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

(-)a/koha-tmpl/intranet-tmpl/lib/js-cookie/js.cookie-2.2.1.js (+163 lines)
Line 0 Link Here
1
/*!
2
 * JavaScript Cookie v2.2.1
3
 * https://github.com/js-cookie/js-cookie
4
 *
5
 * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
6
 * Released under the MIT license
7
 */
8
;(function (factory) {
9
	var registeredInModuleLoader;
10
	if (typeof define === 'function' && define.amd) {
11
		define(factory);
12
		registeredInModuleLoader = true;
13
	}
14
	if (typeof exports === 'object') {
15
		module.exports = factory();
16
		registeredInModuleLoader = true;
17
	}
18
	if (!registeredInModuleLoader) {
19
		var OldCookies = window.Cookies;
20
		var api = window.Cookies = factory();
21
		api.noConflict = function () {
22
			window.Cookies = OldCookies;
23
			return api;
24
		};
25
	}
26
}(function () {
27
	function extend () {
28
		var i = 0;
29
		var result = {};
30
		for (; i < arguments.length; i++) {
31
			var attributes = arguments[ i ];
32
			for (var key in attributes) {
33
				result[key] = attributes[key];
34
			}
35
		}
36
		return result;
37
	}
38
39
	function decode (s) {
40
		return s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);
41
	}
42
43
	function init (converter) {
44
		function api() {}
45
46
		function set (key, value, attributes) {
47
			if (typeof document === 'undefined') {
48
				return;
49
			}
50
51
			attributes = extend({
52
				path: '/'
53
			}, api.defaults, attributes);
54
55
			if (typeof attributes.expires === 'number') {
56
				attributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5);
57
			}
58
59
			// We're using "expires" because "max-age" is not supported by IE
60
			attributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';
61
62
			try {
63
				var result = JSON.stringify(value);
64
				if (/^[\{\[]/.test(result)) {
65
					value = result;
66
				}
67
			} catch (e) {}
68
69
			value = converter.write ?
70
				converter.write(value, key) :
71
				encodeURIComponent(String(value))
72
					.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);
73
74
			key = encodeURIComponent(String(key))
75
				.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent)
76
				.replace(/[\(\)]/g, escape);
77
78
			var stringifiedAttributes = '';
79
			for (var attributeName in attributes) {
80
				if (!attributes[attributeName]) {
81
					continue;
82
				}
83
				stringifiedAttributes += '; ' + attributeName;
84
				if (attributes[attributeName] === true) {
85
					continue;
86
				}
87
88
				// Considers RFC 6265 section 5.2:
89
				// ...
90
				// 3.  If the remaining unparsed-attributes contains a %x3B (";")
91
				//     character:
92
				// Consume the characters of the unparsed-attributes up to,
93
				// not including, the first %x3B (";") character.
94
				// ...
95
				stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];
96
			}
97
98
			return (document.cookie = key + '=' + value + stringifiedAttributes);
99
		}
100
101
		function get (key, json) {
102
			if (typeof document === 'undefined') {
103
				return;
104
			}
105
106
			var jar = {};
107
			// To prevent the for loop in the first place assign an empty array
108
			// in case there are no cookies at all.
109
			var cookies = document.cookie ? document.cookie.split('; ') : [];
110
			var i = 0;
111
112
			for (; i < cookies.length; i++) {
113
				var parts = cookies[i].split('=');
114
				var cookie = parts.slice(1).join('=');
115
116
				if (!json && cookie.charAt(0) === '"') {
117
					cookie = cookie.slice(1, -1);
118
				}
119
120
				try {
121
					var name = decode(parts[0]);
122
					cookie = (converter.read || converter)(cookie, name) ||
123
						decode(cookie);
124
125
					if (json) {
126
						try {
127
							cookie = JSON.parse(cookie);
128
						} catch (e) {}
129
					}
130
131
					jar[name] = cookie;
132
133
					if (key === name) {
134
						break;
135
					}
136
				} catch (e) {}
137
			}
138
139
			return key ? jar[key] : jar;
140
		}
141
142
		api.set = set;
143
		api.get = function (key) {
144
			return get(key, false /* read as raw */);
145
		};
146
		api.getJSON = function (key) {
147
			return get(key, true /* read as json */);
148
		};
149
		api.remove = function (key, attributes) {
150
			set(key, '', extend(attributes, {
151
				expires: -1
152
			}));
153
		};
154
155
		api.defaults = {};
156
157
		api.withConverter = init;
158
159
		return api;
160
	}
161
162
	return init(function () {});
