remove Backbone from window

This commit is contained in:
Devin Howard 2016-09-23 00:16:15 +08:00
parent 30894a313f
commit a996734c79
5 changed files with 22 additions and 12 deletions

View file

@ -1,6 +1,8 @@
/* global Metamaps, Backbone, _, $ */ /* global Metamaps, Backbone, $ */
import _ from 'lodash' import _ from 'lodash'
import Backbone from 'backbone'
Backbone.$ = window.$
/* /*
* Metamaps.Backbone.js.erb * Metamaps.Backbone.js.erb

View file

@ -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 Active from './Active'
import GlobalUI from './GlobalUI' import GlobalUI from './GlobalUI'

View file

@ -1,4 +1,9 @@
/* global Autolinker, $ */ /* 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 linker = new Autolinker({ newWindow: true, truncate: 50, email: false, phone: false, twitter: false });
var Private = { var Private = {

View file

@ -1,4 +1,9 @@
/* global Metamaps, $ */ /* global Metamaps, $ */
import Backbone from 'backbone'
// TODO is this line good or bad
// Backbone.$ = window.$
import Active from '../Active' import Active from '../Active'
import Realtime from '../Realtime' import Realtime from '../Realtime'
@ -6,7 +11,8 @@ import ChatView from './ChatView'
import VideoView from './VideoView' import VideoView from './VideoView'
/* /*
* Metamaps.Backbone * Dependencies:
* Metamaps.Backbone
*/ */
const Room = function(opts) { const Room = function(opts) {

View file

@ -1,15 +1,8 @@
import React from 'react' // create global references to some utility libraries
import ReactDOM from 'react-dom' import ReactDOM from 'react-dom'
import Backbone from 'backbone'
import _ from 'underscore' import _ from 'underscore'
import Metamaps from './Metamaps'
// create global references to some libraries
window.React = React
window.ReactDOM = ReactDOM window.ReactDOM = ReactDOM
Backbone.$ = window.$ // jquery from rails
window.Backbone = Backbone
window._ = _ window._ = _
import Metamaps from './Metamaps'
window.Metamaps = Metamaps window.Metamaps = Metamaps