Repository: incubator-blur Updated Branches: refs/heads/apache-blur-0.2 5362d891f -> d9e844c60
uglify js Signed-off-by: Chris Rohr <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/a121a90d Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/a121a90d Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/a121a90d Branch: refs/heads/apache-blur-0.2 Commit: a121a90deb6773e5754c21f31b0467982a8a4458 Parents: 5362d89 Author: Andrew Avenoso <[email protected]> Authored: Thu Jun 12 16:50:15 2014 -0400 Committer: Chris Rohr <[email protected]> Committed: Tue Jun 17 07:30:21 2014 -0400 ---------------------------------------------------------------------- contrib/blur-console/src/main/webapp/.gitignore | 3 +- .../blur-console/src/main/webapp/Gruntfile.js | 46 +++++++++++++-- contrib/blur-console/src/main/webapp/banner | 16 +++++ contrib/blur-console/src/main/webapp/index.html | 31 +--------- .../src/main/webapp/js/blurconsole.overrides.js | 62 -------------------- .../blur-console/src/main/webapp/package.json | 2 + 6 files changed, 61 insertions(+), 99 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a121a90d/contrib/blur-console/src/main/webapp/.gitignore ---------------------------------------------------------------------- diff --git a/contrib/blur-console/src/main/webapp/.gitignore b/contrib/blur-console/src/main/webapp/.gitignore index 9b6b25c..0a63380 100644 --- a/contrib/blur-console/src/main/webapp/.gitignore +++ b/contrib/blur-console/src/main/webapp/.gitignore @@ -2,6 +2,7 @@ build/ libs/* css/* jsc/* +script test/reports .tmp -.sass-cache \ No newline at end of file +.sass-cache http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a121a90d/contrib/blur-console/src/main/webapp/Gruntfile.js ---------------------------------------------------------------------- diff --git a/contrib/blur-console/src/main/webapp/Gruntfile.js b/contrib/blur-console/src/main/webapp/Gruntfile.js index 551762c..18e60ca 100644 --- a/contrib/blur-console/src/main/webapp/Gruntfile.js +++ b/contrib/blur-console/src/main/webapp/Gruntfile.js @@ -31,6 +31,7 @@ module.exports = function (grunt) { // Define the configuration for all the tasks grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), + banner: grunt.file.read('banner'), clean: ['css'], @@ -75,6 +76,38 @@ module.exports = function (grunt) { } }, + uglify: { + js: { + options: { + sourceMap: true, + sourceMapIncludeSources: true, + banner:'/*\n<%= banner %>\n*/', + compress: { + drop_console: true + } + }, + files: { + 'script/ugly.js': [ + 'libs/jquery/dist/jquery.js', + 'js/utils/*\.js', + 'libs/twbs-bootstrap-sass/vendor/assets/javascripts/bootstrap/tooltip.js', + 'libs/twbs-bootstrap-sass/vendor/assets/javascripts/bootstrap/modal.js', + 'libs/twbs-bootstrap-sass/vendor/assets/javascripts/bootstrap/transition.js', + 'libs/twbs-bootstrap-sass/vendor/assets/javascripts/bootstrap/popover.js', + 'libs/twbs-bootstrap-sass/vendor/assets/javascripts/bootstrap/collapse.js', + 'libs/twbs-bootstrap-sass/vendor/assets/javascripts/bootstrap/tab.js', + 'libs/flot/jquery.flot.js', + 'libs/flot/jquery.flot.pie.js', + 'libs/flot/jquery.flot.categories.js', + 'libs/flot/jquery.flot.stack.js', + 'libs/typeahead.js/dist/typeahead.jquery.js', + 'js/blurconsole.js', + 'js/*\.js' + ] + } + } + }, + // Make sure code styles are up to par and there are no obvious mistakes jshint: { options: { @@ -105,9 +138,9 @@ module.exports = function (grunt) { files: ['sass/**/*.scss', 'libs/**/*.css', 'libs/**/*.scss'], tasks: ['sass:development', 'notify:css'] }, - lint: { + js: { files: ['js/**/*.js'], - tasks: ['jshint:development'] + tasks: ['jshint:development', 'combine:js', 'uglify:js'] }, livereload: { options: { @@ -179,6 +212,7 @@ module.exports = function (grunt) { grunt.loadNpmTasks('grunt-notify'); grunt.loadNpmTasks('grunt-mocha-selenium'); grunt.loadNpmTasks('grunt-karma'); + grunt.loadNpmTasks('grunt-contrib-uglify'); var initialHintSrc = grunt.config('jshint.development.src'); grunt.event.on('watch', function(action, filepath){ @@ -193,8 +227,8 @@ module.exports = function (grunt) { grunt.registerTask('test:unit', 'Run JavaScript Unit Tests', ['karma']); grunt.registerTask('test:style', 'Run JavaScript CodeStyle reports', ['jshint:ci'/*, 'plato:ci' */]); grunt.registerTask('style:development', 'Run JavaScript CodeStyle reports', ['jshint:development']); - grunt.registerTask('development', 'Build sass for development', ['sass:development']); - grunt.registerTask('production', 'Build sass for production', ['sass:production']); - grunt.registerTask('serve', 'Run development server', ['clean','sass:development', 'connect:livereload','watch']); - grunt.registerTask('default', ['clean', 'development', 'style:development', 'watch']); + grunt.registerTask('development', 'Build for development', ['sass:development', 'uglify:js']); + grunt.registerTask('production', 'Build for production', ['sass:production', 'uglify:js']); + grunt.registerTask('serve', 'Run development server', ['clean','sass:development', 'uglify:js', 'connect:livereload','watch']); + grunt.registerTask('default', ['clean', 'style:development', 'development', 'watch']); }; http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a121a90d/contrib/blur-console/src/main/webapp/banner ---------------------------------------------------------------------- diff --git a/contrib/blur-console/src/main/webapp/banner b/contrib/blur-console/src/main/webapp/banner new file mode 100644 index 0000000..90705e0 --- /dev/null +++ b/contrib/blur-console/src/main/webapp/banner @@ -0,0 +1,16 @@ +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you 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. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a121a90d/contrib/blur-console/src/main/webapp/index.html ---------------------------------------------------------------------- diff --git a/contrib/blur-console/src/main/webapp/index.html b/contrib/blur-console/src/main/webapp/index.html index 14ef45f..b36686e 100644 --- a/contrib/blur-console/src/main/webapp/index.html +++ b/contrib/blur-console/src/main/webapp/index.html @@ -60,36 +60,7 @@ under the License. </ul> </nav> <div id="blurconsole"></div> - <script src="js/blurconsole.overrides.js"></script> - <script src="libs/jquery/dist/jquery.js"></script> - <script src="js/utils/jquery.uriAnchor.js"></script> - <script src="js/utils/jquery.event.gevent.js"></script> - - <script src="libs/twbs-bootstrap-sass/vendor/assets/javascripts/bootstrap/tooltip.js"></script> - <script src="libs/twbs-bootstrap-sass/vendor/assets/javascripts/bootstrap/modal.js"></script> - <script src="libs/twbs-bootstrap-sass/vendor/assets/javascripts/bootstrap/transition.js"></script> - <script src="libs/twbs-bootstrap-sass/vendor/assets/javascripts/bootstrap/popover.js"></script> - <script src="libs/twbs-bootstrap-sass/vendor/assets/javascripts/bootstrap/collapse.js"></script> - <script src="libs/twbs-bootstrap-sass/vendor/assets/javascripts/bootstrap/tab.js"></script> - <script src="libs/flot/jquery.flot.js"></script> - <script src="libs/flot/jquery.flot.pie.js"></script> - <script src="libs/flot/jquery.flot.categories.js"></script> - <script src="libs/flot/jquery.flot.stack.js"></script> - <script src="libs/typeahead.js/dist/typeahead.jquery.js"></script> - - <script src="js/blurconsole.js"></script> - <script src="js/blurconsole.utils.js"></script> - <script src="js/blurconsole.b_utils.js"></script> - <script src="js/blurconsole.shell.js"></script> - <script src="js/blurconsole.logging.js"></script> - <script src="js/blurconsole.dashboard.js"></script> - <script src="js/blurconsole.tables.js"></script> - <script src="js/blurconsole.queries.js"></script> - <script src="js/blurconsole.search.js"></script> - <script src="js/blurconsole.schema.js"></script> - <script src="js/blurconsole.data.js"></script> - <script src="js/blurconsole.fake.js"></script> - <script src="js/blurconsole.model.js"></script> + <script src="script/ugly.js"></script> <script type="text/javascript"> $(function () { blurconsole.initModule( $('#blurconsole') ); }); </script> http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a121a90d/contrib/blur-console/src/main/webapp/js/blurconsole.overrides.js ---------------------------------------------------------------------- diff --git a/contrib/blur-console/src/main/webapp/js/blurconsole.overrides.js b/contrib/blur-console/src/main/webapp/js/blurconsole.overrides.js deleted file mode 100644 index d8655fb..0000000 --- a/contrib/blur-console/src/main/webapp/js/blurconsole.overrides.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you 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. -*/ - -/* - * blurconsole.overrides.js - * File to override globals - */ -/*global console:true, blurconsole:false */ - -if (typeof console === 'undefined') { - console = (function() { - 'use strict'; - - function log() { - if(typeof blurconsole !== 'undefined' && typeof blurconsole.model !== 'undefined' && typeof blurconsole.model.logs !== 'undefined') { - var args = Array.prototype.slice.call(arguments); - blurconsole.model.logs.logError(args.join(' '), 'javascript'); - } - } - - function info() { - return console.log.apply(null, arguments); - } - - function warn() { - return console.log.apply(null, arguments); - } - - function error() { - return console.log.apply(null, arguments); - } - - function debug() { - return console.log.apply(null, arguments); - } - - return { - log: log, - info: info, - warn: warn, - error: error, - debug: debug - }; - }()); -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a121a90d/contrib/blur-console/src/main/webapp/package.json ---------------------------------------------------------------------- diff --git a/contrib/blur-console/src/main/webapp/package.json b/contrib/blur-console/src/main/webapp/package.json index fdfa815..58235aa 100644 --- a/contrib/blur-console/src/main/webapp/package.json +++ b/contrib/blur-console/src/main/webapp/package.json @@ -15,6 +15,8 @@ "grunt-contrib-jshint": "~0.8.0", "grunt-contrib-sass": "~0.4.0", "grunt-contrib-watch": "~0.6.1", + "grunt-contrib-concat": "~0.4.0", + "grunt-contrib-uglify": "~0.5.0", "grunt-exec": "~0.4.2", "grunt-karma": "~0.8.2", "grunt-mocha-selenium": "git://github.com/jharwig/grunt-mocha-selenium",
