Commit a0bd73f2 by Spencer Alger

Previous fix did not work when jQuery was inlined into app.js because RequireJS…

Previous fix did not work when jQuery was inlined into app.js because RequireJS was under the impression that it had already init-ed jQuery and didn't call the init function. This new strategy just allows jQuery to be jQuery and has app.js include the extensions (components/extend-jquery.js) before the app boots.
parent 2a1c67ff
This source diff could not be displayed because it is too large. You can view the blob instead.
/*! kibana - v3.0.0m3pre - 2013-09-14 /*! kibana - v3.0.0m3pre - 2013-09-14
* Copyright (c) 2013 Rashid Khan; Licensed Apache License */ * Copyright (c) 2013 Rashid Khan; Licensed Apache License */
require.config({baseUrl:"app",paths:{config:"../config",settings:"components/settings",kbn:"components/kbn",css:"../vendor/require/css",text:"../vendor/require/text",moment:"../vendor/moment",filesaver:"../vendor/filesaver",angular:"../vendor/angular/angular","angular-strap":"../vendor/angular/angular-strap","angular-sanitize":"../vendor/angular/angular-sanitize",timepicker:"../vendor/angular/timepicker",datepicker:"../vendor/angular/datepicker",underscore:"components/underscore.extended","underscore-src":"../vendor/underscore",bootstrap:"../vendor/bootstrap/bootstrap",jquery:"components/jquery.extended","jquery-src":"../vendor/jquery/jquery-1.8.0","jquery.flot":"../vendor/jquery/jquery.flot","jquery.flot.pie":"../vendor/jquery/jquery.flot.pie","jquery.flot.selection":"../vendor/jquery/jquery.flot.selection","jquery.flot.stack":"../vendor/jquery/jquery.flot.stack","jquery.flot.time":"../vendor/jquery/jquery.flot.time",modernizr:"../vendor/modernizr-2.6.1",elasticjs:"../vendor/elasticjs/elastic-angular-client"},shim:{underscore:{exports:"_"},angular:{deps:["jquery"],exports:"angular"},bootstrap:{deps:["jquery"]},modernizr:{exports:"Modernizr"},"jquery-src":{init:function(a){return function(){var b=a.jQuery;return require.undef("jquery"),b}}(this)},"jquery.flot":["jquery"],"jquery.flot.pie":["jquery","jquery.flot"],"jquery.flot.selection":["jquery","jquery.flot"],"jquery.flot.stack":["jquery","jquery.flot"],"jquery.flot.time":["jquery","jquery.flot"],"angular-sanitize":["angular"],"angular-cookies":["angular"],"angular-loader":["angular"],"angular-mocks":["angular"],"angular-resource":["angular"],"angular-route":["angular"],"angular-touch":["angular"],"angular-strap":["angular","bootstrap","timepicker","datepicker"],timepicker:["jquery","bootstrap"],datepicker:["jquery","bootstrap"],elasticjs:["angular","../vendor/elasticjs/elastic"]}}); require.config({baseUrl:"app",paths:{config:"../config",settings:"components/settings",kbn:"components/kbn",css:"../vendor/require/css",text:"../vendor/require/text",moment:"../vendor/moment",filesaver:"../vendor/filesaver",angular:"../vendor/angular/angular","angular-strap":"../vendor/angular/angular-strap","angular-sanitize":"../vendor/angular/angular-sanitize",timepicker:"../vendor/angular/timepicker",datepicker:"../vendor/angular/datepicker",underscore:"components/underscore.extended","underscore-src":"../vendor/underscore",bootstrap:"../vendor/bootstrap/bootstrap",jquery:"../vendor/jquery/jquery-1.8.0","jquery.kbn":"components/jquery.kbn","jquery.flot":"../vendor/jquery/jquery.flot","jquery.flot.pie":"../vendor/jquery/jquery.flot.pie","jquery.flot.selection":"../vendor/jquery/jquery.flot.selection","jquery.flot.stack":"../vendor/jquery/jquery.flot.stack","jquery.flot.time":"../vendor/jquery/jquery.flot.time",modernizr:"../vendor/modernizr-2.6.1",elasticjs:"../vendor/elasticjs/elastic-angular-client"},shim:{underscore:{exports:"_"},angular:{deps:["jquery"],exports:"angular"},bootstrap:{deps:["jquery"]},modernizr:{exports:"Modernizr"},jquery:{exports:"jQuery"},"jquery.flot":["jquery"],"jquery.flot.pie":["jquery","jquery.flot"],"jquery.flot.selection":["jquery","jquery.flot"],"jquery.flot.stack":["jquery","jquery.flot"],"jquery.flot.time":["jquery","jquery.flot"],"angular-sanitize":["angular"],"angular-cookies":["angular"],"angular-loader":["angular"],"angular-mocks":["angular"],"angular-resource":["angular"],"angular-route":["angular"],"angular-touch":["angular"],"angular-strap":["angular","bootstrap","timepicker","datepicker"],timepicker:["jquery","bootstrap"],datepicker:["jquery","bootstrap"],elasticjs:["angular","../vendor/elasticjs/elastic"]}});
\ No newline at end of file \ No newline at end of file
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
app/app.js app/app.js
---------------- ----------------
vendor/jquery/jquery-1.8.0.js vendor/jquery/jquery-1.8.0.js
app/components/jquery.extended.js
vendor/angular/angular.js vendor/angular/angular.js
vendor/underscore.js vendor/underscore.js
app/components/underscore.extended.js app/components/underscore.extended.js
...@@ -13,6 +12,7 @@ vendor/angular/angular-sanitize.js ...@@ -13,6 +12,7 @@ vendor/angular/angular-sanitize.js
vendor/angular/timepicker.js vendor/angular/timepicker.js
vendor/angular/datepicker.js vendor/angular/datepicker.js
vendor/angular/angular-strap.js vendor/angular/angular-strap.js
app/components/jquery.kbn.js
app/components/settings.js app/components/settings.js
app/services/alertSrv.js app/services/alertSrv.js
vendor/modernizr-2.6.1.js vendor/modernizr-2.6.1.js
......
...@@ -10,7 +10,8 @@ define([ ...@@ -10,7 +10,8 @@ define([
'elasticjs', 'elasticjs',
'bootstrap', 'bootstrap',
'angular-sanitize', 'angular-sanitize',
'angular-strap' 'angular-strap',
'extend-jquery'
], ],
function (angular, $, _, appLevelRequire) { function (angular, $, _, appLevelRequire) {
"use strict"; "use strict";
......
define(['jquery-src'], define(['jquery'],
function ($) { function ($) {
'use strict'; 'use strict';
......
...@@ -23,8 +23,10 @@ require.config({ ...@@ -23,8 +23,10 @@ require.config({
'underscore-src': '../vendor/underscore', 'underscore-src': '../vendor/underscore',
bootstrap: '../vendor/bootstrap/bootstrap', bootstrap: '../vendor/bootstrap/bootstrap',
jquery: 'components/jquery.extended', jquery: '../vendor/jquery/jquery-1.8.0',
'jquery-src': '../vendor/jquery/jquery-1.8.0',
'extend-jquery': 'components/extend-jquery.js',
'jquery.flot': '../vendor/jquery/jquery.flot', 'jquery.flot': '../vendor/jquery/jquery.flot',
'jquery.flot.pie': '../vendor/jquery/jquery.flot.pie', 'jquery.flot.pie': '../vendor/jquery/jquery.flot.pie',
'jquery.flot.selection': '../vendor/jquery/jquery.flot.selection', 'jquery.flot.selection': '../vendor/jquery/jquery.flot.selection',
...@@ -54,17 +56,8 @@ require.config({ ...@@ -54,17 +56,8 @@ require.config({
exports: 'Modernizr' exports: 'Modernizr'
}, },
'jquery-src': { jquery: {
init: (function (global) { exports: 'jQuery'
'use strict';
return function () {
var jQuery = global.jQuery;
// jquery defines itself, but we want to extend it and provide our version as the 'jquery'
// package
require.undef('jquery');
return jQuery;
};
})(this)
}, },
// simple dependency declatation // simple dependency declatation
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment