From 0618e89be2362130ca4703046800db1ace05e05a Mon Sep 17 00:00:00 2001 From: "James D. Forrester" Date: Wed, 23 Jul 2014 12:57:40 -0700 Subject: [PATCH] resources: Switch oojs to the version optimised for environments with jQuery Change-Id: Ic8cc04c2e89203825efe64ecc3c91d0cae0b2daa --- maintenance/resources/update-oojs.sh | 2 +- resources/Resources.php | 2 +- .../lib/oojs/{oojs.js => oojs.jquery.js} | 35 ++----------------- 3 files changed, 5 insertions(+), 34 deletions(-) rename resources/lib/oojs/{oojs.js => oojs.jquery.js} (95%) diff --git a/maintenance/resources/update-oojs.sh b/maintenance/resources/update-oojs.sh index 21e847bfbc..d9e6fb9d92 100755 --- a/maintenance/resources/update-oojs.sh +++ b/maintenance/resources/update-oojs.sh @@ -33,7 +33,7 @@ then fi # Copy file(s) -rsync --recursive --delete --force ./node_modules/oojs/dist "$REPO_DIR/$TARGET_DIR" || exit 1 +rsync --force ./node_modules/oojs/dist/oojs.jquery.js "$REPO_DIR/$TARGET_DIR" || exit 1 # Clean up temporary area rm -rf "$NPM_DIR" diff --git a/resources/Resources.php b/resources/Resources.php index ae95a569c5..3ffbc05824 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -1473,7 +1473,7 @@ return array( /* OOjs */ 'oojs' => array( 'scripts' => array( - 'resources/lib/oojs/oojs.js', + 'resources/lib/oojs/oojs.jquery.js', ), 'targets' => array( 'desktop', 'mobile' ), 'dependencies' => array( diff --git a/resources/lib/oojs/oojs.js b/resources/lib/oojs/oojs.jquery.js similarity index 95% rename from resources/lib/oojs/oojs.js rename to resources/lib/oojs/oojs.jquery.js index 8ccd50ab6f..cb8ec2d320 100644 --- a/resources/lib/oojs/oojs.js +++ b/resources/lib/oojs/oojs.jquery.js @@ -6,7 +6,7 @@ * Released under the MIT license * http://oojs.mit-license.org * - * Date: Wed Jun 18 2014 20:03:40 GMT-0700 (PDT) + * Date: Wed Jul 23 2014 12:55:43 GMT-0700 (PDT) */ ( function ( global ) { @@ -442,38 +442,9 @@ oo.simpleArrayIntersection = function ( a, b ) { oo.simpleArrayDifference = function ( a, b ) { return simpleArrayCombine( a, b, false ); }; -/*global hasOwn, toString */ +/*global $ */ -/** - * Assert whether a value is a plain object or not. - * - * @param {Mixed} obj - * @return {boolean} - */ -oo.isPlainObject = function ( obj ) { - /*jshint eqnull:true, eqeqeq:false */ - - // Any object or value whose internal [[Class]] property is not "[object Object]" - // Support IE8: Explicitly filter out DOM nodes - // Support IE8: Explicitly filter out Window object (needs loose comparison) - if ( !obj || toString.call( obj ) !== '[object Object]' || obj.nodeType || ( obj != null && obj == obj.window ) ) { - return false; - } - - // The try/catch suppresses exceptions thrown when attempting to access - // the "constructor" property of certain host objects suich as window.location - // in Firefox < 20 (https://bugzilla.mozilla.org/814622) - try { - if ( obj.constructor && - !hasOwn.call( obj.constructor.prototype, 'isPrototypeOf' ) ) { - return false; - } - } catch ( e ) { - return false; - } - - return true; -}; +oo.isPlainObject = $.isPlainObject; /** * @class OO.EventEmitter * -- 2.20.1