diff --git a/frontend/src/Metamaps/Backbone.js b/frontend/src/Metamaps/Backbone/index.js similarity index 99% rename from frontend/src/Metamaps/Backbone.js rename to frontend/src/Metamaps/Backbone/index.js index bc303df4..7e6878b3 100644 --- a/frontend/src/Metamaps/Backbone.js +++ b/frontend/src/Metamaps/Backbone/index.js @@ -1,6 +1,8 @@ -/* global Metamaps, Backbone, _, $ */ +/* global Metamaps, Backbone, $ */ import _ from 'lodash' +import Backbone from 'backbone' +Backbone.$ = window.$ /* * Metamaps.Backbone.js.erb diff --git a/frontend/src/Metamaps/Router.js b/frontend/src/Metamaps/Router.js index 6760edcc..0ad88efd 100644 --- a/frontend/src/Metamaps/Router.js +++ b/frontend/src/Metamaps/Router.js @@ -1,4 +1,8 @@ -/* global Metamaps, Backbone, $ */ +/* global Metamaps, $ */ + +import Backbone from 'backbone' +//TODO is this line good or bad? +//Backbone.$ = window.$ import Active from './Active' import GlobalUI from './GlobalUI' diff --git a/frontend/src/Metamaps/Views/ChatView.js b/frontend/src/Metamaps/Views/ChatView.js index 5d8f5f65..d1efdf74 100644 --- a/frontend/src/Metamaps/Views/ChatView.js +++ b/frontend/src/Metamaps/Views/ChatView.js @@ -1,4 +1,9 @@ /* global Autolinker, $ */ + +import Backbone from 'backbone' +// TODO is this line good or bad +// Backbone.$ = window.$ + var linker = new Autolinker({ newWindow: true, truncate: 50, email: false, phone: false, twitter: false }); var Private = { diff --git a/frontend/src/Metamaps/Views/Room.js b/frontend/src/Metamaps/Views/Room.js index 014df61b..5b70ee7c 100644 --- a/frontend/src/Metamaps/Views/Room.js +++ b/frontend/src/Metamaps/Views/Room.js @@ -1,4 +1,9 @@ /* global Metamaps, $ */ + +import Backbone from 'backbone' +// TODO is this line good or bad +// Backbone.$ = window.$ + import Active from '../Active' import Realtime from '../Realtime' @@ -6,7 +11,8 @@ import ChatView from './ChatView' import VideoView from './VideoView' /* - * Metamaps.Backbone + * Dependencies: + * Metamaps.Backbone */ const Room = function(opts) { diff --git a/frontend/src/index.js b/frontend/src/index.js index e5705512..176ac329 100644 --- a/frontend/src/index.js +++ b/frontend/src/index.js @@ -1,15 +1,8 @@ -import React from 'react' +// create global references to some utility libraries import ReactDOM from 'react-dom' -import Backbone from 'backbone' import _ from 'underscore' - -import Metamaps from './Metamaps' - -// create global references to some libraries -window.React = React window.ReactDOM = ReactDOM -Backbone.$ = window.$ // jquery from rails -window.Backbone = Backbone window._ = _ +import Metamaps from './Metamaps' window.Metamaps = Metamaps