mirror of https://github.com/Radarr/Radarr
fixed rjs task.
This commit is contained in:
parent
ab60420f58
commit
35fc30e330
94
Gruntfile.js
94
Gruntfile.js
|
@ -105,52 +105,26 @@ module.exports = function (grunt) {
|
||||||
},
|
},
|
||||||
|
|
||||||
copy: {
|
copy: {
|
||||||
index : {
|
content: {
|
||||||
cwd : srcRoot,
|
cwd : srcRoot,
|
||||||
expand: true,
|
expand: true,
|
||||||
src : '*ndex.html',
|
src : [
|
||||||
|
'index.html',
|
||||||
|
'**/*.css',
|
||||||
|
'**/*.png',
|
||||||
|
'**/*.jpg',
|
||||||
|
'**/*.ico',
|
||||||
|
'**/FontAwesome/*.*',
|
||||||
|
'**/fonts/*.*'
|
||||||
|
],
|
||||||
dest : outputDir
|
dest : outputDir
|
||||||
},
|
},
|
||||||
scripts: {
|
scripts: {
|
||||||
cwd : srcRoot,
|
cwd : srcRoot,
|
||||||
expand: true,
|
expand: true,
|
||||||
src : '**/*.js',
|
src : [
|
||||||
dest : outputDir
|
'**/*.js',
|
||||||
},
|
],
|
||||||
styles : {
|
|
||||||
cwd : srcRoot,
|
|
||||||
expand: true,
|
|
||||||
src : '**/*.css',
|
|
||||||
dest : outputDir
|
|
||||||
},
|
|
||||||
images : {
|
|
||||||
cwd : srcRoot,
|
|
||||||
expand: true,
|
|
||||||
src : '**/*.png',
|
|
||||||
dest : outputDir
|
|
||||||
},
|
|
||||||
jpg : {
|
|
||||||
cwd : srcRoot,
|
|
||||||
expand: true,
|
|
||||||
src : '**/*.jpg',
|
|
||||||
dest : outputDir
|
|
||||||
},
|
|
||||||
icon : {
|
|
||||||
cwd : srcRoot,
|
|
||||||
expand: true,
|
|
||||||
src : '**/*.ico',
|
|
||||||
dest : outputDir
|
|
||||||
},
|
|
||||||
fontAwesome : {
|
|
||||||
cwd : srcRoot,
|
|
||||||
expand: true,
|
|
||||||
src : '**/FontAwesome/*.*',
|
|
||||||
dest : outputDir
|
|
||||||
},
|
|
||||||
fonts : {
|
|
||||||
cwd : srcRoot,
|
|
||||||
expand: true,
|
|
||||||
src : '**/fonts/*.*',
|
|
||||||
dest : outputDir
|
dest : outputDir
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -158,16 +132,17 @@ module.exports = function (grunt) {
|
||||||
requirejs: {
|
requirejs: {
|
||||||
compile:{
|
compile:{
|
||||||
options: {
|
options: {
|
||||||
mainConfigFile: "_output/UI/app.js",
|
mainConfigFile: "src/UI/app.js",
|
||||||
fileExclusionRegExp: /^.*\.(?!js$)[^.]+$/,
|
fileExclusionRegExp: /^.*\.(?!js$)[^.]+$/,
|
||||||
preserveLicenseComments: true,
|
preserveLicenseComments: false,
|
||||||
dir: "rjs/",
|
dir: outputDir,
|
||||||
optimize: 'none',
|
optimize: 'none',
|
||||||
removeCombined: true,
|
removeCombined: true,
|
||||||
inlineText: false,
|
inlineText: false,
|
||||||
|
keepBuildDir : true,
|
||||||
modules: [{
|
modules: [{
|
||||||
name: 'app',
|
name: 'app',
|
||||||
exclude: ['JsLibraries/jquery']
|
exclude: ['JsLibraries/jquery', 'templates.js']
|
||||||
}],
|
}],
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -190,37 +165,13 @@ module.exports = function (grunt) {
|
||||||
files: '<%= handlebars.files.src %>',
|
files: '<%= handlebars.files.src %>',
|
||||||
tasks: ['handlebars']
|
tasks: ['handlebars']
|
||||||
},
|
},
|
||||||
copyIndex : {
|
copyContent : {
|
||||||
files: '<%= copy.index.cwd %><%= copy.index.src %>',
|
files: '<%= copy.content.cwd %><%= copy.content.src %>',
|
||||||
tasks: ['copy:index']
|
tasks: ['copy:content']
|
||||||
},
|
},
|
||||||
copyScripts: {
|
copyScripts: {
|
||||||
files: '<%= copy.scripts.cwd %><%= copy.scripts.src %>',
|
files: '<%= copy.scripts.cwd %><%= copy.scripts.src %>',
|
||||||
tasks: ['copy:scripts']
|
tasks: ['copy:scripts']
|
||||||
},
|
|
||||||
copyStyles : {
|
|
||||||
files: '<%= copy.styles.cwd %><%= copy.styles.src %>',
|
|
||||||
tasks: ['copy:styles']
|
|
||||||
},
|
|
||||||
copyImages : {
|
|
||||||
files: '<%= copy.images.cwd %><%= copy.images.src %>',
|
|
||||||
tasks: ['copy:images']
|
|
||||||
},
|
|
||||||
copyJpg : {
|
|
||||||
files: '<%= copy.jpg.cwd %><%= copy.jpg.src %>',
|
|
||||||
tasks: ['copy:jpg']
|
|
||||||
},
|
|
||||||
copyIcon : {
|
|
||||||
files: '<%= copy.icon.cwd %><%= copy.icon.src %>',
|
|
||||||
tasks: ['copy:icon']
|
|
||||||
},
|
|
||||||
copyFontAwesome : {
|
|
||||||
files: '<%= copy.fontAwesome.cwd %><%= copy.fontAwesome.src %>',
|
|
||||||
tasks: ['copy:fontAwesome']
|
|
||||||
},
|
|
||||||
copyFonts : {
|
|
||||||
files: '<%= copy.fonts.cwd %><%= copy.fonts.src %>',
|
|
||||||
tasks: ['copy:fonts']
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -234,7 +185,8 @@ module.exports = function (grunt) {
|
||||||
grunt.loadNpmTasks('grunt-curl');
|
grunt.loadNpmTasks('grunt-curl');
|
||||||
grunt.loadNpmTasks('grunt-contrib-requirejs');
|
grunt.loadNpmTasks('grunt-contrib-requirejs');
|
||||||
|
|
||||||
grunt.registerTask('package', ['clean:output', 'copy', 'less', 'handlebars']);
|
grunt.registerTask('package', ['clean:output','handlebars', 'copy', 'less']);
|
||||||
|
grunt.registerTask('packagerjs', ['clean:output','handlebars', 'requirejs', 'copy:content', 'less']);
|
||||||
grunt.registerTask('default', ['package', 'watch']);
|
grunt.registerTask('default', ['package', 'watch']);
|
||||||
grunt.registerTask('update', ['curl']);
|
grunt.registerTask('update', ['curl']);
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,124 @@
|
||||||
|
/*jshint expr:true eqnull:true */
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Backbone.DeepModel v0.10.4
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013 Charles Davison, Pow Media Ltd
|
||||||
|
*
|
||||||
|
* https://github.com/powmedia/backbone-deep-model
|
||||||
|
* Licensed under the MIT License
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Underscore mixins for deep objects
|
||||||
|
*
|
||||||
|
* Based on https://gist.github.com/echong/3861963
|
||||||
|
*/
|
||||||
|
(function() {
|
||||||
|
var arrays, basicObjects, deepClone, deepExtend, deepExtendCouple, isBasicObject,
|
||||||
|
__slice = [].slice;
|
||||||
|
|
||||||
|
deepClone = function(obj) {
|
||||||
|
var func, isArr;
|
||||||
|
if (!_.isObject(obj) || _.isFunction(obj)) {
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
if (obj instanceof Backbone.Collection || obj instanceof Backbone.Model) {
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
if (_.isDate(obj)) {
|
||||||
|
return new Date(obj.getTime());
|
||||||
|
}
|
||||||
|
if (_.isRegExp(obj)) {
|
||||||
|
return new RegExp(obj.source, obj.toString().replace(/.*\//, ""));
|
||||||
|
}
|
||||||
|
isArr = _.isArray(obj || _.isArguments(obj));
|
||||||
|
func = function(memo, value, key) {
|
||||||
|
if (isArr) {
|
||||||
|
memo.push(deepClone(value));
|
||||||
|
} else {
|
||||||
|
memo[key] = deepClone(value);
|
||||||
|
}
|
||||||
|
return memo;
|
||||||
|
};
|
||||||
|
return _.reduce(obj, func, isArr ? [] : {});
|
||||||
|
};
|
||||||
|
|
||||||
|
isBasicObject = function(object) {
|
||||||
|
if (object == null) return false;
|
||||||
|
return (object.prototype === {}.prototype || object.prototype === Object.prototype) && _.isObject(object) && !_.isArray(object) && !_.isFunction(object) && !_.isDate(object) && !_.isRegExp(object) && !_.isArguments(object);
|
||||||
|
};
|
||||||
|
|
||||||
|
basicObjects = function(object) {
|
||||||
|
return _.filter(_.keys(object), function(key) {
|
||||||
|
return isBasicObject(object[key]);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
arrays = function(object) {
|
||||||
|
return _.filter(_.keys(object), function(key) {
|
||||||
|
return _.isArray(object[key]);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
deepExtendCouple = function(destination, source, maxDepth) {
|
||||||
|
var combine, recurse, sharedArrayKey, sharedArrayKeys, sharedObjectKey, sharedObjectKeys, _i, _j, _len, _len1;
|
||||||
|
if (maxDepth == null) {
|
||||||
|
maxDepth = 20;
|
||||||
|
}
|
||||||
|
if (maxDepth <= 0) {
|
||||||
|
console.warn('_.deepExtend(): Maximum depth of recursion hit.');
|
||||||
|
return _.extend(destination, source);
|
||||||
|
}
|
||||||
|
sharedObjectKeys = _.intersection(basicObjects(destination), basicObjects(source));
|
||||||
|
recurse = function(key) {
|
||||||
|
return source[key] = deepExtendCouple(destination[key], source[key], maxDepth - 1);
|
||||||
|
};
|
||||||
|
for (_i = 0, _len = sharedObjectKeys.length; _i < _len; _i++) {
|
||||||
|
sharedObjectKey = sharedObjectKeys[_i];
|
||||||
|
recurse(sharedObjectKey);
|
||||||
|
}
|
||||||
|
sharedArrayKeys = _.intersection(arrays(destination), arrays(source));
|
||||||
|
combine = function(key) {
|
||||||
|
return source[key] = _.union(destination[key], source[key]);
|
||||||
|
};
|
||||||
|
for (_j = 0, _len1 = sharedArrayKeys.length; _j < _len1; _j++) {
|
||||||
|
sharedArrayKey = sharedArrayKeys[_j];
|
||||||
|
combine(sharedArrayKey);
|
||||||
|
}
|
||||||
|
return _.extend(destination, source);
|
||||||
|
};
|
||||||
|
|
||||||
|
deepExtend = function() {
|
||||||
|
var finalObj, maxDepth, objects, _i;
|
||||||
|
objects = 2 <= arguments.length ? __slice.call(arguments, 0, _i = arguments.length - 1) : (_i = 0, []), maxDepth = arguments[_i++];
|
||||||
|
if (!_.isNumber(maxDepth)) {
|
||||||
|
objects.push(maxDepth);
|
||||||
|
maxDepth = 20;
|
||||||
|
}
|
||||||
|
if (objects.length <= 1) {
|
||||||
|
return objects[0];
|
||||||
|
}
|
||||||
|
if (maxDepth <= 0) {
|
||||||
|
return _.extend.apply(this, objects);
|
||||||
|
}
|
||||||
|
finalObj = objects.shift();
|
||||||
|
while (objects.length > 0) {
|
||||||
|
finalObj = deepExtendCouple(finalObj, deepClone(objects.shift()), maxDepth);
|
||||||
|
}
|
||||||
|
return finalObj;
|
||||||
|
};
|
||||||
|
|
||||||
|
_.mixin({
|
||||||
|
deepClone: deepClone,
|
||||||
|
isBasicObject: isBasicObject,
|
||||||
|
basicObjects: basicObjects,
|
||||||
|
arrays: arrays,
|
||||||
|
deepExtend: deepExtend
|
||||||
|
});
|
||||||
|
|
||||||
|
}).call(this);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main source
|
* Main source
|
||||||
*/
|
*/
|
||||||
|
@ -208,15 +329,11 @@
|
||||||
|
|
||||||
//<custom code>
|
//<custom code>
|
||||||
var separator = DeepModel.keyPathSeparator;
|
var separator = DeepModel.keyPathSeparator;
|
||||||
var alreadyTriggered = {}; // * @restorer
|
|
||||||
|
|
||||||
for (var i = 0, l = changes.length; i < l; i++) {
|
for (var i = 0, l = changes.length; i < l; i++) {
|
||||||
var key = changes[i];
|
var key = changes[i];
|
||||||
|
|
||||||
if (!alreadyTriggered.hasOwnProperty(key) || !alreadyTriggered[key]) { // * @restorer
|
|
||||||
alreadyTriggered[key] = true; // * @restorer
|
|
||||||
this.trigger('change:' + key, this, getNested(current, key), options);
|
this.trigger('change:' + key, this, getNested(current, key), options);
|
||||||
} // * @restorer
|
|
||||||
|
|
||||||
var fields = key.split(separator);
|
var fields = key.split(separator);
|
||||||
|
|
||||||
|
@ -225,17 +342,7 @@
|
||||||
var parentKey = _.first(fields, n).join(separator),
|
var parentKey = _.first(fields, n).join(separator),
|
||||||
wildcardKey = parentKey + separator + '*';
|
wildcardKey = parentKey + separator + '*';
|
||||||
|
|
||||||
if (!alreadyTriggered.hasOwnProperty(wildcardKey) || !alreadyTriggered[wildcardKey]) { // * @restorer
|
|
||||||
alreadyTriggered[wildcardKey] = true; // * @restorer
|
|
||||||
this.trigger('change:' + wildcardKey, this, getNested(current, parentKey), options);
|
this.trigger('change:' + wildcardKey, this, getNested(current, parentKey), options);
|
||||||
} // * @restorer
|
|
||||||
|
|
||||||
// + @restorer
|
|
||||||
if (!alreadyTriggered.hasOwnProperty(parentKey) || !alreadyTriggered[parentKey]) {
|
|
||||||
alreadyTriggered[parentKey] = true;
|
|
||||||
this.trigger('change:' + parentKey, this, getNested(current, parentKey), options);
|
|
||||||
}
|
|
||||||
// - @restorer
|
|
||||||
}
|
}
|
||||||
//</custom code>
|
//</custom code>
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,122 +0,0 @@
|
||||||
/**
|
|
||||||
* Underscore mixins for deep objects
|
|
||||||
*
|
|
||||||
* Based on https://gist.github.com/echong/3861963
|
|
||||||
*/
|
|
||||||
define(
|
|
||||||
[
|
|
||||||
'underscore'
|
|
||||||
], function (_) {
|
|
||||||
|
|
||||||
var arrays, basicObjects, deepClone, deepExtend, deepExtendCouple, isBasicObject, __slice =
|
|
||||||
[
|
|
||||||
].slice;
|
|
||||||
|
|
||||||
deepClone = function (obj) {
|
|
||||||
var func, isArr;
|
|
||||||
if (!_.isObject(obj) || _.isFunction(obj)) {
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
if (obj instanceof Backbone.Collection || obj instanceof Backbone.Model) {
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
if (_.isDate(obj)) {
|
|
||||||
return new Date(obj.getTime());
|
|
||||||
}
|
|
||||||
if (_.isRegExp(obj)) {
|
|
||||||
return new RegExp(obj.source, obj.toString().replace(/.*\//, ''));
|
|
||||||
}
|
|
||||||
isArr = _.isArray(obj || _.isArguments(obj));
|
|
||||||
func = function (memo, value, key) {
|
|
||||||
if (isArr) {
|
|
||||||
memo.push(deepClone(value));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
memo[key] = deepClone(value);
|
|
||||||
}
|
|
||||||
return memo;
|
|
||||||
};
|
|
||||||
return _.reduce(obj, func, isArr ?
|
|
||||||
[
|
|
||||||
] :{});
|
|
||||||
};
|
|
||||||
|
|
||||||
isBasicObject = function (object) {
|
|
||||||
if (object == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return (object.prototype === {}.prototype || object.prototype === Object.prototype) && _.isObject(object) && !_.isArray(object) && !_.isFunction(object) && !_.isDate(object) && !_.isRegExp(object) && !_.isArguments(object);
|
|
||||||
};
|
|
||||||
|
|
||||||
basicObjects = function (object) {
|
|
||||||
return _.filter(_.keys(object), function (key) {
|
|
||||||
return isBasicObject(object[key]);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
arrays = function (object) {
|
|
||||||
return _.filter(_.keys(object), function (key) {
|
|
||||||
return _.isArray(object[key]);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
deepExtendCouple = function (destination, source, maxDepth) {
|
|
||||||
var combine, recurse, sharedArrayKey, sharedArrayKeys, sharedObjectKey, sharedObjectKeys, _i, _j, _len, _len1;
|
|
||||||
if (maxDepth == null) {
|
|
||||||
maxDepth = 20;
|
|
||||||
}
|
|
||||||
if (maxDepth <= 0) {
|
|
||||||
console.warn('_.deepExtend(): Maximum depth of recursion hit.');
|
|
||||||
return _.extend(destination, source);
|
|
||||||
}
|
|
||||||
sharedObjectKeys = _.intersection(basicObjects(destination), basicObjects(source));
|
|
||||||
recurse = function (key) {
|
|
||||||
return source[key] = deepExtendCouple(destination[key], source[key], maxDepth - 1);
|
|
||||||
};
|
|
||||||
for (_i = 0, _len = sharedObjectKeys.length; _i < _len; _i++) {
|
|
||||||
sharedObjectKey = sharedObjectKeys[_i];
|
|
||||||
recurse(sharedObjectKey);
|
|
||||||
}
|
|
||||||
sharedArrayKeys = _.intersection(arrays(destination), arrays(source));
|
|
||||||
combine = function (key) {
|
|
||||||
return source[key] = _.union(destination[key], source[key]);
|
|
||||||
};
|
|
||||||
for (_j = 0, _len1 = sharedArrayKeys.length; _j < _len1; _j++) {
|
|
||||||
sharedArrayKey = sharedArrayKeys[_j];
|
|
||||||
combine(sharedArrayKey);
|
|
||||||
}
|
|
||||||
return _.extend(destination, source);
|
|
||||||
};
|
|
||||||
|
|
||||||
deepExtend = function () {
|
|
||||||
var finalObj, maxDepth, objects, _i;
|
|
||||||
objects = 2 <= arguments.length ? __slice.call(arguments, 0, _i = arguments.length - 1) :(_i = 0,
|
|
||||||
[
|
|
||||||
]), maxDepth = arguments[_i++];
|
|
||||||
if (!_.isNumber(maxDepth)) {
|
|
||||||
objects.push(maxDepth);
|
|
||||||
maxDepth = 20;
|
|
||||||
}
|
|
||||||
if (objects.length <= 1) {
|
|
||||||
return objects[0];
|
|
||||||
}
|
|
||||||
if (maxDepth <= 0) {
|
|
||||||
return _.extend.apply(this, objects);
|
|
||||||
}
|
|
||||||
finalObj = objects.shift();
|
|
||||||
while (objects.length > 0) {
|
|
||||||
finalObj = deepExtendCouple(finalObj, deepClone(objects.shift()), maxDepth);
|
|
||||||
}
|
|
||||||
return finalObj;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
_.mixin({
|
|
||||||
deepClone : deepClone,
|
|
||||||
isBasicObject: isBasicObject,
|
|
||||||
basicObjects : basicObjects,
|
|
||||||
arrays : arrays,
|
|
||||||
deepExtend : deepExtend
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ require.config({
|
||||||
'signalR' : 'JsLibraries/jquery.signalR',
|
'signalR' : 'JsLibraries/jquery.signalR',
|
||||||
'jquery.knob' : 'JsLibraries/jquery.knob',
|
'jquery.knob' : 'JsLibraries/jquery.knob',
|
||||||
'jquery.dotdotdot' : 'JsLibraries/jquery.dotdotdot',
|
'jquery.dotdotdot' : 'JsLibraries/jquery.dotdotdot',
|
||||||
'jquery' : 'JsLibraries/jquery',
|
'jquery' : 'jquery/jquery.shim',
|
||||||
'libs' : 'JsLibraries/',
|
'libs' : 'JsLibraries/',
|
||||||
|
|
||||||
'api': 'Require/require.api'
|
'api': 'Require/require.api'
|
||||||
|
@ -29,6 +29,11 @@ require.config({
|
||||||
|
|
||||||
shim: {
|
shim: {
|
||||||
|
|
||||||
|
|
||||||
|
jquery :{
|
||||||
|
exports: '$'
|
||||||
|
},
|
||||||
|
|
||||||
signalR: {
|
signalR: {
|
||||||
deps:
|
deps:
|
||||||
[
|
[
|
||||||
|
@ -76,14 +81,6 @@ require.config({
|
||||||
exports: 'Backbone'
|
exports: 'Backbone'
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
'backbone.deepmodel': {
|
|
||||||
deps:
|
|
||||||
[
|
|
||||||
'Mixins/underscore.mixin.deepExtend'
|
|
||||||
]
|
|
||||||
},
|
|
||||||
|
|
||||||
'backbone.validation': {
|
'backbone.validation': {
|
||||||
deps :
|
deps :
|
||||||
[
|
[
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
'use strict';
|
||||||
|
define(
|
||||||
|
[
|
||||||
|
|
||||||
|
], function () {
|
||||||
|
return window.$;
|
||||||
|
});
|
Loading…
Reference in New Issue