rem
stringlengths 0
126k
| add
stringlengths 0
441k
| context
stringlengths 15
136k
|
---|---|---|
dactyl.assert(!names.some(function (name) name in this._exMap, this), | memoize(this._exMap, name, function () Command.apply(null, args)); | dactyl.assert(!names.some(function (name) name in this._exMap, this), |
return request('http: try{ tags = JSON.parse(res.responseText)['tags']; } catch(e) { throw new Error(chrome.i18n.getMessage('error_notLoggedin', self.name)); | }).addCallback(function(res){ var doc = createHTML(res.responseText); if(!doc.getElementById('title')) throw new Error(getMessage('error.notLoggedin')); function getTags(part){ return $X('id("save-' + part + '-tags") | return request('http://b.hatena.ne.jp/'+user+'/tags.json').addCallback(function(res){ try{ tags = JSON.parse(res.responseText)['tags']; } catch(e) { throw new Error(chrome.i18n.getMessage('error_notLoggedin', self.name)); } return self.tags = items(tags).map(function(pair){ return { name : pair[0], frequency : pair[1].count } }); }); |
return self.tags = items(tags).map(function(pair){ return { name : pair[0], frequency : pair[1].count } }); }); | return { editPage : editPage = 'http: form : { item : doc.getElementById('title').value, description : doc.getElementById('notes').value, tags : doc.getElementById('tags').value.split(' '), private : doc.getElementById('share').checked }, duplicated : !!doc.getElementById('delete'), recommended : getTags('reco'), popular : getTags('pop'), network : getTags('net') } }) | return request('http://b.hatena.ne.jp/'+user+'/tags.json').addCallback(function(res){ try{ tags = JSON.parse(res.responseText)['tags']; } catch(e) { throw new Error(chrome.i18n.getMessage('error_notLoggedin', self.name)); } return self.tags = items(tags).map(function(pair){ return { name : pair[0], frequency : pair[1].count } }); }); |
return this._exMap[name] || !full && this._exCommands.filter(function (cmd) cmd.hasName(name))[0] || null; | defaults = array(this.options).map(function (opt) [opt.names[0], opt.default]).toObject(); | return this._exMap[name] || !full && this._exCommands.filter(function (cmd) cmd.hasName(name))[0] || null; |
context.fork(dir, 0, this, function (context) { dir = dir.replace("/+$", "") + "/"; completion.file(context, true, dir + context.filter); context.title[0] = dir; context.keys.text = function (f) this.path.substr(dir.length); }); | context.filters.push(function (item) item.isdir || !wig.getKey(this.name)); | context.fork(dir, 0, this, function (context) { dir = dir.replace("/+$", "") + "/"; completion.file(context, true, dir + context.filter); context.title[0] = dir; context.keys.text = function (f) this.path.substr(dir.length); }); |
}, function(res){ func({ success: false, content: res }); }); | getSelected().addCallback(function(tab){ var ps = req.content; if(req.show){ TBRL.Popup.open(tab, ps); } else { var posters = Models.getDefaults(ps); if(!posters.length){ alert(chrome.i18n.getMessage('error_noPoster', ps.type.capitalize())); } else { TBRL.Service.post(ps, posters); } } func({}); }).addErrback(function(e){ | }, function(res){ func({ success: false, content: res }); }); |
context.filters.push(function ({ item }) item != window); | function (args) { dactyl.assert(args.length <= 2 && !args.some(function (i) !/^\d+$/.test(i)), "E488: Trailing characters"); let [winIndex, tabIndex] = args.map(parseInt); let win = dactyl.windows[winIndex - 1]; dactyl.assert(win, "Window " + winIndex + " does not exist"); dactyl.assert(win != window, "Can't reattach to the same window"); let browser = win.getBrowser(); let dummy = browser.addTab("about:blank"); browser.stop(); browser.docShell; let last = browser.mTabs.length - 1; browser.moveTabTo(dummy, Math.constrain(tabIndex || last, 0, last)); browser.selectedTab = dummy; browser.swapBrowsersAndCloseOther(dummy, config.tabbrowser.mCurrentTab); }, { | context.filters.push(function ({ item }) item != window); |
function () { editor.expandAbbreviation(modes.COMMAND_LINE); }); | function () { commandline.resetCompletions(); return editor.expandAbbreviation(modes.COMMAND_LINE); }, | function () { editor.expandAbbreviation(modes.COMMAND_LINE); }); |
mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ca:Ba,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ca:Ba)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(a,b,d){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit."+d.guid,function(f){var e=f.target,i=e.type;if((i==="submit"||i==="image")&&c(e).closest("form").length)return pa("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit."+ | "events").live||[],function(){if(d===this.origType.replace(O,""))return b=false});b&&c.event.remove(this,a.origType,oa)}},beforeunload:{setup:function(a,b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};var Ca=s.removeEventListener?function(a,b,d){a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent= | mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ca:Ba,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ca:Ba)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(a,b,d){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit."+d.guid,function(f){var e=f.target,i=e.type;if((i==="submit"||i==="image")&&c(e).closest("form").length)return pa("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit."+ |
[v for ([k, v] in Iterator(groups))].every(function (g) !g.validator || g.validator(val)) | function () { dactyl.help(); }); | [v for ([k, v] in Iterator(groups))].every(function (g) !g.validator || g.validator(val)) |
[v for ([k, v] in Iterator(groups))].every(function (g) !g.validator || g.validator(val)) | function () { liberator.help(); }); | [v for ([k, v] in Iterator(groups))].every(function (g) !g.validator || g.validator(val)) |
return this.getCurrentUser(user).addCallback(function(user){ return succeed().addCallback(function(){ return request('http: }).addCallback(function(res){ var tags = JSON.parse(res.responseText); return Object.keys(tags).reduce(function(memo, tag){ if(tag){ memo.push({ name : tag, frequency : tags[tag] }); | return request('http: try{ tags = JSON.parse(res.responseText)['tags']; } catch(e) { throw new Error(chrome.i18n.getMessage('error_notLoggedin', self.name)); } return self.tags = items(tags).map(function(pair){ return { name : pair[0], frequency : pair[1].count | return this.getCurrentUser(user).addCallback(function(user){ // εζγ§γ¨γ©γΌγθ΅·γγͺγγγγ«γγ return succeed().addCallback(function(){ return request('http://feeds.delicious.com/v2/json/tags/' + user); }).addCallback(function(res){ var tags = JSON.parse(res.responseText); return Object.keys(tags).reduce(function(memo, tag){ if(tag){ memo.push({ name : tag, frequency : tags[tag] }); } return memo; }, []); }); }); |
return memo; }, []); | }); | return this.getCurrentUser(user).addCallback(function(user){ // εζγ§γ¨γ©γΌγθ΅·γγͺγγγγ«γγ return succeed().addCallback(function(){ return request('http://feeds.delicious.com/v2/json/tags/' + user); }).addCallback(function(res){ var tags = JSON.parse(res.responseText); return Object.keys(tags).reduce(function(memo, tag){ if(tag){ memo.push({ name : tag, frequency : tags[tag] }); } return memo; }, []); }); }); |
}); | return this.getCurrentUser(user).addCallback(function(user){ // εζγ§γ¨γ©γΌγθ΅·γγͺγγγγ«γγ return succeed().addCallback(function(){ return request('http://feeds.delicious.com/v2/json/tags/' + user); }).addCallback(function(res){ var tags = JSON.parse(res.responseText); return Object.keys(tags).reduce(function(memo, tag){ if(tag){ memo.push({ name : tag, frequency : tags[tag] }); } return memo; }, []); }); }); |
|
for (let i in Iterator(tabs.closedTabs)) window.undoCloseTab(0); | if (args.length) args = args[0]; else args = args.count || 0; | function (args) { for (let i in Iterator(tabs.closedTabs)) window.undoCloseTab(0); }, |
}, | let m = /^(\d+)(:|$)/.exec(args || '1'); if (m) window.undoCloseTab(Number(m[1]) - 1); else if (args) { for (let [i, item] in Iterator(tabs.closedTabs)) if (item.state.entries[item.state.index - 1].url == args) { window.undoCloseTab(i); return; } dactyl.echoerr("Exxx: No matching closed tab"); } }, { | function (args) { for (let i in Iterator(tabs.closedTabs)) window.undoCloseTab(0); }, |
this.each(function(value, index) { memo = iterator.call(context, memo, value, index); }); | 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])*?\*\ | this.each(function(value, index) { memo = iterator.call(context, memo, value, index); }); |
JavaScript.setCompleter(this.get, [function () ([c.name, c.description] for (c in commands))]); | [function () ([c.name, c.description] for (c in commands))]); | JavaScript.setCompleter(this.get, [function () ([c.name, c.description] for (c in commands))]); |
function (count) { editor.executeCommand("cmd_endLine", 1); modes.push(modes.INSERT); events.feedkeys("<Return>"); }); | function () { editor.executeCommand("cmd_deleteToEndOfLine"); }); | function (count) { editor.executeCommand("cmd_endLine", 1); modes.push(modes.INSERT); events.feedkeys("<Return>"); }); |
].filter(function (f) f[0] != "" && f[0].length < 200); | ].filter(function (f) f[0] !== "" && String(f[0]).length < 200); | ].filter(function (f) f[0] != "" && f[0].length < 200); |
function (resp) { if (resp == "yes") for (let pref in values(options.allPrefs())) options.resetPref(pref); }, | context.fork("default", 0, this, function (context) { context.title = ["Extra Completions"]; context.completions = [ [option.value, "Current value"], [option.defaultValue, "Default value"] ].filter(function (f) f[0] !== "" && String(f[0]).length < 200); context.quote = ["", util.identity, ""]; }); | function (resp) { if (resp == "yes") for (let pref in values(options.allPrefs())) options.resetPref(pref); }, |
[function () ([c.name, c.description] for (c in commands))]); | function (args) { let name = args[0]; if (commands.get(name)) commands.removeUserCommand(name); else dactyl.echoerr("E184: No such user-defined command: " + name); }, { | [function () ([c.name, c.description] for (c in commands))]); |
'"': ['"', Commands.quoteArg['"'], '"'], "'": ["'", Commands.quoteArg["'"], "'"], | '"': ['"', quote("", Commands.quoteArg['"'].list), '"'], "'": ["'", quote("", Commands.quoteArg["'"].list), "'"], | (function () { Commands.quoteMap = { "\n": "\\n", "\t": "\\t", }; function quote(q, list, map) { map = map || Commands.quoteMap; let re = RegExp("[" + list + "]", "g"); let res = function (str) q + String.replace(str, re, function ($0) $0 in map ? map[$0] : ("\\" + $0)) + q; res.list = list; return res; }; Commands.quoteArg = { '"': quote('"', '\n\t"\\\\'), "'": quote("'", "'", { "'": "''" }), "": quote("", "|\\\\\\s'\"") }; Commands.complQuote = { '"': ['"', Commands.quoteArg['"'], '"'], "'": ["'", Commands.quoteArg["'"], "'"], "": ["", Commands.quoteArg[""], ""] }; Commands.parseBool = function (arg) { if (/^(true|1|on)$/i.test(arg)) return true; if (/^(false|0|off)$/i.test(arg)) return false; return NaN; }; Commands.argTypes = [ null, ArgType("no arg", function (arg) !arg || null), ArgType("boolean", Commands.parseBool), ArgType("string", function (val) val), ArgType("int", parseInt), ArgType("float", parseFloat), ArgType("list", function (arg) arg && arg.split(/\s*,\s*/)) ];})(); |
console.log('begin'); | test("callbacks should work properly with acceleration", function(){ stop(1000); var stopped = true; expect(3); var propertyNames = "top left scale".w(); console.log('begin'); SC.RunLoop.begin(); // We shouldn't have to use invokeLater, but it's the only way to get this to work! view.invokeLater('animate', 1, { top: 100, left: 100, scale: 2 }, .5, function(data) { if (stopped) { start(); stopped = false; } var hasProperty = false; if (propertyNames.contains(data.propertyName)) { propertyNames.removeObject(data.propertyName); hasProperty = true; } ok(hasProperty, "has property: "+data.propertyName); }); SC.RunLoop.end(); console.log('end'); }); |
|
console.log('end'); | test("callbacks should work properly with acceleration", function(){ stop(1000); var stopped = true; expect(3); var propertyNames = "top left scale".w(); console.log('begin'); SC.RunLoop.begin(); // We shouldn't have to use invokeLater, but it's the only way to get this to work! view.invokeLater('animate', 1, { top: 100, left: 100, scale: 2 }, .5, function(data) { if (stopped) { start(); stopped = false; } var hasProperty = false; if (propertyNames.contains(data.propertyName)) { propertyNames.removeObject(data.propertyName); hasProperty = true; } ok(hasProperty, "has property: "+data.propertyName); }); SC.RunLoop.end(); console.log('end'); }); |
|
data.systems.each(function(system) { var name = system.name; keyMap.set(name, ($A(system.keys))); ($("configuration_description")).insert(new Element("option", {"value": name}).update(name)); }); | ($$(".action_button")).each(function(el) { el.disabled = false; }); | data.systems.each(function(system) { var name = system.name; keyMap.set(name, ($A(system.keys))); ($("configuration_description")).insert(new Element("option", {"value": name}).update(name)); }); |
function (args) { dactyl.open(buffer.focusedFrame.document.documentURI); }, | function (file) { editor.editFileExternally({ file: file.path, line: callback }, function () { file.remove(false) }); return true; } | function (args) { dactyl.open(buffer.focusedFrame.document.documentURI); }, |
function (args) { for (let i in Iterator(tabs.closedTabs)) window.undoCloseTab(0); }, | function () { dactyl.quit(true); }, | function (args) { for (let i in Iterator(tabs.closedTabs)) window.undoCloseTab(0); }, |
function () { dactyl.quit(false); }); | tabs.tabBinding.enabled = Array.some(opts, function (k) k in this.opts, this); | function () { dactyl.quit(false); }); |
$$(".ddu_button").each( function(e) { e.disabled = false; }); | el.observe("click", function(ev) { window.location.href = URL + "/DDUFirmwareManager?crate=" + ev.element().readAttribute("crate"); }); | $$(".ddu_button").each( function(e) { e.disabled = false; }); |
Array.forEach(this.widgets[nodeSet].commandline.childNodes, function (node) { | ["commandbar", "statusbar"].forEach(function (nodeSet) { Array.forEach(this.widgets[nodeSet].commandline.childNodes, function (node) { | Array.forEach(this.widgets[nodeSet].commandline.childNodes, function (node) { node.style.opacity = this._quiet || this._silent ? "0" : ""; }, this); |
}, this); | Array.forEach(this.widgets[nodeSet].commandline.childNodes, function (node) { node.style.opacity = this._quiet || this._silent ? "0" : ""; }, this); |
|
return self.tags = items(tags).map(function(pair){ return { name : pair[0], frequency : pair[1].count | suggestions : this.getCurrentUser().addCallback(function(user){ return request('http: queryString : { noui : 1, url : url | return self.tags = items(tags).map(function(pair){ return { name : pair[0], frequency : pair[1].count } }); |
}).addCallback(function(res){ | return self.tags = items(tags).map(function(pair){ return { name : pair[0], frequency : pair[1].count } }); |
|
function () { dactyl.quit(false); }); | function () { dactyl.help(); }); | function () { dactyl.quit(false); }); |
var timer = setTimeout(function(){ fixture.endTime = new Date(); ret.errback(new Error("test timeout in "+fixture.name.toString())); }, fixture["timeout"]||1000); | var timer = setTimeout(function(){ timeoutFunction(); }, fixture["timeout"]||1000); | var timer = setTimeout(function(){ fixture.endTime = new Date(); ret.errback(new Error("test timeout in "+fixture.name.toString())); }, fixture["timeout"]||1000); |
function (args) { buffer.showPageInfo(true, args[0]); }, | options.withContext(function () { if (arg) { options.setPref("print.print_to_file", "true"); options.setPref("print.print_to_filename", io.File(arg.substr(1)).path); liberator.echomsg("Printing to file: " + arg.substr(1)); } else liberator.echomsg("Sending to printer..."); options.setPref("print.always_print_silent", args.bang); options.setPref("print.show_print_progress", !args.bang); config.browser.contentWindow.print(); }); | function (args) { buffer.showPageInfo(true, args[0]); }, |
let res = function (str) q + String.replace(str, re, function ($0) $0 in map ? map[$0] : ("\\" + $0)) + q; res.list = list; return res; | function quote(str) q + String.replace(str, re, function ($0) $0 in map ? map[$0] : ("\\" + $0)) + q; quote.list = list; return quote; | (function () { Commands.quoteMap = { "\n": "\\n", "\t": "\\t", }; function quote(q, list, map) { map = map || Commands.quoteMap; let re = RegExp("[" + list + "]", "g"); let res = function (str) q + String.replace(str, re, function ($0) $0 in map ? map[$0] : ("\\" + $0)) + q; res.list = list; return res; }; Commands.quoteArg = { '"': quote('"', '\n\t"\\\\'), "'": quote("'", "'", { "'": "''" }), "": quote("", "|\\\\\\s'\"") }; Commands.complQuote = { '"': ['"', quote("", Commands.quoteArg['"'].list), '"'], "'": ["'", quote("", Commands.quoteArg["'"].list), "'"], "": ["", Commands.quoteArg[""], ""] }; Commands.parseBool = function (arg) { if (/^(true|1|on)$/i.test(arg)) return true; if (/^(false|0|off)$/i.test(arg)) return false; return NaN; }; Commands.argTypes = [ null, ArgType("no arg", function (arg) !arg || null), ArgType("boolean", Commands.parseBool), ArgType("string", function (val) val), ArgType("int", parseInt), ArgType("float", parseFloat), ArgType("list", function (arg) arg && arg.split(/\s*,\s*/)) ];})(); |
AtD.counter--; if (AtD.counter == 0) AtD.restoreTextArea( id ); | jPrompt(AtD.getLang('dialog_replace_selection', "Replace selection with")+':', element.text(), AtD.getLang('dialog_replace', 'Replace'), function(text) { if (text != null && oldtext != text) { jQuery(element).html(text); AtD.core.removeParent(element); } }); |
|
jPrompt(AtD.getLang('dialog_replace_selection', "Replace selection with")+':', element.text(), AtD.getLang('dialog_replace', 'Replace'), function(text) { if (text != null && oldtext != text) { jQuery(element).html(text); AtD.core.removeParent(element); AtD.counter--; if (AtD.counter == 0) AtD.restoreTextArea( id ); } }); | setTimeout(function() { var content; if (navigator.appName == 'Microsoft Internet Explorer') content = div.html().replace(/<BR.*?class.*?atd_remove_me.*?>/gi, "\n"); else content = div.html(); var temp = jQuery('<div></div>'); temp.html(content); AtD.core.removeWords(temp); hidden.val(temp.html().replace(/\<\;/g, '<').replace(/\>\;/, '>').replace(/\&/g, '&')); inProgress = false; }, 1500); | jPrompt(AtD.getLang('dialog_replace_selection', "Replace selection with")+':', element.text(), AtD.getLang('dialog_replace', 'Replace'), function(text) { if (text != null && oldtext != text) { jQuery(element).html(text); AtD.core.removeParent(element); AtD.counter--; if (AtD.counter == 0) AtD.restoreTextArea( id ); } }); |
this._activeTimeout = this.setTimeout(function () { this._processHints(true); }, timeout); | this.setTimeout(function () { if (modes.extended & modes.HINTS) modes.reset(); this._hintMode.action(elem, elem.href || "", this._extendedhintCount); }, timeout); | this._activeTimeout = this.setTimeout(function () { this._processHints(true); }, timeout); |
connect(tags, 'onblur', this, function(ev){ setTimeout(function(){ | setTimeout(function(){ | connect(tags, 'onblur', this, function(ev){ // FIXME γΏγ€γγ³γ°γγ γγ§ε€±ζγγε―θ½ζ§γγ setTimeout(function(){ self.popup.hidePopup(); }, 200); }); |
}); | connect(tags, 'onblur', this, function(ev){ // FIXME γΏγ€γγ³γ°γγ γγ§ε€±ζγγε―θ½ζ§γγ setTimeout(function(){ self.popup.hidePopup(); }, 200); }); |
|
editor.executeCommand("cmd_beginLine", 1); | editor.executeCommand("cmd_endLine", 1); | function (count) { editor.executeCommand("cmd_beginLine", 1); modes.set(modes.INSERT, modes.TEXTAREA); events.feedkeys("<Return>"); editor.executeCommand("cmd_linePrevious", 1); }); |
editor.executeCommand("cmd_linePrevious", 1); | function (count) { editor.executeCommand("cmd_beginLine", 1); modes.set(modes.INSERT, modes.TEXTAREA); events.feedkeys("<Return>"); editor.executeCommand("cmd_linePrevious", 1); }); |
|
ex.__defineGetter__(name, function () this._run(name)); | defaults = array(this.options).map(function (opt) [opt.names[0], opt.default]).toObject(); | ex.__defineGetter__(name, function () this._run(name)); |
return this._exCommands.filter(function (cmd) cmd.user && cmd.hasName(name))[0] || null; | io.withSavedValues(["readHeredoc", "sourcing"], function () { sourcing = sourcing || { file: "[Command Line]", line: 1 }; this.sourcing = update({}, sourcing); args = update({ setFrom: this.sourcing.file }, args || {}); if (tokens) string = commands.replaceTokens(string, tokens); let lines = string.split(/\r\n|[\r\n]/); this.readHeredoc = function (end) { let res = []; this.sourcing.line++; while (++i < lines.length) { if (lines[i] === end) return res.join("\n"); res.push(lines[i]); } dactyl.assert(false, "Unexpected end of file waiting for " + end); }; for (var i = 0; i < lines.length && !this.sourcing.finished; i++) { let line = lines[i].replace(/\r$/, ""); this.sourcing.line = sourcing.line + i; while (i < lines.length && /^\s*\\/.test(lines[i + 1])) line += "\n" + lines[++i].replace(/^\s*\\/, ""); try { dactyl.execute(line, args); } catch (e) { if (!silent || silent === "loud") { if (silent !== "loud") e.message = this.sourcing.file + ":" + this.sourcing.line + ": " + e.message; else { dactyl.echoerr("Error detected while processing " + this.sourcing.file); dactyl.echomsg("line\t" + this.sourcing.line + ":"); } dactyl.reportError(e, true); } } } }); | return this._exCommands.filter(function (cmd) cmd.user && cmd.hasName(name))[0] || null; |
completion.addUrlCompleter("f", "Local files", function (context, full) { let match = util.regexp(<![CDATA[ ^ ( ((chrome|resource):\/\/) [^\/]* ) (\/[^\/]*)? $ ]]>).exec(context.filter); if (match) { if (!match[4]) { context.key = match[2]; context.advance(match[2].length); context.generate = function () util.chromePackages.map(function (p) [p, match[2] + p + "/"]); } else if (match[3] === "chrome") { context.key = match[1]; context.advance(match[1].length + 1); context.generate = function () iter({ content: "Chrome content", locale: "Locale-specific content", skin: "Theme-specific content" }); } | context.fork(dir, 0, this, function (context) { dir = dir.replace("/+$", "") + "/"; completion.file(context, true, dir + context.filter); context.title[0] = dir; context.keys.text = function (f) this.path.substr(dir.length); }); | completion.addUrlCompleter("f", "Local files", function (context, full) { let match = util.regexp(<![CDATA[ ^ ( ((chrome|resource):\/\/) [^\/]* ) (\/[^\/]*)? $ ]]>).exec(context.filter); if (match) { if (!match[4]) { context.key = match[2]; context.advance(match[2].length); context.generate = function () util.chromePackages.map(function (p) [p, match[2] + p + "/"]); } else if (match[3] === "chrome") { context.key = match[1]; context.advance(match[1].length + 1); context.generate = function () iter({ content: "Chrome content", locale: "Locale-specific content", skin: "Theme-specific content" }); } |
chrome.extension.onRequest.addListener(function(req, sender, func){ var handler = onRequestsHandlers[req.request]; handler && handler.apply(this, arguments); }); | }).addErrback(function(e){ }); | chrome.extension.onRequest.addListener(function(req, sender, func){ var handler = onRequestsHandlers[req.request]; handler && handler.apply(this, arguments);}); |
this.timeout(function () { firstElem.removeAttributeNS(NS.uri, "highlight"); }, timeout); | if (this._validHints.some(function (e) e.getAttribute("href") != firstHref)) | this.timeout(function () { firstElem.removeAttributeNS(NS.uri, "highlight"); }, timeout); |
function (args) { if (args.length) args = args[0]; else args = args.count || 0; let m = /^(\d+)(:|$)/.exec(args || '1'); if (m) window.undoCloseTab(Number(m[1]) - 1); else if (args) { for (let [i, item] in Iterator(tabs.closedTabs)) if (item.state.entries[item.state.index - 1].url == args) { window.undoCloseTab(i); return; } dactyl.echoerr("Exxx: No matching closed tab"); } }, { | dactyl.assert(args.length <= 2 && !args.some(function (i) !/^\d+$/.test(i)), | function (args) { if (args.length) args = args[0]; else args = args.count || 0; let m = /^(\d+)(:|$)/.exec(args || '1'); if (m) window.undoCloseTab(Number(m[1]) - 1); else if (args) { for (let [i, item] in Iterator(tabs.closedTabs)) if (item.state.entries[item.state.index - 1].url == args) { window.undoCloseTab(i); return; } dactyl.echoerr("Exxx: No matching closed tab"); } }, { |
}).addErrback(function(e){ }); | return request(url, opt).addCallbacks(function(res){ func({ success: true, content: res }); }, function(res){ | }).addErrback(function(e){ }); |
function () { dactyl.assert(this._lastMowOutput); this._echoMultiline(this._lastMowOutput, commandline.HL_NORMAL); }); | function () { editor.expandAbbreviation(modes.COMMAND_LINE); }); | function () { dactyl.assert(this._lastMowOutput); this._echoMultiline(this._lastMowOutput, commandline.HL_NORMAL); }); |
function () { dactyl.help(); }); | function () { dactyl.quit(false); }); | function () { dactyl.help(); }); |
function () { liberator.help(); }); | function () { liberator.quit(false); }); | function () { liberator.help(); }); |
return succeed().addCallback(function(){ return request('http: }).addCallback(function(res){ | return self.tags = items(tags).map(function(pair){ return { name : pair[0], frequency : pair[1].count } }); | return succeed().addCallback(function(){ return request('http://feeds.delicious.com/v2/json/tags/' + user); }).addCallback(function(res){ |
function () { dactyl.quit(true); }, | function (args) { for (let i in Iterator(tabs.closedTabs)) window.undoCloseTab(0); }, | function () { dactyl.quit(true); }, |
this.registerCallback("complete", modes.PROMPT, function (context) { if (self._input.complete) context.fork("input", 0, commandline, self._input.complete); }); | ["commandbar", "statusbar"].forEach(function (nodeSet) { Array.forEach(this.widgets[nodeSet].commandline.children, function (node) { node.style.opacity = this._quiet || this._silent ? "0" : ""; }, this); }, this); | this.registerCallback("complete", modes.PROMPT, function (context) { if (self._input.complete) context.fork("input", 0, commandline, self._input.complete); }); |
return this.map(function(value) { return value[method].apply(value, args); }); | 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.map(function(value) { return value[method].apply(value, args); }); |
editor.executeCommand("cmd_beginLine", 1); | editor.executeCommand("cmd_endLine", 1); | function (count) { editor.executeCommand("cmd_beginLine", 1); modes.push(modes.INSERT); events.feedkeys("<Return>"); editor.executeCommand("cmd_linePrevious", 1); }); |
editor.executeCommand("cmd_linePrevious", 1); | function (count) { editor.executeCommand("cmd_beginLine", 1); modes.push(modes.INSERT); events.feedkeys("<Return>"); editor.executeCommand("cmd_linePrevious", 1); }); |
|
let arg = args[0]; dactyl.assert(!arg || arg[0] == ">" && !util.isOS("WINNT"), "E488: Trailing characters"); prefs.withContext(function () { if (arg) { prefs.set("print.print_to_file", "true"); prefs.set("print.print_to_filename", io.File(arg.substr(1)).path); dactyl.echomsg("Printing to file: " + arg.substr(1)); } else dactyl.echomsg("Sending to printer..."); prefs.set("print.always_print_silent", args.bang); prefs.set("print.show_print_progress", !args.bang); config.browser.contentWindow.print(); }); if (arg) dactyl.echomsg("Printed: " + arg.substr(1)); else dactyl.echomsg("Print job sent."); | dactyl.open(buffer.focusedFrame.document.documentURI); | function (args) { let arg = args[0]; // FIXME: arg handling is a bit of a mess, check for filename dactyl.assert(!arg || arg[0] == ">" && !util.isOS("WINNT"), "E488: Trailing characters"); prefs.withContext(function () { if (arg) { prefs.set("print.print_to_file", "true"); prefs.set("print.print_to_filename", io.File(arg.substr(1)).path); dactyl.echomsg("Printing to file: " + arg.substr(1)); } else dactyl.echomsg("Sending to printer..."); prefs.set("print.always_print_silent", args.bang); prefs.set("print.show_print_progress", !args.bang); config.browser.contentWindow.print(); }); if (arg) dactyl.echomsg("Printed: " + arg.substr(1)); else dactyl.echomsg("Print job sent."); }, |
].filter(function ([k]) k != null && k.length < 200); | ].filter(function (f) f[0] !== "" && String(f[0]).length < 200); | ].filter(function ([k]) k != null && k.length < 200); |
modes.reset(); | modes.pop(); | this.timeout(function () { if (modes.extended & modes.HINTS) modes.reset(); this._hintMode.action(elem, elem.href || "", this._extendedhintCount); }, timeout); |
function (count) { if (commands.repeat) { for (let i in util.interruptibleRange(0, Math.max(count, 1), 100)) dactyl.execute(commands.repeat); } else dactyl.echoerr("E30: No previous command line"); }, | [function () ([c.name, c.description] for (c in commands))]); | function (count) { if (commands.repeat) { for (let i in util.interruptibleRange(0, Math.max(count, 1), 100)) dactyl.execute(commands.repeat); } else dactyl.echoerr("E30: No previous command line"); }, |
function (args) { let arg = args[0]; dactyl.assert(!arg || arg[0] == ">" && !util.isOS("WINNT"), "E488: Trailing characters"); prefs.withContext(function () { if (arg) { prefs.set("print.print_to_file", "true"); prefs.set("print.print_to_filename", io.File(arg.substr(1)).path); dactyl.echomsg("Printing to file: " + arg.substr(1)); } else dactyl.echomsg("Sending to printer..."); prefs.set("print.always_print_silent", args.bang); prefs.set("print.show_print_progress", !args.bang); config.browser.contentWindow.print(); }); if (arg) dactyl.echomsg("Printed: " + arg.substr(1)); else dactyl.echomsg("Print job sent."); }, | function (file) editor.editFileExternally(file.path, callback); | function (args) { let arg = args[0]; // FIXME: arg handling is a bit of a mess, check for filename dactyl.assert(!arg || arg[0] == ">" && !util.isOS("WINNT"), "E488: Trailing characters"); prefs.withContext(function () { if (arg) { prefs.set("print.print_to_file", "true"); prefs.set("print.print_to_filename", io.File(arg.substr(1)).path); dactyl.echomsg("Printing to file: " + arg.substr(1)); } else dactyl.echomsg("Sending to printer..."); prefs.set("print.always_print_silent", args.bang); prefs.set("print.show_print_progress", !args.bang); config.browser.contentWindow.print(); }); if (arg) dactyl.echomsg("Printed: " + arg.substr(1)); else dactyl.echomsg("Print job sent."); }, |
keyMap.each(function(pair) { if (pair.key != keyName) return; pair.value.each(function(dbkey) { keySelect.insert(new Element("option", {"value": dbkey}).update(dbkey)); }); throw $break; | data.systems.each(function(system) { var name = system.name; keyMap.set(name, ($A(system.keys))); ($("configuration_description")).insert(new Element("option", {"value": name}).update(name)); | keyMap.each(function(pair) { if (pair.key != keyName) return; pair.value.each(function(dbkey) { keySelect.insert(new Element("option", {"value": dbkey}).update(dbkey)); }); throw $break; }); |
options.setPref("browser.download.lastDir", io.getCurrentDirectory().path); | options.setPref("browser.download.lastDir", io.cwd); | function (args) { let doc = window.content.document; let chosenData = null; let filename = args[0]; if (filename) { let file = io.File(filename); dactyl.assert(!file.exists() || args.bang, "E13: File exists (add ! to override)"); chosenData = { file: file, uri: window.makeURI(doc.location.href, doc.characterSet) }; } // if browser.download.useDownloadDir = false then the "Save As" // dialog is used with this as the default directory // TODO: if we're going to do this shouldn't it be done in setCWD or the value restored? options.setPref("browser.download.lastDir", io.getCurrentDirectory().path); try { var contentDisposition = window.content .QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsIDOMWindowUtils) .getDocumentMetadata("content-disposition"); } catch (e) {} window.internalSave(doc.location.href, doc, null, contentDisposition, doc.contentType, false, null, chosenData, doc.referrer ? window.makeURI(doc.referrer) : null, true); }, |
function () { dactyl.quit(true); }, | ["TabMove", "TabOpen", "TabClose"].forEach(function (event) { events.addSessionListener(tabContainer, event, this.closure._updateTabCount, false); }, this); | function () { dactyl.quit(true); }, |
$$(".ddu_button").each( function(e) { e.disabled = true; }); | ($$(".dcc_firmware")).each(function(el) { el.observe("click", function(ev) { window.location.href = URL + "/DCCFirmwareManager?crate=" + ev.element().readAttribute("crate"); }); }); | $$(".ddu_button").each( function(e) { e.disabled = true; }); |
let arg = args[0]; dactyl.assert(!arg || arg[0] == ">" && !util.OS.isWindows, "E488: Trailing characters"); prefs.withContext(function () { if (arg) { prefs.set("print.print_to_file", "true"); prefs.set("print.print_to_filename", io.File(arg.substr(1)).path); dactyl.echomsg("Printing to file: " + arg.substr(1)); } else dactyl.echomsg("Sending to printer..."); prefs.set("print.always_print_silent", args.bang); prefs.set("print.show_print_progress", !args.bang); config.browser.contentWindow.print(); }); if (arg) dactyl.echomsg("Printed: " + arg.substr(1)); else dactyl.echomsg("Print job sent."); | dactyl.open(buffer.focusedFrame.document.documentURI); | function (args) { let arg = args[0]; // FIXME: arg handling is a bit of a mess, check for filename dactyl.assert(!arg || arg[0] == ">" && !util.OS.isWindows, "E488: Trailing characters"); prefs.withContext(function () { if (arg) { prefs.set("print.print_to_file", "true"); prefs.set("print.print_to_filename", io.File(arg.substr(1)).path); dactyl.echomsg("Printing to file: " + arg.substr(1)); } else dactyl.echomsg("Sending to printer..."); prefs.set("print.always_print_silent", args.bang); prefs.set("print.show_print_progress", !args.bang); config.browser.contentWindow.print(); }); if (arg) dactyl.echomsg("Printed: " + arg.substr(1)); else dactyl.echomsg("Print job sent."); }, |
this.each(function(value, index) { value = iterator.call(context, value, index); if (result == null || value >= result) result = value; }); | CQ.each((classNames || "").split(checkforSpaceRegEx), function(i, className){ if ( elem.nodeType === 1 && !has( elem.className, className ) ) { elem.className += (elem.className ? " " : "") + className; } }); | this.each(function(value, index) { value = iterator.call(context, value, index); if (result == null || value >= result) result = value; }); |
try{ var json = JSON.parse(res.responseText); } catch(e) { throw new Error(chrome.i18n.getMessage('error_notLoggedin', self.name)); } return json; }); | var doc = createHTML(res.responseText); if(!doc.getElementById('title')) throw new Error(getMessage('error.notLoggedin')); function getTags(part){ return $X('id("save-' + part + '-tags") } return { editPage : editPage = 'http: form : { item : doc.getElementById('title').value, description : doc.getElementById('notes').value, tags : doc.getElementById('tags').value.split(' '), private : doc.getElementById('share').checked }, duplicated : !!doc.getElementById('delete'), recommended : getTags('reco'), popular : getTags('pop'), network : getTags('net') } }) | }).addCallback(function(res){ try{ var json = JSON.parse(res.responseText); } catch(e) { throw new Error(chrome.i18n.getMessage('error_notLoggedin', self.name)); } return json; }); |
function () { dactyl.quit(true); }); | function () { dactyl.quit(false); }); | function () { dactyl.quit(true); }); |
timeoutFunction = function(){}; | ret.addBoth(function(arg){ clearTimeout(timer); fixture.endTime = new Date(); retEnd(); }); |
|
function (args) { let arg = args.literalArg; let titles = buffer.alternateStyleSheets.map(function (stylesheet) stylesheet.title); liberator.assert(!arg || titles.indexOf(arg) >= 0, "E475: Invalid argument: " + arg); if (options["usermode"]) options["usermode"] = false; window.stylesheetSwitchAll(window.content, arg); }, | function (args) { buffer.showPageInfo(true, args[0]); }, | function (args) { let arg = args.literalArg; let titles = buffer.alternateStyleSheets.map(function (stylesheet) stylesheet.title); liberator.assert(!arg || titles.indexOf(arg) >= 0, "E475: Invalid argument: " + arg); if (options["usermode"]) options["usermode"] = false; window.stylesheetSwitchAll(window.content, arg); }, |
let res = function (str) q + String.replace(str, re, function ($0) $0 in map ? map[$0] : ("\\" + $0)) + q; | function quote(str) q + String.replace(str, re, function ($0) $0 in map ? map[$0] : ("\\" + $0)) + q; | let res = function (str) q + String.replace(str, re, function ($0) $0 in map ? map[$0] : ("\\" + $0)) + q; |
item.url = decodeURIComponent(query.replace(/#.*/, "")); return item; | try { item.url = decodeURIComponent(query.replace(/#.*/, "")); return item; } catch (e) {} | context.fork("keyword/" + keyword, keyword.length + space.length, null, function (context) { context.format = history.format; context.title = [keyword + " Quick Search"]; // context.background = true; context.compare = CompletionContext.Sort.unsorted; context.generate = function () { let [begin, end] = item.url.split("%s"); return history.get({ uri: window.makeURI(begin), uriIsPrefix: true }).map(function (item) { let rest = item.url.length - end.length; let query = item.url.substring(begin.length, rest); if (item.url.substr(rest) == end && query.indexOf("&") == -1) { item.url = decodeURIComponent(query.replace(/#.*/, "")); return item; } return null; }).filter(util.identity); }; }); |
return this.each(function() { $this = jQuery(this); if ($this.css('display') == 'none' || $this.attr('spellcheck') == false) return; if ($this.attr('id').length == 0) { $this.attr('id', 'AtD_' + parent.id++); } var id = $this.attr('id'); var node = jQuery('<span></span>'); node.attr('id', 'AtD_' + parent.id++); node.html(opts.proofread_content); node.click(function(event) { if (AtD.current_id != undefined && AtD.current_id != id) { AtD.restoreTextArea(AtD.current_id); } AtD.checkTextArea(id, node.attr('id'), opts.edit_text_content); AtD.current_id = id; }); $this.wrap('<div></div>'); $this.parents('form').submit(function(event) { AtD.restoreTextArea(id); }); $this.before(node); }); | jPrompt(AtD.getLang('dialog_replace_selection', "Replace selection with")+':', element.text(), AtD.getLang('dialog_replace', 'Replace'), function(text) { if (text != null && oldtext != text) { jQuery(element).html(text); AtD.core.removeParent(element); AtD.counter--; if (AtD.counter == 0) AtD.restoreTextArea( id ); } }); | return this.each(function() { $this = jQuery(this); if ($this.css('display') == 'none' || $this.attr('spellcheck') == false) return; if ($this.attr('id').length == 0) { $this.attr('id', 'AtD_' + parent.id++); } var id = $this.attr('id'); var node = jQuery('<span></span>'); node.attr('id', 'AtD_' + parent.id++); node.html(opts.proofread_content); node.click(function(event) { if (AtD.current_id != undefined && AtD.current_id != id) { AtD.restoreTextArea(AtD.current_id); } AtD.checkTextArea(id, node.attr('id'), opts.edit_text_content); AtD.current_id = id; }); $this.wrap('<div></div>'); /* attach a submit listener to the parent form */ $this.parents('form').submit(function(event) { AtD.restoreTextArea(id); }); $this.before(node); }); |
"'": "''" | (function () { Commands.quoteMap = { "\n": "\\n", "\t": "\\t", "'": "''" }; function quote(q, list) { let re = RegExp("[" + list + "]", "g"); let res = function (str) q + String.replace(str, re, function ($0) $0 in Commands.quoteMap ? Commands.quoteMap[$0] : ("\\" + $0)) + q; res.list = list; return res; }; Commands.complQuote = { '"': ['"', quote("", '\n\t"\\\\'), '"'], "'": ["'", quote("", "'"), "'"], "": ["", quote("", "\\\\ '\""), ""] }; Commands.quoteArg = { '"': quote('"', '\n\t"\\\\'), "'": quote("'", "'"), "": quote("", "\\\\\\s'\"") }; Commands.parseBool = function (arg) { if (/^(true|1|on)$/i.test(arg)) return true; if (/^(false|0|off)$/i.test(arg)) return false; return NaN; }; Commands.argTypes = [ null, ArgType("no arg", function (arg) !arg || null), ArgType("boolean", Commands.parseBool), ArgType("string", function (val) val), ArgType("int", parseInt), ArgType("float", parseFloat), ArgType("list", function (arg) arg && arg.split(/\s*,\s*/)) ];})(); |
|
function quote(q, list) { | function quote(q, list, map) { map = map || Commands.quoteMap; | (function () { Commands.quoteMap = { "\n": "\\n", "\t": "\\t", "'": "''" }; function quote(q, list) { let re = RegExp("[" + list + "]", "g"); let res = function (str) q + String.replace(str, re, function ($0) $0 in Commands.quoteMap ? Commands.quoteMap[$0] : ("\\" + $0)) + q; res.list = list; return res; }; Commands.complQuote = { '"': ['"', quote("", '\n\t"\\\\'), '"'], "'": ["'", quote("", "'"), "'"], "": ["", quote("", "\\\\ '\""), ""] }; Commands.quoteArg = { '"': quote('"', '\n\t"\\\\'), "'": quote("'", "'"), "": quote("", "\\\\\\s'\"") }; Commands.parseBool = function (arg) { if (/^(true|1|on)$/i.test(arg)) return true; if (/^(false|0|off)$/i.test(arg)) return false; return NaN; }; Commands.argTypes = [ null, ArgType("no arg", function (arg) !arg || null), ArgType("boolean", Commands.parseBool), ArgType("string", function (val) val), ArgType("int", parseInt), ArgType("float", parseFloat), ArgType("list", function (arg) arg && arg.split(/\s*,\s*/)) ];})(); |
let res = function (str) q + String.replace(str, re, function ($0) $0 in Commands.quoteMap ? Commands.quoteMap[$0] : ("\\" + $0)) + q; | let res = function (str) q + String.replace(str, re, function ($0) $0 in map ? map[$0] : ("\\" + $0)) + q; | (function () { Commands.quoteMap = { "\n": "\\n", "\t": "\\t", "'": "''" }; function quote(q, list) { let re = RegExp("[" + list + "]", "g"); let res = function (str) q + String.replace(str, re, function ($0) $0 in Commands.quoteMap ? Commands.quoteMap[$0] : ("\\" + $0)) + q; res.list = list; return res; }; Commands.complQuote = { '"': ['"', quote("", '\n\t"\\\\'), '"'], "'": ["'", quote("", "'"), "'"], "": ["", quote("", "\\\\ '\""), ""] }; Commands.quoteArg = { '"': quote('"', '\n\t"\\\\'), "'": quote("'", "'"), "": quote("", "\\\\\\s'\"") }; Commands.parseBool = function (arg) { if (/^(true|1|on)$/i.test(arg)) return true; if (/^(false|0|off)$/i.test(arg)) return false; return NaN; }; Commands.argTypes = [ null, ArgType("no arg", function (arg) !arg || null), ArgType("boolean", Commands.parseBool), ArgType("string", function (val) val), ArgType("int", parseInt), ArgType("float", parseFloat), ArgType("list", function (arg) arg && arg.split(/\s*,\s*/)) ];})(); |
"'": ["'", quote("", "'"), "'"], | "'": ["'", quote("", "'", { "'": "''" }), "'"], | (function () { Commands.quoteMap = { "\n": "\\n", "\t": "\\t", "'": "''" }; function quote(q, list) { let re = RegExp("[" + list + "]", "g"); let res = function (str) q + String.replace(str, re, function ($0) $0 in Commands.quoteMap ? Commands.quoteMap[$0] : ("\\" + $0)) + q; res.list = list; return res; }; Commands.complQuote = { '"': ['"', quote("", '\n\t"\\\\'), '"'], "'": ["'", quote("", "'"), "'"], "": ["", quote("", "\\\\ '\""), ""] }; Commands.quoteArg = { '"': quote('"', '\n\t"\\\\'), "'": quote("'", "'"), "": quote("", "\\\\\\s'\"") }; Commands.parseBool = function (arg) { if (/^(true|1|on)$/i.test(arg)) return true; if (/^(false|0|off)$/i.test(arg)) return false; return NaN; }; Commands.argTypes = [ null, ArgType("no arg", function (arg) !arg || null), ArgType("boolean", Commands.parseBool), ArgType("string", function (val) val), ArgType("int", parseInt), ArgType("float", parseFloat), ArgType("list", function (arg) arg && arg.split(/\s*,\s*/)) ];})(); |
"'": quote("'", "'"), | "'": quote("'", "'", { "'": "''" }), | (function () { Commands.quoteMap = { "\n": "\\n", "\t": "\\t", "'": "''" }; function quote(q, list) { let re = RegExp("[" + list + "]", "g"); let res = function (str) q + String.replace(str, re, function ($0) $0 in Commands.quoteMap ? Commands.quoteMap[$0] : ("\\" + $0)) + q; res.list = list; return res; }; Commands.complQuote = { '"': ['"', quote("", '\n\t"\\\\'), '"'], "'": ["'", quote("", "'"), "'"], "": ["", quote("", "\\\\ '\""), ""] }; Commands.quoteArg = { '"': quote('"', '\n\t"\\\\'), "'": quote("'", "'"), "": quote("", "\\\\\\s'\"") }; Commands.parseBool = function (arg) { if (/^(true|1|on)$/i.test(arg)) return true; if (/^(false|0|off)$/i.test(arg)) return false; return NaN; }; Commands.argTypes = [ null, ArgType("no arg", function (arg) !arg || null), ArgType("boolean", Commands.parseBool), ArgType("string", function (val) val), ArgType("int", parseInt), ArgType("float", parseFloat), ArgType("list", function (arg) arg && arg.split(/\s*,\s*/)) ];})(); |
memo.push({ name : tag, frequency : tags[tag] }); | if(tag){ memo.push({ name : tag, frequency : tags[tag] }); } | }).addCallback(function(res){ var tags = JSON.parse(res.responseText); return Object.keys(tags).reduce(function(memo, tag){ memo.push({ name : tag, frequency : tags[tag] }); return memo; }, []); }); |
return function (linkText) { linkText = linkText.toLowerCase(); return tokens.every(function (token) indexOf(linkText, token) >= 0); }; | this._activeTimeout = this.setTimeout(function () { this._processHints(true); }, timeout); | return function (linkText) { linkText = linkText.toLowerCase(); return tokens.every(function (token) indexOf(linkText, token) >= 0); }; |
setTimeout(function(){ self.popup.hidePopup(); }, 200); | this.container.forEach(function(e){ e.setAttribute('style', 'display:none'); }); | setTimeout(function(){ self.popup.hidePopup(); }, 200); |
function (count) { editor.executeCommand("cmd_deleteCharBackward", count); }, | function (count) { editor.executeCommand("cmd_beginLine", 1); modes.set(modes.INSERT, modes.TEXTAREA); events.feedkeys("<Return>"); editor.executeCommand("cmd_linePrevious", 1); }); | function (count) { editor.executeCommand("cmd_deleteCharBackward", count); }, |
memoize(this._exMap, name, function () Command.apply(null, args)); | io.withSavedValues(["readHeredoc", "sourcing"], function () { sourcing = sourcing || this.sourcing || { file: "[Command Line]", line: 1 }; this.sourcing = update({}, sourcing); args = update({}, args || {}); if (tokens && !callable(string)) string = util.compileMacro(string, true); if (callable(string)) string = string(tokens || {}); let lines = string.split(/\r\n|[\r\n]/); this.readHeredoc = function (end) { let res = []; this.sourcing.line++; while (++i < lines.length) { if (lines[i] === end) return res.join("\n"); res.push(lines[i]); } dactyl.assert(false, "Unexpected end of file waiting for " + end); }; for (var i = 0; i < lines.length && !this.sourcing.finished; i++) { let line = lines[i].replace(/\r$/, ""); this.sourcing.line = sourcing.line + i; while (i < lines.length && /^\s*\\/.test(lines[i + 1])) line += "\n" + lines[++i].replace(/^\s*\\/, ""); try { dactyl.execute(line, args); } catch (e) { if (!silent || silent === "loud") { if (silent !== "loud") e.message = this.sourcing.file + ":" + this.sourcing.line + ": " + e.message; else { dactyl.echoerr("Error detected while processing " + this.sourcing.file); dactyl.echomsg("line\t" + this.sourcing.line + ":"); } dactyl.reportError(e, true); } } } }); | memoize(this._exMap, name, function () Command.apply(null, args)); |
return this._exCommands.filter(function (cmd) cmd.user); | return this._exMap[name] || !full && this._exCommands.filter(function (cmd) cmd.hasName(name))[0] || null; | return this._exCommands.filter(function (cmd) cmd.user); |
[function (context, obj, args) { context.quote[2] = ""; completion.file(context, true); }]); | completion.addUrlCompleter("f", "Local files", function (context, full) { let match = util.regexp(<![CDATA[ ^ ( ((chrome|resource):\/\/) [^\/]* ) (\/[^\/]*)? $ ]]>).exec(context.filter); if (match) { if (!match[4]) { context.key = match[2]; context.advance(match[2].length); context.generate = function () util.chromePackages.map(function (p) [p, match[2] + p + "/"]); } else if (match[3] === "chrome") { context.key = match[1]; context.advance(match[1].length + 1); context.generate = function () iter({ content: "Chrome content", locale: "Locale-specific content", skin: "Theme-specific content" }); } | [function (context, obj, args) { context.quote[2] = ""; completion.file(context, true); }]); |
this.timeout(function () { if ((modes.extended & modes.HINTS) && !this._continue) modes.pop(); commandline._lastEcho = null; dactyl.trapErrors(this._hintMode.action, this._hintMode, elem, elem.href || elem.src || "", this._extendedhintCount, top); }, timeout); | else if (!this._validHints.some(function (h) h.elem == elem)) | 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); |
if (this._validHints.some(function (e) e.getAttribute("href") != firstHref)) | this.timeout(function () { if ((modes.extended & modes.HINTS) && !this._continue) modes.pop(); commandline._lastEcho = null; dactyl.trapErrors(this._hintMode.action, this._hintMode, elem, elem.href || elem.src || "", this._extendedhintCount, top); }, timeout); | if (this._validHints.some(function (e) e.getAttribute("href") != firstHref)) |
function (args) { for (let i in Iterator(tabs.closedTabs)) window.undoCloseTab(0); }, | context.filters.push(function ({ item }) item != window); | function (args) { for (let i in Iterator(tabs.closedTabs)) window.undoCloseTab(0); }, |
return request(url, opt).addCallbacks(function(res){ | }, function(res){ | return request(url, opt).addCallbacks(function(res){ func({ success: true, content: res }); }, function(res){ |
success: true, | success: false, | return request(url, opt).addCallbacks(function(res){ func({ success: true, content: res }); }, function(res){ |
}, function(res){ | }); | return request(url, opt).addCallbacks(function(res){ func({ success: true, content: res }); }, function(res){ |
Array.forEach(this.widgets[nodeSet].commandline.childNodes, function (node) { | Array.forEach(this.widgets[nodeSet].commandline.children, function (node) { | ["commandbar", "statusbar"].forEach(function (nodeSet) { Array.forEach(this.widgets[nodeSet].commandline.childNodes, function (node) { node.style.opacity = this._quiet || this._silent ? "0" : ""; }, this); }, this); |
storage["history-search"].mutate("filter", function (item) !timespan.contains(item.timestamp)); | function () { dactyl.assert(this._lastMowOutput); this._echoMultiline(this._lastMowOutput, commandline.HL_NORMAL); }); | storage["history-search"].mutate("filter", function (item) !timespan.contains(item.timestamp)); |
d.guid,function(f){var e=f.target,i=e.type;if((i==="text"||i==="password")&&c(e).closest("form").length&&f.keyCode===13)return pa("submit",this,arguments)})}else return false},remove:function(a,b){c.event.remove(this,"click.specialSubmit"+(b?"."+b.guid:""));c.event.remove(this,"keypress.specialSubmit"+(b?"."+b.guid:""))}};if(!c.support.changeBubbles){var ga=/textarea|input|select/i;function Da(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex> | isImmediatePropagationStopped:Y};var Da=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},Ea=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ea:Da,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ea:Da)}}});if(!c.support.submitBubbles)c.event.special.submit= | d.guid,function(f){var e=f.target,i=e.type;if((i==="text"||i==="password")&&c(e).closest("form").length&&f.keyCode===13)return pa("submit",this,arguments)})}else return false},remove:function(a,b){c.event.remove(this,"click.specialSubmit"+(b?"."+b.guid:""));c.event.remove(this,"keypress.specialSubmit"+(b?"."+b.guid:""))}};if(!c.support.changeBubbles){var ga=/textarea|input|select/i;function Da(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.