added global NzbDrone namespace.

pull/2/head
kay.one 11 years ago
parent d5e5d6de29
commit 27c57612f4

@ -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) {

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

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

@ -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) {

@ -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) {

@ -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) {

@ -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();

@ -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: {

@ -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: {

@ -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: {

@ -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: {

@ -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 },

@ -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(){

@ -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();

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

@ -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',

@ -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: {

@ -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,

@ -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) {

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

@ -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);
});

@ -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'

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

@ -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'
});

@ -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()
});

@ -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
});
});

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

@ -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'
});

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

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

Loading…
Cancel
Save