From 2857511ac968564998ab70d268085dc100a070b4 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 15 Jun 2016 08:54:12 +0200 Subject: [PATCH] calling jQuery.noConflict() as early as possible to NOT occupy $ variable stalling many SiteMgr templates --- Gruntfile.js | 1 + api/js/jquery/jquery.noconflict.js | 16 ++++++++++++++++ api/src/Framework.php | 1 + api/src/Framework/Bundle.php | 1 + 4 files changed, 19 insertions(+) create mode 100644 api/js/jquery/jquery.noconflict.js diff --git a/Gruntfile.js b/Gruntfile.js index 1e1123f4bd..b6b451bbaf 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -54,6 +54,7 @@ module.exports = function (grunt) { files: { "api/js/jsapi.min.js": [ "vendor/bower-asset/jquery/dist/jquery.js", + "api/js/jquery/jquery.noconflict.js", "vendor/bower-asset/jquery-ui/jquery-ui.js", "api/js/jsapi/jsapi.js", "api/js/egw_json.js", diff --git a/api/js/jquery/jquery.noconflict.js b/api/js/jquery/jquery.noconflict.js new file mode 100644 index 0000000000..1f0047921b --- /dev/null +++ b/api/js/jquery/jquery.noconflict.js @@ -0,0 +1,16 @@ +/** + * EGroupware API: switch jQuery to NOT use $ as early as possible + * + * @link http://www.egroupware.org + * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License + * @package api + * @subpackage ajax + * @author Ralf Becker + * @version $Id$ + */ + +/*egw:uses + /vendor/bower-asset/jquery/dist/jquery.js; +*/ + +jQuery.noConflict(); \ No newline at end of file diff --git a/api/src/Framework.php b/api/src/Framework.php index 483fde5c39..61d6c8f14f 100644 --- a/api/src/Framework.php +++ b/api/src/Framework.php @@ -168,6 +168,7 @@ abstract class Framework extends Framework\Extra // allways load jquery (not -ui) first '/vendor/bower-asset/jquery/dist/jquery.js', + '/api/js/jquery/jquery.noconflict.js', // always include javascript helper functions '/api/js/jsapi/jsapi.js', '/api/js/jsapi/egw.js', diff --git a/api/src/Framework/Bundle.php b/api/src/Framework/Bundle.php index 3fc2d4ad6b..5097ff2538 100644 --- a/api/src/Framework/Bundle.php +++ b/api/src/Framework/Bundle.php @@ -214,6 +214,7 @@ class Bundle // generate api bundle $inc_mgr->include_js_file('/vendor/bower-asset/jquery/dist/jquery.js'); + $inc_mgr->include_js_file('/api/js/jquery/jquery.noconflict.js'); $inc_mgr->include_js_file('/vendor/bower-asset/jquery-ui/jquery-ui.js'); $inc_mgr->include_js_file('/api/js/jsapi/jsapi.js'); $inc_mgr->include_js_file('/api/js/egw_json.js');