From 5e2bf29d9452e8747649427da64410d8455cb971 Mon Sep 17 00:00:00 2001 From: Michael Benford Date: Sat, 7 Dec 2013 01:12:57 -0200 Subject: [PATCH] chore(minification): Moved templates into HTML files Extracted templates from script files and moved them into separate HTML files so they can be easily edited and minified during build. References #27. --- .jshintrc | 2 +- Gruntfile.js | 29 ++++++++++++++++++--- build/ng-tags-input.js | 45 ++++++++++++++------------------- build/ng-tags-input.min.zip | Bin 4012 -> 4020 bytes build/ng-tags-input.zip | Bin 6859 -> 6882 bytes karma.conf.js | 12 ++++++++- package.json | 2 ++ src/auto-complete.js | 15 ++--------- src/keycodes.js | 2 +- src/tags-input.js | 23 ++--------------- templates/auto-complete.html | 10 ++++++++ templates/tags-input.html | 17 +++++++++++++ test/auto-complete.spec.js | 6 ++--- test/tags-input.spec.js | 7 ++--- test/transclude-append.spec.js | 6 +---- 15 files changed, 95 insertions(+), 81 deletions(-) create mode 100644 templates/auto-complete.html create mode 100644 templates/tags-input.html diff --git a/.jshintrc b/.jshintrc index 1cc7b688..d21b03ef 100644 --- a/.jshintrc +++ b/.jshintrc @@ -1,5 +1,5 @@ { - "strict": true, + "globalstrict": true, "curly": true, "eqeqeq": true, "immed": true, diff --git a/Gruntfile.js b/Gruntfile.js index f2a6c74e..c3d4b146 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -15,6 +15,10 @@ module.exports = function(grunt) { out: 'build/<%= pkg.name %>.css', outMin: 'tmp/<%= pkg.name %>.min.css' }, + html: { + src: ['templates/tags-input.html', 'templates/auto-complete.html'], + out: 'tmp/templates.js' + }, zip: { unminified: 'build/<%= pkg.name %>.zip', minified: 'build/<%= pkg.name %>.min.zip' @@ -45,6 +49,23 @@ module.exports = function(grunt) { build: ['build/'], tmp: ['tmp/'] }, + // Compiles the HTML templates into a Javascript file + ngtemplates: { + 'tags-input': { + files: { + '<%= files.html.out %>': ['<%= files.html.src %>'] + }, + options: { + url: function(url) { + return 'ngTagsInput/' + url.replace('templates/', ''); + }, + htmlmin: { + collapseWhitespace: true, + removeRedundantAttributes: true + } + } + } + }, // Concatenates all source files into one JS file and one CSS file concat: { js: { @@ -52,15 +73,14 @@ module.exports = function(grunt) { banner: '(function() {\n\'use strict\';\n\n', footer: '\n}());', process: function(src) { - // Remove all (function() {'use strict'; and }()) from the code and + // Remove all 'use strict'; from the code and // replaces all double blank lines with one - return src.replace(/\(function\(\) \{\n'use strict';\n\s*/g, '') - .replace(/\n\}\(\)\);/g, '') + return src.replace(/'use strict';\n/g, '') .replace(/\n\n\s*\n/g, '\n\n'); } }, files: { - '<%= files.js.out %>': ['<%= files.js.src %>'] + '<%= files.js.out %>': ['<%= files.js.src %>', '<%= files.html.out %>'] } }, css: { @@ -140,6 +160,7 @@ module.exports = function(grunt) { 'jshint', 'karma', 'clean', + 'ngtemplates', 'concat', 'ngAnnotate', 'uglify', diff --git a/build/ng-tags-input.js b/build/ng-tags-input.js index d97f933b..82045878 100644 --- a/build/ng-tags-input.js +++ b/build/ng-tags-input.js @@ -68,23 +68,7 @@ angular.module('tags-input').directive('tagsInput', ["$timeout","$document","con }, replace: false, transclude: true, - template: '
' + - '
' + - '
    ' + - '
  • ' + - ' {{ tag }}' + - ' ' + - '
  • ' + - '
