diff options
author | mistic100 <mistic@piwigo.org> | 2013-12-24 16:50:35 +0000 |
---|---|---|
committer | mistic100 <mistic@piwigo.org> | 2013-12-24 16:50:35 +0000 |
commit | f51729dfb8a3394be9d72553cdb0cc5dad3e1530 (patch) | |
tree | 1d1da485a7749f011308b1bfadc549e2188ad82b | |
parent | 0b619c37f57ca4518a525efc6e8bd84891ef77bc (diff) |
add missing str_repeat functions in common.js and use it for batch_manager_global.tpl
git-svn-id: http://piwigo.org/svn/trunk@26179 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | admin/themes/default/js/common.js | 5 | ||||
-rw-r--r-- | admin/themes/default/template/batch_manager_global.tpl | 50 |
2 files changed, 8 insertions, 47 deletions
diff --git a/admin/themes/default/js/common.js b/admin/themes/default/js/common.js index d0e460bd8..a017115db 100644 --- a/admin/themes/default/js/common.js +++ b/admin/themes/default/js/common.js @@ -3,6 +3,11 @@ function array_delete(arr, item) { if (i != -1) arr.splice(i, 1); } +function str_repeat(i, m) { + for (var o = []; m > 0; o[--m] = i); + return o.join(''); +} + function sprintf() { var i = 0, a, f = arguments[i++], o = [], m, p, c, x, s = ''; while (f) { diff --git a/admin/themes/default/template/batch_manager_global.tpl b/admin/themes/default/template/batch_manager_global.tpl index f3d6bf314..46e2aa77c 100644 --- a/admin/themes/default/template/batch_manager_global.tpl +++ b/admin/themes/default/template/batch_manager_global.tpl @@ -2,6 +2,8 @@ {include file='include/datepicker.inc.tpl'} {include file='include/colorbox.inc.tpl'} {include file='include/add_album.inc.tpl'} + +{combine_script id='common' load='footer' path='admin/themes/default/js/common.js'} {combine_script id='jquery.ui.slider' require='jquery.ui' load='footer' path='themes/default/js/ui/minified/jquery.ui.slider.min.js'} {combine_css path="themes/default/js/ui/theme/jquery.ui.slider.css"} @@ -48,7 +50,7 @@ jQuery(document).ready(function() { } return true; }); - $(this).click(function(event) {console.log(event.shiftKey);$(this).triggerHandler("shclick",event)}); + $(this).click(function(event) { $(this).triggerHandler("shclick",event)}); }); } $('ul.thumbnails').enableShiftClick(); @@ -118,52 +120,6 @@ var height_str = '{'Height'|@translate}'; var max_width_str = '{'Maximum width'|@translate}'; var max_height_str = '{'Maximum height'|@translate}'; {literal} -function str_repeat(i, m) { - for (var o = []; m > 0; o[--m] = i); - return o.join(''); -} - -function sprintf() { - var i = 0, a, f = arguments[i++], o = [], m, p, c, x, s = ''; - while (f) { - if (m = /^[^\x25]+/.exec(f)) { - o.push(m[0]); - } - else if (m = /^\x25{2}/.exec(f)) { - o.push('%'); - } - else if (m = /^\x25(?:(\d+)\$)?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(f)) { - if (((a = arguments[m[1] || i++]) == null) || (a == undefined)) { - throw('Too few arguments.'); - } - if (/[^s]/.test(m[7]) && (typeof(a) != 'number')) { - throw('Expecting number but found ' + typeof(a)); - } - switch (m[7]) { - case 'b': a = a.toString(2); break; - case 'c': a = String.fromCharCode(a); break; - case 'd': a = parseInt(a); break; - case 'e': a = m[6] ? a.toExponential(m[6]) : a.toExponential(); break; - case 'f': a = m[6] ? parseFloat(a).toFixed(m[6]) : parseFloat(a); break; - case 'o': a = a.toString(8); break; - case 's': a = ((a = String(a)) && m[6] ? a.substring(0, m[6]) : a); break; - case 'u': a = Math.abs(a); break; - case 'x': a = a.toString(16); break; - case 'X': a = a.toString(16).toUpperCase(); break; - } - a = (/[def]/.test(m[7]) && m[2] && a >= 0 ? '+'+ a : a); - c = m[3] ? m[3] == '0' ? '0' : m[3].charAt(1) : ' '; - x = m[5] - String(a).length - s.length; - p = m[5] ? str_repeat(c, x) : ''; - o.push(s + (m[4] ? a + p : p + a)); - } - else { - throw('Huh ?!'); - } - f = f.substring(m[0].length); - } - return o.join(''); -} function progress(success) { jQuery('#progressBar').progressBar(derivatives.done, { |