- Fix directive path in popup-input-button
- Add template caching to the combined JS bundle - Load momentjs from the combined CDN
This commit is contained in:
parent
5fa4733a2f
commit
9e4a8097af
3 changed files with 31 additions and 6 deletions
|
@ -25,7 +25,8 @@ module.exports = function(grunt) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
src: ['../static/lib/**/*.js', '../static/js/*.js', '!../static/lib/jquery.overscroll.min.js'],
|
src: ['../static/lib/**/*.js', '../static/js/*.js', '!../static/lib/jquery.overscroll.min.js',
|
||||||
|
'../static/dist/template-cache.js'],
|
||||||
dest: '../static/dist/<%= pkg.name %>.js'
|
dest: '../static/dist/<%= pkg.name %>.js'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -36,20 +37,45 @@ module.exports = function(grunt) {
|
||||||
|
|
||||||
uglify: {
|
uglify: {
|
||||||
options: {
|
options: {
|
||||||
mangle: false
|
mangle: false,
|
||||||
|
sourceMap: true,
|
||||||
|
sourceMapName: '../static/dist/<%= pkg.name %>.min.map'
|
||||||
},
|
},
|
||||||
js_min: {
|
js_min: {
|
||||||
files: {
|
files: {
|
||||||
'../static/dist/<%= pkg.name %>.min.js': ['../static/dist/<%= pkg.name %>.js']
|
'../static/dist/<%= pkg.name %>.min.js': ['../static/dist/<%= pkg.name %>.js']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
ngtemplates: {
|
||||||
|
options: {
|
||||||
|
url: function(path) {
|
||||||
|
return '/' + path.substr(3); // remove the ../
|
||||||
|
},
|
||||||
|
htmlmin: {
|
||||||
|
collapseBooleanAttributes: true,
|
||||||
|
collapseWhitespace: true,
|
||||||
|
removeAttributeQuotes: true,
|
||||||
|
removeComments: true, // Only if you don't use comment directives!
|
||||||
|
removeEmptyAttributes: true,
|
||||||
|
removeRedundantAttributes: true,
|
||||||
|
removeScriptTypeAttributes: true,
|
||||||
|
removeStyleLinkTypeAttributes: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
quay: {
|
||||||
|
src: ['../static/partials/*.html', '../static/directives/*.html'],
|
||||||
|
dest: '../static/dist/template-cache.js'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
grunt.loadNpmTasks('grunt-contrib-uglify');
|
grunt.loadNpmTasks('grunt-contrib-uglify');
|
||||||
grunt.loadNpmTasks('grunt-contrib-concat');
|
grunt.loadNpmTasks('grunt-contrib-concat');
|
||||||
grunt.loadNpmTasks('grunt-contrib-cssmin');
|
grunt.loadNpmTasks('grunt-contrib-cssmin');
|
||||||
|
grunt.loadNpmTasks('grunt-angular-templates');
|
||||||
|
|
||||||
// Default task(s).
|
// Default task(s).
|
||||||
grunt.registerTask('default', ['concat', 'cssmin', 'uglify']);
|
grunt.registerTask('default', ['ngtemplates', 'concat', 'cssmin', 'uglify']);
|
||||||
};
|
};
|
|
@ -1,5 +1,5 @@
|
||||||
<button class="btn btn-success" data-trigger="click"
|
<button class="btn btn-success" data-trigger="click"
|
||||||
data-content-template="static/directives/popup-input-dialog.html"
|
data-content-template="/static/directives/popup-input-dialog.html"
|
||||||
data-placement="bottom" ng-click="popupShown()" bs-popover>
|
data-placement="bottom" ng-click="popupShown()" bs-popover>
|
||||||
<span ng-transclude></span>
|
<span ng-transclude></span>
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -55,10 +55,9 @@
|
||||||
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.9/angular-sanitize.min.js"></script>
|
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.9/angular-sanitize.min.js"></script>
|
||||||
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.9/angular-animate.min.js"></script>
|
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.9/angular-animate.min.js"></script>
|
||||||
|
|
||||||
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.2.1/moment.min.js"></script>
|
|
||||||
<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.2.0/js/bootstrap-datepicker.min.js"></script>
|
<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.2.0/js/bootstrap-datepicker.min.js"></script>
|
||||||
|
|
||||||
<script src="//cdn.jsdelivr.net/g/bootbox@4.1.0,underscorejs@1.5.2,restangular@1.2.0,d3js@3.3.3"></script>
|
<script src="//cdn.jsdelivr.net/g/bootbox@4.1.0,underscorejs@1.5.2,restangular@1.2.0,d3js@3.3.3,momentjs"></script>
|
||||||
|
|
||||||
{% for script_path in library_scripts %}
|
{% for script_path in library_scripts %}
|
||||||
<script src="/static/{{ script_path }}?v={{ cache_buster }}"></script>
|
<script src="/static/{{ script_path }}?v={{ cache_buster }}"></script>
|
||||||
|
|
Reference in a new issue