rem
stringlengths 0
126k
| add
stringlengths 0
441k
| context
stringlengths 15
136k
|
---|---|---|
this.setPath = function(path) { this.path.__default__ = typeof path == 'string' ? [path] : path; } | this.setPath = function(path) { this.__path.__default__ = typeof path == 'string' ? [path] : path; } | this.setPath = function(path) { this.path.__default__ = typeof path == 'string' ? [path] : path; } |
setRequestHeaders: function() { var headers = { 'X-Requested-With': 'XMLHttpRequest', 'X-Prototype-Version': Prototype.Version, 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*' }; if (this.method == 'post') { headers['Content-type'] = this.options.contentType + (this.options.encoding ? '; charset=' + this.options.encoding : ''); if (this.transport.overrideMimeType && (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005) headers['Connection'] = 'close'; } if (typeof this.options.requestHeaders == 'object') { var extras = this.options.requestHeaders; if (Object.isFunction(extras.push)) for (var i = 0, length = extras.length; i < length; i += 2) headers[extras[i]] = extras[i+1]; else $H(extras).each(function(pair) { headers[pair.key] = pair.value }); } for (var name in headers) this.transport.setRequestHeader(name, headers[name]); }, | 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])*?\*\ | setRequestHeaders: function() { var headers = { 'X-Requested-With': 'XMLHttpRequest', 'X-Prototype-Version': Prototype.Version, 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*' }; if (this.method == 'post') { headers['Content-type'] = this.options.contentType + (this.options.encoding ? '; charset=' + this.options.encoding : ''); /* Force "Connection: close" for older Mozilla browsers to work * around a bug where XMLHttpRequest sends an incorrect * Content-length header. See Mozilla Bugzilla #246651. */ if (this.transport.overrideMimeType && (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005) headers['Connection'] = 'close'; } // user-defined headers if (typeof this.options.requestHeaders == 'object') { var extras = this.options.requestHeaders; if (Object.isFunction(extras.push)) for (var i = 0, length = extras.length; i < length; i += 2) headers[extras[i]] = extras[i+1]; else $H(extras).each(function(pair) { headers[pair.key] = pair.value }); } for (var name in headers) this.transport.setRequestHeader(name, headers[name]); }, |
c,a){this.editor.replaceChars(e,c,a)},getSearchCursor:function(e,c,a){return this.editor.getSearchCursor(e,c,a)},undo:function(){this.editor.history.undo()},redo:function(){this.editor.history.redo()},historySize:function(){return this.editor.history.historySize()},clearHistory:function(){this.editor.history.clear()},grabKeys:function(e,c){this.editor.grabKeys(e,c)},ungrabKeys:function(){this.editor.ungrabKeys()},setParser:function(e,c){this.editor.setParser(e,c)},setSpellcheck:function(e){this.win.document.body.spellcheck= e},setStylesheet:function(e){if(typeof e==="string")e=[e];for(var c={},a={},b=this.win.document.getElementsByTagName("link"),d=0,f;f=b[d];d++)if(f.rel.indexOf("stylesheet")!==-1)for(var g=0;g<e.length;g++){var h=e[g];if(f.href.substring(f.href.length-h.length)===h){c[f.href]=true;a[h]=true}}for(d=0;f=b[d];d++)if(f.rel.indexOf("stylesheet")!==-1)f.disabled=!(f.href in c);for(g=0;g<e.length;g++){h=e[g];if(!(h in a)){f=this.win.document.createElement("link");f.rel="stylesheet";f.type="text/css";f.href= | b,c){this.editor.replaceChars(a,b,c)},getSearchCursor:function(a,b,c){return this.editor.getSearchCursor(a,b,c)},undo:function(){this.editor.history.undo()},redo:function(){this.editor.history.redo()},historySize:function(){return this.editor.history.historySize()},clearHistory:function(){this.editor.history.clear()},grabKeys:function(a,b){this.editor.grabKeys(a,b)},ungrabKeys:function(){this.editor.ungrabKeys()},setParser:function(a,b){this.editor.setParser(a,b)},setSpellcheck:function(a){this.win.document.body.spellcheck= a},setStylesheet:function(a){if(typeof a==="string")a=[a];for(var b={},c={},e=this.win.document.getElementsByTagName("link"),g=0,d;d=e[g];g++)if(d.rel.indexOf("stylesheet")!==-1)for(var f=0;f<a.length;f++){var m=a[f];if(d.href.substring(d.href.length-m.length)===m){b[d.href]=true;c[m]=true}}for(g=0;d=e[g];g++)if(d.rel.indexOf("stylesheet")!==-1)d.disabled=!(d.href in b);for(f=0;f<a.length;f++){m=a[f];if(!(m in c)){d=this.win.document.createElement("link");d.rel="stylesheet";d.type="text/css";d.href= | c,a){this.editor.replaceChars(e,c,a)},getSearchCursor:function(e,c,a){return this.editor.getSearchCursor(e,c,a)},undo:function(){this.editor.history.undo()},redo:function(){this.editor.history.redo()},historySize:function(){return this.editor.history.historySize()},clearHistory:function(){this.editor.history.clear()},grabKeys:function(e,c){this.editor.grabKeys(e,c)},ungrabKeys:function(){this.editor.ungrabKeys()},setParser:function(e,c){this.editor.setParser(e,c)},setSpellcheck:function(e){this.win.document.body.spellcheck=e},setStylesheet:function(e){if(typeof e==="string")e=[e];for(var c={},a={},b=this.win.document.getElementsByTagName("link"),d=0,f;f=b[d];d++)if(f.rel.indexOf("stylesheet")!==-1)for(var g=0;g<e.length;g++){var h=e[g];if(f.href.substring(f.href.length-h.length)===h){c[f.href]=true;a[h]=true}}for(d=0;f=b[d];d++)if(f.rel.indexOf("stylesheet")!==-1)f.disabled=!(f.href in c);for(g=0;g<e.length;g++){h=e[g];if(!(h in a)){f=this.win.document.createElement("link");f.rel="stylesheet";f.type="text/css";f.href= |
setStyle: function(element, styles) { element = $(element); var elementStyle = element.style, match; if (Object.isString(styles)) { element.style.cssText += ';' + styles; return styles.include('opacity') ? element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : element; } for (var property in styles) if (property == 'opacity') element.setOpacity(styles[property]); else elementStyle[(property == 'float' || property == 'cssFloat') ? (Object.isUndefined(elementStyle.styleFloat) ? 'cssFloat' : 'styleFloat') : property] = styles[property]; return element; }, | var Prototype={Version:"1.6.1",Browser:(function(){var b=navigator.userAgent;var a=Object.prototype.toString.call(window.opera)=="[object Opera]";return{IE:!!window.attachEvent&&!a,Opera:a,WebKit:b.indexOf("AppleWebKit/")>-1,Gecko:b.indexOf("Gecko")>-1&&b.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile.*Safari/.test(b)}})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var a=window.Element||window.HTMLElement;return !!(a&&a.prototype)})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=="undefined"){return true}var c=document.createElement("div");var b=document.createElement("form");var a=false;if(c.__proto__&&(c.__proto__!==b.__proto__)){a=true}c=b=null;return a})()},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Abstract={};var Try={these:function(){var c;for(var b=0,d=arguments.length;b<d;b++){var a=arguments[b];try{c=a();break}catch(f){}}return c}};var Class=(function(){function a(){}function b(){var g=null,f=$A(arguments);if(Object.isFunction(f[0])){g=f.shift()}function d(){this.initialize.apply(this,arguments)}Object.extend(d,Class.Methods);d.superclass=g;d.subclasses=[];if(g){a.prototype=g.prototype;d.prototype=new a;g.subclasses.push(d)}for(var e=0;e<f.length;e++){d.addMethods(f[e])}if(!d.prototype.initialize){d.prototype.initialize=Prototype.emptyFunction}d.prototype.constructor=d;return d}function c(k){var f=this.superclass&&this.superclass.prototype;var e=Object.keys(k);if(!Object.keys({toString:true}).length){if(k.toString!=Object.prototype.toString){e.push("toString")}if(k.valueOf!=Object.prototype.valueOf){e.push("valueOf")}}for(var d=0,g=e.length;d<g;d++){var j=e[d],h=k[j];if(f&&Object.isFunction(h)&&h.argumentNames().first()=="$super"){var l=h;h=(function(i){return function(){return f[i].apply(this,arguments)}})(j).wrap(l);h.valueOf=l.valueOf.bind(l);h.toString=l.toString.bind(l)}this.prototype[j]=h}return this}return{create:b,Methods:{addMethods:c}}})();(function(){var d=Object.prototype.toString;function i(q,s){for(var r in s){q[r]=s[r]}return q}function l(q){try{if(e(q)){return"undefined"}if(q===null){return"null"}return q.inspect?q.inspect():String(q)}catch(r){if(r instanceof RangeError){return"..."}throw r}}function k(q){var s=typeof q;switch(s){case"undefined":case"function":case"unknown":return;case"boolean":return q.toString()}if(q===null){return"null"}if(q.toJSON){return q.toJSON()}if(h(q)){return}var r=[];for(var u in q){var t=k(q[u]);if(!e(t)){r.push(u.toJSON()+": "+t)}}return"{"+r.join(", ")+"}"}function c(q){return $H(q).toQueryString()}function f(q){return q&&q.toHTML?q.toHTML():String.interpret(q)}function o(q){var r=[];for(var s in q){r.push(s)}return r}function m(q){var r=[];for(var s in q){r.push(q[s])}return r}function j(q){return i({},q)}function h(q){return !!(q&&q.nodeType==1)}function g(q){return d.call(q)=="[object Array]"}function p(q){return q instanceof Hash}function b(q){return typeof q==="function"}function a(q){return d.call(q)=="[object String]"}function n(q){return d.call(q)=="[object Number]"}function e(q){return typeof q==="undefined"}i(Object,{extend:i,inspect:l,toJSON:k,toQueryString:c,toHTML:f,keys:o,values:m,clone:j,isElement:h,isArray:g,isHash:p,isFunction:b,isString:a,isNumber:n,isUndefined:e})})();Object.extend(Function.prototype,(function(){var k=Array.prototype.slice;function d(o,l){var n=o.length,m=l.length;while(m--){o[n+m]=l[m]}return o}function i(m,l){m=k.call(m,0);return d(m,l)}function g(){var l=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\ | setStyle: function(element, styles) { element = $(element); var elementStyle = element.style, match; if (Object.isString(styles)) { element.style.cssText += ';' + styles; return styles.include('opacity') ? element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : element; } for (var property in styles) if (property == 'opacity') element.setOpacity(styles[property]); else elementStyle[(property == 'float' || property == 'cssFloat') ? (Object.isUndefined(elementStyle.styleFloat) ? 'cssFloat' : 'styleFloat') : property] = styles[property]; return element; }, |
e},setStylesheet:function(e){if(typeof e==="string")e=[e];for(var c={},a={},b=this.win.document.getElementsByTagName("link"),d=0,f;f=b[d];d++)if(f.rel.indexOf("stylesheet")!==-1)for(var g=0;g<e.length;g++){var h=e[g];if(f.href.substring(f.href.length-h.length)===h){c[f.href]=true;a[h]=true}}for(d=0;f=b[d];d++)if(f.rel.indexOf("stylesheet")!==-1)f.disabled=!(f.href in c);for(g=0;g<e.length;g++){h=e[g];if(!(h in a)){f=this.win.document.createElement("link");f.rel="stylesheet";f.type="text/css";f.href= h;this.win.document.getElementsByTagName("head")[0].appendChild(f)}}},setTextWrapping:function(e){if(e!=this.options.textWrapping){this.win.document.body.style.whiteSpace=e?"":"nowrap";this.options.textWrapping=e;if(this.lineNumbers){this.setLineNumbers(false);this.setLineNumbers(true)}}},setIndentUnit:function(e){this.win.indentUnit=e},setUndoDepth:function(e){this.editor.history.maxDepth=e},setTabMode:function(e){this.options.tabMode=e},setEnterMode:function(e){this.options.enterMode=e},setLineNumbers:function(e){if(e&& | a},setStylesheet:function(a){if(typeof a==="string")a=[a];for(var b={},c={},e=this.win.document.getElementsByTagName("link"),g=0,d;d=e[g];g++)if(d.rel.indexOf("stylesheet")!==-1)for(var f=0;f<a.length;f++){var m=a[f];if(d.href.substring(d.href.length-m.length)===m){b[d.href]=true;c[m]=true}}for(g=0;d=e[g];g++)if(d.rel.indexOf("stylesheet")!==-1)d.disabled=!(d.href in b);for(f=0;f<a.length;f++){m=a[f];if(!(m in c)){d=this.win.document.createElement("link");d.rel="stylesheet";d.type="text/css";d.href= m;this.win.document.getElementsByTagName("head")[0].appendChild(d)}}},setTextWrapping:function(a){if(a!=this.options.textWrapping){this.win.document.body.style.whiteSpace=a?"":"nowrap";this.options.textWrapping=a;if(this.lineNumbers){this.setLineNumbers(false);this.setLineNumbers(true)}}},setIndentUnit:function(a){this.win.indentUnit=a},setUndoDepth:function(a){this.editor.history.maxDepth=a},setTabMode:function(a){this.options.tabMode=a},setEnterMode:function(a){this.options.enterMode=a},setLineNumbers:function(a){if(a&& | e},setStylesheet:function(e){if(typeof e==="string")e=[e];for(var c={},a={},b=this.win.document.getElementsByTagName("link"),d=0,f;f=b[d];d++)if(f.rel.indexOf("stylesheet")!==-1)for(var g=0;g<e.length;g++){var h=e[g];if(f.href.substring(f.href.length-h.length)===h){c[f.href]=true;a[h]=true}}for(d=0;f=b[d];d++)if(f.rel.indexOf("stylesheet")!==-1)f.disabled=!(f.href in c);for(g=0;g<e.length;g++){h=e[g];if(!(h in a)){f=this.win.document.createElement("link");f.rel="stylesheet";f.type="text/css";f.href=h;this.win.document.getElementsByTagName("head")[0].appendChild(f)}}},setTextWrapping:function(e){if(e!=this.options.textWrapping){this.win.document.body.style.whiteSpace=e?"":"nowrap";this.options.textWrapping=e;if(this.lineNumbers){this.setLineNumbers(false);this.setLineNumbers(true)}}},setIndentUnit:function(e){this.win.indentUnit=e},setUndoDepth:function(e){this.editor.history.maxDepth=e},setTabMode:function(e){this.options.tabMode=e},setEnterMode:function(e){this.options.enterMode=e},setLineNumbers:function(e){if(e&& |
memo[tag.toUpperCase()] = tag; | if(tag) memo[tag.toUpperCase()] = tag; | setSuggestions: function(res){ var self = this; var memo = res.tags.reduce(function(memo, tag){ memo[tag.toUpperCase()] = tag; return memo; }, {}); var sg = $('suggestions'); var df = $DF(); var suggestions = {}; ['recommended', 'popular'].forEach(function(prop){ res[prop].forEach(function(cand){ var upCand = cand.toUpperCase(); if(!(upCand in suggestions)){ suggestions[upCand] = true; if(upCand in memo){ cand = memo[upCand]; var sug = $N('p', { class: 'suggestion listed' }, cand); } else { var sug = $N('p', { class: 'suggestion' }, cand); } self.elmTags[cand] = sug; connect(sug, 'onclick', cand, function(ev){ if(hasElementClass(sug, 'used')){ self.removeWord(cand); removeElementClass(sug, 'used'); } else { self.injectCandidates(cand, true); } }); df.appendChild(sug); } }); }); sg.appendChild(df); this.refreshCheck(); }, |
if (value) services.get("debugger").on(); | if (value) { if (!services.get("debugger").isOn) services.get("debugger").asyncOn(null); } | setter: function (value) { if (value) services.get("debugger").on(); else services.get("debugger").off(); }, |
setter: function (value) { options.safeSetPref("accessibility.typeaheadfind.enablesound", !value, "See 'visualbell' option"); return value; | setter: function (opts) { let classes = [v[1] for ([k, v] in Iterator(this.opts)) if (opts.indexOf(k) < 0)]; styles.addSheet(true, "taboptions", "chrome: classes.length ? classes.join(",") + "{ display: none; }" : ""); tabs.tabBinding.enabled = Array.some(opts, function (k) k in this.opts, this); statusline.updateTabCount(); | setter: function (value) { options.safeSetPref("accessibility.typeaheadfind.enablesound", !value, "See 'visualbell' option"); return value; } |
let [open, restriction] = [1, 0]; | let open = 1, restriction = 0; | setter: function (values) { let [open, restriction] = [1, 0]; for (let [, opt] in Iterator(values)) { if (opt == "tab") open = 3; else if (opt == "window") open = 2; else if (opt == "resized") restriction = 2; } prefs.safeSet("browser.link.open_newwindow", open, "See 'popups' option."); prefs.safeSet("browser.link.open_newwindow.restriction", restriction, "See 'popups' option."); return values; }, |
val instanceof Number){ | val instanceof Number || val === null){ | function setter(key, def, target){ var val = def[key]; var res = typeof(val); if(Array.isArray(val)){ if(!(target[key])) target[key] = []; for(var i = 0, l = val.length; i < l; ++i){ setter(i, val, target[key]); } } else { switch(res){ case 'string': case 'number': case 'function': case 'boolean': target[key] = val; break; default: if(val instanceof Date || val instanceof RegExp || val instanceof String || val instanceof Number){ target[key] = val; } else { if(!(target[key])) target[key] = {}; Object.keys(val).forEach(function(k){ setter(k, val, target[key]); }); } } } } |
el = $.id(el); text = String(text); if ('textContent' in el) { el.textContent = text; } else if ('innerText' in el) { el.innerText = text.replace(/\n/g, ' '); } else { el.innerHTML = ''; el.appendChild(document.createTextNode(text)); | el = $.id(el); text = String(text); if ('textContent' in el) { el.textContent = text; } else if ('innerText' in el) { el.innerText = text.replace(/\n/g, ' '); } else { el.innerHTML = ''; el.appendChild(document.createTextNode(text)); } | $.setText = function(el, text) { el = $.id(el); text = String(text); if ('textContent' in el) { el.textContent = text; } else if ('innerText' in el) { el.innerText = text.replace(/\n/g, ' '); } else { el.innerHTML = ''; el.appendChild(document.createTextNode(text)); }} |
} | $.setText = function(el, text) { el = $.id(el); text = String(text); if ('textContent' in el) { el.textContent = text; } else if ('innerText' in el) { el.innerText = text.replace(/\n/g, ' '); } else { el.innerHTML = ''; el.appendChild(document.createTextNode(text)); }} |
|
setup: function(){ jQuery.event.add( this, orig, withinElement, fix ); }, | event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},proxy:function(fn,proxy){proxy=proxy||function(){return fn.apply(this,arguments);};proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy;},special:{ready:{setup:bindReady,teardown:function(){}}},specialAll:{live:{setup:function(selector,namespaces){jQuery.event.add(this,namespaces[0],liveHandler);},teardown:function(namespaces){if(namespaces.length){var remove=0,name=RegExp("(^|\\.)"+namespaces[0]+"(\\.|$)");jQuery.each((jQuery.data(this,"events").live||{}),function(){if(name.test(this.type)) | setup: function(){ jQuery.event.add( this, orig, withinElement, fix ); }, |
statechart = Ki.Statechart.create({ | statechart = SC.Statechart.create({ | setup: function() { statechart = Ki.Statechart.create({ monitorIsActive: YES, rootState: Ki.State.design({ initialSubstate: 'x', x: Ki.State.design({ substatesAreConcurrent: YES, a: Ki.State.design({ initialSubstate: 'c', eventAInvoked: NO, eventA: function() { this.set('eventAInvoked', YES); }, c: Ki.State.design({ eventB: function() { this.gotoState('d'); }, eventD: function() { this.gotoState('y'); } }), d: Ki.State.design({ eventC: function() { this.gotoState('c'); } }) }), b: Ki.State.design({ initialSubstate: 'e', eventAInvoked: NO, eventA: function() { this.set('eventAInvoked', YES); }, e: Ki.State.design({ eventB: function() { this.gotoState('f'); }, eventD: function() { this.gotoState('y'); } }), f: Ki.State.design({ eventC: function() { this.gotoState('e'); } }) }) }), y: Ki.State.design() }) }); statechart.initStatechart(); }, |
rootState: Ki.State.design({ | rootState: SC.State.design({ | setup: function() { statechart = Ki.Statechart.create({ monitorIsActive: YES, rootState: Ki.State.design({ initialSubstate: 'x', x: Ki.State.design({ substatesAreConcurrent: YES, a: Ki.State.design({ initialSubstate: 'c', eventAInvoked: NO, eventA: function() { this.set('eventAInvoked', YES); }, c: Ki.State.design({ eventB: function() { this.gotoState('d'); }, eventD: function() { this.gotoState('y'); } }), d: Ki.State.design({ eventC: function() { this.gotoState('c'); } }) }), b: Ki.State.design({ initialSubstate: 'e', eventAInvoked: NO, eventA: function() { this.set('eventAInvoked', YES); }, e: Ki.State.design({ eventB: function() { this.gotoState('f'); }, eventD: function() { this.gotoState('y'); } }), f: Ki.State.design({ eventC: function() { this.gotoState('e'); } }) }) }), y: Ki.State.design() }) }); statechart.initStatechart(); }, |
x: Ki.State.design({ | x: SC.State.design({ | setup: function() { statechart = Ki.Statechart.create({ monitorIsActive: YES, rootState: Ki.State.design({ initialSubstate: 'x', x: Ki.State.design({ substatesAreConcurrent: YES, a: Ki.State.design({ initialSubstate: 'c', eventAInvoked: NO, eventA: function() { this.set('eventAInvoked', YES); }, c: Ki.State.design({ eventB: function() { this.gotoState('d'); }, eventD: function() { this.gotoState('y'); } }), d: Ki.State.design({ eventC: function() { this.gotoState('c'); } }) }), b: Ki.State.design({ initialSubstate: 'e', eventAInvoked: NO, eventA: function() { this.set('eventAInvoked', YES); }, e: Ki.State.design({ eventB: function() { this.gotoState('f'); }, eventD: function() { this.gotoState('y'); } }), f: Ki.State.design({ eventC: function() { this.gotoState('e'); } }) }) }), y: Ki.State.design() }) }); statechart.initStatechart(); }, |
a: Ki.State.design({ | a: SC.State.design({ | setup: function() { statechart = Ki.Statechart.create({ monitorIsActive: YES, rootState: Ki.State.design({ initialSubstate: 'x', x: Ki.State.design({ substatesAreConcurrent: YES, a: Ki.State.design({ initialSubstate: 'c', eventAInvoked: NO, eventA: function() { this.set('eventAInvoked', YES); }, c: Ki.State.design({ eventB: function() { this.gotoState('d'); }, eventD: function() { this.gotoState('y'); } }), d: Ki.State.design({ eventC: function() { this.gotoState('c'); } }) }), b: Ki.State.design({ initialSubstate: 'e', eventAInvoked: NO, eventA: function() { this.set('eventAInvoked', YES); }, e: Ki.State.design({ eventB: function() { this.gotoState('f'); }, eventD: function() { this.gotoState('y'); } }), f: Ki.State.design({ eventC: function() { this.gotoState('e'); } }) }) }), y: Ki.State.design() }) }); statechart.initStatechart(); }, |
c: Ki.State.design({ | c: SC.State.design({ | setup: function() { statechart = Ki.Statechart.create({ monitorIsActive: YES, rootState: Ki.State.design({ initialSubstate: 'x', x: Ki.State.design({ substatesAreConcurrent: YES, a: Ki.State.design({ initialSubstate: 'c', eventAInvoked: NO, eventA: function() { this.set('eventAInvoked', YES); }, c: Ki.State.design({ eventB: function() { this.gotoState('d'); }, eventD: function() { this.gotoState('y'); } }), d: Ki.State.design({ eventC: function() { this.gotoState('c'); } }) }), b: Ki.State.design({ initialSubstate: 'e', eventAInvoked: NO, eventA: function() { this.set('eventAInvoked', YES); }, e: Ki.State.design({ eventB: function() { this.gotoState('f'); }, eventD: function() { this.gotoState('y'); } }), f: Ki.State.design({ eventC: function() { this.gotoState('e'); } }) }) }), y: Ki.State.design() }) }); statechart.initStatechart(); }, |
d: Ki.State.design({ | d: SC.State.design({ | setup: function() { statechart = Ki.Statechart.create({ monitorIsActive: YES, rootState: Ki.State.design({ initialSubstate: 'x', x: Ki.State.design({ substatesAreConcurrent: YES, a: Ki.State.design({ initialSubstate: 'c', eventAInvoked: NO, eventA: function() { this.set('eventAInvoked', YES); }, c: Ki.State.design({ eventB: function() { this.gotoState('d'); }, eventD: function() { this.gotoState('y'); } }), d: Ki.State.design({ eventC: function() { this.gotoState('c'); } }) }), b: Ki.State.design({ initialSubstate: 'e', eventAInvoked: NO, eventA: function() { this.set('eventAInvoked', YES); }, e: Ki.State.design({ eventB: function() { this.gotoState('f'); }, eventD: function() { this.gotoState('y'); } }), f: Ki.State.design({ eventC: function() { this.gotoState('e'); } }) }) }), y: Ki.State.design() }) }); statechart.initStatechart(); }, |
b: Ki.State.design({ | b: SC.State.design({ | setup: function() { statechart = Ki.Statechart.create({ monitorIsActive: YES, rootState: Ki.State.design({ initialSubstate: 'x', x: Ki.State.design({ substatesAreConcurrent: YES, a: Ki.State.design({ initialSubstate: 'c', eventAInvoked: NO, eventA: function() { this.set('eventAInvoked', YES); }, c: Ki.State.design({ eventB: function() { this.gotoState('d'); }, eventD: function() { this.gotoState('y'); } }), d: Ki.State.design({ eventC: function() { this.gotoState('c'); } }) }), b: Ki.State.design({ initialSubstate: 'e', eventAInvoked: NO, eventA: function() { this.set('eventAInvoked', YES); }, e: Ki.State.design({ eventB: function() { this.gotoState('f'); }, eventD: function() { this.gotoState('y'); } }), f: Ki.State.design({ eventC: function() { this.gotoState('e'); } }) }) }), y: Ki.State.design() }) }); statechart.initStatechart(); }, |
e: Ki.State.design({ | e: SC.State.design({ | setup: function() { statechart = Ki.Statechart.create({ monitorIsActive: YES, rootState: Ki.State.design({ initialSubstate: 'x', x: Ki.State.design({ substatesAreConcurrent: YES, a: Ki.State.design({ initialSubstate: 'c', eventAInvoked: NO, eventA: function() { this.set('eventAInvoked', YES); }, c: Ki.State.design({ eventB: function() { this.gotoState('d'); }, eventD: function() { this.gotoState('y'); } }), d: Ki.State.design({ eventC: function() { this.gotoState('c'); } }) }), b: Ki.State.design({ initialSubstate: 'e', eventAInvoked: NO, eventA: function() { this.set('eventAInvoked', YES); }, e: Ki.State.design({ eventB: function() { this.gotoState('f'); }, eventD: function() { this.gotoState('y'); } }), f: Ki.State.design({ eventC: function() { this.gotoState('e'); } }) }) }), y: Ki.State.design() }) }); statechart.initStatechart(); }, |
f: Ki.State.design({ | f: SC.State.design({ | setup: function() { statechart = Ki.Statechart.create({ monitorIsActive: YES, rootState: Ki.State.design({ initialSubstate: 'x', x: Ki.State.design({ substatesAreConcurrent: YES, a: Ki.State.design({ initialSubstate: 'c', eventAInvoked: NO, eventA: function() { this.set('eventAInvoked', YES); }, c: Ki.State.design({ eventB: function() { this.gotoState('d'); }, eventD: function() { this.gotoState('y'); } }), d: Ki.State.design({ eventC: function() { this.gotoState('c'); } }) }), b: Ki.State.design({ initialSubstate: 'e', eventAInvoked: NO, eventA: function() { this.set('eventAInvoked', YES); }, e: Ki.State.design({ eventB: function() { this.gotoState('f'); }, eventD: function() { this.gotoState('y'); } }), f: Ki.State.design({ eventC: function() { this.gotoState('e'); } }) }) }), y: Ki.State.design() }) }); statechart.initStatechart(); }, |
y: Ki.State.design() | y: SC.State.design() | setup: function() { statechart = Ki.Statechart.create({ monitorIsActive: YES, rootState: Ki.State.design({ initialSubstate: 'x', x: Ki.State.design({ substatesAreConcurrent: YES, a: Ki.State.design({ initialSubstate: 'c', eventAInvoked: NO, eventA: function() { this.set('eventAInvoked', YES); }, c: Ki.State.design({ eventB: function() { this.gotoState('d'); }, eventD: function() { this.gotoState('y'); } }), d: Ki.State.design({ eventC: function() { this.gotoState('c'); } }) }), b: Ki.State.design({ initialSubstate: 'e', eventAInvoked: NO, eventA: function() { this.set('eventAInvoked', YES); }, e: Ki.State.design({ eventB: function() { this.gotoState('f'); }, eventD: function() { this.gotoState('y'); } }), f: Ki.State.design({ eventC: function() { this.gotoState('e'); } }) }) }), y: Ki.State.design() }) }); statechart.initStatechart(); }, |
rect1 = elem.getBoundingClientRect(); | rect1 = boundingRect(elem); | setup: function() { SC.RunLoop.begin(); pane = SC.MainPane.create({ childViews: [ SC.SegmentedView.extend({ items: [ { value: "Item1", icon: iconURL }, { value: "Item2", icon: iconURL }, { value: "Item3", icon: iconURL }], itemTitleKey: 'value', itemValueKey: 'value', itemIconKey: 'icon', value: "Item1 Item3".w(), allowsEmptySelection: NO, layout: { height: 25 } })] }); pane.append(); // make sure there is a layer... SC.RunLoop.end(); view = pane.childViews[0]; elem = view.get('layer').childNodes[0]; rect1 = elem.getBoundingClientRect(); elem = view.get('layer').childNodes[1]; rect2 = elem.getBoundingClientRect(); elem = view.get('layer').childNodes[2]; rect3 = elem.getBoundingClientRect(); }, |
rect2 = elem.getBoundingClientRect(); | rect2 = boundingRect(elem); | setup: function() { SC.RunLoop.begin(); pane = SC.MainPane.create({ childViews: [ SC.SegmentedView.extend({ items: [ { value: "Item1", icon: iconURL }, { value: "Item2", icon: iconURL }, { value: "Item3", icon: iconURL }], itemTitleKey: 'value', itemValueKey: 'value', itemIconKey: 'icon', value: "Item1 Item3".w(), allowsEmptySelection: NO, layout: { height: 25 } })] }); pane.append(); // make sure there is a layer... SC.RunLoop.end(); view = pane.childViews[0]; elem = view.get('layer').childNodes[0]; rect1 = elem.getBoundingClientRect(); elem = view.get('layer').childNodes[1]; rect2 = elem.getBoundingClientRect(); elem = view.get('layer').childNodes[2]; rect3 = elem.getBoundingClientRect(); }, |
rect3 = elem.getBoundingClientRect(); | rect3 = boundingRect(elem); | setup: function() { SC.RunLoop.begin(); pane = SC.MainPane.create({ childViews: [ SC.SegmentedView.extend({ items: [ { value: "Item1", icon: iconURL }, { value: "Item2", icon: iconURL }, { value: "Item3", icon: iconURL }], itemTitleKey: 'value', itemValueKey: 'value', itemIconKey: 'icon', value: "Item1 Item3".w(), allowsEmptySelection: NO, layout: { height: 25 } })] }); pane.append(); // make sure there is a layer... SC.RunLoop.end(); view = pane.childViews[0]; elem = view.get('layer').childNodes[0]; rect1 = elem.getBoundingClientRect(); elem = view.get('layer').childNodes[1]; rect2 = elem.getBoundingClientRect(); elem = view.get('layer').childNodes[2]; rect3 = elem.getBoundingClientRect(); }, |
statechart = Ki.Statechart.create({ | statechart = SC.Statechart.create({ | setup: function() { statechart = Ki.Statechart.create({ monitorIsActive: YES, rootState: Ki.State.design({ initialSubstate: 'a', a: Ki.State.design({ initialSubstate: 'b', b: Ki.State.design({ eventC: function() { this.gotoState('c'); }, eventD: function() { this.gotoState('d'); }, eventE: function() { this.gotoState('e'); }, eventX: function() { this.gotoState('x'); } }), c: Ki.State.design({ enterState: function() { this.gotoState('z'); } }), d: Ki.State.design({ enterState: function() { this.gotoState('c'); } }), e: Ki.State.design({ enterState: function() { this.gotoState('f'); } }), f: Ki.State.design(), g: Ki.State.design({ initialSubstate: 'x', foo: function() { /* no-op */ }, enterState: function() { return this.performAsync('foo'); }, x: Ki.State.design({ enterState: function() { this.gotoState('h'); } }) }), h: Ki.State.design() }), z: Ki.State.design() }) }); statechart.initStatechart(); }, |
rootState: Ki.State.design({ | rootState: SC.State.design({ | setup: function() { statechart = Ki.Statechart.create({ monitorIsActive: YES, rootState: Ki.State.design({ initialSubstate: 'a', a: Ki.State.design({ initialSubstate: 'b', b: Ki.State.design({ eventC: function() { this.gotoState('c'); }, eventD: function() { this.gotoState('d'); }, eventE: function() { this.gotoState('e'); }, eventX: function() { this.gotoState('x'); } }), c: Ki.State.design({ enterState: function() { this.gotoState('z'); } }), d: Ki.State.design({ enterState: function() { this.gotoState('c'); } }), e: Ki.State.design({ enterState: function() { this.gotoState('f'); } }), f: Ki.State.design(), g: Ki.State.design({ initialSubstate: 'x', foo: function() { /* no-op */ }, enterState: function() { return this.performAsync('foo'); }, x: Ki.State.design({ enterState: function() { this.gotoState('h'); } }) }), h: Ki.State.design() }), z: Ki.State.design() }) }); statechart.initStatechart(); }, |
a: Ki.State.design({ | a: SC.State.design({ | setup: function() { statechart = Ki.Statechart.create({ monitorIsActive: YES, rootState: Ki.State.design({ initialSubstate: 'a', a: Ki.State.design({ initialSubstate: 'b', b: Ki.State.design({ eventC: function() { this.gotoState('c'); }, eventD: function() { this.gotoState('d'); }, eventE: function() { this.gotoState('e'); }, eventX: function() { this.gotoState('x'); } }), c: Ki.State.design({ enterState: function() { this.gotoState('z'); } }), d: Ki.State.design({ enterState: function() { this.gotoState('c'); } }), e: Ki.State.design({ enterState: function() { this.gotoState('f'); } }), f: Ki.State.design(), g: Ki.State.design({ initialSubstate: 'x', foo: function() { /* no-op */ }, enterState: function() { return this.performAsync('foo'); }, x: Ki.State.design({ enterState: function() { this.gotoState('h'); } }) }), h: Ki.State.design() }), z: Ki.State.design() }) }); statechart.initStatechart(); }, |
b: Ki.State.design({ | b: SC.State.design({ | setup: function() { statechart = Ki.Statechart.create({ monitorIsActive: YES, rootState: Ki.State.design({ initialSubstate: 'a', a: Ki.State.design({ initialSubstate: 'b', b: Ki.State.design({ eventC: function() { this.gotoState('c'); }, eventD: function() { this.gotoState('d'); }, eventE: function() { this.gotoState('e'); }, eventX: function() { this.gotoState('x'); } }), c: Ki.State.design({ enterState: function() { this.gotoState('z'); } }), d: Ki.State.design({ enterState: function() { this.gotoState('c'); } }), e: Ki.State.design({ enterState: function() { this.gotoState('f'); } }), f: Ki.State.design(), g: Ki.State.design({ initialSubstate: 'x', foo: function() { /* no-op */ }, enterState: function() { return this.performAsync('foo'); }, x: Ki.State.design({ enterState: function() { this.gotoState('h'); } }) }), h: Ki.State.design() }), z: Ki.State.design() }) }); statechart.initStatechart(); }, |
c: Ki.State.design({ | c: SC.State.design({ | setup: function() { statechart = Ki.Statechart.create({ monitorIsActive: YES, rootState: Ki.State.design({ initialSubstate: 'a', a: Ki.State.design({ initialSubstate: 'b', b: Ki.State.design({ eventC: function() { this.gotoState('c'); }, eventD: function() { this.gotoState('d'); }, eventE: function() { this.gotoState('e'); }, eventX: function() { this.gotoState('x'); } }), c: Ki.State.design({ enterState: function() { this.gotoState('z'); } }), d: Ki.State.design({ enterState: function() { this.gotoState('c'); } }), e: Ki.State.design({ enterState: function() { this.gotoState('f'); } }), f: Ki.State.design(), g: Ki.State.design({ initialSubstate: 'x', foo: function() { /* no-op */ }, enterState: function() { return this.performAsync('foo'); }, x: Ki.State.design({ enterState: function() { this.gotoState('h'); } }) }), h: Ki.State.design() }), z: Ki.State.design() }) }); statechart.initStatechart(); }, |
d: Ki.State.design({ | d: SC.State.design({ | setup: function() { statechart = Ki.Statechart.create({ monitorIsActive: YES, rootState: Ki.State.design({ initialSubstate: 'a', a: Ki.State.design({ initialSubstate: 'b', b: Ki.State.design({ eventC: function() { this.gotoState('c'); }, eventD: function() { this.gotoState('d'); }, eventE: function() { this.gotoState('e'); }, eventX: function() { this.gotoState('x'); } }), c: Ki.State.design({ enterState: function() { this.gotoState('z'); } }), d: Ki.State.design({ enterState: function() { this.gotoState('c'); } }), e: Ki.State.design({ enterState: function() { this.gotoState('f'); } }), f: Ki.State.design(), g: Ki.State.design({ initialSubstate: 'x', foo: function() { /* no-op */ }, enterState: function() { return this.performAsync('foo'); }, x: Ki.State.design({ enterState: function() { this.gotoState('h'); } }) }), h: Ki.State.design() }), z: Ki.State.design() }) }); statechart.initStatechart(); }, |
e: Ki.State.design({ | e: SC.State.design({ | setup: function() { statechart = Ki.Statechart.create({ monitorIsActive: YES, rootState: Ki.State.design({ initialSubstate: 'a', a: Ki.State.design({ initialSubstate: 'b', b: Ki.State.design({ eventC: function() { this.gotoState('c'); }, eventD: function() { this.gotoState('d'); }, eventE: function() { this.gotoState('e'); }, eventX: function() { this.gotoState('x'); } }), c: Ki.State.design({ enterState: function() { this.gotoState('z'); } }), d: Ki.State.design({ enterState: function() { this.gotoState('c'); } }), e: Ki.State.design({ enterState: function() { this.gotoState('f'); } }), f: Ki.State.design(), g: Ki.State.design({ initialSubstate: 'x', foo: function() { /* no-op */ }, enterState: function() { return this.performAsync('foo'); }, x: Ki.State.design({ enterState: function() { this.gotoState('h'); } }) }), h: Ki.State.design() }), z: Ki.State.design() }) }); statechart.initStatechart(); }, |
f: Ki.State.design(), | f: SC.State.design(), | setup: function() { statechart = Ki.Statechart.create({ monitorIsActive: YES, rootState: Ki.State.design({ initialSubstate: 'a', a: Ki.State.design({ initialSubstate: 'b', b: Ki.State.design({ eventC: function() { this.gotoState('c'); }, eventD: function() { this.gotoState('d'); }, eventE: function() { this.gotoState('e'); }, eventX: function() { this.gotoState('x'); } }), c: Ki.State.design({ enterState: function() { this.gotoState('z'); } }), d: Ki.State.design({ enterState: function() { this.gotoState('c'); } }), e: Ki.State.design({ enterState: function() { this.gotoState('f'); } }), f: Ki.State.design(), g: Ki.State.design({ initialSubstate: 'x', foo: function() { /* no-op */ }, enterState: function() { return this.performAsync('foo'); }, x: Ki.State.design({ enterState: function() { this.gotoState('h'); } }) }), h: Ki.State.design() }), z: Ki.State.design() }) }); statechart.initStatechart(); }, |
g: Ki.State.design({ | g: SC.State.design({ | setup: function() { statechart = Ki.Statechart.create({ monitorIsActive: YES, rootState: Ki.State.design({ initialSubstate: 'a', a: Ki.State.design({ initialSubstate: 'b', b: Ki.State.design({ eventC: function() { this.gotoState('c'); }, eventD: function() { this.gotoState('d'); }, eventE: function() { this.gotoState('e'); }, eventX: function() { this.gotoState('x'); } }), c: Ki.State.design({ enterState: function() { this.gotoState('z'); } }), d: Ki.State.design({ enterState: function() { this.gotoState('c'); } }), e: Ki.State.design({ enterState: function() { this.gotoState('f'); } }), f: Ki.State.design(), g: Ki.State.design({ initialSubstate: 'x', foo: function() { /* no-op */ }, enterState: function() { return this.performAsync('foo'); }, x: Ki.State.design({ enterState: function() { this.gotoState('h'); } }) }), h: Ki.State.design() }), z: Ki.State.design() }) }); statechart.initStatechart(); }, |
x: Ki.State.design({ | x: SC.State.design({ | setup: function() { statechart = Ki.Statechart.create({ monitorIsActive: YES, rootState: Ki.State.design({ initialSubstate: 'a', a: Ki.State.design({ initialSubstate: 'b', b: Ki.State.design({ eventC: function() { this.gotoState('c'); }, eventD: function() { this.gotoState('d'); }, eventE: function() { this.gotoState('e'); }, eventX: function() { this.gotoState('x'); } }), c: Ki.State.design({ enterState: function() { this.gotoState('z'); } }), d: Ki.State.design({ enterState: function() { this.gotoState('c'); } }), e: Ki.State.design({ enterState: function() { this.gotoState('f'); } }), f: Ki.State.design(), g: Ki.State.design({ initialSubstate: 'x', foo: function() { /* no-op */ }, enterState: function() { return this.performAsync('foo'); }, x: Ki.State.design({ enterState: function() { this.gotoState('h'); } }) }), h: Ki.State.design() }), z: Ki.State.design() }) }); statechart.initStatechart(); }, |
h: Ki.State.design() | h: SC.State.design() | setup: function() { statechart = Ki.Statechart.create({ monitorIsActive: YES, rootState: Ki.State.design({ initialSubstate: 'a', a: Ki.State.design({ initialSubstate: 'b', b: Ki.State.design({ eventC: function() { this.gotoState('c'); }, eventD: function() { this.gotoState('d'); }, eventE: function() { this.gotoState('e'); }, eventX: function() { this.gotoState('x'); } }), c: Ki.State.design({ enterState: function() { this.gotoState('z'); } }), d: Ki.State.design({ enterState: function() { this.gotoState('c'); } }), e: Ki.State.design({ enterState: function() { this.gotoState('f'); } }), f: Ki.State.design(), g: Ki.State.design({ initialSubstate: 'x', foo: function() { /* no-op */ }, enterState: function() { return this.performAsync('foo'); }, x: Ki.State.design({ enterState: function() { this.gotoState('h'); } }) }), h: Ki.State.design() }), z: Ki.State.design() }) }); statechart.initStatechart(); }, |
z: Ki.State.design() | z: SC.State.design() | setup: function() { statechart = Ki.Statechart.create({ monitorIsActive: YES, rootState: Ki.State.design({ initialSubstate: 'a', a: Ki.State.design({ initialSubstate: 'b', b: Ki.State.design({ eventC: function() { this.gotoState('c'); }, eventD: function() { this.gotoState('d'); }, eventE: function() { this.gotoState('e'); }, eventX: function() { this.gotoState('x'); } }), c: Ki.State.design({ enterState: function() { this.gotoState('z'); } }), d: Ki.State.design({ enterState: function() { this.gotoState('c'); } }), e: Ki.State.design({ enterState: function() { this.gotoState('f'); } }), f: Ki.State.design(), g: Ki.State.design({ initialSubstate: 'x', foo: function() { /* no-op */ }, enterState: function() { return this.performAsync('foo'); }, x: Ki.State.design({ enterState: function() { this.gotoState('h'); } }) }), h: Ki.State.design() }), z: Ki.State.design() }) }); statechart.initStatechart(); }, |
viewSettingsWithChildren = { childViews: "child1 child2 child3 child4".w(), child1: SC.View.extend({ classNames: "test-child test-1".w() }), child2: SC.View.extend({ classNames: "test-child test-2".w(), render: function(context, firstTime) { if (firstTime) { context.push("<a class='test-2-content'>content</a>"); } } }), child3: SC.View.extend({ classNames: "test-child test-3".w(), render: function(context, firstTime) { this.didReceiveRender = YES; this.didReceiveRenderFirstTime = firstTime; if (firstTime) context.push("<a class='test-3-content'>content</a>"); else context.push("<a class='test-3-content'>content-updated</a>") } }), child4: SC.View.extend({ classNames: "test-child test-4".w(), render: function(context, firstTime) { this.didReceiveRender = YES; this.didReceiveRenderFirstTime = firstTime; if (firstTime) { context.push("<a class='test-4-content'>content</a>"); } else { this.$(".test-4-content").text("content-updated"); } } }) }; | setup: function() { testRenderer = SC.Renderer.extend({ render: function(context) { this.didRender = YES; context.attr("alt", "test"); context.push("<a class='test'>Hello</a>"); }, update: function() { this.didUpdate = YES; this.$().attr("title", "test"); this.$(".test").text("Hi"); }, didAttachLayer: function(layer) { this.layerWasAttached = YES; this.layerAttached = layer; } }).create(); expected_theme = SC.Theme.find("sc-test"); rendererView = SC.View.extend({ theme: "sc-test", // the create renderer test createRenderer: function(theme) { this.createRendererWasCalled = YES; equals(theme, expected_theme, "the correct theme was passed"); this.rendererInstance = testRenderer(); return this.rendererInstance; }, updateRenderer: function(r) { this.updateRendererWasCalled = YES; equals(r, this.rendererInstance, "Renderer should be the one we created"); } }); renderView = SC.View.extend({ render: function(context, firstTime) { if (firstTime) { context.push("<a class='test'>Hello</a>"); } else { context.attr("title", "test"); this.$(".test").text("Hi"); } } }); renderSkipUpdateView = SC.View.extend({ render: function(context, firstTime) { if (firstTime) { context.push("<a class='test'>Hello</a>"); } } }); replacingRenderView = SC.View.extend({ render: function(context, firstTime) { if (firstTime) { context.push("<a class='test'>Hello</a>"); } else { context.push("<a class='test'>Hi</a>"); context.attr("title", "test"); } } }); }, |
|
mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ca:Ba,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ca:Ba)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(a,b,d){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit."+d.guid,function(f){var e=f.target,i=e.type;if((i==="submit"||i==="image")&&c(e).closest("form").length)return pa("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit."+ d.guid,function(f){var e=f.target,i=e.type;if((i==="text"||i==="password")&&c(e).closest("form").length&&f.keyCode===13)return pa("submit",this,arguments)})}else return false},remove:function(a,b){c.event.remove(this,"click.specialSubmit"+(b?"."+b.guid:""));c.event.remove(this,"keypress.specialSubmit"+(b?"."+b.guid:""))}};if(!c.support.changeBubbles){var ga=/textarea|input|select/i;function Da(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex> | {setup:function(){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length)return na("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13)return na("submit",this,arguments)})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}}; | mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ca:Ba,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ca:Ba)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(a,b,d){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit."+d.guid,function(f){var e=f.target,i=e.type;if((i==="submit"||i==="image")&&c(e).closest("form").length)return pa("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit."+d.guid,function(f){var e=f.target,i=e.type;if((i==="text"||i==="password")&&c(e).closest("form").length&&f.keyCode===13)return pa("submit",this,arguments)})}else return false},remove:function(a,b){c.event.remove(this,"click.specialSubmit"+(b?"."+b.guid:""));c.event.remove(this,"keypress.specialSubmit"+(b?"."+b.guid:""))}};if(!c.support.changeBubbles){var ga=/textarea|input|select/i;function Da(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex> |
statechart = Ki.Statechart.create({ | statechart = SC.Statechart.create({ | setup: function() { statechart = Ki.Statechart.create({ monitorIsActive: YES, rootState: Ki.State.design({ initialSubstate: 'a', a: Ki.State.design({ initialSubstate: 'c', c: Ki.State.design({ initialSubstate: 'g', g: Ki.State.design(), h: Ki.State.design() }), d: Ki.State.design({ initialSubstate: 'i', i: Ki.State.design(), j: Ki.State.design() }) }), b: Ki.State.design({ initialSubstate: 'e', e: Ki.State.design({ initialSubstate: 'k', k: Ki.State.design(), l: Ki.State.design() }), f: Ki.State.design({ initialSubstate: 'm', m: Ki.State.design(), n: Ki.State.design() }) }) }) }); statechart.initStatechart(); }, |
rootState: Ki.State.design({ | rootState: SC.State.design({ | setup: function() { statechart = Ki.Statechart.create({ monitorIsActive: YES, rootState: Ki.State.design({ initialSubstate: 'a', a: Ki.State.design({ initialSubstate: 'c', c: Ki.State.design({ initialSubstate: 'g', g: Ki.State.design(), h: Ki.State.design() }), d: Ki.State.design({ initialSubstate: 'i', i: Ki.State.design(), j: Ki.State.design() }) }), b: Ki.State.design({ initialSubstate: 'e', e: Ki.State.design({ initialSubstate: 'k', k: Ki.State.design(), l: Ki.State.design() }), f: Ki.State.design({ initialSubstate: 'm', m: Ki.State.design(), n: Ki.State.design() }) }) }) }); statechart.initStatechart(); }, |
a: Ki.State.design({ | a: SC.State.design({ | setup: function() { statechart = Ki.Statechart.create({ monitorIsActive: YES, rootState: Ki.State.design({ initialSubstate: 'a', a: Ki.State.design({ initialSubstate: 'c', c: Ki.State.design({ initialSubstate: 'g', g: Ki.State.design(), h: Ki.State.design() }), d: Ki.State.design({ initialSubstate: 'i', i: Ki.State.design(), j: Ki.State.design() }) }), b: Ki.State.design({ initialSubstate: 'e', e: Ki.State.design({ initialSubstate: 'k', k: Ki.State.design(), l: Ki.State.design() }), f: Ki.State.design({ initialSubstate: 'm', m: Ki.State.design(), n: Ki.State.design() }) }) }) }); statechart.initStatechart(); }, |
c: Ki.State.design({ | c: SC.State.design({ | setup: function() { statechart = Ki.Statechart.create({ monitorIsActive: YES, rootState: Ki.State.design({ initialSubstate: 'a', a: Ki.State.design({ initialSubstate: 'c', c: Ki.State.design({ initialSubstate: 'g', g: Ki.State.design(), h: Ki.State.design() }), d: Ki.State.design({ initialSubstate: 'i', i: Ki.State.design(), j: Ki.State.design() }) }), b: Ki.State.design({ initialSubstate: 'e', e: Ki.State.design({ initialSubstate: 'k', k: Ki.State.design(), l: Ki.State.design() }), f: Ki.State.design({ initialSubstate: 'm', m: Ki.State.design(), n: Ki.State.design() }) }) }) }); statechart.initStatechart(); }, |
g: Ki.State.design(), h: Ki.State.design() | g: SC.State.design(), h: SC.State.design() | setup: function() { statechart = Ki.Statechart.create({ monitorIsActive: YES, rootState: Ki.State.design({ initialSubstate: 'a', a: Ki.State.design({ initialSubstate: 'c', c: Ki.State.design({ initialSubstate: 'g', g: Ki.State.design(), h: Ki.State.design() }), d: Ki.State.design({ initialSubstate: 'i', i: Ki.State.design(), j: Ki.State.design() }) }), b: Ki.State.design({ initialSubstate: 'e', e: Ki.State.design({ initialSubstate: 'k', k: Ki.State.design(), l: Ki.State.design() }), f: Ki.State.design({ initialSubstate: 'm', m: Ki.State.design(), n: Ki.State.design() }) }) }) }); statechart.initStatechart(); }, |
d: Ki.State.design({ | d: SC.State.design({ | setup: function() { statechart = Ki.Statechart.create({ monitorIsActive: YES, rootState: Ki.State.design({ initialSubstate: 'a', a: Ki.State.design({ initialSubstate: 'c', c: Ki.State.design({ initialSubstate: 'g', g: Ki.State.design(), h: Ki.State.design() }), d: Ki.State.design({ initialSubstate: 'i', i: Ki.State.design(), j: Ki.State.design() }) }), b: Ki.State.design({ initialSubstate: 'e', e: Ki.State.design({ initialSubstate: 'k', k: Ki.State.design(), l: Ki.State.design() }), f: Ki.State.design({ initialSubstate: 'm', m: Ki.State.design(), n: Ki.State.design() }) }) }) }); statechart.initStatechart(); }, |
i: Ki.State.design(), j: Ki.State.design() | i: SC.State.design(), j: SC.State.design() | setup: function() { statechart = Ki.Statechart.create({ monitorIsActive: YES, rootState: Ki.State.design({ initialSubstate: 'a', a: Ki.State.design({ initialSubstate: 'c', c: Ki.State.design({ initialSubstate: 'g', g: Ki.State.design(), h: Ki.State.design() }), d: Ki.State.design({ initialSubstate: 'i', i: Ki.State.design(), j: Ki.State.design() }) }), b: Ki.State.design({ initialSubstate: 'e', e: Ki.State.design({ initialSubstate: 'k', k: Ki.State.design(), l: Ki.State.design() }), f: Ki.State.design({ initialSubstate: 'm', m: Ki.State.design(), n: Ki.State.design() }) }) }) }); statechart.initStatechart(); }, |
b: Ki.State.design({ | b: SC.State.design({ | setup: function() { statechart = Ki.Statechart.create({ monitorIsActive: YES, rootState: Ki.State.design({ initialSubstate: 'a', a: Ki.State.design({ initialSubstate: 'c', c: Ki.State.design({ initialSubstate: 'g', g: Ki.State.design(), h: Ki.State.design() }), d: Ki.State.design({ initialSubstate: 'i', i: Ki.State.design(), j: Ki.State.design() }) }), b: Ki.State.design({ initialSubstate: 'e', e: Ki.State.design({ initialSubstate: 'k', k: Ki.State.design(), l: Ki.State.design() }), f: Ki.State.design({ initialSubstate: 'm', m: Ki.State.design(), n: Ki.State.design() }) }) }) }); statechart.initStatechart(); }, |
e: Ki.State.design({ | e: SC.State.design({ | setup: function() { statechart = Ki.Statechart.create({ monitorIsActive: YES, rootState: Ki.State.design({ initialSubstate: 'a', a: Ki.State.design({ initialSubstate: 'c', c: Ki.State.design({ initialSubstate: 'g', g: Ki.State.design(), h: Ki.State.design() }), d: Ki.State.design({ initialSubstate: 'i', i: Ki.State.design(), j: Ki.State.design() }) }), b: Ki.State.design({ initialSubstate: 'e', e: Ki.State.design({ initialSubstate: 'k', k: Ki.State.design(), l: Ki.State.design() }), f: Ki.State.design({ initialSubstate: 'm', m: Ki.State.design(), n: Ki.State.design() }) }) }) }); statechart.initStatechart(); }, |
k: Ki.State.design(), l: Ki.State.design() | k: SC.State.design(), l: SC.State.design() | setup: function() { statechart = Ki.Statechart.create({ monitorIsActive: YES, rootState: Ki.State.design({ initialSubstate: 'a', a: Ki.State.design({ initialSubstate: 'c', c: Ki.State.design({ initialSubstate: 'g', g: Ki.State.design(), h: Ki.State.design() }), d: Ki.State.design({ initialSubstate: 'i', i: Ki.State.design(), j: Ki.State.design() }) }), b: Ki.State.design({ initialSubstate: 'e', e: Ki.State.design({ initialSubstate: 'k', k: Ki.State.design(), l: Ki.State.design() }), f: Ki.State.design({ initialSubstate: 'm', m: Ki.State.design(), n: Ki.State.design() }) }) }) }); statechart.initStatechart(); }, |
f: Ki.State.design({ | f: SC.State.design({ | setup: function() { statechart = Ki.Statechart.create({ monitorIsActive: YES, rootState: Ki.State.design({ initialSubstate: 'a', a: Ki.State.design({ initialSubstate: 'c', c: Ki.State.design({ initialSubstate: 'g', g: Ki.State.design(), h: Ki.State.design() }), d: Ki.State.design({ initialSubstate: 'i', i: Ki.State.design(), j: Ki.State.design() }) }), b: Ki.State.design({ initialSubstate: 'e', e: Ki.State.design({ initialSubstate: 'k', k: Ki.State.design(), l: Ki.State.design() }), f: Ki.State.design({ initialSubstate: 'm', m: Ki.State.design(), n: Ki.State.design() }) }) }) }); statechart.initStatechart(); }, |
m: Ki.State.design(), n: Ki.State.design() | m: SC.State.design(), n: SC.State.design() | setup: function() { statechart = Ki.Statechart.create({ monitorIsActive: YES, rootState: Ki.State.design({ initialSubstate: 'a', a: Ki.State.design({ initialSubstate: 'c', c: Ki.State.design({ initialSubstate: 'g', g: Ki.State.design(), h: Ki.State.design() }), d: Ki.State.design({ initialSubstate: 'i', i: Ki.State.design(), j: Ki.State.design() }) }), b: Ki.State.design({ initialSubstate: 'e', e: Ki.State.design({ initialSubstate: 'k', k: Ki.State.design(), l: Ki.State.design() }), f: Ki.State.design({ initialSubstate: 'm', m: Ki.State.design(), n: Ki.State.design() }) }) }) }); statechart.initStatechart(); }, |
context = SC.RenderContext().styles({ foo: 'foo' }) ; | context = SC.RenderContext() ; | setup: function() { context = SC.RenderContext().styles({ foo: 'foo' }) ; } |
setValue: function(element, value) { element = $(element); var method = element.tagName.toLowerCase(); Form.Element.Serializers[method](element, value); return element; }, | var Prototype={Version:"1.6.1",Browser:(function(){var b=navigator.userAgent;var a=Object.prototype.toString.call(window.opera)=="[object Opera]";return{IE:!!window.attachEvent&&!a,Opera:a,WebKit:b.indexOf("AppleWebKit/")>-1,Gecko:b.indexOf("Gecko")>-1&&b.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile.*Safari/.test(b)}})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var a=window.Element||window.HTMLElement;return !!(a&&a.prototype)})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=="undefined"){return true}var c=document.createElement("div");var b=document.createElement("form");var a=false;if(c.__proto__&&(c.__proto__!==b.__proto__)){a=true}c=b=null;return a})()},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Abstract={};var Try={these:function(){var c;for(var b=0,d=arguments.length;b<d;b++){var a=arguments[b];try{c=a();break}catch(f){}}return c}};var Class=(function(){function a(){}function b(){var g=null,f=$A(arguments);if(Object.isFunction(f[0])){g=f.shift()}function d(){this.initialize.apply(this,arguments)}Object.extend(d,Class.Methods);d.superclass=g;d.subclasses=[];if(g){a.prototype=g.prototype;d.prototype=new a;g.subclasses.push(d)}for(var e=0;e<f.length;e++){d.addMethods(f[e])}if(!d.prototype.initialize){d.prototype.initialize=Prototype.emptyFunction}d.prototype.constructor=d;return d}function c(k){var f=this.superclass&&this.superclass.prototype;var e=Object.keys(k);if(!Object.keys({toString:true}).length){if(k.toString!=Object.prototype.toString){e.push("toString")}if(k.valueOf!=Object.prototype.valueOf){e.push("valueOf")}}for(var d=0,g=e.length;d<g;d++){var j=e[d],h=k[j];if(f&&Object.isFunction(h)&&h.argumentNames().first()=="$super"){var l=h;h=(function(i){return function(){return f[i].apply(this,arguments)}})(j).wrap(l);h.valueOf=l.valueOf.bind(l);h.toString=l.toString.bind(l)}this.prototype[j]=h}return this}return{create:b,Methods:{addMethods:c}}})();(function(){var d=Object.prototype.toString;function i(q,s){for(var r in s){q[r]=s[r]}return q}function l(q){try{if(e(q)){return"undefined"}if(q===null){return"null"}return q.inspect?q.inspect():String(q)}catch(r){if(r instanceof RangeError){return"..."}throw r}}function k(q){var s=typeof q;switch(s){case"undefined":case"function":case"unknown":return;case"boolean":return q.toString()}if(q===null){return"null"}if(q.toJSON){return q.toJSON()}if(h(q)){return}var r=[];for(var u in q){var t=k(q[u]);if(!e(t)){r.push(u.toJSON()+": "+t)}}return"{"+r.join(", ")+"}"}function c(q){return $H(q).toQueryString()}function f(q){return q&&q.toHTML?q.toHTML():String.interpret(q)}function o(q){var r=[];for(var s in q){r.push(s)}return r}function m(q){var r=[];for(var s in q){r.push(q[s])}return r}function j(q){return i({},q)}function h(q){return !!(q&&q.nodeType==1)}function g(q){return d.call(q)=="[object Array]"}function p(q){return q instanceof Hash}function b(q){return typeof q==="function"}function a(q){return d.call(q)=="[object String]"}function n(q){return d.call(q)=="[object Number]"}function e(q){return typeof q==="undefined"}i(Object,{extend:i,inspect:l,toJSON:k,toQueryString:c,toHTML:f,keys:o,values:m,clone:j,isElement:h,isArray:g,isHash:p,isFunction:b,isString:a,isNumber:n,isUndefined:e})})();Object.extend(Function.prototype,(function(){var k=Array.prototype.slice;function d(o,l){var n=o.length,m=l.length;while(m--){o[n+m]=l[m]}return o}function i(m,l){m=k.call(m,0);return d(m,l)}function g(){var l=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\ | setValue: function(element, value) { element = $(element); var method = element.tagName.toLowerCase(); Form.Element.Serializers[method](element, value); return element; }, |
TBRL.Service.open(tab, ps); | TBRL.Popup.open(tab, ps); | share: function(req, sender, func){ getSelected().addCallback(function(tab){ var ps = req.content; if(req.show){ TBRL.Service.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){ }); }, |
maybeDeferred(ext.extract(ctx)) | return maybeDeferred(ext.extract(ctx)) | share: function(ctx, ext, show){ maybeDeferred(ext.extract(ctx)) .addCallback(function(ps){ chrome.extension.sendRequest(TBRL.id, { request: "share", show : show, content: update({ page : document.title, pageUrl : location.href }, ps) }, function(res){ }); }); }, |
page : document.title, pageUrl : location.href | page : ctx.title, pageUrl : ctx.href | share: function(ctx, ext, show){ maybeDeferred(ext.extract(ctx)) .addCallback(function(ps){ chrome.extension.sendRequest(TBRL.id, { request: "share", show : show, content: update({ page : document.title, pageUrl : location.href }, ps) }, function(res){ }); }); }, |
let dirNames = services.get("environment").get("PATH").split(RegExp(dactyl.has("Win32") ? ";" : ":")); | let dirNames = services.get("environment").get("PATH").split(RegExp(dactyl.has("WINNT") ? ";" : ":")); | completion.shellCommand = function shellCommand(context) { context.title = ["Shell Command", "Path"]; context.generate = function () { let dirNames = services.get("environment").get("PATH").split(RegExp(dactyl.has("Win32") ? ";" : ":")); let commands = []; for (let [, dirName] in Iterator(dirNames)) { let dir = io.File(dirName); if (dir.exists() && dir.isDirectory()) { commands.push([[file.leafName, dir.path] for (file in dir.iterDirectory()) if (file.isFile() && file.isExecutable())]); } } return array.flatten(commands); }; }; |
let frames = []; (function (frame) { if (frame.document.body instanceof HTMLBodyElement) frames.push(frame); Array.forEach(frame.frames, arguments.callee); })(window.content); | let frames = buffer.allFrames; | shiftFrameFocus: function (count, forward) { if (!(window.content.document instanceof HTMLDocument)) return; count = Math.max(count, 1); let frames = []; // find all frames - depth-first search (function (frame) { if (frame.document.body instanceof HTMLBodyElement) frames.push(frame); Array.forEach(frame.frames, arguments.callee); })(window.content); if (frames.length == 0) // currently top is always included return; // remove all unfocusable frames // TODO: find a better way to do this - walking the tree is too slow let start = document.commandDispatcher.focusedWindow; frames = frames.filter(function (frame) { frame.focus(); return document.commandDispatcher.focusedWindow == frame; }); start.focus(); // find the currently focused frame index // TODO: If the window is a frameset then the first _frame_ should be // focused. Since this is not the current FF behaviour, // we initalize current to -1 so the first call takes us to the // first frame. let current = frames.indexOf(document.commandDispatcher.focusedWindow); // calculate the next frame to focus let next = current; if (forward) { next = current + count; if (next > frames.length - 1) { if (current == frames.length - 1) dactyl.beep(); next = frames.length - 1; // still allow the frame indicator to be activated } } else { next = current - count; if (next < 0) { if (current == 0) dactyl.beep(); next = 0; // still allow the frame indicator to be activated } } // focus next frame and scroll into view frames[next].focus(); if (frames[next] != window.content) frames[next].frameElement.scrollIntoView(false); // add the frame indicator let doc = frames[next].document; let indicator = util.xmlToDom(<div highlight="FrameIndicator"/>, doc); doc.body.appendChild(indicator); setTimeout(function () { doc.body.removeChild(indicator); }, 500); // Doesn't unattach //doc.body.setAttributeNS(NS.uri, "activeframe", "true"); //setTimeout(function () { doc.body.removeAttributeNS(NS.uri, "activeframe"); }, 500); }, |
if (!(window.content.document instanceof HTMLDocument)) | if (!(content.document instanceof HTMLDocument)) | shiftFrameFocus: function (count) { if (!(window.content.document instanceof HTMLDocument)) return; let frames = buffer.allFrames(); if (frames.length == 0) // currently top is always included return; // remove all hidden frames frames = frames.filter(function (frame) !(frame.document.body instanceof HTMLFrameSetElement)) .filter(function (frame) !frame.frameElement || let (rect = frame.frameElement.getBoundingClientRect()) rect.width && rect.height); // find the currently focused frame index let current = Math.max(0, frames.indexOf(buffer.focusedFrame)); // calculate the next frame to focus let next = current + count; if (next < 0 || next >= frames.length) dactyl.beep(); next = Math.constrain(next, 0, frames.length - 1); // focus next frame and scroll into view frames[next].focus(); if (frames[next] != window.content) frames[next].frameElement.scrollIntoView(false); // add the frame indicator let doc = frames[next].document; let indicator = util.xmlToDom(<div highlight="FrameIndicator"/>, doc); (doc.body || doc.documentElement || doc).appendChild(indicator); util.timeout(function () { doc.body.removeChild(indicator); }, 500); // Doesn't unattach //doc.body.setAttributeNS(NS.uri, "activeframe", "true"); //util.timeout(function () { doc.body.removeAttributeNS(NS.uri, "activeframe"); }, 500); }, |
if (frames[next] != window.content) | if (frames[next] != content) | shiftFrameFocus: function (count) { if (!(window.content.document instanceof HTMLDocument)) return; let frames = buffer.allFrames(); if (frames.length == 0) // currently top is always included return; // remove all hidden frames frames = frames.filter(function (frame) !(frame.document.body instanceof HTMLFrameSetElement)) .filter(function (frame) !frame.frameElement || let (rect = frame.frameElement.getBoundingClientRect()) rect.width && rect.height); // find the currently focused frame index let current = Math.max(0, frames.indexOf(buffer.focusedFrame)); // calculate the next frame to focus let next = current + count; if (next < 0 || next >= frames.length) dactyl.beep(); next = Math.constrain(next, 0, frames.length - 1); // focus next frame and scroll into view frames[next].focus(); if (frames[next] != window.content) frames[next].frameElement.scrollIntoView(false); // add the frame indicator let doc = frames[next].document; let indicator = util.xmlToDom(<div highlight="FrameIndicator"/>, doc); (doc.body || doc.documentElement || doc).appendChild(indicator); util.timeout(function () { doc.body.removeChild(indicator); }, 500); // Doesn't unattach //doc.body.setAttributeNS(NS.uri, "activeframe", "true"); //util.timeout(function () { doc.body.removeAttributeNS(NS.uri, "activeframe"); }, 500); }, |
frames[next].focus(); | dactyl.focus(frames[next]); | shiftFrameFocus: function (count) { if (!(content.document instanceof HTMLDocument)) return; let frames = buffer.allFrames(); if (frames.length == 0) // currently top is always included return; // remove all hidden frames frames = frames.filter(function (frame) !(frame.document.body instanceof HTMLFrameSetElement)) .filter(function (frame) !frame.frameElement || let (rect = frame.frameElement.getBoundingClientRect()) rect.width && rect.height); // find the currently focused frame index let current = Math.max(0, frames.indexOf(buffer.focusedFrame)); // calculate the next frame to focus let next = current + count; if (next < 0 || next >= frames.length) dactyl.beep(); next = Math.constrain(next, 0, frames.length - 1); // focus next frame and scroll into view frames[next].focus(); if (frames[next] != content) frames[next].frameElement.scrollIntoView(false); // add the frame indicator let doc = frames[next].document; let indicator = util.xmlToDom(<div highlight="FrameIndicator"/>, doc); (doc.body || doc.documentElement || doc).appendChild(indicator); util.timeout(function () { doc.body.removeChild(indicator); }, 500); // Doesn't unattach //doc.body.setAttributeNS(NS.uri, "activeframe", "true"); //util.timeout(function () { doc.body.removeAttributeNS(NS.uri, "activeframe"); }, 500); }, |
shiftFrameFocus: function (count, forward) { | shiftFrameFocus: function (count) { | shiftFrameFocus: function (count, forward) { if (!(window.content.document instanceof HTMLDocument)) return; count = Math.max(count, 1); let frames = buffer.allFrames(); if (frames.length == 0) // currently top is always included return; // remove all unfocusable frames // TODO: find a better way to do this - walking the tree is too slow let start = document.commandDispatcher.focusedWindow; frames = frames.filter(function (frame) { frame.focus(); return document.commandDispatcher.focusedWindow == frame; }); start.focus(); // find the currently focused frame index // TODO: If the window is a frameset then the first _frame_ should be // focused. Since this is not the current FF behavior, // we initialize current to -1 so the first call takes us to the // first frame. let current = frames.indexOf(document.commandDispatcher.focusedWindow); // calculate the next frame to focus let next = current; if (forward) { next = current + count; if (next > frames.length - 1) { if (current == frames.length - 1) dactyl.beep(); next = frames.length - 1; // still allow the frame indicator to be activated } } else { next = current - count; if (next < 0) { if (current == 0) dactyl.beep(); next = 0; // still allow the frame indicator to be activated } } // focus next frame and scroll into view frames[next].focus(); if (frames[next] != window.content) frames[next].frameElement.scrollIntoView(false); // add the frame indicator let doc = frames[next].document; let indicator = util.xmlToDom(<div highlight="FrameIndicator"/>, doc); doc.body.appendChild(indicator); util.timeout(function () { doc.body.removeChild(indicator); }, 500); // Doesn't unattach //doc.body.setAttributeNS(NS.uri, "activeframe", "true"); //util.timeout(function () { doc.body.removeAttributeNS(NS.uri, "activeframe"); }, 500); }, |
count = Math.max(count, 1); | shiftFrameFocus: function (count, forward) { if (!(window.content.document instanceof HTMLDocument)) return; count = Math.max(count, 1); let frames = buffer.allFrames(); if (frames.length == 0) // currently top is always included return; // remove all unfocusable frames // TODO: find a better way to do this - walking the tree is too slow let start = document.commandDispatcher.focusedWindow; frames = frames.filter(function (frame) { frame.focus(); return document.commandDispatcher.focusedWindow == frame; }); start.focus(); // find the currently focused frame index // TODO: If the window is a frameset then the first _frame_ should be // focused. Since this is not the current FF behavior, // we initialize current to -1 so the first call takes us to the // first frame. let current = frames.indexOf(document.commandDispatcher.focusedWindow); // calculate the next frame to focus let next = current; if (forward) { next = current + count; if (next > frames.length - 1) { if (current == frames.length - 1) dactyl.beep(); next = frames.length - 1; // still allow the frame indicator to be activated } } else { next = current - count; if (next < 0) { if (current == 0) dactyl.beep(); next = 0; // still allow the frame indicator to be activated } } // focus next frame and scroll into view frames[next].focus(); if (frames[next] != window.content) frames[next].frameElement.scrollIntoView(false); // add the frame indicator let doc = frames[next].document; let indicator = util.xmlToDom(<div highlight="FrameIndicator"/>, doc); doc.body.appendChild(indicator); util.timeout(function () { doc.body.removeChild(indicator); }, 500); // Doesn't unattach //doc.body.setAttributeNS(NS.uri, "activeframe", "true"); //util.timeout(function () { doc.body.removeAttributeNS(NS.uri, "activeframe"); }, 500); }, |
|
let start = document.commandDispatcher.focusedWindow; frames = frames.filter(function (frame) { frame.focus(); return document.commandDispatcher.focusedWindow == frame; }); start.focus(); | frames = frames.filter(function (frame) !(frame.document.body instanceof HTMLFrameSetElement)) .filter(function (frame) !frame.frameElement || let (rect = frame.frameElement.getBoundingClientRect()) rect.width && rect.height); | shiftFrameFocus: function (count, forward) { if (!(window.content.document instanceof HTMLDocument)) return; count = Math.max(count, 1); let frames = buffer.allFrames(); if (frames.length == 0) // currently top is always included return; // remove all unfocusable frames // TODO: find a better way to do this - walking the tree is too slow let start = document.commandDispatcher.focusedWindow; frames = frames.filter(function (frame) { frame.focus(); return document.commandDispatcher.focusedWindow == frame; }); start.focus(); // find the currently focused frame index // TODO: If the window is a frameset then the first _frame_ should be // focused. Since this is not the current FF behavior, // we initialize current to -1 so the first call takes us to the // first frame. let current = frames.indexOf(document.commandDispatcher.focusedWindow); // calculate the next frame to focus let next = current; if (forward) { next = current + count; if (next > frames.length - 1) { if (current == frames.length - 1) dactyl.beep(); next = frames.length - 1; // still allow the frame indicator to be activated } } else { next = current - count; if (next < 0) { if (current == 0) dactyl.beep(); next = 0; // still allow the frame indicator to be activated } } // focus next frame and scroll into view frames[next].focus(); if (frames[next] != window.content) frames[next].frameElement.scrollIntoView(false); // add the frame indicator let doc = frames[next].document; let indicator = util.xmlToDom(<div highlight="FrameIndicator"/>, doc); doc.body.appendChild(indicator); util.timeout(function () { doc.body.removeChild(indicator); }, 500); // Doesn't unattach //doc.body.setAttributeNS(NS.uri, "activeframe", "true"); //util.timeout(function () { doc.body.removeAttributeNS(NS.uri, "activeframe"); }, 500); }, |
let current = frames.indexOf(document.commandDispatcher.focusedWindow); | let current = Math.max(0, frames.indexOf(buffer.focusedFrame)); | shiftFrameFocus: function (count, forward) { if (!(window.content.document instanceof HTMLDocument)) return; count = Math.max(count, 1); let frames = buffer.allFrames(); if (frames.length == 0) // currently top is always included return; // remove all unfocusable frames // TODO: find a better way to do this - walking the tree is too slow let start = document.commandDispatcher.focusedWindow; frames = frames.filter(function (frame) { frame.focus(); return document.commandDispatcher.focusedWindow == frame; }); start.focus(); // find the currently focused frame index // TODO: If the window is a frameset then the first _frame_ should be // focused. Since this is not the current FF behavior, // we initialize current to -1 so the first call takes us to the // first frame. let current = frames.indexOf(document.commandDispatcher.focusedWindow); // calculate the next frame to focus let next = current; if (forward) { next = current + count; if (next > frames.length - 1) { if (current == frames.length - 1) dactyl.beep(); next = frames.length - 1; // still allow the frame indicator to be activated } } else { next = current - count; if (next < 0) { if (current == 0) dactyl.beep(); next = 0; // still allow the frame indicator to be activated } } // focus next frame and scroll into view frames[next].focus(); if (frames[next] != window.content) frames[next].frameElement.scrollIntoView(false); // add the frame indicator let doc = frames[next].document; let indicator = util.xmlToDom(<div highlight="FrameIndicator"/>, doc); doc.body.appendChild(indicator); util.timeout(function () { doc.body.removeChild(indicator); }, 500); // Doesn't unattach //doc.body.setAttributeNS(NS.uri, "activeframe", "true"); //util.timeout(function () { doc.body.removeAttributeNS(NS.uri, "activeframe"); }, 500); }, |
let next = current; if (forward) { next = current + count; if (next > frames.length - 1) { if (current == frames.length - 1) dactyl.beep(); next = frames.length - 1; } } else { next = current - count; if (next < 0) { if (current == 0) dactyl.beep(); next = 0; } } | let next = current + count; if (next < 0 || next >= frames.length) dactyl.beep(); next = Math.constrain(next, 0, frames.length - 1); util.dump(current, count, next, String(frames[next])); | shiftFrameFocus: function (count, forward) { if (!(window.content.document instanceof HTMLDocument)) return; count = Math.max(count, 1); let frames = buffer.allFrames(); if (frames.length == 0) // currently top is always included return; // remove all unfocusable frames // TODO: find a better way to do this - walking the tree is too slow let start = document.commandDispatcher.focusedWindow; frames = frames.filter(function (frame) { frame.focus(); return document.commandDispatcher.focusedWindow == frame; }); start.focus(); // find the currently focused frame index // TODO: If the window is a frameset then the first _frame_ should be // focused. Since this is not the current FF behavior, // we initialize current to -1 so the first call takes us to the // first frame. let current = frames.indexOf(document.commandDispatcher.focusedWindow); // calculate the next frame to focus let next = current; if (forward) { next = current + count; if (next > frames.length - 1) { if (current == frames.length - 1) dactyl.beep(); next = frames.length - 1; // still allow the frame indicator to be activated } } else { next = current - count; if (next < 0) { if (current == 0) dactyl.beep(); next = 0; // still allow the frame indicator to be activated } } // focus next frame and scroll into view frames[next].focus(); if (frames[next] != window.content) frames[next].frameElement.scrollIntoView(false); // add the frame indicator let doc = frames[next].document; let indicator = util.xmlToDom(<div highlight="FrameIndicator"/>, doc); doc.body.appendChild(indicator); util.timeout(function () { doc.body.removeChild(indicator); }, 500); // Doesn't unattach //doc.body.setAttributeNS(NS.uri, "activeframe", "true"); //util.timeout(function () { doc.body.removeAttributeNS(NS.uri, "activeframe"); }, 500); }, |
doc.body.appendChild(indicator); | (doc.body || doc.documentElement || doc).appendChild(indicator); | shiftFrameFocus: function (count, forward) { if (!(window.content.document instanceof HTMLDocument)) return; count = Math.max(count, 1); let frames = buffer.allFrames(); if (frames.length == 0) // currently top is always included return; // remove all unfocusable frames // TODO: find a better way to do this - walking the tree is too slow let start = document.commandDispatcher.focusedWindow; frames = frames.filter(function (frame) { frame.focus(); return document.commandDispatcher.focusedWindow == frame; }); start.focus(); // find the currently focused frame index // TODO: If the window is a frameset then the first _frame_ should be // focused. Since this is not the current FF behavior, // we initialize current to -1 so the first call takes us to the // first frame. let current = frames.indexOf(document.commandDispatcher.focusedWindow); // calculate the next frame to focus let next = current; if (forward) { next = current + count; if (next > frames.length - 1) { if (current == frames.length - 1) dactyl.beep(); next = frames.length - 1; // still allow the frame indicator to be activated } } else { next = current - count; if (next < 0) { if (current == 0) dactyl.beep(); next = 0; // still allow the frame indicator to be activated } } // focus next frame and scroll into view frames[next].focus(); if (frames[next] != window.content) frames[next].frameElement.scrollIntoView(false); // add the frame indicator let doc = frames[next].document; let indicator = util.xmlToDom(<div highlight="FrameIndicator"/>, doc); doc.body.appendChild(indicator); util.timeout(function () { doc.body.removeChild(indicator); }, 500); // Doesn't unattach //doc.body.setAttributeNS(NS.uri, "activeframe", "true"); //util.timeout(function () { doc.body.removeAttributeNS(NS.uri, "activeframe"); }, 500); }, |
Report.shit = function(dataTypes) | Report.shit = function(bindingTypes, dataTypes) | Report.shit = function(dataTypes) // static types (classes){ //alert(dataTypes.toSource()); Report.dataTypes = dataTypes;} |
Report.bindingTypes = bindingTypes; | Report.shit = function(dataTypes) // static types (classes){ //alert(dataTypes.toSource()); Report.dataTypes = dataTypes;} |
|
if(/\/\/bit\.ly/.test(url)) | if(/\/\/(?:bit\.ly|j\.mp)/.test(url)) | shorten : function(url){ var self = this; if(/\/\/bit\.ly/.test(url)) return succeed(url); return this.callMethod('shorten', { longUrl : url }).addCallback(function(res){ return res[url].shortUrl; }); }, |
var reUrl = /https?[-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+/g; | var reUrl = /https?[-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#\^]+/g; | function shortenUrls(text, model){ var reUrl = /https?[-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+/g; if(!reUrl.test(text)) return; var urls = text.match(reUrl); return gatherResults(urls.map(function(url){ return model.shorten(url); })).addCallback(function(ress){ zip(urls, ress).forEach(function(pair){ var url = pair[0], res = pair[1]; text = text.replace(url, res); }); return text; });} |
return; | return text; | function shortenUrls(text, model){ var reUrl = /https?[-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#\^]+/g; if(!reUrl.test(text)) return; var urls = text.match(reUrl); return gatherResults(urls.map(function(url){ return model.shorten(url); })).addCallback(function(ress){ zip(urls, ress).forEach(function(pair){ var url = pair[0], res = pair[1]; text = text.replace(url, res); }); return text; });} |
shouldUseSelectorsAPI: function() { if (!Prototype.BrowserFeatures.SelectorsAPI) return false; if (!Selector._div) Selector._div = new Element('div'); try { Selector._div.querySelector(this.expression); } catch(e) { return false; } return true; }, | 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])*?\*\ | shouldUseSelectorsAPI: function() { if (!Prototype.BrowserFeatures.SelectorsAPI) return false; if (!Selector._div) Selector._div = new Element('div'); // Make sure the browser treats the selector as valid. Test on an // isolated element to minimize cost of this check. try { Selector._div.querySelector(this.expression); } catch(e) { return false; } return true; }, |
show: function(){ this.onBeforeLoad(); }, | show : function(){ this.onFocus(); }, | show: function(){ this.onBeforeLoad(); }, |
this._top = win || content; this._top.addEventListener("resize", this._resizeTimer.closure.tell, true); | show: function (minor, filter, win) { this._hintMode = this._hintModes[minor]; dactyl.assert(this._hintMode); commandline.input(this._hintMode.prompt + ": ", null, { onChange: this.closure._onInput }); modes.extended = modes.HINTS; this.hintKeys = events.fromString(options["hintkeys"]).map(events.closure.toString); this._submode = minor; this._hintString = filter || ""; this._hintNumber = 0; this._usedTabKey = false; this.prevInput = ""; this._canUpdate = false; this._generate(win); // get all keys from the input queue util.threadYield(true); this._canUpdate = true; this._showHints(); if (this._validHints.length == 0) { dactyl.beep(); modes.pop(); } else if (this._validHints.length == 1) this._processHints(false); else // Ticket #185 this._checkUnique(); }, |
|
commandline.input(this._hintMode.prompt + ": ", null, { onChange: this.closure._onInput }); | commandline.input(this._hintMode.prompt + ": ", null, { extended: modes.HINTS, leave: function () { hints.hide(); }, onChange: this.closure._onInput }); | show: function (minor, filter, win) { this._hintMode = this._hintModes[minor]; dactyl.assert(this._hintMode); commandline.input(this._hintMode.prompt + ": ", null, { onChange: this.closure._onInput }); modes.extended = modes.HINTS; this.hintKeys = events.fromString(options["hintkeys"]).map(events.closure.toString); this._submode = minor; this._hintString = filter || ""; this._hintNumber = 0; this._usedTabKey = false; this.prevInput = ""; this._canUpdate = false; this._top = win || content; this._top.addEventListener("resize", this._resizeTimer.closure.tell, true); this._generate(win); // get all keys from the input queue util.threadYield(true); this._canUpdate = true; this._showHints(); if (this._validHints.length == 0) { dactyl.beep(); modes.pop(); } else if (this._validHints.length == 1) this._processHints(false); else // Ticket #185 this._checkUnique(); }, |
null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(i){return e.step(i)}this.startTime=K();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!Z)Z=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop=== "width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=K(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow= | this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now= | null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(i){return e.step(i)}this.startTime=K();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!Z)Z=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=K(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow= |
commandline.input(this._hintMode.prompt + ": ", null, { onChange: this.closure._onInput }); | commandline.input(this._hintMode.prompt, null, { onChange: this.closure._onInput }); | show: function (minor, filter, win) { this._hintMode = this._hintModes[minor]; liberator.assert(this._hintMode); commandline.input(this._hintMode.prompt + ": ", null, { onChange: this.closure._onInput }); modes.extended = modes.HINTS; this._submode = minor; this._hintString = filter || ""; this._hintNumber = 0; this._usedTabKey = false; this._prevInput = ""; this._canUpdate = false; this._generate(win); // get all keys from the input queue liberator.threadYield(true); this._canUpdate = true; this._showHints(); if (this._validHints.length == 0) { liberator.beep(); modes.reset(); } else if (this._validHints.length == 1) this._processHints(false); else // Ticket #185 this._checkUnique(); }, |
this._prevInput = ""; | this.prevInput = ""; | show: function (minor, filter, win) { this._hintMode = this._hintModes[minor]; dactyl.assert(this._hintMode); commandline.input(this._hintMode.prompt + ": ", null, { onChange: this.closure._onInput }); modes.extended = modes.HINTS; this._submode = minor; this._hintString = filter || ""; this._hintNumber = 0; this._usedTabKey = false; this._prevInput = ""; this._canUpdate = false; this._generate(win); // get all keys from the input queue util.threadYield(true); this._canUpdate = true; this._showHints(); if (this._validHints.length == 0) { dactyl.beep(); modes.reset(); } else if (this._validHints.length == 1) this._processHints(false); else // Ticket #185 this._checkUnique(); }, |
show: function(element) { element = $(element); element.style.display = ''; return element; }, | var Prototype={Version:"1.6.1",Browser:(function(){var b=navigator.userAgent;var a=Object.prototype.toString.call(window.opera)=="[object Opera]";return{IE:!!window.attachEvent&&!a,Opera:a,WebKit:b.indexOf("AppleWebKit/")>-1,Gecko:b.indexOf("Gecko")>-1&&b.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile.*Safari/.test(b)}})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var a=window.Element||window.HTMLElement;return !!(a&&a.prototype)})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=="undefined"){return true}var c=document.createElement("div");var b=document.createElement("form");var a=false;if(c.__proto__&&(c.__proto__!==b.__proto__)){a=true}c=b=null;return a})()},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Abstract={};var Try={these:function(){var c;for(var b=0,d=arguments.length;b<d;b++){var a=arguments[b];try{c=a();break}catch(f){}}return c}};var Class=(function(){function a(){}function b(){var g=null,f=$A(arguments);if(Object.isFunction(f[0])){g=f.shift()}function d(){this.initialize.apply(this,arguments)}Object.extend(d,Class.Methods);d.superclass=g;d.subclasses=[];if(g){a.prototype=g.prototype;d.prototype=new a;g.subclasses.push(d)}for(var e=0;e<f.length;e++){d.addMethods(f[e])}if(!d.prototype.initialize){d.prototype.initialize=Prototype.emptyFunction}d.prototype.constructor=d;return d}function c(k){var f=this.superclass&&this.superclass.prototype;var e=Object.keys(k);if(!Object.keys({toString:true}).length){if(k.toString!=Object.prototype.toString){e.push("toString")}if(k.valueOf!=Object.prototype.valueOf){e.push("valueOf")}}for(var d=0,g=e.length;d<g;d++){var j=e[d],h=k[j];if(f&&Object.isFunction(h)&&h.argumentNames().first()=="$super"){var l=h;h=(function(i){return function(){return f[i].apply(this,arguments)}})(j).wrap(l);h.valueOf=l.valueOf.bind(l);h.toString=l.toString.bind(l)}this.prototype[j]=h}return this}return{create:b,Methods:{addMethods:c}}})();(function(){var d=Object.prototype.toString;function i(q,s){for(var r in s){q[r]=s[r]}return q}function l(q){try{if(e(q)){return"undefined"}if(q===null){return"null"}return q.inspect?q.inspect():String(q)}catch(r){if(r instanceof RangeError){return"..."}throw r}}function k(q){var s=typeof q;switch(s){case"undefined":case"function":case"unknown":return;case"boolean":return q.toString()}if(q===null){return"null"}if(q.toJSON){return q.toJSON()}if(h(q)){return}var r=[];for(var u in q){var t=k(q[u]);if(!e(t)){r.push(u.toJSON()+": "+t)}}return"{"+r.join(", ")+"}"}function c(q){return $H(q).toQueryString()}function f(q){return q&&q.toHTML?q.toHTML():String.interpret(q)}function o(q){var r=[];for(var s in q){r.push(s)}return r}function m(q){var r=[];for(var s in q){r.push(q[s])}return r}function j(q){return i({},q)}function h(q){return !!(q&&q.nodeType==1)}function g(q){return d.call(q)=="[object Array]"}function p(q){return q instanceof Hash}function b(q){return typeof q==="function"}function a(q){return d.call(q)=="[object String]"}function n(q){return d.call(q)=="[object Number]"}function e(q){return typeof q==="undefined"}i(Object,{extend:i,inspect:l,toJSON:k,toQueryString:c,toHTML:f,keys:o,values:m,clone:j,isElement:h,isArray:g,isHash:p,isFunction:b,isString:a,isNumber:n,isUndefined:e})})();Object.extend(Function.prototype,(function(){var k=Array.prototype.slice;function d(o,l){var n=o.length,m=l.length;while(m--){o[n+m]=l[m]}return o}function i(m,l){m=k.call(m,0);return d(m,l)}function g(){var l=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\ | show: function(element) { element = $(element); element.style.display = ''; return element; }, |
modes.reset(); | modes.pop(); | show: function (minor, filter, win) { this._hintMode = this._hintModes[minor]; dactyl.assert(this._hintMode); commandline.input(this._hintMode.prompt + ": ", null, { onChange: this.closure._onInput }); modes.extended = modes.HINTS; this.hintKeys = events.fromString(options["hintkeys"]).map(events.closure.toString); this._submode = minor; this._hintString = filter || ""; this._hintNumber = 0; this._usedTabKey = false; this.prevInput = ""; this._canUpdate = false; this._generate(win); // get all keys from the input queue util.threadYield(true); this._canUpdate = true; this._showHints(); if (this._validHints.length == 0) { dactyl.beep(); modes.reset(); } else if (this._validHints.length == 1) this._processHints(false); else // Ticket #185 this._checkUnique(); }, |
window.getSelection().empty(); | this.showCanvas = function (x, y, parent_node) { if (!parent_node) { return; } if (parent_node.lastChild != this.html_canvas) { parent_node.appendChild(this.html_canvas); this.setCanvasStyle("blue", "white", 5); } window.getSelection().empty(); this.ctx.beginPath(); this.ctx.moveTo(x, y); }; |
|
var expectRE = new RegExp('^' + expectedLines[i] + '$'); | try { var expectRE = new RegExp('^' + expectedLines[i] + '$'); } catch (e) { result.push('regex match failed: ' + repr(gotLine) + ' (' + expectedLines[i] + ')'); continue; } | doctest.JSRunner.prototype.showCheckDifference = function (got, expectedRegex) { if (expectedRegex.charAt(0) != '^') { throw 'Unexpected regex, no leading ^'; } if (expectedRegex.charAt(expectedRegex.length-1) != '$') { throw 'Unexpected regex, no trailing $'; } expectedRegex = expectedRegex.substr(1, expectedRegex.length-2); // Technically this might not be right, but this is all a heuristic: var expectedLines = expectedRegex.split('\\n'); var gotLines = got.split('\n'); var result = []; var totalLines = expectedLines.length > gotLines.length ? expectedLines.length : gotLines.length; function displayExpectedLine(line) { return line; line = line.replace(/\[a-zA-Z0-9_.\]\+/g, '?'); line = line.replace(/ \+/g, ' '); line = line.replace(/\(\?:\.\|\[\\r\\n\]\)\*/g, '...'); // FIXME: also unescape values? e.g., * became \* return line; } for (var i=0; i<totalLines; i++) { if (i >= expectedLines.length) { result.push('got extra line: ' + repr(gotLines[i])); continue; } else if (i >= gotLines.length) { result.push('expected extra line: ' + displayExpectedLine(expectedLines[i])); continue; } var gotLine = gotLines[i]; var expectRE = new RegExp('^' + expectedLines[i] + '$'); if (gotLine.search(expectRE) != -1) { result.push('match: ' + repr(gotLine)); } else { result.push('no match: ' + repr(gotLine) + ' (' + displayExpectedLine(expectedLines[i]) + ')'); } } return result;}; |
var updateForced = (aArg !== null); | var updateForced = typeof aArg === "number"; | function showFollowersStatus(aArg) { self.currentFilter = self.filterNameTimeline; var updateForced = (aArg !== null); if (updateForced || !share.twitterStatusesJSONCache) { if (twitterStatusesPending) { display.echoStatusBar(M({ja: 'Twitter γΈγͺγ―γ¨γΉγγιδΏ‘γγ¦γγΎγγγγ°γγγεΎ
γ‘δΈγγγ', en: "Requesting to the Twitter ... Please wait."}), 2000); } else { // rebuild cache self.updateStatusesCache( function () { if (share.twitterStatusesJSONCache) { callSelector(share.twitterStatusesJSONCache); setLastStatus(share.twitterStatusesJSONCache); } }, updateForced); } } else { // use cache callSelector(share.twitterStatusesJSONCache); setLastStatus(share.twitterStatusesJSONCache); } } |
var url = "/dxr/getinfo.cgi?virtroot=" + virtroot + "&tree=" + tree + "&div=" + infoDivID++ | var url = virtroot + sep + "getinfo.cgi?virtroot=" + virtroot + "&tree=" + tree + "&div=" + infoDivID++ | function showInfo(node) { var type = node.className; var name = node.innerHTML; var line = node.parentNode.id.replace('l', ''); var file = location.pathname.replace(virtroot + '/' + tree + '/', '').replace('.html', ''); var url = "/dxr/getinfo.cgi?virtroot=" + virtroot + "&tree=" + tree + "&div=" + infoDivID++ if (type == 's' || type == 's-fuzzy') { // statements have matching line number url += "&type=" + type + "&name=" + name + "&file=" + file + "&line=" + node.getAttribute("line").replace('l',''); } else { url += "&type=" + type + "&name=" + name; } if (infoDiv) { closeInfo(); } var id = 'info-div-' + infoDivID; infoDiv = new dojox.layout.ContentPane({ id: id, style: "margin:0; padding:0; white-space: normal !important;" }); infoDiv.placeAt(node.parentNode, "after"); infoDiv.attr('href', url); //"/dxr/getinfo2.cgi?tree-id=" + ); // /dxr/info-test.html?id=" + infoDivID); location.hash = line + '/' + name; dojo.addClass(node, 'highlighted'); // TODO: this needs to happen in an onLoad or onDownloadEnd event vs. here... dojo.fx.wipeIn({node: infoDiv.id, duration: 500}).play();} |
var join_message_ar = ["<message from='"+nick+"' to='[email protected]/3' id='1' type='groupchat'><x xmlns='jabber:x:event'><composing/></x></message>"]; var join_message_jq = $(join_message_ar.join("")); var body_elem = document.createElement("body"); var body_text = document.createTextNode("/me has "+status+" the room."); body_elem.appendChild(body_text); join_message_jq.append(body_elem); app.messageView().displayMessage(nick, room_avatar, join_message_jq.get(0), false); | var join_message_ar = ["<message from='", nick, "' to='[email protected]/3' id='1' type='groupchat'><x xmlns='jabber:x:event'><composing/></x><body>/me has ", status, " the room.</body></message>"]; try { var join_message_jq = Speeqe.text_to_xml(join_message_ar.join("")); app.messageView().displayMessage(nick, room_avatar, join_message_jq, false); } catch(e) { console.error(e); } | showJoinLeave: function(nick,status) { //test if we are to display message along with chat messages. var chatwindow = $("#chatWindow_chatpane"); if (chatwindow.hasClass('joinleave')) { var room_avatar = '/avatar-service/lookup/?sha1=f2f8ab835b10d66f9233518d1047f3014b3857cf'; var join_message_ar = ["<message from='"+nick+"' to='[email protected]/3' id='1' type='groupchat'><x xmlns='jabber:x:event'><composing/></x></message>"]; var join_message_jq = $(join_message_ar.join("")); var body_elem = document.createElement("body"); var body_text = document.createTextNode("/me has "+status+" the room."); body_elem.appendChild(body_text); join_message_jq.append(body_elem); app.messageView().displayMessage(nick, room_avatar, join_message_jq.get(0), false); } var msg_template = $('#room_message_template').clone(); msg_template.find("#nick").text(nick); $('#room_messages').append(msg_template.get(0)); } |
var blocker = $('blocker'); if (!blocker) { $(document.body).insert('<div id="blocker"></div>'); blocker = $('blocker'); } blocker.setStyle({top: 0, left: 0, width: '100%', height: screen.height+'px', position: 'fixed'}); | var showLoading = function() { var blocker = $('blocker'); if (!blocker) { $(document.body).insert('<div id="blocker"></div>'); blocker = $('blocker'); } blocker.setStyle({top: 0, left: 0, width: '100%', height: screen.height+'px', position: 'fixed'}); $$('.loader').invoke('addClassName', 'loadingImage').invoke('update', 'LOADING CONTENT... PLEASE WAIT');} |
|
this._picker.set("contentView", this.get("masterView")); this._picker.set("extraRightOffset", this.get("pointerDistanceFromEdge")); | showMasterPicker: function(view) { if (this._picker && this._picker.get("isVisibleInWindow")) return; if (!this._picker) { var pp = this.get("pickerPane"); this._picker = pp.create({ }); this._picker.set("contentView", this.get("masterView")); this._picker.set("extraRightOffset", this.get("pointerDistanceFromEdge")); } this.showPicker(this._picker, view); }, |
|
this._picker.set("contentView", this.get("masterView")); this._picker.set("extraRightOffset", this.get("pointerDistanceFromEdge")); | showMasterPicker: function(view) { if (this._picker && this._picker.get("isVisibleInWindow")) return; if (!this._picker) { var pp = this.get("pickerPane"); this._picker = pp.create({ }); this._picker.set("contentView", this.get("masterView")); this._picker.set("extraRightOffset", this.get("pointerDistanceFromEdge")); } this.showPicker(this._picker, view); }, |
|
let file = window.content.document.location.pathname.split("/").pop() || "[No Name]"; let title = window.content.document.title || "[No Title]"; | let file = content.document.location.pathname.split("/").pop() || "[No Name]"; let title = content.document.title || "[No Title]"; | showPageInfo: function (verbose, sections) { // Ctrl-g single line output if (!verbose) { let file = window.content.document.location.pathname.split("/").pop() || "[No Name]"; let title = window.content.document.title || "[No Title]"; let info = template.map("gf", function (opt) template.map(buffer.pageInfo[opt][0](), util.identity, ", "), ", "); if (bookmarks.isBookmarked(this.URL)) info += ", bookmarked"; let pageInfoText = <>{file.quote()} [{info}] {title}</>; dactyl.echo(pageInfoText, commandline.FORCE_SINGLELINE); return; } let option = sections || options["pageinfo"]; let list = template.map(option, function (option) { let opt = buffer.pageInfo[option]; return opt ? template.table(opt[1], opt[0](true)) : undefined; }, <br/>); dactyl.echo(list, commandline.FORCE_MULTILINE); }, |
dojo.addClass(node, "highlighted"); | dojo.addClass(node, 'highlighted'); | function showPopup(node) { var name = node.innerHTML; var type = node.className; var line = node.parentNode.id.replace('l', ''); var file = location.pathname.replace(virtroot + '/' + tree + '/', '').replace('.html', ''); var url = virtroot + "/getinfo.cgi?virtroot=" + virtroot + "&tree=" + tree // put back the tooltip connector image and remove old highlight (if any) dojo.query(".dijitTooltipConnector").style("display", "inline"); dojo.query(".sidebar-highlighted").removeClass("sidebar-highlighted"); dojo.query(".highlighted").removeClass("highlighted"); if (type == 's' || type == 's-fuzzy') // statements have matching line number url += "&type=" + type + "&name=" + name + "&file=" + file + "&line=" + node.getAttribute("line").replace('l',''); else url += "&type=" + type + "&name=" + name; var ttd = dijit.byId("ttd"); var e = dojo.connect(ttd, "onDownloadEnd", function () { var ttd_dnd = new dojo.dnd.Moveable('ttd', {handle: 'titlebar'}); var ofm = dojo.connect(ttd_dnd, "onFirstMove", function(mover) { // If the user drags the dialog away from the link, remove the connector var s = mover.node.style; var xy = dojo.coords('ttd'); dojo.style("ttd", { position: "absolute", top: xy.y + "px", left: xy.x + "px" }); dojo.query(".dijitTooltipConnector").style("display", "none"); dojo.disconnect(ofm); }); dojo.disconnect(e); }); ttd.attr("href", url); dijit.popup.open({ popup: ttd, around: node, onCancel: function(){ dijit.popup.close(ttd); dojo.query(".highlighted").removeClass("highlighted"); } }); location.hash = line + '/' + name; dojo.addClass(node, "highlighted");} |
services.observer.notifyObservers(null, "dactyl-cleanup", null); | function shutdown(data, reason) { dump("dactyl: bootstrap: shutdown\n"); for (let factory in values(components)) // TODO: Categories; factory.unregister(); services.observer.notifyObservers(null, "dactyl-cleanup", null);} |
|
function shutdown(data, reason) { dump("dactyl: bootstrap: shutdown\n") } | function shutdown(data, reason) { dump("dactyl: bootstrap: shutdown\n"); for (let factory in values(components)) factory.unregister(); services.observer.notifyObservers(null, "dactyl-cleanup", null); } | function shutdown(data, reason) { dump("dactyl: bootstrap: shutdown\n") } |
services.observer.notifyObservers(null, "dactyl-cleanup-modules", null); | function shutdown(data, reason) { dump("dactyl: bootstrap: shutdown " + reasonToString(reason) + "\n"); if (reason != APP_SHUTDOWN) { if ([ADDON_UPGRADE, ADDON_DOWNGRADE, ADDON_UNINSTALL].indexOf(reason) >= 0) services.observer.notifyObservers(null, "dactyl-purge", null); services.observer.notifyObservers(null, "dactyl-cleanup", null); for (let factory in values(components)) // TODO: Categories; factory.unregister(); }} |
|
1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ga=/ jQuery\d+="(?:\d+|null)"/g,Y=/^\s+/,db=/(<([\w:]+)[^>]*?)\/>/g,eb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,Ha=/<([\w:]+)/,fb=/<tbody/i,gb=/<|&\w+;/,hb=function(a,b,d){return eb.test(d)?a:b+"></"+d+">"},G={option:[1,"<select multiple='multiple'>","</select>"], | 1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/<tbody/i,jb=/<|&#?\w+;/,ta=/<script|<object|<embed|<option|<style/i,ua=/checked\s*(?:[^=]|=\s*.checked.)/i,Ma=function(a,b,d){return hb.test(d)? | 1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ga=/ jQuery\d+="(?:\d+|null)"/g,Y=/^\s+/,db=/(<([\w:]+)[^>]*?)\/>/g,eb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,Ha=/<([\w:]+)/,fb=/<tbody/i,gb=/<|&\w+;/,hb=function(a,b,d){return eb.test(d)?a:b+"></"+d+">"},G={option:[1,"<select multiple='multiple'>","</select>"], |
siblings: function(element) { element = $(element); return element.previousSiblings().reverse().concat(element.nextSiblings()); }, | 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])*?\*\ | siblings: function(element) { element = $(element); return element.previousSiblings().reverse().concat(element.nextSiblings()); }, |
SC.platform.bounceOnScroll = YES; | simulateTouchEvents: function() { // Touch events are supported natively, no need for this. if (this.touch) { //@ if (debug) SC.Logger.info("Can't simulate touch events in an environment that supports them."); //@ endif return; } // Tell the app that we now "speak" touch SC.platform.touch = YES; // CSS selectors may depend on the touch class name being present document.body.className = document.body.className + ' touch'; // Initialize a counter, which we will use to generate unique ids for each // fake touch. this._simtouch_counter = 1; // Remove events that don't exist in touch environments this.removeEvents('click dblclick mouseout mouseover mousewheel'.w()); // Replace mouse events with our translation methods this.replaceEvent('mousemove', this._simtouch_mousemove); this.replaceEvent('mousedown', this._simtouch_mousedown); this.replaceEvent('mouseup', this._simtouch_mouseup); }, |
|
"url": '/volumes/create', | "url": '/volumes', | DcmgrGUI.prototype.snapshotPanel = function(){ var total = 0; var maxrow = 10; var page = 1; var list_request = { "url" : DcmgrGUI.Util.getPagePath('/snapshots/list/',page), "data" : DcmgrGUI.Util.getPagenateData(page,maxrow) }; DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "uuid":'', "size":'', "origin_volume_id":'', "created_at":'', "state":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "uuid" : "-", "size" : "-", "origin_volume_id" : "-", "created_at" : "-", "updated_at" : "-", "state" : "", } } var c_pagenate = new DcmgrGUI.Pagenate({ row:maxrow, total:total }); var c_list = new DcmgrGUI.List({ element_id:'#display_snapshots', template_id:'#snapshotsListTemplate', maxrow:maxrow, page:page }); c_list.setDetailTemplate({ template_id:'#snapshotsDetailTemplate', detail_path:'/snapshots/show/' }); c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ var snapshot = params.data.volume_snapshot; c_pagenate.changeTotal(snapshot.owner_total); c_list.setData(snapshot.results); c_list.multiCheckList(c_list.detail_template); }); var bt_refresh = new DcmgrGUI.Refresh(); var bt_create_volume = new DcmgrGUI.Dialog({ target:'.create_volume', width:400, height:200, title:'Create Volume', path:'/create_volume_from_snapshot', button:{ "Create": function() { var create_volumes = $(this).find('#create_volumes').find('li'); var ids = [] $.each(create_volumes,function(){ ids.push($(this).text()) }) var data = $.param({ids:ids}) $.ajax({ "type": "POST", "async": true, "url": '/volumes/create', "dataType": "json", "data": data, success: function(json,status){ bt_refresh.element.trigger('dcmgrGUI.refresh'); } }); $(this).dialog("close"); } } }); var bt_delete_snapshot = new DcmgrGUI.Dialog({ target:'.delete_snapshot', width:400, height:200, title:'Delete snapshot', path:'/delete_snapshot', button:{ "Close": function() { $(this).dialog("close"); }, "Yes, Delete": function() { var delete_snapshots = $(this).find('#delete_snapshots').find('li'); var ids = [] $.each(delete_snapshots,function(){ ids.push($(this).text()) }) var data = $.param({ids:ids}) $.ajax({ "type": "DELETE", "async": true, "url": '/snapshots/delete', "dataType": "json", "data": data, success: function(json,status){ bt_refresh.element.trigger('dcmgrGUI.refresh'); } }); c_list.changeStatus('deleting'); $(this).dialog("close"); } } }); bt_create_volume.target.bind('click',function(){ bt_create_volume.open(c_list.getCheckedInstanceIds()); }); bt_delete_snapshot.target.bind('click',function(){ bt_delete_snapshot.open(c_list.getCheckedInstanceIds()); }); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ c_list.page = c_pagenate.current_page; list_request.url = DcmgrGUI.Util.getPagePath('/snapshots/list/',c_list.page); list_request.data = DcmgrGUI.Util.getPagenateData(c_pagenate.start,c_pagenate.row); 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('/snapshots/show/',check_id) },true); }); }); c_pagenate.element.bind('dcmgrGUI.updatePagenate',function(){ c_list.clearCheckedList(); $('#detail').html(''); bt_refresh.element.trigger('dcmgrGUI.refresh'); }); //list c_list.setData(null); c_list.update(list_request,true); } |
list_request.data = DcmgrGUI.Util.getPagenateData(c_list.page,c_list.maxrow) | list_request.data = DcmgrGUI.Util.getPagenateData(c_pagenate.start,c_pagenate.row); | DcmgrGUI.prototype.snapshotPanel = function(){ var total = 0; var maxrow = 10; var page = 1; var list_request = { "url" : DcmgrGUI.Util.getPagePath('/snapshots/list/',page), "data" : DcmgrGUI.Util.getPagenateData(page,maxrow) }; DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "uuid":'', "size":'', "origin_volume_id":'', "created_at":'', "state":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "uuid" : "-", "size" : "-", "origin_volume_id" : "-", "created_at" : "-", "updated_at" : "-", "state" : "", } } var c_pagenate = new DcmgrGUI.Pagenate({ row:maxrow, total:total }); var c_list = new DcmgrGUI.List({ element_id:'#display_snapshots', template_id:'#snapshotsListTemplate', maxrow:maxrow, page:page }); c_list.setDetailTemplate({ template_id:'#snapshotsDetailTemplate', detail_path:'/snapshots/show/' }); c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ var snapshot = params.data.volume_snapshot; c_pagenate.changeTotal(snapshot.owner_total); c_list.setData(snapshot.results); c_list.multiCheckList(c_list.detail_template); }); var bt_refresh = new DcmgrGUI.Refresh(); var bt_create_volume = new DcmgrGUI.Dialog({ target:'.create_volume', width:400, height:200, title:'Create Volume', path:'/create_volume_from_snapshot', button:{ "Create": function() { var create_volumes = $(this).find('#create_volumes').find('li'); var ids = [] $.each(create_volumes,function(){ ids.push($(this).text()) }) var data = $.param({ids:ids}) $.ajax({ "type": "POST", "async": true, "url": '/volumes/create', "dataType": "json", "data": data, success: function(json,status){ bt_refresh.element.trigger('dcmgrGUI.refresh'); } }); $(this).dialog("close"); } } }); var bt_delete_snapshot = new DcmgrGUI.Dialog({ target:'.delete_snapshot', width:400, height:200, title:'Delete snapshot', path:'/delete_snapshot', button:{ "Close": function() { $(this).dialog("close"); }, "Yes, Delete": function() { var delete_snapshots = $(this).find('#delete_snapshots').find('li'); var ids = [] $.each(delete_snapshots,function(){ ids.push($(this).text()) }) var data = $.param({ids:ids}) $.ajax({ "type": "DELETE", "async": true, "url": '/snapshots/delete', "dataType": "json", "data": data, success: function(json,status){ bt_refresh.element.trigger('dcmgrGUI.refresh'); } }); c_list.changeStatus('deleting'); $(this).dialog("close"); } } }); bt_create_volume.target.bind('click',function(){ bt_create_volume.open(c_list.getCheckedInstanceIds()); }); bt_delete_snapshot.target.bind('click',function(){ bt_delete_snapshot.open(c_list.getCheckedInstanceIds()); }); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ c_list.page = c_pagenate.current_page; list_request.url = DcmgrGUI.Util.getPagePath('/snapshots/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}) //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('/snapshots/show/',check_id) },true); }); }); c_pagenate.element.bind('dcmgrGUI.updatePagenate',function(){ c_list.clearCheckedList(); $('#detail').html(''); bt_refresh.element.trigger('dcmgrGUI.refresh'); }); //list c_list.setData(null); c_list.update(list_request,true); } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.