commit
e316578832
14 changed files with 132 additions and 49 deletions
|
|
@ -617,11 +617,29 @@ env.editor.setOptions({
|
|||
});
|
||||
|
||||
// allow easy access to ace in console, but not in ace code which uses strict
|
||||
function isNonStrict() {
|
||||
try { return !!arguments.callee.caller.caller }
|
||||
catch(e){ return false }
|
||||
void function() {
|
||||
function isStrict() {
|
||||
try { return !arguments.callee.caller.caller.caller}
|
||||
catch(e){ return true }
|
||||
}
|
||||
window.__defineGetter__("ace", function(){ return isNonStrict() && env.editor });
|
||||
window.__defineGetter__("editor", function(){ return isNonStrict() && env.editor });
|
||||
window.__defineGetter__("session", function(){ return isNonStrict() && env.editor.session });
|
||||
window.__defineGetter__("split", function(){ return isNonStrict() && env.split });
|
||||
function warn() {
|
||||
if (isStrict()) {
|
||||
console.error("trying to access to global variable");
|
||||
}
|
||||
}
|
||||
function def(o, key, get) {
|
||||
Object.defineProperty(o, key, {
|
||||
configurable: true,
|
||||
get: get,
|
||||
set: function(val) {
|
||||
delete o[key];
|
||||
o[key] = val;
|
||||
}
|
||||
});
|
||||
}
|
||||
def(window, "ace", function(){ warn(); return env.editor });
|
||||
def(window, "editor", function(){ warn(); return env.editor });
|
||||
def(window, "session", function(){ warn(); return env.editor.session });
|
||||
def(window, "split", function(){ warn(); return env.split });
|
||||
|
||||
}();
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 48 KiB |
|
|
@ -16,9 +16,8 @@ body {
|
|||
color: white;
|
||||
}
|
||||
|
||||
#logo {
|
||||
padding: 15px;
|
||||
margin-left: 70px;
|
||||
#c9-logo, #ace-logo {
|
||||
padding: 0;
|
||||
border: none;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue