From 842f063eaa519c20109ac1100239e6c9c27705cf Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Fri, 27 Jun 2014 10:05:30 +0100 Subject: [PATCH] Change use of maybe-defined "mkws_jQuery" to avoid assigning to an undefined variable. Fixes the "make phantomjs" Jenkins error: Strict mode forbids implicit creation of global property 'mkws_jQuery' Note: not yet tested as part of installation (which we need so we can check that Seb's widgets embedded in the blog still work). I am pushing so that I can onto the live site and verify that. If there's a problem there, I'll revert and try again. --- src/mkws-core.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/mkws-core.js b/src/mkws-core.js index 7c74664..dd106f7 100644 --- a/src/mkws-core.js +++ b/src/mkws-core.js @@ -96,8 +96,11 @@ var mkws = { }; // We may be using a separate copy -if (typeof(mkws_jQuery) === "undefined") mkws_jQuery = jQuery; -mkws.$ = mkws_jQuery; +if (typeof(mkws_jQuery) !== "undefined") { + mkws.$ = mkws_jQuery; +} else { + mkws.$ = jQuery; +} mkws.log = function(string) { if (!mkws.log_level) @@ -609,4 +612,4 @@ mkws.pagerNext = function(tname) { var widgetSelector = selectorForAllWidgets(); if (widgetSelector && $(widgetSelector).length !== 0) init(); }); -})(mkws_jQuery); +})(mkws.$); -- 1.7.10.4