diff --git a/build/src/ace-uncompressed.js b/build/src/ace-uncompressed.js
index fd28944a..a53e3370 100644
--- a/build/src/ace-uncompressed.js
+++ b/build/src/ace-uncompressed.js
@@ -5956,8 +5956,8 @@ var Editor =function(renderer, session) {
if (shouldOutdent) {
mode.autoOutdent(lineState, session, cursor.row);
}
- };
- }
+ }
+ };
this.onTextInput = function(text) {
this.keyBinding.onTextInput(text);
@@ -13021,7 +13021,7 @@ var VirtualRenderer = function(container, theme) {
this.getShowGutter = function(){
return this.showGutter;
- }
+ };
this.setShowGutter = function(show){
if(this.showGutter === show)
@@ -13029,10 +13029,10 @@ var VirtualRenderer = function(container, theme) {
this.$gutter.style.display = show ? "block" : "none";
this.showGutter = show;
this.onResize(true);
- }
+ };
this.$updatePrintMargin = function() {
- var containerEl
+ var containerEl;
if (!this.$showPrintMargin && !this.$printMarginEl)
return;
@@ -13040,7 +13040,7 @@ var VirtualRenderer = function(container, theme) {
if (!this.$printMarginEl) {
containerEl = dom.createElement("div");
containerEl.className = "ace_print_margin_layer";
- this.$printMarginEl = dom.createElement("div")
+ this.$printMarginEl = dom.createElement("div");
this.$printMarginEl.className = "ace_print_margin";
containerEl.appendChild(this.$printMarginEl);
this.content.insertBefore(containerEl, this.$textLayer.element);
@@ -13087,8 +13087,8 @@ var VirtualRenderer = function(container, theme) {
if (!this.layerConfig)
return 0;
- return this.layerConfig.firstRow + (this.layerConfig.offset == 0 ? 0 : 1);
- }
+ return this.layerConfig.firstRow + (this.layerConfig.offset === 0 ? 0 : 1);
+ };
this.getLastFullyVisibleRow = function() {
if (!this.layerConfig)
@@ -13096,7 +13096,7 @@ var VirtualRenderer = function(container, theme) {
var flint = Math.floor((this.layerConfig.height + this.layerConfig.offset) / this.layerConfig.lineHeight);
return this.layerConfig.firstRow - 1 + flint;
- }
+ };
this.getLastVisibleRow = function() {
return (this.layerConfig || {}).lastRow || 0;
@@ -13112,7 +13112,7 @@ var VirtualRenderer = function(container, theme) {
this.getHScrollBarAlwaysVisible = function() {
return this.$horizScrollAlwaysVisible;
- }
+ };
this.setHScrollBarAlwaysVisible = function(alwaysVisible) {
if (this.$horizScrollAlwaysVisible != alwaysVisible) {
@@ -13120,7 +13120,7 @@ var VirtualRenderer = function(container, theme) {
if (!this.$horizScrollAlwaysVisible || !this.$horizScroll)
this.$loop.schedule(this.CHANGE_SCROLL);
}
- }
+ };
this.onScroll = function(e) {
this.scrollToY(e.data);
@@ -13148,7 +13148,8 @@ var VirtualRenderer = function(container, theme) {
// full
if (changes & this.CHANGE_FULL) {
this.$textLayer.update(this.layerConfig);
- this.showGutter && this.$gutterLayer.update(this.layerConfig);
+ if (this.showGutter)
+ this.$gutterLayer.update(this.layerConfig);
this.$markerBack.update(this.layerConfig);
this.$markerFront.update(this.layerConfig);
this.$cursorLayer.update(this.layerConfig);
@@ -13162,7 +13163,9 @@ var VirtualRenderer = function(container, theme) {
this.$textLayer.update(this.layerConfig);
else
this.$textLayer.scrollLines(this.layerConfig);
- this.showGutter && this.$gutterLayer.update(this.layerConfig);
+
+ if (this.showGutter)
+ this.$gutterLayer.update(this.layerConfig);
this.$markerBack.update(this.layerConfig);
this.$markerFront.update(this.layerConfig);
this.$cursorLayer.update(this.layerConfig);
@@ -13172,14 +13175,17 @@ var VirtualRenderer = function(container, theme) {
if (changes & this.CHANGE_TEXT) {
this.$textLayer.update(this.layerConfig);
- this.showGutter && this.$gutterLayer.update(this.layerConfig);
+ if (this.showGutter)
+ this.$gutterLayer.update(this.layerConfig);
}
else if (changes & this.CHANGE_LINES) {
this.$updateLines();
this.$updateScrollBar();
- this.showGutter && this.$gutterLayer.update(this.layerConfig);
+ if (this.showGutter)
+ this.$gutterLayer.update(this.layerConfig);
} else if (changes & this.CHANGE_GUTTER) {
- this.showGutter && this.$gutterLayer.update(this.layerConfig);
+ if (this.showGutter)
+ this.$gutterLayer.update(this.layerConfig);
}
if (changes & this.CHANGE_CURSOR)
@@ -13290,7 +13296,8 @@ var VirtualRenderer = function(container, theme) {
// if the last row is unknown -> redraw everything
if (lastRow === Infinity) {
- this.showGutter && this.$gutterLayer.update(layerConfig);
+ if (this.showGutter)
+ this.$gutterLayer.update(layerConfig);
this.$textLayer.update(layerConfig);
return;
}
@@ -13320,12 +13327,12 @@ var VirtualRenderer = function(container, theme) {
this.addGutterDecoration = function(row, className){
this.$gutterLayer.addGutterDecoration(row, className);
this.$loop.schedule(this.CHANGE_GUTTER);
- }
+ };
this.removeGutterDecoration = function(row, className){
this.$gutterLayer.removeGutterDecoration(row, className);
this.$loop.schedule(this.CHANGE_GUTTER);
- }
+ };
this.setBreakpoints = function(rows) {
this.$gutterLayer.setBreakpoints(rows);
@@ -13379,7 +13386,7 @@ var VirtualRenderer = function(container, theme) {
else
this.scrollToX(Math.round(left + this.characterWidth - this.$size.scrollerWidth));
}
- },
+ };
this.getScrollTop = function() {
return this.scrollTop;
@@ -13395,7 +13402,7 @@ var VirtualRenderer = function(container, theme) {
this.getScrollBottomRow = function() {
return Math.max(0, Math.floor((this.scrollTop + this.$size.scrollerHeight) / this.lineHeight) - 1);
- }
+ };
this.scrollToRow = function(row) {
this.scrollToY(row * this.lineHeight);
@@ -13457,7 +13464,7 @@ var VirtualRenderer = function(container, theme) {
return {
pageX: canvasPos.left + x - this.getScrollLeft(),
pageY: canvasPos.top + y - this.getScrollTop()
- }
+ };
};
this.visualizeFocus = function() {
@@ -13503,6 +13510,7 @@ var VirtualRenderer = function(container, theme) {
this.setTheme = function(theme) {
var _self = this;
+
this.$themeValue = theme;
if (!theme || typeof theme == "string") {
theme = theme || "ace/theme/textmate";
@@ -13513,7 +13521,6 @@ var VirtualRenderer = function(container, theme) {
afterLoad(theme);
}
- var _self = this;
function afterLoad(theme) {
if (_self.$theme)
dom.removeCssClass(_self.container, _self.$theme);
@@ -13533,24 +13540,24 @@ var VirtualRenderer = function(container, theme) {
this.getTheme = function() {
return this.$themeValue;
- }
+ };
// Methods allows to add / remove CSS classnames to the editor element.
// This feature can be used by plug-ins to provide a visual indication of
// a certain mode that editor is in.
this.setStyle = function setStyle(style) {
- dom.addCssClass(this.container, style)
+ dom.addCssClass(this.container, style);
};
this.unsetStyle = function unsetStyle(style) {
- dom.removeCssClass(this.container, style)
+ dom.removeCssClass(this.container, style);
};
this.destroy = function() {
this.$textLayer.destroy();
this.$cursorLayer.destroy();
- }
+ };
}).call(VirtualRenderer.prototype);
@@ -14187,7 +14194,7 @@ var Text = function(parentEl) {
if(row > lastRow)
break;
- html.push("
")
+ html.push("
");
// Get the tokens per line as there might be some lines in between
// beeing folded.
// OPTIMIZE: If there is a long block of unfolded lines, just make
@@ -14195,7 +14202,7 @@ var Text = function(parentEl) {
var tokens = this.session.getTokens(row, row);
if (tokens.length == 1)
this.$renderLine(html, row, tokens[0].tokens);
- html.push("
")
+ html.push("
");
row++;
}
@@ -14208,22 +14215,21 @@ var Text = function(parentEl) {
"lparen": true
};
- this.$renderToken = function(stringBuilder, screenColumn, token, value) {
+ this.$renderToken = function(stringBuilder, screenColumn, token, value) {
var self = this;
var replaceReg = /\t|&|<|( +)|([\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000])|[\u1100-\u115F]|[\u11A3-\u11A7]|[\u11FA-\u11FF]|[\u2329-\u232A]|[\u2E80-\u2E99]|[\u2E9B-\u2EF3]|[\u2F00-\u2FD5]|[\u2FF0-\u2FFB]|[\u3000-\u303E]|[\u3041-\u3096]|[\u3099-\u30FF]|[\u3105-\u312D]|[\u3131-\u318E]|[\u3190-\u31BA]|[\u31C0-\u31E3]|[\u31F0-\u321E]|[\u3220-\u3247]|[\u3250-\u32FE]|[\u3300-\u4DBF]|[\u4E00-\uA48C]|[\uA490-\uA4C6]|[\uA960-\uA97C]|[\uAC00-\uD7A3]|[\uD7B0-\uD7C6]|[\uD7CB-\uD7FB]|[\uF900-\uFAFF]|[\uFE10-\uFE19]|[\uFE30-\uFE52]|[\uFE54-\uFE66]|[\uFE68-\uFE6B]|[\uFF01-\uFF60]|[\uFFE0-\uFFE6]/g;
var replaceFunc = function(c, a, b, tabIdx, idx4) {
if (c.charCodeAt(0) == 32) {
return new Array(c.length+1).join(" ");
} else if (c == "\t") {
- var tabSize = self.session.
- getScreenTabSize(screenColumn + tabIdx);
+ var tabSize = self.session.getScreenTabSize(screenColumn + tabIdx);
screenColumn += tabSize - 1;
return self.$tabStrings[tabSize];
} else if (c == "&") {
- if (useragent.isOldGecko)
- return "&";
- else
- return "&";
+ if (useragent.isOldGecko)
+ return "&";
+ else
+ return "&";
} else if (c == "<") {
return "<";
} else if (c.match(/[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]/)) {
@@ -14235,11 +14241,11 @@ var Text = function(parentEl) {
}
} else {
screenColumn += 1;
- return "" + c + "";
+ return "" + c + "";
}
- }
+ };
var output = value.replace(replaceReg, replaceFunc);
@@ -14251,7 +14257,7 @@ var Text = function(parentEl) {
stringBuilder.push(output);
}
return value.length;
- }
+ };
this.$renderLineCore = function(stringBuilder, lastRow, tokens, splits) {
var chars = 0,
@@ -14301,7 +14307,7 @@ var Text = function(parentEl) {
addToken(token, value);
}
}
- };
+ }
if (this.showInvisibles) {
if (lastRow !== this.session.getLength() - 1) {
@@ -14311,16 +14317,16 @@ var Text = function(parentEl) {
}
}
stringBuilder.push("");
- }
+ };
this.$renderLine = function(stringBuilder, row, tokens) {
// Check if the line to render is folded or not. If not, things are
// simple, otherwise, we need to fake some things...
if (!this.session.isRowFolded(row)) {
var splits = this.session.getRowSplitData(row);
- this.$renderLineCore(stringBuilder, row, tokens, splits)
+ this.$renderLineCore(stringBuilder, row, tokens, splits);
} else {
- this.$renderFoldLine(stringBuilder, row, tokens, splits);
+ this.$renderFoldLine(stringBuilder, row, tokens);
}
};
@@ -14332,8 +14338,8 @@ var Text = function(parentEl) {
function addTokens(tokens, from, to) {
var idx = 0, col = 0;
while ((col + tokens[idx].value.length) < from) {
- col += tokens[idx].value.length
- idx++
+ col += tokens[idx].value.length;
+ idx++;
if (idx == tokens.length) {
return;
@@ -14352,7 +14358,7 @@ var Text = function(parentEl) {
});
col = from + value.length;
- idx += 1
+ idx += 1;
}
while (col < to) {
diff --git a/build/src/ace.js b/build/src/ace.js
index daddc9e3..8de3dd8f 100644
--- a/build/src/ace.js
+++ b/build/src/ace.js
@@ -1 +1 @@
-(function(){if(window.require)require.packaged=!0;else{window.define=function(a,b,c){typeof a!=="string"?(console.error("dropping module because define wasn't a string."),console.trace()):(arguments.length==2&&(c=b),define.modules||(define.modules={}),define.modules[a]=c)},window.require=function(b,c){if(Object.prototype.toString.call(b)==="[object Array]"){var d=[];for(var e=0,f=b.length;e=b)throw new TypeError}while(!0)}else var d=arguments[1];for(;c=0;c--)c in this&&(d=a.call(null,d,this[c],c,this));return d}),Array.prototype.indexOf||(Array.prototype.indexOf=function w(a){var b=this.length;if(!b)return-1;var c=arguments[1]||0;if(c>=b)return-1;c<0&&(c+=b);for(;c=0;c--){if(!i(this,c))continue;if(a===this[c])return c}return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function y(a){return a.__proto__||a.constructor.prototype});if(!Object.getOwnPropertyDescriptor){var z="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function A(a,b){if(typeof a!=="object"&&typeof a!=="function"||a===null)throw new TypeError(z+a);if(!i(a,b))return undefined;var c,d,e;c={enumerable:!0,configurable:!0};if(n){var f=a.__proto__;a.__proto__=h;var d=l(a,b),e=m(a,b);a.__proto__=f;if(d||e){d&&(descriptor.get=d),e&&(descriptor.set=e);return descriptor}}descriptor.value=a[b];return descriptor}}Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function B(a){return Object.keys(a)}),Object.create||(Object.create=function C(a,b){var c;if(a===null)c={"__proto__":null};else{if(typeof a!=="object")throw new TypeError("typeof prototype["+typeof a+"] != 'object'");var d=function(){};d.prototype=a,c=new d,c.__proto__=a}typeof b!=="undefined"&&Object.defineProperties(c,b);return c});if(!Object.defineProperty){var D="Property description must be an object: ",E="Object.defineProperty called on non-object: ",F="getters & setters can not be defined on this javascript engine";Object.defineProperty=function G(a,b,c){if(typeof a!=="object"&&typeof a!=="function")throw new TypeError(E+a);if(typeof a!=="object"||a===null)throw new TypeError(D+c);if(i(c,"value"))if(n&&(l(a,b)||m(a,b))){var d=a.__proto__;a.__proto__=h,delete a[b],a[b]=c.value,a.prototype}else a[b]=c.value;else{if(!n)throw new TypeError(F);i(c,"get")&&j(a,b,c.get),i(c,"set")&&k(a,b,c.set)}return a}}Object.defineProperties||(Object.defineProperties=function H(a,b){for(var c in b)i(b,c)&&Object.defineProperty(a,c,b[c]);return a}),Object.seal||(Object.seal=function I(a){return a}),Object.freeze||(Object.freeze=function J(a){return a});try{Object.freeze(function(){})}catch(K){Object.freeze=function J(a){return function b(b){return typeof b==="function"?b:a(b)}}(Object.freeze)}Object.preventExtensions||(Object.preventExtensions=function L(a){return a}),Object.isSealed||(Object.isSealed=function M(a){return!1}),Object.isFrozen||(Object.isFrozen=function N(a){return!1}),Object.isExtensible||(Object.isExtensible=function O(a){return!0});if(!Object.keys){var P=!0,Q=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],R=Q.length;for(var S in {toString:null})P=!1;Object.keys=function T(a){if(typeof a!=="object"&&typeof a!=="function"||a===null)throw new TypeError("Object.keys called on a non-object");var b=[];for(var c in a)i(a,c)&&b.push(c);if(P)for(var d=0,e=R;d=7?new a(c,d,e,f,g,h,i):j>=6?new a(c,d,e,f,g,h):j>=5?new a(c,d,e,f,g):j>=4?new a(c,d,e,f):j>=3?new a(c,d,e):j>=2?new a(c,d):j>=1?new a(c):new a;k.constructor=b;return k}return a.apply(this,arguments)},c=new RegExp("^(?:((?:[+-]\\d\\d)?\\d\\d\\d\\d)(?:-(\\d\\d)(?:-(\\d\\d))?)?)?(?:T(\\d\\d):(\\d\\d)(?::(\\d\\d)(?:\\.(\\d\\d\\d))?)?)?(?:Z|([+-])(\\d\\d):(\\d\\d))?$");for(var d in a)b[d]=a[d];b.now=a.now,b.UTC=a.UTC,b.prototype=a.prototype,b.prototype.constructor=b,b.parse=function e(b){var d=c.exec(b);if(d){d.shift();var e=d[0]===undefined;for(var f=0;f<10;f++){if(f===7)continue;d[f]=+(d[f]||(f<3?1:0)),f===1&&d[f]--}if(e)return((d[3]*60+d[4])*60+d[5])*1e3+d[6];var g=(d[8]*60+d[9])*60*1e3;d[6]==="-"&&(g=-g);return a.UTC.apply(this,d.slice(0,7))+g}return a.parse.apply(this,arguments)};return b}(Date));if(!String.prototype.trim){var X=/^\s\s*/,Y=/\s\s*$/;String.prototype.trim=function Z(){return String(this).replace(X,"").replace(Y,"")}}}),define("ace/ace",["require","exports","module","pilot/index","pilot/fixoldbrowsers","pilot/plugin_manager","pilot/dom","pilot/event","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/theme/textmate","pilot/environment"],function(a,b,c){a("pilot/index"),a("pilot/fixoldbrowsers");var d=a("pilot/plugin_manager").catalog;d.registerPlugins(["pilot/index"]);var e=a("pilot/dom"),f=a("pilot/event"),g=a("ace/editor").Editor,h=a("ace/edit_session").EditSession,i=a("ace/undomanager").UndoManager,j=a("ace/virtual_renderer").VirtualRenderer;b.edit=function(b){typeof b=="string"&&(b=document.getElementById(b));var c=new h(e.getInnerText(b));c.setUndoManager(new i),b.innerHTML="";var k=new g(new j(b,a("ace/theme/textmate")));k.setSession(c);var l=a("pilot/environment").create();d.startupPlugins({env:l}).then(function(){l.document=c,l.editor=k,k.resize(),f.addListener(window,"resize",function(){k.resize()}),b.env=l}),k.env=l;return k}}),define("pilot/index",["require","exports","module","pilot/fixoldbrowsers","pilot/types/basic","pilot/types/command","pilot/types/settings","pilot/commands/settings","pilot/commands/basic","pilot/settings/canon","pilot/canon"],function(a,b,c){b.startup=function(b,c){a("pilot/fixoldbrowsers"),a("pilot/types/basic").startup(b,c),a("pilot/types/command").startup(b,c),a("pilot/types/settings").startup(b,c),a("pilot/commands/settings").startup(b,c),a("pilot/commands/basic").startup(b,c),a("pilot/settings/canon").startup(b,c),a("pilot/canon").startup(b,c)},b.shutdown=function(b,c){a("pilot/types/basic").shutdown(b,c),a("pilot/types/command").shutdown(b,c),a("pilot/types/settings").shutdown(b,c),a("pilot/commands/settings").shutdown(b,c),a("pilot/commands/basic").shutdown(b,c),a("pilot/settings/canon").shutdown(b,c),a("pilot/canon").shutdown(b,c)}}),define("pilot/types/basic",["require","exports","module","pilot/types"],function(a,b,c){function m(a){if(a instanceof e)this.subtype=a;else{if(typeof a!=="string")throw new Error("Can' handle array subtype");this.subtype=d.getType(a);if(this.subtype==null)throw new Error("Unknown array subtype: "+a)}}function l(a){if(typeof a.defer!=="function")throw new Error("Instances of DeferredType need typeSpec.defer to be a function that returns a type");Object.keys(a).forEach(function(b){this[b]=a[b]},this)}function j(a){if(!Array.isArray(a.data)&&typeof a.data!=="function")throw new Error("instances of SelectionType need typeSpec.data to be an array or function that returns an array:"+JSON.stringify(a));Object.keys(a).forEach(function(b){this[b]=a[b]},this)}var d=a("pilot/types"),e=d.Type,f=d.Conversion,g=d.Status,h=new e;h.stringify=function(a){return a},h.parse=function(a){if(typeof a!="string")throw new Error("non-string passed to text.parse()");return new f(a)},h.name="text";var i=new e;i.stringify=function(a){if(!a)return null;return""+a},i.parse=function(a){if(typeof a!="string")throw new Error("non-string passed to number.parse()");if(a.replace(/\s/g,"").length===0)return new f(null,g.INCOMPLETE,"");var b=new f(parseInt(a,10));isNaN(b.value)&&(b.status=g.INVALID,b.message="Can't convert \""+a+'" to a number.');return b},i.decrement=function(a){return a-1},i.increment=function(a){return a+1},i.name="number",j.prototype=new e,j.prototype.stringify=function(a){return a},j.prototype.parse=function(a){if(typeof a!="string")throw new Error("non-string passed to parse()");if(!this.data)throw new Error("Missing data on selection type extension.");var b=typeof this.data==="function"?this.data():this.data,c=!1,d,e=[];b.forEach(function(b){a==b?(d=this.fromString(b),c=!0):b.indexOf(a)===0&&e.push(this.fromString(b))},this);if(c)return new f(d);this.noMatch&&this.noMatch();if(e.length>0){var h="Possibilities"+(a.length===0?"":" for '"+a+"'");return new f(null,g.INCOMPLETE,h,e)}var h="Can't use '"+a+"'.";return new f(null,g.INVALID,h,e)},j.prototype.fromString=function(a){return a},j.prototype.decrement=function(a){var b=typeof this.data==="function"?this.data():this.data,c;if(a==null)c=b.length-1;else{var d=this.stringify(a),c=b.indexOf(d);c=c===0?b.length-1:c-1}return this.fromString(b[c])},j.prototype.increment=function(a){var b=typeof this.data==="function"?this.data():this.data,c;if(a==null)c=0;else{var d=this.stringify(a),c=b.indexOf(d);c=c===b.length-1?0:c+1}return this.fromString(b[c])},j.prototype.name="selection",b.SelectionType=j;var k=new j({name:"bool",data:["true","false"],stringify:function(a){return""+a},fromString:function(a){return a==="true"?!0:!1}});l.prototype=new e,l.prototype.stringify=function(a){return this.defer().stringify(a)},l.prototype.parse=function(a){return this.defer().parse(a)},l.prototype.decrement=function(a){var b=this.defer();return b.decrement?b.decrement(a):undefined},l.prototype.increment=function(a){var b=this.defer();return b.increment?b.increment(a):undefined},l.prototype.name="deferred",b.DeferredType=l,m.prototype=new e,m.prototype.stringify=function(a){return a.join(" ")},m.prototype.parse=function(a){return this.defer().parse(a)},m.prototype.name="array";var n=!1;b.startup=function(){n||(n=!0,d.registerType(h),d.registerType(i),d.registerType(k),d.registerType(j),d.registerType(l),d.registerType(m))},b.shutdown=function(){n=!1,d.unregisterType(h),d.unregisterType(i),d.unregisterType(k),d.unregisterType(j),d.unregisterType(l),d.unregisterType(m)}}),define("pilot/types",["require","exports","module"],function(a,b,c){function i(a,b){if(a.substr(-2)==="[]"){var c=a.slice(0,-2);return new g.array(c)}var d=g[a];typeof d==="function"&&(d=new d(b));return d}function f(){}function e(a,b,c,e){this.value=a,this.status=b||d.VALID,this.message=c,this.predictions=e||[]}var d={VALID:{toString:function(){return"VALID"},valueOf:function(){return 0}},INCOMPLETE:{toString:function(){return"INCOMPLETE"},valueOf:function(){return 1}},INVALID:{toString:function(){return"INVALID"},valueOf:function(){return 2}},combine:function(a){var b=d.VALID;for(var c=0;cb.valueOf()&&(b=a[c]);return b}};b.Status=d,b.Conversion=e,f.prototype={stringify:function(a){throw new Error("not implemented")},parse:function(a){throw new Error("not implemented")},name:undefined,increment:function(a){return undefined},decrement:function(a){return undefined},getDefault:function(){return this.parse("")}},b.Type=f;var g={};b.registerType=function(a){if(typeof a==="object"){if(!(a instanceof f))throw new Error("Can't registerType using: "+a);if(!a.name)throw new Error("All registered types must have a name");g[a.name]=a}else{if(typeof a!=="function")throw new Error("Unknown type: "+a);if(!a.prototype.name)throw new Error("All registered types must have a name");g[a.prototype.name]=a}},b.registerTypes=function h(a){Object.keys(a).forEach(function(c){var d=a[c];d.name=c,b.registerType(d)})},b.deregisterType=function(a){delete g[a.name]},b.getType=function(a){if(typeof a==="string")return i(a);if(typeof a==="object"){if(!a.name)throw new Error("Missing 'name' member to typeSpec");return i(a.name,a)}throw new Error("Can't extract type from "+a)}}),define("pilot/types/command",["require","exports","module","pilot/canon","pilot/types/basic","pilot/types"],function(a,b,c){var d=a("pilot/canon"),e=a("pilot/types/basic").SelectionType,f=a("pilot/types"),g=new e({name:"command",data:function(){return d.getCommandNames()},stringify:function(a){return a.name},fromString:function(a){return d.getCommand(a)}});b.startup=function(){f.registerType(g)},b.shutdown=function(){f.unregisterType(g)}}),define("pilot/canon",["require","exports","module","pilot/console","pilot/stacktrace","pilot/oop","pilot/useragent","pilot/keys","pilot/event_emitter","pilot/typecheck","pilot/catalog","pilot/types","pilot/lang"],function(a,b,c){function J(a){a=a||{},this.command=a.command,this.args=a.args,this.typed=a.typed,this._begunOutput=!1,this.start=new Date,this.end=null,this.completed=!1,this.error=!1}function G(a,b,c,e,f){function h(){a.exec(b,g.args,g),!g.isAsync&&!g.isDone&&g.done()}typeof a==="string"&&(a=q[a]);if(!a)return!1;var g=new J({sender:c,command:a,args:e||{},typed:f});if(g.getStatus()==l.INVALID){d.error("Canon.exec: Invalid parameter(s) passed to "+a.name);return!1}if(g.getStatus()==l.INCOMPLETE){var i,j=b[c];if(!j||!j.getArgsProvider||!(i=j.getArgsProvider()))i=F;i(g,function(){g.getStatus()==l.VALID&&h()});return!0}h();return!0}function F(a,b){var c=a.args,d=a.command.params;for(var e=0;eI)H.shiftObject();b._dispatchEvent("output",{requests:H,request:this})},J.prototype.doneWithError=function(a){this.error=!0,this.done(a)},J.prototype.async=function(){this.isAsync=!0,this._begunOutput||this._beginOutput()},J.prototype.output=function(a){this._begunOutput||this._beginOutput(),typeof a!=="string"&&!(a instanceof Node)&&(a=a.toString()),this.outputs.push(a),this.isDone=!0,this._dispatchEvent("output",{});return this},J.prototype.done=function(a){this.completed=!0,this.end=new Date,this.duration=this.end.getTime()-this.start.getTime(),a&&this.output(a),this.isDone||(this.isDone=!0,this._dispatchEvent("output",{}))},b.Request=J}),define("pilot/console",["require","exports","module"],function(a,b,c){var d=function(){},e=["assert","count","debug","dir","dirxml","error","group","groupEnd","info","log","profile","profileEnd","time","timeEnd","trace","warn"];typeof window==="undefined"?e.forEach(function(a){b[a]=function(){var b=Array.prototype.slice.call(arguments),c={op:"log",method:a,args:b};postMessage(JSON.stringify(c))}}):e.forEach(function(a){window.console&&window.console[a]?b[a]=Function.prototype.bind.call(window.console[a],window.console):b[a]=d})}),define("pilot/stacktrace",["require","exports","module","pilot/useragent","pilot/console"],function(a,b,c){function i(){}function g(a){for(var b=0;b\s*\(/gm,"{anonymous}()@").split("\n")},firefox:function(a){var b=a.stack;if(!b){e.log(a);return[]}b=b.replace(/(?:\n@:0)?\s+$/m,""),b=b.replace(/^\(/gm,"{anonymous}(");return b.split("\n")},opera:function(a){var b=a.message.split("\n"),c="{anonymous}",d=/Line\s+(\d+).*?script\s+(http\S+)(?:.*?in\s+function\s+(\S+))?/i,e,f,g;for(e=4,f=0,g=b.length;e=0,b.isIPad=e.indexOf("iPad")>=0,b.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},b.getOS=function(){return b.isMac?b.OS.MAC:b.isLinux?b.OS.LINUX:b.OS.WINDOWS}}),define("pilot/oop",["require","exports","module"],function(a,b,c){b.inherits=function(){var a=function(){};return function(b,c){a.prototype=c.prototype,b.super_=c.prototype,b.prototype=new a,b.prototype.constructor=b}}(),b.mixin=function(a,b){for(var c in b)a[c]=b[c]},b.implement=function(a,c){b.mixin(a,c)}}),define("pilot/keys",["require","exports","module","pilot/oop"],function(a,b,c){var d=a("pilot/oop"),e=function(){var a={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,meta:8,command:8},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",188:",",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:'"'}};for(i in a.FUNCTION_KEYS){var b=a.FUNCTION_KEYS[i].toUpperCase();a[b]=parseInt(i,10)}d.mixin(a,a.MODIFIER_KEYS),d.mixin(a,a.PRINTABLE_KEYS),d.mixin(a,a.FUNCTION_KEYS);return a}();d.mixin(b,e),b.keyCodeToString=function(a){return(e[a]||String.fromCharCode(a)).toLowerCase()}}),define("pilot/event_emitter",["require","exports","module"],function(a,b,c){var d={};d._emit=d._dispatchEvent=function(a,b){this._eventRegistry=this._eventRegistry||{};var c=this._eventRegistry[a];if(c&&c.length){var b=b||{};b.type=a;for(var d=0;d"+setting.name+" = "+setting.get():(b.setting.set(b.value),d="Setting: "+b.setting.name+" = "+b.setting.get());else{var e=a.settings.getSettingNames();d="",e.sort(function(a,b){return a.localeCompare(b)}),e.forEach(function(b){var c=a.settings.getSetting(b),e="https://wiki.mozilla.org/Labs/Skywriter/Settings#"+c.name;d+=''+c.name+" = "+c.value+" "})}c.done(d)}},e={name:"unset",params:[{name:"setting",type:"setting",description:"The name of the setting to return to defaults"}],description:"unset a setting entirely",exec:function(a,b,c){var d=a.settings.get(b.setting);d?(d.reset(),c.done("Reset "+d.name+" to default: "+a.settings.get(b.setting))):c.doneWithError("No setting with the name "+b.setting+".")}},f=a("pilot/canon");b.startup=function(a,b){f.addCommand(d),f.addCommand(e)},b.shutdown=function(a,b){f.removeCommand(d),f.removeCommand(e)}}),define("pilot/commands/basic",["require","exports","module","pilot/typecheck","pilot/canon"],function(require,exports,module){var checks=require("pilot/typecheck"),canon=require("pilot/canon"),helpMessages={plainPrefix:'
',plainSuffix:'For more information, see the Skywriter Wiki.'},helpCommandSpec={name:"help",params:[{name:"search",type:"text",description:"Search string to narrow the output.",defaultValue:null}],description:"Get help on the available commands.",exec:function(a,b,c){var d=[],e=canon.getCommand(b.search);if(e&&e.exec)d.push(e.description?e.description:"No description for "+b.search);else{var f=!1;!b.search&&helpMessages.plainPrefix&&d.push(helpMessages.plainPrefix),e?(d.push("
"),!b.search&&helpMessages.plainSuffix&&d.push(helpMessages.plainSuffix)}c.done(d.join(""))}},evalCommandSpec={name:"eval",params:[{name:"javascript",type:"text",description:"The JavaScript to evaluate"}],description:"evals given js code and show the result",hidden:!0,exec:function(env,args,request){var result,javascript=args.javascript;try{result=eval(javascript)}catch(e){result="Error: "+e.message+""}var msg="",type="",x;if(checks.isFunction(result))msg=(result+"").replace(/\n/g," ").replace(/ /g," "),type="function";else if(checks.isObject(result)){Array.isArray(result)?type="array":type="object";var items=[],value;for(x in result)result.hasOwnProperty(x)&&(checks.isFunction(result[x])?value="[function]":checks.isObject(result[x])?value="[object]":value=result[x],items.push({name:x,value:value}));items.sort(function(a,b){return a.name.toLowerCase()"+items[x].name+": "+items[x].value+" "}else msg=result,type=typeof result;request.done("Result for eval '"+javascript+"' (type: "+type+"):
',plainSuffix:'For more information, see the Skywriter Wiki.'},helpCommandSpec={name:"help",params:[{name:"search",type:"text",description:"Search string to narrow the output.",defaultValue:null}],description:"Get help on the available commands.",exec:function(a,b,c){var d=[],e=canon.getCommand(b.search);if(e&&e.exec)d.push(e.description?e.description:"No description for "+b.search);else{var f=!1;!b.search&&helpMessages.plainPrefix&&d.push(helpMessages.plainPrefix),e?(d.push("
"),!b.search&&helpMessages.plainSuffix&&d.push(helpMessages.plainSuffix)}c.done(d.join(""))}},evalCommandSpec={name:"eval",params:[{name:"javascript",type:"text",description:"The JavaScript to evaluate"}],description:"evals given js code and show the result",hidden:!0,exec:function(env,args,request){var result,javascript=args.javascript;try{result=eval(javascript)}catch(e){result="Error: "+e.message+""}var msg="",type="",x;if(checks.isFunction(result))msg=(result+"").replace(/\n/g," ").replace(/ /g," "),type="function";else if(checks.isObject(result)){Array.isArray(result)?type="array":type="object";var items=[],value;for(x in result)result.hasOwnProperty(x)&&(checks.isFunction(result[x])?value="[function]":checks.isObject(result[x])?value="[object]":value=result[x],items.push({name:x,value:value}));items.sort(function(a,b){return a.name.toLowerCase()"+items[x].name+": "+items[x].value+" "}else msg=result,type=typeof result;request.done("Result for eval '"+javascript+"' (type: "+type+"):
',plainSuffix:'For more information, see the Skywriter Wiki.'},helpCommandSpec={name:"help",params:[{name:"search",type:"text",description:"Search string to narrow the output.",defaultValue:null}],description:"Get help on the available commands.",exec:function(a,b,c){var d=[],e=canon.getCommand(b.search);if(e&&e.exec)d.push(e.description?e.description:"No description for "+b.search);else{var f=!1;!b.search&&helpMessages.plainPrefix&&d.push(helpMessages.plainPrefix),e?(d.push("
"),!b.search&&helpMessages.plainSuffix&&d.push(helpMessages.plainSuffix)}c.done(d.join(""))}},evalCommandSpec={name:"eval",params:[{name:"javascript",type:"text",description:"The JavaScript to evaluate"}],description:"evals given js code and show the result",hidden:!0,exec:function(env,args,request){var result,javascript=args.javascript;try{result=eval(javascript)}catch(e){result="Error: "+e.message+""}var msg="",type="",x;if(checks.isFunction(result))msg=(result+"").replace(/\n/g," ").replace(/ /g," "),type="function";else if(checks.isObject(result)){Array.isArray(result)?type="array":type="object";var items=[],value;for(x in result)result.hasOwnProperty(x)&&(checks.isFunction(result[x])?value="[function]":checks.isObject(result[x])?value="[object]":value=result[x],items.push({name:x,value:value}));items.sort(function(a,b){return a.name.toLowerCase()"+items[x].name+": "+items[x].value+" "}else msg=result,type=typeof result;request.done("Result for eval '"+javascript+"' (type: "+type+"):
',plainSuffix:'For more information, see the Skywriter Wiki.'},helpCommandSpec={name:"help",params:[{name:"search",type:"text",description:"Search string to narrow the output.",defaultValue:null}],description:"Get help on the available commands.",exec:function(a,b,c){var d=[],e=canon.getCommand(b.search);if(e&&e.exec)d.push(e.description?e.description:"No description for "+b.search);else{var f=!1;!b.search&&helpMessages.plainPrefix&&d.push(helpMessages.plainPrefix),e?(d.push("
"),!b.search&&helpMessages.plainSuffix&&d.push(helpMessages.plainSuffix)}c.done(d.join(""))}},evalCommandSpec={name:"eval",params:[{name:"javascript",type:"text",description:"The JavaScript to evaluate"}],description:"evals given js code and show the result",hidden:!0,exec:function(env,args,request){var result,javascript=args.javascript;try{result=eval(javascript)}catch(e){result="Error: "+e.message+""}var msg="",type="",x;if(checks.isFunction(result))msg=(result+"").replace(/\n/g," ").replace(/ /g," "),type="function";else if(checks.isObject(result)){Array.isArray(result)?type="array":type="object";var items=[],value;for(x in result)result.hasOwnProperty(x)&&(checks.isFunction(result[x])?value="[function]":checks.isObject(result[x])?value="[object]":value=result[x],items.push({name:x,value:value}));items.sort(function(a,b){return a.name.toLowerCase()"+items[x].name+": "+items[x].value+" "}else msg=result,type=typeof result;request.done("Result for eval '"+javascript+"' (type: "+type+"):