View | Details | Raw Unified | Return to bug 8283
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/js/pages/batchMod.js (-23 / +12 lines)
Lines 5-17 Link Here
5
5
6
6
7
function hideColumns(){
7
function hideColumns(){
8
  valCookie = YAHOO.util.Cookie.get("showColumns", function(stringValue){
8
  valCookie = $.cookie("showColumns");
9
    return stringValue.split("/");
10
  });
11
  if(valCookie){
9
  if(valCookie){
10
    valCookie = valCookie.split("/");
12
    $("#showall").removeAttr("checked").parent().removeClass("selected");
11
    $("#showall").removeAttr("checked").parent().removeClass("selected");
13
    for( i=0; i<valCookie.length; i++ ){
12
    for( i=0; i<valCookie.length; i++ ){
14
      if(valCookie[i] != ''){
13
      if(valCookie[i] !== ''){
15
        index = valCookie[i] - 2;
14
        index = valCookie[i] - 2;
16
        $("#itemst td:nth-child("+valCookie[i]+"),#itemst th:nth-child("+valCookie[i]+")").toggle();
15
        $("#itemst td:nth-child("+valCookie[i]+"),#itemst th:nth-child("+valCookie[i]+")").toggle();
17
        $("#checkheader"+index).removeAttr("checked").parent().removeClass("selected");
16
        $("#checkheader"+index).removeAttr("checked").parent().removeClass("selected");
Lines 22-30 function hideColumns(){ Link Here
22
21
23
function hideColumn(num) {
22
function hideColumn(num) {
24
  $("#hideall,#showall").removeAttr("checked").parent().removeClass("selected");
23
  $("#hideall,#showall").removeAttr("checked").parent().removeClass("selected");
25
  valCookie = YAHOO.util.Cookie.get("showColumns", function(stringValue){
24
  valCookie = $.cookie("showColumns");
26
    return stringValue.split("/");
27
  });
28
  // set the index of the table column to hide
25
  // set the index of the table column to hide
29
  $("#"+num).parent().removeClass("selected");
26
  $("#"+num).parent().removeClass("selected");
30
  var hide = Number(num.replace("checkheader","")) + 2;
27
  var hide = Number(num.replace("checkheader","")) + 2;
Lines 32-37 function hideColumn(num) { Link Here
32
  $("#itemst td:nth-child("+hide+"),#itemst th:nth-child("+hide+")").toggle();
29
  $("#itemst td:nth-child("+hide+"),#itemst th:nth-child("+hide+")").toggle();
33
  // set or modify cookie with the hidden column's index
30
  // set or modify cookie with the hidden column's index
34
  if(valCookie){
31
  if(valCookie){
32
    valCookie = valCookie.split("/");
35
    var found = false;
33
    var found = false;
36
    for( $i=0; $i<valCookie.length; $i++ ){
34
    for( $i=0; $i<valCookie.length; $i++ ){
37
        if (hide == valCookie[i]) {
35
        if (hide == valCookie[i]) {
Lines 42-55 function hideColumn(num) { Link Here
42
    if( !found ){
40
    if( !found ){
43
        valCookie.push(hide);
41
        valCookie.push(hide);
44
        var cookieString = valCookie.join("/");
42
        var cookieString = valCookie.join("/");
45
        YAHOO.util.Cookie.set("showColumns", cookieString, {
43
        $.cookie("showColumns", cookieString, { expires : date });
46
          expires: date
47
        });
48
    }
44
    }
49
  } else {
45
  } else {
50
        YAHOO.util.Cookie.set("showColumns", hide, {
46
        $.cookie("showColumns", hide, { expires : date });
51
          expires: date
52
        });
53
  }
47
  }
54
}
48
}
55
49
Lines 64-78 Array.prototype.remove = function(from, to) { Link Here
64
function showColumn(num){
58
function showColumn(num){
65
  $("#hideall").removeAttr("checked").parent().removeClass("selected");
59
  $("#hideall").removeAttr("checked").parent().removeClass("selected");
66
  $("#"+num).parent().addClass("selected");
60
  $("#"+num).parent().addClass("selected");
67
  valCookie = YAHOO.util.Cookie.get("showColumns", function(stringValue){
61
  valCookie = $.cookie("showColumns");
68
    return stringValue.split("/");
69
  });
70
  // set the index of the table column to hide
62
  // set the index of the table column to hide
71
  show = Number(num.replace("checkheader","")) + 2;
63
  show = Number(num.replace("checkheader","")) + 2;
72
  // hide header and cells matching the index
64
  // hide header and cells matching the index
73
  $("#itemst td:nth-child("+show+"),#itemst th:nth-child("+show+")").toggle();
65
  $("#itemst td:nth-child("+show+"),#itemst th:nth-child("+show+")").toggle();
74
  // set or modify cookie with the hidden column's index
66
  // set or modify cookie with the hidden column's index
75
  if(valCookie){
67
  if(valCookie){
68
    valCookie = valCookie.split("/");
76
    var found = false;
69
    var found = false;
77
    for( i=0; i<valCookie.length; i++ ){
70
    for( i=0; i<valCookie.length; i++ ){
78
        if (show == valCookie[i]) {
71
        if (show == valCookie[i]) {
Lines 82-90 function showColumn(num){ Link Here
82
    }
75
    }
83
    if( found ){
76
    if( found ){
84
        var cookieString = valCookie.join("/");
77
        var cookieString = valCookie.join("/");
85
        YAHOO.util.Cookie.set("showColumns", cookieString, {
78
        $.cookie("showColumns", cookieString, { expires : date });
86
          expires: date
87
        });
88
    }
79
    }
89
  }
80
  }
90
}
81
}
Lines 92-98 function showAllColumns(){ Link Here
92
    $("#selections").checkCheckboxes();
83
    $("#selections").checkCheckboxes();
93
    $("#selections span").addClass("selected");
84
    $("#selections span").addClass("selected");
94
    $("#itemst td:nth-child(2),#itemst tr th:nth-child(2)").nextAll().show();
85
    $("#itemst td:nth-child(2),#itemst tr th:nth-child(2)").nextAll().show();
95
    YAHOO.util.Cookie.remove("showColumns");
86
    $.cookie("showColumns",null);
96
    $("#hideall").removeAttr("checked").parent().removeClass("selected");
87
    $("#hideall").removeAttr("checked").parent().removeClass("selected");
97
}
88
}
98
function hideAllColumns(){
89
function hideAllColumns(){
Lines 101-109 function hideAllColumns(){ Link Here
101
    $("#itemst td:nth-child(2),#itemst th:nth-child(2)").nextAll().hide();
92
    $("#itemst td:nth-child(2),#itemst th:nth-child(2)").nextAll().hide();
102
    $("#hideall").attr("checked","checked").parent().addClass("selected");
93
    $("#hideall").attr("checked","checked").parent().addClass("selected");
103
    var cookieString = allColumns.join("/");
94
    var cookieString = allColumns.join("/");
104
    YAHOO.util.Cookie.set("showColumns", cookieString, {
95
    $.cookie("showColumns", cookieString, { expires : date });
105
      expires: date
106
    });
107
}
96
}
108
97
109
  $(document).ready(function() {
98
  $(document).ready(function() {
(-)a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/cookie/cookie-debug.js (-482 lines)
Lines 1-482 Link Here
1
/*
2
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
3
Code licensed under the BSD License:
4
http://developer.yahoo.net/yui/license.txt
5
version: 2.8.0r4
6
*/
7
/**
8
 * Utilities for cookie management
9
 * @namespace YAHOO.util
10
 * @module cookie
11
 */
12
YAHOO.namespace("util");
13
14
/**
15
 * Cookie utility.
16
 * @class Cookie
17
 * @static
18
 */
19
YAHOO.util.Cookie = {
20
    
21
    //-------------------------------------------------------------------------
22
    // Private Methods
23
    //-------------------------------------------------------------------------
24
    
25
    /**
26
     * Creates a cookie string that can be assigned into document.cookie.
27
     * @param {String} name The name of the cookie.
28
     * @param {String} value The value of the cookie.
29
     * @param {Boolean} encodeValue True to encode the value, false to leave as-is.
30
     * @param {Object} options (Optional) Options for the cookie.
31
     * @return {String} The formatted cookie string.
32
     * @method _createCookieString
33
     * @private
34
     * @static
35
     */
36
    _createCookieString : function (name /*:String*/, value /*:Variant*/, encodeValue /*:Boolean*/, options /*:Object*/) /*:String*/ {
37
        
38
        //shortcut
39
        var lang = YAHOO.lang,
40
            text = encodeURIComponent(name) + "=" + (encodeValue ? encodeURIComponent(value) : value);
41
        
42
        
43
        if (lang.isObject(options)){
44
            //expiration date
45
            if (options.expires instanceof Date){
46
                text += "; expires=" + options.expires.toUTCString();
47
            }
48
            
49
            //path
50
            if (lang.isString(options.path) && options.path !== ""){
51
                text += "; path=" + options.path;
52
            }
53
            
54
            //domain
55
            if (lang.isString(options.domain) && options.domain !== ""){
56
                text += "; domain=" + options.domain;
57
            }
58
            
59
            //secure
60
            if (options.secure === true){
61
                text += "; secure";
62
            }
63
        }
64
        
65
        return text;
66
    },
67
    
68
    /**
69
     * Formats a cookie value for an object containing multiple values.
70
     * @param {Object} hash An object of key-value pairs to create a string for.
71
     * @return {String} A string suitable for use as a cookie value.
72
     * @method _createCookieHashString
73
     * @private
74
     * @static
75
     */
76
    _createCookieHashString : function (hash /*:Object*/) /*:String*/ {
77
        
78
        //shortcuts
79
        var lang = YAHOO.lang;
80
        
81
        if (!lang.isObject(hash)){
82
            throw new TypeError("Cookie._createCookieHashString(): Argument must be an object.");
83
        }
84
        
85
        var text /*:Array*/ = [];
86
        
87
        for (var key in hash){
88
            if (lang.hasOwnProperty(hash, key) && !lang.isFunction(hash[key]) && !lang.isUndefined(hash[key])){
89
                text.push(encodeURIComponent(key) + "=" + encodeURIComponent(String(hash[key])));
90
            }
91
        }
92
        
93
        return text.join("&");
94
    },
95
    
96
    /**
97
     * Parses a cookie hash string into an object.
98
     * @param {String} text The cookie hash string to parse. The string should already be URL-decoded.
99
     * @return {Object} An object containing entries for each cookie value.
100
     * @method _parseCookieHash
101
     * @private
102
     * @static
103
     */
104
    _parseCookieHash : function (text /*:String*/) /*:Object*/ {
105
        
106
        var hashParts /*:Array*/ = text.split("&"),
107
            hashPart /*:Array*/ = null,
108
            hash /*:Object*/ = {};
109
        
110
        if (text.length > 0){
111
            for (var i=0, len=hashParts.length; i < len; i++){
112
                hashPart = hashParts[i].split("=");
113
                hash[decodeURIComponent(hashPart[0])] = decodeURIComponent(hashPart[1]);
114
            }
115
        }
116
        
117
        return hash;
118
    },
119
    
120
    /**
121
     * Parses a cookie string into an object representing all accessible cookies.
122
     * @param {String} text The cookie string to parse.
123
     * @param {Boolean} decode (Optional) Indicates if the cookie values should be decoded or not. Default is true.
124
     * @return {Object} An object containing entries for each accessible cookie.
125
     * @method _parseCookieString
126
     * @private
127
     * @static
128
     */
129
    _parseCookieString : function (text /*:String*/, decode /*:Boolean*/) /*:Object*/ {
130
        
131
        var cookies /*:Object*/ = {};
132
        
133
        if (YAHOO.lang.isString(text) && text.length > 0) {
134
            
135
            var decodeValue = (decode === false ? function(s){return s;} : decodeURIComponent);
136
            
137
            //if (/[^=]+=[^=;]?(?:; [^=]+=[^=]?)?/.test(text)){
138
                var cookieParts /*:Array*/ = text.split(/;\s/g),
139
                    cookieName /*:String*/ = null,
140
                    cookieValue /*:String*/ = null,
141
                    cookieNameValue /*:Array*/ = null;
142
                
143
                for (var i=0, len=cookieParts.length; i < len; i++){
144
                    
145
                    //check for normally-formatted cookie (name-value)
146
                    cookieNameValue = cookieParts[i].match(/([^=]+)=/i);
147
                    if (cookieNameValue instanceof Array){
148
                        try {
149
                            cookieName = decodeURIComponent(cookieNameValue[1]);
150
                            cookieValue = decodeValue(cookieParts[i].substring(cookieNameValue[1].length+1));
151
                        } catch (ex){
152
                            //ignore the entire cookie - encoding is likely invalid
153
                        }
154
                    } else {
155
                        //means the cookie does not have an "=", so treat it as a boolean flag
156
                        cookieName = decodeURIComponent(cookieParts[i]);
157
                        cookieValue = "";
158
                    }
159
                    cookies[cookieName] = cookieValue;
160
                }
161
            //}
162
        }
163
        
164
        return cookies;
165
    },
166
    
167
    //-------------------------------------------------------------------------
168
    // Public Methods
169
    //-------------------------------------------------------------------------
170
    
171
    /**
172
     * Determines if the cookie with the given name exists. This is useful for
173
     * Boolean cookies (those that do not follow the name=value convention).
174
     * @param {String} name The name of the cookie to check.
175
     * @return {Boolean} True if the cookie exists, false if not.
176
     * @method exists
177
     * @static
178
     */
179
    exists: function(name) {
180
181
        if (!YAHOO.lang.isString(name) || name === ""){
182
            throw new TypeError("Cookie.exists(): Cookie name must be a non-empty string.");
183
        }
184
185
        var cookies /*:Object*/ = this._parseCookieString(document.cookie, true);
186
        
187
        return cookies.hasOwnProperty(name);
188
    },
189
    
190
    /**
191
     * Returns the cookie value for the given name.
192
     * @param {String} name The name of the cookie to retrieve.
193
     * @param {Object|Function} options (Optional) An object containing one or more
194
     *      cookie options: raw (true/false) and converter (a function).
195
     *      The converter function is run on the value before returning it. The
196
     *      function is not used if the cookie doesn't exist. The function can be
197
     *      passed instead of the options object for backwards compatibility.
198
     * @return {Variant} If no converter is specified, returns a string or null if
199
     *      the cookie doesn't exist. If the converter is specified, returns the value
200
     *      returned from the converter or null if the cookie doesn't exist.
201
     * @method get
202
     * @static
203
     */
204
    get : function (name /*:String*/, options /*:Variant*/) /*:Variant*/{
205
        
206
        var lang = YAHOO.lang,
207
            converter;
208
        
209
        if (lang.isFunction(options)) {
210
            converter = options;
211
            options = {};
212
        } else if (lang.isObject(options)) {
213
            converter = options.converter;
214
        } else {
215
            options = {};
216
        }
217
        
218
        var cookies /*:Object*/ = this._parseCookieString(document.cookie, !options.raw);
219
        
220
        if (!lang.isString(name) || name === ""){
221
            throw new TypeError("Cookie.get(): Cookie name must be a non-empty string.");
222
        }
223
        
224
        if (lang.isUndefined(cookies[name])) {
225
            return null;
226
        }
227
        
228
        if (!lang.isFunction(converter)){
229
            return cookies[name];
230
        } else {
231
            return converter(cookies[name]);
232
        }
233
    },
234
    
235
    /**
236
     * Returns the value of a subcookie.
237
     * @param {String} name The name of the cookie to retrieve.
238
     * @param {String} subName The name of the subcookie to retrieve.
239
     * @param {Function} converter (Optional) A function to run on the value before returning
240
     *      it. The function is not used if the cookie doesn't exist.
241
     * @return {Variant} If the cookie doesn't exist, null is returned. If the subcookie
242
     *      doesn't exist, null if also returned. If no converter is specified and the
243
     *      subcookie exists, a string is returned. If a converter is specified and the
244
     *      subcookie exists, the value returned from the converter is returned.
245
     * @method getSub
246
     * @static
247
     */
248
    getSub : function (name, subName, converter) {
249
        
250
        var lang = YAHOO.lang,
251
            hash = this.getSubs(name);
252
        
253
        if (hash !== null) {
254
            
255
            if (!lang.isString(subName) || subName === ""){
256
                throw new TypeError("Cookie.getSub(): Subcookie name must be a non-empty string.");
257
            }
258
            
259
            if (lang.isUndefined(hash[subName])){
260
                return null;
261
            }
262
            
263
            if (!lang.isFunction(converter)){
264
                return hash[subName];
265
            } else {
266
                return converter(hash[subName]);
267
            }
268
        } else {
269
            return null;
270
        }
271
    
272
    },
273
    
274
    /**
275
     * Returns an object containing name-value pairs stored in the cookie with the given name.
276
     * @param {String} name The name of the cookie to retrieve.
277
     * @return {Object} An object of name-value pairs if the cookie with the given name
278
     *      exists, null if it does not.
279
     * @method getSubs
280
     * @static
281
     */
282
    getSubs : function (name /*:String*/) /*:Object*/ {
283
    
284
        var isString = YAHOO.lang.isString;
285
        
286
        //check cookie name
287
        if (!isString(name) || name === ""){
288
            throw new TypeError("Cookie.getSubs(): Cookie name must be a non-empty string.");
289
        }
290
        
291
        var cookies = this._parseCookieString(document.cookie, false);
292
        if (isString(cookies[name])){
293
            return this._parseCookieHash(cookies[name]);
294
        }
295
        return null;
296
    },
297
    
298
    /**
299
     * Removes a cookie from the machine by setting its expiration date to
300
     * sometime in the past.
301
     * @param {String} name The name of the cookie to remove.
302
     * @param {Object} options (Optional) An object containing one or more
303
     *      cookie options: path (a string), domain (a string),
304
     *      and secure (true/false). The expires option will be overwritten
305
     *      by the method.
306
     * @return {String} The created cookie string.
307
     * @method remove
308
     * @static
309
     */
310
    remove : function (name /*:String*/, options /*:Object*/) /*:String*/ {
311
        
312
        //check cookie name
313
        if (!YAHOO.lang.isString(name) || name === ""){
314
            throw new TypeError("Cookie.remove(): Cookie name must be a non-empty string.");
315
        }
316
        
317
        //set options - clone options so the original isn't affected
318
        options = YAHOO.lang.merge(options || {}, {
319
            expires: new Date(0)
320
        });
321
        
322
        //set cookie
323
        return this.set(name, "", options);
324
    },
325
    
326
    /**
327
     * Removes a subcookie with a given name. Removing the last subcookie
328
     *      won't remove the entire cookie unless options.removeIfEmpty is true.
329
     * @param {String} name The name of the cookie in which the subcookie exists.
330
     * @param {String} subName The name of the subcookie to remove.
331
     * @param {Object} options (Optional) An object containing one or more
332
     *      cookie options: path (a string), domain (a string), expires (a Date object),
333
     *      removeIfEmpty (true/false), and secure (true/false). This must be the same
334
     *      settings as the original subcookie.
335
     * @return {String} The created cookie string.
336
     * @method removeSub
337
     * @static
338
     */
339
    removeSub : function(name /*:String*/, subName /*:String*/, options /*:Object*/) /*:String*/ {
340
        
341
        var lang = YAHOO.lang;
342
        
343
        options = options || {};
344
        
345
        //check cookie name
346
        if (!lang.isString(name) || name === ""){
347
            throw new TypeError("Cookie.removeSub(): Cookie name must be a non-empty string.");
348
        }
349
        
350
        //check subcookie name
351
        if (!lang.isString(subName) || subName === ""){
352
            throw new TypeError("Cookie.removeSub(): Subcookie name must be a non-empty string.");
353
        }
354
        
355
        //get all subcookies for this cookie
356
        var subs = this.getSubs(name);
357
        
358
        //delete the indicated subcookie
359
        if (lang.isObject(subs) && lang.hasOwnProperty(subs, subName)){
360
            delete subs[subName];
361
362
            if (!options.removeIfEmpty) {
363
                //reset the cookie
364
365
                return this.setSubs(name, subs, options);
366
            } else {
367
                //reset the cookie if there are subcookies left, else remove
368
                for (var key in subs){
369
                    if (lang.hasOwnProperty(subs, key) && !lang.isFunction(subs[key]) && !lang.isUndefined(subs[key])){
370
                        return this.setSubs(name, subs, options);
371
                    }
372
                }
373
                
374
                return this.remove(name, options);
375
            }
376
        } else {
377
            return "";
378
        }
379
        
380
    },
381
    
382
    /**
383
     * Sets a cookie with a given name and value.
384
     * @param {String} name The name of the cookie to set.
385
     * @param {Variant} value The value to set for the cookie.
386
     * @param {Object} options (Optional) An object containing one or more
387
     *      cookie options: path (a string), domain (a string), expires (a Date object),
388
     *      raw (true/false), and secure (true/false).
389
     * @return {String} The created cookie string.
390
     * @method set
391
     * @static
392
     */
393
    set : function (name /*:String*/, value /*:Variant*/, options /*:Object*/) /*:String*/ {
394
        
395
        var lang = YAHOO.lang;
396
        
397
        options = options || {};
398
        
399
        if (!lang.isString(name)){
400
            throw new TypeError("Cookie.set(): Cookie name must be a string.");
401
        }
402
        
403
        if (lang.isUndefined(value)){
404
            throw new TypeError("Cookie.set(): Value cannot be undefined.");
405
        }
406
        
407
        var text /*:String*/ = this._createCookieString(name, value, !options.raw, options);
408
        document.cookie = text;
409
        return text;
410
    },
411
    
412
    /**
413
     * Sets a sub cookie with a given name to a particular value.
414
     * @param {String} name The name of the cookie to set.
415
     * @param {String} subName The name of the subcookie to set.
416
     * @param {Variant} value The value to set.
417
     * @param {Object} options (Optional) An object containing one or more
418
     *      cookie options: path (a string), domain (a string), expires (a Date object),
419
     *      and secure (true/false).
420
     * @return {String} The created cookie string.
421
     * @method setSub
422
     * @static
423
     */
424
    setSub : function (name /*:String*/, subName /*:String*/, value /*:Variant*/, options /*:Object*/) /*:String*/ {
425
        
426
        var lang = YAHOO.lang;
427
        
428
        if (!lang.isString(name) || name === ""){
429
            throw new TypeError("Cookie.setSub(): Cookie name must be a non-empty string.");
430
        }
431
        
432
        if (!lang.isString(subName) || subName === ""){
433
            throw new TypeError("Cookie.setSub(): Subcookie name must be a non-empty string.");
434
        }
435
        
436
        if (lang.isUndefined(value)){
437
            throw new TypeError("Cookie.setSub(): Subcookie value cannot be undefined.");
438
        }
439
        
440
        var hash /*:Object*/ = this.getSubs(name);
441
        
442
        if (!lang.isObject(hash)){
443
            hash = {};
444
        }
445
        
446
        hash[subName] = value;
447
        
448
        return this.setSubs(name, hash, options);
449
        
450
    },
451
    
452
    /**
453
     * Sets a cookie with a given name to contain a hash of name-value pairs.
454
     * @param {String} name The name of the cookie to set.
455
     * @param {Object} value An object containing name-value pairs.
456
     * @param {Object} options (Optional) An object containing one or more
457
     *      cookie options: path (a string), domain (a string), expires (a Date object),
458
     *      and secure (true/false).
459
     * @return {String} The created cookie string.
460
     * @method setSubs
461
     * @static
462
     */
463
    setSubs : function (name /*:String*/, value /*:Object*/, options /*:Object*/) /*:String*/ {
464
        
465
        var lang = YAHOO.lang;
466
        
467
        if (!lang.isString(name)){
468
            throw new TypeError("Cookie.setSubs(): Cookie name must be a string.");
469
        }
470
        
471
        if (!lang.isObject(value)){
472
            throw new TypeError("Cookie.setSubs(): Cookie value must be an object.");
473
        }
474
        
475
        var text /*:String*/ = this._createCookieString(name, this._createCookieHashString(value), false, options);
476
        document.cookie = text;
477
        return text;
478
    }
479
480
};
481
482
YAHOO.register("cookie", YAHOO.util.Cookie, {version: "2.8.0r4", build: "2449"});
(-)a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/cookie/cookie-min.js (-7 lines)
Lines 1-7 Link Here
1
/*
2
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
3
Code licensed under the BSD License:
4
http://developer.yahoo.net/yui/license.txt
5
version: 2.8.0r4
6
*/
7
YAHOO.namespace("util");YAHOO.util.Cookie={_createCookieString:function(B,D,C,A){var F=YAHOO.lang,E=encodeURIComponent(B)+"="+(C?encodeURIComponent(D):D);if(F.isObject(A)){if(A.expires instanceof Date){E+="; expires="+A.expires.toUTCString();}if(F.isString(A.path)&&A.path!==""){E+="; path="+A.path;}if(F.isString(A.domain)&&A.domain!==""){E+="; domain="+A.domain;}if(A.secure===true){E+="; secure";}}return E;},_createCookieHashString:function(B){var D=YAHOO.lang;if(!D.isObject(B)){throw new TypeError("Cookie._createCookieHashString(): Argument must be an object.");}var C=[];for(var A in B){if(D.hasOwnProperty(B,A)&&!D.isFunction(B[A])&&!D.isUndefined(B[A])){C.push(encodeURIComponent(A)+"="+encodeURIComponent(String(B[A])));}}return C.join("&");},_parseCookieHash:function(E){var D=E.split("&"),F=null,C={};if(E.length>0){for(var B=0,A=D.length;B<A;B++){F=D[B].split("=");C[decodeURIComponent(F[0])]=decodeURIComponent(F[1]);}}return C;},_parseCookieString:function(J,A){var K={};if(YAHOO.lang.isString(J)&&J.length>0){var B=(A===false?function(L){return L;}:decodeURIComponent);var H=J.split(/;\s/g),I=null,C=null,E=null;for(var D=0,F=H.length;D<F;D++){E=H[D].match(/([^=]+)=/i);if(E instanceof Array){try{I=decodeURIComponent(E[1]);C=B(H[D].substring(E[1].length+1));}catch(G){}}else{I=decodeURIComponent(H[D]);C="";}K[I]=C;}}return K;},exists:function(A){if(!YAHOO.lang.isString(A)||A===""){throw new TypeError("Cookie.exists(): Cookie name must be a non-empty string.");}var B=this._parseCookieString(document.cookie,true);return B.hasOwnProperty(A);},get:function(B,A){var E=YAHOO.lang,C;if(E.isFunction(A)){C=A;A={};}else{if(E.isObject(A)){C=A.converter;}else{A={};}}var D=this._parseCookieString(document.cookie,!A.raw);if(!E.isString(B)||B===""){throw new TypeError("Cookie.get(): Cookie name must be a non-empty string.");}if(E.isUndefined(D[B])){return null;}if(!E.isFunction(C)){return D[B];}else{return C(D[B]);}},getSub:function(A,C,B){var E=YAHOO.lang,D=this.getSubs(A);if(D!==null){if(!E.isString(C)||C===""){throw new TypeError("Cookie.getSub(): Subcookie name must be a non-empty string.");}if(E.isUndefined(D[C])){return null;}if(!E.isFunction(B)){return D[C];}else{return B(D[C]);}}else{return null;}},getSubs:function(B){var A=YAHOO.lang.isString;if(!A(B)||B===""){throw new TypeError("Cookie.getSubs(): Cookie name must be a non-empty string.");}var C=this._parseCookieString(document.cookie,false);if(A(C[B])){return this._parseCookieHash(C[B]);}return null;},remove:function(B,A){if(!YAHOO.lang.isString(B)||B===""){throw new TypeError("Cookie.remove(): Cookie name must be a non-empty string.");}A=YAHOO.lang.merge(A||{},{expires:new Date(0)});return this.set(B,"",A);},removeSub:function(B,E,A){var F=YAHOO.lang;A=A||{};if(!F.isString(B)||B===""){throw new TypeError("Cookie.removeSub(): Cookie name must be a non-empty string.");}if(!F.isString(E)||E===""){throw new TypeError("Cookie.removeSub(): Subcookie name must be a non-empty string.");}var D=this.getSubs(B);if(F.isObject(D)&&F.hasOwnProperty(D,E)){delete D[E];if(!A.removeIfEmpty){return this.setSubs(B,D,A);}else{for(var C in D){if(F.hasOwnProperty(D,C)&&!F.isFunction(D[C])&&!F.isUndefined(D[C])){return this.setSubs(B,D,A);}}return this.remove(B,A);}}else{return"";}},set:function(B,C,A){var E=YAHOO.lang;A=A||{};if(!E.isString(B)){throw new TypeError("Cookie.set(): Cookie name must be a string.");}if(E.isUndefined(C)){throw new TypeError("Cookie.set(): Value cannot be undefined.");}var D=this._createCookieString(B,C,!A.raw,A);document.cookie=D;return D;},setSub:function(B,D,C,A){var F=YAHOO.lang;if(!F.isString(B)||B===""){throw new TypeError("Cookie.setSub(): Cookie name must be a non-empty string.");}if(!F.isString(D)||D===""){throw new TypeError("Cookie.setSub(): Subcookie name must be a non-empty string.");}if(F.isUndefined(C)){throw new TypeError("Cookie.setSub(): Subcookie value cannot be undefined.");}var E=this.getSubs(B);if(!F.isObject(E)){E={};}E[D]=C;return this.setSubs(B,E,A);},setSubs:function(B,C,A){var E=YAHOO.lang;if(!E.isString(B)){throw new TypeError("Cookie.setSubs(): Cookie name must be a string.");}if(!E.isObject(C)){throw new TypeError("Cookie.setSubs(): Cookie value must be an object.");}var D=this._createCookieString(B,this._createCookieHashString(C),false,A);document.cookie=D;return D;}};YAHOO.register("cookie",YAHOO.util.Cookie,{version:"2.8.0r4",build:"2449"});
(-)a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/cookie/cookie.js (-482 lines)
Lines 1-482 Link Here
1
/*
2
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
3
Code licensed under the BSD License:
4
http://developer.yahoo.net/yui/license.txt
5
version: 2.8.0r4
6
*/
7
/**
8
 * Utilities for cookie management
9
 * @namespace YAHOO.util
10
 * @module cookie
11
 */
12
YAHOO.namespace("util");
13
14
/**
15
 * Cookie utility.
16
 * @class Cookie
17
 * @static
18
 */
19
YAHOO.util.Cookie = {
20
    
21
    //-------------------------------------------------------------------------
22
    // Private Methods
23
    //-------------------------------------------------------------------------
24
    
25
    /**
26
     * Creates a cookie string that can be assigned into document.cookie.
27
     * @param {String} name The name of the cookie.
28
     * @param {String} value The value of the cookie.
29
     * @param {Boolean} encodeValue True to encode the value, false to leave as-is.
30
     * @param {Object} options (Optional) Options for the cookie.
31
     * @return {String} The formatted cookie string.
32
     * @method _createCookieString
33
     * @private
34
     * @static
35
     */
36
    _createCookieString : function (name /*:String*/, value /*:Variant*/, encodeValue /*:Boolean*/, options /*:Object*/) /*:String*/ {
37
        
38
        //shortcut
39
        var lang = YAHOO.lang,
40
            text = encodeURIComponent(name) + "=" + (encodeValue ? encodeURIComponent(value) : value);
41
        
42
        
43
        if (lang.isObject(options)){
44
            //expiration date
45
            if (options.expires instanceof Date){
46
                text += "; expires=" + options.expires.toUTCString();
47
            }
48
            
49
            //path
50
            if (lang.isString(options.path) && options.path !== ""){
51
                text += "; path=" + options.path;
52
            }
53
            
54
            //domain
55
            if (lang.isString(options.domain) && options.domain !== ""){
56
                text += "; domain=" + options.domain;
57
            }
58
            
59
            //secure
60
            if (options.secure === true){
61
                text += "; secure";
62
            }
63
        }
64
        
65
        return text;
66
    },
67
    
68
    /**
69
     * Formats a cookie value for an object containing multiple values.
70
     * @param {Object} hash An object of key-value pairs to create a string for.
71
     * @return {String} A string suitable for use as a cookie value.
72
     * @method _createCookieHashString
73
     * @private
74
     * @static
75
     */
76
    _createCookieHashString : function (hash /*:Object*/) /*:String*/ {
77
        
78
        //shortcuts
79
        var lang = YAHOO.lang;
80
        
81
        if (!lang.isObject(hash)){
82
            throw new TypeError("Cookie._createCookieHashString(): Argument must be an object.");
83
        }
84
        
85
        var text /*:Array*/ = [];
86
        
87
        for (var key in hash){
88
            if (lang.hasOwnProperty(hash, key) && !lang.isFunction(hash[key]) && !lang.isUndefined(hash[key])){
89
                text.push(encodeURIComponent(key) + "=" + encodeURIComponent(String(hash[key])));
90
            }
91
        }
92
        
93
        return text.join("&");
94
    },
95
    
96
    /**
97
     * Parses a cookie hash string into an object.
98
     * @param {String} text The cookie hash string to parse. The string should already be URL-decoded.
99
     * @return {Object} An object containing entries for each cookie value.
100
     * @method _parseCookieHash
101
     * @private
102
     * @static
103
     */
104
    _parseCookieHash : function (text /*:String*/) /*:Object*/ {
105
        
106
        var hashParts /*:Array*/ = text.split("&"),
107
            hashPart /*:Array*/ = null,
108
            hash /*:Object*/ = {};
109
        
110
        if (text.length > 0){
111
            for (var i=0, len=hashParts.length; i < len; i++){
112
                hashPart = hashParts[i].split("=");
113
                hash[decodeURIComponent(hashPart[0])] = decodeURIComponent(hashPart[1]);
114
            }
115
        }
116
        
117
        return hash;
118
    },
119
    
120
    /**
121
     * Parses a cookie string into an object representing all accessible cookies.
122
     * @param {String} text The cookie string to parse.
123
     * @param {Boolean} decode (Optional) Indicates if the cookie values should be decoded or not. Default is true.
124
     * @return {Object} An object containing entries for each accessible cookie.
125
     * @method _parseCookieString
126
     * @private
127
     * @static
128
     */
129
    _parseCookieString : function (text /*:String*/, decode /*:Boolean*/) /*:Object*/ {
130
        
131
        var cookies /*:Object*/ = {};
132
        
133
        if (YAHOO.lang.isString(text) && text.length > 0) {
134
            
135
            var decodeValue = (decode === false ? function(s){return s;} : decodeURIComponent);
136
            
137
            //if (/[^=]+=[^=;]?(?:; [^=]+=[^=]?)?/.test(text)){
138
                var cookieParts /*:Array*/ = text.split(/;\s/g),
139
                    cookieName /*:String*/ = null,
140
                    cookieValue /*:String*/ = null,
141
                    cookieNameValue /*:Array*/ = null;
142
                
143
                for (var i=0, len=cookieParts.length; i < len; i++){
144
                    
145
                    //check for normally-formatted cookie (name-value)
146
                    cookieNameValue = cookieParts[i].match(/([^=]+)=/i);
147
                    if (cookieNameValue instanceof Array){
148
                        try {
149
                            cookieName = decodeURIComponent(cookieNameValue[1]);
150
                            cookieValue = decodeValue(cookieParts[i].substring(cookieNameValue[1].length+1));
151
                        } catch (ex){
152
                            //ignore the entire cookie - encoding is likely invalid
153
                        }
154
                    } else {
155
                        //means the cookie does not have an "=", so treat it as a boolean flag
156
                        cookieName = decodeURIComponent(cookieParts[i]);
157
                        cookieValue = "";
158
                    }
159
                    cookies[cookieName] = cookieValue;
160
                }
161
            //}
162
        }
163
        
164
        return cookies;
165
    },
166
    
167
    //-------------------------------------------------------------------------
168
    // Public Methods
169
    //-------------------------------------------------------------------------
170
    
171
    /**
172
     * Determines if the cookie with the given name exists. This is useful for
173
     * Boolean cookies (those that do not follow the name=value convention).
174
     * @param {String} name The name of the cookie to check.
175
     * @return {Boolean} True if the cookie exists, false if not.
176
     * @method exists
177
     * @static
178
     */
179
    exists: function(name) {
180
181
        if (!YAHOO.lang.isString(name) || name === ""){
182
            throw new TypeError("Cookie.exists(): Cookie name must be a non-empty string.");
183
        }
184
185
        var cookies /*:Object*/ = this._parseCookieString(document.cookie, true);
186
        
187
        return cookies.hasOwnProperty(name);
188
    },
189
    
190
    /**
191
     * Returns the cookie value for the given name.
192
     * @param {String} name The name of the cookie to retrieve.
193
     * @param {Object|Function} options (Optional) An object containing one or more
194
     *      cookie options: raw (true/false) and converter (a function).
195
     *      The converter function is run on the value before returning it. The
196
     *      function is not used if the cookie doesn't exist. The function can be
197
     *      passed instead of the options object for backwards compatibility.
198
     * @return {Variant} If no converter is specified, returns a string or null if
199
     *      the cookie doesn't exist. If the converter is specified, returns the value
200
     *      returned from the converter or null if the cookie doesn't exist.
201
     * @method get
202
     * @static
203
     */
204
    get : function (name /*:String*/, options /*:Variant*/) /*:Variant*/{
205
        
206
        var lang = YAHOO.lang,
207
            converter;
208
        
209
        if (lang.isFunction(options)) {
210
            converter = options;
211
            options = {};
212
        } else if (lang.isObject(options)) {
213
            converter = options.converter;
214
        } else {
215
            options = {};
216
        }
217
        
218
        var cookies /*:Object*/ = this._parseCookieString(document.cookie, !options.raw);
219
        
220
        if (!lang.isString(name) || name === ""){
221
            throw new TypeError("Cookie.get(): Cookie name must be a non-empty string.");
222
        }
223
        
224
        if (lang.isUndefined(cookies[name])) {
225
            return null;
226
        }
227
        
228
        if (!lang.isFunction(converter)){
229
            return cookies[name];
230
        } else {
231
            return converter(cookies[name]);
232
        }
233
    },
234
    
235
    /**
236
     * Returns the value of a subcookie.
237
     * @param {String} name The name of the cookie to retrieve.
238
     * @param {String} subName The name of the subcookie to retrieve.
239
     * @param {Function} converter (Optional) A function to run on the value before returning
240
     *      it. The function is not used if the cookie doesn't exist.
241
     * @return {Variant} If the cookie doesn't exist, null is returned. If the subcookie
242
     *      doesn't exist, null if also returned. If no converter is specified and the
243
     *      subcookie exists, a string is returned. If a converter is specified and the
244
     *      subcookie exists, the value returned from the converter is returned.
245
     * @method getSub
246
     * @static
247
     */
248
    getSub : function (name, subName, converter) {
249
        
250
        var lang = YAHOO.lang,
251
            hash = this.getSubs(name);
252
        
253
        if (hash !== null) {
254
            
255
            if (!lang.isString(subName) || subName === ""){
256
                throw new TypeError("Cookie.getSub(): Subcookie name must be a non-empty string.");
257
            }
258
            
259
            if (lang.isUndefined(hash[subName])){
260
                return null;
261
            }
262
            
263
            if (!lang.isFunction(converter)){
264
                return hash[subName];
265
            } else {
266
                return converter(hash[subName]);
267
            }
268
        } else {
269
            return null;
270
        }
271
    
272
    },
273
    
274
    /**
275
     * Returns an object containing name-value pairs stored in the cookie with the given name.
276
     * @param {String} name The name of the cookie to retrieve.
277
     * @return {Object} An object of name-value pairs if the cookie with the given name
278
     *      exists, null if it does not.
279
     * @method getSubs
280
     * @static
281
     */
282
    getSubs : function (name /*:String*/) /*:Object*/ {
283
    
284
        var isString = YAHOO.lang.isString;
285
        
286
        //check cookie name
287
        if (!isString(name) || name === ""){
288
            throw new TypeError("Cookie.getSubs(): Cookie name must be a non-empty string.");
289
        }
290
        
291
        var cookies = this._parseCookieString(document.cookie, false);
292
        if (isString(cookies[name])){
293
            return this._parseCookieHash(cookies[name]);
294
        }
295
        return null;
296
    },
297
    
298
    /**
299
     * Removes a cookie from the machine by setting its expiration date to
300
     * sometime in the past.
301
     * @param {String} name The name of the cookie to remove.
302
     * @param {Object} options (Optional) An object containing one or more
303
     *      cookie options: path (a string), domain (a string),
304
     *      and secure (true/false). The expires option will be overwritten
305
     *      by the method.
306
     * @return {String} The created cookie string.
307
     * @method remove
308
     * @static
309
     */
310
    remove : function (name /*:String*/, options /*:Object*/) /*:String*/ {
311
        
312
        //check cookie name
313
        if (!YAHOO.lang.isString(name) || name === ""){
314
            throw new TypeError("Cookie.remove(): Cookie name must be a non-empty string.");
315
        }
316
        
317
        //set options - clone options so the original isn't affected
318
        options = YAHOO.lang.merge(options || {}, {
319
            expires: new Date(0)
320
        });
321
        
322
        //set cookie
323
        return this.set(name, "", options);
324
    },
325
    
326
    /**
327
     * Removes a subcookie with a given name. Removing the last subcookie
328
     *      won't remove the entire cookie unless options.removeIfEmpty is true.
329
     * @param {String} name The name of the cookie in which the subcookie exists.
330
     * @param {String} subName The name of the subcookie to remove.
331
     * @param {Object} options (Optional) An object containing one or more
332
     *      cookie options: path (a string), domain (a string), expires (a Date object),
333
     *      removeIfEmpty (true/false), and secure (true/false). This must be the same
334
     *      settings as the original subcookie.
335
     * @return {String} The created cookie string.
336
     * @method removeSub
337
     * @static
338
     */
339
    removeSub : function(name /*:String*/, subName /*:String*/, options /*:Object*/) /*:String*/ {
340
        
341
        var lang = YAHOO.lang;
342
        
343
        options = options || {};
344
        
345
        //check cookie name
346
        if (!lang.isString(name) || name === ""){
347
            throw new TypeError("Cookie.removeSub(): Cookie name must be a non-empty string.");
348
        }
349
        
350
        //check subcookie name
351
        if (!lang.isString(subName) || subName === ""){
352
            throw new TypeError("Cookie.removeSub(): Subcookie name must be a non-empty string.");
353
        }
354
        
355
        //get all subcookies for this cookie
356
        var subs = this.getSubs(name);
357
        
358
        //delete the indicated subcookie
359
        if (lang.isObject(subs) && lang.hasOwnProperty(subs, subName)){
360
            delete subs[subName];
361
362
            if (!options.removeIfEmpty) {
363
                //reset the cookie
364
365
                return this.setSubs(name, subs, options);
366
            } else {
367
                //reset the cookie if there are subcookies left, else remove
368
                for (var key in subs){
369
                    if (lang.hasOwnProperty(subs, key) && !lang.isFunction(subs[key]) && !lang.isUndefined(subs[key])){
370
                        return this.setSubs(name, subs, options);
371
                    }
372
                }
373
                
374
                return this.remove(name, options);
375
            }
376
        } else {
377
            return "";
378
        }
379
        
380
    },
381
    
382
    /**
383
     * Sets a cookie with a given name and value.
384
     * @param {String} name The name of the cookie to set.
385
     * @param {Variant} value The value to set for the cookie.
386
     * @param {Object} options (Optional) An object containing one or more
387
     *      cookie options: path (a string), domain (a string), expires (a Date object),
388
     *      raw (true/false), and secure (true/false).
389
     * @return {String} The created cookie string.
390
     * @method set
391
     * @static
392
     */
393
    set : function (name /*:String*/, value /*:Variant*/, options /*:Object*/) /*:String*/ {
394
        
395
        var lang = YAHOO.lang;
396
        
397
        options = options || {};
398
        
399
        if (!lang.isString(name)){
400
            throw new TypeError("Cookie.set(): Cookie name must be a string.");
401
        }
402
        
403
        if (lang.isUndefined(value)){
404
            throw new TypeError("Cookie.set(): Value cannot be undefined.");
405
        }
406
        
407
        var text /*:String*/ = this._createCookieString(name, value, !options.raw, options);
408
        document.cookie = text;
409
        return text;
410
    },
411
    
412
    /**
413
     * Sets a sub cookie with a given name to a particular value.
414
     * @param {String} name The name of the cookie to set.
415
     * @param {String} subName The name of the subcookie to set.
416
     * @param {Variant} value The value to set.
417
     * @param {Object} options (Optional) An object containing one or more
418
     *      cookie options: path (a string), domain (a string), expires (a Date object),
419
     *      and secure (true/false).
420
     * @return {String} The created cookie string.
421
     * @method setSub
422
     * @static
423
     */
424
    setSub : function (name /*:String*/, subName /*:String*/, value /*:Variant*/, options /*:Object*/) /*:String*/ {
425
        
426
        var lang = YAHOO.lang;
427
        
428
        if (!lang.isString(name) || name === ""){
429
            throw new TypeError("Cookie.setSub(): Cookie name must be a non-empty string.");
430
        }
431
        
432
        if (!lang.isString(subName) || subName === ""){
433
            throw new TypeError("Cookie.setSub(): Subcookie name must be a non-empty string.");
434
        }
435
        
436
        if (lang.isUndefined(value)){
437
            throw new TypeError("Cookie.setSub(): Subcookie value cannot be undefined.");
438
        }
439
        
440
        var hash /*:Object*/ = this.getSubs(name);
441
        
442
        if (!lang.isObject(hash)){
443
            hash = {};
444
        }
445
        
446
        hash[subName] = value;
447
        
448
        return this.setSubs(name, hash, options);
449
        
450
    },
451
    
452
    /**
453
     * Sets a cookie with a given name to contain a hash of name-value pairs.
454
     * @param {String} name The name of the cookie to set.
455
     * @param {Object} value An object containing name-value pairs.
456
     * @param {Object} options (Optional) An object containing one or more
457
     *      cookie options: path (a string), domain (a string), expires (a Date object),
458
     *      and secure (true/false).
459
     * @return {String} The created cookie string.
460
     * @method setSubs
461
     * @static
462
     */
463
    setSubs : function (name /*:String*/, value /*:Object*/, options /*:Object*/) /*:String*/ {
464
        
465
        var lang = YAHOO.lang;
466
        
467
        if (!lang.isString(name)){
468
            throw new TypeError("Cookie.setSubs(): Cookie name must be a string.");
469
        }
470
        
471
        if (!lang.isObject(value)){
472
            throw new TypeError("Cookie.setSubs(): Cookie value must be an object.");
473
        }
474
        
475
        var text /*:String*/ = this._createCookieString(name, this._createCookieHashString(value), false, options);
476
        document.cookie = text;
477
        return text;
478
    }
479
480
};
481
482
YAHOO.register("cookie", YAHOO.util.Cookie, {version: "2.8.0r4", build: "2449"});
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt (-2 lines)
Lines 4-10 Link Here
4
<script type="text/javascript" src="[% themelang %]/js/background-job-progressbar.js"></script>
4
<script type="text/javascript" src="[% themelang %]/js/background-job-progressbar.js"></script>
5
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/pages/batchMod.css" />
5
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/pages/batchMod.css" />
6
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
6
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
7
<script src="[% themelang %]/lib/yui/cookie/cookie-min.js"></script>
8
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
7
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
9
<script type="text/javascript">
8
<script type="text/javascript">
10
//<![CDATA[
9
//<![CDATA[
Lines 12-18 Link Here
12
// Prepare array of all column headers, incrementing each index by
11
// Prepare array of all column headers, incrementing each index by
13
// two to accomodate control and title columns
12
// two to accomodate control and title columns
14
var allColumns = new Array([% FOREACH item_header_loo IN item_header_loop %]'[% loop.count %]'[% UNLESS ( loop.last ) %],[% END %][% END %]);
13
var allColumns = new Array([% FOREACH item_header_loo IN item_header_loop %]'[% loop.count %]'[% UNLESS ( loop.last ) %],[% END %][% END %]);
15
console.log(allColumns);
16
for( x=0; x<allColumns.length; x++ ){
14
for( x=0; x<allColumns.length; x++ ){
17
  allColumns[x] = Number(allColumns[x]) + 2;
15
  allColumns[x] = Number(allColumns[x]) + 2;
18
}
16
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt (-3 lines)
Lines 4-10 Link Here
4
<script type="text/javascript" src="[% themelang %]/js/background-job-progressbar.js"></script>
4
<script type="text/javascript" src="[% themelang %]/js/background-job-progressbar.js"></script>
5
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/pages/batchMod.css" />
5
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/pages/batchMod.css" />
6
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
6
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
7
<script src="[% themelang %]/lib/yui/cookie/cookie-min.js"></script>
8
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
7
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
9
<script type="text/javascript">
8
<script type="text/javascript">
10
//<![CDATA[
9
//<![CDATA[
Lines 12-18 Link Here
12
// Prepare array of all column headers, incrementing each index by
11
// Prepare array of all column headers, incrementing each index by
13
// two to accomodate control and title columns
12
// two to accomodate control and title columns
14
var allColumns = new Array([% FOREACH item_header_loo IN item_header_loop %]'[% loop.count %]'[% UNLESS ( loop.last ) %],[% END %][% END %]);
13
var allColumns = new Array([% FOREACH item_header_loo IN item_header_loop %]'[% loop.count %]'[% UNLESS ( loop.last ) %],[% END %][% END %]);
15
console.log(allColumns);
16
for( x=0; x<allColumns.length; x++ ){
14
for( x=0; x<allColumns.length; x++ ){
17
  allColumns[x] = Number(allColumns[x]) + 2;
15
  allColumns[x] = Number(allColumns[x]) + 2;
18
}
16
}
19
- 

Return to bug 8283