diff options
author | Fabio Comuni <fabrix.xm@gmail.com> | 2011-06-16 14:56:43 +0200 |
---|---|---|
committer | Fabio Comuni <fabrix.xm@gmail.com> | 2011-06-16 14:56:43 +0200 |
commit | ede011cc32b34b9da797813a0a901847d2a68a7a (patch) | |
tree | f7b30ecb8d7df4fb12c5694bfd39792ea5d40499 /include/main.js | |
parent | c94b809634cd92c69be3483c935e6741b7d0c090 (diff) | |
download | volse-hubzilla-ede011cc32b34b9da797813a0a901847d2a68a7a.tar.gz volse-hubzilla-ede011cc32b34b9da797813a0a901847d2a68a7a.tar.bz2 volse-hubzilla-ede011cc32b34b9da797813a0a901847d2a68a7a.zip |
Admin users page. some fix to template processor.
Diffstat (limited to 'include/main.js')
-rw-r--r-- | include/main.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/main.js b/include/main.js index 31b441afb..1a377a1a4 100644 --- a/include/main.js +++ b/include/main.js @@ -307,3 +307,15 @@ }); } +/** + * sprintf in javascript + * "{0} and {1}".format('zero','uno'); + **/ +String.prototype.format = function() { + var formatted = this; + for (var i = 0; i < arguments.length; i++) { + var regexp = new RegExp('\\{'+i+'\\}', 'gi'); + formatted = formatted.replace(regexp, arguments[i]); + } + return formatted; +}; |