163
}));
(-)a/koha-tmpl/intranet-tmpl/lib/js-cookie/js.cookie-2.2.1.min.js (+3 lines)
Line 0 Link Here
1
/*! js-cookie v2.2.1 | MIT */
2
3
!function(a){var b;if("function"==typeof define&&define.amd&&(define(a),b=!0),"object"==typeof exports&&(module.exports=a(),b=!0),!b){var c=window.Cookies,d=window.Cookies=a();d.noConflict=function(){return window.Cookies=c,d}}}(function(){function a(){for(var a=0,b={};a<arguments.length;a++){var c=arguments[a];for(var d in c)b[d]=c[d]}return b}function b(a){return a.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}function c(d){function e(){}function f(b,c,f){if("undefined"!=typeof document){f=a({path:"/"},e.defaults,f),"number"==typeof f.expires&&(f.expires=new Date(1*new Date+864e5*f.expires)),f.expires=f.expires?f.expires.toUTCString():"";try{var g=JSON.stringify(c);/^[\{\[]/.test(g)&&(c=g)}catch(j){}c=d.write?d.write(c,b):encodeURIComponent(c+"").replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),b=encodeURIComponent(b+"").replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var h="";for(var i in f)f[i]&&(h+="; "+i,!0!==f[i]&&(h+="="+f[i].split(";")[0]));return document.cookie=b+"="+c+h}}function g(a,c){if("undefined"!=typeof document){for(var e={},f=document.cookie?document.cookie.split("; "):[],g=0;g<f.length;g++){var h=f[g].split("="),i=h.slice(1).join("=");c||'"'!==i.charAt(0)||(i=i.slice(1,-1));try{var j=b(h[0]);if(i=(d.read||d)(i,j)||b(i),c)try{i=JSON.parse(i)}catch(k){}if(e[j]=i,a===j)break}catch(k){}}return a?e[a]:e}}return e.set=f,e.get=function(a){return g(a,!1)},e.getJSON=function(a){return g(a,!0)},e.remove=function(b,c){f(b,"",a(c,{expires:-1}))},e.defaults={},e.withConverter=c,e}return c(function(){})});
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc (+1 lines)
Lines 19-24 Link Here
19
[% Asset.js("lib/jquery/jquery-ui-1.11.4.min.js") | $raw %]
19
[% Asset.js("lib/jquery/jquery-ui-1.11.4.min.js") | $raw %]
20
[% Asset.js("lib/shortcut/shortcut.js") | $raw %]
20
[% Asset.js("lib/shortcut/shortcut.js") | $raw %]
21
[% Asset.js("lib/jquery/plugins/jquery.cookie.min.js") | $raw %]
21
[% Asset.js("lib/jquery/plugins/jquery.cookie.min.js") | $raw %]
22
[% Asset.js("lib/js-cookie/js.cookie-2.2.1.min.js") | $raw %]
22
[% Asset.js("lib/jquery/plugins/jquery.highlight-3.js") | $raw %]
23
[% Asset.js("lib/jquery/plugins/jquery.highlight-3.js") | $raw %]
23
[% Asset.js("lib/bootstrap/bootstrap.min.js") | $raw %]
24
[% Asset.js("lib/bootstrap/bootstrap.min.js") | $raw %]
24
[% Asset.js("lib/jquery/plugins/jquery.validate.min.js") | $raw %]
25
[% Asset.js("lib/jquery/plugins/jquery.validate.min.js") | $raw %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt (-1 / +6 lines)
Lines 710-715 Link Here
710
710
711
            <h2>Verovio</h2>
711
            <h2>Verovio</h2>
712
            <p><a href="https://www.verovio.org/index.xhtml">Verovio is developed by the Swiss RISM Office with the support of the Swiss National Science Foundation, licensed under the <a href="http://www.gnu.org/licenses/lgpl-3.0.html">LGPL v3.0</a>.</p>
712
            <p><a href="https://www.verovio.org/index.xhtml">Verovio is developed by the Swiss RISM Office with the support of the Swiss National Science Foundation, licensed under the <a href="http://www.gnu.org/licenses/lgpl-3.0.html">LGPL v3.0</a>.</p>
713
714
            <h2>jquery.cookie</h2>
715
            <p><a href="https://github.com/carhartl/jquery-cookie">jquery.cookie</a> by Klaus Hartl is a jQuery plugin for setting, reading, and deleting browser cookies, licensed under the <a href="https://github.com/carhartl/jquery-cookie/blob/master/MIT-LICENSE.txt">MIT license</a>.</p>
716
717
            <h2>JavaScript Cookie</h2>
718
            <p><a href="https://github.com/js-cookie/js-cookie">JavaScript Cookie</a> is a "simple, lightweight JavaScript API for handling cookies," licensed under the <a href="https://github.com/js-cookie/js-cookie/blob/master/LICENSE">MIT license</a>.</p>
713
        </div>
719
        </div>
714
720
715
        <div id="translations">
721
        <div id="translations">
716
- 

Return to bug 23944