Changeset 27046


Ignore:
Timestamp:
Jan 29, 2014, 10:05:10 PM (10 years ago)
Author:
plg
Message:

bug fixed: (related to jQuery 1.9+) when selecting "a specific user", the list of users isn't shown.

use sprintf function from common.js

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/community/admin_permissions.tpl

    r23085 r27046  
    11{combine_script id='jquery.ui.slider' require='jquery.ui' load='footer' path='themes/default/js/ui/minified/jquery.ui.slider.min.js'}
    22{combine_css path="themes/default/js/ui/theme/jquery.ui.slider.css"}
     3
     4{combine_script id='common' load='footer' path='admin/themes/default/js/common.js'}
    35
    46{literal}
     
    1416
    1517{footer_script}{literal}
    16 function sprintf() {
    17         var i = 0, a, f = arguments[i++], o = [], m, p, c, x, s = '';
    18         while (f) {
    19                 if (m = /^[^\x25]+/.exec(f)) {
    20                         o.push(m[0]);
    21                 }
    22                 else if (m = /^\x25{2}/.exec(f)) {
    23                         o.push('%');
    24                 }
    25                 else if (m = /^\x25(?:(\d+)\$)?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(f)) {
    26                         if (((a = arguments[m[1] || i++]) == null) || (a == undefined)) {
    27                                 throw('Too few arguments.');
    28                         }
    29                         if (/[^s]/.test(m[7]) && (typeof(a) != 'number')) {
    30                                 throw('Expecting number but found ' + typeof(a));
    31                         }
    32                         switch (m[7]) {
    33                                 case 'b': a = a.toString(2); break;
    34                                 case 'c': a = String.fromCharCode(a); break;
    35                                 case 'd': a = parseInt(a); break;
    36                                 case 'e': a = m[6] ? a.toExponential(m[6]) : a.toExponential(); break;
    37                                 case 'f': a = m[6] ? parseFloat(a).toFixed(m[6]) : parseFloat(a); break;
    38                                 case 'o': a = a.toString(8); break;
    39                                 case 's': a = ((a = String(a)) && m[6] ? a.substring(0, m[6]) : a); break;
    40                                 case 'u': a = Math.abs(a); break;
    41                                 case 'x': a = a.toString(16); break;
    42                                 case 'X': a = a.toString(16).toUpperCase(); break;
    43                         }
    44                         a = (/[def]/.test(m[7]) && m[2] && a >= 0 ? '+'+ a : a);
    45                         c = m[3] ? m[3] == '0' ? '0' : m[3].charAt(1) : ' ';
    46                         x = m[5] - String(a).length - s.length;
    47                         p = m[5] ? str_repeat(c, x) : '';
    48                         o.push(s + (m[4] ? a + p : p + a));
    49                 }
    50                 else {
    51                         throw('Huh ?!');
    52                 }
    53                 f = f.substring(m[0].length);
    54         }
    55         return o.join('');
    56 }
    5718
    5819$(document).ready(function() {
    5920  $("select[name=who]").change(function () {
    6021    $("[name^=who_]").hide();
    61     $("[name=who_"+$(this).attr("value")+"]").show();
     22    $("[name=who_"+$(this).prop("value")+"]").show();
    6223    checkWhoOptions();
    6324  });
Note: See TracChangeset for help on using the changeset viewer.