' + - ' ' + - '
' + - '
', + templateUrl: 'ngTagsInput/tags-input.html', controller: ["$scope","$attrs","$element", function($scope, $attrs, $element) { var events = new SimplePubSub(), shouldRemoveLastTag; @@ -356,15 +340,7 @@ angular.module('tags-input').directive('autoComplete', ["$document","$timeout"," restrict: 'E', require: '?^tagsInput', scope: { source: '&' }, - template: '
' + - ' ' + - '
', + templateUrl: 'ngTagsInput/auto-complete.html', link: function(scope, element, attrs, tagsInputCtrl) { var hotkeys = [KEYS.enter, KEYS.tab, KEYS.escape, KEYS.up, KEYS.down], suggestionList, tagsInput, highlight; @@ -474,6 +450,7 @@ angular.module('tags-input').directive('autoComplete', ["$document","$timeout"," } }; }]); +(function() { /** * @ngdoc directive @@ -490,6 +467,9 @@ angular.module('tags-input').directive('transcludeAppend', function() { }; }); +}()); +(function() { + /** * @ngdoc service * @name tagsInput.service:configuration @@ -516,5 +496,18 @@ angular.module('tags-input').service('configuration', ["$interpolate", function( }; }]); +}()); + +angular.module('tags-input').run(['$templateCache', function($templateCache) { + + $templateCache.put('ngTagsInput/tags-input.html', + "
  • {{tag}}
" + ); + + $templateCache.put('ngTagsInput/auto-complete.html', + "
" + ); + +}]); }()); \ No newline at end of file diff --git a/build/ng-tags-input.min.zip b/build/ng-tags-input.min.zip index ea009b44c47ac36630563a5eb81354a913219777..d4d8b298df0a85ed00811cd77d1f72dbc100430b 100644 GIT binary patch delta 2851 zcmV+;3*7XqAG9A0P)h>@6aWYa2mlfchmj2>e~npfZ`(K${wuB!xDrY$c6*2GDp7)N zo5L08?iNk&4mhtDpd?yWB1>LTN}9Fx-|rbxq-4iQ`ysX^4u|tT4<|2{O%c~wS-9TT zX`~p*y2|3(IlJT4h=<#V$G39BV-dV%HIIUym?&yd1+zCy$e3?L@cJK26TErNnoaQL ze=SSO`y%+;l*Q$G&4bz7x9u4((kADXzb=y|7p_zDR8F#D)6@=|FFf|ly5}cZB_QKn zx9?-O%{i&FwJ3>&bCQ&CvxaE+9hb#2OPh+5S`M=cMl5EDw>8fr0hK!~+p|j4O;v2m zA~5SN=)EnUM~mIgrLRy4iXZ-_kt;X$e_94xr75g&u%}aYSyop(Ua8H!7#vLfnCH1$ zG0ind8c2r ztP-1?JoaJ+0eK# zgsjZ#x{~xmvH`*=Tbta2WWN;^A#ye z#F968{U4q;B5<6RDd|^bp5XLnC}DyTA3=0%L1<=0BEEI>zc%YgRAdP<3-r8xSVv|4 z3^y%{zpNnQidXMpYWMZ*@9=SFf6Z%30{P#pUVY$lC5#R~mt`(^v9H97Y0K7G@ktbE zz1kCLpY9FF__rfuE#pb@TXCgQO`G7!gA}Ebt~=>C<*eiRUM1y^@ccP%jQx+Zgq8^7 z@?InqNuLoMqAEHezKHbd+h$+g(?8~X^4Gh`|E80lewT|^C#Nl{36FA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FXte1VI=M8@adJaPePAL7h8!OT^$aB+0YYbJt+kWs5hMRf7T2tn7{%1GZN#H<^TZL zC9tJgzy>kOh7m9_F`*)cl0d96>!Y2EWIhgAcPP4=Aq=h2Hvgb!?aNVfO#`%8I+75e zkv6Qw49d_B=&qha1`ApBlO!6c)c+(S(a32F1)9SC;z|7{gr%`X!chqeH&j0tCwpE7 zP2}6`Sgmx_f52PMyjkjXS=xOH-aqY|Sh9t|0j!9STdJ)TkQZnsy5j<;T%lG80bP$c zh!|`rZ0TgsLb}u1cbuctf-Tjpn}=u#VZ3>7G3~KC(%e7#sQLf95{A1HXzH>^_l4<5 zus%_lWca_F^fqq{6ssqbPBM~Ru-r%=X81~wq>aE$KU}qp`xiVVQe?k6Whz9~}ajv2yZIJX$j-lrG z8lLs8A2S&2#zMgKdi6yt^VZA%70;@Wc_QC~-rwlxe@n|;sG?~mY_maWwn+%bP$YF5 z(tm3of7J*`pB!iS4f=Ew`KPpm5bA!9H^eJJD)GLwai?qbol44{O+DdQ9V@)GU^lp$ z*62Z-+az%)6Ujq*qDwu2+x|Na@!h-XC;X~94*uwL@`u(z{s(z5tMJx19bV&{6Mt3+ zCx?sVmNs5-c8g6Nhv;dChYn6L5bJT!vBM^wf2=awMr!vJW~hgeING=Ge+t~Nf8TA> z&+@Y9bbFg74E6T@SdH=YuIGR>kFTxniCR{-c#DCxNd327iK8DK1v?}?8mALU`U_Tc zW{kgAg})2)8iaL zK5Tl|Xb>HBCuX~Y!pbY24BirO9VrzEVAjNPNXvG#we!)(vBjvMrLdVtb? zuP-%+jDJFZkm0J8CHt4X!GNJkW-XX' + - '
    ' + - '
  • ' + - '
