summaryrefslogtreecommitdiff
path: root/buildscripts/apigen/pradosoft/js/jquery.sprintf.js
diff options
context:
space:
mode:
authorCiro Mattia Gonano <ciromattia@gmail.com>2013-09-11 15:56:48 +0200
committerCiro Mattia Gonano <ciromattia@gmail.com>2013-09-11 15:57:07 +0200
commit3069eaf35e833ffe4a1c1c7829dd7e168ae27420 (patch)
treed0c2e4d934cc34ba7d4232f759923b5a257dcb21 /buildscripts/apigen/pradosoft/js/jquery.sprintf.js
parentb833247ce597ec26159b46c8dfbea7f1e265950b (diff)
Merge up to r3319
Diffstat (limited to 'buildscripts/apigen/pradosoft/js/jquery.sprintf.js')
-rw-r--r--buildscripts/apigen/pradosoft/js/jquery.sprintf.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/buildscripts/apigen/pradosoft/js/jquery.sprintf.js b/buildscripts/apigen/pradosoft/js/jquery.sprintf.js
new file mode 100644
index 00000000..2eed7fdd
--- /dev/null
+++ b/buildscripts/apigen/pradosoft/js/jquery.sprintf.js
@@ -0,0 +1,8 @@
+/*!
+ * sprintf and vsprintf for jQuery
+ * somewhat based on http://jan.moesen.nu/code/javascript/sprintf-and-printf-in-javascript/
+ * Copyright (c) 2008 Sabin Iacob (m0n5t3r) <iacobs@m0n5t3r.info>
+ * @license http://www.gnu.org/licenses/gpl.html
+ * @project jquery.sprintf
+ */
+(function(d){var a={b:function(e){return parseInt(e,10).toString(2)},c:function(e){return String.fromCharCode(parseInt(e,10))},d:function(e){return parseInt(e,10)},u:function(e){return Math.abs(e)},f:function(f,e){e=parseInt(e,10);f=parseFloat(f);if(isNaN(e&&f)){return NaN}return e&&f.toFixed(e)||f},o:function(e){return parseInt(e,10).toString(8)},s:function(e){return e},x:function(e){return(""+parseInt(e,10).toString(16)).toLowerCase()},X:function(e){return(""+parseInt(e,10).toString(16)).toUpperCase()}};var c=/%(?:(\d+)?(?:\.(\d+))?|\(([^)]+)\))([%bcdufosxX])/g;var b=function(f){if(f.length==1&&typeof f[0]=="object"){f=f[0];return function(i,h,k,j,g,m,l){return a[g](f[j])}}else{var e=0;return function(i,h,k,j,g,m,l){if(g=="%"){return"%"}return a[g](f[e++],k)}}};d.extend({sprintf:function(f){var e=Array.apply(null,arguments).slice(1);return f.replace(c,b(e))},vsprintf:function(f,e){return f.replace(c,b(e))}})})(jQuery);