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';
import Mn from 'backbone.marionette';
const Mn = require('backbone.marionette');
const template = require('./empty.ejs');
const AccessModel = require('../../models/access');
const Controller = require('../controller');

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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