' + - '', + templateUrl: 'ngTagsInput/auto-complete.html', link: function(scope, element, attrs, tagsInputCtrl) { var hotkeys = [KEYS.enter, KEYS.tab, KEYS.escape, KEYS.up, KEYS.down], suggestionList, tagsInput, highlight; @@ -210,6 +201,4 @@ angular.module('tags-input').directive('autoComplete', function($document, $time }); } }; -}); - -}()); \ No newline at end of file +}); \ No newline at end of file diff --git a/src/keycodes.js b/src/keycodes.js index 09d7d9f8..18748376 100644 --- a/src/keycodes.js +++ b/src/keycodes.js @@ -7,4 +7,4 @@ var KEYS = { up: 38, down: 40, comma: 188 -}; +}; \ No newline at end of file diff --git a/src/tags-input.js b/src/tags-input.js index cc32cf3b..b22dd1c5 100644 --- a/src/tags-input.js +++ b/src/tags-input.js @@ -1,4 +1,3 @@ -(function() { 'use strict'; angular.module('tags-input', []); @@ -57,23 +56,7 @@ angular.module('tags-input').directive('tagsInput', function($timeout, $document }, replace: false, transclude: true, - template: '
' + - '
' + - '
    ' + - '
  • ' + - ' {{ tag }}' + - ' ' + - '
  • ' + - '
' + - ' ' + - '
' + - '
', + templateUrl: 'ngTagsInput/tags-input.html', controller: function($scope, $attrs, $element) { var events = new SimplePubSub(), shouldRemoveLastTag; @@ -251,6 +234,4 @@ angular.module('tags-input').directive('tagsInput', function($timeout, $document }); } }; -}); - -}()); \ No newline at end of file +}); \ No newline at end of file diff --git a/templates/auto-complete.html b/templates/auto-complete.html new file mode 100644 index 00000000..de2cb598 --- /dev/null +++ b/templates/auto-complete.html @@ -0,0 +1,10 @@ +
+
    +
  • +
+
\ No newline at end of file diff --git a/templates/tags-input.html b/templates/tags-input.html new file mode 100644 index 00000000..bd44ba4f --- /dev/null +++ b/templates/tags-input.html @@ -0,0 +1,17 @@ +
+
+
    +
  • + {{tag}} + +
  • +
+ +
+
\ No newline at end of file diff --git a/test/auto-complete.spec.js b/test/auto-complete.spec.js index 21fc1fa2..8a11cdfb 100644 --- a/test/auto-complete.spec.js +++ b/test/auto-complete.spec.js @@ -1,4 +1,3 @@ -(function() { 'use strict'; describe('autocomplete-directive', function() { @@ -37,8 +36,9 @@ describe('autocomplete-directive', function() { }; parent = $compile('')($scope); - parentCtrl = parent.controller('tagsInput'); + $scope.$digest(); + parentCtrl = parent.controller('tagsInput'); spyOn(parentCtrl, 'registerAutocomplete').andReturn(tagsInput); options = jQuery.makeArray(arguments).join(' '); @@ -726,5 +726,3 @@ describe('autocomplete-directive', function() { }); }); }); - -})(); diff --git a/test/tags-input.spec.js b/test/tags-input.spec.js index f99bb648..c9246a76 100644 --- a/test/tags-input.spec.js +++ b/test/tags-input.spec.js @@ -1,4 +1,3 @@ -(function() { 'use strict'; describe('tags-input-directive', function() { @@ -21,8 +20,8 @@ describe('tags-input-directive', function() { var template = ''; element = $compile(template)($scope); - isolateScope = element.isolateScope(); $scope.$digest(); + isolateScope = element.isolateScope(); } function getTags() { @@ -965,6 +964,4 @@ describe('tags-input-directive', function() { expect(autocompleteObj.getTags()).toEqual(['a', 'b', 'c']); }); }); -}); - -}()); +}); \ No newline at end of file diff --git a/test/transclude-append.spec.js b/test/transclude-append.spec.js index 48b3b22b..439739cb 100644 --- a/test/transclude-append.spec.js +++ b/test/transclude-append.spec.js @@ -1,4 +1,3 @@ -(function() { 'use strict'; describe('transclude-append-directive', function () { @@ -55,7 +54,4 @@ describe('transclude-append-directive', function () { var content = $.map(element.find('p'), function(e) { return $(e).html(); }); expect(content).toEqual(['existing content', 'transcluded content']); }); -}); - - -}()); +}); \ No newline at end of file