1
0
mirror of https://github.com/moparisthebest/mail synced 2024-11-29 12:22:22 -05:00

Merge pull request #151 from whiteout-io/dev/WO-633

[WO-633] angular template minification
This commit is contained in:
Tankred Hase 2014-12-03 15:49:10 +01:00
commit fee1151952
3 changed files with 45 additions and 13 deletions

View File

@ -30,7 +30,7 @@ module.exports = function(grunt) {
clean: { clean: {
dist: ['dist', 'compile', 'test/lib', 'test/integration/src'], dist: ['dist', 'compile', 'test/lib', 'test/integration/src'],
release: ['dist/**/*.browserified.js', 'dist/**/*.js.map'] release: ['dist/**/*.browserified.js', 'dist/**/*.js.map', 'dist/js/app.templates.js']
}, },
copy: { copy: {
@ -74,7 +74,7 @@ module.exports = function(grunt) {
tpl: { tpl: {
expand: true, expand: true,
cwd: 'src/tpl/', cwd: 'src/tpl/',
src: ['*'], src: ['read-sandbox.html'],
dest: 'dist/tpl/' dest: 'dist/tpl/'
}, },
app: { app: {
@ -231,6 +231,22 @@ module.exports = function(grunt) {
} }
}, },
ngtemplates: {
mail: {
src: [
'tpl/**/*.html'
],
dest: 'dist/js/app.templates.js',
cwd: 'src/',
options: {
htmlmin: {
collapseWhitespace: true,
removeComments: true // we do not use comment directives
}
}
}
},
concat: { concat: {
options: { options: {
separator: ';\n', separator: ';\n',
@ -249,7 +265,8 @@ module.exports = function(grunt) {
'src/lib/lawnchair/lawnchair-git.js', 'src/lib/lawnchair/lawnchair-git.js',
'src/lib/lawnchair/lawnchair-adapter-webkit-sqlite-git.js', 'src/lib/lawnchair/lawnchair-adapter-webkit-sqlite-git.js',
'src/lib/lawnchair/lawnchair-adapter-indexed-db-git.js', 'src/lib/lawnchair/lawnchair-adapter-indexed-db-git.js',
'dist/js/app.browserified.js' 'dist/js/app.browserified.js',
'<%= ngtemplates.mail.dest %>'
], ],
dest: 'dist/js/app.min.js', dest: 'dist/js/app.min.js',
options: { options: {
@ -447,7 +464,7 @@ module.exports = function(grunt) {
tasks: ['dist-css', 'manifest'] tasks: ['dist-css', 'manifest']
}, },
jsApp: { jsApp: {
files: ['src/js/**/*.js'], files: ['src/js/**/*.js', 'src/**/*.html'],
tasks: ['dist-js-app'] tasks: ['dist-js-app']
}, },
jsUnitTest: { jsUnitTest: {
@ -498,6 +515,8 @@ module.exports = function(grunt) {
'appcache.manifest', 'appcache.manifest',
'manifest.webapp', 'manifest.webapp',
'manifest.mobile.json', 'manifest.mobile.json',
'background.js',
'js/app.templates.js',
'js/app.js.map', 'js/app.js.map',
'js/app.min.js.map', 'js/app.min.js.map',
'js/app.browserified.js', 'js/app.browserified.js',
@ -540,16 +559,18 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-svgmin'); grunt.loadNpmTasks('grunt-svgmin');
grunt.loadNpmTasks('grunt-svgstore'); grunt.loadNpmTasks('grunt-svgstore');
grunt.loadNpmTasks('grunt-shell'); grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-angular-templates');
// Build tasks // Build tasks
grunt.registerTask('dist-css', ['sass', 'autoprefixer', 'csso']); grunt.registerTask('dist-css', ['sass', 'autoprefixer', 'csso']);
grunt.registerTask('dist-js', ['browserify', 'exorcise', 'concat', 'uglify']); grunt.registerTask('dist-js', ['browserify', 'exorcise', 'ngtemplates', 'concat', 'uglify']);
grunt.registerTask('dist-js-app', [ grunt.registerTask('dist-js-app', [
'browserify:app', 'browserify:app',
'browserify:pbkdf2Worker', 'browserify:pbkdf2Worker',
'browserify:mailreaderWorker', 'browserify:mailreaderWorker',
'browserify:tlsWorker', 'browserify:tlsWorker',
'exorcise:app', 'exorcise:app',
'ngtemplates',
'concat:app', 'concat:app',
'concat:readSandbox', 'concat:readSandbox',
'concat:pbkdf2Worker', 'concat:pbkdf2Worker',

View File

@ -41,6 +41,7 @@
"crypto-lib": "~0.2.1", "crypto-lib": "~0.2.1",
"dompurify": "~0.4.2", "dompurify": "~0.4.2",
"grunt": "~0.4.1", "grunt": "~0.4.1",
"grunt-angular-templates": "~0.5.7",
"grunt-autoprefixer": "~0.7.2", "grunt-autoprefixer": "~0.7.2",
"grunt-browserify": "^3.0.1", "grunt-browserify": "^3.0.1",
"grunt-contrib-clean": "~0.5.0", "grunt-contrib-clean": "~0.5.0",

View File

@ -8,13 +8,23 @@
<li ng-repeat="folder in account.folders" ng-if="folder.wellknown" ng-hide="folder.type === 'Outbox' && folder.count < 1" <li ng-repeat="folder in account.folders" ng-if="folder.wellknown" ng-hide="folder.type === 'Outbox' && folder.count < 1"
class="nav__folder" ng-class="{'nav__folder--open': state.nav.currentFolder === folder}"> class="nav__folder" ng-class="{'nav__folder--open': state.nav.currentFolder === folder}">
<a href="#" wo-touch="$event.preventDefault(); openFolder(folder)"> <a href="#" wo-touch="$event.preventDefault(); openFolder(folder)">
<svg role="presentation"> <svg ng-if="folder.type === 'Inbox'" role="presentation">
<use ng-if="folder.type === 'Inbox'" xlink:href="#icon-inbox" /> <use xlink:href="#icon-inbox" />
<use ng-if="folder.type === 'Sent'" xlink:href="#icon-sent" /> </svg>
<use ng-if="folder.type === 'Outbox'" xlink:href="#icon-outbox" /> <svg ng-if="folder.type === 'Sent'" role="presentation">
<use ng-if="folder.type === 'Drafts'" xlink:href="#icon-draft" /> <use xlink:href="#icon-sent" />
<use ng-if="folder.type === 'Trash'" xlink:href="#icon-delete" /> </svg>
<use ng-if="folder.type === 'Flagged'" xlink:href="#icon-star" /> <svg ng-if="folder.type === 'Outbox'" role="presentation">
<use xlink:href="#icon-outbox" />
</svg>
<svg ng-if="folder.type === 'Drafts'" role="presentation">
<use xlink:href="#icon-draft" />
</svg>
<svg ng-if="folder.type === 'Trash'" role="presentation">
<use xlink:href="#icon-delete" />
</svg>
<svg ng-if="folder.type === 'Flagged'" role="presentation">
<use xlink:href="#icon-star" />
</svg> </svg>
{{folder.type}} {{folder.type}}
<span ng-show="folder.count > 0" class="nav__counter">{{folder.count}}</span> <span ng-show="folder.count > 0" class="nav__counter">{{folder.count}}</span>