prep urls for proxying
This commit is contained in:
parent
74ad3d33c8
commit
db2ca5945c
26 changed files with 49 additions and 49 deletions
|
@ -67,7 +67,7 @@ const Cable = {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/synapses/' + event.synapse.id + '.json',
|
url: '/main/synapses/' + event.synapse.id + '.json',
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
DataModel.Synapses.add(response)
|
DataModel.Synapses.add(response)
|
||||||
synapse = DataModel.Synapses.get(response.id)
|
synapse = DataModel.Synapses.get(response.id)
|
||||||
|
@ -77,7 +77,7 @@ const Cable = {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/mappings/' + event.mapping_id + '.json',
|
url: '/main/mappings/' + event.mapping_id + '.json',
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
DataModel.Mappings.add(response)
|
DataModel.Mappings.add(response)
|
||||||
mapping = DataModel.Mappings.get(response.id)
|
mapping = DataModel.Mappings.get(response.id)
|
||||||
|
@ -149,7 +149,7 @@ const Cable = {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/topics/' + event.topic.id + '.json',
|
url: '/main/topics/' + event.topic.id + '.json',
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
DataModel.Topics.add(response)
|
DataModel.Topics.add(response)
|
||||||
topic = DataModel.Topics.get(response.id)
|
topic = DataModel.Topics.get(response.id)
|
||||||
|
@ -159,7 +159,7 @@ const Cable = {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/mappings/' + event.mapping_id + '.json',
|
url: '/main/mappings/' + event.mapping_id + '.json',
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
DataModel.Mappings.add(response)
|
DataModel.Mappings.add(response)
|
||||||
mapping = DataModel.Mappings.get(response.id)
|
mapping = DataModel.Mappings.get(response.id)
|
||||||
|
|
|
@ -147,7 +147,7 @@ const Create = {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
url: '/user/updatemetacodes',
|
url: '/main/user/updatemetacodes',
|
||||||
data: mdata,
|
data: mdata,
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
console.log('selected metacodes saved')
|
console.log('selected metacodes saved')
|
||||||
|
@ -206,7 +206,7 @@ const Create = {
|
||||||
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'),
|
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'),
|
||||||
queryTokenizer: Bloodhound.tokenizers.whitespace,
|
queryTokenizer: Bloodhound.tokenizers.whitespace,
|
||||||
remote: {
|
remote: {
|
||||||
url: '/topics/autocomplete_topic?term=%QUERY',
|
url: '/main/topics/autocomplete_topic?term=%QUERY',
|
||||||
wildcard: '%QUERY'
|
wildcard: '%QUERY'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -296,7 +296,7 @@ const Create = {
|
||||||
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'),
|
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'),
|
||||||
queryTokenizer: Bloodhound.tokenizers.whitespace,
|
queryTokenizer: Bloodhound.tokenizers.whitespace,
|
||||||
remote: {
|
remote: {
|
||||||
url: '/search/synapses?term=%QUERY',
|
url: '/main/search/synapses?term=%QUERY',
|
||||||
wildcard: '%QUERY'
|
wildcard: '%QUERY'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -304,7 +304,7 @@ const Create = {
|
||||||
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'),
|
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'),
|
||||||
queryTokenizer: Bloodhound.tokenizers.whitespace,
|
queryTokenizer: Bloodhound.tokenizers.whitespace,
|
||||||
remote: {
|
remote: {
|
||||||
url: '/search/synapses?topic1id=%TOPIC1&topic2id=%TOPIC2',
|
url: '/main/search/synapses?topic1id=%TOPIC1&topic2id=%TOPIC2',
|
||||||
prepare: function(query, settings) {
|
prepare: function(query, settings) {
|
||||||
var self = Create.newSynapse
|
var self = Create.newSynapse
|
||||||
if (Selected.Nodes.length < 2 && self.topic1id && self.topic2id) {
|
if (Selected.Nodes.length < 2 && self.topic1id && self.topic2id) {
|
||||||
|
|
|
@ -9,7 +9,7 @@ import InfoBox from '../Map/InfoBox'
|
||||||
import Mapper from '../Mapper'
|
import Mapper from '../Mapper'
|
||||||
|
|
||||||
const Map = Backbone.Model.extend({
|
const Map = Backbone.Model.extend({
|
||||||
urlRoot: '/maps',
|
urlRoot: '/main/maps',
|
||||||
blacklist: ['created_at', 'updated_at', 'created_at_clean', 'updated_at_clean', 'user_name', 'contributor_count', 'topic_count', 'synapse_count', 'topics', 'synapses', 'mappings', 'mappers'],
|
blacklist: ['created_at', 'updated_at', 'created_at_clean', 'updated_at_clean', 'user_name', 'contributor_count', 'topic_count', 'synapse_count', 'topics', 'synapses', 'mappings', 'mappers'],
|
||||||
toJSON: function(options) {
|
toJSON: function(options) {
|
||||||
return _.omit(this.attributes, this.blacklist)
|
return _.omit(this.attributes, this.blacklist)
|
||||||
|
|
|
@ -4,7 +4,7 @@ try { Backbone.$ = window.$ } catch (err) {}
|
||||||
import outdent from 'outdent'
|
import outdent from 'outdent'
|
||||||
|
|
||||||
const Mapper = Backbone.Model.extend({
|
const Mapper = Backbone.Model.extend({
|
||||||
urlRoot: '/users',
|
urlRoot: '/main/users',
|
||||||
blacklist: ['created_at', 'updated_at', 'follows'],
|
blacklist: ['created_at', 'updated_at', 'follows'],
|
||||||
toJSON: function(options) {
|
toJSON: function(options) {
|
||||||
return _.omit(this.attributes, this.blacklist)
|
return _.omit(this.attributes, this.blacklist)
|
||||||
|
|
|
@ -5,7 +5,7 @@ import Mapper from './Mapper'
|
||||||
|
|
||||||
const MapperCollection = Backbone.Collection.extend({
|
const MapperCollection = Backbone.Collection.extend({
|
||||||
model: Mapper,
|
model: Mapper,
|
||||||
url: '/users'
|
url: '/main/users'
|
||||||
})
|
})
|
||||||
|
|
||||||
export default MapperCollection
|
export default MapperCollection
|
||||||
|
|
|
@ -8,7 +8,7 @@ import Synapse from '../Synapse'
|
||||||
import Topic from '../Topic'
|
import Topic from '../Topic'
|
||||||
|
|
||||||
const Mapping = Backbone.Model.extend({
|
const Mapping = Backbone.Model.extend({
|
||||||
urlRoot: '/mappings',
|
urlRoot: '/main/mappings',
|
||||||
blacklist: ['created_at', 'updated_at'],
|
blacklist: ['created_at', 'updated_at'],
|
||||||
toJSON: function(options) {
|
toJSON: function(options) {
|
||||||
return _.omit(this.attributes, this.blacklist)
|
return _.omit(this.attributes, this.blacklist)
|
||||||
|
|
|
@ -5,7 +5,7 @@ import Mapping from './Mapping'
|
||||||
|
|
||||||
const MappingCollection = Backbone.Collection.extend({
|
const MappingCollection = Backbone.Collection.extend({
|
||||||
model: Mapping,
|
model: Mapping,
|
||||||
url: '/mappings'
|
url: '/main/mappings'
|
||||||
})
|
})
|
||||||
|
|
||||||
export default MappingCollection
|
export default MappingCollection
|
||||||
|
|
|
@ -3,7 +3,7 @@ import Backbone from 'backbone'
|
||||||
try { Backbone.$ = window.$ } catch (err) {}
|
try { Backbone.$ = window.$ } catch (err) {}
|
||||||
|
|
||||||
const Message = Backbone.Model.extend({
|
const Message = Backbone.Model.extend({
|
||||||
urlRoot: '/messages',
|
urlRoot: '/main/messages',
|
||||||
blacklist: ['created_at', 'updated_at'],
|
blacklist: ['created_at', 'updated_at'],
|
||||||
toJSON: function(options) {
|
toJSON: function(options) {
|
||||||
return _.omit(this.attributes, this.blacklist)
|
return _.omit(this.attributes, this.blacklist)
|
||||||
|
|
|
@ -5,7 +5,7 @@ import Message from './Message'
|
||||||
|
|
||||||
const MessageCollection = Backbone.Collection.extend({
|
const MessageCollection = Backbone.Collection.extend({
|
||||||
model: Message,
|
model: Message,
|
||||||
url: '/messages'
|
url: '/main/messages'
|
||||||
})
|
})
|
||||||
|
|
||||||
export default MessageCollection
|
export default MessageCollection
|
||||||
|
|
|
@ -5,7 +5,7 @@ import Metacode from './Metacode'
|
||||||
|
|
||||||
const MetacodeCollection = Backbone.Collection.extend({
|
const MetacodeCollection = Backbone.Collection.extend({
|
||||||
model: Metacode,
|
model: Metacode,
|
||||||
url: '/metacodes',
|
url: '/main/metacodes',
|
||||||
comparator: function(a, b) {
|
comparator: function(a, b) {
|
||||||
a = a.get('name').toLowerCase()
|
a = a.get('name').toLowerCase()
|
||||||
b = b.get('name').toLowerCase()
|
b = b.get('name').toLowerCase()
|
||||||
|
|
|
@ -11,7 +11,7 @@ import Visualize from '../Visualize'
|
||||||
import DataModel from './index'
|
import DataModel from './index'
|
||||||
|
|
||||||
const Synapse = Backbone.Model.extend({
|
const Synapse = Backbone.Model.extend({
|
||||||
urlRoot: '/synapses',
|
urlRoot: '/main/synapses',
|
||||||
blacklist: ['edge', 'created_at', 'updated_at'],
|
blacklist: ['edge', 'created_at', 'updated_at'],
|
||||||
toJSON: function(options) {
|
toJSON: function(options) {
|
||||||
return _.omit(this.attributes, this.blacklist)
|
return _.omit(this.attributes, this.blacklist)
|
||||||
|
|
|
@ -5,7 +5,7 @@ import Synapse from './Synapse'
|
||||||
|
|
||||||
const SynapseCollection = Backbone.Collection.extend({
|
const SynapseCollection = Backbone.Collection.extend({
|
||||||
model: Synapse,
|
model: Synapse,
|
||||||
url: '/synapses'
|
url: '/main/synapses'
|
||||||
})
|
})
|
||||||
|
|
||||||
export default SynapseCollection
|
export default SynapseCollection
|
||||||
|
|
|
@ -10,7 +10,7 @@ import Visualize from '../Visualize'
|
||||||
import DataModel from './index'
|
import DataModel from './index'
|
||||||
|
|
||||||
const Topic = Backbone.Model.extend({
|
const Topic = Backbone.Model.extend({
|
||||||
urlRoot: '/topics',
|
urlRoot: '/main/topics',
|
||||||
blacklist: ['node', 'created_at', 'updated_at', 'user_name', 'user_image', 'map_count', 'synapse_count'],
|
blacklist: ['node', 'created_at', 'updated_at', 'user_name', 'user_image', 'map_count', 'synapse_count'],
|
||||||
toJSON: function(options) {
|
toJSON: function(options) {
|
||||||
return _.omit(this.attributes, this.blacklist)
|
return _.omit(this.attributes, this.blacklist)
|
||||||
|
|
|
@ -5,7 +5,7 @@ import Topic from './Topic'
|
||||||
|
|
||||||
const TopicCollection = Backbone.Collection.extend({
|
const TopicCollection = Backbone.Collection.extend({
|
||||||
model: Topic,
|
model: Topic,
|
||||||
url: '/topics'
|
url: '/main/topics'
|
||||||
})
|
})
|
||||||
|
|
||||||
export default TopicCollection
|
export default TopicCollection
|
||||||
|
|
|
@ -9,7 +9,7 @@ const Notifications = {
|
||||||
},
|
},
|
||||||
fetch: render => {
|
fetch: render => {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/notifications.json',
|
url: '/main/notifications.json',
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
Notifications.notifications = data
|
Notifications.notifications = data
|
||||||
render()
|
render()
|
||||||
|
@ -27,7 +27,7 @@ const Notifications = {
|
||||||
markAsRead: (render, id) => {
|
markAsRead: (render, id) => {
|
||||||
const n = Notifications.notifications.find(n => n.id === id)
|
const n = Notifications.notifications.find(n => n.id === id)
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: `/notifications/${id}/mark_read.json`,
|
url: `/main/notifications/${id}/mark_read.json`,
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
success: function(r) {
|
success: function(r) {
|
||||||
if (n) {
|
if (n) {
|
||||||
|
@ -44,7 +44,7 @@ const Notifications = {
|
||||||
markAsUnread: (render, id) => {
|
markAsUnread: (render, id) => {
|
||||||
const n = Notifications.notifications.find(n => n.id === id)
|
const n = Notifications.notifications.find(n => n.id === id)
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: `/notifications/${id}/mark_unread.json`,
|
url: `/main/notifications/${id}/mark_unread.json`,
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
success: function() {
|
success: function() {
|
||||||
if (n) {
|
if (n) {
|
||||||
|
|
|
@ -68,7 +68,7 @@ const Search = {
|
||||||
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'),
|
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'),
|
||||||
queryTokenizer: Bloodhound.tokenizers.whitespace,
|
queryTokenizer: Bloodhound.tokenizers.whitespace,
|
||||||
remote: {
|
remote: {
|
||||||
url: '/search/topics',
|
url: '/main/search/topics',
|
||||||
prepare: function(query, settings) {
|
prepare: function(query, settings) {
|
||||||
settings.url += '?term=' + query
|
settings.url += '?term=' + query
|
||||||
if (Active.Mapper && self.limitTopicsToMe) {
|
if (Active.Mapper && self.limitTopicsToMe) {
|
||||||
|
@ -101,7 +101,7 @@ const Search = {
|
||||||
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'),
|
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'),
|
||||||
queryTokenizer: Bloodhound.tokenizers.whitespace,
|
queryTokenizer: Bloodhound.tokenizers.whitespace,
|
||||||
remote: {
|
remote: {
|
||||||
url: '/search/maps',
|
url: '/main/search/maps',
|
||||||
prepare: function(query, settings) {
|
prepare: function(query, settings) {
|
||||||
settings.url += '?term=' + query
|
settings.url += '?term=' + query
|
||||||
if (Active.Mapper && self.limitMapsToMe) {
|
if (Active.Mapper && self.limitMapsToMe) {
|
||||||
|
@ -135,7 +135,7 @@ const Search = {
|
||||||
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'),
|
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'),
|
||||||
queryTokenizer: Bloodhound.tokenizers.whitespace,
|
queryTokenizer: Bloodhound.tokenizers.whitespace,
|
||||||
remote: {
|
remote: {
|
||||||
url: '/search/mappers?term=%QUERY',
|
url: '/main/search/mappers?term=%QUERY',
|
||||||
wildcard: '%QUERY'
|
wildcard: '%QUERY'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -370,7 +370,7 @@ const Import = {
|
||||||
{
|
{
|
||||||
success: function(topic) {
|
success: function(topic) {
|
||||||
if (topic.get('name') !== 'Link') return
|
if (topic.get('name') !== 'Link') return
|
||||||
$.get('/hacks/load_url_title', {
|
$.get('/main/hacks/load_url_title', {
|
||||||
url
|
url
|
||||||
}, function success(data, textStatus) {
|
}, function success(data, textStatus) {
|
||||||
if (typeof data === 'string' && data.trim() === '') return
|
if (typeof data === 'string' && data.trim() === '') return
|
||||||
|
|
|
@ -213,7 +213,7 @@ const InfoBox = {
|
||||||
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'),
|
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'),
|
||||||
queryTokenizer: Bloodhound.tokenizers.whitespace,
|
queryTokenizer: Bloodhound.tokenizers.whitespace,
|
||||||
remote: {
|
remote: {
|
||||||
url: '/search/mappers?term=%QUERY',
|
url: '/main/search/mappers?term=%QUERY',
|
||||||
wildcard: '%QUERY'
|
wildcard: '%QUERY'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -237,7 +237,7 @@ const InfoBox = {
|
||||||
var self = InfoBox
|
var self = InfoBox
|
||||||
DataModel.Collaborators.remove(DataModel.Collaborators.get(collaboratorId))
|
DataModel.Collaborators.remove(DataModel.Collaborators.get(collaboratorId))
|
||||||
var mapperIds = DataModel.Collaborators.models.map(function(mapper) { return mapper.id })
|
var mapperIds = DataModel.Collaborators.models.map(function(mapper) { return mapper.id })
|
||||||
$.post('/maps/' + Active.Map.id + '/access', { access: mapperIds })
|
$.post('/main/maps/' + Active.Map.id + '/access', { access: mapperIds })
|
||||||
self.updateNumbers()
|
self.updateNumbers()
|
||||||
},
|
},
|
||||||
addCollaborator: function(newCollaboratorId) {
|
addCollaborator: function(newCollaboratorId) {
|
||||||
|
@ -251,13 +251,13 @@ const InfoBox = {
|
||||||
function callback(mapper) {
|
function callback(mapper) {
|
||||||
DataModel.Collaborators.add(mapper)
|
DataModel.Collaborators.add(mapper)
|
||||||
var mapperIds = DataModel.Collaborators.models.map(function(mapper) { return mapper.id })
|
var mapperIds = DataModel.Collaborators.models.map(function(mapper) { return mapper.id })
|
||||||
$.post('/maps/' + Active.Map.id + '/access', { access: mapperIds })
|
$.post('/main/maps/' + Active.Map.id + '/access', { access: mapperIds })
|
||||||
var name = DataModel.Collaborators.get(newCollaboratorId).get('name')
|
var name = DataModel.Collaborators.get(newCollaboratorId).get('name')
|
||||||
GlobalUI.notifyUser(name + ' will be notified')
|
GlobalUI.notifyUser(name + ' will be notified')
|
||||||
self.updateNumbers()
|
self.updateNumbers()
|
||||||
}
|
}
|
||||||
|
|
||||||
$.getJSON('/users/' + newCollaboratorId + '.json', callback)
|
$.getJSON('/main/users/' + newCollaboratorId + '.json', callback)
|
||||||
},
|
},
|
||||||
handleResultClick: function(event, item) {
|
handleResultClick: function(event, item) {
|
||||||
var self = InfoBox
|
var self = InfoBox
|
||||||
|
|
|
@ -63,7 +63,7 @@ const Map = {
|
||||||
self.setAccessRequest()
|
self.setAccessRequest()
|
||||||
const mapId = Active.Map.id
|
const mapId = Active.Map.id
|
||||||
$.post({
|
$.post({
|
||||||
url: `/maps/${mapId}/access_request`
|
url: `/main/maps/${mapId}/access_request`
|
||||||
})
|
})
|
||||||
GlobalUI.notifyUser('Map creator will be notified of your request')
|
GlobalUI.notifyUser('Map creator will be notified of your request')
|
||||||
},
|
},
|
||||||
|
@ -117,7 +117,7 @@ const Map = {
|
||||||
else {
|
else {
|
||||||
Loading.show()
|
Loading.show()
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/maps/' + id + '/contains.json',
|
url: '/main/maps/' + id + '/contains.json',
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
Active.Map = new DataModelMap(data.map)
|
Active.Map = new DataModelMap(data.map)
|
||||||
DataModel.Mappers = new DataModel.MapperCollection(data.mappers)
|
DataModel.Mappers = new DataModel.MapperCollection(data.mappers)
|
||||||
|
@ -153,7 +153,7 @@ const Map = {
|
||||||
var self = Map
|
var self = Map
|
||||||
|
|
||||||
if (!Active.Map) return
|
if (!Active.Map) return
|
||||||
$.post('/maps/' + Active.Map.id + '/star')
|
$.post('/main/maps/' + Active.Map.id + '/star')
|
||||||
DataModel.Stars.push({ user_id: Active.Mapper.id, map_id: Active.Map.id })
|
DataModel.Stars.push({ user_id: Active.Mapper.id, map_id: Active.Map.id })
|
||||||
DataModel.Maps.Starred.add(Active.Map)
|
DataModel.Maps.Starred.add(Active.Map)
|
||||||
GlobalUI.notifyUser('Map is now starred')
|
GlobalUI.notifyUser('Map is now starred')
|
||||||
|
@ -164,7 +164,7 @@ const Map = {
|
||||||
var self = Map
|
var self = Map
|
||||||
|
|
||||||
if (!Active.Map) return
|
if (!Active.Map) return
|
||||||
$.post('/maps/' + Active.Map.id + '/unstar')
|
$.post('/main/maps/' + Active.Map.id + '/unstar')
|
||||||
DataModel.Stars = DataModel.Stars.filter(function(s) { return s.user_id !== Active.Mapper.id })
|
DataModel.Stars = DataModel.Stars.filter(function(s) { return s.user_id !== Active.Mapper.id })
|
||||||
DataModel.Maps.Starred.remove(Active.Map)
|
DataModel.Maps.Starred.remove(Active.Map)
|
||||||
self.mapIsStarred = false
|
self.mapIsStarred = false
|
||||||
|
@ -263,7 +263,7 @@ const Map = {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'PATCH',
|
type: 'PATCH',
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
url: `/maps/${Active.Map.id}`,
|
url: `/main/maps/${Active.Map.id}`,
|
||||||
data: formData,
|
data: formData,
|
||||||
processData: false,
|
processData: false,
|
||||||
contentType: false,
|
contentType: false,
|
||||||
|
|
|
@ -7,7 +7,7 @@ const Mapper = {
|
||||||
// @param id = the id of the mapper to retrieve
|
// @param id = the id of the mapper to retrieve
|
||||||
get: function(id, callback) {
|
get: function(id, callback) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: `/users/${id}.json`,
|
url: `/main/users/${id}.json`,
|
||||||
success: data => {
|
success: data => {
|
||||||
callback(new DataModel.Mapper(data))
|
callback(new DataModel.Mapper(data))
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,7 +101,7 @@ export const acceptCall = self => userid => {
|
||||||
invited: Active.Mapper.id,
|
invited: Active.Mapper.id,
|
||||||
inviter: userid
|
inviter: userid
|
||||||
})
|
})
|
||||||
$.post('/maps/' + Active.Map.id + '/events/conversation')
|
$.post('/main/maps/' + Active.Map.id + '/events/conversation')
|
||||||
self.joinCall()
|
self.joinCall()
|
||||||
GlobalUI.clearNotify()
|
GlobalUI.clearNotify()
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ const Synapse = {
|
||||||
// if the desired topic is not yet in the local topic repository, fetch it
|
// if the desired topic is not yet in the local topic repository, fetch it
|
||||||
if (DataModel.Synapses.get(id) === undefined) {
|
if (DataModel.Synapses.get(id) === undefined) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/synapses/' + id + '.json',
|
url: '/main/synapses/' + id + '.json',
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
DataModel.Synapses.add(data)
|
DataModel.Synapses.add(data)
|
||||||
callback(DataModel.Synapses.get(id))
|
callback(DataModel.Synapses.get(id))
|
||||||
|
|
|
@ -85,7 +85,7 @@ const SynapseCard = {
|
||||||
$('#edit_synapse_desc').attr('data-bip-attribute', 'desc')
|
$('#edit_synapse_desc').attr('data-bip-attribute', 'desc')
|
||||||
$('#edit_synapse_desc').attr('data-bip-type', 'textarea')
|
$('#edit_synapse_desc').attr('data-bip-type', 'textarea')
|
||||||
$('#edit_synapse_desc').attr('data-bip-nil', dataNil)
|
$('#edit_synapse_desc').attr('data-bip-nil', dataNil)
|
||||||
$('#edit_synapse_desc').attr('data-bip-url', '/synapses/' + synapse.id)
|
$('#edit_synapse_desc').attr('data-bip-url', '/main/synapses/' + synapse.id)
|
||||||
$('#edit_synapse_desc').attr('data-bip-value', synapse.get('desc'))
|
$('#edit_synapse_desc').attr('data-bip-value', synapse.get('desc'))
|
||||||
$('#edit_synapse_desc').html(synapse.get('desc'))
|
$('#edit_synapse_desc').html(synapse.get('desc'))
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ const Topic = {
|
||||||
// if the desired topic is not yet in the local topic repository, fetch it
|
// if the desired topic is not yet in the local topic repository, fetch it
|
||||||
if (DataModel.Topics.get(id) === undefined) {
|
if (DataModel.Topics.get(id) === undefined) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/topics/' + id + '.json',
|
url: '/main/topics/' + id + '.json',
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
DataModel.Topics.add(data)
|
DataModel.Topics.add(data)
|
||||||
callback(DataModel.Topics.get(id))
|
callback(DataModel.Topics.get(id))
|
||||||
|
@ -55,7 +55,7 @@ const Topic = {
|
||||||
else {
|
else {
|
||||||
Loading.show()
|
Loading.show()
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/topics/' + id + '/network.json',
|
url: '/main/topics/' + id + '/network.json',
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
Active.Topic = new DataModel.Topic(data.topic)
|
Active.Topic = new DataModel.Topic(data.topic)
|
||||||
DataModel.Creators = new DataModel.MapperCollection(data.creators)
|
DataModel.Creators = new DataModel.MapperCollection(data.creators)
|
||||||
|
@ -90,7 +90,7 @@ const Topic = {
|
||||||
onTopicFollow: topic => {
|
onTopicFollow: topic => {
|
||||||
const isFollowing = topic.isFollowedBy(Active.Mapper)
|
const isFollowing = topic.isFollowedBy(Active.Mapper)
|
||||||
$.post({
|
$.post({
|
||||||
url: `/topics/${topic.id}/${isFollowing ? 'un' : ''}follow`
|
url: `/main/topics/${topic.id}/${isFollowing ? 'un' : ''}follow`
|
||||||
})
|
})
|
||||||
if (isFollowing) {
|
if (isFollowing) {
|
||||||
GlobalUI.notifyUser('You are no longer following this topic')
|
GlobalUI.notifyUser('You are no longer following this topic')
|
||||||
|
@ -166,7 +166,7 @@ const Topic = {
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
url: '/topics/' + topic.id + '/relatives.json?' + paramsString,
|
url: '/main/topics/' + topic.id + '/relatives.json?' + paramsString,
|
||||||
success: successCallback,
|
success: successCallback,
|
||||||
error: function() {}
|
error: function() {}
|
||||||
})
|
})
|
||||||
|
|
|
@ -98,7 +98,7 @@ const ContextMenu = {
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
url: `/topics/${id}/relative_numbers.json?network=${topicsString}`,
|
url: `/main/topics/${id}/relative_numbers.json?network=${topicsString}`,
|
||||||
success: successCallback,
|
success: successCallback,
|
||||||
error: function() {}
|
error: function() {}
|
||||||
})
|
})
|
||||||
|
|
|
@ -109,7 +109,7 @@ const ExploreMaps = {
|
||||||
|
|
||||||
// first load the mapper object and then call the render function
|
// first load the mapper object and then call the render function
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/users/' + self.collection.mapperId + '/details.json',
|
url: '/main/users/' + self.collection.mapperId + '/details.json',
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
self.mapper = response
|
self.mapper = response
|
||||||
document.title = self.mapper.name + ' | Metamaps'
|
document.title = self.mapper.name + ' | Metamaps'
|
||||||
|
@ -122,7 +122,7 @@ const ExploreMaps = {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
onStar: function(map) {
|
onStar: function(map) {
|
||||||
$.post('/maps/' + map.id + '/star')
|
$.post('/main/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: Active.Mapper.id, map_id: map.id })
|
||||||
DataModel.Maps.Starred.add(map)
|
DataModel.Maps.Starred.add(map)
|
||||||
|
@ -131,14 +131,14 @@ const ExploreMaps = {
|
||||||
},
|
},
|
||||||
onRequest: function(map) {
|
onRequest: function(map) {
|
||||||
$.post({
|
$.post({
|
||||||
url: `/maps/${map.id}/access_request`
|
url: `/main/maps/${map.id}/access_request`
|
||||||
})
|
})
|
||||||
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(Active.Mapper)
|
||||||
$.post({
|
$.post({
|
||||||
url: `/maps/${map.id}/${isFollowing ? 'un' : ''}follow`
|
url: `/main/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')
|
||||||
|
|
Loading…
Reference in a new issue