rem
stringlengths
0
126k
add
stringlengths
0
441k
context
stringlengths
15
136k
privateData: function (args) args.some(function (spec) { let opt = options.parseOpt(spec); return opt.option && opt.option.privateData && (!callable(opt.option.privateData) || opt.option.privateData(opt.values)); })
context.filters.push(function ({ item }) item.scope & scope);
privateData: function (args) args.some(function (spec) { let opt = options.parseOpt(spec); return opt.option && opt.option.privateData && (!callable(opt.option.privateData) || opt.option.privateData(opt.values)); })
function () { commandline._messageHistory.clear(); },
this.timeout(function () this.widgets.mowContainer.height = Math.min(doc.body.clientHeight, availableHeight) + "px",
function () { commandline._messageHistory.clear(); },
function (count) { tabs.switchTo(null, null, count, true); },
function (count) { commands.get("undo").action({ count: count }); },
function (count) { tabs.switchTo(null, null, count, true); },
$$(".dcc_button").each( function(e) { e.disabled = false; });
$$(".dcc_button").each( function(e) { e.disabled = true; });
$$(".dcc_button").each( function(e) { e.disabled = false; });
function () { update(true) });
function () { update(true); });
function () { update(true) });
function (args) { let extension = liberator.getExtension(args[0]); liberator.assert(extension && extension.options, "E474: Invalid argument"); if (args.bang) window.openDialog(extension.options, "_blank", "chrome"); else liberator.open(extension.options, { from: "extoptions" }); }, {
context.filters.push(function ({ item: f }) f.isDirectory() || /\.xpi$/.test(f.leafName));
function (args) { let extension = liberator.getExtension(args[0]); liberator.assert(extension && extension.options, "E474: Invalid argument"); if (args.bang) window.openDialog(extension.options, "_blank", "chrome"); else liberator.open(extension.options, { from: "extoptions" }); }, {
context.filters.push(function ({ item: f }) f.isDirectory() || /\.xpi$/.test(f.leafName));
function (args) { let url = args[0]; let file = io.File(url); if (!file.exists()) AddonManager.getInstallForURL(url, callResult("install"), "application/x-xpinstall"); else if (file.isReadable() && file.isFile()) AddonManager.getInstallForFile(file, callResult("install"), "application/x-xpinstall"); else if (file.isDirectory()) dactyl.echomsg("Cannot install a directory: " + file.path.quote(), 0); else dactyl.echoerr("E484: Can't open file " + file.path); }, {
context.filters.push(function ({ item: f }) f.isDirectory() || /\.xpi$/.test(f.leafName));
function () { tabs.stop(config.browser.mCurrentTab); });
function () { if (Editor.windowIsEditable()) { if (options["insertmode"]) modes.set(modes.INSERT); else if (win.getSelection().toString() != "") modes.set(modes.VISUAL, modes.TEXTAREA); else modes.main = modes.TEXTAREA; } else { options.setPref("accessibility.browsewithcaret", true); } });
function () { tabs.stop(config.browser.mCurrentTab); });
delete self['token'];
}).addCallback(function(res){ if(res.responseText.match(/"postkey" value="(.*)"/)){ self.token = RegExp.$1; return self.token; } else { throw new Error(chrome.i18n.getMessage('error_notLoggedin', self.name)); } });
var tagsTable = tags.reduce(function(memo, i){ memo[i.toLowerCase()] = i; return memo; }, {});
this.convertToCandidates(tags).addCallback(function(cands){ self.candidates = cands; background.TBRL.Popup.candidates = cands; background.TBRL.Popup.provider = Config['post']['tag_provider']; self.autoComplete = true; });
var tagsTable = tags.reduce(function(memo, i){ memo[i.toLowerCase()] = i; return memo; }, {});
addon.__defineGetter__("userDisabled", function () getRdfProperty(addon, "userDisabled") == "true");
dactyl.echomsg("Checking updates for addons: " + addons.map(function (a) a.name).join(", "));
addon.__defineGetter__("userDisabled", function () getRdfProperty(addon, "userDisabled") == "true");
let pos = editor.findCharBackward(arg, count);
let pos = editor.findCharForward(arg, count);
function (count, arg) { let pos = editor.findCharBackward(arg, count); if (pos >= 0) editor.moveToPosition(pos + 1, false, dactyl.mode == modes.VISUAL); },
editor.moveToPosition(pos + 1, false, dactyl.mode == modes.VISUAL);
editor.moveToPosition(pos - 1, true, dactyl.mode == modes.VISUAL);
function (count, arg) { let pos = editor.findCharBackward(arg, count); if (pos >= 0) editor.moveToPosition(pos + 1, false, dactyl.mode == modes.VISUAL); },
function (count) { dactyl.execute(count + "undo"); },
function (count) { commands.get("undo").action({ count: count }); },
function (count) { dactyl.execute(count + "undo"); },
function (args) {},
function (args) { let name = args[0]; if (commands.get(name)) commands.removeUserCommand(name); else dactyl.echoerr("E184: No such user-defined command: " + name); }, {
function (args) {},
function (count) { hints.open("g;", { continue: true, count: count }); },
function (count) { hints.open(";", { count: count }); },
function (count) { hints.open("g;", { continue: true, count: count }); },
commandline.input("g;", null, inputOpts({ continue: true }));
commandline.input(";", null, inputOpts());
function (count) { this._extendedhintCount = count; commandline.input("g;", null, inputOpts({ continue: true })); }, { count: true });
commandline.input(";", null, inputOpts());
commandline.input("g;", null, inputOpts({ continue: true }));
function (count) { this._extendedhintCount = count; commandline.input(";", null, inputOpts()); }, { count: true });
function (count) { tabs.switchTo(null, null, count, false); },
function (count) { tabs.remove(tabs.getTab(), count, false); },
function (count) { tabs.switchTo(null, null, count, false); },
function (filter, str) String.indexOf(str, filter) >= 0;
this.cache.constructed = items.map(function (item) ({ __proto__: proto, item: item }));
function (filter, str) String.indexOf(str, filter) >= 0;
function () { events.onEscape(); });
function () { commandline.resetCompletions(); return editor.expandAbbreviation(modes.COMMAND_LINE); },
function () { events.onEscape(); });
this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});(function(){function a(g){for(var h="",k,m=0;g[m];m++){k=g[m];if(k.nodeType===3||k.nodeType===4)h+=k.nodeValue;else if(k.nodeType!==8)h+=a(k.childNodes)}return h}function b(g,h,k,m,r,q){r=0;for(var v=m.length;r<v;r++){var u=m[r];if(u){u=u[g];for(var y=false;u;){if(u.sizcache===
u=j?this:c(this.context);if(c.isFunction(f)){e=f;f=w}for(d=(d||"").split(" ");(i=d[o++])!=null;){j=O.exec(i);k="";if(j){k=j[0];i=i.replace(O,"")}if(i==="hover")d.push("mouseenter"+k,"mouseleave"+k);else{n=i;if(i==="focus"||i==="blur"){d.push(Ga[i]+k);i+=k}else i=(Ga[i]||i)+k;b==="live"?u.each(function(){c.event.add(this,pa(i,r),{data:f,selector:r,handler:e,origType:i,origHandler:e,preType:n})}):u.unbind(pa(i,r),e)}}return this}});c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),
this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});(function(){function a(g){for(var h="",k,m=0;g[m];m++){k=g[m];if(k.nodeType===3||k.nodeType===4)h+=k.nodeValue;else if(k.nodeType!==8)h+=a(k.childNodes)}return h}function b(g,h,k,m,r,q){r=0;for(var v=m.length;r<v;r++){var u=m[r];if(u){u=u[g];for(var y=false;u;){if(u.sizcache===
context.filters.push(function ({ item }) item.isDirectory() || /\.xpi$/.test(item.leafName));
].forEach(function (command) { let perm = AddonManager["PERM_CAN_" + command.perm.toUpperCase()]; function ok(addon) !perm || addon.permissions & perm; commands.add([command.name], command.description, function (args) { let name = args[0]; if (args.bang) dactyl.assert(!name, "E488: Trailing characters"); else dactyl.assert(name, "E471: Argument required"); AddonManager.getAddonsByTypes(["extension"], function (list) { if (!args.bang) list = list.filter(function (extension) extension.name == name); if (!args.bang && !list.every(ok)) return dactyl.echoerr("Permission denied"); list.forEach(command.action); }); }, { argCount: "?", bang: true, completer: function (context) { completion.extension(context); context.filters.push(function ({ item }) ok(item)); if (command.filter) context.filters.push(command.filter); }, literal: 0 }); });
context.filters.push(function ({ item }) item.isDirectory() || /\.xpi$/.test(item.leafName));
function (args) { let name = args[0]; function action(e) { if (command.action == "uninstallItem") e.original.uninstall(); else e.original.userDisabled = command.action == "disableItem"; }; if (args.bang) liberator.extensions.forEach(function (e) { action(e); }); else { liberator.assert(name, "E471: Argument required"); let extension = liberator.getExtension(name); if (extension) action(extension); else liberator.echoerr("E474: Invalid argument"); } }, {
liberator.extensions.forEach(function (e) { action(e); });
function (args) { let name = args[0]; function action(e) { if (command.action == "uninstallItem") e.original.uninstall(); else e.original.userDisabled = command.action == "disableItem"; }; if (args.bang) liberator.extensions.forEach(function (e) { action(e); }); else { liberator.assert(name, "E471: Argument required"); // XXX let extension = liberator.getExtension(name); if (extension) action(extension); else liberator.echoerr("E474: Invalid argument"); } }, {
if(res.responseText.match(/"postkey" value="(.*)"/)){ self.token = RegExp.$1; return self.token; } else {
var doc = createHTML(res.responseText); if($X('id("loginFormbox")', doc)[0]){
}).addCallback(function(res){ if(res.responseText.match(/"postkey" value="(.*)"/)){ self.token = RegExp.$1; return self.token; } else { delete self['token']; throw new Error(chrome.i18n.getMessage('error_notLoggedin', self.name)); } });
function (count) { commands.get("undo").action({ count: count }); },
function (count) { tabs.switchTo(null, null, count, true); },
function (count) { commands.get("undo").action({ count: count }); },
return this.uniq().findAll(function(item) { return array.detect(function(value) { return item === value }); });
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.uniq().findAll(function(item) { return array.detect(function(value) { return item === value }); });
tabs.allTabs.forEach(function (tab, i) { let group = (tab.tabItem || defItem).parent || defItem.parent; if (!set.has(tabGroups, group.id)) tabGroups[group.id] = [group.getTitle(), []]; group = tabGroups[group.id]; group[1].push([i, tab.linkedBrowser]);
buffer.alternateStyleSheets.forEach(function (style) { styles[style.title].push(style.href || "inline");
tabs.allTabs.forEach(function (tab, i) { let group = (tab.tabItem || defItem).parent || defItem.parent; if (!set.has(tabGroups, group.id)) tabGroups[group.id] = [group.getTitle(), []]; group = tabGroups[group.id]; group[1].push([i, tab.linkedBrowser]); });
function (args) { for (let [, name] in args) { name = name.replace(/^g:/, ""); if (!dactyl.globalVariables.hasOwnProperty(name)) { if (!args.bang) dactyl.echoerr("E108: No such variable: " + name); return; } delete dactyl.globalVariables[name]; } },
context.filters.push(function (i) newValues.indexOf(i.text) == -1);
function (args) { for (let [, name] in args) { name = name.replace(/^g:/, ""); // throw away the scope prefix if (!dactyl.globalVariables.hasOwnProperty(name)) { if (!args.bang) dactyl.echoerr("E108: No such variable: " + name); return; } delete dactyl.globalVariables[name]; } },
NOARG: ArgType("no arg", function (arg) !arg || null),
this.shortNames = array(parsedSpecs).map(function (n) n[1]).compact();
NOARG: ArgType("no arg", function (arg) !arg || null),
array_each(onpuchan_topics(html), function(t) { tag.parentNode.removeChild(tag); insertNext(placepoint, t[1]);
arrayEach(onpuchanTopics(document), function(topic) { var reply = xpath(". var abbreviate = xpath(". if(reply && abbreviate) { var href = reply.getAttribute("href"); var anchor = document.createElement("a"); anchor.setAttribute("style", "cursor: hand; font-size: 10px; color: #fff; padding: 4px; border: 1px solid #00f; background: #36c;"); var onClick = function() { anchor.removeEventListener("click", onClick, false); anchor.innerHTML = "読み込み中..."; xmlHttpRequest({method: "GET", url: href, onload: function(http) { var html = document.createElement("div"); html.innerHTML = http.responseText; arrayEach(onpuchanTopics(html), function(t) { insertNext(topic, t);
array_each(onpuchan_topics(html), function(t) { tag.parentNode.removeChild(tag); insertNext(placepoint, t[1]); });
topic.parentNode.removeChild(topic); }}); } anchor.addEventListener("click", onClick, false); anchor.innerHTML = "全部表示"; insertNext(abbreviate, anchor); } });
array_each(onpuchan_topics(html), function(t) { tag.parentNode.removeChild(tag); insertNext(placepoint, t[1]); });
!freshnessLifetimeGreaterThan(headers, msInAMonth) &&
!freshnessLifetimeGreaterThan(headers, msInAMonth - 1) &&
function(url, headers, type) { // Add an Expires header. Use at least one month in the // future. return isCacheableResourceType(type) && !hasHeader(headers, 'Set-Cookie') && !freshnessLifetimeGreaterThan(headers, msInAMonth) && freshnessLifetimeGreaterThan(headers, 0); }),
}).bind('keyup',function (e) {
}).bind('keypress',function (e) {
}).bind('keyup',function (e) { if (16 == $.fn.tabby.catch_kc(e)) pressed.shft = false; }).bind('blur',function (e) { // workaround for Opera -- http://www.webdeveloper.com/forum/showthread.php?p=806588
equals(view.$('.sc-inner').css("width"), "0%", 'width should be 0%');
equals(view.$('.sc-inner')[0].style.width, "0%", 'width should be 0%');
test("basic value 0", function() { var view = pane.view('progress basic value 0'); ok(!view.$().hasClass('disabled'), 'should NOT have disabled class'); ok(view.$('.sc-inner'), 'should have sc-inner class'); equals(view.$('.sc-inner').css("width"), "0%", 'width should be 0%'); equals(view.$('.sc-inner').width(), 0, 'pixel width '); });
c_pagenate.element.bind('dcmgrGUI.updatePagenate',function(){ c_list.clearCheckedList(); $('#detail').html(''); bt_refresh.element.trigger('dcmgrGUI.refresh'); });
$.each(c_list.checked_list,function(check_id,obj){ $($('#detail').find('#'+check_id)).remove(); c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/security_groups/show/',check_id) },true); });
c_pagenate.element.bind('dcmgrGUI.updatePagenate',function(){ c_list.clearCheckedList(); $('#detail').html(''); bt_refresh.element.trigger('dcmgrGUI.refresh'); });
var timeout = setTimeout(function(){
view.invokeLater('animate', 1, 'left', 100, .5, function() {
var timeout = setTimeout(function(){ start(); ok(false, "Timeout! Callback was not called."); }, 2000);
ok(false, "Timeout! Callback was not called."); }, 2000);
ok(true, "Callback was called."); });
var timeout = setTimeout(function(){ start(); ok(false, "Timeout! Callback was not called."); }, 2000);
: function() { return method.apply(context, arguments); }
exports.logging = (function() { var logging = { DEBUG: 1, LOG: 2, INFO: 3, WARN: 4, ERROR: 5 }, loggers = {}, production = false; logging.setProduction = function(prod) { production = !!prod; } logging.get = function(name) { return loggers.hasOwnProperty(name) ? loggers[name] : (loggers[name] = new Logger(name)); } logging.set = function(name, _logger) { loggers[name] = _logger; } logging.getAll = function() { return loggers; } logging.__create = function(pkg, ctx) { ctx.logger = logging.get(pkg); } var Logger = exports.Class(function() { this.init = function(name, level) { this._name = name; this._level = level || logging.LOG; this._listener = exports.log; } this.setLevel = function(level) { this._level = level; } function makeLogFunction(level, type) { return function() { if (!production && level >= this._level) { return this._listener.apply(this._listener, [type, this._name].concat(SLICE.call(arguments))); } return arguments[0]; } } this.setListener = function(listener) { log = listener; } this.debug = makeLogFunction(logging.DEBUG, "DEBUG"); this.log = makeLogFunction(logging.LOG, "LOG"); this.info = makeLogFunction(logging.INFO, "INFO"); this.warn = makeLogFunction(logging.WARN, "WARN"); this.error = makeLogFunction(logging.ERROR, "ERROR"); }); return logging; })();
: function() { return method.apply(context, arguments); }
function (o) {
function (o, extended) {
function (o) { return o + ""; }],
bt_instance_stop.target.bind('click',function(){ bt_instance_stop.open(c_list.getCheckedInstanceIds());
bt_instance_reboot.target.bind('click',function(){ bt_instance_reboot.open(c_list.getCheckedInstanceIds());
bt_instance_stop.target.bind('click',function(){ bt_instance_stop.open(c_list.getCheckedInstanceIds()); });
$.each(q, function (i_, e) { if (e == t) { found = true; return false; } });
$.getJSON(this.DATA_DIR + this.encode(prefix) + this.JSON, null, function (data) { data.prefix = prefix; me._dict = data; if (callback) { callback(schema); } });
$.each(q, function (i_, e) { if (e == t) { found = true; return false; } });
setTimeout(function () { popup.hidePopup(); }, 20);
dactyl.callInMainThread(function () { let popup = document.getElementById("dactyl-visualbell"); let win = config.visualbellWindow; let rect = win.getBoundingClientRect(); let width = rect.right - rect.left; let height = rect.bottom - rect.top; popup.openPopup(win, "overlap", 1, 1, false, false); popup.sizeTo(width - 2, height - 2); setTimeout(function () { popup.hidePopup(); }, 20); });
setTimeout(function () { popup.hidePopup(); }, 20);
thisRef.Data.ajax_getData_charts('chartData_'+i, _charts[i].dataURL, _charts[i].dataURL_params(thisRef.Data), function(data, chart){ getData(data, chart); }, function(){},_charts[i]);
this.Data.ajax_getData('mainsReq', _Settings.dataURL, _Settings.dataURL_params(this.Data), getData, function(){});
thisRef.Data.ajax_getData_charts('chartData_'+i, _charts[i].dataURL, _charts[i].dataURL_params(thisRef.Data), function(data, chart){ getData(data, chart); }, function(){},_charts[i]);
memoize(this.commandbar, obj.name, function () get("dactyl-" + (obj.id || obj.name)));
memoize(this.commandbar, obj.name, function () get("dactyl-", {}, (obj.id || obj.name)));
memoize(this.commandbar, obj.name, function () get("dactyl-" + (obj.id || obj.name)));
[function (aIndex) { if (aIndex >= 0) { var url = getPermaLink(collection[aIndex]); openUILinkIn(url, "tab"); } },
return uniq(tag.split(" ").filter(function (s) !!s)).map(function (t) "[" + t + "]").join("");
[function (aIndex) { if (aIndex >= 0) { var url = getPermaLink(collection[aIndex]); openUILinkIn(url, "tab"); } },
Event.observe(dragger, 'mousedown', function(evt) { offSet = resizedObj.getHeight()-Event.pointerY(evt); mouseMoveHandler = evtHandler.mouseMove.bindAsEventListener(evtHandler); Event.observe(dragger, 'mouseup', function() { Event.stopObserving(dragger, 'mousemove', mouseMoveHandler); }); Event.observe(dragger, 'mouseout', function() { Event.stopObserving(dragger, 'mousemove', mouseMoveHandler); }); Event.observe(dragger, 'mousemove', mouseMoveHandler); });
top.Event.stopObserving(document.body, 'keypress', function(event) {});
Event.observe(dragger, 'mousedown', function(evt) { offSet = resizedObj.getHeight()-Event.pointerY(evt); mouseMoveHandler = evtHandler.mouseMove.bindAsEventListener(evtHandler); // register the mouse up event handler Event.observe(dragger, 'mouseup', function() { // unregister mouse move event handler Event.stopObserving(dragger, 'mousemove', mouseMoveHandler); }); // register the mouse out event handler Event.observe(dragger, 'mouseout', function() { // unregister mouse move event handler Event.stopObserving(dragger, 'mousemove', mouseMoveHandler); }); // register the mouse move event handler Event.observe(dragger, 'mousemove', mouseMoveHandler); });
var bindingType = Report.bindingTypes.results.bindings.filter(function(el) { return el.type.value == visBindings[i].bindingType.value; } )[0];
var bindingType = Report.bindingTypes.results.bindings.filter(function(el) { return el.type.value == visBindings[i].type.value; } )[0];
var bindingType = Report.bindingTypes.results.bindings.filter(function(el) { return el.type.value == visBindings[i].bindingType.value; } )[0];
if (_charts[i].ajax) thisRef.Data.ajax_getData_charts(_charts[i].dataURL, _charts[i].dataURL_params(thisRef.Data), function(data, chart){getData(data, chart);}, function(){},_charts[i]);}
thisRef.Data.ajax_getData_charts(_charts[i].dataURL, _charts[i].dataURL_params(thisRef.Data), function(data, chart){ getData(data, chart); }, function(){},_charts[i]);
if (_charts[i].ajax) thisRef.Data.ajax_getData_charts(_charts[i].dataURL, _charts[i].dataURL_params(thisRef.Data), function(data, chart){getData(data, chart);}, function(){},_charts[i]);}
$.each(c_list.checked_list,function(check_id,obj){ $($('#detail').find('#'+check_id)).remove(); c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/images/show/',check_id) },true); });
c_pagenate.element.bind('dcmgrGUI.updatePagenate',function(){ c_list.clearCheckedList(); $('#detail').html(''); bt_refresh.element.trigger('dcmgrGUI.refresh'); });
$.each(c_list.checked_list,function(check_id,obj){ //remove $($('#detail').find('#'+check_id)).remove(); //update c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/images/show/',check_id) },true); });
test("isEnabled=NO should add disabled class", function() {
test("changing the title should update the span", function() { var oldDisplayTitle = view.get('displayTitle');
test("isEnabled=NO should add disabled class", function() { SC.RunLoop.begin(); view.set('isEnabled', NO); SC.RunLoop.end(); ok(view.$().hasClass('disabled'), 'should have disabled class');});
view.set('isEnabled', NO);
view.set('title', 'Last Name');
test("isEnabled=NO should add disabled class", function() { SC.RunLoop.begin(); view.set('isEnabled', NO); SC.RunLoop.end(); ok(view.$().hasClass('disabled'), 'should have disabled class');});
ok(view.$().hasClass('disabled'), 'should have disabled class');
ok(view.get('displayTitle') !== oldDisplayTitle, 'precond - should have changed display title'); var q = Q$('span', view.get('layer')); equals(q.text(), view.get('displayTitle'), 'should have display title');
test("isEnabled=NO should add disabled class", function() { SC.RunLoop.begin(); view.set('isEnabled', NO); SC.RunLoop.end(); ok(view.$().hasClass('disabled'), 'should have disabled class');});
var XHR = window.XMLHttpRequest || function() { return new ActiveXObject("Msxml2.XMLHTTP"); }
var XHR = window.XMLHttpRequest || function() { return new ActiveXObject("Msxml2.XMLHTTP"); },
var XHR = window.XMLHttpRequest || function() { return new ActiveXObject("Msxml2.XMLHTTP"); }
this.map(this.ignore_types, function(type) { types[type] = 1;
this.map(list, function(error) { var tokens = error["word"].split(/\s+/); var pre = error["pre"]; var first = tokens[0]; if (errors['__' + first] == undefined) { errors['__' + first] = new Object(); errors['__' + first].pretoks = {}; errors['__' + first].defaults = new Array(); } if (pre == "") { errors['__' + first].defaults.push(parent.makeError(error["word"], tokens, type, seps, pre)); } else { if (errors['__' + first].pretoks['__' + pre] == undefined) errors['__' + first].pretoks['__' + pre] = new Array(); errors['__' + first].pretoks['__' + pre].push(parent.makeError(error["word"], tokens, type, seps, pre)); }
this.map(this.ignore_types, function(type) { types[type] = 1; });
startIndexA = a.indexOf('>') + 1 endIndexA = a.indexOf('</') x = a.substring(startIndexA, endIndexA) x = parseInt(x)
x = 0 y = 0 if(a.indexOf('>') > -1) { startIndexA = a.indexOf('>') + 1 endIndexA = a.indexOf('</') x = a.substring(startIndexA, endIndexA) x = parseInt(x) } else { x = parseInt(a) }
jQuery.fn.dataTableExt.oSort['integer-in-tag-desc'] = function(a,b) { startIndexA = a.indexOf('>') + 1 endIndexA = a.indexOf('</') x = a.substring(startIndexA, endIndexA) x = parseInt(x) startIndexB = b.indexOf('>') + 1 endIndexB = b.indexOf('</') y = b.substring(startIndexB, endIndexB) y = parseInt(y) return ((x < y) ? 1 : ((x > y) ? -1 : 0));};
startIndexB = b.indexOf('>') + 1 endIndexB = b.indexOf('</') y = b.substring(startIndexB, endIndexB) y = parseInt(y)
if(b.indexOf('>') > -1) { startIndexB = b.indexOf('>') + 1 endIndexB = b.indexOf('</') y = b.substring(startIndexB, endIndexB) y = parseInt(y) } else { y = parseInt(b) }
jQuery.fn.dataTableExt.oSort['integer-in-tag-desc'] = function(a,b) { startIndexA = a.indexOf('>') + 1 endIndexA = a.indexOf('</') x = a.substring(startIndexA, endIndexA) x = parseInt(x) startIndexB = b.indexOf('>') + 1 endIndexB = b.indexOf('</') y = b.substring(startIndexB, endIndexB) y = parseInt(y) return ((x < y) ? 1 : ((x > y) ? -1 : 0));};
$.getJSON("macs.php", function(data) {
$.getJSON("data.php", function(data) {
$.getJSON("macs.php", function(data) { self.updateNodes(data); });
csp.Server = Class(process.EventEmitter, function () { this.init = function (sessionURL) { process.EventEmitter.call(this); this._sessionUrl = sessionURL || ''; log('starting server, session url is <' + this._sessionUrl + '>'); }; var CSPError = Class(AssertionError, function (supr) {
var CSPError = Class(AssertionError, function (supr) {
csp.Server = Class(process.EventEmitter, function () { this.init = function (sessionURL) { process.EventEmitter.call(this); this._sessionUrl = sessionURL || ''; log('starting server, session url is <' + this._sessionUrl + '>'); }; var CSPError = Class(AssertionError, function (supr) { this.name = 'CSPError' this.init = function (code/*, other args */) { supr(this, 'init', args); this.code = code; var args = Array.prototype.slice.call(arguments, 1); }; }); var assertOrRenderError = function (exp, code, message) { if (!exp) { throw new CSPError(code, message) }; }; var renderError = function (response, code, message) { response.sendHeader(code, {'Content-Type' : 'text/plain', 'Content-Length' : message.length}); response.sendBody(message); response.finish(); }; var sendStatic = function (path, response) { debug('SEND STATIC', path, response) staticFile('./' + path.join('/')) // defined in util.js .addCallback(function(content){ response.sendHeader(200, {'Content-Type' : 'text/plain', 'Content-Length' : content.length}); response.sendBody(content); response.finish(); }) .addErrback(function(){ renderError(response, 404, 'No such file, ' + path); }); }; // returns a request which fires with the whole post body as bytes, or // immediately with null for GET requests var getRequestBody = function (request) { var promise = new process.Promise(); if (request.method === 'GET') { reschedule(function () { promise.emitSuccess(''); }); } else { var body = []; request.setBodyEncoding('binary'); request .addListener('body', function (chunk) { body.push(chunk); // body += chunk }) .addListener('complete', function () { promise.emitSuccess(body.join('')); }); }; return promise; }; // The logic of the server goes in the 'handleRequest' function, which is // called every time a new request comes in. var resources = Set('static', 'handshake', 'comet', 'send', 'close', 'reflect', 'streamtest'); var methods = Set('GET', 'POST'); this._handleRequest = function (request, response) { getRequestBody(request).addCallback(bind(this, function(body) { logger.debug('received request', request.url); try { var uri = nodeUrl.parse(request.url, true), path = uri.pathname, sessionUrl = this._sessionUrl; assertOrRenderError(startswith(path, sessionUrl + '/'), 404, 'Request to invalid session URL'); assertOrRenderError(request.method in methods, 405, 'Invalid HTTP method, ' + request.method); var resource = path.split('/').pop(); if (resource === 'static') { assertOrRenderError(startswith(path, sessionUrl + '/'), 404, 'sendStatic Not Implemented'); // TODO: sendStatic(relativePath, response); return; }; assertOrRenderError(resources.hasOwnProperty(resource), 404, 'Invalid resource, ' + path); var params = uri.query; // 'data' is either the POST body if it exists, or the 'd' variable request.data = body || params.d || null; if (resource === 'handshake') { assertOrRenderError(!params.s, 400, 'Handshake cannot have session'); try { var dict = JSON.parse(request.data); // make sure our json dict is an object literal assert((dict instanceof Object) && !(dict instanceof Array)); } catch (err) { debug('INVALID HANDSHAKE, ', request, err); throw new CSPError(400, 'Invalid data parameter for handshake'); }; var session = new csp.Session(); var connection = new csp.Connection(session); session.connection = connection; this.emit('connection', connection); connection.emit('connect'); } else { var session = sessionDict[params.s]; assertOrRenderError(session, 400, 'Invalid or missing session'); // 'ackId' is either the 'Last-Event-Id' header, or the 'a' variable var ackId = parseInt(request.headers['Last-Event-Id']) || parseInt(params.a) || -1; session.receiveAck(ackId); }; session.updateVars(params); session.dispatch[resource].call(session, request, response); // logic is in session } catch (err) { if (err instanceof CSPError) { renderError(response, err.code, err.message); } else { debug('Unexpected Error: ', err.message); renderError(response, 500, 'Unknown Server error'); }; }; })); }; this.listen = function (port, host) { var server = http.createServer(bind(this, this._handleRequest)); server.listen(port, host); hoststring = host ? host : 'localhost'; };});
var assertOrRenderError = function (exp, code, message) { if (!exp) { throw new CSPError(code, message) }; }; var renderError = function (response, code, message) { response.sendHeader(code, {'Content-Type' : 'text/plain', 'Content-Length' : message.length}); response.sendBody(message); response.finish(); }; var sendStatic = function (path, response) { debug('SEND STATIC', path, response) staticFile('./' + path.join('/')) .addCallback(function(content){ response.sendHeader(200, {'Content-Type' : 'text/plain', 'Content-Length' : content.length}); response.sendBody(content); response.finish(); }) .addErrback(function(){ renderError(response, 404, 'No such file, ' + path); }); }; var getRequestBody = function (request) { var promise = new process.Promise(); if (request.method === 'GET') { reschedule(function () { promise.emitSuccess(''); }); } else { var body = []; request.setBodyEncoding('binary'); request .addListener('body', function (chunk) { body.push(chunk); }) .addListener('complete', function () { promise.emitSuccess(body.join('')); }); }; return promise; }; var resources = Set('static', 'handshake', 'comet', 'send', 'close', 'reflect', 'streamtest'); var methods = Set('GET', 'POST'); this._handleRequest = function (request, response) { getRequestBody(request).addCallback(bind(this, function(body) { logger.debug('received request', request.url); try { var uri = nodeUrl.parse(request.url, true), path = uri.pathname, sessionUrl = this._sessionUrl; assertOrRenderError(startswith(path, sessionUrl + '/'), 404, 'Request to invalid session URL'); assertOrRenderError(request.method in methods, 405, 'Invalid HTTP method, ' + request.method); var resource = path.split('/').pop(); if (resource === 'static') { assertOrRenderError(startswith(path, sessionUrl + '/'), 404, 'sendStatic Not Implemented'); return; }; assertOrRenderError(resources.hasOwnProperty(resource), 404, 'Invalid resource, ' + path); var params = uri.query; request.data = body || params.d || null; if (resource === 'handshake') { assertOrRenderError(!params.s, 400, 'Handshake cannot have session'); try { var dict = JSON.parse(request.data); assert((dict instanceof Object) && !(dict instanceof Array)); } catch (err) { debug('INVALID HANDSHAKE, ', request, err); throw new CSPError(400, 'Invalid data parameter for handshake'); }; var session = new csp.Session(); var connection = new csp.Connection(session); session.connection = connection; this.emit('connection', connection); connection.emit('connect'); } else { var session = sessionDict[params.s]; assertOrRenderError(session, 400, 'Invalid or missing session'); var ackId = parseInt(request.headers['Last-Event-Id']) || parseInt(params.a) || -1; session.receiveAck(ackId); }; session.updateVars(params); session.dispatch[resource].call(session, request, response); } catch (err) { if (err instanceof CSPError) { renderError(response, err.code, err.message); } else { debug('Unexpected Error: ', err.message); renderError(response, 500, 'Unknown Server error'); }; }; })); }; this.listen = function (port, host) { var server = http.createServer(bind(this, this._handleRequest)); server.listen(port, host); hoststring = host ? host : 'localhost'; }; });
csp.Server = Class(process.EventEmitter, function () { this.init = function (sessionURL) { process.EventEmitter.call(this); this._sessionUrl = sessionURL || ''; log('starting server, session url is <' + this._sessionUrl + '>'); }; var CSPError = Class(AssertionError, function (supr) { this.name = 'CSPError' this.init = function (code/*, other args */) { supr(this, 'init', args); this.code = code; var args = Array.prototype.slice.call(arguments, 1); }; }); var assertOrRenderError = function (exp, code, message) { if (!exp) { throw new CSPError(code, message) }; }; var renderError = function (response, code, message) { response.sendHeader(code, {'Content-Type' : 'text/plain', 'Content-Length' : message.length}); response.sendBody(message); response.finish(); }; var sendStatic = function (path, response) { debug('SEND STATIC', path, response) staticFile('./' + path.join('/')) // defined in util.js .addCallback(function(content){ response.sendHeader(200, {'Content-Type' : 'text/plain', 'Content-Length' : content.length}); response.sendBody(content); response.finish(); }) .addErrback(function(){ renderError(response, 404, 'No such file, ' + path); }); }; // returns a request which fires with the whole post body as bytes, or // immediately with null for GET requests var getRequestBody = function (request) { var promise = new process.Promise(); if (request.method === 'GET') { reschedule(function () { promise.emitSuccess(''); }); } else { var body = []; request.setBodyEncoding('binary'); request .addListener('body', function (chunk) { body.push(chunk); // body += chunk }) .addListener('complete', function () { promise.emitSuccess(body.join('')); }); }; return promise; }; // The logic of the server goes in the 'handleRequest' function, which is // called every time a new request comes in. var resources = Set('static', 'handshake', 'comet', 'send', 'close', 'reflect', 'streamtest'); var methods = Set('GET', 'POST'); this._handleRequest = function (request, response) { getRequestBody(request).addCallback(bind(this, function(body) { logger.debug('received request', request.url); try { var uri = nodeUrl.parse(request.url, true), path = uri.pathname, sessionUrl = this._sessionUrl; assertOrRenderError(startswith(path, sessionUrl + '/'), 404, 'Request to invalid session URL'); assertOrRenderError(request.method in methods, 405, 'Invalid HTTP method, ' + request.method); var resource = path.split('/').pop(); if (resource === 'static') { assertOrRenderError(startswith(path, sessionUrl + '/'), 404, 'sendStatic Not Implemented'); // TODO: sendStatic(relativePath, response); return; }; assertOrRenderError(resources.hasOwnProperty(resource), 404, 'Invalid resource, ' + path); var params = uri.query; // 'data' is either the POST body if it exists, or the 'd' variable request.data = body || params.d || null; if (resource === 'handshake') { assertOrRenderError(!params.s, 400, 'Handshake cannot have session'); try { var dict = JSON.parse(request.data); // make sure our json dict is an object literal assert((dict instanceof Object) && !(dict instanceof Array)); } catch (err) { debug('INVALID HANDSHAKE, ', request, err); throw new CSPError(400, 'Invalid data parameter for handshake'); }; var session = new csp.Session(); var connection = new csp.Connection(session); session.connection = connection; this.emit('connection', connection); connection.emit('connect'); } else { var session = sessionDict[params.s]; assertOrRenderError(session, 400, 'Invalid or missing session'); // 'ackId' is either the 'Last-Event-Id' header, or the 'a' variable var ackId = parseInt(request.headers['Last-Event-Id']) || parseInt(params.a) || -1; session.receiveAck(ackId); }; session.updateVars(params); session.dispatch[resource].call(session, request, response); // logic is in session } catch (err) { if (err instanceof CSPError) { renderError(response, err.code, err.message); } else { debug('Unexpected Error: ', err.message); renderError(response, 500, 'Unknown Server error'); }; }; })); }; this.listen = function (port, host) { var server = http.createServer(bind(this, this._handleRequest)); server.listen(port, host); hoststring = host ? host : 'localhost'; };});
modes.forEach(function (mode) { for (let m in modules.modes.mainModes) if (mode == m.mask && modeSign.indexOf(m.char) == -1) modeSign += m.char; });
template.map(map.names, function (name) <tr> <td>{modeSign} {name}</td> <td>{map.noremap ? "*" : " "}</td> <td>{map.rhs || "function () { ... }"}</td> </tr>))
modes.forEach(function (mode) { for (let m in modules.modes.mainModes) if (mode == m.mask && modeSign.indexOf(m.char) == -1) modeSign += m.char; });
bt_refresh.element.bind('dcmgrGUI.refresh',function(){ list_request.url = DcmgrGUI.Util.getPagePath('/volumes/show/',c_pagenate.current_page); c_list.element.trigger('dcmgrGUI.updateList',{request:list_request}) $.each(c_list.checked_list,function(check_id,obj){ $($('#detail').find('#'+check_id)).remove(); c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/volumes/detail/',check_id) },true); });
bt_delete_volume.target.bind('click',function(){ bt_delete_volume.open(c_list.getCheckedInstanceIds());
bt_refresh.element.bind('dcmgrGUI.refresh',function(){ list_request.url = DcmgrGUI.Util.getPagePath('/volumes/show/',c_pagenate.current_page); c_list.element.trigger('dcmgrGUI.updateList',{request:list_request}) //update detail $.each(c_list.checked_list,function(check_id,obj){ $($('#detail').find('#'+check_id)).remove(); c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/volumes/detail/',check_id) },true); }); });
$("#fixture_container").empty();
$(Screw).bind('loaded', function() { $('.it') .bind('failed', function(e, reason) { if (!window.console || !window.console.debug) { return; } console.debug("Failure:"); console.debug(exampleName(this)); console.debug(reason.toString()); var file = reason.fileName || reason.sourceURL; var line = reason.lineNumber || reason.line; if (file || line) { console.debug('line ' + line + ', ' + file); } var trace = reason.stack; if (trace) { console.debug(trace); } }) .bind('failed', function(e, reason) { var trace = reason.stack; if (trace) { var trace_lines = trace.split("\n") var test_dom = $(this); $.each(trace_lines, function(number, line) { test_dom.append($('<p class="error"></p>').text(line)); }); } }); $(Screw) .bind('after', function() { var failures = $("li .it.failed"); if (failures.length > 0) { window.scrollTo(0, failures.first().position().top); } })});
function () { let sh = history.session; commandline.commandOutput(template.jumps(sh.index, sh)); },
return dactyl.open(items.map(function (i) i.url), dactyl.NEW_TAB);
function () { let sh = history.session; commandline.commandOutput(template.jumps(sh.index, sh)); },
d.callback(res.title); });
ps = res; d.callback(res); });
}, function(res){ d.callback(res.title); });
context.filters.push(function (item) util.compareIgnoreCase(item.text.substr(0, this.filter.length), this.filter));
context.filters.push(function (item) item.item.indexOf(args.prefix) === 0);
context.filters.push(function (item) util.compareIgnoreCase(item.text.substr(0, this.filter.length), this.filter));
bg = $(this).parent().css("background-color"); kids = $(this).parent().children(); kids.css("background-color","#82c9d9"); },
kids.css("background-color",bg); }
function () { //Mouse over bg = $(this).parent().css("background-color"); kids = $(this).parent().children(); kids.css("background-color","#82c9d9"); },
this._backend.loadSchemaList(function (schemaList) { me._schemaList = schemaList; me.onSchemaListReady(schemaList); if (schemaList.length > 0) { me.loadSchema(schemaList[0].schema); } });
d = $.grep(d, function (e) { return e >= b[j]; });
this._backend.loadSchemaList(function (schemaList) { me._schemaList = schemaList; me.onSchemaListReady(schemaList); if (schemaList.length > 0) { me.loadSchema(schemaList[0].schema); } });
if (typeof count != "number" || count < 1 || !hasCount)
if (typeof count != "number" || count < 1)
function (count) { if (typeof count != "number" || count < 1 || !hasCount) count = 1; let controller = buffer.selectionController; while (count--) { if (modes.extended & modes.TEXTAREA) { if (typeof visualTextareaCommand == "function") visualTextareaCommand(); else editor.executeCommand(visualTextareaCommand); } else controller[caretModeMethod](caretModeArg, true); } },
while (count--) { if (modes.extended & modes.TEXTAREA) { if (typeof visualTextareaCommand == "function") visualTextareaCommand(); else editor.executeCommand(visualTextareaCommand); } else controller[caretModeMethod](caretModeArg, true); }
let sel = controller.getSelection(controller.SELECTION_NORMAL); if (!sel.rangeCount) sel.addRange(RangeFind.endpoint( RangeFind.nodeRange(buffer.focusedFrame.document.documentElement), true)); while (count--) controller[caretModeMethod](caretModeArg, false);
function (count) { if (typeof count != "number" || count < 1 || !hasCount) count = 1; let controller = buffer.selectionController; while (count--) { if (modes.extended & modes.TEXTAREA) { if (typeof visualTextareaCommand == "function") visualTextareaCommand(); else editor.executeCommand(visualTextareaCommand); } else controller[caretModeMethod](caretModeArg, true); } },
var g1 = null, g2 = null ;
var g1 = null, g2 = null ; target = null ;
test("should automatically bind with arguments if passed", function() { SC.RunLoop.begin() ; var fired = NO ; var g1 = null, g2 = null ; var o = SC.Object.create({ func: function(arg1, arg2) { g1 = arg1 ; g2 = arg2 ; fired = YES ; } }); o.invokeLater('func', 200, 'ARG1', 'ARG2') ; SC.RunLoop.end() ; var tries = 20 ; var f = function f() { if (!fired && --tries >= 0) { setTimeout(f, 100) ; return ; } equals(YES, fired, 'did not fire') ; equals(g1, 'ARG1', 'arg1') ; equals(g2, 'ARG2', 'arg2') ; window.start() ; // starts the test runner } ; stop() ; // stops the test runner setTimeout(f, 300) ;});
g1 = arg1 ; g2 = arg2 ; fired = YES ;
g1 = arg1 ; g2 = arg2 ; fired = YES ; target = this ;
test("should automatically bind with arguments if passed", function() { SC.RunLoop.begin() ; var fired = NO ; var g1 = null, g2 = null ; var o = SC.Object.create({ func: function(arg1, arg2) { g1 = arg1 ; g2 = arg2 ; fired = YES ; } }); o.invokeLater('func', 200, 'ARG1', 'ARG2') ; SC.RunLoop.end() ; var tries = 20 ; var f = function f() { if (!fired && --tries >= 0) { setTimeout(f, 100) ; return ; } equals(YES, fired, 'did not fire') ; equals(g1, 'ARG1', 'arg1') ; equals(g2, 'ARG2', 'arg2') ; window.start() ; // starts the test runner } ; stop() ; // stops the test runner setTimeout(f, 300) ;});
equals(target, o, 'target') ;
test("should automatically bind with arguments if passed", function() { SC.RunLoop.begin() ; var fired = NO ; var g1 = null, g2 = null ; var o = SC.Object.create({ func: function(arg1, arg2) { g1 = arg1 ; g2 = arg2 ; fired = YES ; } }); o.invokeLater('func', 200, 'ARG1', 'ARG2') ; SC.RunLoop.end() ; var tries = 20 ; var f = function f() { if (!fired && --tries >= 0) { setTimeout(f, 100) ; return ; } equals(YES, fired, 'did not fire') ; equals(g1, 'ARG1', 'arg1') ; equals(g2, 'ARG2', 'arg2') ; window.start() ; // starts the test runner } ; stop() ; // stops the test runner setTimeout(f, 300) ;});
return request(url+'/text').addCallback(function(res){ var textDoc = createHTML(res.responseText); var textForm = formContents($X(' if(textForm['post[one]'].trim()){ delete textForm.preview_post; textForm.redirect_to = self.TUMBLR_URL+'dashboard'; return textForm; } if(/^http:\/\/[^.]+\.tumblr\.com\/post\/\d+/.test(form['post[two]'])){ delete textForm.preview_post; textForm.redirect_to = self.TUMBLR_URL+'dashboard'; return textForm; }
var m = ctx.href.match(/^http:\/\/([^\/]+)\/post\/([^\/]+)\/?/); if(m){ return request('http: charset: 'text/plain; charset=utf-8', queryString: { id: m[2] } }).addCallback(function(res){ var xml = createXML(res.responseText); var type = xml.getElementsByTagName('post')[0].getAttribute('type'); if(type === 'regular'){ return request(url+'/text').addCallback(function(res){ var textDoc = createHTML(res.responseText); var textForm = formContents($X(' delete textForm.preview_post; textForm.redirect_to = self.TUMBLR_URL+'dashboard'; return textForm; }); } else { return form; } }); } else {
return request(url).addCallback(function(res){ var doc = createHTML(res.responseText); var form = formContents($X('//form', doc)[1]); delete form.preview_post; form.redirect_to = self.TUMBLR_URL+'dashboard'; if(form.reblog_post_id){ // self.trimReblogInfo(form); // Tumblrから他サービスへポストするため画像URLを取得しておく if(form['post[type]']==='photo') form.image = $X('id("edit_post")//img[contains(@src, "media.tumblr.com/") or contains(@src, "data.tumblr.com/")]/@src', doc)[0]; } if(TBRL.config.entry['reconvert_text'] && form['post[type]']==='link'){ // LinkがTextの省略である可能性を考慮する // LinkにconvertされたTextの特徴 // 1. as Textとした際, Titleに文字が入っていたらText確定 // このとき, もともとTitleがないText Postは判別できない. // しかし, 入っていたら少なくとも確実にconveted Text Post // 2. LinkのurlがtumblrのurlであればTextからのconvertの可能性が高い return request(url+'/text').addCallback(function(res){ var textDoc = createHTML(res.responseText); var textForm = formContents($X('//form', textDoc)[1]); if(textForm['post[one]'].trim()){ // converted Text Post delete textForm.preview_post; textForm.redirect_to = self.TUMBLR_URL+'dashboard'; return textForm; } if(/^http:\/\/[^.]+\.tumblr\.com\/post\/\d+/.test(form['post[two]'])){ // maybe converted Text Post delete textForm.preview_post; textForm.redirect_to = self.TUMBLR_URL+'dashboard'; return textForm; } return form; }); } else { return form; } });
});
}
return request(url).addCallback(function(res){ var doc = createHTML(res.responseText); var form = formContents($X('//form', doc)[1]); delete form.preview_post; form.redirect_to = self.TUMBLR_URL+'dashboard'; if(form.reblog_post_id){ // self.trimReblogInfo(form); // Tumblrから他サービスへポストするため画像URLを取得しておく if(form['post[type]']==='photo') form.image = $X('id("edit_post")//img[contains(@src, "media.tumblr.com/") or contains(@src, "data.tumblr.com/")]/@src', doc)[0]; } if(TBRL.config.entry['reconvert_text'] && form['post[type]']==='link'){ // LinkがTextの省略である可能性を考慮する // LinkにconvertされたTextの特徴 // 1. as Textとした際, Titleに文字が入っていたらText確定 // このとき, もともとTitleがないText Postは判別できない. // しかし, 入っていたら少なくとも確実にconveted Text Post // 2. LinkのurlがtumblrのurlであればTextからのconvertの可能性が高い return request(url+'/text').addCallback(function(res){ var textDoc = createHTML(res.responseText); var textForm = formContents($X('//form', textDoc)[1]); if(textForm['post[one]'].trim()){ // converted Text Post delete textForm.preview_post; textForm.redirect_to = self.TUMBLR_URL+'dashboard'; return textForm; } if(/^http:\/\/[^.]+\.tumblr\.com\/post\/\d+/.test(form['post[two]'])){ // maybe converted Text Post delete textForm.preview_post; textForm.redirect_to = self.TUMBLR_URL+'dashboard'; return textForm; } return form; }); } else { return form; } });
function() { var input_vacationsubject = rcube_find_object('_vacationsubject'); if (input_vacationsubject && input_vacationsubject.value == '') { alert(rcmail.gettext( 'vacationnosubject', 'vacation')); input_vacationsubject.focus(); } else { rcmail.gui_objects.vacationform .submit(); } }, true);
rcmail.register_command('plugin.vacation-save', function() { rcmail.gui_objects.vacationform.submit(); }, true);
function() { var input_vacationsubject = rcube_find_object('_vacationsubject'); if (input_vacationsubject && input_vacationsubject.value == '') { alert(rcmail.gettext( 'vacationnosubject', 'vacation')); input_vacationsubject.focus(); } else { rcmail.gui_objects.vacationform .submit(); } }, true);
$(document.body).observe('click', function(event) { var clickedElement = Event.element(event); if (!clickedElement.match('#' + strElmntID + 'List')) { listObj.hide(); } });
jsonObj.each(function(vals) { vals = vals.toString(); strListVal += '<li><a class="DDlink" onclick="setInputValue(\'' + strElmntID + '\', \'' + vals.sub("'", "\\'") + '\')">' + vals + '</a></li>'; });
$(document.body).observe('click', function(event) { var clickedElement = Event.element(event); if (!clickedElement.match('#' + strElmntID + 'List')) { listObj.hide(); } });
SC.run(function() { var propertyName = evt.originalEvent.propertyName, callback = this._transitionCallbacks[propertyName]; if(callback) SC.Animatable.runCallback(callback); }, this);
this._animatable_original_hasAcceleratedLayer = this.hasAcceleratedLayer || function(){};
SC.run(function() { var propertyName = evt.originalEvent.propertyName, callback = this._transitionCallbacks[propertyName]; if(callback) SC.Animatable.runCallback(callback); }, this);
bt_refresh.element.bind('dcmgrGUI.refresh',function(){ list_request.url = DcmgrGUI.Util.getPagePath('/security_groups/show/',c_pagenate.current_page); c_list.element.trigger('dcmgrGUI.updateList',{request:list_request}) $.each(c_list.checked_list,function(check_id,obj){ $($('#detail').find('#'+check_id)).remove(); c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/security_groups/detail/',check_id) },true); });
c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ c_list.setData(params.data); c_list.singleCheckList(c_list.detail_template);
bt_refresh.element.bind('dcmgrGUI.refresh',function(){ //Update list element list_request.url = DcmgrGUI.Util.getPagePath('/security_groups/show/',c_pagenate.current_page); c_list.element.trigger('dcmgrGUI.updateList',{request:list_request}) $.each(c_list.checked_list,function(check_id,obj){ //All remove detail element $($('#detail').find('#'+check_id)).remove(); //All reload detail element c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/security_groups/detail/',check_id) },true); }); });
commandline.open(":", "contact " + address + " " + displayName, modes.EX);
commandline.open("", "contact " + address + " " + displayName, modes.EX);
function () { try { var to = gDBView.hdrForFirstSelectedMessage.mime2DecodedAuthor; } catch (e) { liberator.beep(); } if (!to) return; let address = to.substring(to.indexOf("<") + 1, to.indexOf(">")); let displayName = to.substr(0, to.indexOf("<") - 1); if (/^\S+\s+\S+\s*$/.test(displayName)) { let names = displayName.split(/\s+/); displayName = "-firstname=" + names[0].replace(/"/g, "") + " -lastname=" + names[1].replace(/"/g, ""); } else displayName = "-name=\"" + displayName.replace(/"/g, "") + "\""; commandline.open(":", "contact " + address + " " + displayName, modes.EX); });
dactyl.execute(args[0], null, true);
dactyl.execute(args[0] || "", null, true);
function (args) { let alternate = tabs.alternate; try { dactyl.execute(args[0], null, true); } finally { tabs.updateSelectionHistory([tabs.getTab(), alternate]); } }, {
let abbrevs = abbreviations.merged.filter(function (abbr) abbr.inModes(modes));
let fn = modes ? function (abbr) abbr.inModes(modes) : util.identity;
let abbrevs = abbreviations.merged.filter(function (abbr) abbr.inModes(modes));
let url = args.literalArg;
let url = args[0];
function (args) { let url = args.literalArg; if (args.bang) history.goToStart(); else { if (url) { let sh = history.session; if (/^\d+(:|$)/.test(url) && sh.index - parseInt(url) in sh) return void window.getWebNavigation().gotoIndex(sh.index - parseInt(url)); for (let [i, ent] in Iterator(sh.slice(0, sh.index).reverse())) if (ent.URI.spec == url) return void window.getWebNavigation().gotoIndex(i); dactyl.echoerr("Exxx: URL not found in history"); } else history.stepTo(-Math.max(args.count, 1)); } return null; },
function () { commandline.open(":", "open ", modes.EX); });
function () { commandline.open("", "open ", modes.EX); });
function () { commandline.open(":", "open ", modes.EX); });
this.focusTrack(view.getItemByIndex(0));
player.focusTrack(view.getItemByIndex(0));
function (args) { let view = LibraryUtils.createStandardMediaListView(LibraryUtils.mainLibrary, args.literalArg); dactyl.assert(view.length, "No matching tracks"); SBGetBrowser().loadMediaList(LibraryUtils.mainLibrary, null, null, view, "chrome://songbird/content/mediapages/filtersPage.xul"); // TODO: make this this.focusTrack work ? this.focusTrack(view.getItemByIndex(0)); },
0;ea.apply(this,a);return this},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||
function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b<d;b++)if((e=arguments[b])!=null)for(j in e){i=a[j];o=e[j];if(a!==o)if(f&&o&&(c.isPlainObject(o)||c.isArray(o))){i=i&&(c.isPlainObject(i)||
0;ea.apply(this,a);return this},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||
let alternate = tabs.alternate;
let special = args.bang; let count = args.count; let arg = args.literalArg;
function (args) { let alternate = tabs.alternate; try { dactyl.execute(args[0], null, true); } finally { tabs.updateSelectionHistory([tabs.getTab(), alternate]); } }, {
try { dactyl.execute(args[0], null, true);
if (arg) { let removed = 0; let matches = arg.match(/^(\d+):?/); if (matches) { tabs.remove(tabs.getTab(parseInt(matches[1], 10) - 1)); removed = 1; } else { let str = arg.toLowerCase(); let browsers = config.tabbrowser.browsers; for (let i = browsers.length - 1; i >= 0; i--) { let host, title, uri = browsers[i].currentURI.spec; if (browsers[i].currentURI.schemeIs("about")) { host = ""; title = "(Untitled)"; } else { host = browsers[i].currentURI.host; title = browsers[i].contentTitle; } [host, title, uri] = [host, title, uri].map(String.toLowerCase); if (host.indexOf(str) >= 0 || uri == str || (special && (title.indexOf(str) >= 0 || uri.indexOf(str) >= 0))) { tabs.remove(tabs.getTab(i)); removed++; } } } if (removed > 0) dactyl.echomsg(removed + " fewer tab(s)", 9); else dactyl.echoerr("E94: No matching tab for " + arg);
function (args) { let alternate = tabs.alternate; try { dactyl.execute(args[0], null, true); } finally { tabs.updateSelectionHistory([tabs.getTab(), alternate]); } }, {
finally { tabs.updateSelectionHistory([tabs.getTab(), alternate]); }
else tabs.remove(tabs.getTab(), Math.max(count, 1), special, 0);
function (args) { let alternate = tabs.alternate; try { dactyl.execute(args[0], null, true); } finally { tabs.updateSelectionHistory([tabs.getTab(), alternate]); } }, {
$("div.img-chooser-wrap img").src('/static/img/blank.jpg');
$("div.img-chooser-wrap img").attr('src', '/static/img/blank.jpg');
$("a.chooser-remove").live("click", function () { $("input.chooser-input").val(''); $("div.img-chooser-wrap img").src('/static/img/blank.jpg'); $(this).prev().text("Add"); $(this).remove(); return false; });
$X('./descendant-or-self::a', content).forEach(function(l){ l.href = resolveRelativePath(l.href, ctx.href); });
return request(link).addCallback(function(res){ var text = res.responseText; var doc = createHTML(res.responseText); ctx.href = link; var m = text.match(/<title(?:\s[^>]+?)?>([\S\s]*?)<\/title\s*>/i); ctx.title = ((m)? m[1] : '').replace(/[\n\r]/g, ''); return self.extractByPage(ctx, doc); });
$X('./descendant-or-self::a', content).forEach(function(l){ l.href = resolveRelativePath(l.href, ctx.href); });
test("adds disabled class if view isEnabled = NO", function() {
test("adds text-selectable class if view has isTextSelectable", function() {
test("adds disabled class if view isEnabled = NO", function() { var view = SC.View.create() ; var context ; context = view.renderContext(); view.set('isEnabled', YES); view.prepareContext(context, YES); ok(!context.hasClass('disabled'), 'should NOT have disabled class'); context = view.renderContext(); view.set('isEnabled', NO); view.prepareContext(context, YES); ok(context.hasClass('disabled'), 'should have disabled class'); });
view.set('isEnabled', YES);
view.set('isTextSelectable', YES);
test("adds disabled class if view isEnabled = NO", function() { var view = SC.View.create() ; var context ; context = view.renderContext(); view.set('isEnabled', YES); view.prepareContext(context, YES); ok(!context.hasClass('disabled'), 'should NOT have disabled class'); context = view.renderContext(); view.set('isEnabled', NO); view.prepareContext(context, YES); ok(context.hasClass('disabled'), 'should have disabled class'); });
ok(!context.hasClass('disabled'), 'should NOT have disabled class');
ok(context.hasClass('allow-select'), 'should have text-selectable class');
test("adds disabled class if view isEnabled = NO", function() { var view = SC.View.create() ; var context ; context = view.renderContext(); view.set('isEnabled', YES); view.prepareContext(context, YES); ok(!context.hasClass('disabled'), 'should NOT have disabled class'); context = view.renderContext(); view.set('isEnabled', NO); view.prepareContext(context, YES); ok(context.hasClass('disabled'), 'should have disabled class'); });
view.set('isEnabled', NO);
view.set('isTextSelectable', NO);
test("adds disabled class if view isEnabled = NO", function() { var view = SC.View.create() ; var context ; context = view.renderContext(); view.set('isEnabled', YES); view.prepareContext(context, YES); ok(!context.hasClass('disabled'), 'should NOT have disabled class'); context = view.renderContext(); view.set('isEnabled', NO); view.prepareContext(context, YES); ok(context.hasClass('disabled'), 'should have disabled class'); });
ok(context.hasClass('disabled'), 'should have disabled class');
ok(!context.hasClass('allow-select'), 'should NOT have text-selectable class');
test("adds disabled class if view isEnabled = NO", function() { var view = SC.View.create() ; var context ; context = view.renderContext(); view.set('isEnabled', YES); view.prepareContext(context, YES); ok(!context.hasClass('disabled'), 'should NOT have disabled class'); context = view.renderContext(); view.set('isEnabled', NO); view.prepareContext(context, YES); ok(context.hasClass('disabled'), 'should have disabled class'); });
c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ c_list.setData(params.data); c_list.singleCheckList(c_list.detail_template);
bt_refresh.element.bind('dcmgrGUI.refresh',function(){ c_list.page = c_pagenate.current_page; list_request.url = DcmgrGUI.Util.getPagePath('/security_groups/list/',c_list.page); list_request.data = DcmgrGUI.Util.getPagenateData(c_list.page,c_list.maxrow) c_list.element.trigger('dcmgrGUI.updateList',{request:list_request}) $.each(c_list.checked_list,function(check_id,obj){ $($('#detail').find('#'+check_id)).remove(); c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/security_groups/show/',check_id) },true); });
c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ c_list.setData(params.data); c_list.singleCheckList(c_list.detail_template); });
d=function(){a();e.form.submit=b;e.form.submit();e.form.submit=d};e.form.submit=d}e.style.display="none";var f=new o(function(g){e.nextSibling?e.parentNode.insertBefore(g,e.nextSibling):e.parentNode.appendChild(g)},c);f.toTextArea=function(){a();e.parentNode.removeChild(f.wrapping);e.style.display="";if(e.form){e.form.submit=b;typeof e.form.removeEventListener=="function"?e.form.removeEventListener("submit",a,false):e.form.detachEvent("onsubmit",a)}};return f};o.isProbablySupported=function(){var e;
g=function(){c();a.form.submit=e;a.form.submit();a.form.submit=g};a.form.submit=g}a.style.display="none";var d=new s(function(f){a.nextSibling?a.parentNode.insertBefore(f,a.nextSibling):a.parentNode.appendChild(f)},b);d.toTextArea=function(){c();a.parentNode.removeChild(d.wrapping);a.style.display="";if(a.form){a.form.submit=e;typeof a.form.removeEventListener=="function"?a.form.removeEventListener("submit",c,false):a.form.detachEvent("onsubmit",c)}};return d};s.isProbablySupported=function(){var a;
d=function(){a();e.form.submit=b;e.form.submit();e.form.submit=d};e.form.submit=d}e.style.display="none";var f=new o(function(g){e.nextSibling?e.parentNode.insertBefore(g,e.nextSibling):e.parentNode.appendChild(g)},c);f.toTextArea=function(){a();e.parentNode.removeChild(f.wrapping);e.style.display="";if(e.form){e.form.submit=b;typeof e.form.removeEventListener=="function"?e.form.removeEventListener("submit",a,false):e.form.detachEvent("onsubmit",a)}};return f};o.isProbablySupported=function(){var e;
layerDependencies: layers.slice(0, i).map(function(name){ return "../" + name.replace(/\./g,'/') + ".js" })
(kwArgs.htmlFiles instanceof Array ? kwArgs.htmlFiles : kwArgs.htmlFiles.split(',')).forEach(function(file){ processHtmlFile(file); });
layerDependencies: layers.slice(0, i).map(function(name){ return "../" + name.replace(/\./g,'/') + ".js" })
memoize(this, "widgets", function () { let widgets = { commandline: document.getElementById("dactyl-commandline"), prompt: document.getElementById("dactyl-commandline-prompt"), command: document.getElementById("dactyl-commandline-command"), message: document.getElementById("dactyl-message"), multilineOutput: document.getElementById("dactyl-multiline-output"), multilineInput: document.getElementById("dactyl-multiline-input") }; widgets.command.inputField.QueryInterface(Ci.nsIDOMNSEditableElement); widgets.message.inputField.QueryInterface(Ci.nsIDOMNSEditableElement); widgets.mowContainer = widgets.multilineOutput.parentNode; widgets.multilineOutput.contentDocument.body.id = "dactyl-multiline-output-content"; return widgets;
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; }
memoize(this, "widgets", function () { let widgets = { commandline: document.getElementById("dactyl-commandline"), prompt: document.getElementById("dactyl-commandline-prompt"), command: document.getElementById("dactyl-commandline-command"), message: document.getElementById("dactyl-message"), multilineOutput: document.getElementById("dactyl-multiline-output"), multilineInput: document.getElementById("dactyl-multiline-input") }; widgets.command.inputField.QueryInterface(Ci.nsIDOMNSEditableElement); widgets.message.inputField.QueryInterface(Ci.nsIDOMNSEditableElement); widgets.mowContainer = widgets.multilineOutput.parentNode; widgets.multilineOutput.contentDocument.body.id = "dactyl-multiline-output-content"; return widgets; });