minor changes

This commit is contained in:
coderaiser 2012-08-02 10:59:58 -04:00
parent f60b799a01
commit 95bff794b7
2 changed files with 39 additions and 9 deletions

View file

@ -8,14 +8,16 @@ CloudCommander.Editor.CodeMirror = {
/* function shows editor */
var createEditorDiv = function(){
if (!document.getElementById('CloudEditor')) {
var lEditor=document.createElement('div');
lEditor.id ='CloudEditor';
if (!pParent.getById('CloudEditor')) {
var lFM = document.getElementById('fm');
if(lFM){
lFM.appendChild(lEditor);
}else console.log('Error. Something went wrong FM not found');
if(lFM)
CloudCommander.anyload({
name : 'div',
id : 'CloudEditor',
element : lFM
});
else
console.log('Error. Something went wrong FM not found');
pParent.show();
}

View file

@ -16,8 +16,36 @@ CloudCommander.Terminal.jqconsole = {
});
},
init: function(){
init: (function(){
var pConsole = document.getById('terminal');
if(!pConsole){
CloudCommander.anyload({
name : 'div',
id :'terminal'
});
}
}),
show: function(){
$(function () {
var jqconsole = $('#terminal').jqconsole('Hi\n', '>>>');
var startPrompt = function () {
// Start the prompt with history enabled.
jqconsole.Prompt(true, function (input) {
// Output input with the class jqconsole-output.
jqconsole.Write(input + '\n', 'jqconsole-output');
// Restart the prompt.
startPrompt();
});
};
startPrompt();
});
},
getById : function(pId){return document.getElementById(pId);},
getByClass : function(pClass){
return document.getElementsByClassName(pClass);
}
};