parent
344f3d66ef
commit
428a1439e5
@ -0,0 +1,50 @@
|
|||||||
|
<Query Kind="Program" />
|
||||||
|
|
||||||
|
void Main()
|
||||||
|
{
|
||||||
|
var files = Directory.GetFiles("c:\\git\\sonarr\\src\\UI","*.js", SearchOption.AllDirectories);
|
||||||
|
|
||||||
|
var moduleRegex = new Regex(@"module.exports\s*=\s*\(function\s*\(\)\s*{\n\s*return\s*(\w|\W)*\)\.call\(this\);$");
|
||||||
|
var functionHead = new Regex(@"\s*\(function\s*\(\)\s*{\n\s*return\s*");
|
||||||
|
var functionTail = new Regex(@"\}\).call\(this\);$");
|
||||||
|
var multiVar = new Regex(@"^(?<d>var\s*\w*\s*=\s*require\(.*\)),");
|
||||||
|
var seperateDeclearatuin = new Regex(@"^((\w|\$|_)*\s=\srequire\(.*\))(,|;)", RegexOptions.Multiline);
|
||||||
|
|
||||||
|
foreach (var filePath in files)
|
||||||
|
{
|
||||||
|
var text = File.ReadAllText(filePath);
|
||||||
|
|
||||||
|
var newContent = text.Replace("// Generated by uRequire v0.7.0-beta.14 template: 'nodejs'","");
|
||||||
|
|
||||||
|
newContent = newContent.Replace("var __isAMD = !!(typeof define === 'function' && define.amd),","");
|
||||||
|
newContent = newContent.Replace("__isNode = (typeof exports === 'object'),","");
|
||||||
|
newContent = newContent.Replace("__isWeb = !__isNode;","");
|
||||||
|
newContent = newContent.Replace("\"use strict\";","'use strict';");
|
||||||
|
|
||||||
|
newContent = newContent.Trim();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if(moduleRegex.IsMatch(newContent))
|
||||||
|
{
|
||||||
|
filePath.Dump();
|
||||||
|
|
||||||
|
newContent = functionHead.Replace(newContent," ");
|
||||||
|
newContent = functionTail.Replace(newContent,"");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(multiVar.IsMatch(newContent))
|
||||||
|
{
|
||||||
|
newContent = multiVar.Replace(newContent,"$1;"); //first one
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
newContent = seperateDeclearatuin.Replace(newContent,"var $1;"); //ones after
|
||||||
|
newContent.Replace("var $ = require('jquery'), var","var $ = require('jquery');");
|
||||||
|
|
||||||
|
File.WriteAllText(filePath,newContent.Trim());
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Define other methods and classes here
|
@ -1,12 +1,12 @@
|
|||||||
require('./watch.js');
|
require('./watch.js');
|
||||||
require('./build.js');
|
require('./build.js');
|
||||||
require('./clean.js');
|
require('./clean.js');
|
||||||
require('./requirejs.js');
|
|
||||||
require('./jshint.js');
|
require('./jshint.js');
|
||||||
require('./handlebars.js');
|
require('./handlebars.js');
|
||||||
require('./copy.js');
|
require('./copy.js');
|
||||||
require('./less.js');
|
require('./less.js');
|
||||||
require('./stripBom.js');
|
require('./stripBom.js');
|
||||||
require('./imageMin.js');
|
require('./imageMin.js');
|
||||||
|
require('./webpack.js');
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,32 +0,0 @@
|
|||||||
var gulp = require('gulp');
|
|
||||||
var requirejs = require('requirejs');
|
|
||||||
var paths = require('./paths');
|
|
||||||
|
|
||||||
require('./handlebars.js');
|
|
||||||
require('./jshint.js');
|
|
||||||
|
|
||||||
|
|
||||||
gulp.task('requireJs', ['jshint'], function (cb) {
|
|
||||||
|
|
||||||
var config = {
|
|
||||||
mainConfigFile: 'src/UI/app.js',
|
|
||||||
fileExclusionRegExp: /^.*\.(?!js$)[^.]+$/,
|
|
||||||
preserveLicenseComments: false,
|
|
||||||
dir: paths.dest.root,
|
|
||||||
optimize: 'none',
|
|
||||||
removeCombined: true,
|
|
||||||
inlineText: false,
|
|
||||||
keepBuildDir: true,
|
|
||||||
modules: [
|
|
||||||
{
|
|
||||||
name: 'app',
|
|
||||||
exclude: ['templates.js']
|
|
||||||
}
|
|
||||||
]};
|
|
||||||
|
|
||||||
requirejs.optimize(config, function (buildResponse) {
|
|
||||||
console.log(buildResponse);
|
|
||||||
cb();
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
@ -0,0 +1,20 @@
|
|||||||
|
var gulp = require('gulp');
|
||||||
|
|
||||||
|
var gulpWebpack = require('gulp-webpack');
|
||||||
|
var webpack = require('webpack');
|
||||||
|
var webpackConfig = require('../webpack.config');
|
||||||
|
|
||||||
|
webpackConfig.devtool = "#source-map";
|
||||||
|
|
||||||
|
gulp.task('webpack', function() {
|
||||||
|
return gulp.src('main.js')
|
||||||
|
.pipe(gulpWebpack(webpackConfig, webpack))
|
||||||
|
.pipe(gulp.dest(''));
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('webpackWatch', function() {
|
||||||
|
webpackConfig.watch = true;
|
||||||
|
return gulp.src('main.js')
|
||||||
|
.pipe(gulpWebpack(webpackConfig, webpack))
|
||||||
|
.pipe(gulp.dest(''));
|
||||||
|
});
|
@ -1,19 +1,13 @@
|
|||||||
'use strict';
|
var Handlebars = require('handlebars');
|
||||||
define(
|
|
||||||
[
|
|
||||||
'handlebars'
|
|
||||||
], function (Handlebars) {
|
|
||||||
|
|
||||||
|
module.exports = (function(){
|
||||||
Handlebars.registerHelper('historyAge', function(){
|
Handlebars.registerHelper('historyAge', function(){
|
||||||
|
|
||||||
var unit = 'days';
|
var unit = 'days';
|
||||||
var age = this.age;
|
var age = this.age;
|
||||||
|
|
||||||
if(age < 2) {
|
if(age < 2) {
|
||||||
unit = 'hours';
|
unit = 'hours';
|
||||||
age = parseFloat(this.ageHours).toFixed(1);
|
age = parseFloat(this.ageHours).toFixed(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Handlebars.SafeString('<dt>Age (when grabbed):</dt><dd>{0} {1}</dd>'.format(age, unit));
|
return new Handlebars.SafeString('<dt>Age (when grabbed):</dt><dd>{0} {1}</dd>'.format(age, unit));
|
||||||
});
|
});
|
||||||
});
|
}).call(this);
|
@ -1,11 +1,4 @@
|
|||||||
'use strict';
|
var Marionette = require('marionette');
|
||||||
define(
|
require('./HistoryDetailsAge');
|
||||||
[
|
|
||||||
'marionette',
|
|
||||||
'Activity/History/Details/HistoryDetailsAge'
|
|
||||||
], function (Marionette) {
|
|
||||||
|
|
||||||
return Marionette.ItemView.extend({
|
module.exports = Marionette.ItemView.extend({template : 'Activity/History/Details/HistoryDetailsViewTemplate'});
|
||||||
template: 'Activity/History/Details/HistoryDetailsViewTemplate'
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,31 +1,22 @@
|
|||||||
'use strict';
|
var _ = require('underscore');
|
||||||
define(
|
var Backbone = require('backbone');
|
||||||
[
|
var PageableCollection = require('backbone.pageable');
|
||||||
'underscore',
|
var QueueModel = require('./QueueModel');
|
||||||
'backbone',
|
require('../../Mixins/backbone.signalr.mixin');
|
||||||
'backbone.pageable',
|
|
||||||
'Activity/Queue/QueueModel',
|
module.exports = (function(){
|
||||||
'Mixins/backbone.signalr.mixin'
|
|
||||||
], function (_, Backbone, PageableCollection, QueueModel) {
|
|
||||||
var QueueCollection = PageableCollection.extend({
|
var QueueCollection = PageableCollection.extend({
|
||||||
url : window.NzbDrone.ApiRoot + '/queue',
|
url : window.NzbDrone.ApiRoot + '/queue',
|
||||||
model : QueueModel,
|
model : QueueModel,
|
||||||
|
state : {pageSize : 15},
|
||||||
state: {
|
|
||||||
pageSize: 15
|
|
||||||
},
|
|
||||||
|
|
||||||
mode : 'client',
|
mode : 'client',
|
||||||
|
|
||||||
findEpisode : function(episodeId){
|
findEpisode : function(episodeId){
|
||||||
return _.find(this.fullCollection.models, function(queueModel){
|
return _.find(this.fullCollection.models, function(queueModel){
|
||||||
return queueModel.get('episode').id === episodeId;
|
return queueModel.get('episode').id === episodeId;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var collection = new QueueCollection().bindSignalR();
|
var collection = new QueueCollection().bindSignalR();
|
||||||
collection.fetch();
|
collection.fetch();
|
||||||
|
|
||||||
return collection;
|
return collection;
|
||||||
});
|
}).call(this);
|
@ -1,11 +1,3 @@
|
|||||||
'use strict';
|
var Marionette = require('marionette');
|
||||||
|
|
||||||
define(
|
module.exports = Marionette.CompositeView.extend({template : 'AddSeries/EmptyViewTemplate'});
|
||||||
[
|
|
||||||
'marionette'
|
|
||||||
], function (Marionette) {
|
|
||||||
|
|
||||||
return Marionette.CompositeView.extend({
|
|
||||||
template: 'AddSeries/EmptyViewTemplate'
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,20 +1,11 @@
|
|||||||
'use strict';
|
var Marionette = require('marionette');
|
||||||
|
|
||||||
define(
|
module.exports = Marionette.CompositeView.extend({
|
||||||
[
|
|
||||||
'marionette'
|
|
||||||
], function (Marionette) {
|
|
||||||
|
|
||||||
return Marionette.CompositeView.extend({
|
|
||||||
template : 'AddSeries/ErrorViewTemplate',
|
template : 'AddSeries/ErrorViewTemplate',
|
||||||
|
|
||||||
initialize : function(options){
|
initialize : function(options){
|
||||||
this.options = options;
|
this.options = options;
|
||||||
},
|
},
|
||||||
|
|
||||||
templateHelpers : function(){
|
templateHelpers : function(){
|
||||||
return this.options;
|
return this.options;
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
|
||||||
});
|
});
|
@ -1,59 +1,38 @@
|
|||||||
'use strict';
|
var Marionette = require('marionette');
|
||||||
define(
|
var AddSeriesView = require('../AddSeriesView');
|
||||||
[
|
var UnmappedFolderCollection = require('./UnmappedFolderCollection');
|
||||||
'marionette',
|
|
||||||
'AddSeries/AddSeriesView',
|
|
||||||
'AddSeries/Existing/UnmappedFolderCollection'
|
|
||||||
], function (Marionette, AddSeriesView, UnmappedFolderCollection) {
|
|
||||||
|
|
||||||
return Marionette.CompositeView.extend({
|
|
||||||
|
|
||||||
|
module.exports = Marionette.CompositeView.extend({
|
||||||
itemView : AddSeriesView,
|
itemView : AddSeriesView,
|
||||||
itemViewContainer : '.x-loading-folders',
|
itemViewContainer : '.x-loading-folders',
|
||||||
template : 'AddSeries/Existing/AddExistingSeriesCollectionViewTemplate',
|
template : 'AddSeries/Existing/AddExistingSeriesCollectionViewTemplate',
|
||||||
|
ui : {loadingFolders : '.x-loading-folders'},
|
||||||
ui: {
|
|
||||||
loadingFolders: '.x-loading-folders'
|
|
||||||
},
|
|
||||||
|
|
||||||
initialize : function(){
|
initialize : function(){
|
||||||
this.collection = new UnmappedFolderCollection();
|
this.collection = new UnmappedFolderCollection();
|
||||||
this.collection.importItems(this.model);
|
this.collection.importItems(this.model);
|
||||||
},
|
},
|
||||||
|
|
||||||
showCollection : function(){
|
showCollection : function(){
|
||||||
this._showAndSearch(0);
|
this._showAndSearch(0);
|
||||||
},
|
},
|
||||||
|
|
||||||
appendHtml : function(collectionView, itemView, index){
|
appendHtml : function(collectionView, itemView, index){
|
||||||
collectionView.ui.loadingFolders.before(itemView.el);
|
collectionView.ui.loadingFolders.before(itemView.el);
|
||||||
},
|
},
|
||||||
|
|
||||||
_showAndSearch : function(index){
|
_showAndSearch : function(index){
|
||||||
var self = this;
|
var self = this;
|
||||||
var model = this.collection.at(index);
|
var model = this.collection.at(index);
|
||||||
|
|
||||||
if(model) {
|
if(model) {
|
||||||
var currentIndex = index;
|
var currentIndex = index;
|
||||||
var folderName = model.get('folder').name;
|
var folderName = model.get('folder').name;
|
||||||
this.addItemView(model, this.getItemView(), index);
|
this.addItemView(model, this.getItemView(), index);
|
||||||
this.children.findByModel(model)
|
this.children.findByModel(model).search({term : folderName}).always(function(){
|
||||||
.search({term: folderName})
|
|
||||||
.always(function () {
|
|
||||||
if(!self.isClosed) {
|
if(!self.isClosed) {
|
||||||
self._showAndSearch(currentIndex + 1);
|
self._showAndSearch(currentIndex + 1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
this.ui.loadingFolders.hide();
|
this.ui.loadingFolders.hide();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
itemViewOptions : {isExisting : true}
|
||||||
itemViewOptions: {
|
|
||||||
isExisting: true
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
});
|
});
|
@ -1,10 +1,3 @@
|
|||||||
'use strict';
|
var Backbone = require('backbone');
|
||||||
|
|
||||||
define(
|
module.exports = Backbone.Model.extend({});
|
||||||
[
|
|
||||||
'backbone'
|
|
||||||
], function (Backbone) {
|
|
||||||
return Backbone.Model.extend({
|
|
||||||
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,20 +1,11 @@
|
|||||||
'use strict';
|
var Marionette = require('marionette');
|
||||||
|
|
||||||
define(
|
module.exports = Marionette.CompositeView.extend({
|
||||||
[
|
|
||||||
'marionette'
|
|
||||||
], function (Marionette) {
|
|
||||||
|
|
||||||
return Marionette.CompositeView.extend({
|
|
||||||
template : 'AddSeries/NotFoundViewTemplate',
|
template : 'AddSeries/NotFoundViewTemplate',
|
||||||
|
|
||||||
initialize : function(options){
|
initialize : function(options){
|
||||||
this.options = options;
|
this.options = options;
|
||||||
},
|
},
|
||||||
|
|
||||||
templateHelpers : function(){
|
templateHelpers : function(){
|
||||||
return this.options;
|
return this.options;
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
|
||||||
});
|
});
|
@ -1,17 +1,11 @@
|
|||||||
'use strict';
|
var Backbone = require('backbone');
|
||||||
define(
|
var RootFolderModel = require('./RootFolderModel');
|
||||||
[
|
require('../../Mixins/backbone.signalr.mixin');
|
||||||
'backbone',
|
|
||||||
'AddSeries/RootFolders/RootFolderModel',
|
|
||||||
'Mixins/backbone.signalr.mixin'
|
|
||||||
], function (Backbone, RootFolderModel) {
|
|
||||||
|
|
||||||
|
module.exports = (function(){
|
||||||
var RootFolderCollection = Backbone.Collection.extend({
|
var RootFolderCollection = Backbone.Collection.extend({
|
||||||
url : window.NzbDrone.ApiRoot + '/rootfolder',
|
url : window.NzbDrone.ApiRoot + '/rootfolder',
|
||||||
model : RootFolderModel
|
model : RootFolderModel
|
||||||
});
|
});
|
||||||
|
|
||||||
//var collection = new RootFolderCollection().bindSignalR();
|
|
||||||
|
|
||||||
return new RootFolderCollection();
|
return new RootFolderCollection();
|
||||||
});
|
}).call(this);
|
@ -1,81 +1,54 @@
|
|||||||
'use strict';
|
var Marionette = require('marionette');
|
||||||
|
var RootFolderCollectionView = require('./RootFolderCollectionView');
|
||||||
define(
|
var RootFolderCollection = require('./RootFolderCollection');
|
||||||
[
|
var RootFolderModel = require('./RootFolderModel');
|
||||||
'marionette',
|
var LoadingView = require('../../Shared/LoadingView');
|
||||||
'AddSeries/RootFolders/RootFolderCollectionView',
|
var AsValidatedView = require('../../Mixins/AsValidatedView');
|
||||||
'AddSeries/RootFolders/RootFolderCollection',
|
require('../../Mixins/FileBrowser');
|
||||||
'AddSeries/RootFolders/RootFolderModel',
|
|
||||||
'Shared/LoadingView',
|
module.exports = (function(){
|
||||||
'Mixins/AsValidatedView',
|
|
||||||
'Mixins/FileBrowser'
|
|
||||||
], function (Marionette, RootFolderCollectionView, RootFolderCollection, RootFolderModel, LoadingView, AsValidatedView) {
|
|
||||||
|
|
||||||
var layout = Marionette.Layout.extend({
|
var layout = Marionette.Layout.extend({
|
||||||
template : 'AddSeries/RootFolders/RootFolderLayoutTemplate',
|
template : 'AddSeries/RootFolders/RootFolderLayoutTemplate',
|
||||||
|
ui : {pathInput : '.x-path'},
|
||||||
ui: {
|
regions : {currentDirs : '#current-dirs'},
|
||||||
pathInput: '.x-path'
|
|
||||||
},
|
|
||||||
|
|
||||||
regions: {
|
|
||||||
currentDirs: '#current-dirs'
|
|
||||||
},
|
|
||||||
|
|
||||||
events : {
|
events : {
|
||||||
'click .x-add' : '_addFolder',
|
'click .x-add' : '_addFolder',
|
||||||
'keydown .x-path input' : '_keydown'
|
'keydown .x-path input' : '_keydown'
|
||||||
},
|
},
|
||||||
|
|
||||||
initialize : function(){
|
initialize : function(){
|
||||||
this.collection = RootFolderCollection;
|
this.collection = RootFolderCollection;
|
||||||
this.rootfolderListView = new RootFolderCollectionView({collection : RootFolderCollection});
|
this.rootfolderListView = new RootFolderCollectionView({collection : RootFolderCollection});
|
||||||
|
|
||||||
this.listenTo(this.rootfolderListView, 'itemview:folderSelected', this._onFolderSelected);
|
this.listenTo(this.rootfolderListView, 'itemview:folderSelected', this._onFolderSelected);
|
||||||
this.listenTo(RootFolderCollection, 'sync', this._showCurrentDirs);
|
this.listenTo(RootFolderCollection, 'sync', this._showCurrentDirs);
|
||||||
},
|
},
|
||||||
|
|
||||||
onRender : function(){
|
onRender : function(){
|
||||||
this.currentDirs.show(new LoadingView());
|
this.currentDirs.show(new LoadingView());
|
||||||
|
|
||||||
if(RootFolderCollection.synced) {
|
if(RootFolderCollection.synced) {
|
||||||
this._showCurrentDirs();
|
this._showCurrentDirs();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.ui.pathInput.fileBrowser();
|
this.ui.pathInput.fileBrowser();
|
||||||
},
|
},
|
||||||
|
|
||||||
_onFolderSelected : function(options){
|
_onFolderSelected : function(options){
|
||||||
this.trigger('folderSelected', options);
|
this.trigger('folderSelected', options);
|
||||||
},
|
},
|
||||||
|
|
||||||
_addFolder : function(){
|
_addFolder : function(){
|
||||||
var self = this;
|
var self = this;
|
||||||
|
var newDir = new RootFolderModel({Path : this.ui.pathInput.val()});
|
||||||
var newDir = new RootFolderModel({
|
|
||||||
Path: this.ui.pathInput.val()
|
|
||||||
});
|
|
||||||
|
|
||||||
this.bindToModelValidation(newDir);
|
this.bindToModelValidation(newDir);
|
||||||
|
|
||||||
newDir.save().done(function(){
|
newDir.save().done(function(){
|
||||||
RootFolderCollection.add(newDir);
|
RootFolderCollection.add(newDir);
|
||||||
self.trigger('folderSelected', {model : newDir});
|
self.trigger('folderSelected', {model : newDir});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
_showCurrentDirs : function(){
|
_showCurrentDirs : function(){
|
||||||
this.currentDirs.show(this.rootfolderListView);
|
this.currentDirs.show(this.rootfolderListView);
|
||||||
},
|
},
|
||||||
|
|
||||||
_keydown : function(e){
|
_keydown : function(e){
|
||||||
if(e.keyCode !== 13) {
|
if(e.keyCode !== 13) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._addFolder();
|
this._addFolder();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return AsValidatedView.apply(layout);
|
return AsValidatedView.apply(layout);
|
||||||
});
|
}).call(this);
|
@ -1,12 +1,6 @@
|
|||||||
'use strict';
|
var Backbone = require('backbone');
|
||||||
define(
|
|
||||||
[
|
module.exports = Backbone.Model.extend({
|
||||||
'backbone'
|
|
||||||
], function (Backbone) {
|
|
||||||
return Backbone.Model.extend({
|
|
||||||
urlRoot : window.NzbDrone.ApiRoot + '/rootfolder',
|
urlRoot : window.NzbDrone.ApiRoot + '/rootfolder',
|
||||||
defaults: {
|
defaults : {freeSpace : 0}
|
||||||
freeSpace: 0
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
@ -1,33 +1,22 @@
|
|||||||
'use strict';
|
var vent = require('../vent');
|
||||||
|
var NzbDroneCell = require('./NzbDroneCell');
|
||||||
define(
|
|
||||||
[
|
|
||||||
'vent',
|
|
||||||
'Cells/NzbDroneCell'
|
|
||||||
], function (vent, NzbDroneCell) {
|
|
||||||
return NzbDroneCell.extend({
|
|
||||||
|
|
||||||
|
module.exports = NzbDroneCell.extend({
|
||||||
className : 'episode-title-cell',
|
className : 'episode-title-cell',
|
||||||
|
events : {"click" : '_showDetails'},
|
||||||
events: {
|
|
||||||
'click': '_showDetails'
|
|
||||||
},
|
|
||||||
|
|
||||||
render : function(){
|
render : function(){
|
||||||
var title = this.cellValue.get('title');
|
var title = this.cellValue.get('title');
|
||||||
|
|
||||||
if(!title || title === '') {
|
if(!title || title === '') {
|
||||||
title = 'TBA';
|
title = 'TBA';
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$el.html(title);
|
this.$el.html(title);
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
_showDetails : function(){
|
_showDetails : function(){
|
||||||
var hideSeriesLink = this.column.get('hideSeriesLink');
|
var hideSeriesLink = this.column.get('hideSeriesLink');
|
||||||
|
vent.trigger(vent.Commands.ShowEpisodeDetails, {
|
||||||
vent.trigger(vent.Commands.ShowEpisodeDetails, { episode: this.cellValue, hideSeriesLink: hideSeriesLink });
|
episode : this.cellValue,
|
||||||
}
|
hideSeriesLink : hideSeriesLink
|
||||||
});
|
});
|
||||||
|
}
|
||||||
});
|
});
|
@ -1,12 +1,6 @@
|
|||||||
'use strict';
|
var TemplatedCell = require('./TemplatedCell');
|
||||||
define(
|
|
||||||
[
|
|
||||||
'Cells/TemplatedCell'
|
|
||||||
], function (TemplatedCell) {
|
|
||||||
return TemplatedCell.extend({
|
|
||||||
|
|
||||||
|
module.exports = TemplatedCell.extend({
|
||||||
className : 'series-title-cell',
|
className : 'series-title-cell',
|
||||||
template : 'Cells/SeriesTitleTemplate'
|
template : 'Cells/SeriesTitleTemplate'
|
||||||
|
|
||||||
});
|
|
||||||
});
|
});
|
@ -1,26 +1,18 @@
|
|||||||
'use strict';
|
var Backbone = require('backbone');
|
||||||
define(
|
var CommandModel = require('./CommandModel');
|
||||||
[
|
require('../Mixins/backbone.signalr.mixin');
|
||||||
'backbone',
|
|
||||||
'Commands/CommandModel',
|
|
||||||
'Mixins/backbone.signalr.mixin'
|
|
||||||
], function (Backbone, CommandModel) {
|
|
||||||
|
|
||||||
|
module.exports = (function(){
|
||||||
var CommandCollection = Backbone.Collection.extend({
|
var CommandCollection = Backbone.Collection.extend({
|
||||||
url : window.NzbDrone.ApiRoot + '/command',
|
url : window.NzbDrone.ApiRoot + '/command',
|
||||||
model : CommandModel,
|
model : CommandModel,
|
||||||
|
|
||||||
findCommand : function(command){
|
findCommand : function(command){
|
||||||
return this.find(function(model){
|
return this.find(function(model){
|
||||||
return model.isSameCommand(command);
|
return model.isSameCommand(command);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
var collection = new CommandCollection().bindSignalR();
|
var collection = new CommandCollection().bindSignalR();
|
||||||
|
|
||||||
collection.fetch();
|
collection.fetch();
|
||||||
|
|
||||||
return collection;
|
return collection;
|
||||||
});
|
}).call(this);
|
@ -1,14 +1,8 @@
|
|||||||
'use strict';
|
var Marionette = require('marionette');
|
||||||
define(
|
var commandCollection = require('./CommandCollection');
|
||||||
[
|
var CommandMessengerItemView = require('./CommandMessengerItemView');
|
||||||
'marionette',
|
|
||||||
'Commands/CommandCollection',
|
|
||||||
'Commands/CommandMessengerItemView'
|
|
||||||
], function (Marionette, commandCollection, CommandMessengerItemView) {
|
|
||||||
|
|
||||||
var CollectionView = Marionette.CollectionView.extend({
|
|
||||||
itemView: CommandMessengerItemView
|
|
||||||
});
|
|
||||||
|
|
||||||
|
module.exports = (function(){
|
||||||
|
var CollectionView = Marionette.CollectionView.extend({itemView : CommandMessengerItemView});
|
||||||
return new CollectionView({collection : commandCollection});
|
return new CollectionView({collection : commandCollection});
|
||||||
});
|
}).call(this);
|
@ -1,11 +1,3 @@
|
|||||||
'use strict';
|
var Marionette = require('marionette');
|
||||||
define(
|
|
||||||
[
|
|
||||||
'marionette'
|
|
||||||
], function (Marionette) {
|
|
||||||
|
|
||||||
return Marionette.ItemView.extend({
|
module.exports = Marionette.ItemView.extend({template : 'Episode/Activity/NoActivityViewTemplate'});
|
||||||
template: 'Episode/Activity/NoActivityViewTemplate'
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
@ -1,10 +1,3 @@
|
|||||||
'use strict';
|
var Marionette = require('marionette');
|
||||||
define(
|
|
||||||
[
|
|
||||||
'marionette'
|
|
||||||
], function (Marionette) {
|
|
||||||
|
|
||||||
return Marionette.ItemView.extend({
|
module.exports = Marionette.ItemView.extend({template : 'Episode/Search/ButtonsViewTemplate'});
|
||||||
template: 'Episode/Search/ButtonsViewTemplate'
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,10 +1,3 @@
|
|||||||
'use strict';
|
var Marionette = require('marionette');
|
||||||
|
|
||||||
define(
|
module.exports = Marionette.ItemView.extend({template : 'Episode/Search/NoResultsViewTemplate'});
|
||||||
[
|
|
||||||
'marionette'
|
|
||||||
], function (Marionette) {
|
|
||||||
return Marionette.ItemView.extend({
|
|
||||||
template: 'Episode/Search/NoResultsViewTemplate'
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,11 +1,3 @@
|
|||||||
'use strict';
|
var Marionette = require('marionette');
|
||||||
define(
|
|
||||||
[
|
|
||||||
'marionette'
|
|
||||||
], function (Marionette) {
|
|
||||||
|
|
||||||
return Marionette.ItemView.extend({
|
module.exports = Marionette.ItemView.extend({template : 'Episode/Summary/NoFileViewTemplate'});
|
||||||
template: 'Episode/Summary/NoFileViewTemplate'
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue