From: Thomas Tanghus Date: Mon, 15 Apr 2013 20:10:29 +0000 (+0200) Subject: Updated docs. X-Git-Tag: v6.0.0alpha2~905^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=155582ab70b0a469f1d0a7159a16334283f91bbc;p=nextcloud-server.git Updated docs. --- diff --git a/core/js/octemplate.js b/core/js/octemplate.js index f25f70eb375..a5d56852a57 100644 --- a/core/js/octemplate.js +++ b/core/js/octemplate.js @@ -5,12 +5,17 @@ * * Usage examples: * - * var str = 'Bake, uncovered, until the {greasystuff} is melted and the {pasta} is heated through, about {min} minutes.' - * $(str).octemplate({greasystuff: 'cheese', pasta: 'macaroni', min: 10}); + * var htmlStr = '

Bake, uncovered, until the {greasystuff} is melted and the {pasta} is heated through, about {min} minutes.

' + * $(htmlStr).octemplate({greasystuff: 'cheese', pasta: 'macaroni', min: 10}); * * var htmlStr = '

Welcome back {user}

'; * $(htmlStr).octemplate({user: 'John Q. Public'}, {escapeFunction: null}); * + * Be aware that the target string must be wrapped in an HTML element for the plugin to work. The following won't work: + * + * var textStr = 'Welcome back {user}'; + * $(textStr).octemplate({user: 'John Q. Public'}); + * * For anything larger than one-liners, you can use a simple $.get() ajax request to get the template, * or you can embed them it the page using the text/template type: *