Browse Source

Combine javascript files

pull/5180/head
Ruud 10 years ago
parent
commit
cc7b446ed1
  1. 73
      Gruntfile.js
  2. 26
      couchpotato/core/_base/clientscript.py
  3. 4
      couchpotato/core/media/movie/_base/static/movie.actions.js
  4. 2
      couchpotato/core/plugins/base.py
  5. 2259
      couchpotato/static/scripts/combined.base.min.js
  6. 4004
      couchpotato/static/scripts/combined.plugins.min.js
  7. 9259
      couchpotato/static/scripts/combined.vendor.min.js

73
Gruntfile.js

@ -8,9 +8,41 @@ module.exports = function(grunt){
var config = {
tmp: '.tmp',
base: 'couchpotato',
css_dest: 'couchpotato/static/style/combined.min.css'
css_dest: 'couchpotato/static/style/combined.min.css',
scripts_vendor_dest: 'couchpotato/static/scripts/combined.vendor.min.js',
scripts_base_dest: 'couchpotato/static/scripts/combined.base.min.js',
scripts_plugins_dest: 'couchpotato/static/scripts/combined.plugins.min.js'
};
var vendor_scripts_files = [
'couchpotato/static/scripts/vendor/mootools.js',
'couchpotato/static/scripts/vendor/mootools_more.js',
'couchpotato/static/scripts/vendor/form_replacement/form_check.js',
'couchpotato/static/scripts/vendor/form_replacement/form_radio.js',
'couchpotato/static/scripts/vendor/form_replacement/form_dropdown.js',
'couchpotato/static/scripts/vendor/form_replacement/form_selectoption.js',
'couchpotato/static/scripts/vendor/Array.stableSort.js',
'couchpotato/static/scripts/vendor/history.js',
'couchpotato/static/scripts/vendor/dynamics.js'
];
var scripts_files = [
'couchpotato/static/scripts/library/uniform.js',
'couchpotato/static/scripts/library/question.js',
'couchpotato/static/scripts/library/scrollspy.js',
'couchpotato/static/scripts/couchpotato.js',
'couchpotato/static/scripts/api.js',
'couchpotato/static/scripts/page.js',
'couchpotato/static/scripts/block.js',
'couchpotato/static/scripts/block/navigation.js',
'couchpotato/static/scripts/block/header.js',
'couchpotato/static/scripts/block/footer.js',
'couchpotato/static/scripts/block/menu.js',
'couchpotato/static/scripts/page/home.js',
'couchpotato/static/scripts/page/settings.js',
'couchpotato/static/scripts/page/about.js'
];
grunt.initConfig({
// Project settings
@ -26,7 +58,8 @@ module.exports = function(grunt){
},
all: [
'<%= config.base %>/{,**/}*.js',
'!<%= config.base %>/static/scripts/vendor/{,**/}*.js'
'!<%= config.base %>/static/scripts/vendor/{,**/}*.js',
'!<%= config.base %>/static/scripts/combined.*.js'
]
},
@ -76,6 +109,30 @@ module.exports = function(grunt){
}
},
uglify: {
options: {
mangle: false,
compress: false,
beautify: true,
screwIE8: true
},
vendor: {
files: {
'<%= config.scripts_vendor_dest %>': vendor_scripts_files
}
},
base: {
files: {
'<%= config.scripts_base_dest %>': scripts_files
}
},
plugins: {
files: {
'<%= config.scripts_plugins_dest %>': ['<%= config.base %>/core/**/*.js']
}
}
},
shell: {
runCouchPotato: {
command: 'python CouchPotato.py',
@ -91,16 +148,20 @@ module.exports = function(grunt){
},
js: {
files: [
'<%= config.base %>/**/*.js'
'<%= config.base %>/**/*.js',
'!<%= config.base %>/static/scripts/combined.*.js'
],
tasks: ['jshint']
tasks: ['uglify:base', 'uglify:plugins', 'jshint']
},
livereload: {
options: {
livereload: 35729
},
files: [
'<%= config.css_dest %>'
'<%= config.css_dest %>',
'<%= config.scripts_vendor_dest %>',
'<%= config.scripts_base_dest %>',
'<%= config.scripts_plugins_dest %>'
]
}
},
@ -114,6 +175,6 @@ module.exports = function(grunt){
});
grunt.registerTask('default', ['sass:server', 'autoprefixer', 'cssmin', 'concurrent']);
grunt.registerTask('default', ['sass:server', 'autoprefixer', 'cssmin', 'uglify:vendor', 'uglify:base', 'uglify:plugins', 'concurrent']);
};

26
couchpotato/core/_base/clientscript.py

@ -22,29 +22,9 @@ class ClientScript(Plugin):
'style/combined.min.css',
],
'script': [
'scripts/vendor/mootools.js',
'scripts/vendor/mootools_more.js',
'scripts/vendor/form_replacement/form_check.js',
'scripts/vendor/form_replacement/form_radio.js',
'scripts/vendor/form_replacement/form_dropdown.js',
'scripts/vendor/form_replacement/form_selectoption.js',
'scripts/vendor/Array.stableSort.js',
'scripts/vendor/history.js',
'scripts/vendor/dynamics.js',
'scripts/library/uniform.js',
'scripts/library/question.js',
'scripts/library/scrollspy.js',
'scripts/couchpotato.js',
'scripts/api.js',
'scripts/page.js',
'scripts/block.js',
'scripts/block/navigation.js',
'scripts/block/header.js',
'scripts/block/footer.js',
'scripts/block/menu.js',
'scripts/page/home.js',
'scripts/page/settings.js',
'scripts/page/about.js',
'scripts/combined.vendor.min.js',
'scripts/combined.base.min.js',
'scripts/combined.plugins.min.js',
],
}

4
couchpotato/core/media/movie/_base/static/movie.actions.js

@ -931,11 +931,11 @@ MA.Files = new Class({
getDetails: function(){
var self = this;
if(!self.movie.data.releases || self.movie.data.releases.length == 0)
if(!self.movie.data.releases || self.movie.data.releases.length === 0)
return;
if(!self.files_container){
self.files_container = new Element('div.files.table')
self.files_container = new Element('div.files.table');
// Header
new Element('div.item.head').adopt(

2
couchpotato/core/plugins/base.py

@ -32,7 +32,7 @@ class Plugin(object):
plugin_path = None
enabled_option = 'enabled'
auto_register_static = True
auto_register_static = False
_needs_shutdown = False
_running = None

2259
couchpotato/static/scripts/combined.base.min.js

File diff suppressed because it is too large

4004
couchpotato/static/scripts/combined.plugins.min.js

File diff suppressed because it is too large

9259
couchpotato/static/scripts/combined.vendor.min.js

File diff suppressed because it is too large
Loading…
Cancel
Save