rem
stringlengths 0
126k
| add
stringlengths 0
441k
| context
stringlengths 15
136k
|
---|---|---|
$.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; } } } }); | $.each(data[q.ikey.join(" ")] || [], function (i, e) { var r = me._checkEntry(e, q, ctx); if (r) { if (!p[r.end]) p[r.end] = [r]; else p[r.end].push(r); } }); | $.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; } } } }); |
homepages = homepages.replace(/\|/g, options["urlseperator"] || ", "); | function () { let homepages = gHomeButton.getHomePage(); liberator.open(homepages, { from: "homepage", where: liberator.NEW_TAB }); }); |
|
[["-keyword", "-k"], commands.OPTION_STRING, function (arg) /\w/.test(arg)]] | return this._exCommands.filter(function (cmd) cmd.user && cmd.hasName(name))[0] || null; | [["-keyword", "-k"], commands.OPTION_STRING, function (arg) /\w/.test(arg)]] |
result: prefix + item.result, | let items = this.contextList.map(function (context) { if (!context.hasItems) return []; let prefix = self.value.substring(minStart, context.offset); return context.items.map(function (item) ({ text: prefix + item.text, __proto__: item })); }); |
|
dactyl.trapErrors(function () { if (self._completions) self._completions.tab(event.shiftKey, event.altKey && options["altwildmode"]); }); | ["copy", "copylink", "selectall"].forEach(function (tail) { let xpath = " document.getElementById("dactyl-context-" + tail).style.listStyleImage = util.computedStyle(util.evaluateXPath(xpath, document).snapshotItem(0)).listStyleImage; }); | dactyl.trapErrors(function () { if (self._completions) self._completions.tab(event.shiftKey, event.altKey && options["altwildmode"]); }); |
(function (frame) { if (frame.document.body instanceof HTMLBodyElement) frames.push(frame); Array.forEach(frame.frames, arguments.callee); })(window.content); | ["mousedown", "mouseup", "click"].forEach(function (event) { elem.dispatchEvent(events.create(doc, event, { screenX: offsetX, screenY: offsetY, ctrlKey: ctrlKey, shiftKey: shiftKey, metaKey: ctrlKey })); }); | (function (frame) { if (frame.document.body instanceof HTMLBodyElement) frames.push(frame); Array.forEach(frame.frames, arguments.callee); })(window.content); |
function (args) { tabs.reloadAll(args.bang); }, { | function () { tabs.stopAll(); }, | function (args) { tabs.reloadAll(args.bang); }, { |
$.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; } }); | $.each(fuzzyMap[c[i]], function (i_, t) { if (k[0] == t) { found = true; return false; } }); | $.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; } }); |
$("a.delete").live("click", function () { c = confirm('Are you sure you want to delete this item? This action cannot be undone.'); if (c) { trgt = this; action = $(this).attr("rel"); $.post(action, $.param({'delete': true}), function (data) { if (data['deleted']) { selector = '[rel="' + action + '"]'; containingList = $(selector).parent().parent().parent(); $(selector).parent().parent().remove(); if (!$(containingList).children().length) { $(containingList).append('<li class="empty">No ' + $(containingList).closest("div").find("h3").text().toLowerCase() + ' defined.</li>'); | $.post(action, params, function (data) { errors = data['errors']; if (errors) { $(trgt).parent().find(":input").each(function () { if (errors[$(this).attr("name")]) { $(this).addClass("error"); if (!$(this).next().hasClass("msg")) { $(this).after('<span class="msg">' + errors[$(this).attr("name")][0] + '</span>'); } } else { $(this).removeClass("error"); $(this).parent().find('span.msg').remove(); | $("a.delete").live("click", function () { c = confirm('Are you sure you want to delete this item? This action cannot be undone.'); if (c) { trgt = this; action = $(this).attr("rel"); $.post(action, $.param({'delete': true}), function (data) { if (data['deleted']) { selector = '[rel="' + action + '"]'; containingList = $(selector).parent().parent().parent(); $(selector).parent().parent().remove(); if (!$(containingList).children().length) { $(containingList).append('<li class="empty">No ' + $(containingList).closest("div").find("h3").text().toLowerCase() + ' defined.</li>'); } } else { $(selector).insertAfter('<span class="fail">An error occurred.</span>'); $("span.fail").delay(1500).fadeOut("fast", function () { $(this).remove(); }); } }, "json"); } return false; }); |
} else { $(selector).insertAfter('<span class="fail">An error occurred.</span>'); $("span.fail").delay(1500).fadeOut("fast", function () { $(this).remove(); }); } }, "json"); } return false; }); | }); } else { $(trgt).parent().replaceWith(data['new_row']); $(selector).prev().find("li.empty").remove(); } }, "json"); | $("a.delete").live("click", function () { c = confirm('Are you sure you want to delete this item? This action cannot be undone.'); if (c) { trgt = this; action = $(this).attr("rel"); $.post(action, $.param({'delete': true}), function (data) { if (data['deleted']) { selector = '[rel="' + action + '"]'; containingList = $(selector).parent().parent().parent(); $(selector).parent().parent().remove(); if (!$(containingList).children().length) { $(containingList).append('<li class="empty">No ' + $(containingList).closest("div").find("h3").text().toLowerCase() + ' defined.</li>'); } } else { $(selector).insertAfter('<span class="fail">An error occurred.</span>'); $("span.fail").delay(1500).fadeOut("fast", function () { $(this).remove(); }); } }, "json"); } return false; }); |
chrome.extension.onRequest.addListener(function(req, sender, func){ var handler = onRequestsHandlers[req.request]; handler && handler.apply(this, arguments); }); | 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){ TBRL.Service.alertPreference(ps.type); } else { TBRL.Service.post(ps, posters); } } func({}); }).addErrback(function(e){ | chrome.extension.onRequest.addListener(function(req, sender, func){ var handler = onRequestsHandlers[req.request]; handler && handler.apply(this, arguments);}); |
function (m) /^\\(\\\\)*!$/.test(m) ? m.replace("\\!", "!") : m.replace("!", io._lastRunCommand) | function (args) { let arg = args[0] || ""; if (args.bang) arg = "!" + arg; if (options["banghist"]) { dactyl.assert(!/((^|[^\\])(\\\\)*)!/.test(arg) || io._lastRunCommand, "E34: No previous command"); arg = arg.replace(/(\\)*!/g, function (m) /^\\(\\\\)*!$/.test(m) ? m.replace("\\!", "!") : m.replace("!", io._lastRunCommand) | function (m) /^\\(\\\\)*!$/.test(m) ? m.replace("\\!", "!") : m.replace("!", io._lastRunCommand) ); |
} io._lastRunCommand = arg; let output = io.system(arg); commandline.command = "!" + arg; commandline.commandOutput(<span highlight="CmdOutput">{output}</span>); autocommands.trigger("ShellCmdPost", {}); }, { | function (m) /^\\(\\\\)*!$/.test(m) ? m.replace("\\!", "!") : m.replace("!", io._lastRunCommand) ); |
|
Object.keys(val).forEach(function(k){ setter(k, val, target[key]); }); | }).addErrback(function(err){ self.alertError(err, ps.pageUrl); }); | Object.keys(val).forEach(function(k){ setter(k, val, target[key]); }); |
self.element.live('click',function(){ self.element.trigger('dcmgrGUI.refresh'); }) | self.checked_list[check_id].c_detail.element.bind('dcmgrGUI.contentChange',function(event,params){ if(self.checked_list[check_id]){ var data = { item:params.data } if(!params.data){ data.item = self.checked_list[check_id].c_detail.getEmptyData(); } if(data.item){ $( self.checked_list[check_id].c_detail.template ) .tmpl(data) .appendTo( $('#detail') ); } } }); | self.element.live('click',function(){ self.element.trigger('dcmgrGUI.refresh'); }) |
this.addMode("F", "Open multiple hints in tabs", function (elem) { buffer.followLink(elem, dactyl.NEW_BACKGROUND_TAB); hints.show("F"); }); | this.addMode("F", "Open multiple hints in tabs", function (elem, l, c, top) { buffer.followLink(elem, dactyl.NEW_BACKGROUND_TAB); hints.show("F", null, top); }); | this.addMode("F", "Open multiple hints in tabs", function (elem) { buffer.followLink(elem, dactyl.NEW_BACKGROUND_TAB); hints.show("F"); }); |
$.alerts._show(title, message, value, 'prompt', function(result) { | $.alerts._show(title, message, null, 'confirm', function(result) { | $.alerts._show(title, message, value, 'prompt', function(result) { if( callback ) callback(result); }); |
var bindingType = Report.bindingTypes.results.bindings.filter(function(el) { return el.type.value == bindings[i].type.value; } )[0]; | var bindDataTypes = this.dataTypes.filter(function(dataType) { return dataType.bindingType.value == bindingType.type.value; } ); | var bindingType = Report.bindingTypes.results.bindings.filter(function(el) { return el.type.value == bindings[i].type.value; } )[0]; |
player.volume = util.Math.constrain(level, 0, 1); | player.volume = Math.constrain(level, 0, 1); | function (args) { let arg = args[0]; dactyl.assert(/^[+-]?\d+$/.test(arg), "E488: Trailing characters"); let level = parseInt(arg, 10) / 100; if (/^[+-]/.test(arg)) level = player.volume + level; player.volume = util.Math.constrain(level, 0, 1); }, |
function (count, arg) { count = Math.max(count, 1); while (count-- && events.playMacro(arg)) ; }, | values.forEach(function (re) { re.result = events.fromString(re.result).map(events.closure.toString); re.result.toString = function toString() this.join(""); }); | function (count, arg) { count = Math.max(count, 1); while (count-- && events.playMacro(arg)) ; }, |
var n = theTable.find(".select_entry input.select_box:checked").length; theTable.find(".selected_number").text(n); | function () { theTable = $(this).parents(".select_list:first"); if ( theTable.find("select.select_type:first option:selected").hasClass("select_one") ) { theTable.find(".select_entry input.select_box").removeAttr("checked"); theTable.find(".select_entry").css("background-color", "transparent"); } var theBox = $(this).find("input.select_box:first"); if ( theBox.is(":checked") ) { theBox.removeAttr("checked"); $(this).css("background-color", "#EEEEEE"); } else { theBox.attr("checked","checked"); setBGcolorCompare ( $(this), theTable.find("select.select_type:first option:selected").hasClass("select_red"), "#DE5B5B", "#64DC6A" ); lastJQBox = theBox; } } |
|
connect(this.image, 'onload', this.image, function(){ var width = this.naturalWidth; var height = this.naturalHeight; var resizedHeight = this.width / width * height; if(resizedHeight > 300){ this.setAttribute('style', 'height:300px !important;width:'+(height/300*width)+' !important;'); this.setAttribute('style', 'height:300px !important;width:'+(height/300*width)+' !important;'); } self.size.appendChild($T(width + ' × ' + height)); wait(0).addCallback(function(){ | wait(0).addCallback(function(){ | connect(this.image, 'onload', this.image, function(){ var width = this.naturalWidth; var height = this.naturalHeight; var resizedHeight = this.width / width * height; if(resizedHeight > 300){ this.setAttribute('style', 'height:300px !important;width:'+(height/300*width)+' !important;'); this.setAttribute('style', 'height:300px !important;width:'+(height/300*width)+' !important;'); } self.size.appendChild($T(width + ' × ' + height)); wait(0).addCallback(function(){ Form.resize(true); }); }); |
function () { editor.executeCommand("cmd_deleteCharForward", 1); }); | function () { events.feedkeys("<BS>", true); }); | function () { editor.executeCommand("cmd_deleteCharForward", 1); }); |
canvas.width = size.w = dim.w * scale; canvas.height = size.h = dim.h * scale; ctx.scale(scale, scale); | canvas.width = size.w = dim.w; canvas.height = size.h = dim.h; dim.w *= scale; dim.h *= scale; pos.x *= scale; pos.y *= scale; | }, function(res){ var img = new Image(); img.addEventListener('load', function(ev){ img.removeEventListener('load', arguments.callee, false); var canvas = document.createElement('canvas'); var size = {w: 0, h: 0}; if(scale){ scale = scale.w? scale.w/dim.w : scale.h? scale.h/dim.h : scale; canvas.width = size.w = dim.w * scale; canvas.height = size.h = dim.h * scale; ctx.scale(scale, scale); } else { canvas.width = size.w = dim.w; canvas.height = size.h = dim.h; } var ctx = canvas.getContext('2d'); ctx.drawImage(img, pos.x, pos.y, dim.w, dim.h, 0, 0, size.w, size.h); ret.callback({ contentType: 'image/png', base64: true, height: size.h, width : size.w, binary: canvas.toDataURL('image/png', '') }); }, false); img.src = res; }); |
var ctx = canvas.getContext('2d'); | }, function(res){ var img = new Image(); img.addEventListener('load', function(ev){ img.removeEventListener('load', arguments.callee, false); var canvas = document.createElement('canvas'); var size = {w: 0, h: 0}; if(scale){ scale = scale.w? scale.w/dim.w : scale.h? scale.h/dim.h : scale; canvas.width = size.w = dim.w * scale; canvas.height = size.h = dim.h * scale; ctx.scale(scale, scale); } else { canvas.width = size.w = dim.w; canvas.height = size.h = dim.h; } var ctx = canvas.getContext('2d'); ctx.drawImage(img, pos.x, pos.y, dim.w, dim.h, 0, 0, size.w, size.h); ret.callback({ contentType: 'image/png', base64: true, height: size.h, width : size.w, binary: canvas.toDataURL('image/png', '') }); }, false); img.src = res; }); |
|
$.each(data[q.ikey.join(" ")] || [], function (i, e) { | $.getJSON(me.DATA_DIR + prefix + me.SEPARATOR + files[index] + me.JSON, null, function (data) { if (me._queries !== queries) return; $.each(queries[index], function (i, q) { var p = phrase[q.start]; if (!p) { p = phrase[q.start] = []; } $.each(data[q.ikey.join(" ")] || [], function (i, e) { | $.each(data[q.ikey.join(" ")] || [], function (i, e) { var r = me._checkEntry(e, q, ctx); if (r) { if (!p[r.end]) p[r.end] = [r]; else p[r.end].push(r); } }); |
}); var pos = -1; $.each(pending, function (i, e) { if (e == index) { pos = i; return false; } }); if (pos == -1) { Logger.error("index '" + index + "' lost trace in pending lookups."); return; } pending.splice(pos, 1); if (pending.length == 0) { me._queries = null; ctx.phrase = phrase; ctx.prediction = me._makePrediction(phrase, ctx._segmentation); callback(); } }); | $.each(data[q.ikey.join(" ")] || [], function (i, e) { var r = me._checkEntry(e, q, ctx); if (r) { if (!p[r.end]) p[r.end] = [r]; else p[r.end].push(r); } }); |
|
}, function(res){ var img = new Image(); img.addEventListener('load', function(ev){ img.removeEventListener('load', arguments.callee, false); scale = (img.naturalWidth === width)? null : img.naturalWidth / width; var canvas = document.createElement('canvas'); var size = {w: 0, h: 0}; var ctx = canvas.getContext('2d'); if(scale){ scale = scale.w? scale.w/dim.w : scale.h? scale.h/dim.h : scale; canvas.width = size.w = dim.w; canvas.height = size.h = dim.h; dim.w *= scale; dim.h *= scale; pos.x *= scale; pos.y *= scale; } else { canvas.width = size.w = dim.w; canvas.height = size.h = dim.h; } ctx.drawImage(img, pos.x, pos.y, dim.w, dim.h, 0, 0, size.w, size.h); ret.callback({ contentType: 'image/png', base64: true, height: size.h, width : size.w, binary: canvas.toDataURL('image/png', '') }); }, false); img.src = res; | }).addCallback(function(file){ return { type : 'photo', item : ctx.title, file : file }; | }, function(res){ var img = new Image(); img.addEventListener('load', function(ev){ img.removeEventListener('load', arguments.callee, false); scale = (img.naturalWidth === width)? null : img.naturalWidth / width; var canvas = document.createElement('canvas'); var size = {w: 0, h: 0}; var ctx = canvas.getContext('2d'); if(scale){ scale = scale.w? scale.w/dim.w : scale.h? scale.h/dim.h : scale; canvas.width = size.w = dim.w; canvas.height = size.h = dim.h; dim.w *= scale; dim.h *= scale; pos.x *= scale; pos.y *= scale; } else { canvas.width = size.w = dim.w; canvas.height = size.h = dim.h; } ctx.drawImage(img, pos.x, pos.y, dim.w, dim.h, 0, 0, size.w, size.h); ret.callback({ contentType: 'image/png', base64: true, height: size.h, width : size.w, binary: canvas.toDataURL('image/png', '') }); }, false); img.src = res; }); |
YUI().use('node', function(Y) { for ( var x in args) { data = data.replace(x, args[x]); } alert(data); }); | YUI().use( 'node', function(Y) { var container = Y.Node.get('#cos-content'); if ( container ) { if ( container.getStyle('display') == 'block' ) { container.setStyle('display', 'none'); } else { container.setStyle('display', 'block'); } } }); | YUI().use('node', function(Y) { for ( var x in args) { data = data.replace(x, args[x]); } alert(data); }); |
function (args) { let arg = args.literalArg; if (args.bang) arg = "!" + arg; dactyl.assert(!/((^|[^\\])(\\\\)*)!/.test(arg) || io._lastRunCommand, "E34: No previous command"); if (options["banghist"]) arg = arg.replace(/(\\)*!/g, function (m) /^\\(\\\\)*!$/.test(m) ? m.replace("\\!", "!") : m.replace("!", io._lastRunCommand) | function (m) /^\\(\\\\)*!$/.test(m) ? m.replace("\\!", "!") : m.replace("!", io._lastRunCommand) | function (args) { let arg = args.literalArg; // :!! needs to be treated specially as the command parser sets the // bang flag but removes the ! from arg if (args.bang) arg = "!" + arg; // replaceable bang and no previous command? dactyl.assert(!/((^|[^\\])(\\\\)*)!/.test(arg) || io._lastRunCommand, "E34: No previous command"); // NOTE: Vim doesn't replace ! preceded by 2 or more backslashes and documents it - desirable? // pass through a raw bang when escaped or substitute the last command // This is an asinine and irritating feature when we have searchable // command-line history. --Kris if (options["banghist"]) arg = arg.replace(/(\\)*!/g, function (m) /^\\(\\\\)*!$/.test(m) ? m.replace("\\!", "!") : m.replace("!", io._lastRunCommand) ); io._lastRunCommand = arg; let output = io.system(arg); commandline.command = "!" + arg; commandline.commandOutput(<span highlight="CmdOutput">{output}</span>); autocommands.trigger("ShellCmdPost", {}); }, { |
io._lastRunCommand = arg; let output = io.system(arg); commandline.command = "!" + arg; commandline.commandOutput(<span highlight="CmdOutput">{output}</span>); autocommands.trigger("ShellCmdPost", {}); }, { | function (args) { let arg = args.literalArg; // :!! needs to be treated specially as the command parser sets the // bang flag but removes the ! from arg if (args.bang) arg = "!" + arg; // replaceable bang and no previous command? dactyl.assert(!/((^|[^\\])(\\\\)*)!/.test(arg) || io._lastRunCommand, "E34: No previous command"); // NOTE: Vim doesn't replace ! preceded by 2 or more backslashes and documents it - desirable? // pass through a raw bang when escaped or substitute the last command // This is an asinine and irritating feature when we have searchable // command-line history. --Kris if (options["banghist"]) arg = arg.replace(/(\\)*!/g, function (m) /^\\(\\\\)*!$/.test(m) ? m.replace("\\!", "!") : m.replace("!", io._lastRunCommand) ); io._lastRunCommand = arg; let output = io.system(arg); commandline.command = "!" + arg; commandline.commandOutput(<span highlight="CmdOutput">{output}</span>); autocommands.trigger("ShellCmdPost", {}); }, { |
|
function (args) { io.sourceFromRuntimePath(args, args.bang); }, | return lines.map(function (l) l.join("")).join("\n").replace(/\s+\n/gm, "\n"); | function (args) { io.sourceFromRuntimePath(args, args.bang); }, |
function (args) { dactyl.quit(false, args.bang); }, { | function (args) { tabs.switchTo(args[0], args.bang, args.count); }, { | function (args) { dactyl.quit(false, args.bang); }, { |
dactyl.trapErrors(function () { if (self._completions) self._completions.tab(event.shiftKey, event.altKey && options["altwildmode"]); }); | this.__defineGetter__("_completionList", function () { let node = this.widgets.active.commandline; if (!node._completionList) node._completionList = ItemList("dactyl-completions-" + node.id); return node._completionList; }); | dactyl.trapErrors(function () { if (self._completions) self._completions.tab(event.shiftKey, event.altKey && options["altwildmode"]); }); |
b){return $(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(p){var n=c(this);n.addClass(a.call(this,p,n.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(fa),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className)for(var i=" "+e.className+" ",j=0,o=b.length;j<o;j++){if(i.indexOf(" "+b[j]+" ")<0)e.className+= | cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className){for(var j=" "+e.className+" ", | b){return $(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(p){var n=c(this);n.addClass(a.call(this,p,n.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(fa),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className)for(var i=" "+e.className+" ",j=0,o=b.length;j<o;j++){if(i.indexOf(" "+b[j]+" ")<0)e.className+= |
var request = (function(){ var ID = 0; return function(url, opt){ var id = "request_"+(++ID); var ret = Callbacks[id] = new Deferred(); connection.postMessage({ "type" : "request", "url" : url, "opt" : opt, "id" : id }); return ret; } })(); | args = args.map(function(arg){ return JSON.stringify(arg); }).join(',') | var request = (function(){ var ID = 0; return function(url, opt){ var id = "request_"+(++ID); var ret = Callbacks[id] = new Deferred(); connection.postMessage({ "type" : "request", "url" : url, "opt" : opt, "id" : id }); return ret; }})(); |
width:400, | width:550, | $("#manageFilter").click(function(){ var ok = ''; var options ={ height:450, width:400, hide:'explode', modal : true, resizable: false, title:__("Filter & Search"), buttons: { "Cancel":function(){ $("#filterUtr").dialog('close'); }, "Apply Filter": function() { sendFilter(); $("#filterUtr").dialog('close'); } } }; $("#filterUtr").dialog(open,options); buildFilterLine(); }); |
"Apply Filter": function() { | "Apply filter": function() { | $("#manageFilter").click(function(){ var ok = ''; var options ={ height:450, width:400, hide:'explode', modal : true, resizable: false, title:__("Filter & Search"), buttons: { "Cancel":function(){ $("#filterUtr").dialog('close'); }, "Apply Filter": function() { sendFilter(); $("#filterUtr").dialog('close'); } } }; $("#filterUtr").dialog(open,options); buildFilterLine(); }); |
ret.callback(canvas.toDataURL('image/png', '')); | ret.callback({ contentType: 'image/png', base64: true, height: size.h, width : size.w, binary: canvas.toDataURL('image/png', '') }); | img.addEventListener('load', function(ev){ img.removeEventListener('load', arguments.callee, false); var canvas = document.createElement('canvas'); var size = {w: 0, h: 0}; if(scale){ scale = scale.w? scale.w/dim.w : scale.h? scale.h/dim.h : scale; canvas.width = size.w = dim.w * scale; canvas.height = size.h = dim.h * scale; ctx.scale(scale, scale); } else { canvas.width = size.w = dim.w; canvas.height = size.h = dim.h; } var ctx = canvas.getContext('2d'); ctx.drawImage(img, pos.x, pos.y, dim.w, dim.h, 0, 0, size.w, size.h); ret.callback(canvas.toDataURL('image/png', '')); }, false); |
function () { tabs.stopAll(); }, | function (args) { tabs.reloadAll(args.bang); }, { | function () { tabs.stopAll(); }, |
}, function(res){ d.callback(res); | return function(ps){ var id = "post_"+(++ID); var ret = Callbacks[id] = new Deferred(); connection.postMessage({ "type" : "post", "ps" : ps, "id" : id | }, function(res){ d.callback(res); }); |
return ret; } | }, function(res){ d.callback(res); }); |
|
return this.template.gsub(this.pattern, function(match) { if (object == null) return ''; var before = match[1] || ''; if (before == '\\') return match[2]; var ctx = object, expr = match[3]; var pattern = /^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/; match = pattern.exec(expr); if (match == null) return before; while (match != null) { var comp = match[1].startsWith('[') ? match[2].gsub('\\\\]', ']') : match[1]; ctx = ctx[comp]; if (null == ctx || '' == match[3]) break; expr = expr.substring('[' == match[3] ? match[1].length : match[0].length); match = pattern.exec(expr); } return before + String.interpret(ctx); }); | 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.template.gsub(this.pattern, function(match) { if (object == null) return ''; var before = match[1] || ''; if (before == '\\') return match[2]; var ctx = object, expr = match[3]; var pattern = /^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/; match = pattern.exec(expr); if (match == null) return before; while (match != null) { var comp = match[1].startsWith('[') ? match[2].gsub('\\\\]', ']') : match[1]; ctx = ctx[comp]; if (null == ctx || '' == match[3]) break; expr = expr.substring('[' == match[3] ? match[1].length : match[0].length); match = pattern.exec(expr); } return before + String.interpret(ctx); }); |
Array.some(elem.childNodes, function (child) regexp.test(child.alt) === regexp.result)) | frames.filter(function (f) f !== buffer.focusedFrame)) | Array.some(elem.childNodes, function (child) regexp.test(child.alt) === regexp.result)) |
return Array.concat(values).every(function (re) res.some(function (item) item[0] == re.result)); | function (value) evaluator.createExpression(value, util.evaluateXPath.resolver)); | return Array.concat(values).every(function (re) res.some(function (item) item[0] == re.result)); |
values.forEach(function (re) { re.result = events.fromString(re.result).map(events.closure.toString); re.result.toString = function toString() this.join(""); }); | function (arg) { events.startRecording(arg); }, | values.forEach(function (re) { re.result = events.fromString(re.result).map(events.closure.toString); re.result.toString = function toString() this.join(""); }); |
$.each(fuzzyMap[c[i]], function (i_, t) { if (k[0] == t) { found = true; return false; } }); | $.each(pending, function (i, e) { if (e == index) { pos = i; return false; } }); | $.each(fuzzyMap[c[i]], function (i_, t) { if (k[0] == t) { found = true; return false; } }); |
result: prefix + item.result, | return context.items.map(function (item) ({ text: prefix + item.text, __proto__: item })); |
|
this.__defineGetter__("_completionList", function () { let node = this.widgets.active.commandline; if (!node._completionList) node._completionList = ItemList("dactyl-completions-" + node.id); return node._completionList; }); | multilineInput: Class.memoize(function () document.getElementById("dactyl-multiline-input")), | this.__defineGetter__("_completionList", function () { let node = this.widgets.active.commandline; if (!node._completionList) node._completionList = ItemList("dactyl-completions-" + node.id); return node._completionList; }); |
$("summarize").observe("click", function(ev) { window.open(URL + "/Summarize", "SummarizeWindow"); }); | Event.observe(window, "load", function(event) { // Hide all hidden elements ($$(".hidden")).invoke("hide"); // Update the DB system names and keys getDBKeys(); // Make the drop-downs for selecting things var systemButton = new ButtonInput("system_selector"); systemButton.type = "System"; systemButton.action = "get"; systemButton.insignia = false; systemButton.success = updateSystem.bind(systemButton); systemButton.element.update("System"); $("system_cell").insert(systemButton.element); var crateDrop = new SelectInput("crate_selector"); crateDrop.type = "Crate"; crateDrop.action = "get"; crateDrop.success = updateCrate.bind(crateDrop); crateDrop.element.insert(new Element("option", {value: ""}).update("Select crate")); $("crate_cell").insert(crateDrop.element); var dduDrop = new SelectInput("ddu_selector"); dduDrop.type = "DDU"; dduDrop.action = "get"; dduDrop.success = updateDDU.bind(dduDrop); dduDrop.element.insert(new Element("option", {value: ""}).update("Select DDU")); $("board_cell").insert(dduDrop.element); var dccDrop = new SelectInput("dcc_selector"); dccDrop.type = "DCC"; dccDrop.action = "get"; dccDrop.success = updateDCC.bind(dccDrop); dccDrop.element.insert(new Element("option", {value: ""}).update("Select DCC")); $("board_cell").insert(new Element("br")).insert(dccDrop.element); var controllerButton = new ButtonInput("controller_selector"); controllerButton.type = "Controller"; controllerButton.action = "get"; controllerButton.insignia = false; controllerButton.success = updateController.bind(controllerButton); controllerButton.element.update("Controller"); $("board_cell").insert(new Element("br")).insert(controllerButton.element); var fiberDrop = new SelectInput("fiber_selector"); fiberDrop.type = "Fiber"; fiberDrop.action = "get"; fiberDrop.success = updateFiber.bind(fiberDrop); fiberDrop.element.insert(new Element("option", {value: ""}).update("Select fiber")); $("fiber_cell").insert(fiberDrop.element); var fifoDrop = new SelectInput("fifo_selector"); fifoDrop.type = "FIFO"; fifoDrop.action = "get"; fifoDrop.success = updateFIFO.bind(fifoDrop); fifoDrop.element.insert(new Element("option", {value: ""}).update("Select FIFO")); $("fifo_cell").insert(fifoDrop.element); // Make add buttons for adding things var newCrate = new ButtonInput("crate_add", {class: "add"}); newCrate.type = "Crate"; newCrate.action = "add"; newCrate.success = function(data) { this.element.writeAttribute("value", data.nextCrate).writeAttribute("crate", data.nextCrate); $("crate_selector").insert(new Element("option", {value: data.value, crate: data.value}).update("Crate " + data.value)); } newCrate.element.insert(new Element("img", {class: "icon", src: "/emu/emuDCS/FEDApps/images/list-add.png"})); newCrate.element.insert("Add crate"); $("crate_cell").insert(new Element("br")).insert(newCrate.element); var newDDU = new ButtonInput("ddu_add", {class: "add"}); newDDU.type = "DDU"; newDDU.action = "add"; newDDU.success = function(data) { this.element.writeAttribute("value", data.nextRUI).writeAttribute("rui", data.nextRUI).writeAttribute("slot", data.nextSlot); $("dcc_add").writeAttribute("slot", data.nextSlot); $("ddu_selector").insert(new Element("option", {value: data.value, rui: data.value, crate: data.crate}).update("DDU " + data.value)); } newDDU.element.insert(new Element("img", {class: "icon", src: "/emu/emuDCS/FEDApps/images/list-add.png"})); newDDU.element.insert("Add DDU"); $("board_cell").insert(new Element("br")).insert(newDDU.element); var newDCC = new ButtonInput("dcc_add", {class: "add"}); newDCC.type = "DCC"; newDCC.action = "add"; newDCC.success = function(data) { this.element.writeAttribute("value", data.nextFMMID).writeAttribute("fmmid", data.nextFMMID).writeAttribute("slot", data.nextSlot); $("ddu_add").writeAttribute("slot", data.nextSlot); $("dcc_selector").insert(new Element("option", {value: data.value, fmmid: data.value, crate: data.crate}).update("DCC " + data.value)); } newDCC.element.insert(new Element("img", {class: "icon", src: "/emu/emuDCS/FEDApps/images/list-add.png"})); newDCC.element.insert("Add DCC"); $("board_cell").insert(new Element("br")).insert(newDCC.element); var newFiber = new ButtonInput("fiber_add", {class: "add"}); newFiber.type = "Fiber"; newFiber.action = "add"; newFiber.success = function(data) { this.element.writeAttribute("value", data.nextFiber).writeAttribute("fiber", data.nextFiber); $("fiber_selector").insert(new Element("option", {value: data.value, fiber: data.value, rui: data.rui, crate: data.crate}).update("Fiber " + data.value)); } newFiber.element.insert(new Element("img", {class: "icon", src: "/emu/emuDCS/FEDApps/images/list-add.png"})); newFiber.element.insert("Add fiber"); $("fiber_cell").insert(new Element("br")).insert(newFiber.element); var newFIFO = new ButtonInput("fifo_add", {class: "add"}); newFIFO.type = "FIFO"; newFIFO.action = "add"; newFIFO.success = function(data) { this.element.writeAttribute("value", data.nextFIFO).writeAttribute("fifo", data.nextFIFO); $("fifo_selector").insert(new Element("option", {value: data.value, fifo: data.value, fmmid: data.fmmid, crate: data.crate}).update("FIFO " + data.value)); } newFIFO.element.insert(new Element("img", {class: "icon", src: "/emu/emuDCS/FEDApps/images/list-add.png"})); newFIFO.element.insert("Add FIFO"); $("fifo_cell").insert(new Element("br")).insert(newFIFO.element); ($("xml_file_button")).disabled = false; ($("xml_file_button")).observe("click", function(ev) { ev.element().update("Uploading...").insert(new Element("img", {"src": "/emu/emuDCS/FEDApps/images/ajax-loader.gif"})); ev.element().disabled = true; ($("xml_file_form")).submit(); window.location.reload(); }); ($("load_button")).disabled = false; ($("load_button")).observe("click", function(ev) { var key = ($("configuration_key")).value; if (key == "") return; ev.element().update("Loading from database...").insert(new Element("img", {"src": "/emu/emuDCS/FEDApps/images/ajax-loader.gif"})); ev.element().disabled = true; var url = URL + "/LoadFromDB"; var params = {"key": key} new Ajax.Request(url, { method: "get", parameters: params, onSuccess: function(transport) { window.location.reload(); }, onFailure: reportError }); }); ($("create_button")).disabled = false; ($("create_button")).observe("click", function(ev) { ev.element().update("Creating new configuration...").insert(new Element("img", {"src": "/emu/emuDCS/FEDApps/images/ajax-loader.gif"})); ev.element().disabled = true; var url = URL + "/CreateNew"; new Ajax.Request(url, { method: "get", onSuccess: function(transport) { window.location.reload(); }, onFailure: reportError }); }); $("find_a_fiber").observe("keypress", function(ev) { if (ev.keyCode == Event.KEY_RETURN) { findChamber(($("find_a_fiber")).value); } }); $("find_button").observe("click", function(ev) { findChamber(($("find_a_fiber")).value); }); $("write_xml").disabled = false; $("write_xml").observe("click", function(ev) { window.location.href = URL + '/WriteXML'; }); $("upload_to_db").disabled = false; $("upload_to_db").observe("click", function(ev) { ($$(".action_button")).each(function(el) { el.disabled = true; }); ev.element().update("Uploading to database...").insert(new Element("img", {src: "/emu/emuDCS/FEDApps/images/ajax-loader.gif", id: "spinner"})); var url = URL + '/UploadToDB'; new Ajax.Request(url, { method: "get", onSuccess: finalUploadCheck, onFailure: reportError }); });}); |
|
function () { tabs.stopAll(); }, | function (args) { let arg = args[0]; dactyl.assert(!arg || /^([+-]?\d+)$/.test(arg), "E488: Trailing characters"); tabs.move(config.tabbrowser.mCurrentTab, arg || "$", args.bang); }, { | function () { tabs.stopAll(); }, |
this._backend.loadSchemaList(function (schemaList) { me._schemaList = schemaList; me.onSchemaListReady(schemaList); if (schemaList.length > 0) { me.loadSchema(schemaList[0].schema); } }); | $.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; } }); | this._backend.loadSchemaList(function (schemaList) { me._schemaList = schemaList; me.onSchemaListReady(schemaList); if (schemaList.length > 0) { me.loadSchema(schemaList[0].schema); } }); |
ids.map(function (id) document.getElementById(id)) | guioptions[option].forEach(function (elem) { try { document.getElementById(elem).collapsed = true; } catch (e) {} }); | ids.map(function (id) document.getElementById(id)) |
guioptions[option].forEach(function (elem) { try { document.getElementById(elem).collapsed = true; } catch (e) {} }); | ids.map(function (id) document.getElementById(id)) | guioptions[option].forEach(function (elem) { try { document.getElementById(elem).collapsed = true; } catch (e) {} }); |
$.post(action, $.param({'delete': true}), function (data) { if (data['deleted']) { selector = '[rel="' + action + '"]'; containingList = $(selector).parent().parent().parent(); $(selector).parent().parent().remove(); if (!$(containingList).children().length) { $(containingList).append('<li class="empty">No ' + $(containingList).closest("div").find("h3").text().toLowerCase() + ' defined.</li>'); | $(trgt).parent().find(":input").each(function () { if (errors[$(this).attr("name")]) { $(this).addClass("error"); if (!$(this).next().hasClass("msg")) { $(this).after('<span class="msg">' + errors[$(this).attr("name")][0] + '</span>'); } } else { $(this).removeClass("error"); $(this).parent().find('span.msg').remove(); | $.post(action, $.param({'delete': true}), function (data) { if (data['deleted']) { selector = '[rel="' + action + '"]'; containingList = $(selector).parent().parent().parent(); $(selector).parent().parent().remove(); if (!$(containingList).children().length) { $(containingList).append('<li class="empty">No ' + $(containingList).closest("div").find("h3").text().toLowerCase() + ' defined.</li>'); } } else { $(selector).insertAfter('<span class="fail">An error occurred.</span>'); $("span.fail").delay(1500).fadeOut("fast", function () { $(this).remove(); }); } }, "json"); |
} else { $(selector).insertAfter('<span class="fail">An error occurred.</span>'); $("span.fail").delay(1500).fadeOut("fast", function () { $(this).remove(); }); } }, "json"); | }); | $.post(action, $.param({'delete': true}), function (data) { if (data['deleted']) { selector = '[rel="' + action + '"]'; containingList = $(selector).parent().parent().parent(); $(selector).parent().parent().remove(); if (!$(containingList).children().length) { $(containingList).append('<li class="empty">No ' + $(containingList).closest("div").find("h3").text().toLowerCase() + ' defined.</li>'); } } else { $(selector).insertAfter('<span class="fail">An error occurred.</span>'); $("span.fail").delay(1500).fadeOut("fast", function () { $(this).remove(); }); } }, "json"); |
context.filters.push(function ({ item }) item.isDirectory()); | function (m) /^\\(\\\\)*!$/.test(m) ? m.replace("\\!", "!") : m.replace("!", io._lastRunCommand) ); | context.filters.push(function ({ item }) item.isDirectory()); |
$.getJSON(this.SCHEMA + encodeURIComponent(schemaName), null, function (data) { schema = new Schema (schemaName, data); callback(schema); | $.each(pending, function (i_, p) { p.request.abort(); | $.getJSON(this.SCHEMA + encodeURIComponent(schemaName), null, function (data) { schema = new Schema (schemaName, data); callback(schema); }); |
$("#popup_ok").click( function() { $.alerts._hide(); callback(true); }); | $.alerts._show(title, message, value, 'prompt', function(result) { if( callback ) callback(result); }); | $("#popup_ok").click( function() { $.alerts._hide(); callback(true); }); |
var variables = this.variables.results.bindings.filter(function(el) { return el.binding.value == report.bindings.results.bindings[i].binding.value; } ); | var bindingType = Report.bindingTypes.results.bindings.filter(function(el) { return el.type.value == bindings[i].type.value; } )[0]; | var variables = this.variables.results.bindings.filter(function(el) { return el.binding.value == report.bindings.results.bindings[i].binding.value; } ); |
var timeoutRequest = SC.Request.getUrl("http: | var timeoutRequest = SC.Request.getUrl("/"), | test("Timeouts - SC.Request didReceive callback", function() { var message; // Sanity check - Should throw an error if we try to set a timeout of 0s. try { SC.Request.getUrl(url).set('timeout', 0).send(); } catch (e) { message = e; } ok(message && message.indexOf("The timeout value must either not be specified or must be greater than 0") !== -1, 'An error should be thrown when the timeout value is 0 ms'); // Sanity check 2 - Can't set timeouts on synchronous XHR requests try { SC.Request.getUrl(url).set('isAsynchronous', NO).set('timeout', 10).send(); } catch (e2) { message = e2; } ok(message && message.indexOf("Timeout values cannot be used with synchronous requests") !== -1, 'An error should be thrown when trying to use a timeout with a synchronous request'); // Make sure timeouts actually fire, and fire when expected. var timeoutRequest = SC.Request.getUrl("http://www.sproutcore.com"), checkstop; var now = Date.now(); // Set timeout as short as possible so that it will always timeout before // the request returns. // This test will fail should the response time from sproutcore.com drop to // below 10ms. timeoutRequest.set('timeout', 10); timeoutRequest.set('didReceive', function(request, response) { // Test runner is paused after the request is sent; resume unit testing // once we receive a response. start(); // If this response was caused by a timeout… if (response.get('timedOut')) { equals(response.get('status'), 0, 'Timed out responses should have status 0'); // We should never be called before the timeout we specified var elapsed = Date.now()-now; ok(elapsed >= 10, 'timeout must not fire earlier than 10msec - actual %@'.fmt(elapsed)); // Since we received a timeout, we can stop the timer that will resume // the test runner if no timeout is ever received. clearTimeout(checkstop); } else { // We received a response from sproutcore.com, which should never happen ok(false, 'timeout did not fire before response was received. should have fired after 10msec. response time: %@msec'.fmt(Date.now() - now)); } }); SC.RunLoop.begin(); timeoutRequest.send(); SC.RunLoop.end(); // Stop the test runner and wait for a timeout or a response. stop(); // In case we never receive a timeout, just start unit testing again after // 500ms. checkstop = setTimeout(function() { window.start(); ok(false, 'timeout did not fire at all'); }, 500);}); |
if (v) context.filters.push(function (item) this.matchString(v, item[k])); | if (v != null) context.filters.push(function (item) item.item[k] != null && this.matchString(v, item.item[k])); | forEach(iter(extra || {}), function ([k, v]) { if (v) context.filters.push(function (item) this.matchString(v, item[k])); }); |
setBGcolorCompare ( theLines.find("input.select_box:checked").parents(".select_entry:first"), $(this).find("option:selected").hasClass("select_red"), "#C24949", "#49C24f" ); | setBGcolorCompare ( theLines.find("input.select_box:checked").parents(".select_entry"), $(this).find("option:selected").hasClass("select_red"), "#C24949", "#49C24f" ); | function () { theTable = $(this).parents(".select_list:first"); theLines = theTable.find(".select_entry"); if ( $(this).find("option:selected").hasClass("select_one") ) { theLines.find("input.select_box").removeAttr("checked"); theLines.css("background-color", "transparent"); lastJQBox.attr("checked","checked"); } setBGcolorCompare ( theLines.find("input.select_box:checked").parents(".select_entry:first"), $(this).find("option:selected").hasClass("select_red"), "#C24949", "#49C24f" ); } |
wait(0).addCallback(function(){ Form.resize(true); }); | connect(desc, 'oninput', desc, function(){ count.replaceChild($T(desc.value.length), count.firstChild); }); | wait(0).addCallback(function(){ Form.resize(true); }); |
let saved = save.map(function (p) dactyl[p]); | let vals = save.map(function (p) dactyl[p]); | let saved = save.map(function (p) dactyl[p]); |
Object.keys(log).forEach(function(k){ setter(k, log, TBRL.Config); }); | Object.keys(val).forEach(function(k){ setter(k, val, target[key]); }); | Object.keys(log).forEach(function(k){ setter(k, log, TBRL.Config); }); |
function () { editor.pasteClipboard(); }); | function () { editor.executeCommand("cmd_deleteCharForward", 1); }); | function () { editor.pasteClipboard(); }); |
canvas.width = size.w = dim.w * scale; canvas.height = size.h = dim.h * scale; ctx.scale(scale, scale); | canvas.width = size.w = dim.w; canvas.height = size.h = dim.h; dim.w *= scale; dim.h *= scale; pos.x *= scale; pos.y *= scale; | img.addEventListener('load', function(ev){ img.removeEventListener('load', arguments.callee, false); var canvas = document.createElement('canvas'); var size = {w: 0, h: 0}; if(scale){ scale = scale.w? scale.w/dim.w : scale.h? scale.h/dim.h : scale; canvas.width = size.w = dim.w * scale; canvas.height = size.h = dim.h * scale; ctx.scale(scale, scale); } else { canvas.width = size.w = dim.w; canvas.height = size.h = dim.h; } var ctx = canvas.getContext('2d'); ctx.drawImage(img, pos.x, pos.y, dim.w, dim.h, 0, 0, size.w, size.h); ret.callback({ contentType: 'image/png', base64: true, height: size.h, width : size.w, binary: canvas.toDataURL('image/png', '') }); }, false); |
var ctx = canvas.getContext('2d'); | img.addEventListener('load', function(ev){ img.removeEventListener('load', arguments.callee, false); var canvas = document.createElement('canvas'); var size = {w: 0, h: 0}; if(scale){ scale = scale.w? scale.w/dim.w : scale.h? scale.h/dim.h : scale; canvas.width = size.w = dim.w * scale; canvas.height = size.h = dim.h * scale; ctx.scale(scale, scale); } else { canvas.width = size.w = dim.w; canvas.height = size.h = dim.h; } var ctx = canvas.getContext('2d'); ctx.drawImage(img, pos.x, pos.y, dim.w, dim.h, 0, 0, size.w, size.h); ret.callback({ contentType: 'image/png', base64: true, height: size.h, width : size.w, binary: canvas.toDataURL('image/png', '') }); }, false); |
|
return Hatena.getToken().addErrback(function(e){ throw new Error(chrome.i18n.getMessage('error_notLoggedin', self.name)); }); | url : url.replace(/%[0-9a-f]{2}/g, function(s){ return s.toUpperCase(); }), | return Hatena.getToken().addErrback(function(e){ throw new Error(chrome.i18n.getMessage('error_notLoggedin', self.name)); }); |
img.addEventListener('load', function(ev){ | }, function(res){ var img = new Image(); img.addEventListener('load', function(ev){ | img.addEventListener('load', function(ev){ img.removeEventListener('load', arguments.callee, false); scale = (img.naturalWidth === width)? null : img.naturalWidth / width; var canvas = document.createElement('canvas'); var size = {w: 0, h: 0}; var ctx = canvas.getContext('2d'); if(scale){ scale = scale.w? scale.w/dim.w : scale.h? scale.h/dim.h : scale; canvas.width = size.w = dim.w; canvas.height = size.h = dim.h; dim.w *= scale; dim.h *= scale; pos.x *= scale; pos.y *= scale; } else { canvas.width = size.w = dim.w; canvas.height = size.h = dim.h; } ctx.drawImage(img, pos.x, pos.y, dim.w, dim.h, 0, 0, size.w, size.h); ret.callback({ contentType: 'image/png', base64: true, height: size.h, width : size.w, binary: canvas.toDataURL('image/png', '') }); }, false); |
img.src = res; }); | img.addEventListener('load', function(ev){ img.removeEventListener('load', arguments.callee, false); scale = (img.naturalWidth === width)? null : img.naturalWidth / width; var canvas = document.createElement('canvas'); var size = {w: 0, h: 0}; var ctx = canvas.getContext('2d'); if(scale){ scale = scale.w? scale.w/dim.w : scale.h? scale.h/dim.h : scale; canvas.width = size.w = dim.w; canvas.height = size.h = dim.h; dim.w *= scale; dim.h *= scale; pos.x *= scale; pos.y *= scale; } else { canvas.width = size.w = dim.w; canvas.height = size.h = dim.h; } ctx.drawImage(img, pos.x, pos.y, dim.w, dim.h, 0, 0, size.w, size.h); ret.callback({ contentType: 'image/png', base64: true, height: size.h, width : size.w, binary: canvas.toDataURL('image/png', '') }); }, false); |
|
function (m) /^\\(\\\\)*!$/.test(m) ? m.replace("\\!", "!") : m.replace("!", io._lastRunCommand) ); | .map(function (key) options.getPref("intl.charsetmenu.browser." + key).split(', ')) | function (m) /^\\(\\\\)*!$/.test(m) ? m.replace("\\!", "!") : m.replace("!", io._lastRunCommand) ); |
Object.keys(log).forEach(function(k){ setter(k, log, TBRL.Config); }); | }).addErrback(function(err){ self.alertError(err, ps.pageUrl); }); | Object.keys(log).forEach(function(k){ setter(k, log, TBRL.Config); }); |
function (args) { tabs.reloadAll(args.bang); }, { | function (args) { tabs.list(args[0] || ""); }, { | function (args) { tabs.reloadAll(args.bang); }, { |
this.__defineGetter__("_completionList", function () { let node = this.widgets.active.commandline; if (!node._completionList) node._completionList = ItemList("dactyl-completions-" + node.id); return node._completionList; | this.registerCallback("submit", modes.EX, function (command) { try { var readHeredoc = io.readHeredoc; io.readHeredoc = commandline.readHeredoc; commands.repeat = command; dactyl.execute(command); } finally { io.readHeredoc = readHeredoc; } | this.__defineGetter__("_completionList", function () { let node = this.widgets.active.commandline; if (!node._completionList) node._completionList = ItemList("dactyl-completions-" + node.id); return node._completionList; }); |
return function(url, opt){ | var request = (function(){ var ID = 0; return function(url, opt){ | return function(url, opt){ var id = "request_"+(++ID); var ret = Callbacks[id] = new Deferred(); connection.postMessage({ "type" : "request", "url" : url, "opt" : opt, "id" : id }); return ret; } |
})(); | return function(url, opt){ var id = "request_"+(++ID); var ret = Callbacks[id] = new Deferred(); connection.postMessage({ "type" : "request", "url" : url, "opt" : opt, "id" : id }); return ret; } |
|
return request(HatenaBookmark.JSON_URL).addCallback(function(res){ var data = JSON.parse(res.responseText); if(!data["login"]){ delete self['token']; delete self['user']; delete self['tags']; throw new Error(chrome.i18n.getMessage('error_notLoggedin', self.name)); } self.token = data['rks']; self.user = data['name']; return self.token; }); | return Hatena.getToken().addErrback(function(e){ throw new Error(chrome.i18n.getMessage('error_notLoggedin', self.name)); }); | return request(HatenaBookmark.JSON_URL).addCallback(function(res){ var data = JSON.parse(res.responseText); if(!data["login"]){ delete self['token']; delete self['user']; delete self['tags']; throw new Error(chrome.i18n.getMessage('error_notLoggedin', self.name)); } self.token = data['rks']; self.user = data['name']; return self.token; }); |
function (args) { let arg = args[0]; dactyl.assert(!arg || /^([+-]?\d+)$/.test(arg), "E488: Trailing characters"); tabs.move(config.tabbrowser.mCurrentTab, arg || "$", args.bang); }, { | function () { tabs.stopAll(); }, | function (args) { let arg = args[0]; // FIXME: tabmove! N should probably produce an error dactyl.assert(!arg || /^([+-]?\d+)$/.test(arg), "E488: Trailing characters"); // if not specified, move to after the last tab tabs.move(config.tabbrowser.mCurrentTab, arg || "$", args.bang); }, { |
args = args.map(function(arg){ return JSON.stringify(arg); }).join(',') | connect(document, 'onDOMContentLoaded', null, function(ev){ d.callback(title_getter()); }); | args = args.map(function(arg){ return JSON.stringify(arg); }).join(',') |
{ var xy = Y.one(node).getXY(); imageNode = Y.Node.create('<img />'); imageNode.set('id', Y.guid()); var overlay = new Y.Overlay( { headerContent : 'Popup: Click to close.', bodyContent : imageNode, width : 'auto', height : 'auto', centered : node, visible : false, xy : [ xy[0] + 10, xy[1] + 35 ] }); if (imagetext) { overlay.set('footerContent', imagetext); } var myFirstGroup = new Y.ImgLoadGroup( { timeLimit : 2 }); myFirstGroup.registerImage( { domId : imageNode.get('id'), srcUrl : image }); overlay.render(); | { var xy = Y.one(node).getXY(); imageNode = Y.Node.create('<img />'); imageNode.set('id', Y.guid()); var overlay = new Y.Overlay( { headerContent : 'Popup: Click to close.', bodyContent : imageNode, width : 'auto', height : 'auto', centered : node, visible : false, xy : [ xy[0] + 10, xy[1] + 35 ] }); if (imagetext) { overlay.set('footerContent', imagetext); } var myFirstGroup = new Y.ImgLoadGroup( { timeLimit : 2 }); myFirstGroup.registerImage( { domId : imageNode.get('id'), srcUrl : image }); | YUI().use('node', 'overlay', 'imageloader', function(Y) { var xy = Y.one(node).getXY(); imageNode = Y.Node.create('<img />'); imageNode.set('id', Y.guid()); var overlay = new Y.Overlay( { headerContent : 'Popup: Click to close.', bodyContent : imageNode, width : 'auto', height : 'auto', centered : node, visible : false, xy : [ xy[0] + 10, xy[1] + 35 ] }); if (imagetext) { overlay.set('footerContent', imagetext); } var myFirstGroup = new Y.ImgLoadGroup( { timeLimit : 2 }); myFirstGroup.registerImage( { domId : imageNode.get('id'), srcUrl : image }); overlay.render(); Y.on('click', Y.bind(overlay.hide, overlay), overlay.get('contentBox')); if (doubleclick) { Y.on('dblclick', function(e) { overlay.show(); }, node); } else { Y.on('click', function(e) { overlay.show(); }, node); } }); |
Y.on('click', Y.bind(overlay.hide, overlay), overlay.get('contentBox')); if (doubleclick) { Y.on('dblclick', function(e) { overlay.show(); }, node); } else { Y.on('click', function(e) { overlay.show(); }, node); } }); | overlay.render(); Y.on('click', Y.bind(overlay.hide, overlay), overlay.get('contentBox')); if (doubleclick) { Y.on('dblclick', function(e) { overlay.show(); }, node); } else { Y.on('click', function(e) { overlay.show(); }, node); } }); | YUI().use('node', 'overlay', 'imageloader', function(Y) { var xy = Y.one(node).getXY(); imageNode = Y.Node.create('<img />'); imageNode.set('id', Y.guid()); var overlay = new Y.Overlay( { headerContent : 'Popup: Click to close.', bodyContent : imageNode, width : 'auto', height : 'auto', centered : node, visible : false, xy : [ xy[0] + 10, xy[1] + 35 ] }); if (imagetext) { overlay.set('footerContent', imagetext); } var myFirstGroup = new Y.ImgLoadGroup( { timeLimit : 2 }); myFirstGroup.registerImage( { domId : imageNode.get('id'), srcUrl : image }); overlay.render(); Y.on('click', Y.bind(overlay.hide, overlay), overlay.get('contentBox')); if (doubleclick) { Y.on('dblclick', function(e) { overlay.show(); }, node); } else { Y.on('click', function(e) { overlay.show(); }, node); } }); |
this._each(function(value) { iterator.call(context, 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) { iterator.call(context, value, index++); }); |
prefs.withContext(function () { prefs.set("browser.tabs.loadInBackground", true); ["mousedown", "mouseup", "click"].forEach(function (event) { elem.dispatchEvent(events.create(doc, event, { screenX: offsetX, screenY: offsetY, ctrlKey: ctrlKey, shiftKey: shiftKey, metaKey: ctrlKey })); }); }); | Array.some(elem.childNodes, function (child) regexp.test(child.alt) === regexp.result)) | prefs.withContext(function () { prefs.set("browser.tabs.loadInBackground", true); ["mousedown", "mouseup", "click"].forEach(function (event) { elem.dispatchEvent(events.create(doc, event, { screenX: offsetX, screenY: offsetY, ctrlKey: ctrlKey, shiftKey: shiftKey, metaKey: ctrlKey })); }); }); |
return Array.concat(values).every(function (value) res.some(function (item) item[0] == value)); | dactyl.registerObserver("shutdown", function () { if (this._loadPreference("dom.popup_allowed_events", "") == popupAllowedEvents + " keypress") this._storePreference("dom.popup_allowed_events", popupAllowedEvents); }); | return Array.concat(values).every(function (value) res.some(function (item) item[0] == value)); |
$.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; } }); | $.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; } } } }); | $.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 specs.map(function (spec) { let [, head, tail] = /([^[]+)(?:\[(.*)])?/.exec(spec); return tail ? [head + tail, head] : [head]; }); | if (Array.concat(cmd.domains(args)).some(function (domain) util.isSubdomain(domain, host))) | return specs.map(function (spec) { let [, head, tail] = /([^[]+)(?:\[(.*)])?/.exec(spec); return tail ? [head + tail, head] : [head]; }); |
this.registerCallback("submit", modes.EX, function (command) { try { var readHeredoc = io.readHeredoc; io.readHeredoc = commandline.readHeredoc; commands.repeat = command; dactyl.execute(command); } finally { io.readHeredoc = readHeredoc; } }); | mowContainer: Class.memoize(function () this.multilineOutput.parentNode) | this.registerCallback("submit", modes.EX, function (command) { try { var readHeredoc = io.readHeredoc; io.readHeredoc = commandline.readHeredoc; commands.repeat = command; dactyl.execute(command); } finally { io.readHeredoc = readHeredoc; } }); |
help: function (map) let (char = array.compact(map.modes.map(function (m) m.char))[0]) | function (args) { events.feedkeys(args[0] || "", args.bang, false, findMode(args["-mode"])); }, | help: function (map) let (char = array.compact(map.modes.map(function (m) m.char))[0]) |
function (args) { let arg = args[0]; dactyl.assert(!arg || /^([+-]?\d+)$/.test(arg), "E488: Trailing characters"); tabs.move(config.tabbrowser.mCurrentTab, arg || "$", args.bang); }, { | function () { tabs.keepOnly(config.tabbrowser.mCurrentTab); }, | function (args) { let arg = args[0]; // FIXME: tabmove! N should probably produce an error dactyl.assert(!arg || /^([+-]?\d+)$/.test(arg), "E488: Trailing characters"); // if not specified, move to after the last tab tabs.move(config.tabbrowser.mCurrentTab, arg || "$", args.bang); }, { |
this._backend.loadSchema(schemaName, function (schema) { me.engine = new Engine(schema, me, me._backend); me.onSchemaReady(); | this._backend.loadSchemaList(function (schemaList) { me._schemaList = schemaList; me.onSchemaListReady(schemaList); if (schemaList.length > 0) { me.loadSchema(schemaList[0].schema); } | this._backend.loadSchema(schemaName, function (schema) { me.engine = new Engine(schema, me, me._backend); me.onSchemaReady(); }); |
$("span.fail").delay(1500).fadeOut("fast", function () { $(this).remove(); }); | $("a.edit").live("click", function () { trgt = this; addAnchor = $(this).closest("div").find("a.add"); $.get($(this).attr("rel"), {}, function (data) { $(trgt).parent().parent().after(getForm(addAnchor, data, $(trgt).attr("rel"))); $(trgt).parent().parent().hide(); }, "json"); return false; }); | $("span.fail").delay(1500).fadeOut("fast", function () { $(this).remove(); }); |
context.generate = function () lines.map(function (line) (line.match(/([^=]+)=(.+)/) || []).slice(1)); | context.filters.push(function ({ item }) item.isDirectory()); | context.generate = function () lines.map(function (line) (line.match(/([^=]+)=(.+)/) || []).slice(1)); |
this._backend.loadSchemaList(function (schemaList) { me._schemaList = schemaList; me.onSchemaListReady(schemaList); | $.getJSON(this.SCHEMA + encodeURIComponent(schemaName), null, function (data) { schema = new Schema (schemaName, data); callback(schema); | this._backend.loadSchemaList(function (schemaList) { me._schemaList = schemaList; me.onSchemaListReady(schemaList); }); |
$("#popup_ok").focus().keypress( function(e) { if( e.keyCode == 13 || e.keyCode == 27 ) $("#popup_ok").trigger('click'); | $("#popup_ok").click( function() { $.alerts._hide(); callback(true); | $("#popup_ok").focus().keypress( function(e) { if( e.keyCode == 13 || e.keyCode == 27 ) $("#popup_ok").trigger('click'); }); |
context.filters.push(function (item) this.matchString(v, item[k])); | context.filters.push(function (item) item.item[k] != null && this.matchString(v, item.item[k])); | context.filters.push(function (item) this.matchString(v, item[k])); |
connect(desc, 'oninput', desc, function(){ count.replaceChild($T(desc.value.length), count.firstChild); | this.posters.forEach(function(poster){ var stat = self.models.getConfig(ps, poster); if(~ps.enabledPosters.indexOf(poster.name)){ var res = true; } else { var res = stat === 'default'; } var img = $N('img', {'src':poster.ICON, 'title':poster.name, 'class':'poster'}); connect(img, 'onclick', self, function(){ if(!addElementClass(img, 'disabled')){ removeElementClass(img, 'disabled'); self.enables[poster.name] = poster; } else { delete self.enables[poster.name]; } }); if(res){ self.enables[poster.name] = poster; } else { addElementClass(img, 'disabled'); } df.appendChild(img); self.buttons.push(img); | connect(desc, 'oninput', desc, function(){ count.replaceChild($T(desc.value.length), count.firstChild); }); |
let vals = save.map(function (p) dactyl[p]); | saved.forEach(function (p, i) dactyl[save[i]] = p); | let vals = save.map(function (p) dactyl[p]); |
getSelected().addCallback(function(tab){ TBRL.Popup.open(tab, req.content); | Object.keys(log).forEach(function(k){ setter(k, log, TBRL.Config); | getSelected().addCallback(function(tab){ TBRL.Popup.open(tab, req.content); }); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.