completely broke everything by moving it
This commit is contained in:
parent
f07b97d573
commit
7fe26ea022
30 changed files with 33 additions and 37 deletions
|
@ -12,6 +12,9 @@ module.exports = {
|
||||||
"es6": true,
|
"es6": true,
|
||||||
"node": true
|
"node": true
|
||||||
},
|
},
|
||||||
|
"settings": {
|
||||||
|
"ecmascript": 6
|
||||||
|
},
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"promise",
|
"promise",
|
||||||
"standard",
|
"standard",
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
/* global $ */
|
/* global $ */
|
||||||
|
|
||||||
import Active from '../Active'
|
import DataModel from './DataModel'
|
||||||
import DataModel from '../DataModel'
|
import GlobalUI, { ReactApp } from './GlobalUI'
|
||||||
import GlobalUI, { ReactApp } from '../GlobalUI'
|
import Loading from './Loading'
|
||||||
import Loading from '../Loading'
|
|
||||||
|
|
||||||
const ExploreMaps = {
|
const ExploreMaps = {
|
||||||
pending: false,
|
pending: false,
|
||||||
|
@ -124,7 +123,7 @@ const ExploreMaps = {
|
||||||
onStar: function(map) {
|
onStar: function(map) {
|
||||||
$.post('/maps/' + map.id + '/star')
|
$.post('/maps/' + map.id + '/star')
|
||||||
map.set('star_count', map.get('star_count') + 1)
|
map.set('star_count', map.get('star_count') + 1)
|
||||||
if (DataModel.Stars) DataModel.Stars.push({ user_id: Active.Mapper.id, map_id: map.id })
|
if (DataModel.Stars) DataModel.Stars.push({ user_id: ReactApp.currentUser.id, map_id: map.id })
|
||||||
DataModel.Maps.Starred.add(map)
|
DataModel.Maps.Starred.add(map)
|
||||||
GlobalUI.notifyUser('Map is now starred')
|
GlobalUI.notifyUser('Map is now starred')
|
||||||
ReactApp.render()
|
ReactApp.render()
|
||||||
|
@ -136,16 +135,16 @@ const ExploreMaps = {
|
||||||
GlobalUI.notifyUser('You will be notified by email if request accepted')
|
GlobalUI.notifyUser('You will be notified by email if request accepted')
|
||||||
},
|
},
|
||||||
onMapFollow: function(map) {
|
onMapFollow: function(map) {
|
||||||
const isFollowing = map.isFollowedBy(Active.Mapper)
|
const isFollowing = map.isFollowedBy(ReactApp.currentUser)
|
||||||
$.post({
|
$.post({
|
||||||
url: `/maps/${map.id}/${isFollowing ? 'un' : ''}follow`
|
url: `/maps/${map.id}/${isFollowing ? 'un' : ''}follow`
|
||||||
})
|
})
|
||||||
if (isFollowing) {
|
if (isFollowing) {
|
||||||
GlobalUI.notifyUser('You are no longer following this map')
|
GlobalUI.notifyUser('You are no longer following this map')
|
||||||
Active.Mapper.unfollowMap(map.id)
|
ReactApp.currentUser.unfollowMap(map.id)
|
||||||
} else {
|
} else {
|
||||||
GlobalUI.notifyUser('You are now following this map')
|
GlobalUI.notifyUser('You are now following this map')
|
||||||
Active.Mapper.followMap(map.id)
|
ReactApp.currentUser.followMap(map.id)
|
||||||
}
|
}
|
||||||
ReactApp.render()
|
ReactApp.render()
|
||||||
}
|
}
|
|
@ -8,13 +8,9 @@ import { merge } from 'lodash'
|
||||||
import { notifyUser } from './index.js'
|
import { notifyUser } from './index.js'
|
||||||
import ImportDialog from './ImportDialog'
|
import ImportDialog from './ImportDialog'
|
||||||
import Mapper from '../DataModel/Mapper'
|
import Mapper from '../DataModel/Mapper'
|
||||||
import { ExploreMaps, ChatView, TopicCard } from '../Views'
|
import ExploreMaps from '../ExploreMaps'
|
||||||
import Filter from '../Filter'
|
import { mapControl } from '../Map'
|
||||||
import JIT from '../JIT'
|
import { topicControl } from '../Topic'
|
||||||
import Realtime from '../Realtime'
|
|
||||||
import Map, { mapControl } from '../Map'
|
|
||||||
import Topic from '../Topic'
|
|
||||||
import Visualize from '../Visualize'
|
|
||||||
import makeRoutes from '../../components/makeRoutes'
|
import makeRoutes from '../../components/makeRoutes'
|
||||||
let routes
|
let routes
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
/* global $ */
|
/* global $ */
|
||||||
|
|
||||||
import ExploreMaps from './ExploreMaps'
|
|
||||||
import ChatView from './ChatView'
|
import ChatView from './ChatView'
|
||||||
import VideoView from './VideoView'
|
import VideoView from './VideoView'
|
||||||
import Room from './Room'
|
import Room from './Room'
|
||||||
|
@ -10,7 +9,7 @@ import { JUNTO_UPDATED } from '../Realtime/events'
|
||||||
const Views = {
|
const Views = {
|
||||||
init: (serverData) => {
|
init: (serverData) => {
|
||||||
$(document).on(JUNTO_UPDATED, () => ExploreMaps.render())
|
$(document).on(JUNTO_UPDATED, () => ExploreMaps.render())
|
||||||
//ChatView.init([serverData['sounds/MM_sounds.mp3'], serverData['sounds/MM_sounds.ogg']])
|
ChatView.init([serverData['sounds/MM_sounds.mp3'], serverData['sounds/MM_sounds.ogg']])
|
||||||
},
|
},
|
||||||
ExploreMaps,
|
ExploreMaps,
|
||||||
ChatView,
|
ChatView,
|
||||||
|
@ -19,5 +18,5 @@ const Views = {
|
||||||
TopicCard
|
TopicCard
|
||||||
}
|
}
|
||||||
|
|
||||||
export { ExploreMaps, ChatView, VideoView, Room, TopicCard }
|
export { ChatView, VideoView, Room, TopicCard }
|
||||||
export default Views
|
export default Views
|
|
@ -1,34 +1,33 @@
|
||||||
import Account from './Account'
|
import Account from './Account'
|
||||||
import Active from './Active'
|
import Active from './Map/Active'
|
||||||
import Admin from './Admin'
|
import Admin from './Admin'
|
||||||
import AutoLayout from './AutoLayout'
|
import AutoLayout from './Map/AutoLayout'
|
||||||
import Cable from './Cable'
|
import Cable from './Map/Cable'
|
||||||
import Control from './Control'
|
import Control from './Map/Control'
|
||||||
import Create from './Create'
|
import Create from './Map/Create'
|
||||||
import DataModel from './DataModel'
|
import DataModel from './DataModel'
|
||||||
import Debug from './Debug'
|
import Debug from './Debug'
|
||||||
import Filter from './Filter'
|
import Filter from './Map/Filter'
|
||||||
import GlobalUI, {
|
import GlobalUI, {
|
||||||
ReactApp, Search, CreateMap, ImportDialog
|
ReactApp, Search, CreateMap, ImportDialog
|
||||||
} from './GlobalUI'
|
} from './GlobalUI'
|
||||||
import Import from './Import'
|
import Import from './Map/Import'
|
||||||
import JIT from './JIT'
|
import JIT from './Map/JIT'
|
||||||
import Listeners from './Listeners'
|
import Listeners from './Map/Listeners'
|
||||||
import Loading from './Loading'
|
import Loading from './Loading'
|
||||||
import Map, { CheatSheet } from './Map'
|
import Map, { CheatSheet } from './Map'
|
||||||
import Mapper from './Mapper'
|
import Mapper from './Mapper'
|
||||||
import Mouse from './Mouse'
|
import Mouse from './Map/Mouse'
|
||||||
import Organize from './Organize'
|
import Organize from './Map/Organize'
|
||||||
import PasteInput from './PasteInput'
|
import PasteInput from './Map/PasteInput'
|
||||||
import Realtime from './Realtime'
|
import Realtime from './Map/Realtime'
|
||||||
import Selected from './Selected'
|
import Selected from './Map/Selected'
|
||||||
import Settings from './Settings'
|
import Settings from './Settings'
|
||||||
import Synapse from './Synapse'
|
import Synapse from './Map/Synapse'
|
||||||
import SynapseCard from './SynapseCard'
|
import SynapseCard from './Map/SynapseCard'
|
||||||
import Topic from './Topic'
|
import Topic from './Map/Topic'
|
||||||
import Util from './Util'
|
import Util from './Util'
|
||||||
import Views from './Views'
|
import Visualize from './Map/Visualize'
|
||||||
import Visualize from './Visualize'
|
|
||||||
|
|
||||||
const Metamaps = window.Metamaps || {}
|
const Metamaps = window.Metamaps || {}
|
||||||
Metamaps.Account = Account
|
Metamaps.Account = Account
|
||||||
|
|
Loading…
Add table
Reference in a new issue