Merge lp:~raoul-snyman/openlp/upgrade-jquery-2.4 into lp:openlp/2.4
- upgrade-jquery-2.4
- Merge into 2.4
Status: | Merged |
---|---|
Merged at revision: | 2662 |
Proposed branch: | lp:~raoul-snyman/openlp/upgrade-jquery-2.4 |
Merge into: | lp:openlp/2.4 |
Diff against target: |
922 lines (+824/-35) 5 files modified
openlp/plugins/remotes/html/index.html (+12/-11) openlp/plugins/remotes/html/jquery-migrate.js (+752/-0) openlp/plugins/remotes/html/jquery-migrate.min.js (+2/-0) openlp/plugins/remotes/html/openlp.js (+26/-24) tests/interfaces/openlp_core_ui/test_shortcutlistform.py (+32/-0) |
To merge this branch: | bzr merge lp:~raoul-snyman/openlp/upgrade-jquery-2.4 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Tim Bentley | Approve | ||
Tomas Groth | Pending | ||
Review via email: mp+313387@code.launchpad.net |
This proposal supersedes a proposal from 2016-12-14.
Commit message
Description of the change
Fix web remote for once and for all
Add this to your merge proposal:
-------
lp:~raoul-snyman/openlp/upgrade-jquery-2.4 (revision 2648)
[SUCCESS] https:/
[SUCCESS] https:/
[SUCCESS] https:/
[SUCCESS] https:/
[SUCCESS] https:/
[SUCCESS] https:/
[SUCCESS] https:/
Tomas Groth (tomasgroth) wrote : Posted in a previous version of this proposal | # |
Tim Bentley (trb143) wrote : Posted in a previous version of this proposal | # |
Should we have console.log code here
Tim Bentley (trb143) : | # |
Preview Diff
1 | === modified file 'openlp/plugins/remotes/html/index.html' | |||
2 | --- openlp/plugins/remotes/html/index.html 2016-01-10 16:00:05 +0000 | |||
3 | +++ openlp/plugins/remotes/html/index.html 2016-12-15 18:14:46 +0000 | |||
4 | @@ -27,17 +27,6 @@ | |||
5 | 27 | <link rel="stylesheet" href="/files/jquery.mobile.min.css" /> | 27 | <link rel="stylesheet" href="/files/jquery.mobile.min.css" /> |
6 | 28 | <link rel="stylesheet" href="/files/openlp.css" /> | 28 | <link rel="stylesheet" href="/files/openlp.css" /> |
7 | 29 | <link rel="shortcut icon" type="image/x-icon" href="/files/images/favicon.ico"> | 29 | <link rel="shortcut icon" type="image/x-icon" href="/files/images/favicon.ico"> |
8 | 30 | <script type="text/javascript" src="/files/jquery.min.js"></script> | ||
9 | 31 | <script type="text/javascript" src="/files/openlp.js"></script> | ||
10 | 32 | <script type="text/javascript" src="/files/jquery.mobile.min.js"></script> | ||
11 | 33 | <script type="text/javascript"> | ||
12 | 34 | translationStrings = { | ||
13 | 35 | "go_live": "${go_live}", | ||
14 | 36 | "add_to_service": "${add_to_service}", | ||
15 | 37 | "no_results": "${no_results}", | ||
16 | 38 | "home": "${home}" | ||
17 | 39 | } | ||
18 | 40 | </script> | ||
19 | 41 | </head> | 30 | </head> |
20 | 42 | <body> | 31 | <body> |
21 | 43 | <div data-role="page" id="home"> | 32 | <div data-role="page" id="home"> |
22 | @@ -173,5 +162,17 @@ | |||
23 | 173 | <a href="#" id="add-and-go-to-service" data-role="button">${add_and_go_to_service}</a> | 162 | <a href="#" id="add-and-go-to-service" data-role="button">${add_and_go_to_service}</a> |
24 | 174 | </div> | 163 | </div> |
25 | 175 | </div> | 164 | </div> |
26 | 165 | <script type="text/javascript" src="/files/jquery.min.js"></script> | ||
27 | 166 | <script type="text/javascript" src="/files/jquery-migrate.min.js"></script> | ||
28 | 167 | <script type="text/javascript" src="/files/jquery.mobile.min.js"></script> | ||
29 | 168 | <script type="text/javascript" src="/files/openlp.js"></script> | ||
30 | 169 | <script type="text/javascript"> | ||
31 | 170 | translationStrings = { | ||
32 | 171 | "go_live": "${go_live}", | ||
33 | 172 | "add_to_service": "${add_to_service}", | ||
34 | 173 | "no_results": "${no_results}", | ||
35 | 174 | "home": "${home}" | ||
36 | 175 | }; | ||
37 | 176 | </script> | ||
38 | 176 | </body> | 177 | </body> |
39 | 177 | </html> | 178 | </html> |
40 | 178 | 179 | ||
41 | === added file 'openlp/plugins/remotes/html/jquery-migrate.js' | |||
42 | --- openlp/plugins/remotes/html/jquery-migrate.js 1970-01-01 00:00:00 +0000 | |||
43 | +++ openlp/plugins/remotes/html/jquery-migrate.js 2016-12-15 18:14:46 +0000 | |||
44 | @@ -0,0 +1,752 @@ | |||
45 | 1 | /*! | ||
46 | 2 | * jQuery Migrate - v1.4.1 - 2016-05-19 | ||
47 | 3 | * Copyright jQuery Foundation and other contributors | ||
48 | 4 | */ | ||
49 | 5 | (function( jQuery, window, undefined ) { | ||
50 | 6 | // See http://bugs.jquery.com/ticket/13335 | ||
51 | 7 | // "use strict"; | ||
52 | 8 | |||
53 | 9 | |||
54 | 10 | jQuery.migrateVersion = "1.4.1"; | ||
55 | 11 | |||
56 | 12 | |||
57 | 13 | var warnedAbout = {}; | ||
58 | 14 | |||
59 | 15 | // List of warnings already given; public read only | ||
60 | 16 | jQuery.migrateWarnings = []; | ||
61 | 17 | |||
62 | 18 | // Set to true to prevent console output; migrateWarnings still maintained | ||
63 | 19 | // jQuery.migrateMute = false; | ||
64 | 20 | |||
65 | 21 | // Show a message on the console so devs know we're active | ||
66 | 22 | if ( window.console && window.console.log ) { | ||
67 | 23 | window.console.log( "JQMIGRATE: Migrate is installed" + | ||
68 | 24 | ( jQuery.migrateMute ? "" : " with logging active" ) + | ||
69 | 25 | ", version " + jQuery.migrateVersion ); | ||
70 | 26 | } | ||
71 | 27 | |||
72 | 28 | // Set to false to disable traces that appear with warnings | ||
73 | 29 | if ( jQuery.migrateTrace === undefined ) { | ||
74 | 30 | jQuery.migrateTrace = true; | ||
75 | 31 | } | ||
76 | 32 | |||
77 | 33 | // Forget any warnings we've already given; public | ||
78 | 34 | jQuery.migrateReset = function() { | ||
79 | 35 | warnedAbout = {}; | ||
80 | 36 | jQuery.migrateWarnings.length = 0; | ||
81 | 37 | }; | ||
82 | 38 | |||
83 | 39 | function migrateWarn( msg) { | ||
84 | 40 | var console = window.console; | ||
85 | 41 | if ( !warnedAbout[ msg ] ) { | ||
86 | 42 | warnedAbout[ msg ] = true; | ||
87 | 43 | jQuery.migrateWarnings.push( msg ); | ||
88 | 44 | if ( console && console.warn && !jQuery.migrateMute ) { | ||
89 | 45 | console.warn( "JQMIGRATE: " + msg ); | ||
90 | 46 | if ( jQuery.migrateTrace && console.trace ) { | ||
91 | 47 | console.trace(); | ||
92 | 48 | } | ||
93 | 49 | } | ||
94 | 50 | } | ||
95 | 51 | } | ||
96 | 52 | |||
97 | 53 | function migrateWarnProp( obj, prop, value, msg ) { | ||
98 | 54 | if ( Object.defineProperty ) { | ||
99 | 55 | // On ES5 browsers (non-oldIE), warn if the code tries to get prop; | ||
100 | 56 | // allow property to be overwritten in case some other plugin wants it | ||
101 | 57 | try { | ||
102 | 58 | Object.defineProperty( obj, prop, { | ||
103 | 59 | configurable: true, | ||
104 | 60 | enumerable: true, | ||
105 | 61 | get: function() { | ||
106 | 62 | migrateWarn( msg ); | ||
107 | 63 | return value; | ||
108 | 64 | }, | ||
109 | 65 | set: function( newValue ) { | ||
110 | 66 | migrateWarn( msg ); | ||
111 | 67 | value = newValue; | ||
112 | 68 | } | ||
113 | 69 | }); | ||
114 | 70 | return; | ||
115 | 71 | } catch( err ) { | ||
116 | 72 | // IE8 is a dope about Object.defineProperty, can't warn there | ||
117 | 73 | } | ||
118 | 74 | } | ||
119 | 75 | |||
120 | 76 | // Non-ES5 (or broken) browser; just set the property | ||
121 | 77 | jQuery._definePropertyBroken = true; | ||
122 | 78 | obj[ prop ] = value; | ||
123 | 79 | } | ||
124 | 80 | |||
125 | 81 | if ( document.compatMode === "BackCompat" ) { | ||
126 | 82 | // jQuery has never supported or tested Quirks Mode | ||
127 | 83 | migrateWarn( "jQuery is not compatible with Quirks Mode" ); | ||
128 | 84 | } | ||
129 | 85 | |||
130 | 86 | |||
131 | 87 | var attrFn = jQuery( "<input/>", { size: 1 } ).attr("size") && jQuery.attrFn, | ||
132 | 88 | oldAttr = jQuery.attr, | ||
133 | 89 | valueAttrGet = jQuery.attrHooks.value && jQuery.attrHooks.value.get || | ||
134 | 90 | function() { return null; }, | ||
135 | 91 | valueAttrSet = jQuery.attrHooks.value && jQuery.attrHooks.value.set || | ||
136 | 92 | function() { return undefined; }, | ||
137 | 93 | rnoType = /^(?:input|button)$/i, | ||
138 | 94 | rnoAttrNodeType = /^[238]$/, | ||
139 | 95 | rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, | ||
140 | 96 | ruseDefault = /^(?:checked|selected)$/i; | ||
141 | 97 | |||
142 | 98 | // jQuery.attrFn | ||
143 | 99 | migrateWarnProp( jQuery, "attrFn", attrFn || {}, "jQuery.attrFn is deprecated" ); | ||
144 | 100 | |||
145 | 101 | jQuery.attr = function( elem, name, value, pass ) { | ||
146 | 102 | var lowerName = name.toLowerCase(), | ||
147 | 103 | nType = elem && elem.nodeType; | ||
148 | 104 | |||
149 | 105 | if ( pass ) { | ||
150 | 106 | // Since pass is used internally, we only warn for new jQuery | ||
151 | 107 | // versions where there isn't a pass arg in the formal params | ||
152 | 108 | if ( oldAttr.length < 4 ) { | ||
153 | 109 | migrateWarn("jQuery.fn.attr( props, pass ) is deprecated"); | ||
154 | 110 | } | ||
155 | 111 | if ( elem && !rnoAttrNodeType.test( nType ) && | ||
156 | 112 | (attrFn ? name in attrFn : jQuery.isFunction(jQuery.fn[name])) ) { | ||
157 | 113 | return jQuery( elem )[ name ]( value ); | ||
158 | 114 | } | ||
159 | 115 | } | ||
160 | 116 | |||
161 | 117 | // Warn if user tries to set `type`, since it breaks on IE 6/7/8; by checking | ||
162 | 118 | // for disconnected elements we don't warn on $( "<button>", { type: "button" } ). | ||
163 | 119 | if ( name === "type" && value !== undefined && rnoType.test( elem.nodeName ) && elem.parentNode ) { | ||
164 | 120 | migrateWarn("Can't change the 'type' of an input or button in IE 6/7/8"); | ||
165 | 121 | } | ||
166 | 122 | |||
167 | 123 | // Restore boolHook for boolean property/attribute synchronization | ||
168 | 124 | if ( !jQuery.attrHooks[ lowerName ] && rboolean.test( lowerName ) ) { | ||
169 | 125 | jQuery.attrHooks[ lowerName ] = { | ||
170 | 126 | get: function( elem, name ) { | ||
171 | 127 | // Align boolean attributes with corresponding properties | ||
172 | 128 | // Fall back to attribute presence where some booleans are not supported | ||
173 | 129 | var attrNode, | ||
174 | 130 | property = jQuery.prop( elem, name ); | ||
175 | 131 | return property === true || typeof property !== "boolean" && | ||
176 | 132 | ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ? | ||
177 | 133 | |||
178 | 134 | name.toLowerCase() : | ||
179 | 135 | undefined; | ||
180 | 136 | }, | ||
181 | 137 | set: function( elem, value, name ) { | ||
182 | 138 | var propName; | ||
183 | 139 | if ( value === false ) { | ||
184 | 140 | // Remove boolean attributes when set to false | ||
185 | 141 | jQuery.removeAttr( elem, name ); | ||
186 | 142 | } else { | ||
187 | 143 | // value is true since we know at this point it's type boolean and not false | ||
188 | 144 | // Set boolean attributes to the same name and set the DOM property | ||
189 | 145 | propName = jQuery.propFix[ name ] || name; | ||
190 | 146 | if ( propName in elem ) { | ||
191 | 147 | // Only set the IDL specifically if it already exists on the element | ||
192 | 148 | elem[ propName ] = true; | ||
193 | 149 | } | ||
194 | 150 | |||
195 | 151 | elem.setAttribute( name, name.toLowerCase() ); | ||
196 | 152 | } | ||
197 | 153 | return name; | ||
198 | 154 | } | ||
199 | 155 | }; | ||
200 | 156 | |||
201 | 157 | // Warn only for attributes that can remain distinct from their properties post-1.9 | ||
202 | 158 | if ( ruseDefault.test( lowerName ) ) { | ||
203 | 159 | migrateWarn( "jQuery.fn.attr('" + lowerName + "') might use property instead of attribute" ); | ||
204 | 160 | } | ||
205 | 161 | } | ||
206 | 162 | |||
207 | 163 | return oldAttr.call( jQuery, elem, name, value ); | ||
208 | 164 | }; | ||
209 | 165 | |||
210 | 166 | // attrHooks: value | ||
211 | 167 | jQuery.attrHooks.value = { | ||
212 | 168 | get: function( elem, name ) { | ||
213 | 169 | var nodeName = ( elem.nodeName || "" ).toLowerCase(); | ||
214 | 170 | if ( nodeName === "button" ) { | ||
215 | 171 | return valueAttrGet.apply( this, arguments ); | ||
216 | 172 | } | ||
217 | 173 | if ( nodeName !== "input" && nodeName !== "option" ) { | ||
218 | 174 | migrateWarn("jQuery.fn.attr('value') no longer gets properties"); | ||
219 | 175 | } | ||
220 | 176 | return name in elem ? | ||
221 | 177 | elem.value : | ||
222 | 178 | null; | ||
223 | 179 | }, | ||
224 | 180 | set: function( elem, value ) { | ||
225 | 181 | var nodeName = ( elem.nodeName || "" ).toLowerCase(); | ||
226 | 182 | if ( nodeName === "button" ) { | ||
227 | 183 | return valueAttrSet.apply( this, arguments ); | ||
228 | 184 | } | ||
229 | 185 | if ( nodeName !== "input" && nodeName !== "option" ) { | ||
230 | 186 | migrateWarn("jQuery.fn.attr('value', val) no longer sets properties"); | ||
231 | 187 | } | ||
232 | 188 | // Does not return so that setAttribute is also used | ||
233 | 189 | elem.value = value; | ||
234 | 190 | } | ||
235 | 191 | }; | ||
236 | 192 | |||
237 | 193 | |||
238 | 194 | var matched, browser, | ||
239 | 195 | oldInit = jQuery.fn.init, | ||
240 | 196 | oldFind = jQuery.find, | ||
241 | 197 | oldParseJSON = jQuery.parseJSON, | ||
242 | 198 | rspaceAngle = /^\s*</, | ||
243 | 199 | rattrHashTest = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/, | ||
244 | 200 | rattrHashGlob = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g, | ||
245 | 201 | // Note: XSS check is done below after string is trimmed | ||
246 | 202 | rquickExpr = /^([^<]*)(<[\w\W]+>)([^>]*)$/; | ||
247 | 203 | |||
248 | 204 | // $(html) "looks like html" rule change | ||
249 | 205 | jQuery.fn.init = function( selector, context, rootjQuery ) { | ||
250 | 206 | var match, ret; | ||
251 | 207 | |||
252 | 208 | if ( selector && typeof selector === "string" ) { | ||
253 | 209 | if ( !jQuery.isPlainObject( context ) && | ||
254 | 210 | (match = rquickExpr.exec( jQuery.trim( selector ) )) && match[ 0 ] ) { | ||
255 | 211 | |||
256 | 212 | // This is an HTML string according to the "old" rules; is it still? | ||
257 | 213 | if ( !rspaceAngle.test( selector ) ) { | ||
258 | 214 | migrateWarn("$(html) HTML strings must start with '<' character"); | ||
259 | 215 | } | ||
260 | 216 | if ( match[ 3 ] ) { | ||
261 | 217 | migrateWarn("$(html) HTML text after last tag is ignored"); | ||
262 | 218 | } | ||
263 | 219 | |||
264 | 220 | // Consistently reject any HTML-like string starting with a hash (gh-9521) | ||
265 | 221 | // Note that this may break jQuery 1.6.x code that otherwise would work. | ||
266 | 222 | if ( match[ 0 ].charAt( 0 ) === "#" ) { | ||
267 | 223 | migrateWarn("HTML string cannot start with a '#' character"); | ||
268 | 224 | jQuery.error("JQMIGRATE: Invalid selector string (XSS)"); | ||
269 | 225 | } | ||
270 | 226 | |||
271 | 227 | // Now process using loose rules; let pre-1.8 play too | ||
272 | 228 | // Is this a jQuery context? parseHTML expects a DOM element (#178) | ||
273 | 229 | if ( context && context.context && context.context.nodeType ) { | ||
274 | 230 | context = context.context; | ||
275 | 231 | } | ||
276 | 232 | |||
277 | 233 | if ( jQuery.parseHTML ) { | ||
278 | 234 | return oldInit.call( this, | ||
279 | 235 | jQuery.parseHTML( match[ 2 ], context && context.ownerDocument || | ||
280 | 236 | context || document, true ), context, rootjQuery ); | ||
281 | 237 | } | ||
282 | 238 | } | ||
283 | 239 | } | ||
284 | 240 | |||
285 | 241 | ret = oldInit.apply( this, arguments ); | ||
286 | 242 | |||
287 | 243 | // Fill in selector and context properties so .live() works | ||
288 | 244 | if ( selector && selector.selector !== undefined ) { | ||
289 | 245 | // A jQuery object, copy its properties | ||
290 | 246 | ret.selector = selector.selector; | ||
291 | 247 | ret.context = selector.context; | ||
292 | 248 | |||
293 | 249 | } else { | ||
294 | 250 | ret.selector = typeof selector === "string" ? selector : ""; | ||
295 | 251 | if ( selector ) { | ||
296 | 252 | ret.context = selector.nodeType? selector : context || document; | ||
297 | 253 | } | ||
298 | 254 | } | ||
299 | 255 | |||
300 | 256 | return ret; | ||
301 | 257 | }; | ||
302 | 258 | jQuery.fn.init.prototype = jQuery.fn; | ||
303 | 259 | |||
304 | 260 | jQuery.find = function( selector ) { | ||
305 | 261 | var args = Array.prototype.slice.call( arguments ); | ||
306 | 262 | |||
307 | 263 | // Support: PhantomJS 1.x | ||
308 | 264 | // String#match fails to match when used with a //g RegExp, only on some strings | ||
309 | 265 | if ( typeof selector === "string" && rattrHashTest.test( selector ) ) { | ||
310 | 266 | |||
311 | 267 | // The nonstandard and undocumented unquoted-hash was removed in jQuery 1.12.0 | ||
312 | 268 | // First see if qS thinks it's a valid selector, if so avoid a false positive | ||
313 | 269 | try { | ||
314 | 270 | document.querySelector( selector ); | ||
315 | 271 | } catch ( err1 ) { | ||
316 | 272 | |||
317 | 273 | // Didn't *look* valid to qSA, warn and try quoting what we think is the value | ||
318 | 274 | selector = selector.replace( rattrHashGlob, function( _, attr, op, value ) { | ||
319 | 275 | return "[" + attr + op + "\"" + value + "\"]"; | ||
320 | 276 | } ); | ||
321 | 277 | |||
322 | 278 | // If the regexp *may* have created an invalid selector, don't update it | ||
323 | 279 | // Note that there may be false alarms if selector uses jQuery extensions | ||
324 | 280 | try { | ||
325 | 281 | document.querySelector( selector ); | ||
326 | 282 | migrateWarn( "Attribute selector with '#' must be quoted: " + args[ 0 ] ); | ||
327 | 283 | args[ 0 ] = selector; | ||
328 | 284 | } catch ( err2 ) { | ||
329 | 285 | migrateWarn( "Attribute selector with '#' was not fixed: " + args[ 0 ] ); | ||
330 | 286 | } | ||
331 | 287 | } | ||
332 | 288 | } | ||
333 | 289 | |||
334 | 290 | return oldFind.apply( this, args ); | ||
335 | 291 | }; | ||
336 | 292 | |||
337 | 293 | // Copy properties attached to original jQuery.find method (e.g. .attr, .isXML) | ||
338 | 294 | var findProp; | ||
339 | 295 | for ( findProp in oldFind ) { | ||
340 | 296 | if ( Object.prototype.hasOwnProperty.call( oldFind, findProp ) ) { | ||
341 | 297 | jQuery.find[ findProp ] = oldFind[ findProp ]; | ||
342 | 298 | } | ||
343 | 299 | } | ||
344 | 300 | |||
345 | 301 | // Let $.parseJSON(falsy_value) return null | ||
346 | 302 | jQuery.parseJSON = function( json ) { | ||
347 | 303 | if ( !json ) { | ||
348 | 304 | migrateWarn("jQuery.parseJSON requires a valid JSON string"); | ||
349 | 305 | return null; | ||
350 | 306 | } | ||
351 | 307 | return oldParseJSON.apply( this, arguments ); | ||
352 | 308 | }; | ||
353 | 309 | |||
354 | 310 | jQuery.uaMatch = function( ua ) { | ||
355 | 311 | ua = ua.toLowerCase(); | ||
356 | 312 | |||
357 | 313 | var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) || | ||
358 | 314 | /(webkit)[ \/]([\w.]+)/.exec( ua ) || | ||
359 | 315 | /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) || | ||
360 | 316 | /(msie) ([\w.]+)/.exec( ua ) || | ||
361 | 317 | ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) || | ||
362 | 318 | []; | ||
363 | 319 | |||
364 | 320 | return { | ||
365 | 321 | browser: match[ 1 ] || "", | ||
366 | 322 | version: match[ 2 ] || "0" | ||
367 | 323 | }; | ||
368 | 324 | }; | ||
369 | 325 | |||
370 | 326 | // Don't clobber any existing jQuery.browser in case it's different | ||
371 | 327 | if ( !jQuery.browser ) { | ||
372 | 328 | matched = jQuery.uaMatch( navigator.userAgent ); | ||
373 | 329 | browser = {}; | ||
374 | 330 | |||
375 | 331 | if ( matched.browser ) { | ||
376 | 332 | browser[ matched.browser ] = true; | ||
377 | 333 | browser.version = matched.version; | ||
378 | 334 | } | ||
379 | 335 | |||
380 | 336 | // Chrome is Webkit, but Webkit is also Safari. | ||
381 | 337 | if ( browser.chrome ) { | ||
382 | 338 | browser.webkit = true; | ||
383 | 339 | } else if ( browser.webkit ) { | ||
384 | 340 | browser.safari = true; | ||
385 | 341 | } | ||
386 | 342 | |||
387 | 343 | jQuery.browser = browser; | ||
388 | 344 | } | ||
389 | 345 | |||
390 | 346 | // Warn if the code tries to get jQuery.browser | ||
391 | 347 | migrateWarnProp( jQuery, "browser", jQuery.browser, "jQuery.browser is deprecated" ); | ||
392 | 348 | |||
393 | 349 | // jQuery.boxModel deprecated in 1.3, jQuery.support.boxModel deprecated in 1.7 | ||
394 | 350 | jQuery.boxModel = jQuery.support.boxModel = (document.compatMode === "CSS1Compat"); | ||
395 | 351 | migrateWarnProp( jQuery, "boxModel", jQuery.boxModel, "jQuery.boxModel is deprecated" ); | ||
396 | 352 | migrateWarnProp( jQuery.support, "boxModel", jQuery.support.boxModel, "jQuery.support.boxModel is deprecated" ); | ||
397 | 353 | |||
398 | 354 | jQuery.sub = function() { | ||
399 | 355 | function jQuerySub( selector, context ) { | ||
400 | 356 | return new jQuerySub.fn.init( selector, context ); | ||
401 | 357 | } | ||
402 | 358 | jQuery.extend( true, jQuerySub, this ); | ||
403 | 359 | jQuerySub.superclass = this; | ||
404 | 360 | jQuerySub.fn = jQuerySub.prototype = this(); | ||
405 | 361 | jQuerySub.fn.constructor = jQuerySub; | ||
406 | 362 | jQuerySub.sub = this.sub; | ||
407 | 363 | jQuerySub.fn.init = function init( selector, context ) { | ||
408 | 364 | var instance = jQuery.fn.init.call( this, selector, context, rootjQuerySub ); | ||
409 | 365 | return instance instanceof jQuerySub ? | ||
410 | 366 | instance : | ||
411 | 367 | jQuerySub( instance ); | ||
412 | 368 | }; | ||
413 | 369 | jQuerySub.fn.init.prototype = jQuerySub.fn; | ||
414 | 370 | var rootjQuerySub = jQuerySub(document); | ||
415 | 371 | migrateWarn( "jQuery.sub() is deprecated" ); | ||
416 | 372 | return jQuerySub; | ||
417 | 373 | }; | ||
418 | 374 | |||
419 | 375 | // The number of elements contained in the matched element set | ||
420 | 376 | jQuery.fn.size = function() { | ||
421 | 377 | migrateWarn( "jQuery.fn.size() is deprecated; use the .length property" ); | ||
422 | 378 | return this.length; | ||
423 | 379 | }; | ||
424 | 380 | |||
425 | 381 | |||
426 | 382 | var internalSwapCall = false; | ||
427 | 383 | |||
428 | 384 | // If this version of jQuery has .swap(), don't false-alarm on internal uses | ||
429 | 385 | if ( jQuery.swap ) { | ||
430 | 386 | jQuery.each( [ "height", "width", "reliableMarginRight" ], function( _, name ) { | ||
431 | 387 | var oldHook = jQuery.cssHooks[ name ] && jQuery.cssHooks[ name ].get; | ||
432 | 388 | |||
433 | 389 | if ( oldHook ) { | ||
434 | 390 | jQuery.cssHooks[ name ].get = function() { | ||
435 | 391 | var ret; | ||
436 | 392 | |||
437 | 393 | internalSwapCall = true; | ||
438 | 394 | ret = oldHook.apply( this, arguments ); | ||
439 | 395 | internalSwapCall = false; | ||
440 | 396 | return ret; | ||
441 | 397 | }; | ||
442 | 398 | } | ||
443 | 399 | }); | ||
444 | 400 | } | ||
445 | 401 | |||
446 | 402 | jQuery.swap = function( elem, options, callback, args ) { | ||
447 | 403 | var ret, name, | ||
448 | 404 | old = {}; | ||
449 | 405 | |||
450 | 406 | if ( !internalSwapCall ) { | ||
451 | 407 | migrateWarn( "jQuery.swap() is undocumented and deprecated" ); | ||
452 | 408 | } | ||
453 | 409 | |||
454 | 410 | // Remember the old values, and insert the new ones | ||
455 | 411 | for ( name in options ) { | ||
456 | 412 | old[ name ] = elem.style[ name ]; | ||
457 | 413 | elem.style[ name ] = options[ name ]; | ||
458 | 414 | } | ||
459 | 415 | |||
460 | 416 | ret = callback.apply( elem, args || [] ); | ||
461 | 417 | |||
462 | 418 | // Revert the old values | ||
463 | 419 | for ( name in options ) { | ||
464 | 420 | elem.style[ name ] = old[ name ]; | ||
465 | 421 | } | ||
466 | 422 | |||
467 | 423 | return ret; | ||
468 | 424 | }; | ||
469 | 425 | |||
470 | 426 | |||
471 | 427 | // Ensure that $.ajax gets the new parseJSON defined in core.js | ||
472 | 428 | jQuery.ajaxSetup({ | ||
473 | 429 | converters: { | ||
474 | 430 | "text json": jQuery.parseJSON | ||
475 | 431 | } | ||
476 | 432 | }); | ||
477 | 433 | |||
478 | 434 | |||
479 | 435 | var oldFnData = jQuery.fn.data; | ||
480 | 436 | |||
481 | 437 | jQuery.fn.data = function( name ) { | ||
482 | 438 | var ret, evt, | ||
483 | 439 | elem = this[0]; | ||
484 | 440 | |||
485 | 441 | // Handles 1.7 which has this behavior and 1.8 which doesn't | ||
486 | 442 | if ( elem && name === "events" && arguments.length === 1 ) { | ||
487 | 443 | ret = jQuery.data( elem, name ); | ||
488 | 444 | evt = jQuery._data( elem, name ); | ||
489 | 445 | if ( ( ret === undefined || ret === evt ) && evt !== undefined ) { | ||
490 | 446 | migrateWarn("Use of jQuery.fn.data('events') is deprecated"); | ||
491 | 447 | return evt; | ||
492 | 448 | } | ||
493 | 449 | } | ||
494 | 450 | return oldFnData.apply( this, arguments ); | ||
495 | 451 | }; | ||
496 | 452 | |||
497 | 453 | |||
498 | 454 | var rscriptType = /\/(java|ecma)script/i; | ||
499 | 455 | |||
500 | 456 | // Since jQuery.clean is used internally on older versions, we only shim if it's missing | ||
501 | 457 | if ( !jQuery.clean ) { | ||
502 | 458 | jQuery.clean = function( elems, context, fragment, scripts ) { | ||
503 | 459 | // Set context per 1.8 logic | ||
504 | 460 | context = context || document; | ||
505 | 461 | context = !context.nodeType && context[0] || context; | ||
506 | 462 | context = context.ownerDocument || context; | ||
507 | 463 | |||
508 | 464 | migrateWarn("jQuery.clean() is deprecated"); | ||
509 | 465 | |||
510 | 466 | var i, elem, handleScript, jsTags, | ||
511 | 467 | ret = []; | ||
512 | 468 | |||
513 | 469 | jQuery.merge( ret, jQuery.buildFragment( elems, context ).childNodes ); | ||
514 | 470 | |||
515 | 471 | // Complex logic lifted directly from jQuery 1.8 | ||
516 | 472 | if ( fragment ) { | ||
517 | 473 | // Special handling of each script element | ||
518 | 474 | handleScript = function( elem ) { | ||
519 | 475 | // Check if we consider it executable | ||
520 | 476 | if ( !elem.type || rscriptType.test( elem.type ) ) { | ||
521 | 477 | // Detach the script and store it in the scripts array (if provided) or the fragment | ||
522 | 478 | // Return truthy to indicate that it has been handled | ||
523 | 479 | return scripts ? | ||
524 | 480 | scripts.push( elem.parentNode ? elem.parentNode.removeChild( elem ) : elem ) : | ||
525 | 481 | fragment.appendChild( elem ); | ||
526 | 482 | } | ||
527 | 483 | }; | ||
528 | 484 | |||
529 | 485 | for ( i = 0; (elem = ret[i]) != null; i++ ) { | ||
530 | 486 | // Check if we're done after handling an executable script | ||
531 | 487 | if ( !( jQuery.nodeName( elem, "script" ) && handleScript( elem ) ) ) { | ||
532 | 488 | // Append to fragment and handle embedded scripts | ||
533 | 489 | fragment.appendChild( elem ); | ||
534 | 490 | if ( typeof elem.getElementsByTagName !== "undefined" ) { | ||
535 | 491 | // handleScript alters the DOM, so use jQuery.merge to ensure snapshot iteration | ||
536 | 492 | jsTags = jQuery.grep( jQuery.merge( [], elem.getElementsByTagName("script") ), handleScript ); | ||
537 | 493 | |||
538 | 494 | // Splice the scripts into ret after their former ancestor and advance our index beyond them | ||
539 | 495 | ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) ); | ||
540 | 496 | i += jsTags.length; | ||
541 | 497 | } | ||
542 | 498 | } | ||
543 | 499 | } | ||
544 | 500 | } | ||
545 | 501 | |||
546 | 502 | return ret; | ||
547 | 503 | }; | ||
548 | 504 | } | ||
549 | 505 | |||
550 | 506 | var eventAdd = jQuery.event.add, | ||
551 | 507 | eventRemove = jQuery.event.remove, | ||
552 | 508 | eventTrigger = jQuery.event.trigger, | ||
553 | 509 | oldToggle = jQuery.fn.toggle, | ||
554 | 510 | oldLive = jQuery.fn.live, | ||
555 | 511 | oldDie = jQuery.fn.die, | ||
556 | 512 | oldLoad = jQuery.fn.load, | ||
557 | 513 | ajaxEvents = "ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess", | ||
558 | 514 | rajaxEvent = new RegExp( "\\b(?:" + ajaxEvents + ")\\b" ), | ||
559 | 515 | rhoverHack = /(?:^|\s)hover(\.\S+|)\b/, | ||
560 | 516 | hoverHack = function( events ) { | ||
561 | 517 | if ( typeof( events ) !== "string" || jQuery.event.special.hover ) { | ||
562 | 518 | return events; | ||
563 | 519 | } | ||
564 | 520 | if ( rhoverHack.test( events ) ) { | ||
565 | 521 | migrateWarn("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'"); | ||
566 | 522 | } | ||
567 | 523 | return events && events.replace( rhoverHack, "mouseenter$1 mouseleave$1" ); | ||
568 | 524 | }; | ||
569 | 525 | |||
570 | 526 | // Event props removed in 1.9, put them back if needed; no practical way to warn them | ||
571 | 527 | if ( jQuery.event.props && jQuery.event.props[ 0 ] !== "attrChange" ) { | ||
572 | 528 | jQuery.event.props.unshift( "attrChange", "attrName", "relatedNode", "srcElement" ); | ||
573 | 529 | } | ||
574 | 530 | |||
575 | 531 | // Undocumented jQuery.event.handle was "deprecated" in jQuery 1.7 | ||
576 | 532 | if ( jQuery.event.dispatch ) { | ||
577 | 533 | migrateWarnProp( jQuery.event, "handle", jQuery.event.dispatch, "jQuery.event.handle is undocumented and deprecated" ); | ||
578 | 534 | } | ||
579 | 535 | |||
580 | 536 | // Support for 'hover' pseudo-event and ajax event warnings | ||
581 | 537 | jQuery.event.add = function( elem, types, handler, data, selector ){ | ||
582 | 538 | if ( elem !== document && rajaxEvent.test( types ) ) { | ||
583 | 539 | migrateWarn( "AJAX events should be attached to document: " + types ); | ||
584 | 540 | } | ||
585 | 541 | eventAdd.call( this, elem, hoverHack( types || "" ), handler, data, selector ); | ||
586 | 542 | }; | ||
587 | 543 | jQuery.event.remove = function( elem, types, handler, selector, mappedTypes ){ | ||
588 | 544 | eventRemove.call( this, elem, hoverHack( types ) || "", handler, selector, mappedTypes ); | ||
589 | 545 | }; | ||
590 | 546 | |||
591 | 547 | jQuery.each( [ "load", "unload", "error" ], function( _, name ) { | ||
592 | 548 | |||
593 | 549 | jQuery.fn[ name ] = function() { | ||
594 | 550 | var args = Array.prototype.slice.call( arguments, 0 ); | ||
595 | 551 | |||
596 | 552 | // If this is an ajax load() the first arg should be the string URL; | ||
597 | 553 | // technically this could also be the "Anything" arg of the event .load() | ||
598 | 554 | // which just goes to show why this dumb signature has been deprecated! | ||
599 | 555 | // jQuery custom builds that exclude the Ajax module justifiably die here. | ||
600 | 556 | if ( name === "load" && typeof args[ 0 ] === "string" ) { | ||
601 | 557 | return oldLoad.apply( this, args ); | ||
602 | 558 | } | ||
603 | 559 | |||
604 | 560 | migrateWarn( "jQuery.fn." + name + "() is deprecated" ); | ||
605 | 561 | |||
606 | 562 | args.splice( 0, 0, name ); | ||
607 | 563 | if ( arguments.length ) { | ||
608 | 564 | return this.bind.apply( this, args ); | ||
609 | 565 | } | ||
610 | 566 | |||
611 | 567 | // Use .triggerHandler here because: | ||
612 | 568 | // - load and unload events don't need to bubble, only applied to window or image | ||
613 | 569 | // - error event should not bubble to window, although it does pre-1.7 | ||
614 | 570 | // See http://bugs.jquery.com/ticket/11820 | ||
615 | 571 | this.triggerHandler.apply( this, args ); | ||
616 | 572 | return this; | ||
617 | 573 | }; | ||
618 | 574 | |||
619 | 575 | }); | ||
620 | 576 | |||
621 | 577 | jQuery.fn.toggle = function( fn, fn2 ) { | ||
622 | 578 | |||
623 | 579 | // Don't mess with animation or css toggles | ||
624 | 580 | if ( !jQuery.isFunction( fn ) || !jQuery.isFunction( fn2 ) ) { | ||
625 | 581 | return oldToggle.apply( this, arguments ); | ||
626 | 582 | } | ||
627 | 583 | migrateWarn("jQuery.fn.toggle(handler, handler...) is deprecated"); | ||
628 | 584 | |||
629 | 585 | // Save reference to arguments for access in closure | ||
630 | 586 | var args = arguments, | ||
631 | 587 | guid = fn.guid || jQuery.guid++, | ||
632 | 588 | i = 0, | ||
633 | 589 | toggler = function( event ) { | ||
634 | 590 | // Figure out which function to execute | ||
635 | 591 | var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i; | ||
636 | 592 | jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 ); | ||
637 | 593 | |||
638 | 594 | // Make sure that clicks stop | ||
639 | 595 | event.preventDefault(); | ||
640 | 596 | |||
641 | 597 | // and execute the function | ||
642 | 598 | return args[ lastToggle ].apply( this, arguments ) || false; | ||
643 | 599 | }; | ||
644 | 600 | |||
645 | 601 | // link all the functions, so any of them can unbind this click handler | ||
646 | 602 | toggler.guid = guid; | ||
647 | 603 | while ( i < args.length ) { | ||
648 | 604 | args[ i++ ].guid = guid; | ||
649 | 605 | } | ||
650 | 606 | |||
651 | 607 | return this.click( toggler ); | ||
652 | 608 | }; | ||
653 | 609 | |||
654 | 610 | jQuery.fn.live = function( types, data, fn ) { | ||
655 | 611 | migrateWarn("jQuery.fn.live() is deprecated"); | ||
656 | 612 | if ( oldLive ) { | ||
657 | 613 | return oldLive.apply( this, arguments ); | ||
658 | 614 | } | ||
659 | 615 | jQuery( this.context ).on( types, this.selector, data, fn ); | ||
660 | 616 | return this; | ||
661 | 617 | }; | ||
662 | 618 | |||
663 | 619 | jQuery.fn.die = function( types, fn ) { | ||
664 | 620 | migrateWarn("jQuery.fn.die() is deprecated"); | ||
665 | 621 | if ( oldDie ) { | ||
666 | 622 | return oldDie.apply( this, arguments ); | ||
667 | 623 | } | ||
668 | 624 | jQuery( this.context ).off( types, this.selector || "**", fn ); | ||
669 | 625 | return this; | ||
670 | 626 | }; | ||
671 | 627 | |||
672 | 628 | // Turn global events into document-triggered events | ||
673 | 629 | jQuery.event.trigger = function( event, data, elem, onlyHandlers ){ | ||
674 | 630 | if ( !elem && !rajaxEvent.test( event ) ) { | ||
675 | 631 | migrateWarn( "Global events are undocumented and deprecated" ); | ||
676 | 632 | } | ||
677 | 633 | return eventTrigger.call( this, event, data, elem || document, onlyHandlers ); | ||
678 | 634 | }; | ||
679 | 635 | jQuery.each( ajaxEvents.split("|"), | ||
680 | 636 | function( _, name ) { | ||
681 | 637 | jQuery.event.special[ name ] = { | ||
682 | 638 | setup: function() { | ||
683 | 639 | var elem = this; | ||
684 | 640 | |||
685 | 641 | // The document needs no shimming; must be !== for oldIE | ||
686 | 642 | if ( elem !== document ) { | ||
687 | 643 | jQuery.event.add( document, name + "." + jQuery.guid, function() { | ||
688 | 644 | jQuery.event.trigger( name, Array.prototype.slice.call( arguments, 1 ), elem, true ); | ||
689 | 645 | }); | ||
690 | 646 | jQuery._data( this, name, jQuery.guid++ ); | ||
691 | 647 | } | ||
692 | 648 | return false; | ||
693 | 649 | }, | ||
694 | 650 | teardown: function() { | ||
695 | 651 | if ( this !== document ) { | ||
696 | 652 | jQuery.event.remove( document, name + "." + jQuery._data( this, name ) ); | ||
697 | 653 | } | ||
698 | 654 | return false; | ||
699 | 655 | } | ||
700 | 656 | }; | ||
701 | 657 | } | ||
702 | 658 | ); | ||
703 | 659 | |||
704 | 660 | jQuery.event.special.ready = { | ||
705 | 661 | setup: function() { | ||
706 | 662 | if ( this === document ) { | ||
707 | 663 | migrateWarn( "'ready' event is deprecated" ); | ||
708 | 664 | } | ||
709 | 665 | } | ||
710 | 666 | }; | ||
711 | 667 | |||
712 | 668 | var oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack, | ||
713 | 669 | oldFnFind = jQuery.fn.find; | ||
714 | 670 | |||
715 | 671 | jQuery.fn.andSelf = function() { | ||
716 | 672 | migrateWarn("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()"); | ||
717 | 673 | return oldSelf.apply( this, arguments ); | ||
718 | 674 | }; | ||
719 | 675 | |||
720 | 676 | jQuery.fn.find = function( selector ) { | ||
721 | 677 | var ret = oldFnFind.apply( this, arguments ); | ||
722 | 678 | ret.context = this.context; | ||
723 | 679 | ret.selector = this.selector ? this.selector + " " + selector : selector; | ||
724 | 680 | return ret; | ||
725 | 681 | }; | ||
726 | 682 | |||
727 | 683 | |||
728 | 684 | // jQuery 1.6 did not support Callbacks, do not warn there | ||
729 | 685 | if ( jQuery.Callbacks ) { | ||
730 | 686 | |||
731 | 687 | var oldDeferred = jQuery.Deferred, | ||
732 | 688 | tuples = [ | ||
733 | 689 | // action, add listener, callbacks, .then handlers, final state | ||
734 | 690 | [ "resolve", "done", jQuery.Callbacks("once memory"), | ||
735 | 691 | jQuery.Callbacks("once memory"), "resolved" ], | ||
736 | 692 | [ "reject", "fail", jQuery.Callbacks("once memory"), | ||
737 | 693 | jQuery.Callbacks("once memory"), "rejected" ], | ||
738 | 694 | [ "notify", "progress", jQuery.Callbacks("memory"), | ||
739 | 695 | jQuery.Callbacks("memory") ] | ||
740 | 696 | ]; | ||
741 | 697 | |||
742 | 698 | jQuery.Deferred = function( func ) { | ||
743 | 699 | var deferred = oldDeferred(), | ||
744 | 700 | promise = deferred.promise(); | ||
745 | 701 | |||
746 | 702 | deferred.pipe = promise.pipe = function( /* fnDone, fnFail, fnProgress */ ) { | ||
747 | 703 | var fns = arguments; | ||
748 | 704 | |||
749 | 705 | migrateWarn( "deferred.pipe() is deprecated" ); | ||
750 | 706 | |||
751 | 707 | return jQuery.Deferred(function( newDefer ) { | ||
752 | 708 | jQuery.each( tuples, function( i, tuple ) { | ||
753 | 709 | var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; | ||
754 | 710 | // deferred.done(function() { bind to newDefer or newDefer.resolve }) | ||
755 | 711 | // deferred.fail(function() { bind to newDefer or newDefer.reject }) | ||
756 | 712 | // deferred.progress(function() { bind to newDefer or newDefer.notify }) | ||
757 | 713 | deferred[ tuple[1] ](function() { | ||
758 | 714 | var returned = fn && fn.apply( this, arguments ); | ||
759 | 715 | if ( returned && jQuery.isFunction( returned.promise ) ) { | ||
760 | 716 | returned.promise() | ||
761 | 717 | .done( newDefer.resolve ) | ||
762 | 718 | .fail( newDefer.reject ) | ||
763 | 719 | .progress( newDefer.notify ); | ||
764 | 720 | } else { | ||
765 | 721 | newDefer[ tuple[ 0 ] + "With" ]( | ||
766 | 722 | this === promise ? newDefer.promise() : this, | ||
767 | 723 | fn ? [ returned ] : arguments | ||
768 | 724 | ); | ||
769 | 725 | } | ||
770 | 726 | }); | ||
771 | 727 | }); | ||
772 | 728 | fns = null; | ||
773 | 729 | }).promise(); | ||
774 | 730 | |||
775 | 731 | }; | ||
776 | 732 | |||
777 | 733 | deferred.isResolved = function() { | ||
778 | 734 | migrateWarn( "deferred.isResolved is deprecated" ); | ||
779 | 735 | return deferred.state() === "resolved"; | ||
780 | 736 | }; | ||
781 | 737 | |||
782 | 738 | deferred.isRejected = function() { | ||
783 | 739 | migrateWarn( "deferred.isRejected is deprecated" ); | ||
784 | 740 | return deferred.state() === "rejected"; | ||
785 | 741 | }; | ||
786 | 742 | |||
787 | 743 | if ( func ) { | ||
788 | 744 | func.call( deferred, deferred ); | ||
789 | 745 | } | ||
790 | 746 | |||
791 | 747 | return deferred; | ||
792 | 748 | }; | ||
793 | 749 | |||
794 | 750 | } | ||
795 | 751 | |||
796 | 752 | })( jQuery, window ); | ||
797 | 0 | 753 | ||
798 | === added file 'openlp/plugins/remotes/html/jquery-migrate.min.js' | |||
799 | --- openlp/plugins/remotes/html/jquery-migrate.min.js 1970-01-01 00:00:00 +0000 | |||
800 | +++ openlp/plugins/remotes/html/jquery-migrate.min.js 2016-12-15 18:14:46 +0000 | |||
801 | @@ -0,0 +1,2 @@ | |||
802 | 1 | /*! jQuery Migrate v1.4.1 | (c) jQuery Foundation and other contributors | jquery.org/license */ | ||
803 | 2 | "undefined"==typeof jQuery.migrateMute&&(jQuery.migrateMute=!0),function(a,b,c){function d(c){var d=b.console;f[c]||(f[c]=!0,a.migrateWarnings.push(c),d&&d.warn&&!a.migrateMute&&(d.warn("JQMIGRATE: "+c),a.migrateTrace&&d.trace&&d.trace()))}function e(b,c,e,f){if(Object.defineProperty)try{return void Object.defineProperty(b,c,{configurable:!0,enumerable:!0,get:function(){return d(f),e},set:function(a){d(f),e=a}})}catch(g){}a._definePropertyBroken=!0,b[c]=e}a.migrateVersion="1.4.1";var f={};a.migrateWarnings=[],b.console&&b.console.log&&b.console.log("JQMIGRATE: Migrate is installed"+(a.migrateMute?"":" with logging active")+", version "+a.migrateVersion),a.migrateTrace===c&&(a.migrateTrace=!0),a.migrateReset=function(){f={},a.migrateWarnings.length=0},"BackCompat"===document.compatMode&&d("jQuery is not compatible with Quirks Mode");var g=a("<input/>",{size:1}).attr("size")&&a.attrFn,h=a.attr,i=a.attrHooks.value&&a.attrHooks.value.get||function(){return null},j=a.attrHooks.value&&a.attrHooks.value.set||function(){return c},k=/^(?:input|button)$/i,l=/^[238]$/,m=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,n=/^(?:checked|selected)$/i;e(a,"attrFn",g||{},"jQuery.attrFn is deprecated"),a.attr=function(b,e,f,i){var j=e.toLowerCase(),o=b&&b.nodeType;return i&&(h.length<4&&d("jQuery.fn.attr( props, pass ) is deprecated"),b&&!l.test(o)&&(g?e in g:a.isFunction(a.fn[e])))?a(b)[e](f):("type"===e&&f!==c&&k.test(b.nodeName)&&b.parentNode&&d("Can't change the 'type' of an input or button in IE 6/7/8"),!a.attrHooks[j]&&m.test(j)&&(a.attrHooks[j]={get:function(b,d){var e,f=a.prop(b,d);return f===!0||"boolean"!=typeof f&&(e=b.getAttributeNode(d))&&e.nodeValue!==!1?d.toLowerCase():c},set:function(b,c,d){var e;return c===!1?a.removeAttr(b,d):(e=a.propFix[d]||d,e in b&&(b[e]=!0),b.setAttribute(d,d.toLowerCase())),d}},n.test(j)&&d("jQuery.fn.attr('"+j+"') might use property instead of attribute")),h.call(a,b,e,f))},a.attrHooks.value={get:function(a,b){var c=(a.nodeName||"").toLowerCase();return"button"===c?i.apply(this,arguments):("input"!==c&&"option"!==c&&d("jQuery.fn.attr('value') no longer gets properties"),b in a?a.value:null)},set:function(a,b){var c=(a.nodeName||"").toLowerCase();return"button"===c?j.apply(this,arguments):("input"!==c&&"option"!==c&&d("jQuery.fn.attr('value', val) no longer sets properties"),void(a.value=b))}};var o,p,q=a.fn.init,r=a.find,s=a.parseJSON,t=/^\s*</,u=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/,v=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g,w=/^([^<]*)(<[\w\W]+>)([^>]*)$/;a.fn.init=function(b,e,f){var g,h;return b&&"string"==typeof b&&!a.isPlainObject(e)&&(g=w.exec(a.trim(b)))&&g[0]&&(t.test(b)||d("$(html) HTML strings must start with '<' character"),g[3]&&d("$(html) HTML text after last tag is ignored"),"#"===g[0].charAt(0)&&(d("HTML string cannot start with a '#' character"),a.error("JQMIGRATE: Invalid selector string (XSS)")),e&&e.context&&e.context.nodeType&&(e=e.context),a.parseHTML)?q.call(this,a.parseHTML(g[2],e&&e.ownerDocument||e||document,!0),e,f):(h=q.apply(this,arguments),b&&b.selector!==c?(h.selector=b.selector,h.context=b.context):(h.selector="string"==typeof b?b:"",b&&(h.context=b.nodeType?b:e||document)),h)},a.fn.init.prototype=a.fn,a.find=function(a){var b=Array.prototype.slice.call(arguments);if("string"==typeof a&&u.test(a))try{document.querySelector(a)}catch(c){a=a.replace(v,function(a,b,c,d){return"["+b+c+'"'+d+'"]'});try{document.querySelector(a),d("Attribute selector with '#' must be quoted: "+b[0]),b[0]=a}catch(e){d("Attribute selector with '#' was not fixed: "+b[0])}}return r.apply(this,b)};var x;for(x in r)Object.prototype.hasOwnProperty.call(r,x)&&(a.find[x]=r[x]);a.parseJSON=function(a){return a?s.apply(this,arguments):(d("jQuery.parseJSON requires a valid JSON string"),null)},a.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a.browser||(o=a.uaMatch(navigator.userAgent),p={},o.browser&&(p[o.browser]=!0,p.version=o.version),p.chrome?p.webkit=!0:p.webkit&&(p.safari=!0),a.browser=p),e(a,"browser",a.browser,"jQuery.browser is deprecated"),a.boxModel=a.support.boxModel="CSS1Compat"===document.compatMode,e(a,"boxModel",a.boxModel,"jQuery.boxModel is deprecated"),e(a.support,"boxModel",a.support.boxModel,"jQuery.support.boxModel is deprecated"),a.sub=function(){function b(a,c){return new b.fn.init(a,c)}a.extend(!0,b,this),b.superclass=this,b.fn=b.prototype=this(),b.fn.constructor=b,b.sub=this.sub,b.fn.init=function(d,e){var f=a.fn.init.call(this,d,e,c);return f instanceof b?f:b(f)},b.fn.init.prototype=b.fn;var c=b(document);return d("jQuery.sub() is deprecated"),b},a.fn.size=function(){return d("jQuery.fn.size() is deprecated; use the .length property"),this.length};var y=!1;a.swap&&a.each(["height","width","reliableMarginRight"],function(b,c){var d=a.cssHooks[c]&&a.cssHooks[c].get;d&&(a.cssHooks[c].get=function(){var a;return y=!0,a=d.apply(this,arguments),y=!1,a})}),a.swap=function(a,b,c,e){var f,g,h={};y||d("jQuery.swap() is undocumented and deprecated");for(g in b)h[g]=a.style[g],a.style[g]=b[g];f=c.apply(a,e||[]);for(g in b)a.style[g]=h[g];return f},a.ajaxSetup({converters:{"text json":a.parseJSON}});var z=a.fn.data;a.fn.data=function(b){var e,f,g=this[0];return!g||"events"!==b||1!==arguments.length||(e=a.data(g,b),f=a._data(g,b),e!==c&&e!==f||f===c)?z.apply(this,arguments):(d("Use of jQuery.fn.data('events') is deprecated"),f)};var A=/\/(java|ecma)script/i;a.clean||(a.clean=function(b,c,e,f){c=c||document,c=!c.nodeType&&c[0]||c,c=c.ownerDocument||c,d("jQuery.clean() is deprecated");var g,h,i,j,k=[];if(a.merge(k,a.buildFragment(b,c).childNodes),e)for(i=function(a){return!a.type||A.test(a.type)?f?f.push(a.parentNode?a.parentNode.removeChild(a):a):e.appendChild(a):void 0},g=0;null!=(h=k[g]);g++)a.nodeName(h,"script")&&i(h)||(e.appendChild(h),"undefined"!=typeof h.getElementsByTagName&&(j=a.grep(a.merge([],h.getElementsByTagName("script")),i),k.splice.apply(k,[g+1,0].concat(j)),g+=j.length));return k});var B=a.event.add,C=a.event.remove,D=a.event.trigger,E=a.fn.toggle,F=a.fn.live,G=a.fn.die,H=a.fn.load,I="ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",J=new RegExp("\\b(?:"+I+")\\b"),K=/(?:^|\s)hover(\.\S+|)\b/,L=function(b){return"string"!=typeof b||a.event.special.hover?b:(K.test(b)&&d("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'"),b&&b.replace(K,"mouseenter$1 mouseleave$1"))};a.event.props&&"attrChange"!==a.event.props[0]&&a.event.props.unshift("attrChange","attrName","relatedNode","srcElement"),a.event.dispatch&&e(a.event,"handle",a.event.dispatch,"jQuery.event.handle is undocumented and deprecated"),a.event.add=function(a,b,c,e,f){a!==document&&J.test(b)&&d("AJAX events should be attached to document: "+b),B.call(this,a,L(b||""),c,e,f)},a.event.remove=function(a,b,c,d,e){C.call(this,a,L(b)||"",c,d,e)},a.each(["load","unload","error"],function(b,c){a.fn[c]=function(){var a=Array.prototype.slice.call(arguments,0);return"load"===c&&"string"==typeof a[0]?H.apply(this,a):(d("jQuery.fn."+c+"() is deprecated"),a.splice(0,0,c),arguments.length?this.bind.apply(this,a):(this.triggerHandler.apply(this,a),this))}}),a.fn.toggle=function(b,c){if(!a.isFunction(b)||!a.isFunction(c))return E.apply(this,arguments);d("jQuery.fn.toggle(handler, handler...) is deprecated");var e=arguments,f=b.guid||a.guid++,g=0,h=function(c){var d=(a._data(this,"lastToggle"+b.guid)||0)%g;return a._data(this,"lastToggle"+b.guid,d+1),c.preventDefault(),e[d].apply(this,arguments)||!1};for(h.guid=f;g<e.length;)e[g++].guid=f;return this.click(h)},a.fn.live=function(b,c,e){return d("jQuery.fn.live() is deprecated"),F?F.apply(this,arguments):(a(this.context).on(b,this.selector,c,e),this)},a.fn.die=function(b,c){return d("jQuery.fn.die() is deprecated"),G?G.apply(this,arguments):(a(this.context).off(b,this.selector||"**",c),this)},a.event.trigger=function(a,b,c,e){return c||J.test(a)||d("Global events are undocumented and deprecated"),D.call(this,a,b,c||document,e)},a.each(I.split("|"),function(b,c){a.event.special[c]={setup:function(){var b=this;return b!==document&&(a.event.add(document,c+"."+a.guid,function(){a.event.trigger(c,Array.prototype.slice.call(arguments,1),b,!0)}),a._data(this,c,a.guid++)),!1},teardown:function(){return this!==document&&a.event.remove(document,c+"."+a._data(this,c)),!1}}}),a.event.special.ready={setup:function(){this===document&&d("'ready' event is deprecated")}};var M=a.fn.andSelf||a.fn.addBack,N=a.fn.find;if(a.fn.andSelf=function(){return d("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()"),M.apply(this,arguments)},a.fn.find=function(a){var b=N.apply(this,arguments);return b.context=this.context,b.selector=this.selector?this.selector+" "+a:a,b},a.Callbacks){var O=a.Deferred,P=[["resolve","done",a.Callbacks("once memory"),a.Callbacks("once memory"),"resolved"],["reject","fail",a.Callbacks("once memory"),a.Callbacks("once memory"),"rejected"],["notify","progress",a.Callbacks("memory"),a.Callbacks("memory")]];a.Deferred=function(b){var c=O(),e=c.promise();return c.pipe=e.pipe=function(){var b=arguments;return d("deferred.pipe() is deprecated"),a.Deferred(function(d){a.each(P,function(f,g){var h=a.isFunction(b[f])&&b[f];c[g[1]](function(){var b=h&&h.apply(this,arguments);b&&a.isFunction(b.promise)?b.promise().done(d.resolve).fail(d.reject).progress(d.notify):d[g[0]+"With"](this===e?d.promise():this,h?[b]:arguments)})}),b=null}).promise()},c.isResolved=function(){return d("deferred.isResolved is deprecated"),"resolved"===c.state()},c.isRejected=function(){return d("deferred.isRejected is deprecated"),"rejected"===c.state()},b&&b.call(c,c),c}}}(jQuery,window); | ||
804 | 0 | \ No newline at end of file | 3 | \ No newline at end of file |
805 | 1 | 4 | ||
806 | === modified file 'openlp/plugins/remotes/html/openlp.js' | |||
807 | --- openlp/plugins/remotes/html/openlp.js 2016-01-05 19:32:12 +0000 | |||
808 | +++ openlp/plugins/remotes/html/openlp.js 2016-12-15 18:14:46 +0000 | |||
809 | @@ -345,40 +345,42 @@ | |||
810 | 345 | $.mobile.defaultPageTransition = "none"; | 345 | $.mobile.defaultPageTransition = "none"; |
811 | 346 | }); | 346 | }); |
812 | 347 | // Service Manager | 347 | // Service Manager |
821 | 348 | $("#service-manager").live("pagebeforeshow", OpenLP.loadService); | 348 | $("#service-manager").on("pagebeforeshow", OpenLP.loadService); |
822 | 349 | $("#service-refresh").live("click", OpenLP.loadService); | 349 | $("#service-refresh").on("click", OpenLP.loadService); |
823 | 350 | $("#service-next").live("click", OpenLP.nextItem); | 350 | $("#service-next").on("click", OpenLP.nextItem); |
824 | 351 | $("#service-previous").live("click", OpenLP.previousItem); | 351 | $("#service-previous").on("click", OpenLP.previousItem); |
825 | 352 | $("#service-blank").live("click", OpenLP.blankDisplay); | 352 | $("#service-blank").on("click", OpenLP.blankDisplay); |
826 | 353 | $("#service-theme").live("click", OpenLP.themeDisplay); | 353 | $("#service-theme").on("click", OpenLP.themeDisplay); |
827 | 354 | $("#service-desktop").live("click", OpenLP.desktopDisplay); | 354 | $("#service-desktop").on("click", OpenLP.desktopDisplay); |
828 | 355 | $("#service-show").live("click", OpenLP.showDisplay); | 355 | $("#service-show").on("click", OpenLP.showDisplay); |
829 | 356 | // Slide Controller | 356 | // Slide Controller |
838 | 357 | $("#slide-controller").live("pagebeforeshow", OpenLP.loadController); | 357 | $("#slide-controller").on("pagebeforeshow", OpenLP.loadController); |
839 | 358 | $("#controller-refresh").live("click", OpenLP.loadController); | 358 | $("#controller-refresh").on("click", OpenLP.loadController); |
840 | 359 | $("#controller-next").live("click", OpenLP.nextSlide); | 359 | $("#controller-next").on("click", OpenLP.nextSlide); |
841 | 360 | $("#controller-previous").live("click", OpenLP.previousSlide); | 360 | $("#controller-previous").on("click", OpenLP.previousSlide); |
842 | 361 | $("#controller-blank").live("click", OpenLP.blankDisplay); | 361 | $("#controller-blank").on("click", OpenLP.blankDisplay); |
843 | 362 | $("#controller-theme").live("click", OpenLP.themeDisplay); | 362 | $("#controller-theme").on("click", OpenLP.themeDisplay); |
844 | 363 | $("#controller-desktop").live("click", OpenLP.desktopDisplay); | 363 | $("#controller-desktop").on("click", OpenLP.desktopDisplay); |
845 | 364 | $("#controller-show").live("click", OpenLP.showDisplay); | 364 | $("#controller-show").on("click", OpenLP.showDisplay); |
846 | 365 | // Alerts | 365 | // Alerts |
848 | 366 | $("#alert-submit").live("click", OpenLP.showAlert); | 366 | $("#alert-submit").on("click", OpenLP.showAlert); |
849 | 367 | // Search | 367 | // Search |
852 | 368 | $("#search-submit").live("click", OpenLP.search); | 368 | $("#search-submit").on("click", OpenLP.search); |
853 | 369 | $("#search-text").live("keypress", function(event) { | 369 | $("#search-text").on("keypress", function(event) { |
854 | 370 | if (event.which == 13) | 370 | if (event.which == 13) |
855 | 371 | { | 371 | { |
856 | 372 | OpenLP.search(event); | 372 | OpenLP.search(event); |
857 | 373 | } | 373 | } |
858 | 374 | }); | 374 | }); |
862 | 375 | $("#go-live").live("click", OpenLP.goLive); | 375 | $("#go-live").on("click", OpenLP.goLive); |
863 | 376 | $("#add-to-service").live("click", OpenLP.addToService); | 376 | $("#add-to-service").on("click", OpenLP.addToService); |
864 | 377 | $("#add-and-go-to-service").live("click", OpenLP.addAndGoToService); | 377 | $("#add-and-go-to-service").on("click", OpenLP.addAndGoToService); |
865 | 378 | // Poll the server twice a second to get any updates. | 378 | // Poll the server twice a second to get any updates. |
866 | 379 | $.ajaxSetup({cache: false}); | 379 | $.ajaxSetup({cache: false}); |
868 | 380 | $("#search").live("pageinit", function (event) { | 380 | console.log("hook"); |
869 | 381 | $("#search").on("pageinit", function (event) { | ||
870 | 382 | console.log("Page init!"); | ||
871 | 381 | OpenLP.getSearchablePlugins(); | 383 | OpenLP.getSearchablePlugins(); |
872 | 382 | }); | 384 | }); |
874 | 383 | setInterval("OpenLP.pollServer();", 500); | 385 | setInterval(OpenLP.pollServer, 500); |
875 | 384 | OpenLP.pollServer(); | 386 | OpenLP.pollServer(); |
876 | 385 | 387 | ||
877 | === modified file 'tests/interfaces/openlp_core_ui/test_shortcutlistform.py' | |||
878 | --- tests/interfaces/openlp_core_ui/test_shortcutlistform.py 2016-02-12 19:46:04 +0000 | |||
879 | +++ tests/interfaces/openlp_core_ui/test_shortcutlistform.py 2016-12-15 18:14:46 +0000 | |||
880 | @@ -28,6 +28,7 @@ | |||
881 | 28 | 28 | ||
882 | 29 | from openlp.core.common import Registry | 29 | from openlp.core.common import Registry |
883 | 30 | from openlp.core.ui.shortcutlistform import ShortcutListForm | 30 | from openlp.core.ui.shortcutlistform import ShortcutListForm |
884 | 31 | from openlp.core.ui.shortcutlistdialog import CaptureShortcutButton, ShortcutTreeWidget | ||
885 | 31 | 32 | ||
886 | 32 | from tests.interfaces import MagicMock, patch | 33 | from tests.interfaces import MagicMock, patch |
887 | 33 | from tests.helpers.testmixin import TestMixin | 34 | from tests.helpers.testmixin import TestMixin |
888 | @@ -227,3 +228,34 @@ | |||
889 | 227 | mocked_action_shortcuts.assert_called_with(mocked_action) | 228 | mocked_action_shortcuts.assert_called_with(mocked_action) |
890 | 228 | mocked_refresh_shortcut_list.assert_called_with() | 229 | mocked_refresh_shortcut_list.assert_called_with() |
891 | 229 | mocked_set_text.assert_called_with('Esc') | 230 | mocked_set_text.assert_called_with('Esc') |
892 | 231 | |||
893 | 232 | |||
894 | 233 | def test_key_press_event(): | ||
895 | 234 | """ | ||
896 | 235 | Test the keyPressEvent method | ||
897 | 236 | """ | ||
898 | 237 | # GIVEN: A checked button and a mocked event | ||
899 | 238 | button = CaptureShortcutButton() | ||
900 | 239 | button.setChecked(True) | ||
901 | 240 | mocked_event = MagicMock() | ||
902 | 241 | mocked_event.key.return_value = QtCore.Qt.Key_Space | ||
903 | 242 | |||
904 | 243 | # WHEN: keyPressEvent is called with an event that should be ignored | ||
905 | 244 | button.keyPressEvent(mocked_event) | ||
906 | 245 | |||
907 | 246 | # THEN: The ignore() method on the event should have been called | ||
908 | 247 | mocked_event.ignore.assert_called_once_with() | ||
909 | 248 | |||
910 | 249 | |||
911 | 250 | def test_keyboard_search(): | ||
912 | 251 | """ | ||
913 | 252 | Test the keyboardSearch method of the ShortcutTreeWidget | ||
914 | 253 | """ | ||
915 | 254 | # GIVEN: A ShortcutTreeWidget | ||
916 | 255 | widget = ShortcutTreeWidget() | ||
917 | 256 | |||
918 | 257 | # WHEN: keyboardSearch() is called | ||
919 | 258 | widget.keyboardSearch('') | ||
920 | 259 | |||
921 | 260 | # THEN: Nothing happens | ||
922 | 261 | assert True |
"Once and for all" are rather big words ;)