updated more functional element classes to use the x- notation.

This commit is contained in:
kay.one 2013-01-28 23:44:07 -08:00
parent 30a049e4fb
commit bb024d6203
10 changed files with 28 additions and 48 deletions

View File

@ -201,7 +201,6 @@
<Content Include="_backboneApp\Quality\qualityProfileCollection.js" /> <Content Include="_backboneApp\Quality\qualityProfileCollection.js" />
<Content Include="_backboneApp\Quality\qualityTypeModel.js" /> <Content Include="_backboneApp\Quality\qualityTypeModel.js" />
<Content Include="_backboneApp\Quality\qualityTypeCollection.js" /> <Content Include="_backboneApp\Quality\qualityTypeCollection.js" />
<Content Include="_backboneApp\nzbdrone.logging.js" />
<Content Include="_backboneApp\JsLibraries\backbone.marionette.extend.js" /> <Content Include="_backboneApp\JsLibraries\backbone.marionette.extend.js" />
<Compile Include="_backboneApp\CassetteConfiguration.cs" /> <Compile Include="_backboneApp\CassetteConfiguration.cs" />
<Compile Include="Controllers\ImageController.cs" /> <Compile Include="Controllers\ImageController.cs" />

View File

@ -15,17 +15,16 @@ NzbDrone.AddSeries.AddSeriesLayout = Backbone.Marionette.Layout.extend({
}, },
ui: { ui: {
addNewTab: ".nav-tabs a[href='#add-new']", addNewTab: ".x-add-new-tab",
importTab: ".nav-tabs a[href='#import-existing']", importExistingTab: ".x-import-existing-tab",
rootDirTab: ".nav-tabs a[href='#root-folders']", rootFoldersTab: ".x-root-folders-tab",
rootTabRequiredMessage: "",
}, },
events: { events: {
"click .nav-tabs a[href='#add-new']": 'showAddNew', "click .x-add-new-tab": 'showAddNew',
"click .nav-tabs a[href='#import-existing']": 'showImport', "click .x-import-existing-tab": 'showImport',
"click .nav-tabs a[href='#root-folders']": 'showRootFolders', "click .x-root-folders-tab": 'showRootFolders',
}, },
showAddNew: function (e) { showAddNew: function (e) {
@ -39,14 +38,14 @@ NzbDrone.AddSeries.AddSeriesLayout = Backbone.Marionette.Layout.extend({
showImport: function (e) { showImport: function (e) {
if (e) e.preventDefault(); if (e) e.preventDefault();
this.ui.importTab.tab('show'); this.ui.importExistingTab.tab('show');
NzbDrone.Router.navigate('series/add/import'); NzbDrone.Router.navigate('series/add/import');
}, },
showRootFolders: function (e) { showRootFolders: function (e) {
if (e) e.preventDefault(); if (e) e.preventDefault();
this.ui.rootDirTab.tab('show'); this.ui.rootFoldersTab.tab('show');
NzbDrone.Router.navigate('series/add/rootfolders'); NzbDrone.Router.navigate('series/add/rootfolders');
}, },
@ -93,11 +92,11 @@ NzbDrone.AddSeries.AddSeriesLayout = Backbone.Marionette.Layout.extend({
evaluateActions: function () { evaluateActions: function () {
if (this.rootFolderCollection.length == 0) { if (this.rootFolderCollection.length == 0) {
this.ui.addNewTab.hide(); this.ui.addNewTab.hide();
this.ui.importTab.hide(); this.ui.importExistingTab.hide();
this.showRootFolders(); this.showRootFolders();
} else { } else {
this.ui.addNewTab.show(); this.ui.addNewTab.show();
this.ui.importTab.show(); this.ui.importExistingTab.show();
} }
}, },

View File

@ -3,6 +3,6 @@
<span name="freeSpaceString"></span> <span name="freeSpaceString"></span>
</td> </td>
<td class="span1 nz-row-action"> <td class="span1 nz-row-action">
<div id="remove-dir" class="btn btn-danger icon-minus"> <div class="btn btn-danger icon-minus x-remove">
</div> </div>
</td> </td>

View File

@ -1,8 +1,8 @@
<div class="tab-pane" id="root-dir"> <div class="tab-pane" id="root-dir">
<div class="input-prepend input-append nz-input-large path"> <div class="input-prepend input-append nz-input-large x-path">
<i class="add-on icon-folder-open"></i> <i class="add-on icon-folder-open"></i>
<input type="text" class="span10" placeholder="Path of the folder to add ..."> <input type="text" class="span10" placeholder="Path of the folder to add ...">
<div id="add-dir" class="btn icon-plus btn-success" /> <div class="btn icon-plus btn-success x-add" />
</div> </div>
<div class="span15 offset2 result-list" id="current-dirs" /> <div class="span15 offset2 result-list" id="current-dirs" />
</div> </div>

View File

@ -8,14 +8,14 @@ NzbDrone.AddSeries.RootDirItemView = Backbone.Marionette.ItemView.extend({
tagName: 'tr', tagName: 'tr',
events: { events: {
'click #remove-dir': 'removeDir', 'click .x-remove': 'removeFolder',
}, },
onRender: function () { onRender: function () {
NzbDrone.ModelBinder.bind(this.model, this.el); NzbDrone.ModelBinder.bind(this.model, this.el);
}, },
removeDir: function () { removeFolder: function () {
this.model.destroy({ wait: true }); this.model.destroy({ wait: true });
this.model.collection.remove(this.model); this.model.collection.remove(this.model);
}, },
@ -34,7 +34,7 @@ NzbDrone.AddSeries.RootDirView = Backbone.Marionette.Layout.extend({
route: "series/add/rootdir", route: "series/add/rootdir",
ui: { ui: {
pathInput: '.path input' pathInput: '.x-path input'
}, },
regions: { regions: {
@ -42,37 +42,20 @@ NzbDrone.AddSeries.RootDirView = Backbone.Marionette.Layout.extend({
}, },
events: { events: {
'click #add-dir': 'addDir', 'click .x-add': 'addFolder',
},
shortcuts: {
'enter': 'addDir'
}, },
collection: new NzbDrone.AddSeries.RootDirCollection(), collection: new NzbDrone.AddSeries.RootDirCollection(),
onRender: function () { onRender: function () {
var self = this;
//NzbDrone.Router.navigate(this.route, { trigger: true });
/*
this.ui.seriesSearch
.data('timeout', null)
.keyup(function () {
clearTimeout(self.$el.data('timeout'));
self.$el.data('timeout', setTimeout(self.search, 500, self));
});
*/
this.currentDirs.show(new NzbDrone.AddSeries.RootDirListView({ collection: this.collection })); this.currentDirs.show(new NzbDrone.AddSeries.RootDirListView({ collection: this.collection }));
this.collection.fetch(); this.collection.fetch();
}, },
addDir: function () { addFolder: function () {
var newDir = new NzbDrone.AddSeries.RootDirModel( var newDir = new NzbDrone.AddSeries.RootDirModel(
{ {
Path: this.ui.pathInput.val() Path: this.ui.pathInput.val()

View File

@ -21,9 +21,8 @@
text-align: left; text-align: left;
} }
.result-list .well:hover { .result-list .accordion-heading:hover {
background-color: #fcf8e3; background-color: #fcf8e3;
cursor: pointer;
} }
@ -33,6 +32,10 @@
padding-left: 10px; padding-left: 10px;
} }
.search-item .accordion-body .in {
background-color: #fcf8e3;
}
.result-list .result-item a { .result-list .result-item a {
font-size: 20px; font-size: 20px;
} }

View File

@ -2,9 +2,9 @@
<strong>Heads up!</strong> you need to add at least one TV folder. <strong>Heads up!</strong> you need to add at least one TV folder.
</div>--> </div>-->
<ul class="nav nav-tabs" id="myTab"> <ul class="nav nav-tabs" id="myTab">
<li><a href="#add-new">Add New Series</a></li> <li><a href="#add-new" class="x-add-new-tab">Add New Series</a></li>
<li><a href="#import-existing">Import Existing Series</a></li> <li><a href="#import-existing" class="x-import-existing-tab">Import Existing Series</a></li>
<li><a href="#root-folders">TV Folders</a></li> <li><a href="#root-folders" class ="x-root-folders-tab">TV Folders</a></li>
</ul> </ul>
<div class="tab-content nz-center"> <div class="tab-content nz-center">
<div class="tab-pane" id="add-new">Add new series.</div> <div class="tab-pane" id="add-new">Add new series.</div>

View File

@ -41,14 +41,14 @@ body {
text-align: center; text-align: center;
} }
#footer { #footer-region {
font-size: 16px; font-size: 16px;
text-decoration: none; text-decoration: none;
font-weight: lighter; font-weight: lighter;
margin: 20px 0 30px 0; margin: 20px 0 30px 0;
} }
#footer a:hover { #footer-region a:hover {
text-decoration: underline; text-decoration: underline;
} }

View File

@ -11,7 +11,6 @@
/// <reference path="JsLibraries/backbone.marionette.viewswapper.js" /> /// <reference path="JsLibraries/backbone.marionette.viewswapper.js" />
/// <reference path="JsLibraries/backbone.modelbinder.js" /> /// <reference path="JsLibraries/backbone.modelbinder.js" />
/// <reference path="JsLibraries/bootstrap.js" /> /// <reference path="JsLibraries/bootstrap.js" />
/// <reference path="nzbdrone.logging.js" />
if (typeof console == "undefined") { if (typeof console == "undefined") {
window.console = { log: function () { } }; window.console = { log: function () { } };

View File

@ -1,3 +0,0 @@
$(document).ajaxSuccess(function (event, XMLHttpRequest, ajaxOptionsa) {
console.log(ajaxOptionsa);
});