rem
stringlengths 0
126k
| add
stringlengths 0
441k
| context
stringlengths 15
136k
|
---|---|---|
window.content.scrollTo(0, window.content.scrollY + elem.getBoundingClientRect().top - 10); | content.scrollTo(0, content.scrollY + elem.getBoundingClientRect().top - 10); | function checkFragment() { document.title = document.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "title")[0].textContent; var frag = document.location.hash.substr(1); var elem = document.getElementById(frag); function action() { window.content.scrollTo(0, window.content.scrollY + elem.getBoundingClientRect().top - 10); // 10px context } if (elem) { action(); setTimeout(action, 10); }} |
/* var p=TreeParents[field][node]; while (p>-1) { if (TreeChecked[field][p]==0) { CheckNode(field,p); unode=TreeParents[field][p]; if (unode==-1) {DrawTree(field);} else {UpdateNode(field,unode);} | if( p > -1 ) { if( TreeChecked[field][p] == 0 ) { CheckNode( field, p ); unode = TreeParents[field][p]; if( unode == -1 ) { DrawTree( field ); } else { UpdateNode( field, unode ); | function CheckNode(field,node) { if (TreeChecked[field][node]==0) { TreeChecked[field][node]=1; //Make sure all parents are ticked /* var p=TreeParents[field][node]; while (p>-1) { if (TreeChecked[field][p]==0) { CheckNode(field,p); unode=TreeParents[field][p]; if (unode==-1) {DrawTree(field);} else {UpdateNode(field,unode);} } var p=TreeParents[field][p]; } */ } else { TreeChecked[field][node]=0;ResetChildren(field,node); var p=TreeParents[field][node]; if (p!=-1) { if ((CountTickedChildren(field,p)==0) && (TreeChecked[field][p]==1)) {CheckNode(field,p);UpdateNode(field,TreeParents[field][p]);} } UpdateNode(field,node); } UpdateStatusBox(field); UpdateHiddenField(field); } |
var p=TreeParents[field][p]; | function CheckNode(field,node) { if (TreeChecked[field][node]==0) { TreeChecked[field][node]=1; //Make sure all parents are ticked /* var p=TreeParents[field][node]; while (p>-1) { if (TreeChecked[field][p]==0) { CheckNode(field,p); unode=TreeParents[field][p]; if (unode==-1) {DrawTree(field);} else {UpdateNode(field,unode);} } var p=TreeParents[field][p]; } */ } else { TreeChecked[field][node]=0;ResetChildren(field,node); var p=TreeParents[field][node]; if (p!=-1) { if ((CountTickedChildren(field,p)==0) && (TreeChecked[field][p]==1)) {CheckNode(field,p);UpdateNode(field,TreeParents[field][p]);} } UpdateNode(field,node); } UpdateStatusBox(field); UpdateHiddenField(field); } |
|
*/ | function CheckNode(field,node) { if (TreeChecked[field][node]==0) { TreeChecked[field][node]=1; //Make sure all parents are ticked /* var p=TreeParents[field][node]; while (p>-1) { if (TreeChecked[field][p]==0) { CheckNode(field,p); unode=TreeParents[field][p]; if (unode==-1) {DrawTree(field);} else {UpdateNode(field,unode);} } var p=TreeParents[field][p]; } */ } else { TreeChecked[field][node]=0;ResetChildren(field,node); var p=TreeParents[field][node]; if (p!=-1) { if ((CountTickedChildren(field,p)==0) && (TreeChecked[field][p]==1)) {CheckNode(field,p);UpdateNode(field,TreeParents[field][p]);} } UpdateNode(field,node); } UpdateStatusBox(field); UpdateHiddenField(field); } |
|
else { TreeChecked[field][node]=0;ResetChildren(field,node); var p=TreeParents[field][node]; if (p!=-1) { if ((CountTickedChildren(field,p)==0) && (TreeChecked[field][p]==1)) {CheckNode(field,p);UpdateNode(field,TreeParents[field][p]);} } UpdateNode(field,node); } UpdateStatusBox(field); UpdateHiddenField(field); | } else { TreeChecked[field][node] = 0; ResetChildren( field, node ); UpdateNode( field, node ); | function CheckNode(field,node) { if (TreeChecked[field][node]==0) { TreeChecked[field][node]=1; //Make sure all parents are ticked /* var p=TreeParents[field][node]; while (p>-1) { if (TreeChecked[field][p]==0) { CheckNode(field,p); unode=TreeParents[field][p]; if (unode==-1) {DrawTree(field);} else {UpdateNode(field,unode);} } var p=TreeParents[field][p]; } */ } else { TreeChecked[field][node]=0;ResetChildren(field,node); var p=TreeParents[field][node]; if (p!=-1) { if ((CountTickedChildren(field,p)==0) && (TreeChecked[field][p]==1)) {CheckNode(field,p);UpdateNode(field,TreeParents[field][p]);} } UpdateNode(field,node); } UpdateStatusBox(field); UpdateHiddenField(field); } |
UpdateStatusBox( field ); UpdateHiddenField( field ); } | function CheckNode(field,node) { if (TreeChecked[field][node]==0) { TreeChecked[field][node]=1; //Make sure all parents are ticked /* var p=TreeParents[field][node]; while (p>-1) { if (TreeChecked[field][p]==0) { CheckNode(field,p); unode=TreeParents[field][p]; if (unode==-1) {DrawTree(field);} else {UpdateNode(field,unode);} } var p=TreeParents[field][p]; } */ } else { TreeChecked[field][node]=0;ResetChildren(field,node); var p=TreeParents[field][node]; if (p!=-1) { if ((CountTickedChildren(field,p)==0) && (TreeChecked[field][p]==1)) {CheckNode(field,p);UpdateNode(field,TreeParents[field][p]);} } UpdateNode(field,node); } UpdateStatusBox(field); UpdateHiddenField(field); } |
|
if (! expected) { if (/Error:/.exec(got)) { return false; } return true; } | doctest.JSRunner.prototype.checkResult = function (got, expected) { if (! expected) { // We special case a no-expected-output case, to just test that // there is no "Error:" in the text if (/Error:/.exec(got)) { return false; } return true; } expected = expected.replace(/[\n\r]*$/, '') + '\n'; got = got.replace(/[\n\r]*$/, '') + '\n'; if (expected == '...\n') { return true; } expected = RegExp.escape(expected); // Note: .* doesn't match newlines, but [^] matches everything expected = '^' + expected.replace(/\\.\\.\\./g, "[^]*") + '$'; expected = expected.replace(/\n/, '\\n'); var re = new RegExp(expected); return got.search(re) != -1;}; |
|
expected = '^' + expected.replace(/\\\.\\\.\\\./g, "[^]*") + '$'; | expected = '^' + expected.replace(/\\\.\\\.\\\./g, "[^\\r\\n]*") + '$'; | doctest.JSRunner.prototype.checkResult = function (got, expected) { expected = expected.replace(/[\n\r]*$/, '') + '\n'; got = got.replace(/[\n\r]*$/, '') + '\n'; if (expected == '...\n') { return true; } expected = RegExp.escape(expected); // Note: .* doesn't match newlines, but [^] matches everything expected = '^' + expected.replace(/\\\.\\\.\\\./g, "[^]*") + '$'; expected = expected.replace(/\n/, '\\n'); var re = new RegExp(expected); return got.search(re) != -1;}; |
expected = '^' + expected.replace(/\\.\\.\\./g, "[^]*") + '$'; | expected = '^' + expected.replace(/\\\.\\\.\\\./g, "[^]*") + '$'; | doctest.JSRunner.prototype.checkResult = function (got, expected) { expected = expected.replace(/[\n\r]*$/, '') + '\n'; got = got.replace(/[\n\r]*$/, '') + '\n'; if (expected == '...\n') { return true; } expected = RegExp.escape(expected); // Note: .* doesn't match newlines, but [^] matches everything expected = '^' + expected.replace(/\\.\\.\\./g, "[^]*") + '$'; expected = expected.replace(/\n/, '\\n'); var re = new RegExp(expected); return got.search(re) != -1;}; |
expected = expected.replace(/\\\?/g, "[a-zA-Z0-9_.]+"); | doctest.JSRunner.prototype.checkResult = function (got, expected) { expected = expected.replace(/[\n\r]*$/, '') + '\n'; got = got.replace(/[\n\r]*$/, '') + '\n'; if (expected == '...\n') { return true; } expected = RegExp.escape(expected); // Note: .* doesn't match newlines, [^] doesn't work on IE expected = '^' + expected.replace(/\\\.\\\.\\\./g, "(?:.|[\\r\\n])*") + '$'; expected = expected.replace(/\n/, '\\n'); var re = new RegExp(expected); return got.search(re) != -1;}; |
|
expected = '^' + expected.replace(/\\\.\\\.\\\./g, "[^\\r\\n]*") + '$'; | expected = '^' + expected.replace(/\\\.\\\.\\\./g, "(?:.|[\\r\\n])*") + '$'; | doctest.JSRunner.prototype.checkResult = function (got, expected) { expected = expected.replace(/[\n\r]*$/, '') + '\n'; got = got.replace(/[\n\r]*$/, '') + '\n'; if (expected == '...\n') { return true; } expected = RegExp.escape(expected); // Note: .* doesn't match newlines, [^] doesn't work on IE expected = '^' + expected.replace(/\\\.\\\.\\\./g, "[^\\r\\n]*") + '$'; expected = expected.replace(/\n/, '\\n'); var re = new RegExp(expected); return got.search(re) != -1;}; |
this.throwIfDisposed_(); | activity.TimelineView.BarChart_.prototype.clampToStartTime = function(startTime) { this.throwIfDisposed_(); if (this.isEmpty() || startTime >= this.endTime_) { // If there are no visible events, update the start and end times // and remove any existing children. this.startTime_ = startTime; this.endTime_ = startTime; this.lastEventEndTime_ = 0; this.removeAllChildren_(); return; } var amountToTrim = startTime - this.startTime_; if (amountToTrim < 0) { throw new Error(['Current BarChart start time', this.startTime_, 'exceeds requested start time', startTime].join(' ')); } while (amountToTrim > 0) { var spacer = this.bar_.firstChild; if (!spacer) { throw new Error('Ran out of spacers!'); } var duration = spacer.getAttribute('flex'); if (!duration) { throw new Error('clampToStartTime encountered zero-width child.'); } if (duration <= amountToTrim) { // The duration of this spacer is less than the amount to trim, // so we can safely remove the entire spacer. this.bar_.removeChild(spacer); amountToTrim -= duration; } else { // The spacer's duration exceeds that of the amount to trim, so // we need to reduce the spacer's duration by the amount to // trim. spacer.setAttribute('flex', duration - amountToTrim); amountToTrim = 0; } } this.startTime_ = startTime;}; |
|
var cls = function() { if(this.init) { this.init.apply(this, arguments); }} | var cls = function() { if(this.init) { return this.init.apply(this, arguments); }} | exports.Class = function(parent, proto) { if(!parent) { throw new Error('parent or prototype not provided'); } if(!proto) { proto = parent; } else if(parent instanceof Array) { // multiple inheritance, use at your own risk =) proto.prototype = {}; for(var i = 0, p; p = parent[i]; ++i) { for(var item in p.prototype) { if(!(item in proto.prototype)) { proto.prototype[item] = p.prototype[item]; } } } parent = parent[0]; } else { proto.prototype = parent.prototype; } var cls = function() { if(this.init) { this.init.apply(this, arguments); }} cls.prototype = new proto(function(context, method, args) { var args = args || []; var target = proto; while(target = target.prototype) { if(target[method]) { return target[method].apply(context, args); } } throw new Error('method ' + method + ' does not exist'); }); cls.prototype.constructor = cls; return cls;} |
h=h.getElementsByName(g[1]);for(var m=0,r=h.length;m<r;m++)h[m].getAttribute("name")===g[1]&&k.push(h[m]);return k.length===0?null:k}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,k,m,r,q){g=" "+g[1].replace(/\\/g,"")+" ";if(q)return g;q=0;for(var v;(v=h[q])!=null;q++)if(v)if(r^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))k||m.push(v);else if(k)h[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()}, | (function(){var g=s.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}: | h=h.getElementsByName(g[1]);for(var m=0,r=h.length;m<r;m++)h[m].getAttribute("name")===g[1]&&k.push(h[m]);return k.length===0?null:k}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,k,m,r,q){g=" "+g[1].replace(/\\/g,"")+" ";if(q)return g;q=0;for(var v;(v=h[q])!=null;q++)if(v)if(r^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))k||m.push(v);else if(k)h[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()}, |
return this.$().attr('class'); | return this.$().attr('class').split(' '); | classNames: function(classNames, cloneOnModify) { if (this._elem) { if (classNames) { this.$().resetClassNames().addClass(classNames); return this; } else { return this.$().attr('class'); } } if (classNames === undefined) { if (this._cloneClassNames) { this._classNames = (this._classNames || []).slice(); this._cloneClassNames = NO ; } // if there are no class names, create an empty array but don't modify. if (!this._classNames) this._classNames = []; return this._classNames ; } else { this._classNames = classNames ; this._cloneClassNames = cloneOnModify || NO ; this._classNamesDidChange = YES ; return this ; } }, |
classNames: function(element) { return new Element.ClassNames(element); }, | var Prototype={Version:"1.6.1",Browser:(function(){var b=navigator.userAgent;var a=Object.prototype.toString.call(window.opera)=="[object Opera]";return{IE:!!window.attachEvent&&!a,Opera:a,WebKit:b.indexOf("AppleWebKit/")>-1,Gecko:b.indexOf("Gecko")>-1&&b.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile.*Safari/.test(b)}})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var a=window.Element||window.HTMLElement;return !!(a&&a.prototype)})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=="undefined"){return true}var c=document.createElement("div");var b=document.createElement("form");var a=false;if(c.__proto__&&(c.__proto__!==b.__proto__)){a=true}c=b=null;return a})()},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Abstract={};var Try={these:function(){var c;for(var b=0,d=arguments.length;b<d;b++){var a=arguments[b];try{c=a();break}catch(f){}}return c}};var Class=(function(){function a(){}function b(){var g=null,f=$A(arguments);if(Object.isFunction(f[0])){g=f.shift()}function d(){this.initialize.apply(this,arguments)}Object.extend(d,Class.Methods);d.superclass=g;d.subclasses=[];if(g){a.prototype=g.prototype;d.prototype=new a;g.subclasses.push(d)}for(var e=0;e<f.length;e++){d.addMethods(f[e])}if(!d.prototype.initialize){d.prototype.initialize=Prototype.emptyFunction}d.prototype.constructor=d;return d}function c(k){var f=this.superclass&&this.superclass.prototype;var e=Object.keys(k);if(!Object.keys({toString:true}).length){if(k.toString!=Object.prototype.toString){e.push("toString")}if(k.valueOf!=Object.prototype.valueOf){e.push("valueOf")}}for(var d=0,g=e.length;d<g;d++){var j=e[d],h=k[j];if(f&&Object.isFunction(h)&&h.argumentNames().first()=="$super"){var l=h;h=(function(i){return function(){return f[i].apply(this,arguments)}})(j).wrap(l);h.valueOf=l.valueOf.bind(l);h.toString=l.toString.bind(l)}this.prototype[j]=h}return this}return{create:b,Methods:{addMethods:c}}})();(function(){var d=Object.prototype.toString;function i(q,s){for(var r in s){q[r]=s[r]}return q}function l(q){try{if(e(q)){return"undefined"}if(q===null){return"null"}return q.inspect?q.inspect():String(q)}catch(r){if(r instanceof RangeError){return"..."}throw r}}function k(q){var s=typeof q;switch(s){case"undefined":case"function":case"unknown":return;case"boolean":return q.toString()}if(q===null){return"null"}if(q.toJSON){return q.toJSON()}if(h(q)){return}var r=[];for(var u in q){var t=k(q[u]);if(!e(t)){r.push(u.toJSON()+": "+t)}}return"{"+r.join(", ")+"}"}function c(q){return $H(q).toQueryString()}function f(q){return q&&q.toHTML?q.toHTML():String.interpret(q)}function o(q){var r=[];for(var s in q){r.push(s)}return r}function m(q){var r=[];for(var s in q){r.push(q[s])}return r}function j(q){return i({},q)}function h(q){return !!(q&&q.nodeType==1)}function g(q){return d.call(q)=="[object Array]"}function p(q){return q instanceof Hash}function b(q){return typeof q==="function"}function a(q){return d.call(q)=="[object String]"}function n(q){return d.call(q)=="[object Number]"}function e(q){return typeof q==="undefined"}i(Object,{extend:i,inspect:l,toJSON:k,toQueryString:c,toHTML:f,keys:o,values:m,clone:j,isElement:h,isArray:g,isHash:p,isFunction:b,isString:a,isNumber:n,isUndefined:e})})();Object.extend(Function.prototype,(function(){var k=Array.prototype.slice;function d(o,l){var n=o.length,m=l.length;while(m--){o[n+m]=l[m]}return o}function i(m,l){m=k.call(m,0);return d(m,l)}function g(){var l=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\ | classNames: function(element) { return new Element.ClassNames(element); }, |
function(a,b){c.fn[a]=function(){return this.each(b,arguments)}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;var e=[];c.each(a,function(i,j){if(typeof j==="number")j+="";if(j){if(typeof j==="string"&&!gb.test(j))j=b.createTextNode(j);else if(typeof j==="string"){j=j.replace(db,hb);var o=(Ha.exec(j)||["",""])[1].toLowerCase(),p=G[o]||G._default,n=p[0];i=b.createElement("div");for(i.innerHTML=p[1]+j+p[2];n--;)i=i.lastChild; if(!c.support.tbody){n=fb.test(j);o=o==="table"&&!n?i.firstChild&&i.firstChild.childNodes:p[1]==="<table>"&&!n?i.childNodes:[];for(p=o.length-1;p>=0;--p)c.nodeName(o[p],"tbody")&&!o[p].childNodes.length&&o[p].parentNode.removeChild(o[p])}!c.support.leadingWhitespace&&Y.test(j)&&i.insertBefore(b.createTextNode(Y.exec(j)[0]),i.firstChild);j=c.makeArray(i.childNodes)}if(j.nodeType)e.push(j);else e=c.merge(e,j)}});if(d)for(a=0;e[a];a++)if(f&&c.nodeName(e[a],"script")&&(!e[a].type||e[a].type.toLowerCase()=== "text/javascript"))f.push(e[a].parentNode?e[a].parentNode.removeChild(e[a]):e[a]);else{e[a].nodeType===1&&e.splice.apply(e,[a+1,0].concat(c.makeArray(e[a].getElementsByTagName("script"))));d.appendChild(e[a])}return e}});var ib=/z-?index|font-?weight|opacity|zoom|line-?height/i,Ia=/alpha\([^)]*\)/,Ja=/opacity=([^)]*)/,ja=/float/i,ka=/-([a-z])/ig,jb=/([A-Z])/g,kb=/^-?\d+(?:px)?$/i,lb=/^-?\d/,mb={position:"absolute",visibility:"hidden",display:"block"},nb=["Left","Right"],ob=["Top","Bottom"],pb=s.defaultView&& | return this}else{e=0;for(var j=d.length;e<j;e++){var i=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["", ""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]==="<table>"&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e= c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]? | function(a,b){c.fn[a]=function(){return this.each(b,arguments)}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;var e=[];c.each(a,function(i,j){if(typeof j==="number")j+="";if(j){if(typeof j==="string"&&!gb.test(j))j=b.createTextNode(j);else if(typeof j==="string"){j=j.replace(db,hb);var o=(Ha.exec(j)||["",""])[1].toLowerCase(),p=G[o]||G._default,n=p[0];i=b.createElement("div");for(i.innerHTML=p[1]+j+p[2];n--;)i=i.lastChild;if(!c.support.tbody){n=fb.test(j);o=o==="table"&&!n?i.firstChild&&i.firstChild.childNodes:p[1]==="<table>"&&!n?i.childNodes:[];for(p=o.length-1;p>=0;--p)c.nodeName(o[p],"tbody")&&!o[p].childNodes.length&&o[p].parentNode.removeChild(o[p])}!c.support.leadingWhitespace&&Y.test(j)&&i.insertBefore(b.createTextNode(Y.exec(j)[0]),i.firstChild);j=c.makeArray(i.childNodes)}if(j.nodeType)e.push(j);else e=c.merge(e,j)}});if(d)for(a=0;e[a];a++)if(f&&c.nodeName(e[a],"script")&&(!e[a].type||e[a].type.toLowerCase()==="text/javascript"))f.push(e[a].parentNode?e[a].parentNode.removeChild(e[a]):e[a]);else{e[a].nodeType===1&&e.splice.apply(e,[a+1,0].concat(c.makeArray(e[a].getElementsByTagName("script"))));d.appendChild(e[a])}return e}});var ib=/z-?index|font-?weight|opacity|zoom|line-?height/i,Ia=/alpha\([^)]*\)/,Ja=/opacity=([^)]*)/,ja=/float/i,ka=/-([a-z])/ig,jb=/([A-Z])/g,kb=/^-?\d+(?:px)?$/i,lb=/^-?\d/,mb={position:"absolute",visibility:"hidden",display:"block"},nb=["Left","Right"],ob=["Top","Bottom"],pb=s.defaultView&& |
cleanWhitespace: function(element) { element = $(element); var node = element.firstChild; while (node) { var nextNode = node.nextSibling; if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) element.removeChild(node); node = nextNode; } return element; }, | var Prototype={Version:"1.6.1",Browser:(function(){var b=navigator.userAgent;var a=Object.prototype.toString.call(window.opera)=="[object Opera]";return{IE:!!window.attachEvent&&!a,Opera:a,WebKit:b.indexOf("AppleWebKit/")>-1,Gecko:b.indexOf("Gecko")>-1&&b.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile.*Safari/.test(b)}})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var a=window.Element||window.HTMLElement;return !!(a&&a.prototype)})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=="undefined"){return true}var c=document.createElement("div");var b=document.createElement("form");var a=false;if(c.__proto__&&(c.__proto__!==b.__proto__)){a=true}c=b=null;return a})()},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Abstract={};var Try={these:function(){var c;for(var b=0,d=arguments.length;b<d;b++){var a=arguments[b];try{c=a();break}catch(f){}}return c}};var Class=(function(){function a(){}function b(){var g=null,f=$A(arguments);if(Object.isFunction(f[0])){g=f.shift()}function d(){this.initialize.apply(this,arguments)}Object.extend(d,Class.Methods);d.superclass=g;d.subclasses=[];if(g){a.prototype=g.prototype;d.prototype=new a;g.subclasses.push(d)}for(var e=0;e<f.length;e++){d.addMethods(f[e])}if(!d.prototype.initialize){d.prototype.initialize=Prototype.emptyFunction}d.prototype.constructor=d;return d}function c(k){var f=this.superclass&&this.superclass.prototype;var e=Object.keys(k);if(!Object.keys({toString:true}).length){if(k.toString!=Object.prototype.toString){e.push("toString")}if(k.valueOf!=Object.prototype.valueOf){e.push("valueOf")}}for(var d=0,g=e.length;d<g;d++){var j=e[d],h=k[j];if(f&&Object.isFunction(h)&&h.argumentNames().first()=="$super"){var l=h;h=(function(i){return function(){return f[i].apply(this,arguments)}})(j).wrap(l);h.valueOf=l.valueOf.bind(l);h.toString=l.toString.bind(l)}this.prototype[j]=h}return this}return{create:b,Methods:{addMethods:c}}})();(function(){var d=Object.prototype.toString;function i(q,s){for(var r in s){q[r]=s[r]}return q}function l(q){try{if(e(q)){return"undefined"}if(q===null){return"null"}return q.inspect?q.inspect():String(q)}catch(r){if(r instanceof RangeError){return"..."}throw r}}function k(q){var s=typeof q;switch(s){case"undefined":case"function":case"unknown":return;case"boolean":return q.toString()}if(q===null){return"null"}if(q.toJSON){return q.toJSON()}if(h(q)){return}var r=[];for(var u in q){var t=k(q[u]);if(!e(t)){r.push(u.toJSON()+": "+t)}}return"{"+r.join(", ")+"}"}function c(q){return $H(q).toQueryString()}function f(q){return q&&q.toHTML?q.toHTML():String.interpret(q)}function o(q){var r=[];for(var s in q){r.push(s)}return r}function m(q){var r=[];for(var s in q){r.push(q[s])}return r}function j(q){return i({},q)}function h(q){return !!(q&&q.nodeType==1)}function g(q){return d.call(q)=="[object Array]"}function p(q){return q instanceof Hash}function b(q){return typeof q==="function"}function a(q){return d.call(q)=="[object String]"}function n(q){return d.call(q)=="[object Number]"}function e(q){return typeof q==="undefined"}i(Object,{extend:i,inspect:l,toJSON:k,toQueryString:c,toHTML:f,keys:o,values:m,clone:j,isElement:h,isArray:g,isHash:p,isFunction:b,isString:a,isNumber:n,isUndefined:e})})();Object.extend(Function.prototype,(function(){var k=Array.prototype.slice;function d(o,l){var n=o.length,m=l.length;while(m--){o[n+m]=l[m]}return o}function i(m,l){m=k.call(m,0);return d(m,l)}function g(){var l=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\ | cleanWhitespace: function(element) { element = $(element); var node = element.firstChild; while (node) { var nextNode = node.nextSibling; if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) element.removeChild(node); node = nextNode; } return element; }, |
if ((modes.extended & modes.OUTPUT_MULTILINE) && this.widgets.multilineOutput.atEnd) | if (modes.main == modes.OUTPUT_MULTILINE && this.widgets.multilineOutput.atEnd) | clear: function () { if (this.widgets.message && this.widgets.message[1] === this._lastClearable) this.widgets.message = null; if (modes.main != modes.COMMAND_LINE) this.widgets.command = null; if ((modes.extended & modes.OUTPUT_MULTILINE) && this.widgets.multilineOutput.atEnd) modes.pop(); if (modes.extended != modes.OUTPUT_MULTILINE) this.multilineOutputVisible = false; }, |
if (modes.extended != modes.OUTPUT_MULTILINE) | if (modes.main != modes.OUTPUT_MULTILINE) | clear: function () { if (this.widgets.message && this.widgets.message[1] === this._lastClearable) this.widgets.message = null; if (modes.main != modes.COMMAND_LINE) this.widgets.command = null; if ((modes.extended & modes.OUTPUT_MULTILINE) && this.widgets.multilineOutput.atEnd) modes.pop(); if (modes.extended != modes.OUTPUT_MULTILINE) this.multilineOutputVisible = false; }, |
if (modes.main == modes.OUTPUT_MULTILINE && this.widgets.multilineOutput.atEnd) | if (modes.main == modes.OUTPUT_MULTILINE && this.widgets.multilineOutput.atEnd) { dactyl.focusContent(); | clear: function () { if (this.widgets.message && this.widgets.message[1] === this._lastClearable) this.widgets.message = null; if (modes.main != modes.COMMAND_LINE) this.widgets.command = null; if (modes.main == modes.OUTPUT_MULTILINE && this.widgets.multilineOutput.atEnd) modes.pop(); if (modes.main != modes.OUTPUT_MULTILINE) this.multilineOutputVisible = false; }, |
} | clear: function () { if (this.widgets.message && this.widgets.message[1] === this._lastClearable) this.widgets.message = null; if (modes.main != modes.COMMAND_LINE) this.widgets.command = null; if (modes.main == modes.OUTPUT_MULTILINE && this.widgets.multilineOutput.atEnd) modes.pop(); if (modes.main != modes.OUTPUT_MULTILINE) this.multilineOutputVisible = false; }, |
|
if (modes.extended != modes.OUTPUT_MULTILINE) this.multilineOutputVisible = false; | clear: function () { if (this.widgets.message && this.widgets.message[1] === this._lastClearable) this.widgets.message = null; if (modes.main != modes.COMMAND_LINE) this.widgets.command = null; }, |
|
this._input.length = 0; | this._input = []; this._keyword = []; | clear: function () { this._input.length = 0; }, |
clear: function(element) { $(element).value = ''; return element; }, | var Prototype={Version:"1.6.1",Browser:(function(){var b=navigator.userAgent;var a=Object.prototype.toString.call(window.opera)=="[object Opera]";return{IE:!!window.attachEvent&&!a,Opera:a,WebKit:b.indexOf("AppleWebKit/")>-1,Gecko:b.indexOf("Gecko")>-1&&b.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile.*Safari/.test(b)}})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var a=window.Element||window.HTMLElement;return !!(a&&a.prototype)})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=="undefined"){return true}var c=document.createElement("div");var b=document.createElement("form");var a=false;if(c.__proto__&&(c.__proto__!==b.__proto__)){a=true}c=b=null;return a})()},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Abstract={};var Try={these:function(){var c;for(var b=0,d=arguments.length;b<d;b++){var a=arguments[b];try{c=a();break}catch(f){}}return c}};var Class=(function(){function a(){}function b(){var g=null,f=$A(arguments);if(Object.isFunction(f[0])){g=f.shift()}function d(){this.initialize.apply(this,arguments)}Object.extend(d,Class.Methods);d.superclass=g;d.subclasses=[];if(g){a.prototype=g.prototype;d.prototype=new a;g.subclasses.push(d)}for(var e=0;e<f.length;e++){d.addMethods(f[e])}if(!d.prototype.initialize){d.prototype.initialize=Prototype.emptyFunction}d.prototype.constructor=d;return d}function c(k){var f=this.superclass&&this.superclass.prototype;var e=Object.keys(k);if(!Object.keys({toString:true}).length){if(k.toString!=Object.prototype.toString){e.push("toString")}if(k.valueOf!=Object.prototype.valueOf){e.push("valueOf")}}for(var d=0,g=e.length;d<g;d++){var j=e[d],h=k[j];if(f&&Object.isFunction(h)&&h.argumentNames().first()=="$super"){var l=h;h=(function(i){return function(){return f[i].apply(this,arguments)}})(j).wrap(l);h.valueOf=l.valueOf.bind(l);h.toString=l.toString.bind(l)}this.prototype[j]=h}return this}return{create:b,Methods:{addMethods:c}}})();(function(){var d=Object.prototype.toString;function i(q,s){for(var r in s){q[r]=s[r]}return q}function l(q){try{if(e(q)){return"undefined"}if(q===null){return"null"}return q.inspect?q.inspect():String(q)}catch(r){if(r instanceof RangeError){return"..."}throw r}}function k(q){var s=typeof q;switch(s){case"undefined":case"function":case"unknown":return;case"boolean":return q.toString()}if(q===null){return"null"}if(q.toJSON){return q.toJSON()}if(h(q)){return}var r=[];for(var u in q){var t=k(q[u]);if(!e(t)){r.push(u.toJSON()+": "+t)}}return"{"+r.join(", ")+"}"}function c(q){return $H(q).toQueryString()}function f(q){return q&&q.toHTML?q.toHTML():String.interpret(q)}function o(q){var r=[];for(var s in q){r.push(s)}return r}function m(q){var r=[];for(var s in q){r.push(q[s])}return r}function j(q){return i({},q)}function h(q){return !!(q&&q.nodeType==1)}function g(q){return d.call(q)=="[object Array]"}function p(q){return q instanceof Hash}function b(q){return typeof q==="function"}function a(q){return d.call(q)=="[object String]"}function n(q){return d.call(q)=="[object Number]"}function e(q){return typeof q==="undefined"}i(Object,{extend:i,inspect:l,toJSON:k,toQueryString:c,toHTML:f,keys:o,values:m,clone:j,isElement:h,isArray:g,isHash:p,isFunction:b,isString:a,isNumber:n,isUndefined:e})})();Object.extend(Function.prototype,(function(){var k=Array.prototype.slice;function d(o,l){var n=o.length,m=l.length;while(m--){o[n+m]=l[m]}return o}function i(m,l){m=k.call(m,0);return d(m,l)}function g(){var l=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\ | clear: function(element) { $(element).value = ''; return element; }, |
} | }, | clearClassNames: function() { // now, buffer the command. var len = this.length, i; for (i = 0; i < len; i++) { var buffer = jQuery.Buffer.bufferForElement(this[i]); buffer.clearClassNames(); } return this; } |
c,a){this.editor.replaceChars(e,c,a)},getSearchCursor:function(e,c,a){return this.editor.getSearchCursor(e,c,a)},undo:function(){this.editor.history.undo()},redo:function(){this.editor.history.redo()},historySize:function(){return this.editor.history.historySize()},clearHistory:function(){this.editor.history.clear()},grabKeys:function(e,c){this.editor.grabKeys(e,c)},ungrabKeys:function(){this.editor.ungrabKeys()},setParser:function(e,c){this.editor.setParser(e,c)},setSpellcheck:function(e){this.win.document.body.spellcheck= | b,c){this.editor.replaceChars(a,b,c)},getSearchCursor:function(a,b,c){return this.editor.getSearchCursor(a,b,c)},undo:function(){this.editor.history.undo()},redo:function(){this.editor.history.redo()},historySize:function(){return this.editor.history.historySize()},clearHistory:function(){this.editor.history.clear()},grabKeys:function(a,b){this.editor.grabKeys(a,b)},ungrabKeys:function(){this.editor.ungrabKeys()},setParser:function(a,b){this.editor.setParser(a,b)},setSpellcheck:function(a){this.win.document.body.spellcheck= | c,a){this.editor.replaceChars(e,c,a)},getSearchCursor:function(e,c,a){return this.editor.getSearchCursor(e,c,a)},undo:function(){this.editor.history.undo()},redo:function(){this.editor.history.redo()},historySize:function(){return this.editor.history.historySize()},clearHistory:function(){this.editor.history.clear()},grabKeys:function(e,c){this.editor.grabKeys(e,c)},ungrabKeys:function(){this.editor.ungrabKeys()},setParser:function(e,c){this.editor.setParser(e,c)},setSpellcheck:function(e){this.win.document.body.spellcheck= |
var today = new Date(); | function clearInput() { var today = new Date(); resetHintTextboxes(); if(getCurrentPane() == "input") { var form = document.forms["inputform"]; form.src_date.value = today.getFullYear()+ "-" + (today.getMonth() + 1) + "-" + today.getDate(); form.src_date.focus(); form.src_apid.value = 0; form.dst_apid.value = 0; form.dst_days.value = ""; clearTimes(); $('duration').value = ""; $('duration').style.color = "#000"; $('distance').value = ""; $('distance').style.color = "#000"; form.number.value = ""; form.airlineid.value = 0; form.seat.value = ""; form.seat_type.selectedIndex = 0; form.mode.selectedIndex = 0; changeMode("F"); form.plane_id.value = ""; form.registration.value = ""; form.note.value = ""; if(form.trips) form.trips.selectedIndex = 0; } else { var form = document.forms["multiinputform"]; for(i = 0; i < multiinput_ids.length; i++) { $(multiinput_ids[i]).value = 0; } form.src_date1.value = today.getFullYear()+ "-" + (today.getMonth() + 1) + "-" + today.getDate(); form.src_ap1.focus(); form.src_ap1.style.color = '#000000'; } for(ac = 0; ac < ac_airport.length; ac++) { $(ac_airport[ac]).autocompleted = false; } for(ac = 0; ac < ac_airline.length; ac++) { $(ac_airline[ac]).autocompleted = false; } for(ac = 0; ac < ac_plane.length; ac++) { $(ac_plane[ac]).autocompleted = false; } unmarkAirports(); setCommitAllowed(false);} |
|
form.src_date.value = today.getFullYear()+ "-" + (today.getMonth() + 1) + "-" + today.getDate(); | form.src_date.value = todayString(); | function clearInput() { var today = new Date(); resetHintTextboxes(); if(getCurrentPane() == "input") { var form = document.forms["inputform"]; form.src_date.value = today.getFullYear()+ "-" + (today.getMonth() + 1) + "-" + today.getDate(); form.src_date.focus(); form.src_apid.value = 0; form.dst_apid.value = 0; form.dst_days.value = ""; clearTimes(); $('duration').value = ""; $('duration').style.color = "#000"; $('distance').value = ""; $('distance').style.color = "#000"; form.number.value = ""; form.airlineid.value = 0; form.seat.value = ""; form.seat_type.selectedIndex = 0; form.mode.selectedIndex = 0; changeMode("F"); form.plane_id.value = ""; form.registration.value = ""; form.note.value = ""; if(form.trips) form.trips.selectedIndex = 0; } else { var form = document.forms["multiinputform"]; for(i = 0; i < multiinput_ids.length; i++) { $(multiinput_ids[i]).value = 0; } form.src_date1.value = today.getFullYear()+ "-" + (today.getMonth() + 1) + "-" + today.getDate(); form.src_ap1.focus(); form.src_ap1.style.color = '#000000'; } for(ac = 0; ac < ac_airport.length; ac++) { $(ac_airport[ac]).autocompleted = false; } for(ac = 0; ac < ac_airline.length; ac++) { $(ac_airline[ac]).autocompleted = false; } for(ac = 0; ac < ac_plane.length; ac++) { $(ac_plane[ac]).autocompleted = false; } unmarkAirports(); setCommitAllowed(false);} |
form.src_date1.value = today.getFullYear()+ "-" + (today.getMonth() + 1) + "-" + today.getDate(); | form.src_date1.value = todayString(); | function clearInput() { var today = new Date(); resetHintTextboxes(); if(getCurrentPane() == "input") { var form = document.forms["inputform"]; form.src_date.value = today.getFullYear()+ "-" + (today.getMonth() + 1) + "-" + today.getDate(); form.src_date.focus(); form.src_apid.value = 0; form.dst_apid.value = 0; form.dst_days.value = ""; clearTimes(); $('duration').value = ""; $('duration').style.color = "#000"; $('distance').value = ""; $('distance').style.color = "#000"; form.number.value = ""; form.airlineid.value = 0; form.seat.value = ""; form.seat_type.selectedIndex = 0; form.mode.selectedIndex = 0; changeMode("F"); form.plane_id.value = ""; form.registration.value = ""; form.note.value = ""; if(form.trips) form.trips.selectedIndex = 0; } else { var form = document.forms["multiinputform"]; for(i = 0; i < multiinput_ids.length; i++) { $(multiinput_ids[i]).value = 0; } form.src_date1.value = today.getFullYear()+ "-" + (today.getMonth() + 1) + "-" + today.getDate(); form.src_ap1.focus(); form.src_ap1.style.color = '#000000'; } for(ac = 0; ac < ac_airport.length; ac++) { $(ac_airport[ac]).autocompleted = false; } for(ac = 0; ac < ac_airline.length; ac++) { $(ac_airline[ac]).autocompleted = false; } for(ac = 0; ac < ac_plane.length; ac++) { $(ac_plane[ac]).autocompleted = false; } unmarkAirports(); setCommitAllowed(false);} |
changeMode(); | function clearSearch() { var form = document.forms['searchform']; form.name.value = ""; form.country.selectedIndex = 0; form.active.selectedIndex = 0; form.mode.selectedIndex = 0; form.iata.value = ""; form.icao.value = ""; form.alias.value = ""; form.callsign.value = ""; form.iatafilter.checked = true; form.alid.value = "";} |
|
if(mod.alt || mod.meta){ | if(mod.alt){ | clicked: function(ev){ var mod = ev.modifier(); if(mod.alt || mod.meta){ this.quick(ev); } else { this.toggle(); } }, |
url.path = url.path.replace(/[^\/]+\/?$/, ""); | url.path = url.path.replace(/[^\/]+\/*$/, ""); | climbUrlPath: function (count) { let url = util.newURI(buffer.URL); dactyl.assert(url instanceof Ci.nsIURL); while (count-- && url.path != "/") url.path = url.path.replace(/[^\/]+\/?$/, ""); dactyl.assert(url.spec != buffer.URL); dactyl.open(url.spec); }, |
return { left: 0, top: 0, width: this.get('calculatedWidth'), height: this.get('calculatedHeight') }; | var ret = sc_super(), cw = this.get('calculatedWidth'), ch = this.get('calculatedHeight'); if(cw) ret.width = cw; if(ch) ret.height = ch; return ret; | clippingFrame: function() { return { left: 0, top: 0, width: this.get('calculatedWidth'), height: this.get('calculatedHeight') }; }.property('calculatedWidth', 'calculatedHeight'), |
"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ga,"").replace(Y,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ta(this,b);ta(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType=== | return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja, | "after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ga,"").replace(Y,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ta(this,b);ta(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType=== |
clone: function(source, target, options) { options = options || { }; return Element.clonePosition(target, source, options); } | var Prototype={Version:"1.6.1",Browser:(function(){var b=navigator.userAgent;var a=Object.prototype.toString.call(window.opera)=="[object Opera]";return{IE:!!window.attachEvent&&!a,Opera:a,WebKit:b.indexOf("AppleWebKit/")>-1,Gecko:b.indexOf("Gecko")>-1&&b.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile.*Safari/.test(b)}})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var a=window.Element||window.HTMLElement;return !!(a&&a.prototype)})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=="undefined"){return true}var c=document.createElement("div");var b=document.createElement("form");var a=false;if(c.__proto__&&(c.__proto__!==b.__proto__)){a=true}c=b=null;return a})()},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Abstract={};var Try={these:function(){var c;for(var b=0,d=arguments.length;b<d;b++){var a=arguments[b];try{c=a();break}catch(f){}}return c}};var Class=(function(){function a(){}function b(){var g=null,f=$A(arguments);if(Object.isFunction(f[0])){g=f.shift()}function d(){this.initialize.apply(this,arguments)}Object.extend(d,Class.Methods);d.superclass=g;d.subclasses=[];if(g){a.prototype=g.prototype;d.prototype=new a;g.subclasses.push(d)}for(var e=0;e<f.length;e++){d.addMethods(f[e])}if(!d.prototype.initialize){d.prototype.initialize=Prototype.emptyFunction}d.prototype.constructor=d;return d}function c(k){var f=this.superclass&&this.superclass.prototype;var e=Object.keys(k);if(!Object.keys({toString:true}).length){if(k.toString!=Object.prototype.toString){e.push("toString")}if(k.valueOf!=Object.prototype.valueOf){e.push("valueOf")}}for(var d=0,g=e.length;d<g;d++){var j=e[d],h=k[j];if(f&&Object.isFunction(h)&&h.argumentNames().first()=="$super"){var l=h;h=(function(i){return function(){return f[i].apply(this,arguments)}})(j).wrap(l);h.valueOf=l.valueOf.bind(l);h.toString=l.toString.bind(l)}this.prototype[j]=h}return this}return{create:b,Methods:{addMethods:c}}})();(function(){var d=Object.prototype.toString;function i(q,s){for(var r in s){q[r]=s[r]}return q}function l(q){try{if(e(q)){return"undefined"}if(q===null){return"null"}return q.inspect?q.inspect():String(q)}catch(r){if(r instanceof RangeError){return"..."}throw r}}function k(q){var s=typeof q;switch(s){case"undefined":case"function":case"unknown":return;case"boolean":return q.toString()}if(q===null){return"null"}if(q.toJSON){return q.toJSON()}if(h(q)){return}var r=[];for(var u in q){var t=k(q[u]);if(!e(t)){r.push(u.toJSON()+": "+t)}}return"{"+r.join(", ")+"}"}function c(q){return $H(q).toQueryString()}function f(q){return q&&q.toHTML?q.toHTML():String.interpret(q)}function o(q){var r=[];for(var s in q){r.push(s)}return r}function m(q){var r=[];for(var s in q){r.push(q[s])}return r}function j(q){return i({},q)}function h(q){return !!(q&&q.nodeType==1)}function g(q){return d.call(q)=="[object Array]"}function p(q){return q instanceof Hash}function b(q){return typeof q==="function"}function a(q){return d.call(q)=="[object String]"}function n(q){return d.call(q)=="[object Number]"}function e(q){return typeof q==="undefined"}i(Object,{extend:i,inspect:l,toJSON:k,toQueryString:c,toHTML:f,keys:o,values:m,clone:j,isElement:h,isArray:g,isHash:p,isFunction:b,isString:a,isNumber:n,isUndefined:e})})();Object.extend(Function.prototype,(function(){var k=Array.prototype.slice;function d(o,l){var n=o.length,m=l.length;while(m--){o[n+m]=l[m]}return o}function i(m,l){m=k.call(m,0);return d(m,l)}function g(){var l=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\ | clone: function(source, target, options) { options = options || { }; return Element.clonePosition(target, source, options); } |
clonePosition: function(element, source) { var options = Object.extend({ setLeft: true, setTop: true, setWidth: true, setHeight: true, offsetTop: 0, offsetLeft: 0 }, arguments[2] || { }); source = $(source); var p = source.viewportOffset(); element = $(element); var delta = [0, 0]; var parent = null; if (Element.getStyle(element, 'position') == 'absolute') { parent = element.getOffsetParent(); delta = parent.viewportOffset(); } if (parent == document.body) { delta[0] -= document.body.offsetLeft; delta[1] -= document.body.offsetTop; } if (options.setLeft) element.style.left = (p[0] - delta[0] + options.offsetLeft) + 'px'; if (options.setTop) element.style.top = (p[1] - delta[1] + options.offsetTop) + 'px'; if (options.setWidth) element.style.width = source.offsetWidth + 'px'; if (options.setHeight) element.style.height = source.offsetHeight + 'px'; return element; } | var Prototype={Version:"1.6.1",Browser:(function(){var b=navigator.userAgent;var a=Object.prototype.toString.call(window.opera)=="[object Opera]";return{IE:!!window.attachEvent&&!a,Opera:a,WebKit:b.indexOf("AppleWebKit/")>-1,Gecko:b.indexOf("Gecko")>-1&&b.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile.*Safari/.test(b)}})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var a=window.Element||window.HTMLElement;return !!(a&&a.prototype)})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=="undefined"){return true}var c=document.createElement("div");var b=document.createElement("form");var a=false;if(c.__proto__&&(c.__proto__!==b.__proto__)){a=true}c=b=null;return a})()},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Abstract={};var Try={these:function(){var c;for(var b=0,d=arguments.length;b<d;b++){var a=arguments[b];try{c=a();break}catch(f){}}return c}};var Class=(function(){function a(){}function b(){var g=null,f=$A(arguments);if(Object.isFunction(f[0])){g=f.shift()}function d(){this.initialize.apply(this,arguments)}Object.extend(d,Class.Methods);d.superclass=g;d.subclasses=[];if(g){a.prototype=g.prototype;d.prototype=new a;g.subclasses.push(d)}for(var e=0;e<f.length;e++){d.addMethods(f[e])}if(!d.prototype.initialize){d.prototype.initialize=Prototype.emptyFunction}d.prototype.constructor=d;return d}function c(k){var f=this.superclass&&this.superclass.prototype;var e=Object.keys(k);if(!Object.keys({toString:true}).length){if(k.toString!=Object.prototype.toString){e.push("toString")}if(k.valueOf!=Object.prototype.valueOf){e.push("valueOf")}}for(var d=0,g=e.length;d<g;d++){var j=e[d],h=k[j];if(f&&Object.isFunction(h)&&h.argumentNames().first()=="$super"){var l=h;h=(function(i){return function(){return f[i].apply(this,arguments)}})(j).wrap(l);h.valueOf=l.valueOf.bind(l);h.toString=l.toString.bind(l)}this.prototype[j]=h}return this}return{create:b,Methods:{addMethods:c}}})();(function(){var d=Object.prototype.toString;function i(q,s){for(var r in s){q[r]=s[r]}return q}function l(q){try{if(e(q)){return"undefined"}if(q===null){return"null"}return q.inspect?q.inspect():String(q)}catch(r){if(r instanceof RangeError){return"..."}throw r}}function k(q){var s=typeof q;switch(s){case"undefined":case"function":case"unknown":return;case"boolean":return q.toString()}if(q===null){return"null"}if(q.toJSON){return q.toJSON()}if(h(q)){return}var r=[];for(var u in q){var t=k(q[u]);if(!e(t)){r.push(u.toJSON()+": "+t)}}return"{"+r.join(", ")+"}"}function c(q){return $H(q).toQueryString()}function f(q){return q&&q.toHTML?q.toHTML():String.interpret(q)}function o(q){var r=[];for(var s in q){r.push(s)}return r}function m(q){var r=[];for(var s in q){r.push(q[s])}return r}function j(q){return i({},q)}function h(q){return !!(q&&q.nodeType==1)}function g(q){return d.call(q)=="[object Array]"}function p(q){return q instanceof Hash}function b(q){return typeof q==="function"}function a(q){return d.call(q)=="[object String]"}function n(q){return d.call(q)=="[object Number]"}function e(q){return typeof q==="undefined"}i(Object,{extend:i,inspect:l,toJSON:k,toQueryString:c,toHTML:f,keys:o,values:m,clone:j,isElement:h,isArray:g,isHash:p,isFunction:b,isString:a,isNumber:n,isUndefined:e})})();Object.extend(Function.prototype,(function(){var k=Array.prototype.slice;function d(o,l){var n=o.length,m=l.length;while(m--){o[n+m]=l[m]}return o}function i(m,l){m=k.call(m,0);return d(m,l)}function g(){var l=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\ | clonePosition: function(element, source) { var options = Object.extend({ setLeft: true, setTop: true, setWidth: true, setHeight: true, offsetTop: 0, offsetLeft: 0 }, arguments[2] || { }); // find page position of source source = $(source); var p = source.viewportOffset(); // find coordinate system to use element = $(element); var delta = [0, 0]; var parent = null; // delta [0,0] will do fine with position: fixed elements, // position:absolute needs offsetParent deltas if (Element.getStyle(element, 'position') == 'absolute') { parent = element.getOffsetParent(); delta = parent.viewportOffset(); } // correct by body offsets (fixes Safari) if (parent == document.body) { delta[0] -= document.body.offsetLeft; delta[1] -= document.body.offsetTop; } // set position if (options.setLeft) element.style.left = (p[0] - delta[0] + options.offsetLeft) + 'px'; if (options.setTop) element.style.top = (p[1] - delta[1] + options.offsetTop) + 'px'; if (options.setWidth) element.style.width = source.offsetWidth + 'px'; if (options.setHeight) element.style.height = source.offsetHeight + 'px'; return element; } |
if(currentPane == "input" || currentPane == "multiinput") { | if(isEditMode()) { | function closePane() { if(paneStack.length == 1) return; var currentPane = paneStack.pop(); var lastPane = getCurrentPane(); if(currentPane == "input" || currentPane == "multiinput") { unmarkAirports(); $("newairport").style.display = 'none'; $("qsmini").style.display = 'block'; } if(currentPane == "result") { apid = 0; } $(currentPane).style.display = 'none'; $(lastPane).style.display = 'inline'; // If ad pane is now displayed, refresh it if(paneStack.length == 1 && paneStack[0] == "ad") refreshAd();} |
var currentPane = paneStack.pop(); var lastPane = getCurrentPane(); | function closePane() { if(paneStack.length == 1) return; var currentPane = paneStack.pop(); var lastPane = getCurrentPane(); if(isEditMode()) { unmarkAirports(); $("newairport").style.display = 'none'; $("qsmini").style.display = 'block'; } if(currentPane == "result") { apid = 0; } $(currentPane).style.display = 'none'; $(lastPane).style.display = 'inline'; // If ad pane is now displayed, refresh it if(paneStack.length == 1 && paneStack[0] == "ad") refreshAd();} |
|
var currentPane = paneStack.pop(); var lastPane = getCurrentPane(); | function closePane() { if(paneStack.length == 1) return; var currentPane = paneStack.pop(); var lastPane = getCurrentPane(); if(isEditMode()) { unmarkAirports(); $("newairport").style.display = 'none'; $("qsmini").style.display = 'block'; } if(currentPane == "result") { apid = 0; } $(currentPane).style.display = 'none'; $(lastPane).style.display = 'inline'; // If ad pane is now displayed, refresh it if(paneStack.length == 1 && paneStack[0] == "ad") refreshAd();} |
|
c.find(a,this[f],b);if(f>0)for(var i=d;i<b.length;i++)for(var j=0;j<d;j++)if(b[j]===b[i]){b.splice(i--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Fa(this,a,false),"not",a)},filter:function(a){return this.pushStack(Fa(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,i= {},j;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){j=a[e];i[j]||(i[j]=c.expr.match.POS.test(j)?c(j,b||this.context):j)}for(;f&&f.ownerDocument&&f!==b;){for(j in i){e=i[j];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:j,elem:f});delete i[j]}}f=f.parentNode}}return d}var p=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,t){for(;t&&t.ownerDocument&&t!==b;){if(p?p.index(t)>-1:c(t).is(a))return t;t=t.parentNode}return null})},index:function(a){if(!a||typeof a=== | c.find(a,this[f],b);if(f>0)for(var j=d;j<b.length;j++)for(var i=0;i<d;i++)if(b[i]===b[j]){b.splice(j--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Ia(this,a,false),"not",a)},filter:function(a){return this.pushStack(Ia(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j= {},i;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){i=a[e];j[i]||(j[i]=c.expr.match.POS.test(i)?c(i,b||this.context):i)}for(;f&&f.ownerDocument&&f!==b;){for(i in j){e=j[i];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a=== | c.find(a,this[f],b);if(f>0)for(var i=d;i<b.length;i++)for(var j=0;j<d;j++)if(b[j]===b[i]){b.splice(i--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Fa(this,a,false),"not",a)},filter:function(a){return this.pushStack(Fa(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,i={},j;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){j=a[e];i[j]||(i[j]=c.expr.match.POS.test(j)?c(j,b||this.context):j)}for(;f&&f.ownerDocument&&f!==b;){for(j in i){e=i[j];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:j,elem:f});delete i[j]}}f=f.parentNode}}return d}var p=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,t){for(;t&&t.ownerDocument&&t!==b;){if(p?p.index(t)>-1:c(t).is(a))return t;t=t.parentNode}return null})},index:function(a){if(!a||typeof a=== |
var cls = function() { if(this.init) { this.init.apply(this, arguments); }} | var cls = function() { if(this.init) { return this.init.apply(this, arguments); }} | var cls = function() { if(this.init) { this.init.apply(this, arguments); }} |
var CodeMirrorConfig=window.CodeMirrorConfig||{},CodeMirror=function(){function i(e,c){for(var a in c)e.hasOwnProperty(a)||(e[a]=c[a])}function p(e,c){for(var a=0;a<e.length;a++)c(e[a])}function k(e,c){var a=document.createElement("DIV"),b=document.createElement("DIV");a.style.position="absolute";a.style.height="100%";if(a.style.setExpression)try{a.style.setExpression("height","this.previousSibling.offsetHeight + 'px'")}catch(d){}a.style.top="0px";a.style.left="0px";a.style.overflow="hidden";e.appendChild(a); b.className="CodeMirror-line-numbers";a.appendChild(b);b.innerHTML="<div>"+c+"</div>";return a}function n(e){if(typeof e.parserfile=="string")e.parserfile=[e.parserfile];if(typeof e.basefiles=="string")e.basefiles=[e.basefiles];if(typeof e.stylesheet=="string")e.stylesheet=[e.stylesheet];var c=['<!DOCTYPE HTML PUBLIC "- a+'"/>')});p(e.basefiles.concat(e.parserfile),function(a){/^https?:/.test(a)||(a=e.path+a);c.push('<script type="text/javascript" src="'+a+(e.noScriptCaching?"?nocache="+(new Date).getTime().toString(16):"")+'"><\/script>')});c.push('</head><body style="border-width: 0;" class="editbox" spellcheck="'+(e.disableSpellcheck?"false":"true")+'"></body></html>');return c.join("")}function o(e,c){this.options=c=c||{};i(c,CodeMirrorConfig);if(c.dumbTabs)c.tabMode="spaces";else if(c.normalTab)c.tabMode="default"; var a=this.frame=document.createElement("IFRAME");if(c.iframeClass)a.className=c.iframeClass;a.frameBorder=0;a.style.border="0";a.style.width="100%";a.style.height="100%";a.style.display="block";var b=this.wrapping=document.createElement("DIV");b.style.position="relative";b.className="CodeMirror-wrapping";b.style.width=c.width;b.style.height=c.height=="dynamic"?c.minHeight+"px":c.height;var d=this.textareaHack=document.createElement("TEXTAREA");b.appendChild(d);d.style.position="absolute";d.style.left= "-10000px";d.style.width="10px";a.CodeMirror=this;if(c.domain&&q){this.html=n(c);a.src="javascript:(function(){document.open();"+(c.domain?'document.domain="'+c.domain+'";':"")+"document.write(window.frameElement.CodeMirror.html);document.close();})()"}else a.src="javascript:;";e.appendChild?e.appendChild(b):e(b);b.appendChild(a);if(c.lineNumbers)this.lineNumbers=k(b,c.firstLineNumber);this.win=a.contentWindow;if(!c.domain||!q){this.win.document.open();this.win.document.write(n(c));this.win.document.close()}} i(CodeMirrorConfig,{stylesheet:[],path:"",parserfile:[],basefiles:["util.js","stringstream.js","select.js","undo.js","editor.js","tokenize.js"],iframeClass:null,passDelay:200,passTime:50,lineNumberDelay:200,lineNumberTime:50,continuousScanning:false,saveFunction:null,onChange:null,undoDepth:50,undoDelay:800,disableSpellcheck:true,textWrapping:true,readOnly:false,width:"",height:"300px",minHeight:100,autoMatchParens:false,parserConfig:null,tabMode:"indent",enterMode:"indent",electricChars:true,reindentOnLoad:false, activeTokens:null,cursorActivity:null,lineNumbers:false,firstLineNumber:1,indentUnit:2,domain:null,noScriptCaching:false});var q=document.selection&&window.ActiveXObject&&/MSIE/.test(navigator.userAgent);o.prototype={init:function(){this.options.initCallback&&this.options.initCallback(this);this.options.lineNumbers&&this.activateLineNumbers();this.options.reindentOnLoad&&this.reindent();this.options.height=="dynamic"&&this.setDynamicHeight()},getCode:function(){return this.editor.getCode()},setCode:function(e){this.editor.importCode(e)}, selection:function(){this.focusIfIE();return this.editor.selectedText()},reindent:function(){this.editor.reindent()},reindentSelection:function(){this.focusIfIE();this.editor.reindentSelection(null)},focusIfIE:function(){this.win.select.ie_selection&&this.focus()},focus:function(){this.win.focus();this.editor.selectionSnapshot&&this.win.select.setBookmark(this.win.document.body,this.editor.selectionSnapshot)},replaceSelection:function(e){this.focus();this.editor.replaceSelection(e);return true},replaceChars:function(e, c,a){this.editor.replaceChars(e,c,a)},getSearchCursor:function(e,c,a){return this.editor.getSearchCursor(e,c,a)},undo:function(){this.editor.history.undo()},redo:function(){this.editor.history.redo()},historySize:function(){return this.editor.history.historySize()},clearHistory:function(){this.editor.history.clear()},grabKeys:function(e,c){this.editor.grabKeys(e,c)},ungrabKeys:function(){this.editor.ungrabKeys()},setParser:function(e,c){this.editor.setParser(e,c)},setSpellcheck:function(e){this.win.document.body.spellcheck= e},setStylesheet:function(e){if(typeof e==="string")e=[e];for(var c={},a={},b=this.win.document.getElementsByTagName("link"),d=0,f;f=b[d];d++)if(f.rel.indexOf("stylesheet")!==-1)for(var g=0;g<e.length;g++){var h=e[g];if(f.href.substring(f.href.length-h.length)===h){c[f.href]=true;a[h]=true}}for(d=0;f=b[d];d++)if(f.rel.indexOf("stylesheet")!==-1)f.disabled=!(f.href in c);for(g=0;g<e.length;g++){h=e[g];if(!(h in a)){f=this.win.document.createElement("link");f.rel="stylesheet";f.type="text/css";f.href= h;this.win.document.getElementsByTagName("head")[0].appendChild(f)}}},setTextWrapping:function(e){if(e!=this.options.textWrapping){this.win.document.body.style.whiteSpace=e?"":"nowrap";this.options.textWrapping=e;if(this.lineNumbers){this.setLineNumbers(false);this.setLineNumbers(true)}}},setIndentUnit:function(e){this.win.indentUnit=e},setUndoDepth:function(e){this.editor.history.maxDepth=e},setTabMode:function(e){this.options.tabMode=e},setEnterMode:function(e){this.options.enterMode=e},setLineNumbers:function(e){if(e&& !this.lineNumbers){this.lineNumbers=k(this.wrapping,this.options.firstLineNumber);this.activateLineNumbers()}else if(!e&&this.lineNumbers){this.wrapping.removeChild(this.lineNumbers);this.wrapping.style.paddingLeft="";this.lineNumbers=null}},cursorPosition:function(e){this.focusIfIE();return this.editor.cursorPosition(e)},firstLine:function(){return this.editor.firstLine()},lastLine:function(){return this.editor.lastLine()},nextLine:function(e){return this.editor.nextLine(e)},prevLine:function(e){return this.editor.prevLine(e)}, lineContent:function(e){return this.editor.lineContent(e)},setLineContent:function(e,c){this.editor.setLineContent(e,c)},removeLine:function(e){this.editor.removeLine(e)},insertIntoLine:function(e,c,a){this.editor.insertIntoLine(e,c,a)},selectLines:function(e,c,a,b){this.win.focus();this.editor.selectLines(e,c,a,b)},nthLine:function(e){for(var c=this.firstLine();e>1&&c!==false;e--)c=this.nextLine(c);return c},lineNumber:function(e){for(var c=0;e!==false;){c++;e=this.prevLine(e)}return c},jumpToLine:function(e){if(typeof e== "number")e=this.nthLine(e);this.selectLines(e,0);this.win.focus()},currentLine:function(){return this.lineNumber(this.cursorLine())},cursorLine:function(){return this.cursorPosition().line},cursorCoords:function(e){return this.editor.cursorCoords(e)},activateLineNumbers:function(){function e(){if(f.offsetWidth!=0){for(var y=f;y.parentNode;y=y.parentNode);if(!l.parentNode||y!=document||!g.Editor){try{w()}catch(A){}clearInterval(x)}else if(l.offsetWidth!=u){u=l.offsetWidth;f.parentNode.style.paddingLeft= u+"px"}}}function c(){l.scrollTop=j.scrollTop||h.documentElement.scrollTop||0}function a(y){var A=m.firstChild.offsetHeight;if(A!=0){A=Math.ceil((50+Math.max(j.offsetHeight,Math.max(f.offsetHeight,j.scrollHeight||0)))/A);for(var v=m.childNodes.length;v<=A;v++){var z=document.createElement("DIV");z.appendChild(document.createTextNode(y?String(v+r.options.firstLineNumber):"\u00a0"));m.appendChild(z)}}}function b(){function y(){a(true);c()}r.updateNumbers=y;var A=g.addEventHandler(g,"scroll",c,true), v=g.addEventHandler(g,"resize",y,true);w=function(){A();v();if(r.updateNumbers==y)r.updateNumbers=null};y()}function d(){function y(J,K){E||(E=m.appendChild(document.createElement("DIV")));D&&D(E,K,J);B.push(E);B.push(J);N=E.offsetHeight+E.offsetTop;E=E.nextSibling}function A(){for(var J=0;J<B.length;J+=2)B[J].innerHTML=B[J+1];B=[]}function v(){if(!(!m.parentNode||m.parentNode!=r.lineNumbers)){for(var J=(new Date).getTime()+r.options.lineNumberTime;H;){for(y(O++,H.previousSibling);H&&!g.isBR(H);H= H.nextSibling)for(var K=H.offsetTop+H.offsetHeight;m.offsetHeight&&K-3>N;)y(" ");if(H)H=H.nextSibling;if((new Date).getTime()>J){A();G=setTimeout(v,r.options.lineNumberDelay);return}}for(;E;)y(O++);A();c()}}function z(J){c();a(J);H=j.firstChild;E=m.firstChild;N=0;O=r.options.firstLineNumber;v()}function L(){G&&clearTimeout(G);if(r.editor.allClean())z();else G=setTimeout(L,200)}var H,E,O,N,B=[],D=r.options.styleNumbers;z(true);var G=null;r.updateNumbers=L;var F=g.addEventHandler(g,"scroll",c, true),M=g.addEventHandler(g,"resize",L,true);w=function(){G&&clearTimeout(G);if(r.updateNumbers==L)r.updateNumbers=null;F();M()}}var f=this.frame,g=f.contentWindow,h=g.document,j=h.body,l=this.lineNumbers,m=l.firstChild,r=this,u=null,w=function(){};e();var x=setInterval(e,500);(this.options.textWrapping||this.options.styleNumbers?d:b)()},setDynamicHeight:function(){function e(){for(var j=0,l=d.lastChild,m;l&&b.isBR(l);){l.hackBR||j++;l=l.previousSibling}if(l){f=l.offsetHeight;m=l.offsetTop+(1+j)* f}else if(f)m=j*f;if(m)c.wrapping.style.height=Math.max(h+m,c.options.minHeight)+"px"}var c=this,a=c.options.cursorActivity,b=c.win,d=b.document.body,f=null,g=null,h=2*c.frame.offsetTop;d.style.overflowY="hidden";b.document.documentElement.style.overflowY="hidden";this.frame.scrolling="no";setTimeout(e,300);c.options.cursorActivity=function(j){a&&a(j);clearTimeout(g);g=setTimeout(e,100)}}};o.InvalidLineHandle={toString:function(){return"CodeMirror.InvalidLineHandle"}};o.replace=function(e){if(typeof e== "string")e=document.getElementById(e);return function(c){e.parentNode.replaceChild(c,e)}};o.fromTextArea=function(e,c){if(typeof e=="string")e=document.getElementById(e);c=c||{};if(e.style.width&&c.width==null)c.width=e.style.width;if(e.style.height&&c.height==null)c.height=e.style.height;if(c.content==null)c.content=e.value;if(e.form){var a=function(){e.value=f.getCode()};typeof e.form.addEventListener=="function"?e.form.addEventListener("submit",a,false):e.form.attachEvent("onsubmit",a);var b=e.form.submit, d=function(){a();e.form.submit=b;e.form.submit();e.form.submit=d};e.form.submit=d}e.style.display="none";var f=new o(function(g){e.nextSibling?e.parentNode.insertBefore(g,e.nextSibling):e.parentNode.appendChild(g)},c);f.toTextArea=function(){a();e.parentNode.removeChild(f.wrapping);e.style.display="";if(e.form){e.form.submit=b;typeof e.form.removeEventListener=="function"?e.form.removeEventListener("submit",a,false):e.form.detachEvent("onsubmit",a)}};return f};o.isProbablySupported=function(){var e; return window.opera?Number(window.opera.version())>=9.52:/Apple Computers, Inc/.test(navigator.vendor)&&(e=navigator.userAgent.match(/Version\/(\d+(?:\.\d+)?)\./))?Number(e[1])>=3:document.selection&&window.ActiveXObject&&(e=navigator.userAgent.match(/MSIE (\d+(?:\.\d*)?)\b/))?Number(e[1])>=6:(e=navigator.userAgent.match(/gecko\/(\d{8})/i))?Number(e[1])>=20050901:(e=navigator.userAgent.match(/AppleWebKit\/(\d+)/))?Number(e[1])>=525:null};return o}();function method(i,p){return function(){i[p].apply(i,arguments)}}var StopIteration={toString:function(){return"StopIteration"}};function forEach(i,p){if(i.next)try{for(;;)p(i.next())}catch(k){if(k!=StopIteration)throw k;}else for(var n=0;n<i.length;n++)p(i[n])}function map(i,p){var k=[];forEach(i,function(n){k.push(p(n))});return k}function matcher(i){return function(p){return i.test(p)}}function hasClass(i,p){var k=i.className;return k&&RegExp("(^| )"+p+"($| )").test(k)} | var CodeMirrorConfig=window.CodeMirrorConfig||{},CodeMirror=function(){function C(a,b){for(var c in b)a.hasOwnProperty(c)||(a[c]=b[c])}function D(a,b){for(var c=0;c<a.length;c++)b(a[c])}function E(a,b){var c=document.createElement("DIV"),e=document.createElement("DIV");c.style.position="absolute";c.style.height="100%";if(c.style.setExpression)try{c.style.setExpression("height","this.previousSibling.offsetHeight + 'px'")}catch(g){}c.style.top="0px";c.style.left="0px";c.style.overflow="hidden";a.appendChild(c); e.className="CodeMirror-line-numbers";c.appendChild(e);e.innerHTML="<div>"+b+"</div>";return c}function F(a){if(typeof a.parserfile=="string")a.parserfile=[a.parserfile];if(typeof a.basefiles=="string")a.basefiles=[a.basefiles];if(typeof a.stylesheet=="string")a.stylesheet=[a.stylesheet];var b=['<!DOCTYPE HTML PUBLIC "- c+'"/>')});D(a.basefiles.concat(a.parserfile),function(c){/^https?:/.test(c)||(c=a.path+c);b.push('<script type="text/javascript" src="'+c+(a.noScriptCaching?"?nocache="+(new Date).getTime().toString(16):"")+'"><\/script>')});b.push('</head><body style="border-width: 0;" class="editbox" spellcheck="'+(a.disableSpellcheck?"false":"true")+'"></body></html>');return b.join("")}function s(a,b){this.options=b=b||{};C(b,CodeMirrorConfig);if(b.dumbTabs)b.tabMode="spaces";else if(b.normalTab)b.tabMode="default"; var c=this.frame=document.createElement("IFRAME");if(b.iframeClass)c.className=b.iframeClass;c.frameBorder=0;c.style.border="0";c.style.width="100%";c.style.height="100%";c.style.display="block";var e=this.wrapping=document.createElement("DIV");e.style.position="relative";e.className="CodeMirror-wrapping";e.style.width=b.width;e.style.height=b.height=="dynamic"?b.minHeight+"px":b.height;var g=this.textareaHack=document.createElement("TEXTAREA");e.appendChild(g);g.style.position="absolute";g.style.left= "-10000px";g.style.width="10px";c.CodeMirror=this;if(b.domain&&G){this.html=F(b);c.src="javascript:(function(){document.open();"+(b.domain?'document.domain="'+b.domain+'";':"")+"document.write(window.frameElement.CodeMirror.html);document.close();})()"}else c.src="javascript:;";a.appendChild?a.appendChild(e):a(e);e.appendChild(c);if(b.lineNumbers)this.lineNumbers=E(e,b.firstLineNumber);this.win=c.contentWindow;if(!b.domain||!G){this.win.document.open();this.win.document.write(F(b));this.win.document.close()}} C(CodeMirrorConfig,{stylesheet:[],path:"",parserfile:[],basefiles:["util.js","stringstream.js","select.js","undo.js","editor.js","tokenize.js"],iframeClass:null,passDelay:200,passTime:50,lineNumberDelay:200,lineNumberTime:50,continuousScanning:false,saveFunction:null,onChange:null,undoDepth:50,undoDelay:800,disableSpellcheck:true,textWrapping:true,readOnly:false,width:"",height:"300px",minHeight:100,autoMatchParens:false,parserConfig:null,tabMode:"indent",enterMode:"indent",electricChars:true,reindentOnLoad:false, activeTokens:null,cursorActivity:null,lineNumbers:false,firstLineNumber:1,indentUnit:2,domain:null,noScriptCaching:false});var G=document.selection&&window.ActiveXObject&&/MSIE/.test(navigator.userAgent);s.prototype={init:function(){this.options.initCallback&&this.options.initCallback(this);this.options.lineNumbers&&this.activateLineNumbers();this.options.reindentOnLoad&&this.reindent();this.options.height=="dynamic"&&this.setDynamicHeight()},getCode:function(){return this.editor.getCode()},setCode:function(a){this.editor.importCode(a)}, selection:function(){this.focusIfIE();return this.editor.selectedText()},reindent:function(){this.editor.reindent()},reindentSelection:function(){this.focusIfIE();this.editor.reindentSelection(null)},focusIfIE:function(){this.win.select.ie_selection&&this.focus()},focus:function(){this.win.focus();this.editor.selectionSnapshot&&this.win.select.setBookmark(this.win.document.body,this.editor.selectionSnapshot)},replaceSelection:function(a){this.focus();this.editor.replaceSelection(a);return true},replaceChars:function(a, b,c){this.editor.replaceChars(a,b,c)},getSearchCursor:function(a,b,c){return this.editor.getSearchCursor(a,b,c)},undo:function(){this.editor.history.undo()},redo:function(){this.editor.history.redo()},historySize:function(){return this.editor.history.historySize()},clearHistory:function(){this.editor.history.clear()},grabKeys:function(a,b){this.editor.grabKeys(a,b)},ungrabKeys:function(){this.editor.ungrabKeys()},setParser:function(a,b){this.editor.setParser(a,b)},setSpellcheck:function(a){this.win.document.body.spellcheck= a},setStylesheet:function(a){if(typeof a==="string")a=[a];for(var b={},c={},e=this.win.document.getElementsByTagName("link"),g=0,d;d=e[g];g++)if(d.rel.indexOf("stylesheet")!==-1)for(var f=0;f<a.length;f++){var m=a[f];if(d.href.substring(d.href.length-m.length)===m){b[d.href]=true;c[m]=true}}for(g=0;d=e[g];g++)if(d.rel.indexOf("stylesheet")!==-1)d.disabled=!(d.href in b);for(f=0;f<a.length;f++){m=a[f];if(!(m in c)){d=this.win.document.createElement("link");d.rel="stylesheet";d.type="text/css";d.href= m;this.win.document.getElementsByTagName("head")[0].appendChild(d)}}},setTextWrapping:function(a){if(a!=this.options.textWrapping){this.win.document.body.style.whiteSpace=a?"":"nowrap";this.options.textWrapping=a;if(this.lineNumbers){this.setLineNumbers(false);this.setLineNumbers(true)}}},setIndentUnit:function(a){this.win.indentUnit=a},setUndoDepth:function(a){this.editor.history.maxDepth=a},setTabMode:function(a){this.options.tabMode=a},setEnterMode:function(a){this.options.enterMode=a},setLineNumbers:function(a){if(a&& !this.lineNumbers){this.lineNumbers=E(this.wrapping,this.options.firstLineNumber);this.activateLineNumbers()}else if(!a&&this.lineNumbers){this.wrapping.removeChild(this.lineNumbers);this.wrapping.style.paddingLeft="";this.lineNumbers=null}},cursorPosition:function(a){this.focusIfIE();return this.editor.cursorPosition(a)},firstLine:function(){return this.editor.firstLine()},lastLine:function(){return this.editor.lastLine()},nextLine:function(a){return this.editor.nextLine(a)},prevLine:function(a){return this.editor.prevLine(a)}, lineContent:function(a){return this.editor.lineContent(a)},setLineContent:function(a,b){this.editor.setLineContent(a,b)},removeLine:function(a){this.editor.removeLine(a)},insertIntoLine:function(a,b,c){this.editor.insertIntoLine(a,b,c)},selectLines:function(a,b,c,e){this.win.focus();this.editor.selectLines(a,b,c,e)},nthLine:function(a){for(var b=this.firstLine();a>1&&b!==false;a--)b=this.nextLine(b);return b},lineNumber:function(a){for(var b=0;a!==false;){b++;a=this.prevLine(a)}return b},jumpToLine:function(a){if(typeof a== "number")a=this.nthLine(a);this.selectLines(a,0);this.win.focus()},currentLine:function(){return this.lineNumber(this.cursorLine())},cursorLine:function(){return this.cursorPosition().line},cursorCoords:function(a){return this.editor.cursorCoords(a)},activateLineNumbers:function(){function a(){if(d.offsetWidth!=0){for(var h=d;h.parentNode;h=h.parentNode);if(!i.parentNode||h!=document||!f.Editor){try{x()}catch(o){}clearInterval(I)}else if(i.offsetWidth!=y){y=i.offsetWidth;d.parentNode.style.paddingLeft= y+"px"}}}function b(){i.scrollTop=p.scrollTop||m.documentElement.scrollTop||0}function c(h){var o=j.firstChild.offsetHeight;if(o!=0){o=Math.ceil((50+Math.max(p.offsetHeight,Math.max(d.offsetHeight,p.scrollHeight||0)))/o);for(var r=j.childNodes.length;r<=o;r++){var v=document.createElement("DIV");v.appendChild(document.createTextNode(h?String(r+k.options.firstLineNumber):"\u00a0"));j.appendChild(v)}}}function e(){function h(){c(true);b()}k.updateNumbers=h;var o=f.addEventHandler(f,"scroll",b,true), r=f.addEventHandler(f,"resize",h,true);x=function(){o();r();if(k.updateNumbers==h)k.updateNumbers=null};h()}function g(){function h(n,z){q||(q=j.appendChild(document.createElement("DIV")));H&&H(q,z,n);t.push(q);t.push(n);A=q.offsetHeight+q.offsetTop;q=q.nextSibling}function o(){for(var n=0;n<t.length;n+=2)t[n].innerHTML=t[n+1];t=[]}function r(){if(!(!j.parentNode||j.parentNode!=k.lineNumbers)){for(var n=(new Date).getTime()+k.options.lineNumberTime;l;){for(h(B++,l.previousSibling);l&&!f.isBR(l);l= l.nextSibling)for(var z=l.offsetTop+l.offsetHeight;j.offsetHeight&&z-3>A;)h(" ");if(l)l=l.nextSibling;if((new Date).getTime()>n){o();u=setTimeout(r,k.options.lineNumberDelay);return}}for(;q;)h(B++);o();b()}}function v(n){b();c(n);l=p.firstChild;q=j.firstChild;A=0;B=k.options.firstLineNumber;r()}function w(){u&&clearTimeout(u);if(k.editor.allClean())v();else u=setTimeout(w,200)}var l,q,B,A,t=[],H=k.options.styleNumbers;v(true);var u=null;k.updateNumbers=w;var J=f.addEventHandler(f,"scroll",b, true),K=f.addEventHandler(f,"resize",w,true);x=function(){u&&clearTimeout(u);if(k.updateNumbers==w)k.updateNumbers=null;J();K()}}var d=this.frame,f=d.contentWindow,m=f.document,p=m.body,i=this.lineNumbers,j=i.firstChild,k=this,y=null,x=function(){};a();var I=setInterval(a,500);(this.options.textWrapping||this.options.styleNumbers?g:e)()},setDynamicHeight:function(){function a(){for(var p=0,i=g.lastChild,j;i&&e.isBR(i);){i.hackBR||p++;i=i.previousSibling}if(i){d=i.offsetHeight;j=i.offsetTop+(1+p)* d}else if(d)j=p*d;if(j)b.wrapping.style.height=Math.max(m+j,b.options.minHeight)+"px"}var b=this,c=b.options.cursorActivity,e=b.win,g=e.document.body,d=null,f=null,m=2*b.frame.offsetTop;g.style.overflowY="hidden";e.document.documentElement.style.overflowY="hidden";this.frame.scrolling="no";setTimeout(a,300);b.options.cursorActivity=function(p){c&&c(p);clearTimeout(f);f=setTimeout(a,100)}}};s.InvalidLineHandle={toString:function(){return"CodeMirror.InvalidLineHandle"}};s.replace=function(a){if(typeof a== "string")a=document.getElementById(a);return function(b){a.parentNode.replaceChild(b,a)}};s.fromTextArea=function(a,b){if(typeof a=="string")a=document.getElementById(a);b=b||{};if(a.style.width&&b.width==null)b.width=a.style.width;if(a.style.height&&b.height==null)b.height=a.style.height;if(b.content==null)b.content=a.value;if(a.form){var c=function(){a.value=d.getCode()};typeof a.form.addEventListener=="function"?a.form.addEventListener("submit",c,false):a.form.attachEvent("onsubmit",c);var e=a.form.submit, g=function(){c();a.form.submit=e;a.form.submit();a.form.submit=g};a.form.submit=g}a.style.display="none";var d=new s(function(f){a.nextSibling?a.parentNode.insertBefore(f,a.nextSibling):a.parentNode.appendChild(f)},b);d.toTextArea=function(){c();a.parentNode.removeChild(d.wrapping);a.style.display="";if(a.form){a.form.submit=e;typeof a.form.removeEventListener=="function"?a.form.removeEventListener("submit",c,false):a.form.detachEvent("onsubmit",c)}};return d};s.isProbablySupported=function(){var a; return window.opera?Number(window.opera.version())>=9.52:/Apple Computer, Inc/.test(navigator.vendor)&&(a=navigator.userAgent.match(/Version\/(\d+(?:\.\d+)?)\./))?Number(a[1])>=3:document.selection&&window.ActiveXObject&&(a=navigator.userAgent.match(/MSIE (\d+(?:\.\d*)?)\b/))?Number(a[1])>=6:(a=navigator.userAgent.match(/gecko\/(\d{8})/i))?Number(a[1])>=20050901:(a=navigator.userAgent.match(/AppleWebKit\/(\d+)/))?Number(a[1])>=525:null};return s}(); | var CodeMirrorConfig=window.CodeMirrorConfig||{},CodeMirror=function(){function i(e,c){for(var a in c)e.hasOwnProperty(a)||(e[a]=c[a])}function p(e,c){for(var a=0;a<e.length;a++)c(e[a])}function k(e,c){var a=document.createElement("DIV"),b=document.createElement("DIV");a.style.position="absolute";a.style.height="100%";if(a.style.setExpression)try{a.style.setExpression("height","this.previousSibling.offsetHeight + 'px'")}catch(d){}a.style.top="0px";a.style.left="0px";a.style.overflow="hidden";e.appendChild(a);b.className="CodeMirror-line-numbers";a.appendChild(b);b.innerHTML="<div>"+c+"</div>";return a}function n(e){if(typeof e.parserfile=="string")e.parserfile=[e.parserfile];if(typeof e.basefiles=="string")e.basefiles=[e.basefiles];if(typeof e.stylesheet=="string")e.stylesheet=[e.stylesheet];var c=['<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head>'];c.push('<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>');p(e.stylesheet,function(a){c.push('<link rel="stylesheet" type="text/css" href="'+a+'"/>')});p(e.basefiles.concat(e.parserfile),function(a){/^https?:/.test(a)||(a=e.path+a);c.push('<script type="text/javascript" src="'+a+(e.noScriptCaching?"?nocache="+(new Date).getTime().toString(16):"")+'"><\/script>')});c.push('</head><body style="border-width: 0;" class="editbox" spellcheck="'+(e.disableSpellcheck?"false":"true")+'"></body></html>');return c.join("")}function o(e,c){this.options=c=c||{};i(c,CodeMirrorConfig);if(c.dumbTabs)c.tabMode="spaces";else if(c.normalTab)c.tabMode="default";var a=this.frame=document.createElement("IFRAME");if(c.iframeClass)a.className=c.iframeClass;a.frameBorder=0;a.style.border="0";a.style.width="100%";a.style.height="100%";a.style.display="block";var b=this.wrapping=document.createElement("DIV");b.style.position="relative";b.className="CodeMirror-wrapping";b.style.width=c.width;b.style.height=c.height=="dynamic"?c.minHeight+"px":c.height;var d=this.textareaHack=document.createElement("TEXTAREA");b.appendChild(d);d.style.position="absolute";d.style.left="-10000px";d.style.width="10px";a.CodeMirror=this;if(c.domain&&q){this.html=n(c);a.src="javascript:(function(){document.open();"+(c.domain?'document.domain="'+c.domain+'";':"")+"document.write(window.frameElement.CodeMirror.html);document.close();})()"}else a.src="javascript:;";e.appendChild?e.appendChild(b):e(b);b.appendChild(a);if(c.lineNumbers)this.lineNumbers=k(b,c.firstLineNumber);this.win=a.contentWindow;if(!c.domain||!q){this.win.document.open();this.win.document.write(n(c));this.win.document.close()}}i(CodeMirrorConfig,{stylesheet:[],path:"",parserfile:[],basefiles:["util.js","stringstream.js","select.js","undo.js","editor.js","tokenize.js"],iframeClass:null,passDelay:200,passTime:50,lineNumberDelay:200,lineNumberTime:50,continuousScanning:false,saveFunction:null,onChange:null,undoDepth:50,undoDelay:800,disableSpellcheck:true,textWrapping:true,readOnly:false,width:"",height:"300px",minHeight:100,autoMatchParens:false,parserConfig:null,tabMode:"indent",enterMode:"indent",electricChars:true,reindentOnLoad:false,activeTokens:null,cursorActivity:null,lineNumbers:false,firstLineNumber:1,indentUnit:2,domain:null,noScriptCaching:false});var q=document.selection&&window.ActiveXObject&&/MSIE/.test(navigator.userAgent);o.prototype={init:function(){this.options.initCallback&&this.options.initCallback(this);this.options.lineNumbers&&this.activateLineNumbers();this.options.reindentOnLoad&&this.reindent();this.options.height=="dynamic"&&this.setDynamicHeight()},getCode:function(){return this.editor.getCode()},setCode:function(e){this.editor.importCode(e)},selection:function(){this.focusIfIE();return this.editor.selectedText()},reindent:function(){this.editor.reindent()},reindentSelection:function(){this.focusIfIE();this.editor.reindentSelection(null)},focusIfIE:function(){this.win.select.ie_selection&&this.focus()},focus:function(){this.win.focus();this.editor.selectionSnapshot&&this.win.select.setBookmark(this.win.document.body,this.editor.selectionSnapshot)},replaceSelection:function(e){this.focus();this.editor.replaceSelection(e);return true},replaceChars:function(e,c,a){this.editor.replaceChars(e,c,a)},getSearchCursor:function(e,c,a){return this.editor.getSearchCursor(e,c,a)},undo:function(){this.editor.history.undo()},redo:function(){this.editor.history.redo()},historySize:function(){return this.editor.history.historySize()},clearHistory:function(){this.editor.history.clear()},grabKeys:function(e,c){this.editor.grabKeys(e,c)},ungrabKeys:function(){this.editor.ungrabKeys()},setParser:function(e,c){this.editor.setParser(e,c)},setSpellcheck:function(e){this.win.document.body.spellcheck=e},setStylesheet:function(e){if(typeof e==="string")e=[e];for(var c={},a={},b=this.win.document.getElementsByTagName("link"),d=0,f;f=b[d];d++)if(f.rel.indexOf("stylesheet")!==-1)for(var g=0;g<e.length;g++){var h=e[g];if(f.href.substring(f.href.length-h.length)===h){c[f.href]=true;a[h]=true}}for(d=0;f=b[d];d++)if(f.rel.indexOf("stylesheet")!==-1)f.disabled=!(f.href in c);for(g=0;g<e.length;g++){h=e[g];if(!(h in a)){f=this.win.document.createElement("link");f.rel="stylesheet";f.type="text/css";f.href=h;this.win.document.getElementsByTagName("head")[0].appendChild(f)}}},setTextWrapping:function(e){if(e!=this.options.textWrapping){this.win.document.body.style.whiteSpace=e?"":"nowrap";this.options.textWrapping=e;if(this.lineNumbers){this.setLineNumbers(false);this.setLineNumbers(true)}}},setIndentUnit:function(e){this.win.indentUnit=e},setUndoDepth:function(e){this.editor.history.maxDepth=e},setTabMode:function(e){this.options.tabMode=e},setEnterMode:function(e){this.options.enterMode=e},setLineNumbers:function(e){if(e&&!this.lineNumbers){this.lineNumbers=k(this.wrapping,this.options.firstLineNumber);this.activateLineNumbers()}else if(!e&&this.lineNumbers){this.wrapping.removeChild(this.lineNumbers);this.wrapping.style.paddingLeft="";this.lineNumbers=null}},cursorPosition:function(e){this.focusIfIE();return this.editor.cursorPosition(e)},firstLine:function(){return this.editor.firstLine()},lastLine:function(){return this.editor.lastLine()},nextLine:function(e){return this.editor.nextLine(e)},prevLine:function(e){return this.editor.prevLine(e)},lineContent:function(e){return this.editor.lineContent(e)},setLineContent:function(e,c){this.editor.setLineContent(e,c)},removeLine:function(e){this.editor.removeLine(e)},insertIntoLine:function(e,c,a){this.editor.insertIntoLine(e,c,a)},selectLines:function(e,c,a,b){this.win.focus();this.editor.selectLines(e,c,a,b)},nthLine:function(e){for(var c=this.firstLine();e>1&&c!==false;e--)c=this.nextLine(c);return c},lineNumber:function(e){for(var c=0;e!==false;){c++;e=this.prevLine(e)}return c},jumpToLine:function(e){if(typeof e=="number")e=this.nthLine(e);this.selectLines(e,0);this.win.focus()},currentLine:function(){return this.lineNumber(this.cursorLine())},cursorLine:function(){return this.cursorPosition().line},cursorCoords:function(e){return this.editor.cursorCoords(e)},activateLineNumbers:function(){function e(){if(f.offsetWidth!=0){for(var y=f;y.parentNode;y=y.parentNode);if(!l.parentNode||y!=document||!g.Editor){try{w()}catch(A){}clearInterval(x)}else if(l.offsetWidth!=u){u=l.offsetWidth;f.parentNode.style.paddingLeft=u+"px"}}}function c(){l.scrollTop=j.scrollTop||h.documentElement.scrollTop||0}function a(y){var A=m.firstChild.offsetHeight;if(A!=0){A=Math.ceil((50+Math.max(j.offsetHeight,Math.max(f.offsetHeight,j.scrollHeight||0)))/A);for(var v=m.childNodes.length;v<=A;v++){var z=document.createElement("DIV");z.appendChild(document.createTextNode(y?String(v+r.options.firstLineNumber):"\u00a0"));m.appendChild(z)}}}function b(){function y(){a(true);c()}r.updateNumbers=y;var A=g.addEventHandler(g,"scroll",c,true),v=g.addEventHandler(g,"resize",y,true);w=function(){A();v();if(r.updateNumbers==y)r.updateNumbers=null};y()}function d(){function y(J,K){E||(E=m.appendChild(document.createElement("DIV")));D&&D(E,K,J);B.push(E);B.push(J);N=E.offsetHeight+E.offsetTop;E=E.nextSibling}function A(){for(var J=0;J<B.length;J+=2)B[J].innerHTML=B[J+1];B=[]}function v(){if(!(!m.parentNode||m.parentNode!=r.lineNumbers)){for(var J=(new Date).getTime()+r.options.lineNumberTime;H;){for(y(O++,H.previousSibling);H&&!g.isBR(H);H=H.nextSibling)for(var K=H.offsetTop+H.offsetHeight;m.offsetHeight&&K-3>N;)y(" ");if(H)H=H.nextSibling;if((new Date).getTime()>J){A();G=setTimeout(v,r.options.lineNumberDelay);return}}for(;E;)y(O++);A();c()}}function z(J){c();a(J);H=j.firstChild;E=m.firstChild;N=0;O=r.options.firstLineNumber;v()}function L(){G&&clearTimeout(G);if(r.editor.allClean())z();else G=setTimeout(L,200)}var H,E,O,N,B=[],D=r.options.styleNumbers;z(true);var G=null;r.updateNumbers=L;var F=g.addEventHandler(g,"scroll",c,true),M=g.addEventHandler(g,"resize",L,true);w=function(){G&&clearTimeout(G);if(r.updateNumbers==L)r.updateNumbers=null;F();M()}}var f=this.frame,g=f.contentWindow,h=g.document,j=h.body,l=this.lineNumbers,m=l.firstChild,r=this,u=null,w=function(){};e();var x=setInterval(e,500);(this.options.textWrapping||this.options.styleNumbers?d:b)()},setDynamicHeight:function(){function e(){for(var j=0,l=d.lastChild,m;l&&b.isBR(l);){l.hackBR||j++;l=l.previousSibling}if(l){f=l.offsetHeight;m=l.offsetTop+(1+j)*f}else if(f)m=j*f;if(m)c.wrapping.style.height=Math.max(h+m,c.options.minHeight)+"px"}var c=this,a=c.options.cursorActivity,b=c.win,d=b.document.body,f=null,g=null,h=2*c.frame.offsetTop;d.style.overflowY="hidden";b.document.documentElement.style.overflowY="hidden";this.frame.scrolling="no";setTimeout(e,300);c.options.cursorActivity=function(j){a&&a(j);clearTimeout(g);g=setTimeout(e,100)}}};o.InvalidLineHandle={toString:function(){return"CodeMirror.InvalidLineHandle"}};o.replace=function(e){if(typeof e=="string")e=document.getElementById(e);return function(c){e.parentNode.replaceChild(c,e)}};o.fromTextArea=function(e,c){if(typeof e=="string")e=document.getElementById(e);c=c||{};if(e.style.width&&c.width==null)c.width=e.style.width;if(e.style.height&&c.height==null)c.height=e.style.height;if(c.content==null)c.content=e.value;if(e.form){var a=function(){e.value=f.getCode()};typeof e.form.addEventListener=="function"?e.form.addEventListener("submit",a,false):e.form.attachEvent("onsubmit",a);var b=e.form.submit,d=function(){a();e.form.submit=b;e.form.submit();e.form.submit=d};e.form.submit=d}e.style.display="none";var f=new o(function(g){e.nextSibling?e.parentNode.insertBefore(g,e.nextSibling):e.parentNode.appendChild(g)},c);f.toTextArea=function(){a();e.parentNode.removeChild(f.wrapping);e.style.display="";if(e.form){e.form.submit=b;typeof e.form.removeEventListener=="function"?e.form.removeEventListener("submit",a,false):e.form.detachEvent("onsubmit",a)}};return f};o.isProbablySupported=function(){var e;return window.opera?Number(window.opera.version())>=9.52:/Apple Computers, Inc/.test(navigator.vendor)&&(e=navigator.userAgent.match(/Version\/(\d+(?:\.\d+)?)\./))?Number(e[1])>=3:document.selection&&window.ActiveXObject&&(e=navigator.userAgent.match(/MSIE (\d+(?:\.\d*)?)\b/))?Number(e[1])>=6:(e=navigator.userAgent.match(/gecko\/(\d{8})/i))?Number(e[1])>=20050901:(e=navigator.userAgent.match(/AppleWebKit\/(\d+)/))?Number(e[1])>=525:null};return o}();function method(i,p){return function(){i[p].apply(i,arguments)}}var StopIteration={toString:function(){return"StopIteration"}};function forEach(i,p){if(i.next)try{for(;;)p(i.next())}catch(k){if(k!=StopIteration)throw k;}else for(var n=0;n<i.length;n++)p(i[n])}function map(i,p){var k=[];forEach(i,function(n){k.push(p(n))});return k}function matcher(i){return function(p){return i.test(p)}}function hasClass(i,p){var k=i.className;return k&&RegExp("(^| )"+p+"($| )").test(k)} |
var wireTypes = wireTypesByBindingType(binding, xsdTypes); | var wireTypes = wireTypesByBindingType(binding.type, xsdTypes); | function columnsByBinding(binding, xsdTypes){ var bindingColumns = new Array(); var wireTypes = wireTypesByBindingType(binding, xsdTypes); for (var k = 0; k < wireTypes.length; k++) bindingColumns = bindingColumns.concat(columnsByWireType(wireTypes[k])); // add columns for each type return bindingColumns;} |
for (var k = 0; k < wireTypes.length; k++) bindingColumns = bindingColumns.concat(columnsByWireType(wireTypes[k])); | for (var i in wireTypes) bindingColumns = bindingColumns.concat(columnsByWireType(wireTypes[i])); | function columnsByBinding(binding, xsdTypes){ var bindingColumns = new Array(); var wireTypes = wireTypesByBindingType(binding, xsdTypes); for (var k = 0; k < wireTypes.length; k++) bindingColumns = bindingColumns.concat(columnsByWireType(wireTypes[k])); // add columns for each type return bindingColumns;} |
for (var k = 0; k < wireTypes.length; k++) bindingColumns = bindingColumns.concat(columnsByWireType(wireTypes[k])); | for (var i in wireTypes) bindingColumns = bindingColumns.concat(columnsByWireType(wireTypes[i])); | function columnsByBindingType(bindingType, xsdTypes){ var bindingColumns = new Array(); var wireTypes = wireTypesByBindingType(bindingType, xsdTypes); for (var k = 0; k < wireTypes.length; k++) bindingColumns = bindingColumns.concat(columnsByWireType(wireTypes[k])); // add columns for each type return bindingColumns;} |
this.cometSessionOnConnect = function() { | this.cometSessionOnConnect = function(conn) { | this.cometSessionOnConnect = function() { logger.debug('conn has opened'); this.onConnect(new Transport(conn)); } |
Cu.import("resource: require(global, "util"); require(global, "config"); | function CommandLineHandler() { this.wrappedJSObject = this;} |
|
this.echo(<>:{this.command}<br/>{xml}</>, this.HIGHLIGHT_NORMAL, this.FORCE_MULTILINE); | if (this.command) this.echo(<>:{this.command}</>, this.HIGHLIGHT_NORMAL, this.FORCE_MULTILINE); this.echo(xml, this.HIGHLIGHT_NORMAL, this.FORCE_MULTILINE); this.command = null; | commandOutput: function (xml) { XML.ignoreWhitespace = false; XML.prettyPrinting = false; this.echo(<>:{this.command}<br/>{xml}</>, this.HIGHLIGHT_NORMAL, this.FORCE_MULTILINE); }, |
commandline.runSilently(function () dactyl.execute(args[0] || "", null, true)); | commandline.runSilently(function () commands.execute(args[0] || "", null, true)); | commands: function () { [ { name: "ec[ho]", description: "Echo the expression", action: dactyl.echo }, { name: "echoe[rr]", description: "Echo the expression as an error message", action: dactyl.echoerr }, { name: "echom[sg]", description: "Echo the expression as an informational message", action: dactyl.echomsg } ].forEach(function (command) { commands.add([command.name], command.description, function (args) { command.action(CommandLine.echoArgumentToString(args[0] || "", true)); }, { completer: function (context) completion.javascript(context), literal: 0 }); }); commands.add(["mes[sages]"], "Display previously shown messages", function () { // TODO: are all messages single line? Some display an aggregation // of single line messages at least. E.g. :source if (commandline._messageHistory.length == 1) { let message = commandline._messageHistory.messages[0]; commandline.echo(message.message, message.highlight, commandline.FORCE_SINGLELINE); } else if (commandline._messageHistory.length > 1) { XML.ignoreWhitespace = false; commandline.commandOutput( template.map(commandline._messageHistory.messages, function (message) <div highlight={message.highlight + " Message"}>{message.message}</div>));; } }, { argCount: "0" }); commands.add(["messc[lear]"], "Clear the message history", function () { commandline._messageHistory.clear(); }, { argCount: "0" }); commands.add(["sil[ent]"], "Run a command silently", function (args) { commandline.runSilently(function () dactyl.execute(args[0] || "", null, true)); }, { completer: function (context) completion.ex(context), literal: 0, subCommand: 0 }); }, |
let str = CommandLine.echoArgumentToString(args[0], true); | let str = CommandLine.echoArgumentToString(args[0] || "", true); | commands: function () { [ { name: "ec[ho]", description: "Echo the expression", action: dactyl.echo }, { name: "echoe[rr]", description: "Echo the expression as an error message", action: dactyl.echoerr }, { name: "echom[sg]", description: "Echo the expression as an informational message", action: dactyl.echomsg } ].forEach(function (command) { commands.add([command.name], command.description, function (args) { let str = CommandLine.echoArgumentToString(args[0], true); if (str != null) command.action(str); }, { completer: function (context) completion.javascript(context), literal: 0 }); }); commands.add(["mes[sages]"], "Display previously shown messages", function () { // TODO: are all messages single line? Some display an aggregation // of single line messages at least. E.g. :source if (commandline._messageHistory.length == 1) { let message = commandline._messageHistory.messages[0]; commandline.echo(message.message, message.highlight, commandline.FORCE_SINGLELINE); } else if (commandline._messageHistory.length > 1) { XML.ignoreWhitespace = false; commandline.commandOutput( template.map(commandline._messageHistory.messages, function (message) <div highlight={message.highlight + " Message"}>{message.message}</div>));; } }, { argCount: "0" }); commands.add(["messc[lear]"], "Clear the message history", function () { commandline._messageHistory.clear(); }, { argCount: "0" }); commands.add(["sil[ent]"], "Run a command silently", function (args) { commandline.runSilently(function () dactyl.execute(args[0], null, true)); }, { completer: function (context) completion.ex(context), literal: 0, subCommand: 0 }); }, |
commandline.runSilently(function () dactyl.execute(args[0], null, true)); | commandline.runSilently(function () dactyl.execute(args[0] || "", null, true)); | commands: function () { [ { name: "ec[ho]", description: "Echo the expression", action: dactyl.echo }, { name: "echoe[rr]", description: "Echo the expression as an error message", action: dactyl.echoerr }, { name: "echom[sg]", description: "Echo the expression as an informational message", action: dactyl.echomsg } ].forEach(function (command) { commands.add([command.name], command.description, function (args) { let str = CommandLine.echoArgumentToString(args[0], true); if (str != null) command.action(str); }, { completer: function (context) completion.javascript(context), literal: 0 }); }); commands.add(["mes[sages]"], "Display previously shown messages", function () { // TODO: are all messages single line? Some display an aggregation // of single line messages at least. E.g. :source if (commandline._messageHistory.length == 1) { let message = commandline._messageHistory.messages[0]; commandline.echo(message.message, message.highlight, commandline.FORCE_SINGLELINE); } else if (commandline._messageHistory.length > 1) { XML.ignoreWhitespace = false; commandline.commandOutput( template.map(commandline._messageHistory.messages, function (message) <div highlight={message.highlight + " Message"}>{message.message}</div>));; } }, { argCount: "0" }); commands.add(["messc[lear]"], "Clear the message history", function () { commandline._messageHistory.clear(); }, { argCount: "0" }); commands.add(["sil[ent]"], "Run a command silently", function (args) { commandline.runSilently(function () dactyl.execute(args[0], null, true)); }, { completer: function (context) completion.ex(context), literal: 0, subCommand: 0 }); }, |
commandline.widgets.message = null; if (modes.main != modes.COMMAND_LINE) commandline.widgets.command = null; | commandline.clear(); | commands: function () { commands.add(["downl[oads]", "dl"], "Show progress of current downloads", function () { dactyl.open("chrome://mozapps/content/downloads/downloads.xul", { from: "downloads"}); }, { argCount: "0" }); commands.add(["o[pen]"], "Open one or more URLs in the current tab", function (args) { if (args[0]) dactyl.open(args[0]); else dactyl.open("about:blank"); }, { completer: function (context) completion.url(context), domains: function (args) array.compact(dactyl.stringToURLArray(args[0] || "").map( function (url) util.getHost(url))), literal: 0, privateData: true }); commands.add(["redr[aw]"], "Redraw the screen", function () { window.QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsIDOMWindowUtils).redraw(); commandline.widgets.message = null; if (modes.main != modes.COMMAND_LINE) commandline.widgets.command = null; }, { argCount: "0" }); } |
<div highlight={message.highlight + " Message"}>{message.message}</div>));; | <div highlight={message.highlight + " Message"}>{message.message}</div>)); | commands: function () { [ { name: "ec[ho]", description: "Echo the expression", action: dactyl.echo }, { name: "echoe[rr]", description: "Echo the expression as an error message", action: dactyl.echoerr }, { name: "echom[sg]", description: "Echo the expression as an informational message", action: dactyl.echomsg } ].forEach(function (command) { commands.add([command.name], command.description, function (args) { command.action(CommandLine.echoArgumentToString(args[0] || "", true)); }, { completer: function (context) completion.javascript(context), literal: 0 }); }); commands.add(["mes[sages]"], "Display previously shown messages", function () { // TODO: are all messages single line? Some display an aggregation // of single line messages at least. E.g. :source if (commandline._messageHistory.length == 1) { let message = commandline._messageHistory.messages[0]; commandline.echo(message.message, message.highlight, commandline.FORCE_SINGLELINE); } else if (commandline._messageHistory.length > 1) { XML.ignoreWhitespace = false; commandline.commandOutput( template.map(commandline._messageHistory.messages, function (message) <div highlight={message.highlight + " Message"}>{message.message}</div>));; } }, { argCount: "0" }); commands.add(["messc[lear]"], "Clear the message history", function () { commandline._messageHistory.clear(); }, { argCount: "0" }); commands.add(["sil[ent]"], "Run a command silently", function (args) { commandline.runSilently(function () commands.execute(args[0] || "", null, true)); }, { completer: function (context) completion.ex(context), literal: 0, subCommand: 0 }); }, |
args = args[0]; | dactyl.dump(args); args = args[0] || ""; | commands: function () { commands.add(["delqm[arks]"], "Delete the specified QuickMarks", function (args) { // TODO: finish arg parsing - we really need a proper way to do this. :) // assert(args.bang ^ args[0]) dactyl.assert( args.bang || args[0], "E471: Argument required"); dactyl.assert(!args.bang || !args[0], "E474: Invalid argument"); if (args.bang) quickmarks.removeAll(); else quickmarks.remove(args[0]); }, { bang: true, completer: function (context) { context.title = ["QuickMark", "URL"]; context.completions = this._qmarks; }, literal: 0 }); commands.add(["qma[rk]"], "Mark a URL with a letter for quick access", function (args) { if (!/^[a-zA-Z0-9]$/.test(args[0])) dactyl.echoerr("E488: Trailing characters"); else if (!args[1]) quickmarks.add(args[0], buffer.URL); else quickmarks.add(args[0], args[1]); }, { argCount: "+", completer: function (context, args) { if (args.length == 2) return completion.url(context); }, literal: 1 }); commands.add(["qmarks"], "Show all QuickMarks", function (args) { args = args[0]; // ignore invalid qmark characters unless there are no valid qmark chars dactyl.assert(!args || /[a-zA-Z0-9]/.test(args), "E283: No QuickMarks matching " + args.quote()); let filter = args.replace(/[^a-zA-Z0-9]/g, ""); quickmarks.list(filter); }, { literal: 0 }); }, |
dactyl.assert(!args || /[a-zA-Z0-9]/.test(args), "E283: No QuickMarks matching \"" + args + "\""); | dactyl.assert(!args || /[a-zA-Z0-9]/.test(args), "E283: No QuickMarks matching " + args.quote()); | commands: function () { commands.add(["delqm[arks]"], "Delete the specified QuickMarks", function (args) { // TODO: finish arg parsing - we really need a proper way to do this. :) // assert(args.bang ^ args.string) dactyl.assert( args.bang || args.string, "E471: Argument required"); dactyl.assert(!args.bang || !args.string, "E474: Invalid argument"); if (args.bang) quickmarks.removeAll(); else quickmarks.remove(args.string); }, { bang: true, completer: function (context) { context.title = ["QuickMark", "URL"]; context.completions = this._qmarks; } }); commands.add(["qma[rk]"], "Mark a URL with a letter for quick access", function (args) { let matches = args.string.match(/^([a-zA-Z0-9])(?:\s+(.+))?$/); if (!matches) dactyl.echoerr("E488: Trailing characters"); else if (!matches[2]) quickmarks.add(matches[1], buffer.URL); else quickmarks.add(matches[1], matches[2]); }, { argCount: "+" }); commands.add(["qmarks"], "Show all QuickMarks", function (args) { args = args.string; // ignore invalid qmark characters unless there are no valid qmark chars dactyl.assert(!args || /[a-zA-Z0-9]/.test(args), "E283: No QuickMarks matching \"" + args + "\""); let filter = args.replace(/[^a-zA-Z0-9]/g, ""); quickmarks.list(filter); }); }, |
args = args[0]; | args = args[0] || ""; | commands: function () { commands.add(["delm[arks]"], "Delete the specified marks", function (args) { let special = args.bang; args = args[0]; // assert(special ^ args) dactyl.assert( special || args, "E471: Argument required"); dactyl.assert(!special || !args, "E474: Invalid argument"); let matches = args.match(/(?:(?:^|[^a-zA-Z0-9])-|-(?:$|[^a-zA-Z0-9])|[^a-zA-Z0-9 -]).*/); // NOTE: this currently differs from Vim's behavior which // deletes any valid marks in the arg list, up to the first // invalid arg, as well as giving the error message. dactyl.assert(!matches, "E475: Invalid argument: " + (matches && matches[0])); // check for illegal ranges - only allow a-z A-Z 0-9 if ((matches = args.match(/[a-zA-Z0-9]-[a-zA-Z0-9]/g))) { for (let match in values(matches)) dactyl.assert(/[a-z]-[a-z]|[A-Z]-[A-Z]|[0-9]-[0-9]/.test(match) && match[0] <= match[2], "E475: Invalid argument: " + args.match(match + ".*")[0]); } marks.remove(args, special); }, { bang: true, completer: function (context) completion.mark(context), literal: 0 }); commands.add(["ma[rk]"], "Mark current location within the web page", function (args) { let mark = args[0]; dactyl.assert(mark.length <= 1, "E488: Trailing characters"); dactyl.assert(/[a-zA-Z]/.test(mark), "E191: Argument must be a letter or forward/backward quote"); marks.add(mark); }, { argCount: "1" }); commands.add(["marks"], "Show all location marks of current web page", function (args) { args = args[0]; // ignore invalid mark characters unless there are no valid mark chars dactyl.assert(!args || /[a-zA-Z]/.test(args), "E283: No marks matching " + args.quote()); let filter = args.replace(/[^a-zA-Z]/g, ""); marks.list(filter); }, { literal: 0 }); }, |
let mark = args[0]; | let mark = args[0] || ""; | commands: function () { commands.add(["delm[arks]"], "Delete the specified marks", function (args) { let special = args.bang; args = args[0]; // assert(special ^ args) dactyl.assert( special || args, "E471: Argument required"); dactyl.assert(!special || !args, "E474: Invalid argument"); let matches = args.match(/(?:(?:^|[^a-zA-Z0-9])-|-(?:$|[^a-zA-Z0-9])|[^a-zA-Z0-9 -]).*/); // NOTE: this currently differs from Vim's behavior which // deletes any valid marks in the arg list, up to the first // invalid arg, as well as giving the error message. dactyl.assert(!matches, "E475: Invalid argument: " + (matches && matches[0])); // check for illegal ranges - only allow a-z A-Z 0-9 if ((matches = args.match(/[a-zA-Z0-9]-[a-zA-Z0-9]/g))) { for (let match in values(matches)) dactyl.assert(/[a-z]-[a-z]|[A-Z]-[A-Z]|[0-9]-[0-9]/.test(match) && match[0] <= match[2], "E475: Invalid argument: " + args.match(match + ".*")[0]); } marks.remove(args, special); }, { bang: true, completer: function (context) completion.mark(context), literal: 0 }); commands.add(["ma[rk]"], "Mark current location within the web page", function (args) { let mark = args[0]; dactyl.assert(mark.length <= 1, "E488: Trailing characters"); dactyl.assert(/[a-zA-Z]/.test(mark), "E191: Argument must be a letter or forward/backward quote"); marks.add(mark); }, { argCount: "1" }); commands.add(["marks"], "Show all location marks of current web page", function (args) { args = args[0]; // ignore invalid mark characters unless there are no valid mark chars dactyl.assert(!args || /[a-zA-Z]/.test(args), "E283: No marks matching " + args.quote()); let filter = args.replace(/[^a-zA-Z]/g, ""); marks.list(filter); }, { literal: 0 }); }, |
commands.add(["macros"], | commands.add(["mac[ros]"], | commands: function () { commands.add(["delmac[ros]"], "Delete macros", function (args) { liberator.assert(!args.bang || !args.string, "E474: Invalid argument"); if (args.bang) events.deleteMacros(); else if (args.string) events.deleteMacros(args.string); else liberator.echoerr("E471: Argument required"); }, { bang: true, completer: function (context) completion.macro(context) }); commands.add(["macros"], "List all macros", function (args) { completion.listCompleter("macro", args[0]); }, { argCount: "?", completer: function (context) completion.macro(context) }); commands.add(["pl[ay]"], "Replay a recorded macro", function (args) { events.playMacro(args[0]); }, { argCount: "1", completer: function (context) completion.macro(context) }); }, |
res.push(/\n/.test(str) ? "<<EOF\n" + str.replace(/\n$/, "") + "\nEOF" : str); | res.push(!/\n/.test(str) ? str : this.hereDoc ? "<<EOF\n" + str.replace(/\n$/, "") + "\nEOF" : str.replace(/\n/, "\n" + res[0].replace(/./g, " ").replace(/.$/, "\\"))); | commandToString: function (args) { let res = [args.command + (args.bang ? "!" : "")]; for (let [opt, val] in Iterator(args.options || {})) { let chr = /^-.$/.test(opt) ? " " : "="; if (val != null) opt += chr + Commands.quote(val); res.push(opt); } for (let [, arg] in Iterator(args.arguments || [])) res.push(Commands.quote(arg)); let str = args.literalArg; if (str) res.push(/\n/.test(str) ? "<<EOF\n" + str.replace(/\n$/, "") + "\nEOF" : str); return res.join(" "); }, |
if (compare(document.getElementById("sidebar-title").value, arg)) { | if (compare(document.getElementById("sidebar-title").value, args[0])) | function compare(a, b) util.compareIgnoreCase(a, b) == 0 // focus if the requested sidebar is already open if (compare(document.getElementById("sidebar-title").value, arg)) { |
compareRanges: function (r1, r2) this.backward ? r1.compareBoundaryPoints(r1.END_TO_START, r2) : -r1.compareBoundaryPoints(r1.START_TO_END, r2), | compareRanges: function (r1, r2) { try { return this.backward ? r1.compareBoundaryPoints(r1.END_TO_START, r2) : -r1.compareBoundaryPoints(r1.START_TO_END, r2); } catch (e) { util.reportError(e); return 0; } }, | compareRanges: function (r1, r2) this.backward ? r1.compareBoundaryPoints(r1.END_TO_START, r2) : -r1.compareBoundaryPoints(r1.START_TO_END, r2), |
compileMatcher: function() { var e = this.expression, ps = Selector.patterns, h = Selector.handlers, c = Selector.criteria, le, p, m; if (Selector._cache[e]) { this.matcher = Selector._cache[e]; return; } this.matcher = ["this.matcher = function(root) {", "var r = root, h = Selector.handlers, c = false, n;"]; while (e && le != e && (/\S/).test(e)) { le = e; for (var i in ps) { p = ps[i]; if (m = e.match(p)) { this.matcher.push(Object.isFunction(c[i]) ? c[i](m) : new Template(c[i]).evaluate(m)); e = e.replace(m[0], ''); break; } } } this.matcher.push("return h.unique(n);\n}"); eval(this.matcher.join('\n')); Selector._cache[this.expression] = this.matcher; }, | var Prototype={Version:"1.6.1",Browser:(function(){var b=navigator.userAgent;var a=Object.prototype.toString.call(window.opera)=="[object Opera]";return{IE:!!window.attachEvent&&!a,Opera:a,WebKit:b.indexOf("AppleWebKit/")>-1,Gecko:b.indexOf("Gecko")>-1&&b.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile.*Safari/.test(b)}})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var a=window.Element||window.HTMLElement;return !!(a&&a.prototype)})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=="undefined"){return true}var c=document.createElement("div");var b=document.createElement("form");var a=false;if(c.__proto__&&(c.__proto__!==b.__proto__)){a=true}c=b=null;return a})()},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Abstract={};var Try={these:function(){var c;for(var b=0,d=arguments.length;b<d;b++){var a=arguments[b];try{c=a();break}catch(f){}}return c}};var Class=(function(){function a(){}function b(){var g=null,f=$A(arguments);if(Object.isFunction(f[0])){g=f.shift()}function d(){this.initialize.apply(this,arguments)}Object.extend(d,Class.Methods);d.superclass=g;d.subclasses=[];if(g){a.prototype=g.prototype;d.prototype=new a;g.subclasses.push(d)}for(var e=0;e<f.length;e++){d.addMethods(f[e])}if(!d.prototype.initialize){d.prototype.initialize=Prototype.emptyFunction}d.prototype.constructor=d;return d}function c(k){var f=this.superclass&&this.superclass.prototype;var e=Object.keys(k);if(!Object.keys({toString:true}).length){if(k.toString!=Object.prototype.toString){e.push("toString")}if(k.valueOf!=Object.prototype.valueOf){e.push("valueOf")}}for(var d=0,g=e.length;d<g;d++){var j=e[d],h=k[j];if(f&&Object.isFunction(h)&&h.argumentNames().first()=="$super"){var l=h;h=(function(i){return function(){return f[i].apply(this,arguments)}})(j).wrap(l);h.valueOf=l.valueOf.bind(l);h.toString=l.toString.bind(l)}this.prototype[j]=h}return this}return{create:b,Methods:{addMethods:c}}})();(function(){var d=Object.prototype.toString;function i(q,s){for(var r in s){q[r]=s[r]}return q}function l(q){try{if(e(q)){return"undefined"}if(q===null){return"null"}return q.inspect?q.inspect():String(q)}catch(r){if(r instanceof RangeError){return"..."}throw r}}function k(q){var s=typeof q;switch(s){case"undefined":case"function":case"unknown":return;case"boolean":return q.toString()}if(q===null){return"null"}if(q.toJSON){return q.toJSON()}if(h(q)){return}var r=[];for(var u in q){var t=k(q[u]);if(!e(t)){r.push(u.toJSON()+": "+t)}}return"{"+r.join(", ")+"}"}function c(q){return $H(q).toQueryString()}function f(q){return q&&q.toHTML?q.toHTML():String.interpret(q)}function o(q){var r=[];for(var s in q){r.push(s)}return r}function m(q){var r=[];for(var s in q){r.push(q[s])}return r}function j(q){return i({},q)}function h(q){return !!(q&&q.nodeType==1)}function g(q){return d.call(q)=="[object Array]"}function p(q){return q instanceof Hash}function b(q){return typeof q==="function"}function a(q){return d.call(q)=="[object String]"}function n(q){return d.call(q)=="[object Number]"}function e(q){return typeof q==="undefined"}i(Object,{extend:i,inspect:l,toJSON:k,toQueryString:c,toHTML:f,keys:o,values:m,clone:j,isElement:h,isArray:g,isHash:p,isFunction:b,isString:a,isNumber:n,isUndefined:e})})();Object.extend(Function.prototype,(function(){var k=Array.prototype.slice;function d(o,l){var n=o.length,m=l.length;while(m--){o[n+m]=l[m]}return o}function i(m,l){m=k.call(m,0);return d(m,l)}function g(){var l=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\ | compileMatcher: function() { var e = this.expression, ps = Selector.patterns, h = Selector.handlers, c = Selector.criteria, le, p, m; if (Selector._cache[e]) { this.matcher = Selector._cache[e]; return; } this.matcher = ["this.matcher = function(root) {", "var r = root, h = Selector.handlers, c = false, n;"]; while (e && le != e && (/\S/).test(e)) { le = e; for (var i in ps) { p = ps[i]; if (m = e.match(p)) { this.matcher.push(Object.isFunction(c[i]) ? c[i](m) : new Template(c[i]).evaluate(m)); e = e.replace(m[0], ''); break; } } } this.matcher.push("return h.unique(n);\n}"); eval(this.matcher.join('\n')); Selector._cache[this.expression] = this.matcher; }, |
var firstNames = $$(".tx_seminars_pi1_registration_editor_first_name"); var lastNames = $$(".tx_seminars_pi1_registration_editor_last_name"); | var firstNames = $$("#tx_seminars_pi1_registration_editor_separate_names " + ".tx_seminars_pi1_registration_editor_first_name"); var lastNames = $$("#tx_seminars_pi1_registration_editor_separate_names " + ".tx_seminars_pi1_registration_editor_last_name"); var positions = $$("#tx_seminars_pi1_registration_editor_separate_names " + ".tx_seminars_pi1_registration_editor_position"); var eMailAddresses = $$("#tx_seminars_pi1_registration_editor_separate_names " + ".tx_seminars_pi1_registration_editor_attendee_email"); | function compileNames() { var humanReadableField = $("tx_seminars_pi1_registration_editor_attendees_names"); var machineReadableField = $("tx_seminars_pi1_registration_editor_structured_attendees_names"); if (!humanReadableField || !machineReadableField) { return; } var firstNames = $$(".tx_seminars_pi1_registration_editor_first_name"); var lastNames = $$(".tx_seminars_pi1_registration_editor_last_name"); if (firstNames.length != lastNames.length) { return; } var humanReadableNames = ""; var machineReadableNames = []; for (var i = 0; i < firstNames.length; i++) { var firstName = firstNames[i].value.strip(); var lastName = lastNames[i].value.strip(); if ((firstName.empty()) && (lastName.empty())) { continue; } var fullName = (firstName + " " + lastName).strip(); if (!humanReadableNames.empty()) { humanReadableNames += "\r\n"; } humanReadableNames += fullName; machineReadableNames[i] = [firstName, lastName]; } humanReadableField.value = humanReadableNames; machineReadableField.value = machineReadableNames.toJSON();} |
for (var i = 0; i < firstNames.length; i++) { | var numberOfLines = firstNames.length; for (var i = 0; i < numberOfLines; i++) { | function compileNames() { var humanReadableField = $("tx_seminars_pi1_registration_editor_attendees_names"); var machineReadableField = $("tx_seminars_pi1_registration_editor_structured_attendees_names"); if (!humanReadableField || !machineReadableField) { return; } var firstNames = $$(".tx_seminars_pi1_registration_editor_first_name"); var lastNames = $$(".tx_seminars_pi1_registration_editor_last_name"); if (firstNames.length != lastNames.length) { return; } var humanReadableNames = ""; var machineReadableNames = []; for (var i = 0; i < firstNames.length; i++) { var firstName = firstNames[i].value.strip(); var lastName = lastNames[i].value.strip(); if ((firstName.empty()) && (lastName.empty())) { continue; } var fullName = (firstName + " " + lastName).strip(); if (!humanReadableNames.empty()) { humanReadableNames += "\r\n"; } humanReadableNames += fullName; machineReadableNames[i] = [firstName, lastName]; } humanReadableField.value = humanReadableNames; machineReadableField.value = machineReadableNames.toJSON();} |
machineReadableNames[i] = [firstName, lastName]; | if (!position.empty()) { humanReadableNames += ", " + position; } if (!eMailAddress.empty()) { humanReadableNames += ", " + eMailAddress; } machineReadableNames[i] = [firstName, lastName, position, eMailAddress]; | function compileNames() { var humanReadableField = $("tx_seminars_pi1_registration_editor_attendees_names"); var machineReadableField = $("tx_seminars_pi1_registration_editor_structured_attendees_names"); if (!humanReadableField || !machineReadableField) { return; } var firstNames = $$(".tx_seminars_pi1_registration_editor_first_name"); var lastNames = $$(".tx_seminars_pi1_registration_editor_last_name"); if (firstNames.length != lastNames.length) { return; } var humanReadableNames = ""; var machineReadableNames = []; for (var i = 0; i < firstNames.length; i++) { var firstName = firstNames[i].value.strip(); var lastName = lastNames[i].value.strip(); if ((firstName.empty()) && (lastName.empty())) { continue; } var fullName = (firstName + " " + lastName).strip(); if (!humanReadableNames.empty()) { humanReadableNames += "\r\n"; } humanReadableNames += fullName; machineReadableNames[i] = [firstName, lastName]; } humanReadableField.value = humanReadableNames; machineReadableField.value = machineReadableNames.toJSON();} |
compileXPathMatcher: function() { var e = this.expression, ps = Selector.patterns, x = Selector.xpath, le, m; if (Selector._cache[e]) { this.xpath = Selector._cache[e]; return; } this.matcher = ['. while (e && le != e && (/\S/).test(e)) { le = e; for (var i in ps) { if (m = e.match(ps[i])) { this.matcher.push(Object.isFunction(x[i]) ? x[i](m) : new Template(x[i]).evaluate(m)); e = e.replace(m[0], ''); break; } } } this.xpath = this.matcher.join(''); Selector._cache[this.expression] = this.xpath; }, | var Prototype={Version:"1.6.1",Browser:(function(){var b=navigator.userAgent;var a=Object.prototype.toString.call(window.opera)=="[object Opera]";return{IE:!!window.attachEvent&&!a,Opera:a,WebKit:b.indexOf("AppleWebKit/")>-1,Gecko:b.indexOf("Gecko")>-1&&b.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile.*Safari/.test(b)}})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var a=window.Element||window.HTMLElement;return !!(a&&a.prototype)})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=="undefined"){return true}var c=document.createElement("div");var b=document.createElement("form");var a=false;if(c.__proto__&&(c.__proto__!==b.__proto__)){a=true}c=b=null;return a})()},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Abstract={};var Try={these:function(){var c;for(var b=0,d=arguments.length;b<d;b++){var a=arguments[b];try{c=a();break}catch(f){}}return c}};var Class=(function(){function a(){}function b(){var g=null,f=$A(arguments);if(Object.isFunction(f[0])){g=f.shift()}function d(){this.initialize.apply(this,arguments)}Object.extend(d,Class.Methods);d.superclass=g;d.subclasses=[];if(g){a.prototype=g.prototype;d.prototype=new a;g.subclasses.push(d)}for(var e=0;e<f.length;e++){d.addMethods(f[e])}if(!d.prototype.initialize){d.prototype.initialize=Prototype.emptyFunction}d.prototype.constructor=d;return d}function c(k){var f=this.superclass&&this.superclass.prototype;var e=Object.keys(k);if(!Object.keys({toString:true}).length){if(k.toString!=Object.prototype.toString){e.push("toString")}if(k.valueOf!=Object.prototype.valueOf){e.push("valueOf")}}for(var d=0,g=e.length;d<g;d++){var j=e[d],h=k[j];if(f&&Object.isFunction(h)&&h.argumentNames().first()=="$super"){var l=h;h=(function(i){return function(){return f[i].apply(this,arguments)}})(j).wrap(l);h.valueOf=l.valueOf.bind(l);h.toString=l.toString.bind(l)}this.prototype[j]=h}return this}return{create:b,Methods:{addMethods:c}}})();(function(){var d=Object.prototype.toString;function i(q,s){for(var r in s){q[r]=s[r]}return q}function l(q){try{if(e(q)){return"undefined"}if(q===null){return"null"}return q.inspect?q.inspect():String(q)}catch(r){if(r instanceof RangeError){return"..."}throw r}}function k(q){var s=typeof q;switch(s){case"undefined":case"function":case"unknown":return;case"boolean":return q.toString()}if(q===null){return"null"}if(q.toJSON){return q.toJSON()}if(h(q)){return}var r=[];for(var u in q){var t=k(q[u]);if(!e(t)){r.push(u.toJSON()+": "+t)}}return"{"+r.join(", ")+"}"}function c(q){return $H(q).toQueryString()}function f(q){return q&&q.toHTML?q.toHTML():String.interpret(q)}function o(q){var r=[];for(var s in q){r.push(s)}return r}function m(q){var r=[];for(var s in q){r.push(q[s])}return r}function j(q){return i({},q)}function h(q){return !!(q&&q.nodeType==1)}function g(q){return d.call(q)=="[object Array]"}function p(q){return q instanceof Hash}function b(q){return typeof q==="function"}function a(q){return d.call(q)=="[object String]"}function n(q){return d.call(q)=="[object Number]"}function e(q){return typeof q==="undefined"}i(Object,{extend:i,inspect:l,toJSON:k,toQueryString:c,toHTML:f,keys:o,values:m,clone:j,isElement:h,isArray:g,isHash:p,isFunction:b,isString:a,isNumber:n,isUndefined:e})})();Object.extend(Function.prototype,(function(){var k=Array.prototype.slice;function d(o,l){var n=o.length,m=l.length;while(m--){o[n+m]=l[m]}return o}function i(m,l){m=k.call(m,0);return d(m,l)}function g(){var l=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\ | compileXPathMatcher: function() { var e = this.expression, ps = Selector.patterns, x = Selector.xpath, le, m; if (Selector._cache[e]) { this.xpath = Selector._cache[e]; return; } this.matcher = ['.//*']; while (e && le != e && (/\S/).test(e)) { le = e; for (var i in ps) { if (m = e.match(ps[i])) { this.matcher.push(Object.isFunction(x[i]) ? x[i](m) : new Template(x[i]).evaluate(m)); e = e.replace(m[0], ''); break; } } } this.xpath = this.matcher.join(''); Selector._cache[this.expression] = this.xpath; }, |
compl = function (context, args, recurse) { context.process[1] = function highlight(item, v) template.highlight(typeof v == "xml" ? new String(v.toXMLString()) : v, true); let compare = context.compare; function isnan(item) item != '' && isNaN(item); context.compare = function (a, b) { if (!isnan(a.key) && !isnan(b.key)) return a.key - b.key; return isnan(b.key) - isnan(a.key) || compare(a, b); | compl = function (context, obj) { let res = completer.call(self, context, func, obj, args); if (res) context.completions = res; | compl = function (context, args, recurse) { context.process[1] = function highlight(item, v) template.highlight(typeof v == "xml" ? new String(v.toXMLString()) : v, true); // Sort in a logical fashion for object keys: // Numbers are sorted as numbers, rather than strings, and appear first. // Constants are unsorted, and appear before other non-null strings. // Other strings are sorted in the default manner. let compare = context.compare; function isnan(item) item != '' && isNaN(item); context.compare = function (a, b) { if (!isnan(a.key) && !isnan(b.key)) return a.key - b.key; return isnan(b.key) - isnan(a.key) || compare(a, b); }; context.keys = { text: args.prefix ? function (text) text.substr(args.prefix.length) : util.identity, description: function (item) self.getKey(args.obj, item), key: function (item) { if (!isNaN(key)) return parseInt(key); if (/^[A-Z_][A-Z0-9_]*$/.test(key)) return ""; return item; } }; if (!context.anchored) // We've already listed anchored matches, so don't list them again here. context.filters.push(function (item) util.compareIgnoreCase(item.text.substr(0, this.filter.length), this.filter)); if (args.obj == self.cache.evalContext) context.regenerate = true; context.generate = function () self.objectKeys(args.obj, !recurse); }; |
context.keys = { text: args.prefix ? function (text) text.substr(args.prefix.length) : util.identity, description: function (item) self.getKey(args.obj, item), key: function (item) { if (!isNaN(key)) return parseInt(key); if (/^[A-Z_][A-Z0-9_]*$/.test(key)) return ""; return item; } }; if (!context.anchored) context.filters.push(function (item) util.compareIgnoreCase(item.text.substr(0, this.filter.length), this.filter)); if (args.obj == self.cache.evalContext) context.regenerate = true; context.generate = function () self.objectKeys(args.obj, !recurse); }; | compl = function (context, args, recurse) { context.process[1] = function highlight(item, v) template.highlight(typeof v == "xml" ? new String(v.toXMLString()) : v, true); // Sort in a logical fashion for object keys: // Numbers are sorted as numbers, rather than strings, and appear first. // Constants are unsorted, and appear before other non-null strings. // Other strings are sorted in the default manner. let compare = context.compare; function isnan(item) item != '' && isNaN(item); context.compare = function (a, b) { if (!isnan(a.key) && !isnan(b.key)) return a.key - b.key; return isnan(b.key) - isnan(a.key) || compare(a, b); }; context.keys = { text: args.prefix ? function (text) text.substr(args.prefix.length) : util.identity, description: function (item) self.getKey(args.obj, item), key: function (item) { if (!isNaN(key)) return parseInt(key); if (/^[A-Z_][A-Z0-9_]*$/.test(key)) return ""; return item; } }; if (!context.anchored) // We've already listed anchored matches, so don't list them again here. context.filters.push(function (item) util.compareIgnoreCase(item.text.substr(0, this.filter.length), this.filter)); if (args.obj == self.cache.evalContext) context.regenerate = true; context.generate = function () self.objectKeys(args.obj, !recurse); }; |
|
compl = function (context, obj, recurse) { | compl = function (context, args, recurse) { | compl = function (context, obj, recurse) { context.process[1] = function highlight(item, v) template.highlight(typeof v == "xml" ? new String(v.toXMLString()) : v, true); // Sort in a logical fashion for object keys: // Numbers are sorted as numbers, rather than strings, and appear first. // Constants are unsorted, and appear before other non-null strings. // Other strings are sorted in the default manner. let compare = context.compare; function isnan(item) item != '' && isNaN(item); context.compare = function (a, b) { if (!isnan(a.key) && !isnan(b.key)) return a.key - b.key; return isnan(b.key) - isnan(a.key) || compare(a, b); }; context.keys = { text: util.identity, description: function (item) self.getKey(obj, item), key: function (item) { if (!isNaN(key)) return parseInt(key); if (/^[A-Z_][A-Z0-9_]*$/.test(key)) return ""; return item; } }; if (!context.anchored) // We've already listed anchored matches, so don't list them again here. context.filters.push(function (item) util.compareIgnoreCase(item.text.substr(0, this.filter.length), this.filter)); if (obj == self.cache.evalContext) context.regenerate = true; context.generate = function () self.objectKeys(obj, !recurse); }; |
text: util.identity, description: function (item) self.getKey(obj, item), | text: args.prefix ? function (text) text.substr(args.prefix.length) : util.identity, description: function (item) self.getKey(args.obj, item), | compl = function (context, obj, recurse) { context.process[1] = function highlight(item, v) template.highlight(typeof v == "xml" ? new String(v.toXMLString()) : v, true); // Sort in a logical fashion for object keys: // Numbers are sorted as numbers, rather than strings, and appear first. // Constants are unsorted, and appear before other non-null strings. // Other strings are sorted in the default manner. let compare = context.compare; function isnan(item) item != '' && isNaN(item); context.compare = function (a, b) { if (!isnan(a.key) && !isnan(b.key)) return a.key - b.key; return isnan(b.key) - isnan(a.key) || compare(a, b); }; context.keys = { text: util.identity, description: function (item) self.getKey(obj, item), key: function (item) { if (!isNaN(key)) return parseInt(key); if (/^[A-Z_][A-Z0-9_]*$/.test(key)) return ""; return item; } }; if (!context.anchored) // We've already listed anchored matches, so don't list them again here. context.filters.push(function (item) util.compareIgnoreCase(item.text.substr(0, this.filter.length), this.filter)); if (obj == self.cache.evalContext) context.regenerate = true; context.generate = function () self.objectKeys(obj, !recurse); }; |
if (obj == self.cache.evalContext) | if (args.obj == self.cache.evalContext) | compl = function (context, obj, recurse) { context.process[1] = function highlight(item, v) template.highlight(typeof v == "xml" ? new String(v.toXMLString()) : v, true); // Sort in a logical fashion for object keys: // Numbers are sorted as numbers, rather than strings, and appear first. // Constants are unsorted, and appear before other non-null strings. // Other strings are sorted in the default manner. let compare = context.compare; function isnan(item) item != '' && isNaN(item); context.compare = function (a, b) { if (!isnan(a.key) && !isnan(b.key)) return a.key - b.key; return isnan(b.key) - isnan(a.key) || compare(a, b); }; context.keys = { text: util.identity, description: function (item) self.getKey(obj, item), key: function (item) { if (!isNaN(key)) return parseInt(key); if (/^[A-Z_][A-Z0-9_]*$/.test(key)) return ""; return item; } }; if (!context.anchored) // We've already listed anchored matches, so don't list them again here. context.filters.push(function (item) util.compareIgnoreCase(item.text.substr(0, this.filter.length), this.filter)); if (obj == self.cache.evalContext) context.regenerate = true; context.generate = function () self.objectKeys(obj, !recurse); }; |
context.generate = function () self.objectKeys(obj, !recurse); | context.generate = function () self.objectKeys(args.obj, !recurse); | compl = function (context, obj, recurse) { context.process[1] = function highlight(item, v) template.highlight(typeof v == "xml" ? new String(v.toXMLString()) : v, true); // Sort in a logical fashion for object keys: // Numbers are sorted as numbers, rather than strings, and appear first. // Constants are unsorted, and appear before other non-null strings. // Other strings are sorted in the default manner. let compare = context.compare; function isnan(item) item != '' && isNaN(item); context.compare = function (a, b) { if (!isnan(a.key) && !isnan(b.key)) return a.key - b.key; return isnan(b.key) - isnan(a.key) || compare(a, b); }; context.keys = { text: util.identity, description: function (item) self.getKey(obj, item), key: function (item) { if (!isNaN(key)) return parseInt(key); if (/^[A-Z_][A-Z0-9_]*$/.test(key)) return ""; return item; } }; if (!context.anchored) // We've already listed anchored matches, so don't list them again here. context.filters.push(function (item) util.compareIgnoreCase(item.text.substr(0, this.filter.length), this.filter)); if (obj == self.cache.evalContext) context.regenerate = true; context.generate = function () self.objectKeys(obj, !recurse); }; |
this.injectCandidates(cands[0].value, false); | this.injectCandidates(cands[0].value, true); | complete: function(denyEmpty){ var text = this.tags.value; var word = this.getCurrentWord(); var hint = word.hint; if(!hint && denyEmpty){ this.popup.hidePopup(); return; } var cands = this.getCandidates(hint); if(this.autoComplete && !this.deleting && cands.length === 1 && (hint.length >= 2 || cands[0].length === 1)){ this.injectCandidates(cands[0].value, false); this.popup.hidePopup(); return; } if(cands.length){ this.popup.show(null, null, null, cands); //this.popup.show(this, (this.getCursorLeft(word.start) - this.content.scrollLeft) + this.padding(), -2, cands); } else { this.popup.hidePopup(); } }, |
let completeFunc = null; if (completeOpt) { if (/^custom,/.test(completeOpt)) { completeOpt = completeOpt.substr(7); completeFunc = function () { try { var completer = liberator.eval(completeOpt); if (!(completer instanceof Function)) throw new TypeError("User-defined custom completer " + completeOpt.quote() + " is not a function"); } catch (e) { liberator.echo(":" + this.name + " ..."); liberator.echoerr("E117: Unknown function: " + completeOpt); liberator.log(e); return undefined; } return completer.apply(this, Array.slice(arguments)); }; | completeFunc = function (context) completion[completeOptionMap[completeOpt]](context); | let completeFunc = null; // default to no completion for user commands if (completeOpt) { if (/^custom,/.test(completeOpt)) { completeOpt = completeOpt.substr(7); completeFunc = function () { try { var completer = liberator.eval(completeOpt); if (!(completer instanceof Function)) throw new TypeError("User-defined custom completer " + completeOpt.quote() + " is not a function"); } catch (e) { liberator.echo(":" + this.name + " ..."); liberator.echoerr("E117: Unknown function: " + completeOpt); liberator.log(e); return undefined; } return completer.apply(this, Array.slice(arguments)); }; |
completer: function (context) [[k, ""] for ([k, v] in Iterator(completeOptionMap))], | completer: function (context) completion.userCommand(context) }); | completer: function (context) [[k, ""] for ([k, v] in Iterator(completeOptionMap))], |
completer: function (context) [ ["0", "Don't show link destination"], ["1", "Show the link in the status line"], ["2", "Show the link in the command line"] ] }); | completer: function (context) completion.file(context), | completer: function (context) [ ["0", "Don't show link destination"], ["1", "Show the link in the status line"], ["2", "Show the link in the command line"] ] }); |
completer: function (context, args) { if (args.length == 1) return completion.userMapping(context, args, mapmodes); if (args["-javascript"]) return completion.javascript(context); if (args["-ex"]) return completion.ex(context); }, | completer: function () [[array.compact([mode.name.toLowerCase().replace(/_/g, "-"), mode.char]), mode.disp] for (mode in modes.mainModes)], | completer: function (context, args) { if (args.length == 1) return completion.userMapping(context, args, mapmodes); if (args["-javascript"]) return completion.javascript(context); if (args["-ex"]) return completion.ex(context); }, |
})); | }, args)); | completer: function (a, b) compl(a, b, true) })); |
completer: function (context) { context.compare = function () 0; context.completions = [[k, v.prompt] for ([k, v] in Iterator(hints._hintModes))]; }, | completer: function (context) [ ["value", "Match against the value contained by the input field"], ["label", "Match against the value of a label for the input field, if one can be found"], ["name", "Match against the name of an input field, only if neither a name or value could be found."] ] }); | completer: function (context) { context.compare = function () 0; context.completions = [[k, v.prompt] for ([k, v] in Iterator(hints._hintModes))]; }, |
if (args["-javascript"]) return completion.javascript(context); if (args["-ex"]) return completion.ex(context); | if (args.length == 2) { if (args["-javascript"]) return completion.javascript(context); if (args["-ex"]) return completion.ex(context); } | completer: function (context, args) { if (args.length == 1) return completion.userMapping(context, args, mapmodes); if (args["-javascript"]) return completion.javascript(context); if (args["-ex"]) return completion.ex(context); }, |
}).uniq() | }).uniq(); | completer: function (context, args) { context.keys.text = util.identity; context.keys.description = function () seen[this.text] + " matching items"; let seen = {}; context.completions = array(item.description.toLowerCase().split(/[()\s]+/) for (item in params.iterate(args))) .flatten().filter(function (w) /^\w[\w-_']+$/.test(w)) .map(function (k) { seen[k] = (seen[k] || 0) + 1; return k; }).uniq() }, |
completion.bookmark(context, args["-tags"], { keyword: args["-keyword"], title: args["-title"] }); | completion.bookmark(context, args, args["-tags"], { keyword: args["-keyword"], title: args["-title"] }); | completer: function (context, args) { if (!args.bang) { context.title = ["Page URL"]; let frames = buffer.allFrames(); context.completions = [ [win.document.documentURI, frames.length == 1 ? "Current Location" : "Frame: " + win.document.title] for ([, win] in Iterator(frames))]; return; } completion.bookmark(context, args["-tags"], { keyword: args["-keyword"], title: args["-title"] }); }, |
["", "Don't show link destination"], ["status", "Show the link in the status line"], ["command", "Show the link in the command line"] | ["", "Don't show link destinations"], ["status", "Show link destinations in the status line"], ["command", "Show link destinations in the command line"] | completer: function (context) [ ["", "Don't show link destination"], ["status", "Show the link in the status line"], ["command", "Show the link in the command line"] ] }); |
["longest", "Complete to longest common string"], | ["longest", "Complete the longest common string"], | completer: function (context) [ // Why do we need ""? // Because its description is useful during completion. --Kris ["", "Complete only the first match"], ["full", "Complete the next full match"], ["longest", "Complete to longest common string"], ["list", "If more than one match, list all matches"], ["list:full", "List all and complete first match"], ["list:longest", "List all and complete common string"] ], |
["list:longest", "List all and complete common string"] | ["list:longest", "List all and complete the longest common string"] | completer: function (context) [ // Why do we need ""? // Because its description is useful during completion. --Kris ["", "Complete only the first match"], ["full", "Complete the next full match"], ["longest", "Complete to longest common string"], ["list", "If more than one match, list all matches"], ["list:full", "List all and complete first match"], ["list:longest", "List all and complete common string"] ], |
completer: function () config.autocommands.concat([["all", "All events"]]) | completer: function () Iterator(update({ all: "All Events" }, config.autocommands)) | completer: function () config.autocommands.concat([["all", "All events"]]) }); |
completer: function (context) completion.history(context, args["-max"], args["-sort"]), | completer: function (context, args) completion.history(context, args["-max"], args["-sort"]), | completer: function (context) completion.history(context, args["-max"], args["-sort"]), |
return [k for ([k, v] in Iterator(completeOptionMap)) if (completer == completion[v])][0] || "custom"; | return [k for ([k, v] in Iterator(completeOptionMap)) if (completer == completion.closure[v])][0] || "custom"; | function completerToString(completer) { if (completer) return [k for ([k, v] in Iterator(completeOptionMap)) if (completer == completion[v])][0] || "custom"; return ""; } |
filter = context.filter.toLowerCase(); context.anchored = false; context.title = ["Buffer", "URL"]; context.keys = { text: "text", description: "url", icon: "icon" }; context.compare = CompletionContext.Sort.number; let process = context.process[0]; context.process = [function (item, text) <> <span highlight="Indicator" style="display: inline-block; width: 1.5em; text-align: center">{item.item.indicator}</span> { process.call(this, item, text) } </>]; | let filter = context.filter.toLowerCase(); let defItem = { parent: { getTitle: function () "" } }; let tabGroups = {}; tabs.getGroups(); tabs.allTabs.forEach(function (tab, i) { let group = (tab.tabItem || defItem).parent || defItem.parent; if (!set.has(tabGroups, group.id)) tabGroups[group.id] = [group.getTitle(), []]; group = tabGroups[group.id]; group[1].push([i, tab.linkedBrowser]); }); | completion: function () { completion.alternateStyleSheet = function alternateStylesheet(context) { context.title = ["Stylesheet", "Location"]; // unify split style sheets let styles = {}; buffer.alternateStyleSheets.forEach(function (style) { if (!(style.title in styles)) styles[style.title] = []; styles[style.title].push(style.href || "inline"); }); context.completions = [[s, styles[s].join(", ")] for (s in styles)]; }; completion.buffer = function buffer(context) { filter = context.filter.toLowerCase(); context.anchored = false; context.title = ["Buffer", "URL"]; context.keys = { text: "text", description: "url", icon: "icon" }; context.compare = CompletionContext.Sort.number; let process = context.process[0]; context.process = [function (item, text) <> <span highlight="Indicator" style="display: inline-block; width: 1.5em; text-align: center">{item.item.indicator}</span> { process.call(this, item, text) } </>]; context.completions = util.map(tabs.browsers, function ([i, browser]) { let indicator = " "; if (i == tabs.index()) indicator = "%" else if (i == tabs.index(tabs.alternate)) indicator = "#"; let tab = tabs.getTab(i); let url = browser.contentDocument.location.href; i = i + 1; return { text: [i + ": " + (tab.label || "(Untitled)"), i + ": " + url], url: template.highlightURL(url), indicator: indicator, icon: tab.image || DEFAULT_FAVICON }; }); }; }, |
context.completions = util.map(tabs.browsers, function ([i, browser]) { let indicator = " "; if (i == tabs.index()) indicator = "%" else if (i == tabs.index(tabs.alternate)) indicator = "#"; | let orig = context; for (let [id, [name, browsers]] in Iterator(tabGroups)) { context = orig.fork(id, 0); context.anchored = false; context.title = [name || "Buffers"]; context.keys = { text: "text", description: "url", icon: "icon" }; context.compare = CompletionContext.Sort.number; let process = context.process[0]; context.process = [function (item, text) <> <span highlight="Indicator" style="display: inline-block; width: 1.5em; text-align: center">{item.item.indicator}</span> { process.call(this, item, text) } </>]; | completion: function () { completion.alternateStyleSheet = function alternateStylesheet(context) { context.title = ["Stylesheet", "Location"]; // unify split style sheets let styles = {}; buffer.alternateStyleSheets.forEach(function (style) { if (!(style.title in styles)) styles[style.title] = []; styles[style.title].push(style.href || "inline"); }); context.completions = [[s, styles[s].join(", ")] for (s in styles)]; }; completion.buffer = function buffer(context) { filter = context.filter.toLowerCase(); context.anchored = false; context.title = ["Buffer", "URL"]; context.keys = { text: "text", description: "url", icon: "icon" }; context.compare = CompletionContext.Sort.number; let process = context.process[0]; context.process = [function (item, text) <> <span highlight="Indicator" style="display: inline-block; width: 1.5em; text-align: center">{item.item.indicator}</span> { process.call(this, item, text) } </>]; context.completions = util.map(tabs.browsers, function ([i, browser]) { let indicator = " "; if (i == tabs.index()) indicator = "%" else if (i == tabs.index(tabs.alternate)) indicator = "#"; let tab = tabs.getTab(i); let url = browser.contentDocument.location.href; i = i + 1; return { text: [i + ": " + (tab.label || "(Untitled)"), i + ": " + url], url: template.highlightURL(url), indicator: indicator, icon: tab.image || DEFAULT_FAVICON }; }); }; }, |
let tab = tabs.getTab(i); let url = browser.contentDocument.location.href; i = i + 1; | context.completions = util.map(util.Array.itervalues(browsers), function ([i, browser]) { let indicator = " "; if (i == tabs.index()) indicator = "%" else if (i == tabs.index(tabs.alternate)) indicator = "#"; | completion: function () { completion.alternateStyleSheet = function alternateStylesheet(context) { context.title = ["Stylesheet", "Location"]; // unify split style sheets let styles = {}; buffer.alternateStyleSheets.forEach(function (style) { if (!(style.title in styles)) styles[style.title] = []; styles[style.title].push(style.href || "inline"); }); context.completions = [[s, styles[s].join(", ")] for (s in styles)]; }; completion.buffer = function buffer(context) { filter = context.filter.toLowerCase(); context.anchored = false; context.title = ["Buffer", "URL"]; context.keys = { text: "text", description: "url", icon: "icon" }; context.compare = CompletionContext.Sort.number; let process = context.process[0]; context.process = [function (item, text) <> <span highlight="Indicator" style="display: inline-block; width: 1.5em; text-align: center">{item.item.indicator}</span> { process.call(this, item, text) } </>]; context.completions = util.map(tabs.browsers, function ([i, browser]) { let indicator = " "; if (i == tabs.index()) indicator = "%" else if (i == tabs.index(tabs.alternate)) indicator = "#"; let tab = tabs.getTab(i); let url = browser.contentDocument.location.href; i = i + 1; return { text: [i + ": " + (tab.label || "(Untitled)"), i + ": " + url], url: template.highlightURL(url), indicator: indicator, icon: tab.image || DEFAULT_FAVICON }; }); }; }, |
return { text: [i + ": " + (tab.label || "(Untitled)"), i + ": " + url], url: template.highlightURL(url), indicator: indicator, icon: tab.image || DEFAULT_FAVICON }; }); | let tab = tabs.getTab(i); let url = browser.contentDocument.location.href; i = i + 1; return { text: [i + ": " + (tab.label || "(Untitled)"), i + ": " + url], url: template.highlightURL(url), indicator: indicator, icon: tab.image || DEFAULT_FAVICON }; }); } | completion: function () { completion.alternateStyleSheet = function alternateStylesheet(context) { context.title = ["Stylesheet", "Location"]; // unify split style sheets let styles = {}; buffer.alternateStyleSheets.forEach(function (style) { if (!(style.title in styles)) styles[style.title] = []; styles[style.title].push(style.href || "inline"); }); context.completions = [[s, styles[s].join(", ")] for (s in styles)]; }; completion.buffer = function buffer(context) { filter = context.filter.toLowerCase(); context.anchored = false; context.title = ["Buffer", "URL"]; context.keys = { text: "text", description: "url", icon: "icon" }; context.compare = CompletionContext.Sort.number; let process = context.process[0]; context.process = [function (item, text) <> <span highlight="Indicator" style="display: inline-block; width: 1.5em; text-align: center">{item.item.indicator}</span> { process.call(this, item, text) } </>]; context.completions = util.map(tabs.browsers, function ([i, browser]) { let indicator = " "; if (i == tabs.index()) indicator = "%" else if (i == tabs.index(tabs.alternate)) indicator = "#"; let tab = tabs.getTab(i); let url = browser.contentDocument.location.href; i = i + 1; return { text: [i + ": " + (tab.label || "(Untitled)"), i + ": " + url], url: template.highlightURL(url), indicator: indicator, icon: tab.image || DEFAULT_FAVICON }; }); }; }, |
context.keys.icon = 2; context.incomplete = true; context.hasItems = context.completions.length > 0; context.filterFunc = null; context.cancel = function () { if (searchRunning) { services.get("autoCompleteSearch").stopSearch(); searchRunning = false; } }; context.compare = CompletionContext.Sort.unsorted; | context.cancel = function () { if (searchRunning) { services.get("autoCompleteSearch").stopSearch(); searchRunning = false; } }; if (searchRunning) services.get("autoCompleteSearch").stopSearch(); | completion: function () { var searchRunning = false; // only until Firefox fixes https://bugzilla.mozilla.org/show_bug.cgi?id=510589 completion.location = function location(context) { if (!services.get("autoCompleteSearch")) return; context.anchored = false; context.title = ["Smart Completions"]; context.keys.icon = 2; context.incomplete = true; context.hasItems = context.completions.length > 0; // XXX context.filterFunc = null; context.cancel = function () { if (searchRunning) { services.get("autoCompleteSearch").stopSearch(); searchRunning = false; } }; context.compare = CompletionContext.Sort.unsorted; let timer = new Timer(50, 100, function (result) { context.incomplete = result.searchResult >= result.RESULT_NOMATCH_ONGOING; context.completions = [ [result.getValueAt(i), result.getCommentAt(i), result.getImageAt(i)] for (i in util.range(0, result.matchCount)) ]; }); if (searchRunning) services.get("autoCompleteSearch").stopSearch(); searchRunning = true; services.get("autoCompleteSearch").startSearch(context.filter, "", context.result, { onSearchResult: function onSearchResult(search, result) { timer.tell(result); if (result.searchResult <= result.RESULT_SUCCESS) { searchRunning = false; timer.flush(); } } }); }; completion.sidebar = function sidebar(context) { let menu = document.getElementById("viewSidebarMenu"); context.title = ["Sidebar Panel"]; context.completions = Array.map(menu.childNodes, function (n) [n.label, ""]); }; completion.addUrlCompleter("l", "Firefox location bar entries (bookmarks and history sorted in an intelligent way)", completion.location); }, |
if (searchRunning) services.get("autoCompleteSearch").stopSearch(); searchRunning = true; | completion: function () { var searchRunning = false; // only until Firefox fixes https://bugzilla.mozilla.org/show_bug.cgi?id=510589 completion.location = function location(context) { if (!services.get("autoCompleteSearch")) return; context.anchored = false; context.title = ["Smart Completions"]; context.keys.icon = 2; context.incomplete = true; context.hasItems = context.completions.length > 0; // XXX context.filterFunc = null; context.cancel = function () { if (searchRunning) { services.get("autoCompleteSearch").stopSearch(); searchRunning = false; } }; context.compare = CompletionContext.Sort.unsorted; let timer = new Timer(50, 100, function (result) { context.incomplete = result.searchResult >= result.RESULT_NOMATCH_ONGOING; context.completions = [ [result.getValueAt(i), result.getCommentAt(i), result.getImageAt(i)] for (i in util.range(0, result.matchCount)) ]; }); if (searchRunning) services.get("autoCompleteSearch").stopSearch(); searchRunning = true; services.get("autoCompleteSearch").startSearch(context.filter, "", context.result, { onSearchResult: function onSearchResult(search, result) { timer.tell(result); if (result.searchResult <= result.RESULT_SUCCESS) { searchRunning = false; timer.flush(); } } }); }; completion.sidebar = function sidebar(context) { let menu = document.getElementById("viewSidebarMenu"); context.title = ["Sidebar Panel"]; context.completions = Array.map(menu.childNodes, function (n) [n.label, ""]); }; completion.addUrlCompleter("l", "Firefox location bar entries (bookmarks and history sorted in an intelligent way)", completion.location); }, |
|
searchRunning = true; | completion: function () { var searchRunning = false; // only until Firefox fixes https://bugzilla.mozilla.org/show_bug.cgi?id=510589 completion.location = function location(context) { if (!services.get("autoCompleteSearch")) return; context.anchored = false; context.title = ["Smart Completions"]; context.keys.icon = 2; context.incomplete = true; context.hasItems = context.completions.length > 0; // XXX context.filterFunc = null; context.cancel = function () { if (searchRunning) { services.get("autoCompleteSearch").stopSearch(); searchRunning = false; } }; context.compare = CompletionContext.Sort.unsorted; let timer = new Timer(50, 100, function (result) { context.incomplete = result.searchResult >= result.RESULT_NOMATCH_ONGOING; context.completions = [ [result.getValueAt(i), result.getCommentAt(i), result.getImageAt(i)] for (i in util.range(0, result.matchCount)) ]; }); if (searchRunning) services.get("autoCompleteSearch").stopSearch(); searchRunning = true; services.get("autoCompleteSearch").startSearch(context.filter, "", context.result, { onSearchResult: function onSearchResult(search, result) { timer.tell(result); if (result.searchResult <= result.RESULT_SUCCESS) { searchRunning = false; timer.flush(); } } }); }; completion.sidebar = function sidebar(context) { let menu = document.getElementById("viewSidebarMenu"); context.title = ["Sidebar Panel"]; context.completions = Array.map(menu.childNodes, function (n) [n.label, ""]); }; completion.addUrlCompleter("l", "Firefox location bar entries (bookmarks and history sorted in an intelligent way)", completion.location); }, |
|
if (!args.completeOpt && command.completer) { | if (!args.completeOpt && command.completer && args.completeStart != null) { | completion: function () { completion.command = function command(context) { context.title = ["Command"]; context.keys = { text: "longNames", description: "description" }; context.completions = [k for (k in commands)]; }; // provides completions for ex commands, including their arguments completion.ex = function ex(context) { // if there is no space between the command name and the cursor // then get completions of the command name for (var [command, args] in commands.parseCommands(context.filter, context)) if (args.trailing) context.advance(args.commandString.length + 1); if (!args) args = { commandString: context.filter }; let [, prefix, junk] = args.commandString.match(/^(:*\s*\d*\s*)\w*(.?)/) || []; context.advance(prefix.length); if (!junk) { context.fork("", 0, this, "command"); return; } // dynamically get completions as specified with the command's completer function context.highlight(); if (!command) { context.highlight(0, args.commandName && args.commandName.length, "SPELLCHECK"); return; } [prefix] = args.commandString.match(/^(?:\w*[\s!])?\s*/); let cmdContext = context.fork(command.name, prefix.length); try { if (!cmdContext.waitingForTab) { if (!args.completeOpt && command.completer) { cmdContext.advance(args.completeStart); cmdContext.quote = args.quote; cmdContext.filter = args.completeFilter; command.completer.call(command, cmdContext, args); } } } catch (e) { dactyl.reportError(e); } }; completion.userCommand = function userCommand(context) { context.title = ["User Command", "Definition"]; context.keys = { text: "name", description: "replacementText" }; context.completions = commands.getUserCommands(); }; }, |
context.keys = { text: "name", description: "description", icon: "icon" }, context.completions = liberator.extensions; | context.keys = { text: "name", description: "description", icon: "iconURL" }, context.incomplete = true; AddonManager.getAddonsByTypes(["extension"], function (addons) { context.incomplete = false; context.completions = addons; }); | completion: function () { completion.dialog = function dialog(context) { context.title = ["Dialog"]; context.completions = config.dialogs; }; completion.extension = function extension(context) { context.title = ["Extension"]; context.anchored = false; context.keys = { text: "name", description: "description", icon: "icon" }, context.completions = liberator.extensions; }; completion.help = function help(context, unchunked) { liberator.initHelp(); context.title = ["Help"]; context.anchored = false; context.completions = services.get("liberator:").HELP_TAGS; if (unchunked) context.keys = { text: 0, description: function () "all" }; }; completion.menuItem = function menuItem(context) { context.title = ["Menu Path", "Label"]; context.anchored = false; context.keys = { text: "fullMenuPath", description: function (item) item.getAttribute("label") }; context.completions = liberator.menuItems; }; var toolbox = document.getElementById("navigator-toolbox"); completion.toolbar = function toolbar(context) { context.title = ["Toolbar"]; context.keys = { text: function (item) item.getAttribute("toolbarname"), description: function () "" }; context.completions = util.evaluateXPath("./*[@toolbarname]", document, toolbox); }; completion.window = function window(context) { context.title = ["Window", "Title"] context.keys = { text: function (win) liberator.windows.indexOf(win) + 1, description: function (win) win.document.title }; context.completions = liberator.windows; }; }, |
const { CompletionContext, completion } = modules; | const { CompletionContext, bookmarkcache, bookmarks, completion } = modules; | completion: function (dactyl, modules, window) { const { CompletionContext, completion } = modules; const { document } = window; var searchRunning = false; // only until Firefox fixes https://bugzilla.mozilla.org/show_bug.cgi?id=510589 completion.location = function location(context) { if (!services.autoCompleteSearch) return; context.anchored = false; context.compare = CompletionContext.Sort.unsorted; context.filterFunc = null; context.hasItems = context.completions.length > 0; // XXX context.incomplete = true; context.format = bookmarks.format; context.keys.extra = function (item) (bookmarkcache.get(item.url) || {}).extra; context.title = ["Smart Completions"]; context.cancel = function () { if (searchRunning) { services.autoCompleteSearch.stopSearch(); searchRunning = false; } }; if (searchRunning) services.autoCompleteSearch.stopSearch(); let timer = new Timer(50, 100, function (result) { context.incomplete = result.searchResult >= result.RESULT_NOMATCH_ONGOING; context.completions = [ { url: result.getValueAt(i), title: result.getCommentAt(i), icon: result.getImageAt(i) } for (i in util.range(0, result.matchCount)) ]; }); services.autoCompleteSearch.startSearch(context.filter, "", context.result, { onSearchResult: function onSearchResult(search, result) { timer.tell(result); if (result.searchResult <= result.RESULT_SUCCESS) { searchRunning = false; timer.flush(); } } }); searchRunning = true; }; completion.sidebar = function sidebar(context) { let menu = document.getElementById("viewSidebarMenu"); context.title = ["Sidebar Panel"]; context.completions = Array.map(menu.childNodes, function (n) [n.label, ""]); }; completion.addUrlCompleter("l", "Firefox location bar entries (bookmarks and history sorted in an intelligent way)", completion.location); }, |
let toolbox = document.getElementById("navigator-toolbox"); | completion: function () { completion.dialog = function dialog(context) { context.title = ["Dialog"]; context.completions = config.dialogs; }; completion.extension = function extension(context) { context.title = ["Extension"]; context.anchored = false; context.keys = { text: "name", description: "description", icon: "icon" }, context.completions = liberator.extensions; }; completion.help = function help(context, unchunked) { context.title = ["Help"]; context.anchored = false; context.completions = services.get("liberator:").HELP_TAGS; if (unchunked) context.keys = { text: 0, description: function () "all" }; }; completion.menuItem = function menuItem(context) { context.title = ["Menu Path", "Label"]; context.anchored = false; context.keys = { text: "fullMenuPath", description: function (item) item.getAttribute("label") }; context.completions = liberator.menuItems; }; completion.toolbar = function toolbar(context) { context.title = ["Toolbar"]; context.keys = { text: function (item) item.getAttribute("toolbarname"), description: function () "" }; context.completions = util.evaluateXPath("./*[@toolbarname]", document, toolbox); }; completion.window = function window(context) { context.title = ["Window", "Title"] context.keys = { text: function (win) liberator.windows.indexOf(win) + 1, description: function (win) win.document.title }; context.completions = liberator.windows; }; }, |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.