Removed CDN dependencies for JS
This commit is contained in:
parent
216d9b3001
commit
d6bd82dc3e
5 changed files with 37 additions and 13 deletions
25
gruntfile.js
25
gruntfile.js
|
@ -1,12 +1,14 @@
|
|||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
var ini = require('ini');
|
||||
var rmdir = require('rimraf');
|
||||
|
||||
var phpCheckStyleConfigPath = path.join(path.resolve(), 'phpcheckstyle.cfg');
|
||||
var phpSourcesDir = path.join(path.resolve(), 'src');
|
||||
var jsSourcesDir = path.join(path.resolve(), 'public_html/js');
|
||||
var cssSourcesDir = path.join(path.resolve(), 'public_html/css');
|
||||
var templatesDir = path.join(path.resolve(), 'public_html/templates');
|
||||
var publicHtmlDir = path.join(path.resolve(), 'public_html');
|
||||
var jsSourcesDir = path.join(publicHtmlDir, 'js');
|
||||
var cssSourcesDir = path.join(publicHtmlDir, 'css');
|
||||
var templatesDir = path.join(publicHtmlDir, 'templates');
|
||||
|
||||
var config = readConfig([
|
||||
path.join(path.resolve(), 'data/config.ini'),
|
||||
|
@ -87,6 +89,18 @@ module.exports = function(grunt) {
|
|||
},
|
||||
},
|
||||
|
||||
copy: {
|
||||
dist: {
|
||||
files: [
|
||||
{ src: 'node_modules/jquery/dist/jquery.min.js', dest: 'public_html/lib/jquery.min.js' },
|
||||
{ src: 'node_modules/jquery.cookie/jquery.cookie.js', dest: 'public_html/lib/jquery.cookie.js' },
|
||||
{ src: 'node_modules/mousetrap/mousetrap.min.js', dest: 'public_html/lib/mousetrap.min.js' },
|
||||
{ src: 'node_modules/pathjs/path.js', dest: 'public_html/lib/path.js' },
|
||||
{ src: 'node_modules/underscore/underscore-min.js', dest: 'public_html/lib/underscore.min.js' },
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
cssmin: {
|
||||
combine: {
|
||||
files: {
|
||||
|
@ -134,8 +148,9 @@ module.exports = function(grunt) {
|
|||
grunt.loadNpmTasks('grunt-shell');
|
||||
grunt.loadNpmTasks('grunt-contrib-uglify');
|
||||
grunt.loadNpmTasks('grunt-contrib-cssmin');
|
||||
grunt.loadNpmTasks('grunt-contrib-copy');
|
||||
|
||||
grunt.registerTask('default', ['checkstyle', 'tests']);
|
||||
grunt.registerTask('default', ['copy:dist', 'checkstyle', 'tests']);
|
||||
grunt.registerTask('checkstyle', ['jshint', 'shell:phpcheckstyle']);
|
||||
grunt.registerTask('tests', ['shell:tests']);
|
||||
grunt.registerTask('update', ['shell:upgrade']);
|
||||
|
@ -147,6 +162,6 @@ module.exports = function(grunt) {
|
|||
fs.unlink('public_html/app.min.js.map');
|
||||
fs.unlink('public_html/app.min.css');
|
||||
});
|
||||
grunt.registerTask('build', ['clean', 'uglify', 'cssmin', 'processhtml']);
|
||||
grunt.registerTask('build', ['clean', 'copy:dist', 'uglify', 'cssmin', 'processhtml']);
|
||||
|
||||
};
|
||||
|
|
10
package.json
10
package.json
|
@ -2,6 +2,12 @@
|
|||
"name": "szuru2",
|
||||
"version": "0.0.0",
|
||||
"dependencies": {
|
||||
"pathjs": "~0.8.1",
|
||||
"jquery.cookie": "1.4.1",
|
||||
"jquery": "~2.1.1",
|
||||
"underscore": "1.7.0",
|
||||
"mousetrap": "0.0.1",
|
||||
|
||||
"requirejs": "*",
|
||||
"ini": "*",
|
||||
"grunt": "~0.4.5",
|
||||
|
@ -9,7 +15,9 @@
|
|||
"grunt-contrib-uglify": "*",
|
||||
"grunt-contrib-cssmin": "*",
|
||||
"grunt-contrib-jshint": "~0.10.0",
|
||||
"grunt-contrib-copy": "*",
|
||||
"grunt-shell": "~1.1.1",
|
||||
"grunt-cli": "*"
|
||||
"grunt-cli": "*",
|
||||
"rimraf": "~2.1"
|
||||
}
|
||||
}
|
||||
|
|
1
public_html/.gitignore
vendored
1
public_html/.gitignore
vendored
|
@ -2,3 +2,4 @@ app.min.html
|
|||
app.min.js
|
||||
app.min.js.map
|
||||
app.min.css
|
||||
lib
|
||||
|
|
|
@ -8,17 +8,17 @@
|
|||
<!-- build:template
|
||||
<title><%= serviceName %></title>
|
||||
/build -->
|
||||
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/path.js/0.8.4/path.min.js"></script>
|
||||
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.6.0/underscore-min.js"></script>
|
||||
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
|
||||
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/mousetrap/1.4.6/mousetrap.min.js"></script>
|
||||
<script type="text/javascript" src="/lib/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="/lib/jquery.cookie.js"></script>
|
||||
<script type="text/javascript" src="/lib/path.js"></script>
|
||||
<script type="text/javascript" src="/lib/underscore.min.js"></script>
|
||||
<script type="text/javascript" src="/lib/mousetrap.min.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css"/>
|
||||
<!-- build:template
|
||||
<link rel="stylesheet" type="text/css" href="app.min.css?<%= timestamp %>"/>
|
||||
/build -->
|
||||
<!-- build:remove -->
|
||||
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Sans:400,700"/>
|
||||
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Droid+Sans:400,700"/>
|
||||
<link rel="stylesheet" type="text/css" href="/css/core.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/css/forms.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/css/messages.css"/>
|
||||
|
|
|
@ -27,7 +27,7 @@ App.Bootstrap = function(auth, router, util, promise, presenterManager) {
|
|||
|
||||
App.DI.registerSingleton('bootstrap', ['auth', 'router', 'util', 'promise', 'presenterManager'], App.Bootstrap);
|
||||
App.DI.registerManual('jQuery', function() { return window.$; });
|
||||
App.DI.registerManual('pathJs', function() { return window.Path; });
|
||||
App.DI.registerManual('pathJs', function() { return window.pathjs; });
|
||||
App.DI.registerManual('_', function() { return window._; });
|
||||
App.DI.registerManual('mousetrap', function() { return window.Mousetrap; });
|
||||
App.DI.get('bootstrap');
|
||||
|
|
Loading…
Reference in a new issue