rem
stringlengths
0
126k
add
stringlengths
0
441k
context
stringlengths
15
136k
args.completer.call(self, context, args.obj);
args.completer.call(self, context, args);
_fill: function (context, args) { context.title = [args.name]; context.anchored = args.anchored; context.filter = args.filter; context.itemCache = context.parent.itemCache; context.key = args.name + args.last; if (args.last != null) context.quote = [args.last, function (text) util.escapeString(text.substr(args.offset), ""), args.last]; else // We're not looking for a quoted string, so filter out anything that's not a valid identifier context.filters.push(function (item) /^[a-zA-Z_$][\w$]*$/.test(item.text)); args.completer.call(self, context, args.obj); },
context.key = name;
context.key = name + last;
_fill: function (context, obj, name, compl, anchored, key, last, offset) { context.title = [name]; context.anchored = anchored; context.filter = key; context.itemCache = context.parent.itemCache; context.key = name; if (last != null) context.quote = [last, function (text) util.escapeString(text.substr(offset), ""), last]; else // We're not looking for a quoted string, so filter out anything that's not a valid identifier context.filters.push(function (item) /^[a-zA-Z_$][\w$]*$/.test(item.text)); compl.call(self, context, obj); },
if (queue && queue.members.length ) {
if (queue && queue.getMembers().length ) {
_flushinvokeLastQueue: function() { var queue = this._invokeLastQueue, hadContent = NO ; if (queue && queue.members.length ) { this._invokeLastQueue = null; // reset queue. hadContent = YES; // has targets! if (hadContent) queue.invokeMethods(); } return hadContent ; }
rect = elem.getClientRects()[0] || rect;
_generate: function (win) { if (!win) win = window.content; let doc = win.document; let height = win.innerHeight; let width = win.innerWidth; let [offsetX, offsetY] = this._getContainerOffsets(doc); let baseNodeAbsolute = util.xmlToDom(<span highlight="Hint"/>, doc); let res = util.evaluateXPath(this._hintMode.tags(), doc, null, true); let fragment = util.xmlToDom(<div highlight="hints"/>, doc); let start = this._pageHints.length; for (let elem in res) { let hint = { elem: elem, showText: false }; // TODO: for iframes, this calculation is wrong let rect = elem.getBoundingClientRect(); if (!rect || rect.top > height || rect.bottom < 0 || rect.left > width || rect.right < 0) continue; let computedStyle = doc.defaultView.getComputedStyle(elem, null); if (computedStyle.getPropertyValue("visibility") != "visible" || computedStyle.getPropertyValue("display") == "none") continue; if (isinstance(elem, [HTMLInputElement, HTMLSelectElement, HTMLTextAreaElement])) [hint.text, hint.showText] = this._getInputHint(elem, doc); else hint.text = elem.textContent.toLowerCase(); hint.span = baseNodeAbsolute.cloneNode(true); let leftPos = Math.max((rect.left + offsetX), offsetX); let topPos = Math.max((rect.top + offsetY), offsetY); if (elem instanceof HTMLAreaElement) [leftPos, topPos] = this._getAreaOffset(elem, leftPos, topPos); hint.span.style.left = leftPos + "px"; hint.span.style.top = topPos + "px"; fragment.appendChild(hint.span); this._pageHints.push(hint); } let body = doc.body || util.evaluateXPath(["body"], doc).snapshotItem(0); if (body) { body.appendChild(fragment); this._docs.push({ doc: doc, start: start, end: this._pageHints.length - 1 }); } // also _generate hints for frames Array.forEach(win.frames, this.closure._generate); return true; },
for (let elem in res) {
let elem; while (elem = res.iterateNext()) {
_generate: function (win) { if (!win) win = window.content; let doc = win.document; let height = win.innerHeight; let width = win.innerWidth; let [offsetX, offsetY] = this._getContainerOffsets(doc); let baseNodeAbsolute = util.xmlToDom(<span highlight="Hint"/>, doc); let res = util.evaluateXPath(this._hintMode.tags(), doc, null, true); let fragment = util.xmlToDom(<div highlight="hints"/>, doc); let start = this._pageHints.length; for (let elem in res) { let hint = { elem: elem, showText: false }; // TODO: for iframes, this calculation is wrong rect = elem.getBoundingClientRect(); if (!rect || rect.top > height || rect.bottom < 0 || rect.left > width || rect.right < 0) continue; rect = elem.getClientRects()[0]; if (!rect) continue; let computedStyle = doc.defaultView.getComputedStyle(elem, null); if (computedStyle.getPropertyValue("visibility") != "visible" || computedStyle.getPropertyValue("display") == "none") continue; if (elem instanceof HTMLInputElement || elem instanceof HTMLSelectElement || elem instanceof HTMLTextAreaElement) [hint.text, hint.showText] = this._getInputHint(elem, doc); else hint.text = elem.textContent.toLowerCase(); hint.span = baseNodeAbsolute.cloneNode(true); let leftPos = Math.max((rect.left + offsetX), offsetX); let topPos = Math.max((rect.top + offsetY), offsetY); if (elem instanceof HTMLAreaElement) [leftPos, topPos] = this._getAreaOffset(elem, leftPos, topPos); hint.span.style.left = leftPos + "px"; hint.span.style.top = topPos + "px"; fragment.appendChild(hint.span); this._pageHints.push(hint); } let body = doc.body || util.evaluateXPath(["body"], doc).snapshotItem(0); if (body) { body.appendChild(fragment); this._docs.push({ doc: doc, start: start, end: this._pageHints.length - 1 }); } // also _generate hints for frames Array.forEach(win.frames, this.closure._generate); return true; },
if (!this._top) { this._top = win; win.addEventListener("resize", this._resizeTimer.closure.tell, true); }
_generate: function (win) { if (!win) win = window.content; if (!this._top) { this._top = win; win.addEventListener("resize", this._resizeTimer.closure.tell, true); } let doc = win.document; let height = win.innerHeight; let width = win.innerWidth; let [offsetX, offsetY] = this._getContainerOffsets(doc); let baseNodeAbsolute = util.xmlToDom(<span highlight="Hint"/>, doc); let res = util.evaluateXPath(this._hintMode.xpath, doc, null, true); let fragment = util.xmlToDom(<div highlight="hints"/>, doc); let start = this._pageHints.length; for (let elem in res) { let hint = { elem: elem, showText: false }; // TODO: for iframes, this calculation is wrong let rect = elem.getBoundingClientRect(); if (!rect || !rect.width || !rect.height || rect.top > height || rect.bottom < 0 || rect.left > width || rect.right < 0) continue; let computedStyle = doc.defaultView.getComputedStyle(elem, null); if (computedStyle.visibility != "visible" || computedStyle.display == "none") continue; if (isinstance(elem, [HTMLInputElement, HTMLSelectElement, HTMLTextAreaElement])) [hint.text, hint.showText] = this._getInputHint(elem, doc); else hint.text = elem.textContent.toLowerCase(); hint.span = baseNodeAbsolute.cloneNode(true); rect = elem.getClientRects()[0] || rect; let leftPos = Math.max((rect.left + offsetX), offsetX); let topPos = Math.max((rect.top + offsetY), offsetY); if (elem instanceof HTMLAreaElement) [leftPos, topPos] = this._getAreaOffset(elem, leftPos, topPos); hint.span.style.left = leftPos + "px"; hint.span.style.top = topPos + "px"; fragment.appendChild(hint.span); this._pageHints.push(hint); } let body = doc.body || util.evaluateXPath(["body"], doc).snapshotItem(0); if (body) { body.appendChild(fragment); this._docs.push({ doc: doc, start: start, end: this._pageHints.length - 1 }); } // also _generate hints for frames Array.forEach(win.frames, this.closure._generate); return true; },
let height = win.innerHeight; let width = win.innerWidth;
_generate: function (win) { if (!win) win = config.browser.contentWindow; let doc = win.document; let height = win.innerHeight; let width = win.innerWidth; let [offsetX, offsetY] = this._getContainerOffsets(doc); let baseNodeAbsolute = util.xmlToDom(<span highlight="Hint"/>, doc); let res = util.evaluateXPath(this._hintMode.tags(), doc, null, true); let fragment = util.xmlToDom(<div highlight="hints"/>, doc); let start = this._pageHints.length; let elem; while (elem = res.iterateNext()) { let hint = { elem: elem, showText: false }; // TODO: for iframes, this calculation is wrong rect = elem.getBoundingClientRect(); if (!rect || rect.top > height || rect.bottom < 0 || rect.left > width || rect.right < 0) continue; rect = elem.getClientRects()[0]; if (!rect) continue; let computedStyle = doc.defaultView.getComputedStyle(elem, null); if (computedStyle.getPropertyValue("visibility") != "visible" || computedStyle.getPropertyValue("display") == "none") continue; if (elem instanceof HTMLInputElement || elem instanceof HTMLSelectElement || elem instanceof HTMLTextAreaElement) [hint.text, hint.showText] = this._getInputHint(elem, doc); else hint.text = elem.textContent.toLowerCase(); hint.span = baseNodeAbsolute.cloneNode(true); let leftPos = Math.max((rect.left + offsetX), offsetX); let topPos = Math.max((rect.top + offsetY), offsetY); if (elem instanceof HTMLAreaElement) [leftPos, topPos] = this._getAreaOffset(elem, leftPos, topPos); hint.span.style.left = leftPos + "px"; hint.span.style.top = topPos + "px"; fragment.appendChild(hint.span); this._pageHints.push(hint); } let body = doc.body || util.evaluateXPath(["body"], doc).snapshotItem(0); if (body) { body.appendChild(fragment); this._docs.push({ doc: doc, start: start, end: this._pageHints.length - 1 }); } // also _generate hints for frames Array.forEach(win.frames, this.closure._generate); return true; },
while (elem = res.iterateNext()) {
let that = this; function makeHint (elem) { let rect = elem.getClientRects()[0];
_generate: function (win) { if (!win) win = config.browser.contentWindow; let doc = win.document; let height = win.innerHeight; let width = win.innerWidth; let [offsetX, offsetY] = this._getContainerOffsets(doc); let baseNodeAbsolute = util.xmlToDom(<span highlight="Hint"/>, doc); let res = util.evaluateXPath(this._hintMode.tags(), doc, null, true); let fragment = util.xmlToDom(<div highlight="hints"/>, doc); let start = this._pageHints.length; let elem; while (elem = res.iterateNext()) { let hint = { elem: elem, showText: false }; // TODO: for iframes, this calculation is wrong rect = elem.getBoundingClientRect(); if (!rect || rect.top > height || rect.bottom < 0 || rect.left > width || rect.right < 0) continue; rect = elem.getClientRects()[0]; if (!rect) continue; let computedStyle = doc.defaultView.getComputedStyle(elem, null); if (computedStyle.getPropertyValue("visibility") != "visible" || computedStyle.getPropertyValue("display") == "none") continue; if (elem instanceof HTMLInputElement || elem instanceof HTMLSelectElement || elem instanceof HTMLTextAreaElement) [hint.text, hint.showText] = this._getInputHint(elem, doc); else hint.text = elem.textContent.toLowerCase(); hint.span = baseNodeAbsolute.cloneNode(true); let leftPos = Math.max((rect.left + offsetX), offsetX); let topPos = Math.max((rect.top + offsetY), offsetY); if (elem instanceof HTMLAreaElement) [leftPos, topPos] = this._getAreaOffset(elem, leftPos, topPos); hint.span.style.left = leftPos + "px"; hint.span.style.top = topPos + "px"; fragment.appendChild(hint.span); this._pageHints.push(hint); } let body = doc.body || util.evaluateXPath(["body"], doc).snapshotItem(0); if (body) { body.appendChild(fragment); this._docs.push({ doc: doc, start: start, end: this._pageHints.length - 1 }); } // also _generate hints for frames Array.forEach(win.frames, this.closure._generate); return true; },
rect = elem.getBoundingClientRect(); if (!rect || rect.top > height || rect.bottom < 0 || rect.left > width || rect.right < 0) continue; rect = elem.getClientRects()[0]; if (!rect) continue; let computedStyle = doc.defaultView.getComputedStyle(elem, null); if (computedStyle.getPropertyValue("visibility") != "visible" || computedStyle.getPropertyValue("display") == "none") continue;
_generate: function (win) { if (!win) win = config.browser.contentWindow; let doc = win.document; let height = win.innerHeight; let width = win.innerWidth; let [offsetX, offsetY] = this._getContainerOffsets(doc); let baseNodeAbsolute = util.xmlToDom(<span highlight="Hint"/>, doc); let res = util.evaluateXPath(this._hintMode.tags(), doc, null, true); let fragment = util.xmlToDom(<div highlight="hints"/>, doc); let start = this._pageHints.length; let elem; while (elem = res.iterateNext()) { let hint = { elem: elem, showText: false }; // TODO: for iframes, this calculation is wrong rect = elem.getBoundingClientRect(); if (!rect || rect.top > height || rect.bottom < 0 || rect.left > width || rect.right < 0) continue; rect = elem.getClientRects()[0]; if (!rect) continue; let computedStyle = doc.defaultView.getComputedStyle(elem, null); if (computedStyle.getPropertyValue("visibility") != "visible" || computedStyle.getPropertyValue("display") == "none") continue; if (elem instanceof HTMLInputElement || elem instanceof HTMLSelectElement || elem instanceof HTMLTextAreaElement) [hint.text, hint.showText] = this._getInputHint(elem, doc); else hint.text = elem.textContent.toLowerCase(); hint.span = baseNodeAbsolute.cloneNode(true); let leftPos = Math.max((rect.left + offsetX), offsetX); let topPos = Math.max((rect.top + offsetY), offsetY); if (elem instanceof HTMLAreaElement) [leftPos, topPos] = this._getAreaOffset(elem, leftPos, topPos); hint.span.style.left = leftPos + "px"; hint.span.style.top = topPos + "px"; fragment.appendChild(hint.span); this._pageHints.push(hint); } let body = doc.body || util.evaluateXPath(["body"], doc).snapshotItem(0); if (body) { body.appendChild(fragment); this._docs.push({ doc: doc, start: start, end: this._pageHints.length - 1 }); } // also _generate hints for frames Array.forEach(win.frames, this.closure._generate); return true; },
[hint.text, hint.showText] = this._getInputHint(elem, doc);
[hint.text, hint.showText] = that._getInputHint(elem, doc);
_generate: function (win) { if (!win) win = config.browser.contentWindow; let doc = win.document; let height = win.innerHeight; let width = win.innerWidth; let [offsetX, offsetY] = this._getContainerOffsets(doc); let baseNodeAbsolute = util.xmlToDom(<span highlight="Hint"/>, doc); let res = util.evaluateXPath(this._hintMode.tags(), doc, null, true); let fragment = util.xmlToDom(<div highlight="hints"/>, doc); let start = this._pageHints.length; let elem; while (elem = res.iterateNext()) { let hint = { elem: elem, showText: false }; // TODO: for iframes, this calculation is wrong rect = elem.getBoundingClientRect(); if (!rect || rect.top > height || rect.bottom < 0 || rect.left > width || rect.right < 0) continue; rect = elem.getClientRects()[0]; if (!rect) continue; let computedStyle = doc.defaultView.getComputedStyle(elem, null); if (computedStyle.getPropertyValue("visibility") != "visible" || computedStyle.getPropertyValue("display") == "none") continue; if (elem instanceof HTMLInputElement || elem instanceof HTMLSelectElement || elem instanceof HTMLTextAreaElement) [hint.text, hint.showText] = this._getInputHint(elem, doc); else hint.text = elem.textContent.toLowerCase(); hint.span = baseNodeAbsolute.cloneNode(true); let leftPos = Math.max((rect.left + offsetX), offsetX); let topPos = Math.max((rect.top + offsetY), offsetY); if (elem instanceof HTMLAreaElement) [leftPos, topPos] = this._getAreaOffset(elem, leftPos, topPos); hint.span.style.left = leftPos + "px"; hint.span.style.top = topPos + "px"; fragment.appendChild(hint.span); this._pageHints.push(hint); } let body = doc.body || util.evaluateXPath(["body"], doc).snapshotItem(0); if (body) { body.appendChild(fragment); this._docs.push({ doc: doc, start: start, end: this._pageHints.length - 1 }); } // also _generate hints for frames Array.forEach(win.frames, this.closure._generate); return true; },
[leftPos, topPos] = this._getAreaOffset(elem, leftPos, topPos);
[leftPos, topPos] = that._getAreaOffset(elem, leftPos, topPos);
_generate: function (win) { if (!win) win = config.browser.contentWindow; let doc = win.document; let height = win.innerHeight; let width = win.innerWidth; let [offsetX, offsetY] = this._getContainerOffsets(doc); let baseNodeAbsolute = util.xmlToDom(<span highlight="Hint"/>, doc); let res = util.evaluateXPath(this._hintMode.tags(), doc, null, true); let fragment = util.xmlToDom(<div highlight="hints"/>, doc); let start = this._pageHints.length; let elem; while (elem = res.iterateNext()) { let hint = { elem: elem, showText: false }; // TODO: for iframes, this calculation is wrong rect = elem.getBoundingClientRect(); if (!rect || rect.top > height || rect.bottom < 0 || rect.left > width || rect.right < 0) continue; rect = elem.getClientRects()[0]; if (!rect) continue; let computedStyle = doc.defaultView.getComputedStyle(elem, null); if (computedStyle.getPropertyValue("visibility") != "visible" || computedStyle.getPropertyValue("display") == "none") continue; if (elem instanceof HTMLInputElement || elem instanceof HTMLSelectElement || elem instanceof HTMLTextAreaElement) [hint.text, hint.showText] = this._getInputHint(elem, doc); else hint.text = elem.textContent.toLowerCase(); hint.span = baseNodeAbsolute.cloneNode(true); let leftPos = Math.max((rect.left + offsetX), offsetX); let topPos = Math.max((rect.top + offsetY), offsetY); if (elem instanceof HTMLAreaElement) [leftPos, topPos] = this._getAreaOffset(elem, leftPos, topPos); hint.span.style.left = leftPos + "px"; hint.span.style.top = topPos + "px"; fragment.appendChild(hint.span); this._pageHints.push(hint); } let body = doc.body || util.evaluateXPath(["body"], doc).snapshotItem(0); if (body) { body.appendChild(fragment); this._docs.push({ doc: doc, start: start, end: this._pageHints.length - 1 }); } // also _generate hints for frames Array.forEach(win.frames, this.closure._generate); return true; },
this._pageHints.push(hint);
that._pageHints.push(hint); } while (elem = res.iterateNext()) { let rect = elem.getBoundingClientRect(); if (rect.width == 0 || rect.height == 0) { let hasFloatChild = false; for (let i = 0; i < elem.childNodes.length; i++) { if (elem.childNodes[i].nodeType != 1) continue; let computedStyle = doc.defaultView.getComputedStyle(elem.childNodes[i], null); if (computedStyle.getPropertyValue('float') != 'none' && this._isVisible(elem.childNodes[i], win)) { makeHint(elem.childNodes[i]); hasFloatChild = true; break; } } if (hasFloatChild) continue; } if (this._isVisible(elem, win)) makeHint(elem);
_generate: function (win) { if (!win) win = config.browser.contentWindow; let doc = win.document; let height = win.innerHeight; let width = win.innerWidth; let [offsetX, offsetY] = this._getContainerOffsets(doc); let baseNodeAbsolute = util.xmlToDom(<span highlight="Hint"/>, doc); let res = util.evaluateXPath(this._hintMode.tags(), doc, null, true); let fragment = util.xmlToDom(<div highlight="hints"/>, doc); let start = this._pageHints.length; let elem; while (elem = res.iterateNext()) { let hint = { elem: elem, showText: false }; // TODO: for iframes, this calculation is wrong rect = elem.getBoundingClientRect(); if (!rect || rect.top > height || rect.bottom < 0 || rect.left > width || rect.right < 0) continue; rect = elem.getClientRects()[0]; if (!rect) continue; let computedStyle = doc.defaultView.getComputedStyle(elem, null); if (computedStyle.getPropertyValue("visibility") != "visible" || computedStyle.getPropertyValue("display") == "none") continue; if (elem instanceof HTMLInputElement || elem instanceof HTMLSelectElement || elem instanceof HTMLTextAreaElement) [hint.text, hint.showText] = this._getInputHint(elem, doc); else hint.text = elem.textContent.toLowerCase(); hint.span = baseNodeAbsolute.cloneNode(true); let leftPos = Math.max((rect.left + offsetX), offsetX); let topPos = Math.max((rect.top + offsetY), offsetY); if (elem instanceof HTMLAreaElement) [leftPos, topPos] = this._getAreaOffset(elem, leftPos, topPos); hint.span.style.left = leftPos + "px"; hint.span.style.top = topPos + "px"; fragment.appendChild(hint.span); this._pageHints.push(hint); } let body = doc.body || util.evaluateXPath(["body"], doc).snapshotItem(0); if (body) { body.appendChild(fragment); this._docs.push({ doc: doc, start: start, end: this._pageHints.length - 1 }); } // also _generate hints for frames Array.forEach(win.frames, this.closure._generate); return true; },
continue; rect = elem.getClientRects()[0]; if (!rect)
_generate: function (win) { if (!win) win = window.content; let doc = win.document; let height = win.innerHeight; let width = win.innerWidth; let [offsetX, offsetY] = this._getContainerOffsets(doc); let baseNodeAbsolute = util.xmlToDom(<span highlight="Hint"/>, doc); let res = util.evaluateXPath(this._hintMode.tags(), doc, null, true); let fragment = util.xmlToDom(<div highlight="hints"/>, doc); let start = this._pageHints.length; for (let elem in res) { let hint = { elem: elem, showText: false }; // TODO: for iframes, this calculation is wrong let rect = elem.getBoundingClientRect(); if (!rect || rect.top > height || rect.bottom < 0 || rect.left > width || rect.right < 0) continue; rect = elem.getClientRects()[0]; if (!rect) continue; let computedStyle = doc.defaultView.getComputedStyle(elem, null); if (computedStyle.getPropertyValue("visibility") != "visible" || computedStyle.getPropertyValue("display") == "none") continue; if (elem instanceof HTMLInputElement || elem instanceof HTMLSelectElement || elem instanceof HTMLTextAreaElement) [hint.text, hint.showText] = this._getInputHint(elem, doc); else hint.text = elem.textContent.toLowerCase(); hint.span = baseNodeAbsolute.cloneNode(true); let leftPos = Math.max((rect.left + offsetX), offsetX); let topPos = Math.max((rect.top + offsetY), offsetY); if (elem instanceof HTMLAreaElement) [leftPos, topPos] = this._getAreaOffset(elem, leftPos, topPos); hint.span.style.left = leftPos + "px"; hint.span.style.top = topPos + "px"; fragment.appendChild(hint.span); this._pageHints.push(hint); } let body = doc.body || util.evaluateXPath(["body"], doc).snapshotItem(0); if (body) { body.appendChild(fragment); this._docs.push({ doc: doc, start: start, end: this._pageHints.length - 1 }); } // also _generate hints for frames Array.forEach(win.frames, this.closure._generate); return true; },
rect = elem.getBoundingClientRect();
let rect = elem.getBoundingClientRect();
_generate: function (win) { if (!win) win = window.content; let doc = win.document; let height = win.innerHeight; let width = win.innerWidth; let [offsetX, offsetY] = this._getContainerOffsets(doc); let baseNodeAbsolute = util.xmlToDom(<span highlight="Hint"/>, doc); let res = util.evaluateXPath(this._hintMode.tags(), doc, null, true); let fragment = util.xmlToDom(<div highlight="hints"/>, doc); let start = this._pageHints.length; for (let elem in res) { let hint = { elem: elem, showText: false }; // TODO: for iframes, this calculation is wrong rect = elem.getBoundingClientRect(); if (!rect || rect.top > height || rect.bottom < 0 || rect.left > width || rect.right < 0) continue; rect = elem.getClientRects()[0]; if (!rect) continue; let computedStyle = doc.defaultView.getComputedStyle(elem, null); if (computedStyle.getPropertyValue("visibility") != "visible" || computedStyle.getPropertyValue("display") == "none") continue; if (elem instanceof HTMLInputElement || elem instanceof HTMLSelectElement || elem instanceof HTMLTextAreaElement) [hint.text, hint.showText] = this._getInputHint(elem, doc); else hint.text = elem.textContent.toLowerCase(); hint.span = baseNodeAbsolute.cloneNode(true); let leftPos = Math.max((rect.left + offsetX), offsetX); let topPos = Math.max((rect.top + offsetY), offsetY); if (elem instanceof HTMLAreaElement) [leftPos, topPos] = this._getAreaOffset(elem, leftPos, topPos); hint.span.style.left = leftPos + "px"; hint.span.style.top = topPos + "px"; fragment.appendChild(hint.span); this._pageHints.push(hint); } let body = doc.body || util.evaluateXPath(["body"], doc).snapshotItem(0); if (body) { body.appendChild(fragment); this._docs.push({ doc: doc, start: start, end: this._pageHints.length - 1 }); } // also _generate hints for frames Array.forEach(win.frames, this.closure._generate); return true; },
if (computedStyle.getPropertyValue("visibility") != "visible" || computedStyle.getPropertyValue("display") == "none")
if (computedStyle["visibility"] != "visible" || computedStyle["display"] == "none")
_generate: function (win) { if (!win) win = window.content; let doc = win.document; let height = win.innerHeight; let width = win.innerWidth; let [offsetX, offsetY] = this._getContainerOffsets(doc); let baseNodeAbsolute = util.xmlToDom(<span highlight="Hint"/>, doc); let res = util.evaluateXPath(this._hintMode.tags(), doc, null, true); let fragment = util.xmlToDom(<div highlight="hints"/>, doc); let start = this._pageHints.length; for (let elem in res) { let hint = { elem: elem, showText: false }; // TODO: for iframes, this calculation is wrong let rect = elem.getBoundingClientRect(); if (!rect || rect.top > height || rect.bottom < 0 || rect.left > width || rect.right < 0) continue; let computedStyle = doc.defaultView.getComputedStyle(elem, null); if (computedStyle.getPropertyValue("visibility") != "visible" || computedStyle.getPropertyValue("display") == "none") continue; if (isinstance(elem, [HTMLInputElement, HTMLSelectElement, HTMLTextAreaElement])) [hint.text, hint.showText] = this._getInputHint(elem, doc); else hint.text = elem.textContent.toLowerCase(); hint.span = baseNodeAbsolute.cloneNode(true); rect = elem.getClientRects()[0] || rect; let leftPos = Math.max((rect.left + offsetX), offsetX); let topPos = Math.max((rect.top + offsetY), offsetY); if (elem instanceof HTMLAreaElement) [leftPos, topPos] = this._getAreaOffset(elem, leftPos, topPos); hint.span.style.left = leftPos + "px"; hint.span.style.top = topPos + "px"; fragment.appendChild(hint.span); this._pageHints.push(hint); } let body = doc.body || util.evaluateXPath(["body"], doc).snapshotItem(0); if (body) { body.appendChild(fragment); this._docs.push({ doc: doc, start: start, end: this._pageHints.length - 1 }); } // also _generate hints for frames Array.forEach(win.frames, this.closure._generate); return true; },
if (this._combo[this._comboKeys[i]]) { codes.push(this._comboCodes[i]);
if (this._combo[this._comboKeys.charAt(i)]) { codes.push(this._comboCodes.charAt(i));
_getComboString: function () { var codes = []; for (var i = 0; i < this._comboMaxLength; ++i) { if (this._combo[this._comboKeys[i]]) { codes.push(this._comboCodes[i]); } } var s = codes.join(""); if (this._xformRules) { // apply transform rules $.each(this._xformRules, function (i_, r) { s = s.replace(r.pattern, r.repl); }); } return s; },
Element._getContentFromAnonymousElement = function(tagName, html) { var div = new Element('div'), t = Element._insertionTranslations.tags[tagName]; if (t) { div.innerHTML = t[0] + html + t[1]; t[2].times(function() { div = div.firstChild }); } else div.innerHTML = html; return $A(div.childNodes); };
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])*?\*\
Element._getContentFromAnonymousElement = function(tagName, html) { var div = new Element('div'), t = Element._insertionTranslations.tags[tagName]; if (t) { div.innerHTML = t[0] + html + t[1]; t[2].times(function() { div = div.firstChild }); } else div.innerHTML = html; return $A(div.childNodes);};
let selController = this.selectionController;
let selController = buffer.selectionController;
function _getCurrentWord (win) { let selection = win.getSelection(); if (selection.rangeCount <= 0) return; let range = selection.getRangeAt(0); if (selection.isCollapsed) { let selController = this.selectionController; let caretmode = selController.getCaretEnabled(); selController.setCaretEnabled(true); // Only move backwards if the previous character is not a space. if (range.startOffset > 0 && !/\s/.test(range.startContainer.textContent[range.startOffset - 1])) selController.wordMove(false, false); selController.wordMove(true, true); selController.setCaretEnabled(caretmode); return String.match(selection, /\w*/)[0]; } if (util.computedStyle(range.startContainer).whiteSpace == "pre" && util.computedStyle(range.endContainer).whiteSpace == "pre") return String(range); return String(selection); }
if (ret) ret = ret.create();
if (ret && ret.isClass) ret = ret.create();
_getDataSource: function() { var ret = this.get('dataSource'); if (typeof ret === SC.T_STRING) { ret = SC.objectForPropertyPath(ret); if (ret) ret = ret.create(); if (ret) this.set('dataSource', ret); } return ret; },
document._getElementsByXPath = function(expression, parentElement) { var results = []; var query = document.evaluate(expression, $(parentElement) || document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); for (var i = 0, length = query.snapshotLength; i < length; i++) results.push(Element.extend(query.snapshotItem(i))); return results; };
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])*?\*\
document._getElementsByXPath = function(expression, parentElement) { var results = []; var query = document.evaluate(expression, $(parentElement) || document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); for (var i = 0, length = query.snapshotLength; i < length; i++) results.push(Element.extend(query.snapshotItem(i))); return results; };
_getHeaderJSON: function() { var json = this.getHeader('X-JSON'); if (!json) return null; json = decodeURIComponent(escape(json)); try { return json.evalJSON(this.request.options.sanitizeJSON || !this.request.isSameOrigin()); } catch (e) { this.request.dispatchException(e); } },
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])*?\*\
_getHeaderJSON: function() { var json = this.getHeader('X-JSON'); if (!json) return null; json = decodeURIComponent(escape(json)); try { return json.evalJSON(this.request.options.sanitizeJSON || !this.request.isSameOrigin()); } catch (e) { this.request.dispatchException(e); } },
return this._input.slice(0);
if (this._xformRules) { var s = this._input.join(""); $.each(this._xformRules, function (i_, r) { s = s.replace(r.pattern, r.repl); }); return s.split(""); } else { return this._input.slice(0); }
_getInput: function() { // TODO: apply transform rules return this._input.slice(0); },
for (let [, option] in Iterator(options["hintinputs"].split(","))) {
for (let [, option] in Iterator(options["hintinputs"])) {
_getInputHint: function (elem, doc) { // <input type="submit|button|reset"/> Always use the value // <input type="radio|checkbox"/> Use the value if it is not numeric or label or name // <input type="password"/> Never use the value, use label or name // <input type="text|file"/> <textarea/> Use value if set or label or name // <input type="image"/> Use the alt text if present (showText) or label or name // <input type="hidden"/> Never gets here // <select/> Use the text of the selected item or label or name let type = elem.type; if (elem instanceof HTMLInputElement && set.has(Events.editableInputs, elem.type)) return [elem.value, false]; else { for (let [, option] in Iterator(options["hintinputs"].split(","))) { if (option == "value") { if (elem instanceof HTMLSelectElement) { if (elem.selectedIndex >= 0) return [elem.item(elem.selectedIndex).text.toLowerCase(), false]; } else if (type == "image") { if (elem.alt) return [elem.alt.toLowerCase(), true]; } else if (elem.value && type != "password") { // radio's and checkboxes often use internal ids as values - maybe make this an option too... if (! ((type == "radio" || type == "checkbox") && !isNaN(elem.value))) return [elem.value.toLowerCase(), (type == "radio" || type == "checkbox")]; } } else if (option == "label") { if (elem.id) { // TODO: (possibly) do some guess work for label-like objects let label = util.evaluateXPath(["label[@for=" + elem.id.quote() + "]"], doc).snapshotItem(0); if (label) return [label.textContent.toLowerCase(), true]; } } else if (option == "name") return [elem.name.toLowerCase(), true]; } } return ["", false]; },
if (elem instanceof HTMLInputElement && /(submit|button|this._reset)/.test(type))
if (elem instanceof HTMLInputElement && /(submit|button|reset)/.test(type))
_getInputHint: function (elem, doc) { // <input type="submit|button|reset"/> Always use the value // <input type="radio|checkbox"/> Use the value if it is not numeric or label or name // <input type="password"/> Never use the value, use label or name // <input type="text|file"/> <textarea/> Use value if set or label or name // <input type="image"/> Use the alt text if present (showText) or label or name // <input type="hidden"/> Never gets here // <select/> Use the text of the selected item or label or name let type = elem.type; if (elem instanceof HTMLInputElement && /(submit|button|this._reset)/.test(type)) return [elem.value, false]; else { for (let [, option] in Iterator(options["hintinputs"].split(","))) { if (option == "value") { if (elem instanceof HTMLSelectElement) { if (elem.selectedIndex >= 0) return [elem.item(elem.selectedIndex).text.toLowerCase(), false]; } else if (type == "image") { if (elem.alt) return [elem.alt.toLowerCase(), true]; } else if (elem.value && type != "password") { // radio's and checkboxes often use internal ids as values - maybe make this an option too... if (! ((type == "radio" || type == "checkbox") && !isNaN(elem.value))) return [elem.value.toLowerCase(), (type == "radio" || type == "checkbox")]; } } else if (option == "label") { if (elem.id) { // TODO: (possibly) do some guess work for label-like objects let label = util.evaluateXPath(["label[@for=" + elem.id.quote() + "]"], doc).snapshotItem(0); if (label) return [label.textContent.toLowerCase(), true]; } } else if (option == "name") return [elem.name.toLowerCase(), true]; } } return ["", false]; },
let key = this._str.substring(this._get(-2, 0, "statements"), this._get(-1, null, "offset")) + "''";
let key = this._str.substring(this._get(-2, null, "offset") + 1, this._get(-1, null, "offset")) + "''";
_getKey: function () { if (this._last == "") return ""; // After the opening [ upto the opening ", plus '' to take care of any operators before it let key = this._str.substring(this._get(-2, 0, "statements"), this._get(-1, null, "offset")) + "''"; // Now eval the key, to process any referenced variables. return this.evalled(key); },
return $.grep(this._slots, function (e) { return e; }).join("");
var k = this._keyword.join(""); return this._xform ? this._xform(k) : k;
_getKeyword: function () { return $.grep(this._slots, function (e) { return e; }).join(""); },
if (prev != statement && obj == null) { this.context.message = "Error: " + cacheKey.quote() + " is " + String(obj); return []; }
_getObj: function (frame, stop) { let statement = this._get(frame, 0, "statements") || 0; // Current statement. let prev = statement; let obj; let cacheKey; for (let [, dot] in Iterator(this._get(frame).dots.concat(stop))) { if (dot < statement) continue; if (dot > stop || dot <= prev) break; let s = this._str.substring(prev, dot); if (prev != statement) s = JavaScript.EVAL_TMP + "." + s; cacheKey = this._str.substring(statement, dot); if (this._checkFunction(prev, dot, cacheKey)) return []; prev = dot + 1; obj = this.eval(s, cacheKey, obj); } return [[obj, cacheKey]]; },
let obj = null;
let obj = window;
_getObj: function (frame, stop) { let statement = this._get(frame, 0, "statements") || 0; // Current statement. let prev = statement; let obj = null; let cacheKey; for (let [, dot] in Iterator(this._get(frame).dots.concat(stop))) { if (dot < statement) continue; if (dot > stop || dot <= prev) break; let s = this._str.substring(prev, dot); if (prev != statement) s = JavaScript.EVAL_TMP + "." + s; cacheKey = this._str.substring(statement, dot); if (this._checkFunction(prev, dot, cacheKey)) return []; if (prev != statement && obj == null) { this.context.message = "Error: " + cacheKey.quote() + " is " + String(obj); return []; } prev = dot + 1; obj = this.evalled(s, cacheKey, obj); } return [[obj, cacheKey]]; },
_getResponseJSON: function() { var options = this.request.options; if (!options.evalJSON || (options.evalJSON != 'force' && !(this.getHeader('Content-type') || '').include('application/json')) || this.responseText.blank()) return null; try { return this.responseText.evalJSON(options.sanitizeJSON || !this.request.isSameOrigin()); } catch (e) { this.request.dispatchException(e); } }
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])*?\*\
_getResponseJSON: function() { var options = this.request.options; if (!options.evalJSON || (options.evalJSON != 'force' && !(this.getHeader('Content-type') || '').include('application/json')) || this.responseText.blank()) return null; try { return this.responseText.evalJSON(options.sanitizeJSON || !this.request.isSameOrigin()); } catch (e) { this.request.dispatchException(e); } }
this.debug(e);
this.error(e);
doh._handleFailure = function(groupName, fixture, e){ // this.debug("FAILED test:", fixture.name); // mostly borrowed from JUM this._groups[groupName].failures++; var out = ""; if(e instanceof this._AssertFailure){ this._failureCount++; if(e["fileName"]){ out += e.fileName + ':'; } if(e["lineNumber"]){ out += e.lineNumber + ' '; } out += e+": "+e.message; this.debug("\t_AssertFailure:", out); }else{ this._errorCount++; } this.debug(e); if(fixture.runTest["toSource"]){ var ss = fixture.runTest.toSource(); this.debug("\tERROR IN:\n\t\t", ss); }else{ this.debug("\tERROR IN:\n\t\t", fixture.runTest); } if(e.rhinoException){ e.rhinoException.printStackTrace(); }else if(e.javaException){ e.javaException.printStackTrace(); } }
assertOrRenderError(request.method in methods,
logger.debug(request.method); assertOrRenderError(validMethods.contains(request.method),
this._handleRequest = function (request, response) { getRequestBody(request).addCallback(bind(this, function(body) { logger.debug('received request', request.url); try { var uri = nodeUrl.parse(request.url, true), path = uri.pathname, sessionUrl = this._sessionUrl; assertOrRenderError(startswith(path, sessionUrl + '/'), 404, 'Request to invalid session URL'); assertOrRenderError(request.method in methods, 405, 'Invalid HTTP method, ' + request.method); var resource = path.split('/').pop(); if (resource === 'static') { assertOrRenderError(startswith(path, sessionUrl + '/'), 404, 'sendStatic Not Implemented'); // TODO: sendStatic(relativePath, response); return; }; assertOrRenderError(resources.hasOwnProperty(resource), 404, 'Invalid resource, ' + path); var params = uri.query; // 'data' is either the POST body if it exists, or the 'd' variable request.data = body || params.d || null; if (resource === 'handshake') { assertOrRenderError(!params.s, 400, 'Handshake cannot have session'); try { var dict = JSON.parse(request.data); // make sure our json dict is an object literal assert((dict instanceof Object) && !(dict instanceof Array)); } catch (err) { debug('INVALID HANDSHAKE, ', request, err); throw new CSPError(400, 'Invalid data parameter for handshake'); }; var session = new csp.Session(); var connection = new csp.Connection(session); session.connection = connection; this.emit('connection', connection); connection.emit('connect'); } else { var session = sessionDict[params.s]; assertOrRenderError(session, 400, 'Invalid or missing session'); // 'ackId' is either the 'Last-Event-Id' header, or the 'a' variable var ackId = parseInt(request.headers['Last-Event-Id']) || parseInt(params.a) || -1; session.receiveAck(ackId); }; session.updateVars(params); session.dispatch[resource].call(session, request, response); // logic is in session } catch (err) { if (err instanceof CSPError) { renderError(response, err.code, err.message); } else { debug('Unexpected Error: ', err.message); renderError(response, 500, 'Unknown Server error'); }; }; })); };
assertOrRenderError(resources.hasOwnProperty(resource),
assertOrRenderError(validResources.contains(resource),
this._handleRequest = function (request, response) { getRequestBody(request).addCallback(bind(this, function(body) { logger.debug('received request', request.url); try { var uri = nodeUrl.parse(request.url, true), path = uri.pathname, sessionUrl = this._sessionUrl; assertOrRenderError(startswith(path, sessionUrl + '/'), 404, 'Request to invalid session URL'); assertOrRenderError(request.method in methods, 405, 'Invalid HTTP method, ' + request.method); var resource = path.split('/').pop(); if (resource === 'static') { assertOrRenderError(startswith(path, sessionUrl + '/'), 404, 'sendStatic Not Implemented'); // TODO: sendStatic(relativePath, response); return; }; assertOrRenderError(resources.hasOwnProperty(resource), 404, 'Invalid resource, ' + path); var params = uri.query; // 'data' is either the POST body if it exists, or the 'd' variable request.data = body || params.d || null; if (resource === 'handshake') { assertOrRenderError(!params.s, 400, 'Handshake cannot have session'); try { var dict = JSON.parse(request.data); // make sure our json dict is an object literal assert((dict instanceof Object) && !(dict instanceof Array)); } catch (err) { debug('INVALID HANDSHAKE, ', request, err); throw new CSPError(400, 'Invalid data parameter for handshake'); }; var session = new csp.Session(); var connection = new csp.Connection(session); session.connection = connection; this.emit('connection', connection); connection.emit('connect'); } else { var session = sessionDict[params.s]; assertOrRenderError(session, 400, 'Invalid or missing session'); // 'ackId' is either the 'Last-Event-Id' header, or the 'a' variable var ackId = parseInt(request.headers['Last-Event-Id']) || parseInt(params.a) || -1; session.receiveAck(ackId); }; session.updateVars(params); session.dispatch[resource].call(session, request, response); // logic is in session } catch (err) { if (err instanceof CSPError) { renderError(response, err.code, err.message); } else { debug('Unexpected Error: ', err.message); renderError(response, 500, 'Unknown Server error'); }; }; })); };
debug('INVALID HANDSHAKE, ', request, err);
logger.debug('INVALID HANDSHAKE, ', request, err);
this._handleRequest = function (request, response) { getRequestBody(request).addCallback(bind(this, function(body) { logger.debug('received request', request.url); try { var uri = nodeUrl.parse(request.url, true), path = uri.pathname, sessionUrl = this._sessionUrl; assertOrRenderError(startswith(path, sessionUrl + '/'), 404, 'Request to invalid session URL'); assertOrRenderError(request.method in methods, 405, 'Invalid HTTP method, ' + request.method); var resource = path.split('/').pop(); if (resource === 'static') { assertOrRenderError(startswith(path, sessionUrl + '/'), 404, 'sendStatic Not Implemented'); // TODO: sendStatic(relativePath, response); return; }; assertOrRenderError(resources.hasOwnProperty(resource), 404, 'Invalid resource, ' + path); var params = uri.query; // 'data' is either the POST body if it exists, or the 'd' variable request.data = body || params.d || null; if (resource === 'handshake') { assertOrRenderError(!params.s, 400, 'Handshake cannot have session'); try { var dict = JSON.parse(request.data); // make sure our json dict is an object literal assert((dict instanceof Object) && !(dict instanceof Array)); } catch (err) { debug('INVALID HANDSHAKE, ', request, err); throw new CSPError(400, 'Invalid data parameter for handshake'); }; var session = new csp.Session(); var connection = new csp.Connection(session); session.connection = connection; this.emit('connection', connection); connection.emit('connect'); } else { var session = sessionDict[params.s]; assertOrRenderError(session, 400, 'Invalid or missing session'); // 'ackId' is either the 'Last-Event-Id' header, or the 'a' variable var ackId = parseInt(request.headers['Last-Event-Id']) || parseInt(params.a) || -1; session.receiveAck(ackId); }; session.updateVars(params); session.dispatch[resource].call(session, request, response); // logic is in session } catch (err) { if (err instanceof CSPError) { renderError(response, err.code, err.message); } else { debug('Unexpected Error: ', err.message); renderError(response, 500, 'Unknown Server error'); }; }; })); };
var session = new csp.Session(); var connection = new csp.Connection(session);
var session = new exports.Session(); var connection = new exports.Connection(session);
this._handleRequest = function (request, response) { getRequestBody(request).addCallback(bind(this, function(body) { logger.debug('received request', request.url); try { var uri = nodeUrl.parse(request.url, true), path = uri.pathname, sessionUrl = this._sessionUrl; assertOrRenderError(startswith(path, sessionUrl + '/'), 404, 'Request to invalid session URL'); assertOrRenderError(request.method in methods, 405, 'Invalid HTTP method, ' + request.method); var resource = path.split('/').pop(); if (resource === 'static') { assertOrRenderError(startswith(path, sessionUrl + '/'), 404, 'sendStatic Not Implemented'); // TODO: sendStatic(relativePath, response); return; }; assertOrRenderError(resources.hasOwnProperty(resource), 404, 'Invalid resource, ' + path); var params = uri.query; // 'data' is either the POST body if it exists, or the 'd' variable request.data = body || params.d || null; if (resource === 'handshake') { assertOrRenderError(!params.s, 400, 'Handshake cannot have session'); try { var dict = JSON.parse(request.data); // make sure our json dict is an object literal assert((dict instanceof Object) && !(dict instanceof Array)); } catch (err) { debug('INVALID HANDSHAKE, ', request, err); throw new CSPError(400, 'Invalid data parameter for handshake'); }; var session = new csp.Session(); var connection = new csp.Connection(session); session.connection = connection; this.emit('connection', connection); connection.emit('connect'); } else { var session = sessionDict[params.s]; assertOrRenderError(session, 400, 'Invalid or missing session'); // 'ackId' is either the 'Last-Event-Id' header, or the 'a' variable var ackId = parseInt(request.headers['Last-Event-Id']) || parseInt(params.a) || -1; session.receiveAck(ackId); }; session.updateVars(params); session.dispatch[resource].call(session, request, response); // logic is in session } catch (err) { if (err instanceof CSPError) { renderError(response, err.code, err.message); } else { debug('Unexpected Error: ', err.message); renderError(response, 500, 'Unknown Server error'); }; }; })); };
debug('Unexpected Error: ', err.message);
logger.debug('Unexpected Error: ', err.message);
this._handleRequest = function (request, response) { getRequestBody(request).addCallback(bind(this, function(body) { logger.debug('received request', request.url); try { var uri = nodeUrl.parse(request.url, true), path = uri.pathname, sessionUrl = this._sessionUrl; assertOrRenderError(startswith(path, sessionUrl + '/'), 404, 'Request to invalid session URL'); assertOrRenderError(request.method in methods, 405, 'Invalid HTTP method, ' + request.method); var resource = path.split('/').pop(); if (resource === 'static') { assertOrRenderError(startswith(path, sessionUrl + '/'), 404, 'sendStatic Not Implemented'); // TODO: sendStatic(relativePath, response); return; }; assertOrRenderError(resources.hasOwnProperty(resource), 404, 'Invalid resource, ' + path); var params = uri.query; // 'data' is either the POST body if it exists, or the 'd' variable request.data = body || params.d || null; if (resource === 'handshake') { assertOrRenderError(!params.s, 400, 'Handshake cannot have session'); try { var dict = JSON.parse(request.data); // make sure our json dict is an object literal assert((dict instanceof Object) && !(dict instanceof Array)); } catch (err) { debug('INVALID HANDSHAKE, ', request, err); throw new CSPError(400, 'Invalid data parameter for handshake'); }; var session = new csp.Session(); var connection = new csp.Connection(session); session.connection = connection; this.emit('connection', connection); connection.emit('connect'); } else { var session = sessionDict[params.s]; assertOrRenderError(session, 400, 'Invalid or missing session'); // 'ackId' is either the 'Last-Event-Id' header, or the 'a' variable var ackId = parseInt(request.headers['Last-Event-Id']) || parseInt(params.a) || -1; session.receiveAck(ackId); }; session.updateVars(params); session.dispatch[resource].call(session, request, response); // logic is in session } catch (err) { if (err instanceof CSPError) { renderError(response, err.code, err.message); } else { debug('Unexpected Error: ', err.message); renderError(response, 500, 'Unknown Server error'); }; }; })); };
body.css('overflow', 'hidden');
SC.PICKERS_OPEN++; if(SC.PICKERS_OPEN > 0) body.css('overflow', 'hidden');
_hideOverflow: function(){ var body = SC.$(document.body), main = SC.$('.sc-main'), minWidth = parseInt(main.css('minWidth'),0), minHeight = parseInt(main.css('minHeight'),0), windowSize = SC.RootResponder.responder.get('currentWindowSize'); if(windowSize.width>=minWidth && windowSize.height>=minHeight){ body.css('overflow', 'hidden'); } },
completion.history = function _history(context, maxItems) {
completion.history = function _history(context, args, maxItems) {
completion.history = function _history(context, maxItems) { context.format = history.format; context.title = ["History"]; context.compare = CompletionContext.Sort.unsorted; //context.background = true; if (context.maxItems == null) context.maxItems = 100; context.regenerate = true; context.generate = function () history.get(context.filter, this.maxItems); };
_htmlForTitleAndIcon: function(displayProperties) { var title = displayProperties.title, titleMinWidth = displayProperties.titleMinWidth, hint = displayProperties.hint, escapeHTML = displayProperties.escapeHTML, icon = displayProperties.icon || '';
_htmlForTitleAndIcon: function(dataSource) { var title = dataSource.get('title'), titleMinWidth = dataSource.get('titleMinWidth'), hint = dataSource.get('hint'), escapeHTML = dataSource.get('escapeHTML'), icon = dataSource.get('icon') || '';
_htmlForTitleAndIcon: function(displayProperties) { var title = displayProperties.title, titleMinWidth = displayProperties.titleMinWidth, hint = displayProperties.hint, escapeHTML = displayProperties.escapeHTML, icon = displayProperties.icon || ''; // Escape the title of the button if needed. This prevents potential // XSS attacks. if (title && escapeHTML) { title = SC.RenderContext.escapeHTML(title) ; } if (hint && !title) { if (escapeHTML) { hint = SC.RenderContext.escapeHTML(hint); } title = "<span class='sc-hint'>" + hint + "</span>"; } if (icon) { // If the icon property is the path to an image, create an image tag // that points to that URL. if (icon.indexOf('/') >= 0) { icon = '<img src="'+icon+'" alt="" class="icon" />'; // Otherwise, the icon property is a class name that should be added // to the image tag. Display a blank image so that the user can add // background image using CSS. } else { icon = '<img src="'+SC.BLANK_IMAGE_URL+'" alt="" class="'+icon+'" />'; } } return icon+title; }
} else { this._setupIdle();
_idleEntry: function() { this._idleIsScheduled = NO; var last = SC.RunLoop.lastRunLoopEnd; // if no recent events (within < 1s) if (Date.now() - last > this.get('minimumIdleDuration')) { SC.run(this.run, this); SC.RunLoop.lastRunLoopEnd = last; // we were never here } else { this._setupIdle(); } },
this._setupIdle();
_idleEntry: function() { this._idleIsScheduled = NO; var last = SC.RunLoop.lastRunLoopEnd; // if no recent events (within < 1s) if (Date.now() - last > this.get('minimumIdleDuration')) { SC.run(this.run, this); SC.RunLoop.lastRunLoopEnd = last; // we were never here } else { this._setupIdle(); } },
this.run();
SC.run(this.run, this); SC.RunLoop.lastRunLoopEnd = last;
_idleEntry: function() { this._idleIsScheduled = NO; var last = SC.RunLoop.lastRunLoopEnd; if (Date.now() - last > this.get('minimumIdleDuration')) { // if no recent events (within < 1s) this.run(); } else { SC.run(this._doSetupIdle, this); SC.RunLoop.lastRunLoopEnd = last; // we were never here } },
SC.run(this._doSetupIdle, this); SC.RunLoop.lastRunLoopEnd = last;
this._setupIdle();
_idleEntry: function() { this._idleIsScheduled = NO; var last = SC.RunLoop.lastRunLoopEnd; if (Date.now() - last > this.get('minimumIdleDuration')) { // if no recent events (within < 1s) this.run(); } else { SC.run(this._doSetupIdle, this); SC.RunLoop.lastRunLoopEnd = last; // we were never here } },
} else { this._setupIdle();
_idleEntry: function() { this._idleIsScheduled = NO; var last = SC.RunLoop.lastRunLoopEnd; // if no recent events (within < 1s) if (Date.now() - last > this.get('minimumIdleDuration')) { SC.run(this.run, this); SC.RunLoop.lastRunLoopEnd = last; // we were never here } else { this._setupIdle(); } // set up idle timer if needed this._setupIdle(); },
} else { this._setupIdle();
_idleEntry: function() { this._idleIsScheduled = NO; var last = SC.RunLoop.lastRunLoopEnd; // if no recent events (within < 1s) if (Date.now() - last > this.get('minimumIdleDuration')) { SC.run(this.run, this); SC.RunLoop.lastRunLoopEnd = last; // we were never here } // set up idle timer if needed this._setupIdle(); },
SC.run(function() { this._setupIdle(); }, this);
SC.run(this._doSetupIdle, this);
_idleEntry: function() { this._idleIsScheduled = NO; var last = SC.RunLoop.lastRunLoopEnd; if (Date.now() - last > this.get('minimumIdleDuration')) { // if no recent events (within < 1s) this.run(); } else { SC.run(function() { this._setupIdle(); }, this); SC.RunLoop.lastRunLoopEnd = last; // we were never here } },
this._queries = {};
var queries = {};
_indexQueries: function (ctx) { var maxKeywordLength = ctx.schema.maxKeywordLength; var maxKeyLength = ctx.schema.maxKeyLength; var a = ctx._segmentation.a; var b = ctx._segmentation.b; this._queries = {}; var q = []; for (var i = 0; i < b.length; ++i) { var s = []; for (var j = i + 1; j < b.length && b[j] - b[i] <= maxKeywordLength; ++j) { var kw = a[b[j]][b[i]]; if (kw) { var r = {ikey: [kw], start: b[i], end: b[j]}; this._registerQuery(r); if (r.ikey.length < maxKeyLength) s.push(r); var me = this; $.each(q, function (k, e) { if (e.end == b[i]) { r = {ikey: e.ikey.concat([kw]), start: e.start, end: b[j]}; me._registerQuery(r); if (r.ikey.length < maxKeyLength) s.push(r); } }); } } q = q.concat(s); } },
this._registerQuery(r);
this._registerQuery(queries, r);
_indexQueries: function (ctx) { var maxKeywordLength = ctx.schema.maxKeywordLength; var maxKeyLength = ctx.schema.maxKeyLength; var a = ctx._segmentation.a; var b = ctx._segmentation.b; this._queries = {}; var q = []; for (var i = 0; i < b.length; ++i) { var s = []; for (var j = i + 1; j < b.length && b[j] - b[i] <= maxKeywordLength; ++j) { var kw = a[b[j]][b[i]]; if (kw) { var r = {ikey: [kw], start: b[i], end: b[j]}; this._registerQuery(r); if (r.ikey.length < maxKeyLength) s.push(r); var me = this; $.each(q, function (k, e) { if (e.end == b[i]) { r = {ikey: e.ikey.concat([kw]), start: e.start, end: b[j]}; me._registerQuery(r); if (r.ikey.length < maxKeyLength) s.push(r); } }); } } q = q.concat(s); } },
me._registerQuery(r);
me._registerQuery(queries, r);
_indexQueries: function (ctx) { var maxKeywordLength = ctx.schema.maxKeywordLength; var maxKeyLength = ctx.schema.maxKeyLength; var a = ctx._segmentation.a; var b = ctx._segmentation.b; this._queries = {}; var q = []; for (var i = 0; i < b.length; ++i) { var s = []; for (var j = i + 1; j < b.length && b[j] - b[i] <= maxKeywordLength; ++j) { var kw = a[b[j]][b[i]]; if (kw) { var r = {ikey: [kw], start: b[i], end: b[j]}; this._registerQuery(r); if (r.ikey.length < maxKeyLength) s.push(r); var me = this; $.each(q, function (k, e) { if (e.end == b[i]) { r = {ikey: e.ikey.concat([kw]), start: e.start, end: b[j]}; me._registerQuery(r); if (r.ikey.length < maxKeyLength) s.push(r); } }); } } q = q.concat(s); } },
return queries;
_indexQueries: function (ctx) { var maxKeywordLength = ctx.schema.maxKeywordLength; var maxKeyLength = ctx.schema.maxKeyLength; var a = ctx._segmentation.a; var b = ctx._segmentation.b; this._queries = {}; var q = []; for (var i = 0; i < b.length; ++i) { var s = []; for (var j = i + 1; j < b.length && b[j] - b[i] <= maxKeywordLength; ++j) { var kw = a[b[j]][b[i]]; if (kw) { var r = {ikey: [kw], start: b[i], end: b[j]}; this._registerQuery(r); if (r.ikey.length < maxKeyLength) s.push(r); var me = this; $.each(q, function (k, e) { if (e.end == b[i]) { r = {ikey: e.ikey.concat([kw]), start: e.start, end: b[j]}; me._registerQuery(r); if (r.ikey.length < maxKeyLength) s.push(r); } }); } } q = q.concat(s); } },
div.scrollIntoView(true);
this._div.scrollIntoView(true);
_init: function () { this._div = this._dom( <div class="ex-command-output" highlight="Normal" style="white-space: nowrap"> <div highlight="Completions" key="noCompletions"><span highlight="Title">No Completions</span></div> <div key="completions"/> <div highlight="Completions"> { template.map(util.range(0, options["maxitems"] * 2), function (i) <span highlight="CompItem"> <li highlight="NonText">~</li> </span>) } </div> </div>, this._divNodes); this._doc.body.replaceChild(this._div, this._doc.body.firstChild); div.scrollIntoView(true); this._items.contextList.forEach(function init_eachContext(context) { delete context.cache.nodes; if (!context.items.length && !context.message && !context.incomplete) return; context.cache.nodes = []; this._dom(<div key="root" highlight="CompGroup"> <div highlight="Completions"> { context.createRow(context.title || [], "CompTitle") } </div> { this._gradient } <div key="message" highlight="CompMsg"/> <div key="up" highlight="CompLess"/> <div key="items" highlight="Completions"/> <div key="waiting" highlight="CompMsg">{ItemList.WAITING_MESSAGE}</div> <div key="down" highlight="CompMore"/> </div>, context.cache.nodes); this._divNodes.completions.appendChild(context.cache.nodes.root); }, this); this.timeout(this._autoSize, 0); },
util.scrollIntoView(this._div);
util.scrollIntoView(this._div, true);
_init: function () { this._div = this._dom( <div class="ex-command-output" highlight="Normal" style="white-space: nowrap"> <div highlight="Completions" key="noCompletions"><span highlight="Title">No Completions</span></div> <div key="completions"/> <div highlight="Completions"> { template.map(util.range(0, options["maxitems"] * 2), function (i) <span highlight="CompItem"> <li highlight="NonText">~</li> </span>) } </div> </div>, this._divNodes); this._doc.body.replaceChild(this._div, this._doc.body.firstChild); util.scrollIntoView(this._div); this._items.contextList.forEach(function init_eachContext(context) { delete context.cache.nodes; if (!context.items.length && !context.message && !context.incomplete) return; context.cache.nodes = []; this._dom(<div key="root" highlight="CompGroup"> <div highlight="Completions"> { context.createRow(context.title || [], "CompTitle") } </div> { this._gradient } <div key="message" highlight="CompMsg"/> <div key="up" highlight="CompLess"/> <div key="items" highlight="Completions"/> <div key="waiting" highlight="CompMsg">{ItemList.WAITING_MESSAGE}</div> <div key="down" highlight="CompMore"/> </div>, context.cache.nodes); this._divNodes.completions.appendChild(context.cache.nodes.root); }, this); this.timeout(this._autoSize, 0); },
if (!menu.isClass || !menu) return;
if (!menu || !menu.isClass) return;
_instantiateMenu: function() { // get menu var menu = this.get('menu'); // if it is already instantiated or does not exist, we cannot do anything if (!menu.isClass || !menu) return; // create this.menu = menu.create(); // setup this._setupMenu(); },
return this._isInsideElementWithClassName('disclosure', evt);
return this._isInsideElementWithClassName('sc-list-item-disclosure', evt);
_isInsideDisclosure: function(evt) { if (this.get('disclosureState')===SC.LEAF_NODE) return NO; return this._isInsideElementWithClassName('disclosure', evt); },
var cq = this.renderer.$(this.sel);
var cq = this.renderer.$(this.selector); console.error("FINDING " + cq + " " + this.selector + " " + cq[0]);
_layerFinder: function() { var cq = this.renderer.$(this.sel); return cq[0]; },
if (!layout) return;
_layoutDidUpdate: function(){ var layout = this.get('layout'); this.dims = SC._VIEW_DEFAULT_DIMS; this.loc = this.dims.length; var right = this.right = layout.right; this.hasRight = (right != null); var left = this.left = layout.left; this.hasLeft = (left != null); var top = this.top = layout.top; this.hasTop = (top != null); var bottom = this.bottom = layout.bottom; this.hasBottom = (bottom != null); var width = this.width = layout.width; this.hasWidth = (width != null); var height = this. height = layout.height; this.hasHeight = (height != null); var maxWidth = this.maxWidth = layout.maxWidth; this.hasMaxWidth = (maxWidth != null); var maxHeight = this.maxHeight = layout.maxHeight; this.hasMaxHeight = (maxHeight != null); var centerX = this.centerX = layout.centerX; this.hasCenterX = (centerX != null); var centerY = this.centerY = layout.centerY; this.hasCenterY = (centerY != null); this.ret = {}; }.observes('layout'),
this.minWidth = (this.minWidth === undefined) ? null : this.minWidth;
this.minWidth = (layout.minWidth === undefined) ? null : layout.minWidth;
_layoutDidUpdate: function(){ var layout = this.get('layout'); if (!layout) return; this.dims = SC._VIEW_DEFAULT_DIMS; this.loc = this.dims.length; var right = this.right = layout.right; this.hasRight = (right != null); var left = this.left = layout.left; this.hasLeft = (left != null); var top = this.top = layout.top; this.hasTop = (top != null); var bottom = this.bottom = layout.bottom; this.hasBottom = (bottom != null); var width = this.width = layout.width; this.hasWidth = (width != null); var height = this.height = layout.height; this.hasHeight = (height != null); this.minWidth = (this.minWidth === undefined) ? null : this.minWidth; var maxWidth = this.maxWidth = layout.maxWidth; this.hasMaxWidth = (maxWidth != null); this.minHeight = (this.minHeight === undefined) ? null : this.minHeight; var maxHeight = this.maxHeight = layout.maxHeight; this.hasMaxHeight = (maxHeight != null); var centerX = this.centerX = layout.centerX; this.hasCenterX = (centerX != null); var centerY = this.centerY = layout.centerY; this.hasCenterY = (centerY != null); // the toString here is to ensure that it doesn't get px added to it this.zIndex = (layout.zIndex != null) ? layout.zIndex.toString() : null; this.opacity = (layout.opacity != null) ? layout.zIndex.toString() : null; this.backgroundPosition = (layout.backgroundPosition != null) ? layout.backgroundPosition : null; this.ret = { marginTop: null, marginLeft: null }; }.observes('layout'),
var maxWidth = this.maxWidth = layout.maxWidth;
var maxWidth = this.maxWidth = (layout.maxWidth === undefined) ? null : layout.maxWidth;
_layoutDidUpdate: function(){ var layout = this.get('layout'); if (!layout) return; this.dims = SC._VIEW_DEFAULT_DIMS; this.loc = this.dims.length; var right = this.right = layout.right; this.hasRight = (right != null); var left = this.left = layout.left; this.hasLeft = (left != null); var top = this.top = layout.top; this.hasTop = (top != null); var bottom = this.bottom = layout.bottom; this.hasBottom = (bottom != null); var width = this.width = layout.width; this.hasWidth = (width != null); var height = this.height = layout.height; this.hasHeight = (height != null); this.minWidth = (this.minWidth === undefined) ? null : this.minWidth; var maxWidth = this.maxWidth = layout.maxWidth; this.hasMaxWidth = (maxWidth != null); this.minHeight = (this.minHeight === undefined) ? null : this.minHeight; var maxHeight = this.maxHeight = layout.maxHeight; this.hasMaxHeight = (maxHeight != null); var centerX = this.centerX = layout.centerX; this.hasCenterX = (centerX != null); var centerY = this.centerY = layout.centerY; this.hasCenterY = (centerY != null); // the toString here is to ensure that it doesn't get px added to it this.zIndex = (layout.zIndex != null) ? layout.zIndex.toString() : null; this.opacity = (layout.opacity != null) ? layout.zIndex.toString() : null; this.backgroundPosition = (layout.backgroundPosition != null) ? layout.backgroundPosition : null; this.ret = { marginTop: null, marginLeft: null }; }.observes('layout'),
this.minHeight = (this.minHeight === undefined) ? null : this.minHeight;
this.minHeight = (layout.minHeight === undefined) ? null : layout.minHeight;
_layoutDidUpdate: function(){ var layout = this.get('layout'); if (!layout) return; this.dims = SC._VIEW_DEFAULT_DIMS; this.loc = this.dims.length; var right = this.right = layout.right; this.hasRight = (right != null); var left = this.left = layout.left; this.hasLeft = (left != null); var top = this.top = layout.top; this.hasTop = (top != null); var bottom = this.bottom = layout.bottom; this.hasBottom = (bottom != null); var width = this.width = layout.width; this.hasWidth = (width != null); var height = this.height = layout.height; this.hasHeight = (height != null); this.minWidth = (this.minWidth === undefined) ? null : this.minWidth; var maxWidth = this.maxWidth = layout.maxWidth; this.hasMaxWidth = (maxWidth != null); this.minHeight = (this.minHeight === undefined) ? null : this.minHeight; var maxHeight = this.maxHeight = layout.maxHeight; this.hasMaxHeight = (maxHeight != null); var centerX = this.centerX = layout.centerX; this.hasCenterX = (centerX != null); var centerY = this.centerY = layout.centerY; this.hasCenterY = (centerY != null); // the toString here is to ensure that it doesn't get px added to it this.zIndex = (layout.zIndex != null) ? layout.zIndex.toString() : null; this.opacity = (layout.opacity != null) ? layout.zIndex.toString() : null; this.backgroundPosition = (layout.backgroundPosition != null) ? layout.backgroundPosition : null; this.ret = { marginTop: null, marginLeft: null }; }.observes('layout'),
var maxHeight = this.maxHeight = layout.maxHeight;
var maxHeight = this.maxHeight = (layout.maxHeight === undefined) ? null : layout.maxHeight;
_layoutDidUpdate: function(){ var layout = this.get('layout'); if (!layout) return; this.dims = SC._VIEW_DEFAULT_DIMS; this.loc = this.dims.length; var right = this.right = layout.right; this.hasRight = (right != null); var left = this.left = layout.left; this.hasLeft = (left != null); var top = this.top = layout.top; this.hasTop = (top != null); var bottom = this.bottom = layout.bottom; this.hasBottom = (bottom != null); var width = this.width = layout.width; this.hasWidth = (width != null); var height = this.height = layout.height; this.hasHeight = (height != null); this.minWidth = (this.minWidth === undefined) ? null : this.minWidth; var maxWidth = this.maxWidth = layout.maxWidth; this.hasMaxWidth = (maxWidth != null); this.minHeight = (this.minHeight === undefined) ? null : this.minHeight; var maxHeight = this.maxHeight = layout.maxHeight; this.hasMaxHeight = (maxHeight != null); var centerX = this.centerX = layout.centerX; this.hasCenterX = (centerX != null); var centerY = this.centerY = layout.centerY; this.hasCenterY = (centerY != null); // the toString here is to ensure that it doesn't get px added to it this.zIndex = (layout.zIndex != null) ? layout.zIndex.toString() : null; this.opacity = (layout.opacity != null) ? layout.zIndex.toString() : null; this.backgroundPosition = (layout.backgroundPosition != null) ? layout.backgroundPosition : null; this.ret = { marginTop: null, marginLeft: null }; }.observes('layout'),
$.getJSON(this.DATA_DIR + encodeURIComponent(schemaName) + this.CONFIG, null, callback);
$.getJSON(this.DATA_DIR + this.encode(schemaName) + this.CONFIG, null, callback);
_loadConfig: function (schemaName, callback) { $.getJSON(this.DATA_DIR + encodeURIComponent(schemaName) + this.CONFIG, null, callback); },
$.getJSON(this.DATA_DIR + schemaName + this.CONFIG, null, callback);
$.getJSON(this.DATA_DIR + schemaName + this.CONFIG, null, function(config) { for (var k in config.fuzzyMap) { var s = {}; $.each(config.fuzzyMap[k], function(i, e) { s[e] = true; }); config.fuzzyMap[k] = s; } callback(config); });
_loadConfig: function (schemaName, callback) { $.getJSON(this.DATA_DIR + schemaName + this.CONFIG, null, callback); },
$.getJSON(this.DATA_DIR + encodeURIComponent(prefix) + this.JSON, null, function (data) {
$.getJSON(this.DATA_DIR + this.encode(prefix) + this.JSON, null, function (data) {
_loadDict: function (schema, callback) { var me = this; var prefix = schema.prefix; $.getJSON(this.DATA_DIR + encodeURIComponent(prefix) + this.JSON, null, function (data) { data.prefix = prefix; me._dict = data; if (callback) { callback(schema); } }); },
e.prob = (e.unigram[2] + 0.1) / total * p;
e.prob = (e.unigram[2] + 0.1) / total * p * penalty;
_makePrediction: function (phrase, seg) { var total = this._dict.freqTotal + 0.1; var d = []; for (var j = seg.m; j >= 0; --j) { var p = (j == seg.m) ? 1.0 : (d[j] == undefined) ? 0.0 : d[j].prob; for (var i = 0; i < j; ++i) { var c; if (phrase[i] && (c = phrase[i][j])) { $.each(c, function (i_, e) { e.prob = (e.unigram[2] + 0.1) / total * p; if (d[i] == undefined || d[i].prob < e.prob) { d[i] = e; } }); } } } return d; }
some(function (m) m.rhs && m.rhs === map.rhs && m.name === map.name))))
some(function (m) m.rhs && m.rhs === map.rhs && m.name === map.name))));
_mappingsIterator: function (modes, stack) { modes = modes.slice(); return (map for ([i, map] in Iterator(stack[modes.shift()].sort(function (m1, m2) String.localeCompare(m1.name, m2.name)))) if (map.rhs && modes.every(function (mode) stack[mode]. some(function (m) m.rhs && m.rhs === map.rhs && m.name === map.name)))) },
if (modes.every(function (mode) stack[mode]. some(function (m) array.equals(m.rhs, map.rhs) && m.name == map.name))))
if (map.rhs && modes.every(function (mode) stack[mode]. some(function (m) m.rhs && array.equals(m.rhs, map.rhs) && m.name == map.name))))
_mappingsIterator: function (modes, stack) { modes = modes.slice(); return (map for ([i, map] in Iterator(stack[modes.shift()].sort(function (m1, m2) String.localeCompare(m1.name, m2.name)))) if (modes.every(function (mode) stack[mode]. some(function (m) array.equals(m.rhs, map.rhs) && m.name == map.name)))) },
_matchKey: function (k, i, seg, fuzzyMap) {
_matchKey: function (k, i, a, predict, fuzzyMap) {
_matchKey: function (k, i, seg, fuzzyMap) { if (k.length == 0) { return i; } // predict phrase if (i == seg.n) { return i; } var result = 0; var me = this; $.each(seg.a, function (j, c) { if (c && c[i]) { var found = false; $.each(fuzzyMap[c[i]], function (i_, t) { if (k[0] == t) { found = true; return false; } }); if (found) { var r = me._matchKey(k.slice(1), j, seg, fuzzyMap); if (r) { result = r; return false; } } } }); return result; },
if (i == seg.n) {
if (i == predict) {
_matchKey: function (k, i, seg, fuzzyMap) { if (k.length == 0) { return i; } // predict phrase if (i == seg.n) { return i; } var result = 0; var me = this; $.each(seg.a, function (j, c) { if (c && c[i]) { var found = false; $.each(fuzzyMap[c[i]], function (i_, t) { if (k[0] == t) { found = true; return false; } }); if (found) { var r = me._matchKey(k.slice(1), j, seg, fuzzyMap); if (r) { result = r; return false; } } } }); return result; },
var me = this; $.each(seg.a, function (j, c) { if (c && c[i]) { var found = false; $.each(fuzzyMap[c[i]], function (i_, t) { if (k[0] == t) { found = true; return false; } }); if (found) { var r = me._matchKey(k.slice(1), j, seg, fuzzyMap); if (r) { result = r; return false; }
for (var j = a.length - 1; j > i; --j) { var kw = a[j] && a[j][i]; if (!kw) continue; var s = fuzzyMap[kw]; if (s && s[k[0]]) { var r = this._matchKey(k.slice(1), j, a, predict, fuzzyMap); if (r) { result = r; break;
_matchKey: function (k, i, seg, fuzzyMap) { if (k.length == 0) { return i; } // predict phrase if (i == seg.n) { return i; } var result = 0; var me = this; $.each(seg.a, function (j, c) { if (c && c[i]) { var found = false; $.each(fuzzyMap[c[i]], function (i_, t) { if (k[0] == t) { found = true; return false; } }); if (found) { var r = me._matchKey(k.slice(1), j, seg, fuzzyMap); if (r) { result = r; return false; } } } }); return result; },
});
}
_matchKey: function (k, i, seg, fuzzyMap) { if (k.length == 0) { return i; } // predict phrase if (i == seg.n) { return i; } var result = 0; var me = this; $.each(seg.a, function (j, c) { if (c && c[i]) { var found = false; $.each(fuzzyMap[c[i]], function (i_, t) { if (k[0] == t) { found = true; return false; } }); if (found) { var r = me._matchKey(k.slice(1), j, seg, fuzzyMap); if (r) { result = r; return false; } } } }); return result; },
return this._methodized = function() { return __method.apply(null, [this].concat($A(arguments))); };
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])*?\*\
return this._methodized = function() { return __method.apply(null, [this].concat($A(arguments))); };
childViews[idx].notifyPropertyChange("baseTheme");
_notifyThemeDidChange: function() { var len, idx, childViews = this.get("childViews"); len = childViews.length; for (idx = 0; idx < len; idx++){ childViews[idx].notifyPropertyChange("theme"); } },
this._prevInput = "text";
this.prevInput = "text";
_onInput: function (event) { this._prevInput = "text"; // clear any timeout which might be active after pressing a number if (this._activeTimeout) { this._activeTimeout.cancel(); this._activeTimeout = null; } this._hintNumber = 0; this._hintString = commandline.command; this._updateStatusline(); this._showHints(); if (this._validHints.length == 1) this._processHints(false); },
if (this.encoding == 'utf8') data = utf8.decode(data);
if (this.encoding == 'utf8') { var raw = utf8.decode(data); var length = raw[1]; if (length != data.length) { throw new Error("Incomplete utf8 codepoint"); } data = raw[0] }
this._onreadraw = function(data) { if (this.encoding == 'utf8') data = utf8.decode(data); loggers.stream.debug('_onreadraw '+data); this.onread(data); }
return;
this._onReadyStateChange = function(rType, cb, eb) { try { var xhr = this._xhr[rType]; if(xhr.readyState != 4) { return; } if(xhr.status != 200) { logger.debug('XHR failed with status ', xhr.status); eb(); } logger.debug('XHR data received'); cb(eval(xhr.responseText)); } catch(e) { var xhr = this._xhr[rType]; logger.debug('Error in XHR::onReadyStateChange', e); eb(); abortXHR(xhr); logger.debug('done handling XHR error'); } };
if (options["focuscontent"]) this.timeout(function () { dactyl.focusContent(true); }, 10);
_onTabSelect: function () { // TODO: is all of that necessary? // I vote no. --Kris modes.reset(); statusline.updateTabCount(true); this.updateSelectionHistory(); if (options["focuscontent"]) this.timeout(function () { dactyl.focusContent(true); }, 10); // just make sure, that no widget has focus },
var newObj=editor.dom.create(tagname);editor.dom.setAttribs(newObj,args);if(tinymce.isIE){newObj.innerHTML=targetObj.innerHTML;targetObj.parentNode.replaceChild(newObj,targetObj);}else{editor.dom.replace(newObj,targetObj,true);} tagList=doc.getElementsByTagName(org_tagname);}
var newObj=editor.dom.create(tagname);editor.dom.setAttribs(newObj,args);editor.dom.replace(newObj,targetObj,true);tagList=doc.getElementsByTagName(org_tagname);}
id=t.prefix+id;s=tinymce.extend({title:s.title,'class':'mce_'+id,'menu_class':ed.getParam('skin')+'Skin',scope:s.scope},s);c=new tinymce.ui.OpenPNECmdButton(id,s);ed.onPostRender.add(function(){var parentContainer=document.getElementById(c.id).parentNode;parentContainer.style.width="70px";});ed.onRemove.add(function(){c.destroy();});return t.add(c);},_previewToText:function(s,editor){var editorDoc=editor.getBody();function rep(re,str){s=s.replace(re,str);};if(!tinymce.isWebKit){s=tinymce.trim(s);rep('/<(\/?)strong>/gi','<\1b>');rep('/<(\/?)strike>/gi','<\1s>');rep('/<(\/?)em>/gi','<\1i>');editor.dom.setHTML(editor.getBody(),s);}function convertHtmlTagToDecoTag(doc,tagname){var tagList=doc.getElementsByTagName(tagname);var org_tagname=tagname;var args={};while(tagList.length){targetObj=tagList[0];args={};if(org_tagname=="font"){var size=targetObj.getAttribute("size");var color=targetObj.getAttribute("color");tagname='op:font';if(size&&color){if(tinymce.isIE){targetObj.removeAttribute("color");targetObj.innerHTML='<font color="'+color+'">'+targetObj.innerHTML+"</font>";}else{var fontSize=document.createElement("font");fontSize.setAttribute("size",size);fontSize.removeAttribute("color");var clone=targetObj.cloneNode(true);clone.removeAttribute("size");fontSize.appendChild(clone);targetObj.parentNode.replaceChild(fontSize,targetObj);}tagList=doc.getElementsByTagName(org_tagname);continue;}if(size>=1&&size<=7){args['size']=size;}if(color){args['color']=color;}if(tagname==org_tagname){editor.dom.remove(targetObj,true);tagList=doc.getElementsByTagName(org_tagname);continue;}}else if(org_tagname=='span'){if(targetObj.style.fontWeight=='bold'){tagname='op:b';}else if(targetObj.style.textDecoration=='underline'){tagname='op:u';}else if(targetObj.style.textDecoration=='line-through'){tagname='op:s';}else if(targetObj.style.fontStyle=='italic'){tagname='op:i';}else if(targetObj.style.color){var color=tinyMCE.activeEditor.dom.toHex(targetObj.style.color);tagname='op:font';args['color']=color;}else if(targetObj.style.fontSize){var fontSizeMap={'xx-small':1,'x-small':2,'small':3,'medium':4,'large':5,'x-large':6,'xx-large':7}if(!fontSizeMap[targetObj.style.fontSize]){editor.dom.remove(targetObj,true);continue;}tagname='op:font';args['size']=fontSizeMap[targetObj.style.fontSize];}else{editor.dom.remove(targetObj,true);continue;}}else{tagname='op:'+org_tagname;}if(tinymce.isIE){tagname=tagname.replace("op:","op");}var newObj=editor.dom.create(tagname);editor.dom.setAttribs(newObj,args);if(tinymce.isIE){newObj.innerHTML=targetObj.innerHTML;targetObj.parentNode.replaceChild(newObj,targetObj);}else{editor.dom.replace(newObj,targetObj,true);}tagList=doc.getElementsByTagName(org_tagname);}s=editorDoc.innerHTML;}var convertList=new Array('span','font','b','u','s','i');for(var i=0;i<convertList.length;i++){convertHtmlTagToDecoTag(editor.getBody(),convertList[i]);}rep(/<\/?div>/gi,"");if(Prototype.Browser.IE){rep(/<(\/?)op(b|u|s|i|font|large|small|color)/gi,'<$1op:$2');}rep(/<br\s?\/?[^>]*>/gi,"\n\n");rep(/&nbsp;/gi," ");rep(/&quot;/gi,"\"");rep(/&lt;/gi,"<");rep(/&gt;/gi,">");rep(/&amp;/gi,"&");return s;},_textToPreview:function(s){s=tinymce.trim(s);var rule=/&lt;op:(b|u|s|i|font|large|small|color)(\s+(.*?)|)&gt;(.*?)&lt;\/op:\1&gt;/i;function rep(re,str){s=s.replace(re,str);};function getAttributes(str){var result={};if(!str){return result;}
rep(/<\/?div>/gi,"");if(Prototype.Browser.IE){rep(/<(\/?)op(b|u|s|i|font|large|small|color)/gi,'<$1op:$2');}
rep(/<\/?div>/gi,"");if(Prototype.Browser.IE){rep(/<(\/?):?op(b|u|s|i|font|large|small|color)/gi,'<$1op:$2');}
id=t.prefix+id;s=tinymce.extend({title:s.title,'class':'mce_'+id,'menu_class':ed.getParam('skin')+'Skin',scope:s.scope},s);c=new tinymce.ui.OpenPNECmdButton(id,s);ed.onPostRender.add(function(){var parentContainer=document.getElementById(c.id).parentNode;parentContainer.style.width="70px";});ed.onRemove.add(function(){c.destroy();});return t.add(c);},_previewToText:function(s,editor){var editorDoc=editor.getBody();function rep(re,str){s=s.replace(re,str);};if(!tinymce.isWebKit){s=tinymce.trim(s);rep('/<(\/?)strong>/gi','<\1b>');rep('/<(\/?)strike>/gi','<\1s>');rep('/<(\/?)em>/gi','<\1i>');editor.dom.setHTML(editor.getBody(),s);}function convertHtmlTagToDecoTag(doc,tagname){var tagList=doc.getElementsByTagName(tagname);var org_tagname=tagname;var args={};while(tagList.length){targetObj=tagList[0];args={};if(org_tagname=="font"){var size=targetObj.getAttribute("size");var color=targetObj.getAttribute("color");tagname='op:font';if(size&&color){if(tinymce.isIE){targetObj.removeAttribute("color");targetObj.innerHTML='<font color="'+color+'">'+targetObj.innerHTML+"</font>";}else{var fontSize=document.createElement("font");fontSize.setAttribute("size",size);fontSize.removeAttribute("color");var clone=targetObj.cloneNode(true);clone.removeAttribute("size");fontSize.appendChild(clone);targetObj.parentNode.replaceChild(fontSize,targetObj);}tagList=doc.getElementsByTagName(org_tagname);continue;}if(size>=1&&size<=7){args['size']=size;}if(color){args['color']=color;}if(tagname==org_tagname){editor.dom.remove(targetObj,true);tagList=doc.getElementsByTagName(org_tagname);continue;}}else if(org_tagname=='span'){if(targetObj.style.fontWeight=='bold'){tagname='op:b';}else if(targetObj.style.textDecoration=='underline'){tagname='op:u';}else if(targetObj.style.textDecoration=='line-through'){tagname='op:s';}else if(targetObj.style.fontStyle=='italic'){tagname='op:i';}else if(targetObj.style.color){var color=tinyMCE.activeEditor.dom.toHex(targetObj.style.color);tagname='op:font';args['color']=color;}else if(targetObj.style.fontSize){var fontSizeMap={'xx-small':1,'x-small':2,'small':3,'medium':4,'large':5,'x-large':6,'xx-large':7}if(!fontSizeMap[targetObj.style.fontSize]){editor.dom.remove(targetObj,true);continue;}tagname='op:font';args['size']=fontSizeMap[targetObj.style.fontSize];}else{editor.dom.remove(targetObj,true);continue;}}else{tagname='op:'+org_tagname;}if(tinymce.isIE){tagname=tagname.replace("op:","op");}var newObj=editor.dom.create(tagname);editor.dom.setAttribs(newObj,args);if(tinymce.isIE){newObj.innerHTML=targetObj.innerHTML;targetObj.parentNode.replaceChild(newObj,targetObj);}else{editor.dom.replace(newObj,targetObj,true);}tagList=doc.getElementsByTagName(org_tagname);}s=editorDoc.innerHTML;}var convertList=new Array('span','font','b','u','s','i');for(var i=0;i<convertList.length;i++){convertHtmlTagToDecoTag(editor.getBody(),convertList[i]);}rep(/<\/?div>/gi,"");if(Prototype.Browser.IE){rep(/<(\/?)op(b|u|s|i|font|large|small|color)/gi,'<$1op:$2');}rep(/<br\s?\/?[^>]*>/gi,"\n\n");rep(/&nbsp;/gi," ");rep(/&quot;/gi,"\"");rep(/&lt;/gi,"<");rep(/&gt;/gi,">");rep(/&amp;/gi,"&");return s;},_textToPreview:function(s){s=tinymce.trim(s);var rule=/&lt;op:(b|u|s|i|font|large|small|color)(\s+(.*?)|)&gt;(.*?)&lt;\/op:\1&gt;/i;function rep(re,str){s=s.replace(re,str);};function getAttributes(str){var result={};if(!str){return result;}
this._hintMode.action(elem, elem.href || "", this._extendedhintCount);
this._hintMode.action(elem, elem.href || "", this._extendedhintCount, top);
_processHints: function (followFirst) { if (this._validHints.length == 0) { dactyl.beep(); return false; } // This "followhints" option is *too* confusing. For me, and // presumably for users, too. --Kris if (options["followhints"] > 0) { if (!followFirst) return false; // no return hit; don't examine uniqueness // OK. return hit. But there's more than one hint, and // there's no tab-selected current link. Do not follow in mode 2 dactyl.assert(options["followhints"] != 2 || this._validHints.length == 1 || this._hintNumber); } if (!followFirst) { let firstHref = this._validHints[0].getAttribute("href") || null; if (firstHref) { if (this._validHints.some(function (e) e.getAttribute("href") != firstHref)) return false; } else if (this._validHints.length > 1) return false; } let timeout = followFirst || events.feedingKeys ? 0 : 500; let activeIndex = (this._hintNumber ? this._hintNumber - 1 : 0); let elem = this._validHints[activeIndex]; this._removeHints(timeout); if (timeout == 0) // force a possible mode change, based on whether an input field has focus events.onFocusChange(); this.timeout(function () { if (modes.extended & modes.HINTS) modes.pop(); this._hintMode.action(elem, elem.href || "", this._extendedhintCount); }, timeout); return true; },
if (this._continue) {
if (this._continue)
_processHints: function (followFirst) { if (this._validHints.length == 0) { dactyl.beep(); return false; } // This "followhints" option is *too* confusing. For me, and // presumably for users, too. --Kris if (options["followhints"] > 0) { if (!followFirst) return false; // no return hit; don't examine uniqueness // OK. return hit. But there's more than one hint, and // there's no tab-selected current link. Do not follow in mode 2 dactyl.assert(options["followhints"] != 2 || this._validHints.length == 1 || this._hintNumber); } if (!followFirst) { let firstHref = this._validHints[0].getAttribute("href") || null; if (firstHref) { if (this._validHints.some(function (e) e.getAttribute("href") != firstHref)) return false; } else if (this._validHints.length > 1) return false; } let timeout = followFirst || events.feedingKeys ? 0 : 500; let activeIndex = (this._hintNumber ? this._hintNumber - 1 : 0); let elem = this._validHints[activeIndex]; let top = this._top; if (this._continue) { this.__reset(); if (this._validHints.length <= 1) this._showHints(); } else { this._removeHints(timeout); } let n = 5; (function next() { this._setClass(elem, n % 2); if (n--) this.timeout(next, 50); else if (!this._top) elem.removeAttributeNS(NS, "highlight"); }).call(this); this.timeout(function () { if ((modes.extended & modes.HINTS) && !this._continue) modes.pop(); commandline._lastEcho = null; // Hack. dactyl.trapErrors(this._hintMode.action, this._hintMode, elem, elem.href || elem.src || "", this._extendedhintCount, top); }, timeout); return true; },
if (this._validHints.length <= 1) this._showHints(); } else {
else
_processHints: function (followFirst) { if (this._validHints.length == 0) { dactyl.beep(); return false; } // This "followhints" option is *too* confusing. For me, and // presumably for users, too. --Kris if (options["followhints"] > 0) { if (!followFirst) return false; // no return hit; don't examine uniqueness // OK. return hit. But there's more than one hint, and // there's no tab-selected current link. Do not follow in mode 2 dactyl.assert(options["followhints"] != 2 || this._validHints.length == 1 || this._hintNumber); } if (!followFirst) { let firstHref = this._validHints[0].getAttribute("href") || null; if (firstHref) { if (this._validHints.some(function (e) e.getAttribute("href") != firstHref)) return false; } else if (this._validHints.length > 1) return false; } let timeout = followFirst || events.feedingKeys ? 0 : 500; let activeIndex = (this._hintNumber ? this._hintNumber - 1 : 0); let elem = this._validHints[activeIndex]; let top = this._top; if (this._continue) { this.__reset(); if (this._validHints.length <= 1) this._showHints(); } else { this._removeHints(timeout); } let n = 5; (function next() { this._setClass(elem, n % 2); if (n--) this.timeout(next, 50); else if (!this._top) elem.removeAttributeNS(NS, "highlight"); }).call(this); this.timeout(function () { if ((modes.extended & modes.HINTS) && !this._continue) modes.pop(); commandline._lastEcho = null; // Hack. dactyl.trapErrors(this._hintMode.action, this._hintMode, elem, elem.href || elem.src || "", this._extendedhintCount, top); }, timeout); return true; },
}
_processHints: function (followFirst) { if (this._validHints.length == 0) { dactyl.beep(); return false; } // This "followhints" option is *too* confusing. For me, and // presumably for users, too. --Kris if (options["followhints"] > 0) { if (!followFirst) return false; // no return hit; don't examine uniqueness // OK. return hit. But there's more than one hint, and // there's no tab-selected current link. Do not follow in mode 2 dactyl.assert(options["followhints"] != 2 || this._validHints.length == 1 || this._hintNumber); } if (!followFirst) { let firstHref = this._validHints[0].getAttribute("href") || null; if (firstHref) { if (this._validHints.some(function (e) e.getAttribute("href") != firstHref)) return false; } else if (this._validHints.length > 1) return false; } let timeout = followFirst || events.feedingKeys ? 0 : 500; let activeIndex = (this._hintNumber ? this._hintNumber - 1 : 0); let elem = this._validHints[activeIndex]; let top = this._top; if (this._continue) { this.__reset(); if (this._validHints.length <= 1) this._showHints(); } else { this._removeHints(timeout); } let n = 5; (function next() { this._setClass(elem, n % 2); if (n--) this.timeout(next, 50); else if (!this._top) elem.removeAttributeNS(NS, "highlight"); }).call(this); this.timeout(function () { if ((modes.extended & modes.HINTS) && !this._continue) modes.pop(); commandline._lastEcho = null; // Hack. dactyl.trapErrors(this._hintMode.action, this._hintMode, elem, elem.href || elem.src || "", this._extendedhintCount, top); }, timeout); return true; },
else if (!this._top)
else if (!this._validHints.some(function (h) h.elem == elem))
_processHints: function (followFirst) { if (this._validHints.length == 0) { dactyl.beep(); return false; } // This "followhints" option is *too* confusing. For me, and // presumably for users, too. --Kris if (options["followhints"] > 0) { if (!followFirst) return false; // no return hit; don't examine uniqueness // OK. return hit. But there's more than one hint, and // there's no tab-selected current link. Do not follow in mode 2 dactyl.assert(options["followhints"] != 2 || this._validHints.length == 1 || this._hintNumber); } if (!followFirst) { let firstHref = this._validHints[0].getAttribute("href") || null; if (firstHref) { if (this._validHints.some(function (e) e.getAttribute("href") != firstHref)) return false; } else if (this._validHints.length > 1) return false; } let timeout = followFirst || events.feedingKeys ? 0 : 500; let activeIndex = (this._hintNumber ? this._hintNumber - 1 : 0); let elem = this._validHints[activeIndex]; let top = this._top; if (this._continue) { this.__reset(); if (this._validHints.length <= 1) this._showHints(); } else { this._removeHints(timeout); } let n = 5; (function next() { this._setClass(elem, n % 2); if (n--) this.timeout(next, 50); else if (!this._top) elem.removeAttributeNS(NS, "highlight"); }).call(this); this.timeout(function () { if ((modes.extended & modes.HINTS) && !this._continue) modes.pop(); commandline._lastEcho = null; // Hack. dactyl.trapErrors(this._hintMode.action, this._hintMode, elem, elem.href || elem.src || "", this._extendedhintCount, top); }, timeout); return true; },
if (timeout == 0) events.onFocusChange();
_processHints: function (followFirst) { if (this._validHints.length == 0) { dactyl.beep(); return false; } // This "followhints" option is *too* confusing. For me, and // presumably for users, too. --Kris if (options["followhints"] > 0) { if (!followFirst) return false; // no return hit; don't examine uniqueness // OK. return hit. But there's more than one hint, and // there's no tab-selected current link. Do not follow in mode 2 dactyl.assert(options["followhints"] != 2 || this._validHints.length == 1 || this._hintNumber); } if (!followFirst) { let firstHref = this._validHints[0].getAttribute("href") || null; if (firstHref) { if (this._validHints.some(function (e) e.getAttribute("href") != firstHref)) return false; } else if (this._validHints.length > 1) return false; } let timeout = followFirst || events.feedingKeys ? 0 : 500; let activeIndex = (this._hintNumber ? this._hintNumber - 1 : 0); let elem = this._validHints[activeIndex]; let top = this._top; if (this._continue) { this.__reset(); if (this._validHints.length <= 1) this._showHints(); } else { this._removeHints(timeout); if (timeout == 0) // force a possible mode change, based on whether an input field has focus events.onFocusChange(); } this.timeout(function () { if ((modes.extended & modes.HINTS) && !this._continue) modes.pop(); commandline._lastEcho = null; // Hack. dactyl.trapErrors(this._hintMode.action, this._hintMode, elem, elem.href || elem.src || "", this._extendedhintCount, top); }, timeout); return true; },
let n = 3; (function next() { this._setClass(elem, n % 2); if (n--) this.timeout(next, 50); else if (!this._top) elem.removeAttributeNS(NS, "highlight"); }).call(this);
_processHints: function (followFirst) { if (this._validHints.length == 0) { dactyl.beep(); return false; } // This "followhints" option is *too* confusing. For me, and // presumably for users, too. --Kris if (options["followhints"] > 0) { if (!followFirst) return false; // no return hit; don't examine uniqueness // OK. return hit. But there's more than one hint, and // there's no tab-selected current link. Do not follow in mode 2 dactyl.assert(options["followhints"] != 2 || this._validHints.length == 1 || this._hintNumber); } if (!followFirst) { let firstHref = this._validHints[0].getAttribute("href") || null; if (firstHref) { if (this._validHints.some(function (e) e.getAttribute("href") != firstHref)) return false; } else if (this._validHints.length > 1) return false; } let timeout = followFirst || events.feedingKeys ? 0 : 500; let activeIndex = (this._hintNumber ? this._hintNumber - 1 : 0); let elem = this._validHints[activeIndex]; let top = this._top; if (this._continue) { this.__reset(); if (this._validHints.length <= 1) this._showHints(); } else { this._removeHints(timeout); if (timeout == 0) // force a possible mode change, based on whether an input field has focus events.onFocusChange(); } this.timeout(function () { if ((modes.extended & modes.HINTS) && !this._continue) modes.pop(); commandline._lastEcho = null; // Hack. dactyl.trapErrors(this._hintMode.action, this._hintMode, elem, elem.href || elem.src || "", this._extendedhintCount, top); }, timeout); return true; },
modes.reset();
modes.pop();
_processHints: function (followFirst) { if (this._validHints.length == 0) { dactyl.beep(); return false; } // This "followhints" option is *too* confusing. For me, and // presumably for users, too. --Kris if (options["followhints"] > 0) { if (!followFirst) return false; // no return hit; don't examine uniqueness // OK. return hit. But there's more than one hint, and // there's no tab-selected current link. Do not follow in mode 2 dactyl.assert(options["followhints"] != 2 || this._validHints.length == 1 || this._hintNumber); } if (!followFirst) { let firstHref = this._validHints[0].getAttribute("href") || null; if (firstHref) { if (this._validHints.some(function (e) e.getAttribute("href") != firstHref)) return false; } else if (this._validHints.length > 1) return false; } let timeout = followFirst || events.feedingKeys ? 0 : 500; let activeIndex = (this._hintNumber ? this._hintNumber - 1 : 0); let elem = this._validHints[activeIndex]; this._removeHints(timeout); if (timeout == 0) // force a possible mode change, based on whether an input field has focus events.onFocusChange(); this.timeout(function () { if (modes.extended & modes.HINTS) modes.reset(); this._hintMode.action(elem, elem.href || "", this._extendedhintCount); }, timeout); return true; },
_registerQuery: function (r) {
_registerQuery: function (queries, r) {
_registerQuery: function (r) { //Logger.debug("registerQuery: [" + r.start + ", " + r.end + ") " + r.ikey); var index = r.ikey.slice(0, this._dict.indexingLevel).join("_"); if (this._queries[index]) this._queries[index].push(r); else this._queries[index] = [r]; },
if (this._queries[index]) this._queries[index].push(r);
if (queries[index]) queries[index].push(r);
_registerQuery: function (r) { //Logger.debug("registerQuery: [" + r.start + ", " + r.end + ") " + r.ikey); var index = r.ikey.slice(0, this._dict.indexingLevel).join("_"); if (this._queries[index]) this._queries[index].push(r); else this._queries[index] = [r]; },
this._queries[index] = [r];
queries[index] = [r];
_registerQuery: function (r) { //Logger.debug("registerQuery: [" + r.start + ", " + r.end + ") " + r.ikey); var index = r.ikey.slice(0, this._dict.indexingLevel).join("_"); if (this._queries[index]) this._queries[index].push(r); else this._queries[index] = [r]; },
this._checkboxRenderer.attr('classNames', { 'active': NO }); this._checkboxRenderer.update(this.$('.sc-checkbox-view'));
var source = this._checkboxRenderSource; if (!source) source = this._checkboxRenderSource = SC.Object.create(); source.set('isActive', NO); this._checkboxRenderDelegate.update(source, this.$('.sc-checkbox-view'));
_removeCheckboxActiveState: function() { if (this._checkboxRenderer) { this._checkboxRenderer.attr('classNames', { 'active': NO }); this._checkboxRenderer.update(this.$('.sc-checkbox-view')); } else { // for backwards-compatibility. this.$('.sc-checkbox-view').removeClass('active'); } },
if (!source) source = this._checkboxRenderSource = SC.Object.create();
_removeCheckboxActiveState: function() { if (this._checkboxRenderer) { var source = this._checkboxRenderSource; if (!source) source = this._checkboxRenderSource = SC.Object.create(); source.set('isActive', NO); this._checkboxRenderDelegate.update(source, this.$('.sc-checkbox-view')); } else { // for backwards-compatibility. this.$('.sc-checkbox-view').removeClass('active'); } },
this.renderer.attr({ checkboxActive: NO }); this.displayDidChange();
this._checkboxRenderer.attr('classNames', { 'active': NO }); this._checkboxRenderer.update(this.$('.sc-checkbox-view'));
_removeCheckboxActiveState: function() { this.renderer.attr({ checkboxActive: NO }); this.displayDidChange(); },
this._disclosureRenderer.attr('classNames', { 'active': NO }); this._disclosureRenderer.update(this.$('.sc-disclosure-view'));
var source = this._disclosureRenderSource; source.set('isActive', NO); this._disclosureRenderDelegate.update(source, this.$('.sc-disclosure-view'));
_removeDisclosureActiveState: function() { if (this._disclosureRenderer) { this._disclosureRenderer.attr('classNames', { 'active': NO }); this._disclosureRenderer.update(this.$('.sc-disclosure-view')); } else { // for backwards-compatibility. this.$('.sc-disclosure-view').addClass('active'); } },
this.renderer.attr({ disclosureActive: NO }); this.displayDidChange();
this._disclosureRenderer.attr('classNames', { 'active': NO }); this._disclosureRenderer.update(this.$('.sc-list-item-disclosure'));
_removeDisclosureActiveState: function() { this.renderer.attr({ disclosureActive: NO }); this.displayDidChange(); },
for (let elem in util.evaluateXPath("
let result = util.evaluateXPath(" let hints = new Array(); let elem; while (elem = result.iterateNext()) hints.push(elem); while (elem = hints.pop())
_removeHints: function (timeout) { let firstElem = this._validHints[0] || null; for (let [,{ doc: doc, start: start, end: end }] in Iterator(this._docs)) { for (let elem in util.evaluateXPath("//*[@liberator:highlight='hints']", doc)) elem.parentNode.removeChild(elem); for (let i in util.range(start, end + 1)) { let hint = this._pageHints[i]; if (!timeout || hint.elem != firstElem) hint.elem.removeAttributeNS(NS.uri, "highlight"); } // animate the disappearance of the first hint if (timeout && firstElem) setTimeout(function () { firstElem.removeAttributeNS(NS.uri, "highlight"); }, timeout); } styles.removeSheet(true, "hint-positions"); this._reset(); },
if (this._top) this._top.removeEventListener("resize", this._resizeTimer.closure.tell, true); this._top = null;
_removeHints: function (timeout, slight) { let firstElem = this._validHints[0] || null; if (this._top) this._top.removeEventListener("resize", this._resizeTimer.closure.tell, true); this._top = null; for (let [,{ doc: doc, start: start, end: end }] in Iterator(this._docs)) { for (let elem in util.evaluateXPath("//*[@dactyl:highlight='hints']", doc)) elem.parentNode.removeChild(elem); for (let i in util.range(start, end + 1)) { let hint = this._pageHints[i]; if (!timeout || hint.elem != firstElem) hint.elem.removeAttributeNS(NS.uri, "highlight"); } // animate the disappearance of the first hint if (timeout && firstElem) this.timeout(function () { firstElem.removeAttributeNS(NS.uri, "highlight"); }, timeout); } styles.removeSheet(true, "hint-positions"); this._reset(slight); },
util.dump(String(doc), start, end);
_removeHints: function (timeout, slight) { for (let [,{ doc: doc, start: start, end: end }] in Iterator(this._docs)) { for (let elem in util.evaluateXPath("//*[@dactyl:highlight='hints']", doc)) elem.parentNode.removeChild(elem); for (let i in util.range(start, end + 1)) this._pageHints[i].elem.removeAttributeNS(NS, "highlight"); } styles.removeSheet(true, "hint-positions"); this._reset(slight); },
let firstElem = this._validHints[0] || null;
_removeHints: function (timeout, slight) { let firstElem = this._validHints[0] || null; for (let [,{ doc: doc, start: start, end: end }] in Iterator(this._docs)) { for (let elem in util.evaluateXPath("//*[@dactyl:highlight='hints']", doc)) elem.parentNode.removeChild(elem); for (let i in util.range(start, end + 1)) { let hint = this._pageHints[i]; if (!timeout || hint.elem != firstElem) hint.elem.removeAttributeNS(NS.uri, "highlight"); } // animate the disappearance of the first hint if (timeout && firstElem) this.timeout(function () { firstElem.removeAttributeNS(NS.uri, "highlight"); }, timeout); } styles.removeSheet(true, "hint-positions"); this._reset(slight); },
for (let i in util.range(start, end + 1)) { let hint = this._pageHints[i]; if (!timeout || hint.elem != firstElem) hint.elem.removeAttributeNS(NS.uri, "highlight"); } if (timeout && firstElem) this.timeout(function () { firstElem.removeAttributeNS(NS.uri, "highlight"); }, timeout);
for (let i in util.range(start, end + 1)) this._pageHints[i].elem.removeAttributeNS(NS, "highlight");
_removeHints: function (timeout, slight) { let firstElem = this._validHints[0] || null; for (let [,{ doc: doc, start: start, end: end }] in Iterator(this._docs)) { for (let elem in util.evaluateXPath("//*[@dactyl:highlight='hints']", doc)) elem.parentNode.removeChild(elem); for (let i in util.range(start, end + 1)) { let hint = this._pageHints[i]; if (!timeout || hint.elem != firstElem) hint.elem.removeAttributeNS(NS.uri, "highlight"); } // animate the disappearance of the first hint if (timeout && firstElem) this.timeout(function () { firstElem.removeAttributeNS(NS.uri, "highlight"); }, timeout); } styles.removeSheet(true, "hint-positions"); this._reset(slight); },
this._prevInput = "";
this.prevInput = "";
_reset: function () { statusline.updateInputBuffer(""); this._hintString = ""; this._hintNumber = 0; this._usedTabKey = false; this._prevInput = ""; this._pageHints = []; this._validHints = []; this._canUpdate = false; this._docs = []; hints.escNumbers = false; if (this._activeTimeout) this._activeTimeout.cancel(); this._activeTimeout = null; },
this._error = null;
if (this.pending) { this._backend.abortQuery(this); } this.pending = null; this.error = null;
_reset: function () { this.input = []; this._error = null; this._segmentation = null; this._display = null; this._selected = []; this._current = null; this._candidateList = null; },