1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-26 22:46:53 -04:00

rjs -> webpack

This commit is contained in:
Keivan Beigi
2015-02-02 17:18:45 -08:00
parent 344f3d66ef
commit 428a1439e5
399 changed files with 11591 additions and 16139 deletions
+45 -58
View File
@@ -1,60 +1,47 @@
'use strict';
define(
[
'vent',
'AppLayout',
'marionette',
'Shared/NotFoundView'
], function (vent, AppLayout, Marionette, NotFoundView) {
return Marionette.AppRouter.extend({
var vent = require('../vent');
var AppLayout = require('../AppLayout');
var Marionette = require('marionette');
var NotFoundView = require('./NotFoundView');
initialize: function () {
this.listenTo(vent, vent.Events.ServerUpdated, this._onServerUpdated);
},
showNotFound: function () {
this.setTitle('Not Found');
this.showMainRegion(new NotFoundView(this));
},
setTitle: function (title) {
title = title;
if (title === 'Sonarr') {
document.title = 'Sonarr';
}
else {
document.title = title + ' - Sonarr';
}
if(window.NzbDrone.Analytics && window.Piwik){
try {
var piwik = window.Piwik.getTracker('http://piwik.nzbdrone.com/piwik.php', 1);
piwik.setReferrerUrl('');
piwik.setCustomUrl('http://local' + window.location.pathname);
piwik.setCustomVariable(1, 'version', window.NzbDrone.Version, 'page');
piwik.setCustomVariable(2, 'branch', window.NzbDrone.Branch, 'page');
piwik.trackPageView(title);
}
catch (e){
console.error(e);
}
}
},
_onServerUpdated: function () {
this.pendingUpdate = true;
},
showMainRegion: function (view) {
if (this.pendingUpdate) {
window.location.reload();
}
else {
//AppLayout
AppLayout.mainRegion.show(view);
}
module.exports = Marionette.AppRouter.extend({
initialize : function(){
this.listenTo(vent, vent.Events.ServerUpdated, this._onServerUpdated);
},
showNotFound : function(){
this.setTitle('Not Found');
this.showMainRegion(new NotFoundView(this));
},
setTitle : function(title){
title = title;
if(title === 'Sonarr') {
document.title = 'Sonarr';
}
else {
document.title = title + ' - Sonarr';
}
if(window.NzbDrone.Analytics && window.Piwik) {
try {
var piwik = window.Piwik.getTracker('http://piwik.nzbdrone.com/piwik.php', 1);
piwik.setReferrerUrl('');
piwik.setCustomUrl('http://local' + window.location.pathname);
piwik.setCustomVariable(1, 'version', window.NzbDrone.Version, 'page');
piwik.setCustomVariable(2, 'branch', window.NzbDrone.Branch, 'page');
piwik.trackPageView(title);
}
});
});
catch (e) {
console.error(e);
}
}
},
_onServerUpdated : function(){
this.pendingUpdate = true;
},
showMainRegion : function(view){
if(this.pendingUpdate) {
window.location.reload();
}
else {
AppLayout.mainRegion.show(view);
}
}
});