Created
June 4, 2014 11:00
-
-
Save coderaiser/09b89d382efd39267a38 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.setValue = function(value) { | |
getEditConfig(function(config) { | |
Util.exec.if(!config.collaboration, function() { | |
Ace.setValue(value); | |
ConfigView.afterShow(); | |
}, setFirepad); | |
}); | |
}; | |
function setFirepad(callback) { | |
var files = [ | |
'https://cdn.firebase.com/js/client/1.0.11/firebase.js', | |
CloudCmd.LIBDIRCLIENT + 'edit/firepad/firepad.js' | |
]; | |
DOM.load.parallel(files, function() { | |
var firepadRef, | |
path = location.host + Info.path, | |
url = 'https://cloudcmd.firebaseio.com/'; | |
Ace.setValue(''); | |
path = Util.replaceStr(path, '.', '-'); | |
firepadRef = new Firebase(url + path); | |
FirePad = Firepad.fromACE(firepadRef, Ace); | |
FirePad.on('ready', function() { | |
var isEmpty = FirePad.isHistoryEmpty(); | |
if (isEmpty) | |
Util.exec(callback); | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment