added global NzbDrone namespace.

This commit is contained in:
kay.one 2013-09-14 00:10:19 -07:00
parent d5e5d6de29
commit 27c57612f4
30 changed files with 36 additions and 35 deletions

View File

@ -5,7 +5,7 @@ define(
'Series/SeriesModel'
], function (Backbone, SeriesModel) {
return Backbone.Collection.extend({
url : window.ApiRoot + '/series/lookup',
url : window.NzbDrone.ApiRoot + '/series/lookup',
model: SeriesModel,
initialize: function (options) {

View File

@ -7,7 +7,7 @@ define(
], function (Backbone, RootFolderModel) {
var RootFolderCollection = Backbone.Collection.extend({
url : window.ApiRoot + '/rootfolder',
url : window.NzbDrone.ApiRoot + '/rootfolder',
model: RootFolderModel
});

View File

@ -4,7 +4,7 @@ define(
'backbone'
], function (Backbone) {
return Backbone.Model.extend({
urlRoot : window.ApiRoot + '/rootfolder',
urlRoot : window.NzbDrone.ApiRoot + '/rootfolder',
defaults: {
freeSpace: 0
}

View File

@ -5,7 +5,7 @@ define(
'Series/EpisodeModel'
], function (Backbone, EpisodeModel) {
return Backbone.Collection.extend({
url : window.ApiRoot + '/calendar',
url : window.NzbDrone.ApiRoot + '/calendar',
model: EpisodeModel,
comparator: function (model) {

View File

@ -6,7 +6,7 @@ define(
'Series/EpisodeModel'
], function (Backbone, Moment, EpisodeModel) {
return Backbone.Collection.extend({
url : window.ApiRoot + '/calendar',
url : window.NzbDrone.ApiRoot + '/calendar',
model: EpisodeModel,
comparator: function (model1, model2) {

View File

@ -7,7 +7,7 @@ define(
], function (Backbone, CommandModel) {
var CommandCollection = Backbone.Collection.extend({
url : window.ApiRoot + '/command',
url : window.NzbDrone.ApiRoot + '/command',
model: CommandModel,
findCommand: function (command) {

View File

@ -4,7 +4,7 @@ define(
'backbone'
], function (Backbone) {
return Backbone.Model.extend({
url: window.ApiRoot + '/command',
url: window.NzbDrone.ApiRoot + '/command',
parse: function (response) {
response.name = response.name.toLocaleLowerCase();

View File

@ -5,7 +5,7 @@ define(
'backbone.pageable'
], function (HistoryModel, PageableCollection) {
return PageableCollection.extend({
url : window.ApiRoot + '/history',
url : window.NzbDrone.ApiRoot + '/history',
model: HistoryModel,
state: {

View File

@ -1,7 +1,7 @@
'use strict';
define(['backbone.pageable', 'Logs/Model', ], function (PagableCollection, LogsModel) {
return PagableCollection.extend({
url : window.ApiRoot + '/log',
url : window.NzbDrone.ApiRoot + '/log',
model: LogsModel,
state: {

View File

@ -2,7 +2,7 @@
define(['Logs/Files/Model' ],
function (LogFileModel) {
return Backbone.Collection.extend({
url : window.ApiRoot + '/log/files',
url : window.NzbDrone.ApiRoot + '/log/files',
model: LogFileModel,
state: {

View File

@ -5,7 +5,7 @@ define(
'backbone.pageable'
], function (EpisodeModel, PagableCollection) {
return PagableCollection.extend({
url : window.ApiRoot + '/missing',
url : window.NzbDrone.ApiRoot + '/missing',
model: EpisodeModel,
state: {

View File

@ -6,7 +6,7 @@ define(function () {
$(this).typeahead({
source : function (filter, callback) {
$.ajax({
url : window.ApiRoot + resource,
url : window.NzbDrone.ApiRoot + resource,
dataType: 'json',
type : 'GET',
data : { query: filter },

View File

@ -8,7 +8,7 @@ define(
], function (App, Backbone, Messenger) {
var ProgressMessageCollection = Backbone.Collection.extend({
url : window.ApiRoot + '/progressmessage',
url : window.NzbDrone.ApiRoot + '/progressmessage',
model: Backbone.Model,
initialize: function(){

View File

@ -7,7 +7,7 @@ define(
var QualityProfileCollection = Backbone.Collection.extend({
model: QualityProfileModel,
url : window.ApiRoot + '/qualityprofiles'
url : window.NzbDrone.ApiRoot + '/qualityprofiles'
});
var profiles = new QualityProfileCollection();

View File

@ -5,6 +5,6 @@ define(
], function (QualitySizeModel) {
return Backbone.Collection.extend({
model: QualitySizeModel,
url : window.ApiRoot + '/qualitysize'
url : window.NzbDrone.ApiRoot + '/qualitysize'
});
});

View File

@ -5,7 +5,7 @@ define(
'backbone.pageable'
], function (ReleaseModel, PagableCollection) {
return PagableCollection.extend({
url : window.ApiRoot + '/release',
url : window.NzbDrone.ApiRoot + '/release',
model: ReleaseModel,
mode: 'client',

View File

@ -5,7 +5,7 @@ define(
'Series/EpisodeModel'
], function (Backbone, EpisodeModel) {
return Backbone.Collection.extend({
url : window.ApiRoot + '/episodes',
url : window.NzbDrone.ApiRoot + '/episodes',
model: EpisodeModel,
state: {

View File

@ -5,7 +5,7 @@ define(
'Series/EpisodeFileModel'
], function (Backbone, EpisodeFileModel) {
return Backbone.Collection.extend({
url : window.ApiRoot + '/episodefile',
url : window.NzbDrone.ApiRoot + '/episodefile',
model: EpisodeFileModel,
originalFetch: Backbone.Collection.prototype.fetch,

View File

@ -5,7 +5,7 @@ define(
'Series/SeriesModel'
], function (Backbone, SeriesModel) {
var Collection = Backbone.Collection.extend({
url : window.ApiRoot + '/series',
url : window.NzbDrone.ApiRoot + '/series',
model: SeriesModel,
comparator: function (model) {

View File

@ -7,7 +7,7 @@ define(
], function (Backbone, _) {
return Backbone.Model.extend({
urlRoot: ApiRoot + '/series',
urlRoot: window.NzbDrone.ApiRoot + '/series',
defaults: {
episodeFileCount: 0,

View File

@ -1,18 +1,19 @@
window.ApiRoot = '/api';
window.NzbDrone = {};
window.NzbDrone.ApiRoot = '/api';
var statusText = $.ajax({
type : 'GET',
url : window.ApiRoot + '/system/status',
url : window.NzbDrone.ApiRoot + '/system/status',
async: false
}).responseText;
window.ServerStatus = JSON.parse(statusText);
window.NzbDrone.ServerStatus = JSON.parse(statusText);
var footerText = window.ServerStatus.version;
var footerText = window.NzbDrone.ServerStatus.version;
$(document).ready(function () {
if (window.ServerStatus.branch != 'master') {
footerText += '</br>' + window.ServerStatus.branch;
if (window.NzbDrone.ServerStatus.branch != 'master') {
footerText += '</br>' + window.NzbDrone.ServerStatus.branch;
}
$('#footer-region .version').html(footerText);
});

View File

@ -5,7 +5,7 @@ define(
], function (SettingsModelBase) {
return SettingsModelBase.extend({
url : window.ApiRoot + '/settings/host',
url : window.NzbDrone.ApiRoot + '/settings/host',
successMessage: 'General settings saved',
errorMessage : 'Failed to save general settings'

View File

@ -5,7 +5,7 @@ define(
'Form/FormBuilder'
], function (IndexerModel) {
return Backbone.Collection.extend({
url : window.ApiRoot + '/indexer',
url : window.NzbDrone.ApiRoot + '/indexer',
model: IndexerModel
});
});

View File

@ -4,7 +4,7 @@ define(
'Settings/SettingsModelBase'
], function (ModelBase) {
return ModelBase.extend({
url : window.ApiRoot + '/config/naming',
url : window.NzbDrone.ApiRoot + '/config/naming',
successMessage: 'MediaManagement settings saved',
errorMessage : 'Couldn\'t save naming settings'
});

View File

@ -45,7 +45,7 @@ define(
var promise = $.ajax({
type: 'GET',
url : window.ApiRoot + '/config/naming/samples',
url : window.NzbDrone.ApiRoot + '/config/naming/samples',
data: this.model.toJSON()
});

View File

@ -4,7 +4,7 @@ define(
'Settings/Notifications/Model'
], function (NotificationModel) {
return Backbone.Collection.extend({
url : window.ApiRoot + '/notification',
url : window.NzbDrone.ApiRoot + '/notification',
model: NotificationModel
});
});

View File

@ -8,6 +8,6 @@ define(
return Backbone.Collection.extend({
model: QualityProfileModel,
url : window.ApiRoot + '/qualityprofiles/schema'
url : window.NzbDrone.ApiRoot + '/qualityprofiles/schema'
});
});

View File

@ -2,7 +2,7 @@
define(['app',
'Settings/SettingsModelBase'], function (App, SettingsModelBase) {
return SettingsModelBase.extend({
url : window.ApiRoot + '/settings',
url : window.NzbDrone.ApiRoot + '/settings',
successMessage: 'Settings saved',
errorMessage : 'Failed to save settings'
});

View File

@ -5,7 +5,7 @@ define(
], function (Backbone) {
var model = Backbone.Model.extend({
url: window.ApiRoot + '/system/status'
url: window.NzbDrone.ApiRoot + '/system/status'
});

View File

@ -1,7 +1,7 @@
'use strict';
require.config({
urlArgs: 'v=' + window.ServerStatus.version,
urlArgs: 'v=' + window.NzbDrone.ServerStatus.version,
paths: {
'backbone' : 'JsLibraries/backbone',