Use commonjs requires instead of mixing imports/exports/requires

This commit is contained in:
Jamie Curnow 2018-07-30 11:59:05 +10:00
parent 36b014aa47
commit 2111d2913b
28 changed files with 38 additions and 57 deletions

View File

@ -1,7 +1,6 @@
'use strict'; 'use strict';
import Mn from 'backbone.marionette'; const Mn = require('backbone.marionette');
const template = require('./empty.ejs'); const template = require('./empty.ejs');
const AccessModel = require('../../models/access'); const AccessModel = require('../../models/access');
const Controller = require('../controller'); const Controller = require('../controller');

View File

@ -1,7 +1,6 @@
'use strict'; 'use strict';
import Mn from 'backbone.marionette'; const Mn = require('backbone.marionette');
const Api = require('../api'); const Api = require('../api');
const template = require('./main.ejs'); const template = require('./main.ejs');
const Controller = require('../controller'); const Controller = require('../controller');

View File

@ -1,7 +1,6 @@
'use strict'; 'use strict';
import Mn from 'backbone.marionette'; const Mn = require('backbone.marionette');
const template = require('./row.ejs'); const template = require('./row.ejs');
const Controller = require('../controller'); const Controller = require('../controller');

View File

@ -1,7 +1,6 @@
'use strict'; 'use strict';
import Mn from 'backbone.marionette'; const Mn = require('backbone.marionette');
const template = require('./delete.ejs'); const template = require('./delete.ejs');
const Controller = require('../controller'); const Controller = require('../controller');
const Api = require('../api'); const Api = require('../api');

View File

@ -1,7 +1,6 @@
'use strict'; 'use strict';
import Mn from 'backbone.marionette'; const Mn = require('backbone.marionette');
const _ = require('lodash'); const _ = require('lodash');
const template = require('./form.ejs'); const template = require('./form.ejs');
const Controller = require('../controller'); const Controller = require('../controller');

View File

