Merge branch 'master' of github.com:sharelatex/web-sharelatex

This commit is contained in:
Henry Oswald 2014-02-20 21:26:35 +00:00
commit 6f4c2a409c

View file

@ -42,38 +42,58 @@ define [
return attributes
bindToRootDocId: ->
remoteChange = false
@on "change:rootDoc_id", (project, docId) =>
if !remoteChange
@get("ide").socket.emit "setRootDoc", docId
@get("ide").socket.on "rootDocUpdated", (docId) =>
remoteChange = true
@set("rootDoc_id", docId)
remoteChange = false
bindToProjectName: ->
remoteChange = false
@on "change:name", (project, name) =>
if !remoteChange
@get("ide").socket.emit "setProjectName", window.window_id, name
@get("ide").socket.on "projectNameUpdated", (senderWindowId, name) =>
remoteChange = true
@set("name", name)
remoteChange = false
bindToCompiler: ->
remoteChange = false
@on "change:compiler", (project, name) =>
if !remoteChange
@get("ide").socket.emit "setCompiler", name
@get("ide").socket.on "compilerUpdated", (compiler) =>
remoteChange = true
@set("compiler", compiler)
remoteChange = false
bindToSpellingPreference: ->
@on "change:spellCheckLanguage", (project, languageCode) =>
@get("ide").socket.emit "setSpellCheckLanguage", languageCode
bindToPublicAccessLevel: ->
remoteChange = false
@on "change:publicAccesLevel", (project, level) =>
if !remoteChange
@get("ide").socket.emit "setPublicAccessLevel", level
@get("ide").socket.on 'publicAccessLevelUpdated', (level) =>
remoteChange = true
@set("publicAccesLevel", level)
remoteChange = false
bindToProjectDescription: ->
remoteChange = false
@on "change:description", (project, description) =>
if !remoteChange
@get("ide").socket.emit "updateProjectDescription", description
@get("ide").socket.on 'projectDescriptionUpdated', (description) =>
remoteChange = true
@set("description", description)
remoteChange = false
getRootDocumentsList: (callback) ->
@get("ide").socket.emit "getRootDocumentsList", (err, listOfDocs) ->