diff --git a/e107_handlers/js_manager.php b/e107_handlers/js_manager.php index 6c27d55ab..020adec83 100644 --- a/e107_handlers/js_manager.php +++ b/e107_handlers/js_manager.php @@ -24,12 +24,7 @@ class e_jsmanager 'scriptaculous/effects.js', 'e107.js', ), - 'jquery' => array( - "https://cdn.jsdelivr.net/jquery/2.2.4/jquery.min.js", - // jQuery Once filters out all elements that had the same filter applied on them before. It can be used to - // ensure that a function is only applied once to an element. jQuery Once is used in e107.behaviors. - "https://cdnjs.cloudflare.com/ajax/libs/jquery-once/2.1.1/jquery.once.min.js", - ), + 'jquery' => array(), ); /** @@ -236,24 +231,25 @@ class e_jsmanager { // Try to auto-detect runtime location $this->setInAdmin(defset('e_ADMIN_AREA', false)); - - if($this->isInAdmin()) // Include jquery-ui in the admin-area only - Jquery-UI to eventually be removed from e107 completely if possible. - { - $minified = deftrue('e_DEBUG') == true ? null : 'minified'; + $minified = deftrue('e_DEBUG') == true ? null : 'minified'; + + if(isset($_SERVER['E_DEV_LOCALJS']) && $_SERVER['E_DEV_LOCALJS'] === 'true' || !deftrue('e_CDN',true)) // Test with Local JS Framework files. + { + // TODO + } + elseif($this->isInAdmin()) + { e107::library('load', 'cdn.jquery', $minified); // jQuery Once is used in e107.behaviors. e107::library('load', 'cdn.jquery.once', $minified); e107::library('load', 'cdn.jquery.ui', $minified); - - $this->_libraries['jquery'] = array(); } - - if(isset($_SERVER['E_DEV_LOCALJS']) && $_SERVER['E_DEV_LOCALJS'] === 'true' || !deftrue('e_CDN',true)) // Test with Local JS Framework files. + else { - $this->_libraries['jquery'] = array( - "jquery/jquery.min.js" - ); + e107::library('load', 'cdn.jquery', $minified); + // jQuery Once is used in e107.behaviors. + e107::library('load', 'cdn.jquery.once', $minified); } $customJqueryUrls = e107::getPref('library-jquery-urls');