Skip to content

Commit

Permalink
WORKING: remove all js from index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
1ambda committed Dec 28, 2016
1 parent 71de16f commit d715d2a
Show file tree
Hide file tree
Showing 20 changed files with 58 additions and 39 deletions.
2 changes: 1 addition & 1 deletion zeppelin-web/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ module.exports = function(grunt) {
grunt.registerTask('webpack', 'Prepare webpack build', function(target) {
grunt.task.run([
// 'clean:server',
'copy:webpack',
// 'copy:webpack',
// 'copy:dev',
// 'postcss',
]);
Expand Down
2 changes: 1 addition & 1 deletion zeppelin-web/src/app/handsontable/handsonHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
'use strict';

var zeppelin = zeppelin || {};
import zeppelin from '../zeppelin';

/**
* HandsonHelper class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*/
'use strict';

import zeppelin from '../../../zeppelin';

(function() {

angular.module('zeppelinWebApp').controller('ResultCtrl', ResultCtrl);
Expand Down
2 changes: 1 addition & 1 deletion zeppelin-web/src/app/tabledata/columnselector.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

var zeppelin = zeppelin || {};
import zeppelin from '../zeppelin';

/**
* select columns
Expand Down
2 changes: 1 addition & 1 deletion zeppelin-web/src/app/tabledata/passthrough.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

var zeppelin = zeppelin || {};
import zeppelin from '../zeppelin';

/**
* passthough the data
Expand Down
2 changes: 1 addition & 1 deletion zeppelin-web/src/app/tabledata/pivot.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

var zeppelin = zeppelin || {};
import zeppelin from '../zeppelin';

/**
* pivot table data and return d3 chart data
Expand Down
2 changes: 1 addition & 1 deletion zeppelin-web/src/app/tabledata/tabledata.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

var zeppelin = zeppelin || {};
import zeppelin from '../zeppelin';

/**
* Create table data object from paragraph table type result
Expand Down
2 changes: 1 addition & 1 deletion zeppelin-web/src/app/tabledata/transformation.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

var zeppelin = zeppelin || {};
import zeppelin from '../zeppelin';

/**
* Base class for visualization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

var zeppelin = zeppelin || {};
import zeppelin from '../../zeppelin';

/**
* Visualize data in area chart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

var zeppelin = zeppelin || {};
import zeppelin from '../../zeppelin';

/**
* Visualize data in bar char
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

var zeppelin = zeppelin || {};
import zeppelin from '../../zeppelin';

/**
* Visualize data in line chart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

var zeppelin = zeppelin || {};
import zeppelin from '../../zeppelin';

/**
* Visualize data in table format
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

var zeppelin = zeppelin || {};
import zeppelin from '../../zeppelin';

/**
* Visualize data in pie chart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

var zeppelin = zeppelin || {};
import zeppelin from '../../zeppelin';

/**
* Visualize data in scatter char
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

var zeppelin = zeppelin || {};
import zeppelin from '../../zeppelin';

/**
* Visualize data in table format
Expand Down
2 changes: 1 addition & 1 deletion zeppelin-web/src/app/visualization/visualization.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

var zeppelin = zeppelin || {};
import zeppelin from '../zeppelin';

/**
* Base class for visualization
Expand Down
8 changes: 6 additions & 2 deletions zeppelin-web/src/app/zeppelin.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@

'use strict';

var zeppelin = {};
// Used as globally shared variable in
// `src/app/visualization/**/*js`
// `src/app/tabledata/*.js`
// `src/app/notebook/paragraph/result/result.controller.js`
// see also: ProvidePlugin in webpack.config.js

export default zeppelin;
export default {};
15 changes: 0 additions & 15 deletions zeppelin-web/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -167,20 +167,5 @@
<script src="bower_components/ngclipboard/dist/ngclipboard.js"></script>
<!-- endbower -->
<!-- endbuild -->
<!-- build:js({.tmp,src}) scripts/scripts.js -->
<script src="app/tabledata/tabledata.js"></script>
<script src="app/tabledata/transformation.js"></script>
<script src="app/tabledata/pivot.js"></script>
<script src="app/tabledata/passthrough.js"></script>
<script src="app/tabledata/columnselector.js"></script>
<script src="app/visualization/visualization.js"></script>
<script src="app/visualization/builtins/visualization-table.js"></script>
<script src="app/visualization/builtins/visualization-nvd3chart.js"></script>
<script src="app/visualization/builtins/visualization-barchart.js"></script>
<script src="app/visualization/builtins/visualization-piechart.js"></script>
<script src="app/visualization/builtins/visualization-areachart.js"></script>
<script src="app/visualization/builtins/visualization-linechart.js"></script>
<script src="app/visualization/builtins/visualization-scatterchart.js"></script>
<!-- endbuild -->
</body>
</html>
31 changes: 31 additions & 0 deletions zeppelin-web/src/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,39 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import './app/app.js';
import './app/app.controller.js';
import './app/home/home.controller.js';
import './app/handsontable/handsonHelper.js';
import './app/notebook/notebook.controller.js';

/** start: global variable `zeppelin` related files */
import './app/tabledata/tabledata.js';
import './app/tabledata/transformation.js';
import './app/tabledata/pivot.js';
import './app/tabledata/passthrough.js';
import './app/tabledata/columnselector.js';
import './app/visualization/visualization.js';
import './app/visualization/builtins/visualization-table.js';
import './app/visualization/builtins/visualization-nvd3chart.js';
import './app/visualization/builtins/visualization-barchart.js';
import './app/visualization/builtins/visualization-piechart.js';
import './app/visualization/builtins/visualization-areachart.js';
import './app/visualization/builtins/visualization-linechart.js';
import './app/visualization/builtins/visualization-scatterchart.js';
/** end: global variable `zeppelin` related files */

import './app/jobmanager/jobmanager.controller.js';
import './app/jobmanager/jobs/job.controller.js';
import './app/jobmanager/jobmanager.filter.js';
Expand Down
11 changes: 4 additions & 7 deletions zeppelin-web/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,12 @@ module.exports = function makeWebpackConfig () {
* List: http://webpack.github.io/docs/list-of-plugins.html
*/
config.plugins = [
// Enable global variable
new webpack.ProvidePlugin({
"zeppelin": "zeppelin"
})
];

/**
* ProvidePlugin: Used to define global variable `zeppelin`
*/
var providePlugin = new webpack.ProvidePlugin({
"zeppelin": "zeppelin"
});

// Skip rendering index.html in test mode
if (!isTest) {
// Reference: https://github.com/ampedandwired/html-webpack-plugin
Expand Down

0 comments on commit d715d2a

Please sign in to comment.