@ -1,7 +1,6 @@
'use strict'; 'use strict';
import Mn from 'backbone.marionette'; const Mn = require('backbone.marionette');
const template = require('./item.ejs'); const template = require('./item.ejs');
module.exports = Mn.View.extend({ module.exports = Mn.View.extend({

View File

@ -1,6 +1,6 @@
'use strict'; 'use strict';
import $ from 'jquery'; const $ = require('jquery');
/** /**
* @param {String} message * @param {String} message

View File

@ -1,7 +1,6 @@
'use strict'; 'use strict';
import Backbone from 'backbone'; const Backbone = require('backbone');
const Cache = require('./cache'); const Cache = require('./cache');
module.exports = { module.exports = {
@ -21,8 +20,9 @@ module.exports = {
* Dashboard * Dashboard
*/ */
showDashboard: function () { showDashboard: function () {
let controller = this;
require(['./main', './dashboard/main'], (App, View) => { require(['./main', './dashboard/main'], (App, View) => {
this.navigate('/'); controller.navigate('/');
App.UI.showMainLoading(); App.UI.showMainLoading();
let view = new View(); let view = new View();
@ -39,8 +39,9 @@ module.exports = {
* Access * Access
*/ */
showAccess: function () { showAccess: function () {
let controller = this;
require(['./main', './access/main'], (App, View) => { require(['./main', './access/main'], (App, View) => {
this.navigate('/access'); controller.navigate('/access');
App.UI.showMainLoading(); App.UI.showMainLoading();
let view = new View(); let view = new View();

View File

@ -1,7 +1,6 @@
'use strict'; 'use strict';
import Mn from 'backbone.marionette'; const Mn = require('backbone.marionette');
const template = require('./empty.ejs'); const template = require('./empty.ejs');
const HostModel = require('../../models/host'); const HostModel = require('../../models/host');
const Controller = require('../controller'); const Controller = require('../controller');

View File

@ -1,7 +1,6 @@
'use strict'; 'use strict';
import Mn from 'backbone.marionette'; const Mn = require('backbone.marionette');
const Api = require('../api'); const Api = require('../api');
const template = require('./main.ejs'); const template = require('./main.ejs');
const Controller = require('../controller'); const Controller = require('../controller');

View File

@ -1,7 +1,6 @@
'use strict'; 'use strict';
import Mn from 'backbone.marionette'; const Mn = require('backbone.marionette');
const template = require('./row.ejs'); const template = require('./row.ejs');
const Controller = require('../controller'); const Controller = require('../controller');
const AccessListModel = require('../../models/access'); const AccessListModel = require('../../models/access');

View File

@ -1,7 +1,6 @@
'use strict'; 'use strict';
import Mn from 'backbone.marionette'; const Mn = require('backbone.marionette');
const template = require('./main.ejs'); const template = require('./main.ejs');
module.exports = Mn.View.extend({ module.exports = Mn.View.extend({

View File

@ -1,7 +1,6 @@
'use strict'; 'use strict';
import Mn from 'backbone.marionette'; const Mn = require('backbone.marionette');
const _ = require('lodash'); const _ = require('lodash');
const template = require('./404_form.ejs'); const template = require('./404_form.ejs');
const Controller = require('../controller'); const Controller = require('../controller');

View File

@ -1,7 +1,6 @@
'use strict'; 'use strict';
import Mn from 'backbone.marionette'; const Mn = require('backbone.marionette');
const template = require('./advanced.ejs'); const template = require('./advanced.ejs');
const Controller = require('../controller'); const Controller = require('../controller');
const Api = require('../api'); const Api = require('../api');

View File

@ -1,7 +1,6 @@
'use strict'; 'use strict';
import Mn from 'backbone.marionette'; const Mn = require('backbone.marionette');
const template = require('./delete.ejs'); const template = require('./delete.ejs');
const Controller = require('../controller'); const Controller = require('../controller');
const Api = require('../api'); const Api = require('../api');

View File

@ -1,7 +1,6 @@
'use strict'; 'use strict';
import Mn from 'backbone.marionette'; const Mn = require('backbone.marionette');
const _ = require('lodash'); const _ = require('lodash');
const template = require('./proxy_form.ejs'); const template = require('./proxy_form.ejs');
const Controller = require('../controller'); const Controller = require('../controller');

View File

@ -1,7 +1,6 @@
'use strict'; 'use strict';
import Mn from 'backbone.marionette'; const Mn = require('backbone.marionette');
const template = require('./reconfigure.ejs'); const template = require('./reconfigure.ejs');
const Api = require('../api'); const Api = require('../api');
const App = require('../main'); const App = require('../main');

View File

@ -1,7 +1,6 @@
'use strict'; 'use strict';
import Mn from 'backbone.marionette'; const Mn = require('backbone.marionette');
const _ = require('lodash'); const _ = require('lodash');
const template = require('./redirection_form.ejs'); const template = require('./redirection_form.ejs');
const Controller = require('../controller'); const Controller = require('../controller');

View File

@ -1,7 +1,6 @@
'use strict'; 'use strict';
import Mn from 'backbone.marionette'; const Mn = require('backbone.marionette');
const _ = require('lodash'); const _ = require('lodash');
const template = require('./stream_form.ejs'); const template = require('./stream_form.ejs');
const Controller = require('../controller'); const Controller = require('../controller');

View File

@ -1,9 +1,8 @@
'use strict'; 'use strict';
import $ from 'jquery'; const $ = require('jquery');
import _ from 'underscore'; const _ = require('underscore');
import Backbone from 'backbone'; const Backbone = require('backbone');
const Mn = require('../lib/marionette'); const Mn = require('../lib/marionette');
const Cache = require('./cache'); const Cache = require('./cache');
const Controller = require('./controller'); const Controller = require('./controller');

View File

@ -1,7 +1,6 @@
'use strict'; 'use strict';
import Mn from 'backbone.marionette'; const Mn = require('backbone.marionette');
const template = require('./main.ejs'); const template = require('./main.ejs');
const Controller = require('../../controller'); const Controller = require('../../controller');

View File

@ -1,7 +1,6 @@
'use strict'; 'use strict';
import Mn from 'backbone.marionette'; const Mn = require('backbone.marionette');
const template = require('./main.ejs'); const template = require('./main.ejs');
const HeaderView = require('./header/main'); const HeaderView = require('./header/main');
const Cache = require('../cache'); const Cache = require('../cache');

View File

@ -1,7 +1,7 @@
'use strict'; 'use strict';
import numeral from 'numeral'; const numeral = require('numeral');
import moment from 'moment'; const moment = require('moment');
module.exports = { module.exports = {

View File

@ -1,7 +1,7 @@
'use strict'; 'use strict';
import _ from 'underscore'; const _ = require('underscore');
import Mn from 'backbone.marionette'; const Mn = require('backbone.marionette');
let render = Mn.Renderer.render; let render = Mn.Renderer.render;
Mn.Renderer.render = function (template, data, view) { Mn.Renderer.render = function (template, data, view) {

View File

@ -1,7 +1,7 @@
'use strict'; 'use strict';
import promise from 'es6-promise'; const promise = require('es6-promise');
import $ from 'jquery'; const $ = require('jquery');
global.jQuery = $; global.jQuery = $;
global.$ = $; global.$ = $;

View File

@ -1,6 +1,6 @@
'use strict'; 'use strict';
import Backbone from 'backbone'; const Backbone = require('backbone');
const model = Backbone.Model.extend({ const model = Backbone.Model.extend({
idAttribute: '_id', idAttribute: '_id',

View File

@ -1,6 +1,6 @@
'use strict'; 'use strict';
import Backbone from 'backbone'; const Backbone = require('backbone');
const model = Backbone.Model.extend({ const model = Backbone.Model.extend({
idAttribute: 'username', idAttribute: 'username',

View File

@ -1,6 +1,6 @@
'use strict'; 'use strict';
import Backbone from 'backbone'; const Backbone = require('backbone');
const model = Backbone.Model.extend({ const model = Backbone.Model.extend({
idAttribute: '_id', idAttribute: '_id',