rem
stringlengths 0
126k
| add
stringlengths 0
441k
| context
stringlengths 15
136k
|
---|---|---|
handle:function(a){var b,d;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;d=a.type.split(".");a.type=d.shift();b=!d.length&&!a.exclusive;var f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)");d=(c.data(this,"events")||{})[a.type];for(var e in d){var i=d[e];if(b||f.test(i.type)){a.handler=i;a.data=i.data;i=i.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}return a.result}, | f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive; if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e<j;e++){var i=d[e];if(b||f.test(i.namespace)){a.handler=i.handler;a.data=i.data;a.handleObj=i;i=i.handler.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), | handle:function(a){var b,d;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;d=a.type.split(".");a.type=d.shift();b=!d.length&&!a.exclusive;var f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)");d=(c.data(this,"events")||{})[a.type];for(var e in d){var i=d[e];if(b||f.test(i.type)){a.handler=i;a.data=i.data;i=i.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}return a.result}, |
null}};try{var h=x.abort;x.abort=function(){if(x){h.call(x);if(x)x.readyState=0}g()}}catch(k){}e.async&&e.timeout>0&&setTimeout(function(){x&&!F&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||A,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol=== | g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status=== | null}};try{var h=x.abort;x.abort=function(){if(x){h.call(x);if(x)x.readyState=0}g()}}catch(k){}e.async&&e.timeout>0&&setTimeout(function(){x&&!F&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||A,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol=== |
delayedCommandTimeout = null; }, options.displayDelayTime); | createCompletionListPending = false; if (createCompletionListQueued) { createCompletionListQueued = false; delayedCommandTimeout = setTimeout(arguments.callee, options.displayDelayTime); } }, options.displayDelayTime); | function handleKeyUpSelector(aEvent) { /** * Without this cause exception about selection */ if (!currentCallback) return; if (textbox.value.length !== oldTextLength) { if (delayedCommandTimeout) clearTimeout(delayedCommandTimeout); // add delay delayedCommandTimeout = setTimeout( function () { createCompletionList(); delayedCommandTimeout = null; }, options.displayDelayTime); } oldTextLength = textbox.value.length; if (typeof userOnChange === "function") { let currentIndex; let currentRow; if (selectorStatus === SELECTOR_STATE_CANDIDATES) { currentIndex = wholeListIndex; currentRow = wholeList[currentIndex]; } else { currentIndex = selectorContext[SELECTOR_STATE_CANDIDATES].wholeListIndex; currentRow = selectorContext[SELECTOR_STATE_CANDIDATES].wholeList[currentIndex]; } let arg = { textbox : textbox, event : aEvent, finish : self.finish, index : currentIndex, row : currentRow }; userOnChange(arg); } } |
oldTextLength = textbox.selectionEnd; | oldTextLength = textbox.value.length; | function handleKeyUpSelector(aEvent) { /** * Without this cause exception about selection */ if (!currentCallback) return; if (textbox.value.length !== oldTextLength) { if (delayedCommandTimeout) clearTimeout(delayedCommandTimeout); // add delay delayedCommandTimeout = setTimeout( function () { createCompletionList(); delayedCommandTimeout = null; }, options.displayDelayTime); } oldTextLength = textbox.selectionEnd; if (typeof userOnChange === "function") { let currentIndex; let currentRow; if (selectorStatus === SELECTOR_STATE_CANDIDATES) { currentIndex = wholeListIndex; currentRow = wholeList[currentIndex]; } else { currentIndex = selectorContext[SELECTOR_STATE_CANDIDATES].wholeListIndex; currentRow = selectorContext[SELECTOR_STATE_CANDIDATES].wholeList[currentIndex]; } let arg = { textbox : textbox, event : aEvent, finish : self.finish, index : currentIndex, row : currentRow }; userOnChange(arg); } } |
var body = JSON.stringify( {'session': this.key}) this.renderResponse(response, body); | this.renderResponse(response, JSON.stringify( {'session': this.key})); | handshake: function (request, response) { // debug('calling stringify'); var body = JSON.stringify( {'session': this.key}) // debug('stringify called'); this.renderResponse(response, body); }, |
g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,k){return!!p(k[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)}, | c.find(a,this[f],b);if(f>0)for(var j=d;j<b.length;j++)for(var i=0;i<d;i++)if(b[i]===b[j]){b.splice(j--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Ia(this,a,false),"not",a)},filter:function(a){return this.pushStack(Ia(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j= | g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,k){return!!p(k[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)}, |
return sc_super() && leftDuration == topDuration; | if (leftDuration !== topDuration) { return NO; } else if ((topDuration || leftDuration) && !SC.platform.supportsCSSTransitions) { return NO; } else { return sc_super(); } | hasAcceleratedLayer: function(){ var leftDuration = this.transitions['left'] && this.transitions['left'].duration, topDuration = this.transitions['top'] && this.transitions['top'].duration; return sc_super() && leftDuration == topDuration; }.property('wantsAcceleratedLayer', 'transitions'), |
if (leftDuration !== topDuration) { return NO; } else if ((topDuration || leftDuration) && !SC.platform.supportsCSSTransitions) { return NO; } else { return sc_super(); } | return sc_super() && leftDuration == topDuration; | hasAcceleratedLayer: function(){ var leftDuration = this.transitions['left'] && this.transitions['left'].duration, topDuration = this.transitions['top'] && this.transitions['top'].duration; if (leftDuration !== topDuration) { return NO; } else if ((topDuration || leftDuration) && !SC.platform.supportsCSSTransitions) { return NO; } else { return sc_super(); } }.property('wantsAcceleratedLayer', 'transitions'), |
}.property('wantsAcceleratedLayer', 'layout').cacheable(), | }.property('wantsAcceleratedLayer').cacheable(), | hasAcceleratedLayer: function(){ if (this.get('wantsAcceleratedLayer') && SC.platform.supportsAcceleratedLayers) { var layout = this.get('layout'), key; if (layout['animateTop'] || layout['animateLeft']) { for (key in layout) { // If we're animating other transforms at different speeds, don't use acceleratedLayer if ( SC._TRANSFORM_ANIMATIONS[key] && ((layout['animateTop'] && layout['animateTop'].duration !== layout[key].duration) || (layout['animateLeft'] && layout['animateLeft'].duration !== layout[key].duration)) ) { return NO; } } } if ( layout.left != null && !SC.isPercentage(layout.left) && layout.left != SC.LAYOUT_AUTO && layout.top != null && !SC.isPercentage(layout.top) && layout.top != SC.LAYOUT_AUTO && layout.width != null && !SC.isPercentage(layout.width) && layout.width != SC.LAYOUT_AUTO && layout.height != null && !SC.isPercentage(layout.height) && layout.height != SC.LAYOUT_AUTO ) { return YES; } } return NO; }.property('wantsAcceleratedLayer', 'layout').cacheable(), |
Element.hasAttribute = function(element, attribute) { if (element.hasAttribute) return element.hasAttribute(attribute); return Element.Methods.Simulated.hasAttribute(element, attribute); }; | var Prototype={Version:"1.6.1",Browser:(function(){var b=navigator.userAgent;var a=Object.prototype.toString.call(window.opera)=="[object Opera]";return{IE:!!window.attachEvent&&!a,Opera:a,WebKit:b.indexOf("AppleWebKit/")>-1,Gecko:b.indexOf("Gecko")>-1&&b.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile.*Safari/.test(b)}})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var a=window.Element||window.HTMLElement;return !!(a&&a.prototype)})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=="undefined"){return true}var c=document.createElement("div");var b=document.createElement("form");var a=false;if(c.__proto__&&(c.__proto__!==b.__proto__)){a=true}c=b=null;return a})()},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Abstract={};var Try={these:function(){var c;for(var b=0,d=arguments.length;b<d;b++){var a=arguments[b];try{c=a();break}catch(f){}}return c}};var Class=(function(){function a(){}function b(){var g=null,f=$A(arguments);if(Object.isFunction(f[0])){g=f.shift()}function d(){this.initialize.apply(this,arguments)}Object.extend(d,Class.Methods);d.superclass=g;d.subclasses=[];if(g){a.prototype=g.prototype;d.prototype=new a;g.subclasses.push(d)}for(var e=0;e<f.length;e++){d.addMethods(f[e])}if(!d.prototype.initialize){d.prototype.initialize=Prototype.emptyFunction}d.prototype.constructor=d;return d}function c(k){var f=this.superclass&&this.superclass.prototype;var e=Object.keys(k);if(!Object.keys({toString:true}).length){if(k.toString!=Object.prototype.toString){e.push("toString")}if(k.valueOf!=Object.prototype.valueOf){e.push("valueOf")}}for(var d=0,g=e.length;d<g;d++){var j=e[d],h=k[j];if(f&&Object.isFunction(h)&&h.argumentNames().first()=="$super"){var l=h;h=(function(i){return function(){return f[i].apply(this,arguments)}})(j).wrap(l);h.valueOf=l.valueOf.bind(l);h.toString=l.toString.bind(l)}this.prototype[j]=h}return this}return{create:b,Methods:{addMethods:c}}})();(function(){var d=Object.prototype.toString;function i(q,s){for(var r in s){q[r]=s[r]}return q}function l(q){try{if(e(q)){return"undefined"}if(q===null){return"null"}return q.inspect?q.inspect():String(q)}catch(r){if(r instanceof RangeError){return"..."}throw r}}function k(q){var s=typeof q;switch(s){case"undefined":case"function":case"unknown":return;case"boolean":return q.toString()}if(q===null){return"null"}if(q.toJSON){return q.toJSON()}if(h(q)){return}var r=[];for(var u in q){var t=k(q[u]);if(!e(t)){r.push(u.toJSON()+": "+t)}}return"{"+r.join(", ")+"}"}function c(q){return $H(q).toQueryString()}function f(q){return q&&q.toHTML?q.toHTML():String.interpret(q)}function o(q){var r=[];for(var s in q){r.push(s)}return r}function m(q){var r=[];for(var s in q){r.push(q[s])}return r}function j(q){return i({},q)}function h(q){return !!(q&&q.nodeType==1)}function g(q){return d.call(q)=="[object Array]"}function p(q){return q instanceof Hash}function b(q){return typeof q==="function"}function a(q){return d.call(q)=="[object String]"}function n(q){return d.call(q)=="[object Number]"}function e(q){return typeof q==="undefined"}i(Object,{extend:i,inspect:l,toJSON:k,toQueryString:c,toHTML:f,keys:o,values:m,clone:j,isElement:h,isArray:g,isHash:p,isFunction:b,isString:a,isNumber:n,isUndefined:e})})();Object.extend(Function.prototype,(function(){var k=Array.prototype.slice;function d(o,l){var n=o.length,m=l.length;while(m--){o[n+m]=l[m]}return o}function i(m,l){m=k.call(m,0);return d(m,l)}function g(){var l=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\ | Element.hasAttribute = function(element, attribute) { if (element.hasAttribute) return element.hasAttribute(attribute); return Element.Methods.Simulated.hasAttribute(element, attribute);}; |
b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var i=c(this);i.toggleClass(a.call(this,e,i.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,i=0,j=c(this),o=b,p=a.split(fa);e=p[i++];){o=f?o:!j.hasClass(e);j[o?"addClass":"removeClass"](e)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className=this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a= " "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(za," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var i=b?d:0;for(d=b?d+1:e.length;i<d;i++){var j=e[i];if(j.selected){a=c(j).val();if(b)return a;f.push(a)}}return f}if(Aa.test(b.type)&& | this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(Aa," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j<d;j++){var i= | b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var i=c(this);i.toggleClass(a.call(this,e,i.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,i=0,j=c(this),o=b,p=a.split(fa);e=p[i++];){o=f?o:!j.hasClass(e);j[o?"addClass":"removeClass"](e)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className=this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(za," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var i=b?d:0;for(d=b?d+1:e.length;i<d;i++){var j=e[i];if(j.selected){a=c(j).val();if(b)return a;f.push(a)}}return f}if(Aa.test(b.type)&& |
hasClassName: function(element, className) { if (!(element = $(element))) return; var elementClassName = element.className; return (elementClassName.length > 0 && (elementClassName == className || new RegExp("(^|\\s)" + className + "(\\s|$)").test(elementClassName))); }, | 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])*?\*\ | hasClassName: function(element, className) { if (!(element = $(element))) return; var elementClassName = element.className; return (elementClassName.length > 0 && (elementClassName == className || new RegExp("(^|\\s)" + className + "(\\s|$)").test(elementClassName))); }, |
for (let [cmd, args] in this._subCommands(command)) | for (let [cmd, args] in this.subCommands(command)) | hasDomain: function (command, host) { try { for (let [cmd, args] in this._subCommands(command)) if (Array.concat(cmd.domains(args)).some(function (domain) util.isSubdomain(domain, host))) return true; } catch (e) { dactyl.reportError(e); } return false; }, |
let [, head, tail] = spec.match(/([^[]+)(?:\[(.*)])?/); | let [, head, tail] = /([^[]+)(?:\[(.*)])?/.exec(spec); | hasName: function (name) { return this.specs.some(function (spec) { let [, head, tail] = spec.match(/([^[]+)(?:\[(.*)])?/); return name.indexOf(head) == 0 && (head + (tail || "")).indexOf(name) == 0; }); }, |
if (observers && observers.members.length > 0) return YES ; | if (observers && observers.getMembers().length > 0) return YES ; | hasObserverFor: function(key) { SC.Observers.flush(this) ; // hookup as many observers as possible. var observers = this[SC.keyFor('_kvo_observers', key)], locals = this[SC.keyFor('_kvo_local', key)], members ; if (locals && locals.length>0) return YES ; if (observers && observers.members.length > 0) return YES ; return NO ; }, |
for (let [cmd, args] in this._subCommands(command)) | for (let [cmd, args] in this.subCommands(command)) | hasPrivateData: function (command) { for (let [cmd, args] in this._subCommands(command)) if (cmd.privateData) return !callable(cmd.privateData) || cmd.privateData(args); return false; }, |
var bindingType = bindingTypeByType(bindingTypes, bindings[i].type); | var bindingType = objectByType(bindings[i].type, bindingTypes); | function hasSufficientColumns(bindingTypes, xsdTypes, bindings){ for (var i in bindings) { var columns = columnsByBinding(bindings[i], xsdTypes); var bindingType = bindingTypeByType(bindingTypes, bindings[i].type);//alert("BINDING TYPE: " + bindingType.toSource());//alert(binding.type + " Columns: " + columns.length + " Cardinality: " + binding.cardinality); if ("cardinality" in bindingType && bindingType.cardinality > columns.length) return false; if ("minCardinality" in bindingType && bindingType.minCardinality > columns.length) return false; } return true;} |
<ul><li>F1 will bring up this screen. </li>\ | <ul> \ | Speeqe.helpDialogInit = function() { var help_dialog_html = " <div id=\"popupContact\"> \ <a id=\"popupContactClose\">x</a> \ <h1>Speeqe Help.</h1> \ <p id=\"contactArea\"> \ <h2>Keyboard shortcuts.</h2> \ <ul><li>F1 will bring up this screen. </li>\ <li>TAB followed by character(s) will attempt to complete a nick name in the roster list.</li></ul>\ <br/> \ <h2>List of chat commands.</h2> <ul><li>/help : brings up this screen.<li> \ <li>/topic [topic] :changes the room topic if you have permission.</li>\ <li>/join [room name]: opens a new window with the specified room.</li> \ <li>/kick,/ban [user]: Removes user from the room. /ban does so permanently. </li> \ <li>/unban [user]: Allows user to join the room again.</li>\ <li>/nick [nickname]: Changes your nick name to the one specified. </li>\ <li>@nick [message]: Using the @ sign will send a private message to the specified user. </li>\ </ul>" + Speeqe.helpDialogHtml +"<br/><br/> \ Press ESCAPE, Click on X (right-top) or Click Out from the popup to close the popup! \ <br/><br/> \ </p> \ </div><div id=\"backgroundPopup\"></div>"; var helpdialog_elem = $(help_dialog_html); var style_elem = "<link rel=\"stylesheet\" type=\"text/css\" href=\"/css/helpdialog.css\" />"; $("head").append(style_elem); $("body").prepend(helpdialog_elem); //Press Escape event! $(document).keypress(function(e){ var f1_keycode = 112; if(jQuery.browser.safari) { f1_keycode = 63236; } if(e.keyCode==27 && Speeqe.helpDialogStatus==1) { Speeqe.closeHelpDialog(); } if(e.keyCode == f1_keycode) { Speeqe.loadHelpDialog(); return false; } }); //Click the x event! $("#popupContactClose").click(function(){ Speeqe.closeHelpDialog(); }); //Click out event! $("#backgroundPopup").click(function(){ Speeqe.closeHelpDialog(); }); }; |
var f1_keycode = 112; if(jQuery.browser.safari) { f1_keycode = 63236; } | Speeqe.helpDialogInit = function() { var help_dialog_html = " <div id=\"popupContact\"> \ <a id=\"popupContactClose\">x</a> \ <h1>Speeqe Help.</h1> \ <p id=\"contactArea\"> \ <h2>Keyboard shortcuts.</h2> \ <ul><li>F1 will bring up this screen. </li>\ <li>TAB followed by character(s) will attempt to complete a nick name in the roster list.</li></ul>\ <br/> \ <h2>List of chat commands.</h2> <ul><li>/help : brings up this screen.<li> \ <li>/topic [topic] :changes the room topic if you have permission.</li>\ <li>/join [room name]: opens a new window with the specified room.</li> \ <li>/kick,/ban [user]: Removes user from the room. /ban does so permanently. </li> \ <li>/unban [user]: Allows user to join the room again.</li>\ <li>/nick [nickname]: Changes your nick name to the one specified. </li>\ <li>@nick [message]: Using the @ sign will send a private message to the specified user. </li>\ </ul>" + Speeqe.helpDialogHtml +"<br/><br/> \ Press ESCAPE, Click on X (right-top) or Click Out from the popup to close the popup! \ <br/><br/> \ </p> \ </div><div id=\"backgroundPopup\"></div>"; var helpdialog_elem = $(help_dialog_html); var style_elem = "<link rel=\"stylesheet\" type=\"text/css\" href=\"/css/helpdialog.css\" />"; $("head").append(style_elem); $("body").prepend(helpdialog_elem); //Press Escape event! $(document).keypress(function(e){ var f1_keycode = 112; if(jQuery.browser.safari) { f1_keycode = 63236; } if(e.keyCode==27 && Speeqe.helpDialogStatus==1) { Speeqe.closeHelpDialog(); } if(e.keyCode == f1_keycode) { Speeqe.loadHelpDialog(); return false; } }); //Click the x event! $("#popupContactClose").click(function(){ Speeqe.closeHelpDialog(); }); //Click out event! $("#backgroundPopup").click(function(){ Speeqe.closeHelpDialog(); }); }; |
|
if(e.keyCode == f1_keycode) { Speeqe.loadHelpDialog(); return false; } | Speeqe.helpDialogInit = function() { var help_dialog_html = " <div id=\"popupContact\"> \ <a id=\"popupContactClose\">x</a> \ <h1>Speeqe Help.</h1> \ <p id=\"contactArea\"> \ <h2>Keyboard shortcuts.</h2> \ <ul><li>F1 will bring up this screen. </li>\ <li>TAB followed by character(s) will attempt to complete a nick name in the roster list.</li></ul>\ <br/> \ <h2>List of chat commands.</h2> <ul><li>/help : brings up this screen.<li> \ <li>/topic [topic] :changes the room topic if you have permission.</li>\ <li>/join [room name]: opens a new window with the specified room.</li> \ <li>/kick,/ban [user]: Removes user from the room. /ban does so permanently. </li> \ <li>/unban [user]: Allows user to join the room again.</li>\ <li>/nick [nickname]: Changes your nick name to the one specified. </li>\ <li>@nick [message]: Using the @ sign will send a private message to the specified user. </li>\ </ul>" + Speeqe.helpDialogHtml +"<br/><br/> \ Press ESCAPE, Click on X (right-top) or Click Out from the popup to close the popup! \ <br/><br/> \ </p> \ </div><div id=\"backgroundPopup\"></div>"; var helpdialog_elem = $(help_dialog_html); var style_elem = "<link rel=\"stylesheet\" type=\"text/css\" href=\"/css/helpdialog.css\" />"; $("head").append(style_elem); $("body").prepend(helpdialog_elem); //Press Escape event! $(document).keypress(function(e){ var f1_keycode = 112; if(jQuery.browser.safari) { f1_keycode = 63236; } if(e.keyCode==27 && Speeqe.helpDialogStatus==1) { Speeqe.closeHelpDialog(); } if(e.keyCode == f1_keycode) { Speeqe.loadHelpDialog(); return false; } }); //Click the x event! $("#popupContactClose").click(function(){ Speeqe.closeHelpDialog(); }); //Click out event! $("#backgroundPopup").click(function(){ Speeqe.closeHelpDialog(); }); }; |
|
f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var qb=K(),rb=/<script(.|\s)*?\/script>/gi,sb=/select|textarea/i,tb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,O=/=\?(&|$)/,ma=/\?/,ub=/(\?|&)_=.*?(&|$)/,vb=/^(\w+:)?\/\/([^\/?#]+)/, | a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b= a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=/<script(.|\s)*?\/script>/gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!== | f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var qb=K(),rb=/<script(.|\s)*?\/script>/gi,sb=/select|textarea/i,tb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,O=/=\?(&|$)/,ma=/\?/,ub=/(\?|&)_=.*?(&|$)/,vb=/^(\w+:)?\/\/([^\/?#]+)/, |
hide: function(){ this.onLoad(); }, | hide : function(){ this.focus.defer(10, this); var ml = this.menuListeners; this.menu.un("select", ml.select, this); this.menu.un("show", ml.show, this); this.menu.un("hide", ml.hide, this); } | hide: function(){ this.onLoad(); }, |
if (this._top) this._top.removeEventListener("resize", this._resizeTimer.closure.tell, true); this._top = null; | hide: function () { this._removeHints(0); }, |
|
"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= | "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= |
hide: function(element) { element = $(element); element.style.display = 'none'; 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])*?\*\ | hide: function(element) { element = $(element); element.style.display = 'none'; return element; }, |
$('blocker').remove(); $$('.loader').invoke('removeClassName', 'loadingImage').invoke('update', lastStr); | var loaders = $$('.loader'); if (loaders.length > 0) { loaders.invoke('removeClassName', 'loadingImage').invoke('update', lastStr); } | var hideLoading = function(ajaxObj) { $('blocker').remove(); $$('.loader').invoke('removeClassName', 'loadingImage').invoke('update', lastStr); // focus all first form input element var inputEl = $$('input[type=text]'); if (inputEl.length > 0) {inputEl[0].focus();} $(lastAJAXcontainer).registerAJAXEvents();} |
$$('input[type=text]')[0].focus(); | var inputEl = $$('input[type=text]'); if (inputEl.length > 0) {inputEl[0].focus();} | var hideLoading = function(ajaxObj){ $('blocker').remove(); $$('.loader').invoke('removeClassName', 'loadingImage').invoke('update', lastStr); // focus all first form input element $$('input[type=text]')[0].focus(); $(lastAJAXcontainer).registerAJAXEvents();} |
if (this.get('escapeHTML')) hintVal = SC.RenderContext.escapeHTML(hintVal); | hintValue: function() { var hintVal = this.get('hint'); if (this.get('escapeHTML')) hintVal = SC.RenderContext.escapeHTML(hintVal); return hintVal ; }.property('hint', 'escapeHTML').cacheable(), |
|
}.property('hint', 'escapeHTML').cacheable(), | }.property('hint').cacheable(), | hintValue: function() { var hintVal = this.get('hint'); if (this.get('escapeHTML')) hintVal = SC.RenderContext.escapeHTML(hintVal); return hintVal ; }.property('hint', 'escapeHTML').cacheable(), |
this.addUndoLevel(this.updateTo(i,"applyChain"));this.notifyEnvironment();return this.chainNode(i)}},clear:function(){this.history=[];this.redoHistory=[]},historySize:function(){return{undo:this.history.length,redo:this.redoHistory.length}},push:function(i,p,k){for(var n=[],o=0;o<k.length;o++){var q=o==k.length-1?p:this.container.ownerDocument.createElement("BR");n.push({from:i,to:q,text:cleanText(k[o])});i=q}this.pushChains([n],i==null&&p==null);this.notifyEnvironment()},pushChains:function(i,p){this.commit(p); | 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= | this.addUndoLevel(this.updateTo(i,"applyChain"));this.notifyEnvironment();return this.chainNode(i)}},clear:function(){this.history=[];this.redoHistory=[]},historySize:function(){return{undo:this.history.length,redo:this.redoHistory.length}},push:function(i,p,k){for(var n=[],o=0;o<k.length;o++){var q=o==k.length-1?p:this.container.ownerDocument.createElement("BR");n.push({from:i,to:q,text:cleanText(k[o])});i=q}this.pushChains([n],i==null&&p==null);this.notifyEnvironment()},pushChains:function(i,p){this.commit(p); |
b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}},toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b|| a)},live:function(a,b,d){if(c.isFunction(b)){d=b;b=w}c(this.context).bind(ra(a,this.selector),{data:b,selector:this.selector,live:a},d);return this},die:function(a,b){c(this.context).unbind(ra(a,this.selector),b?{guid:b.guid+this.selector+a}:null);return this}});c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){c.fn[b]=function(d){return d? | toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Ga={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,f,e,j){var i,o=0,k,n,r=j||this.selector, | b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}},toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},live:function(a,b,d){if(c.isFunction(b)){d=b;b=w}c(this.context).bind(ra(a,this.selector),{data:b,selector:this.selector,live:a},d);return this},die:function(a,b){c(this.context).unbind(ra(a,this.selector),b?{guid:b.guid+this.selector+a}:null);return this}});c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){c.fn[b]=function(d){return d? |
"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ga,"").replace(Y,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ta(this,b);ta(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType=== 1?this[0].innerHTML.replace(Ga,""):null;else if(typeof a==="string"&&!/<script/i.test(a)&&(c.support.leadingWhitespace||!Y.test(a))&&!G[(Ha.exec(a)||["",""])[1].toLowerCase()])try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){T(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}else c.isFunction(a)?this.each(function(e){var i=c(this),j=i.html();i.empty().append(function(){return a.call(this,e,j)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&& | return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja, ""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}}else c.isFunction(a)?this.each(function(e){var j=c(this),i=j.html();j.empty().append(function(){return a.call(this,e,i)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&& | "after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ga,"").replace(Y,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ta(this,b);ta(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ga,""):null;else if(typeof a==="string"&&!/<script/i.test(a)&&(c.support.leadingWhitespace||!Y.test(a))&&!G[(Ha.exec(a)||["",""])[1].toLowerCase()])try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){T(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}else c.isFunction(a)?this.each(function(e){var i=c(this),j=i.html();i.empty().append(function(){return a.call(this,e,j)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&& |
if (value === undefined) return jQuery.fn.html.apply(this, arguments); | if (value === undefined) { if (this.length < 1) return undefined; return jQuery.Buffer.bufferForElement(this[i]).html(); } | html: function(value) { // if there is no value, we don't handle it. if (value === undefined) return jQuery.fn.html.apply(this, arguments); // there is a vlaue. We are going to do it like jquery, but different. // in this, we inline "buffers" above var len = this.length, i; for (i = 0; i < len; i++) { var buffer = jQuery.Buffer.bufferForElement(this[i]); buffer.html(value); } return this; }, |
"file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;if(e&&a.documentElement.nodeName==="parsererror")throw"parsererror";if(d&& d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&f.indexOf("json")>=0)if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))a=A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+a))();else throw"Invalid JSON: "+a;else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(e,i){i= | 1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b=== "json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional; | "file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;if(e&&a.documentElement.nodeName==="parsererror")throw"parsererror";if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&f.indexOf("json")>=0)if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))a=A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+a))();else throw"Invalid JSON: "+a;else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(e,i){i= |
"file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;if(e&&a.documentElement.nodeName==="parsererror")throw"parsererror";if(d&& | 1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b=== | "file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;if(e&&a.documentElement.nodeName==="parsererror")throw"parsererror";if(d&& |
null}};try{var h=x.abort;x.abort=function(){if(x){h.call(x);if(x)x.readyState=0}g()}}catch(k){}e.async&&e.timeout>0&&setTimeout(function(){x&&!F&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||A,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol=== "file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;if(e&&a.documentElement.nodeName==="parsererror")throw"parsererror";if(d&& | g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status=== 1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b=== | null}};try{var h=x.abort;x.abort=function(){if(x){h.call(x);if(x)x.readyState=0}g()}}catch(k){}e.async&&e.timeout>0&&setTimeout(function(){x&&!F&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||A,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;if(e&&a.documentElement.nodeName==="parsererror")throw"parsererror";if(d&& |
equals(view.$('img.icon').size(), 0, 'should not have image'); | ok(!cq.hasClass('has-icon'), "should not have has-icon class"); equals(iconCQ.size(), 0, 'should not have image'); | function icon(view, spriteName) { if (spriteName === null) { equals(view.$('img.icon').size(), 0, 'should not have image'); } else { var cq = view.$('img.icon'); equals(cq.size(), 1, 'should have icon'); ok(cq.hasClass(spriteName), 'icon should have class name %@'.fmt(spriteName)); }} |
var cq = view.$('img.icon'); equals(cq.size(), 1, 'should have icon'); ok(cq.hasClass(spriteName), 'icon should have class name %@'.fmt(spriteName)); | ok(cq.hasClass('has-icon'), "should have has-icon class"); equals(iconCQ.size(), 1, 'should have icon'); ok(iconCQ.hasClass(spriteName), 'icon should have class name %@'.fmt(spriteName)); | function icon(view, spriteName) { if (spriteName === null) { equals(view.$('img.icon').size(), 0, 'should not have image'); } else { var cq = view.$('img.icon'); equals(cq.size(), 1, 'should have icon'); ok(cq.hasClass(spriteName), 'icon should have class name %@'.fmt(spriteName)); }} |
TYPO3.Backend.Seminars.IconRenderer = function(value, metaData, record, rowIndex, colIndex, store) { metaData.css = value; | TYPO3.Backend.Seminars.Organizers.IconRenderer = function(value, metaData, record, rowIndex, colIndex, store) { metaData.css = 'typo3-backend-seminars-organizer-icon'; | TYPO3.Backend.Seminars.IconRenderer = function(value, metaData, record, rowIndex, colIndex, store) { metaData.css = value; metaData.attr = ' title="id=' + record.get('uid') + '";' return '';}; |
h=h.getElementsByName(g[1]);for(var m=0,r=h.length;m<r;m++)h[m].getAttribute("name")===g[1]&&k.push(h[m]);return k.length===0?null:k}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,k,m,r,q){g=" "+g[1].replace(/\\/g,"")+" ";if(q)return g;q=0;for(var v;(v=h[q])!=null;q++)if(v)if(r^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))k||m.push(v);else if(k)h[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()}, | q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML="<a href='#'></a>"; | h=h.getElementsByName(g[1]);for(var m=0,r=h.length;m<r;m++)h[m].getAttribute("name")===g[1]&&k.push(h[m]);return k.length===0?null:k}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,k,m,r,q){g=" "+g[1].replace(/\\/g,"")+" ";if(q)return g;q=0;for(var v;(v=h[q])!=null;q++)if(v)if(r^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))k||m.push(v);else if(k)h[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()}, |
identify: function(element) { element = $(element); var id = element.readAttribute('id'), self = arguments.callee; if (id) return id; do { id = 'anonymous_element_' + self.counter++ } while ($(id)); element.writeAttribute('id', id); return id; }, | 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])*?\*\ | identify: function(element) { element = $(element); var id = element.readAttribute('id'), self = arguments.callee; if (id) return id; do { id = 'anonymous_element_' + self.counter++ } while ($(id)); element.writeAttribute('id', id); return id; }, |
if (isVisible(f.frameElement)) { | if (elem instanceof HTMLAreaElement) | if (isVisible(f.frameElement)) { |
timeout : 5000, | ignore: function(word) { AtD_ajax_load('show'); jQuery.ajax({ type : 'POST', url : AtD.rpc_ignore + encodeURI( word ).replace( /&/g, '%26'), data: "action=atd_ignore", format : 'raw', error : function(XHR, status, error) { if (AtD.callback_f != undefined && AtD.callback_f.error != undefined) AtD.callback_f.error(status + ": " + error); }, success : function() { AtD_ajax_load('hide'); } }); } |
|
height:220, | height:230, | DcmgrGUI.prototype.imagePanel = function(){ var total = 0; var maxrow = 10; var page = 1; var list_request = { "url":DcmgrGUI.Util.getPagePath('/images/list/',page), "data" : DcmgrGUI.Util.getPagenateData(page,maxrow) } DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "id":'', "wmi_id":'', "source":'', "owner":'', "visibility":'', "state":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "name" : "-", "description" : "-", "source" : "-", "owner" : "-", "visibility" : "-", "product_code" : "-", "state" : "-", "karnel_id":"-", "platform" : "-", "root_device_type":"-", "root_device":"-", "image_size":"-", "block_devices":"-", "virtualization":"", "state_reason":"-" } } var c_pagenate = new DcmgrGUI.Pagenate({ row:maxrow, total:total }); var c_list = new DcmgrGUI.List({ element_id:'#display_images', template_id:'#imagesListTemplate', maxrow:maxrow, page:page }); c_list.setDetailTemplate({ template_id:'#imagesDetailTemplate', detail_path:'/images/show/' }); c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ var image = params.data.image; c_pagenate.changeTotal(image.owner_total); c_list.setData(image.results); c_list.singleCheckList(c_list.detail_template); }); var bt_refresh = new DcmgrGUI.Refresh(); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ c_list.page = c_pagenate.current_page; list_request.url = DcmgrGUI.Util.getPagePath('/images/list/',c_pagenate.current_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){ //remove $($('#detail').find('#'+check_id)).remove(); //update c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/images/show/',check_id) },true); }); }); c_pagenate.element.bind('dcmgrGUI.updatePagenate',function(){ c_list.clearCheckedList(); $('#detail').html(''); bt_refresh.element.trigger('dcmgrGUI.refresh'); }); var bt_launch_instance = new DcmgrGUI.Dialog({ target:'.launch_instance', width:400, height:220, title:'Launch Instance', path:'/launch_instance', button:{ "Launch": function() { var image_id = $(this).find('#image_id').val(); var host_pool_id = $(this).find('#host_pool_id').val(); var instance_spec = $(this).find('#instance_spec').val(); var data = "image_id="+image_id +"&host_pool_id="+host_pool_id +"&instance_spec="+instance_spec; $.ajax({ "type": "POST", "async": true, "url": '/instances/create', "dataType": "json", "data": data, success: function(json,status){ console.log(json); } }); $(this).dialog("close"); } } }); bt_launch_instance.target.bind('click',function(){ var id = c_list.currentChecked(); if( id ){ bt_launch_instance.open({"ids":[id]}); } return false; }); //list c_list.setData(null); c_list.update(list_request,true);} |
c_list.element.bind('dcmgrGUI.beforeUpdate',function(){ $("#list_load_mask").mask("Loading..."); }); | DcmgrGUI.prototype.imagePanel = function(){ var total = 0; var maxrow = 10; var page = 1; var list_request = { "url":DcmgrGUI.Util.getPagePath('/images/list/',page), "data" : DcmgrGUI.Util.getPagenateData(page,maxrow) } DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "id":'', "wmi_id":'', "source":'', "owner":'', "visibility":'', "state":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "name" : "-", "description" : "-", "source" : "-", "owner" : "-", "visibility" : "-", "product_code" : "-", "state" : "-", "karnel_id":"-", "platform" : "-", "root_device_type":"-", "root_device":"-", "image_size":"-", "block_devices":"-", "virtualization":"", "state_reason":"-" } } var c_pagenate = new DcmgrGUI.Pagenate({ row:maxrow, total:total }); var c_list = new DcmgrGUI.List({ element_id:'#display_images', template_id:'#imagesListTemplate', maxrow:maxrow, page:page }); c_list.setDetailTemplate({ template_id:'#imagesDetailTemplate', detail_path:'/images/show/' }); c_list.element.bind('dcmgrGUI.beforeUpdate',function(){ $("#list_load_mask").mask("Loading..."); }); c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ var image = params.data.image; c_pagenate.changeTotal(image.owner_total); c_list.setData(image.results); c_list.singleCheckList(c_list.detail_template); $("#list_load_mask").unmask(); }); var bt_refresh = new DcmgrGUI.Refresh(); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ c_list.page = c_pagenate.current_page; list_request.url = DcmgrGUI.Util.getPagePath('/images/list/',c_pagenate.current_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){ //remove $($('#detail').find('#'+check_id)).remove(); //update c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/images/show/',check_id) },true); }); }); c_pagenate.element.bind('dcmgrGUI.updatePagenate',function(){ c_list.clearCheckedList(); $('#detail').html(''); bt_refresh.element.trigger('dcmgrGUI.refresh'); }); var bt_launch_instance = new DcmgrGUI.Dialog({ target:'.launch_instance', width:400, height:200, title:'Launch Instance', path:'/launch_instance', button:{ "Launch": function() { var image_id = $('#image_id').text(); var host_pool_id = $('#host_pool_id').text(); var instance_spec = $('#instance_spec').text(); var data = "image_id="+image_id +"&host_pool_id="+host_pool_id +"&instance_spec="+instance_spec; $.ajax({ "type": "POST", "async": true, "url": '/instances/create', "dataType": "json", "data": data, success: function(json,status){ console.log(json); } }); $(this).dialog("close"); } } }); bt_launch_instance.target.bind('click',function(){ var id = c_list.currentChecked(); if( id ){ bt_launch_instance.open(id); } return false; }); //list c_list.setData(null); c_list.update(list_request,true);} |
|
$("#list_load_mask").unmask(); | DcmgrGUI.prototype.imagePanel = function(){ var total = 0; var maxrow = 10; var page = 1; var list_request = { "url":DcmgrGUI.Util.getPagePath('/images/list/',page), "data" : DcmgrGUI.Util.getPagenateData(page,maxrow) } DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "id":'', "wmi_id":'', "source":'', "owner":'', "visibility":'', "state":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "name" : "-", "description" : "-", "source" : "-", "owner" : "-", "visibility" : "-", "product_code" : "-", "state" : "-", "karnel_id":"-", "platform" : "-", "root_device_type":"-", "root_device":"-", "image_size":"-", "block_devices":"-", "virtualization":"", "state_reason":"-" } } var c_pagenate = new DcmgrGUI.Pagenate({ row:maxrow, total:total }); var c_list = new DcmgrGUI.List({ element_id:'#display_images', template_id:'#imagesListTemplate', maxrow:maxrow, page:page }); c_list.setDetailTemplate({ template_id:'#imagesDetailTemplate', detail_path:'/images/show/' }); c_list.element.bind('dcmgrGUI.beforeUpdate',function(){ $("#list_load_mask").mask("Loading..."); }); c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ var image = params.data.image; c_pagenate.changeTotal(image.owner_total); c_list.setData(image.results); c_list.singleCheckList(c_list.detail_template); $("#list_load_mask").unmask(); }); var bt_refresh = new DcmgrGUI.Refresh(); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ c_list.page = c_pagenate.current_page; list_request.url = DcmgrGUI.Util.getPagePath('/images/list/',c_pagenate.current_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){ //remove $($('#detail').find('#'+check_id)).remove(); //update c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/images/show/',check_id) },true); }); }); c_pagenate.element.bind('dcmgrGUI.updatePagenate',function(){ c_list.clearCheckedList(); $('#detail').html(''); bt_refresh.element.trigger('dcmgrGUI.refresh'); }); var bt_launch_instance = new DcmgrGUI.Dialog({ target:'.launch_instance', width:400, height:200, title:'Launch Instance', path:'/launch_instance', button:{ "Launch": function() { var image_id = $('#image_id').text(); var host_pool_id = $('#host_pool_id').text(); var instance_spec = $('#instance_spec').text(); var data = "image_id="+image_id +"&host_pool_id="+host_pool_id +"&instance_spec="+instance_spec; $.ajax({ "type": "POST", "async": true, "url": '/instances/create', "dataType": "json", "data": data, success: function(json,status){ console.log(json); } }); $(this).dialog("close"); } } }); bt_launch_instance.target.bind('click',function(){ var id = c_list.currentChecked(); if( id ){ bt_launch_instance.open(id); } return false; }); //list c_list.setData(null); c_list.update(list_request,true);} |
|
var list_request = { "url":DcmgrGUI.Util.getPagePath('/images/show/',1) } | var c_pagenate = new DcmgrGUI.Pagenate({ row:maxrow, total:total }); | DcmgrGUI.prototype.imagePanel = function(){ DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "id":'', "wmi_id":'', "source":'', "owner":'', "visibility":'', "state":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "name" : "-", "description" : "-", "source" : "-", "owner" : "-", "visibility" : "-", "product_code" : "-", "state" : "-", "karnel_id":"-", "platform" : "-", "root_device_type":"-", "root_device":"-", "image_size":"-", "block_devices":"-", "virtualization":"", "state_reason":"-" } } var list_request = { "url":DcmgrGUI.Util.getPagePath('/images/show/',1) } var c_list = new DcmgrGUI.List({ element_id:'#display_images', template_id:'#imagesListTemplate' }); c_list.setDetailTemplate({ template_id:'#imagesDetailTemplate', detail_path:'/images/detail/' }); c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ c_list.setData(params.data); c_list.multiCheckList(c_list.detail_template); }); var c_pagenate = new DcmgrGUI.Pagenate({ row:10, total:30 //todo:get total from dcmgr }); var bt_refresh = new DcmgrGUI.Refresh(); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ list_request.url = DcmgrGUI.Util.getPagePath('/images/show/',c_pagenate.current_page); c_list.element.trigger('dcmgrGUI.updateList',{request:list_request}) //update detail $.each(c_list.checked_list,function(check_id,obj){ //remove $($('#detail').find('#'+check_id)).remove(); //update c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/images/detail/',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);} |
template_id:'#imagesListTemplate' | template_id:'#imagesListTemplate', maxrow:maxrow, page:page | DcmgrGUI.prototype.imagePanel = function(){ DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "id":'', "wmi_id":'', "source":'', "owner":'', "visibility":'', "state":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "name" : "-", "description" : "-", "source" : "-", "owner" : "-", "visibility" : "-", "product_code" : "-", "state" : "-", "karnel_id":"-", "platform" : "-", "root_device_type":"-", "root_device":"-", "image_size":"-", "block_devices":"-", "virtualization":"", "state_reason":"-" } } var list_request = { "url":DcmgrGUI.Util.getPagePath('/images/show/',1) } var c_list = new DcmgrGUI.List({ element_id:'#display_images', template_id:'#imagesListTemplate' }); c_list.setDetailTemplate({ template_id:'#imagesDetailTemplate', detail_path:'/images/detail/' }); c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ c_list.setData(params.data); c_list.multiCheckList(c_list.detail_template); }); var c_pagenate = new DcmgrGUI.Pagenate({ row:10, total:30 //todo:get total from dcmgr }); var bt_refresh = new DcmgrGUI.Refresh(); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ list_request.url = DcmgrGUI.Util.getPagePath('/images/show/',c_pagenate.current_page); c_list.element.trigger('dcmgrGUI.updateList',{request:list_request}) //update detail $.each(c_list.checked_list,function(check_id,obj){ //remove $($('#detail').find('#'+check_id)).remove(); //update c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/images/detail/',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);} |
detail_path:'/images/detail/' | detail_path:'/images/show/' | DcmgrGUI.prototype.imagePanel = function(){ DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "id":'', "wmi_id":'', "source":'', "owner":'', "visibility":'', "state":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "name" : "-", "description" : "-", "source" : "-", "owner" : "-", "visibility" : "-", "product_code" : "-", "state" : "-", "karnel_id":"-", "platform" : "-", "root_device_type":"-", "root_device":"-", "image_size":"-", "block_devices":"-", "virtualization":"", "state_reason":"-" } } var list_request = { "url":DcmgrGUI.Util.getPagePath('/images/show/',1) } var c_list = new DcmgrGUI.List({ element_id:'#display_images', template_id:'#imagesListTemplate' }); c_list.setDetailTemplate({ template_id:'#imagesDetailTemplate', detail_path:'/images/detail/' }); c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ c_list.setData(params.data); c_list.multiCheckList(c_list.detail_template); }); var c_pagenate = new DcmgrGUI.Pagenate({ row:10, total:30 //todo:get total from dcmgr }); var bt_refresh = new DcmgrGUI.Refresh(); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ list_request.url = DcmgrGUI.Util.getPagePath('/images/show/',c_pagenate.current_page); c_list.element.trigger('dcmgrGUI.updateList',{request:list_request}) //update detail $.each(c_list.checked_list,function(check_id,obj){ //remove $($('#detail').find('#'+check_id)).remove(); //update c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/images/detail/',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);} |
c_list.setData(params.data); | var image = params.data.image; c_pagenate.changeTotal(image.owner_total); c_list.setData(image.results); | DcmgrGUI.prototype.imagePanel = function(){ DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "id":'', "wmi_id":'', "source":'', "owner":'', "visibility":'', "state":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "name" : "-", "description" : "-", "source" : "-", "owner" : "-", "visibility" : "-", "product_code" : "-", "state" : "-", "karnel_id":"-", "platform" : "-", "root_device_type":"-", "root_device":"-", "image_size":"-", "block_devices":"-", "virtualization":"", "state_reason":"-" } } var list_request = { "url":DcmgrGUI.Util.getPagePath('/images/show/',1) } var c_list = new DcmgrGUI.List({ element_id:'#display_images', template_id:'#imagesListTemplate' }); c_list.setDetailTemplate({ template_id:'#imagesDetailTemplate', detail_path:'/images/detail/' }); c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ c_list.setData(params.data); c_list.multiCheckList(c_list.detail_template); }); var c_pagenate = new DcmgrGUI.Pagenate({ row:10, total:30 //todo:get total from dcmgr }); var bt_refresh = new DcmgrGUI.Refresh(); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ list_request.url = DcmgrGUI.Util.getPagePath('/images/show/',c_pagenate.current_page); c_list.element.trigger('dcmgrGUI.updateList',{request:list_request}) //update detail $.each(c_list.checked_list,function(check_id,obj){ //remove $($('#detail').find('#'+check_id)).remove(); //update c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/images/detail/',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);} |
}); var c_pagenate = new DcmgrGUI.Pagenate({ row:10, total:30 | DcmgrGUI.prototype.imagePanel = function(){ DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "id":'', "wmi_id":'', "source":'', "owner":'', "visibility":'', "state":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "name" : "-", "description" : "-", "source" : "-", "owner" : "-", "visibility" : "-", "product_code" : "-", "state" : "-", "karnel_id":"-", "platform" : "-", "root_device_type":"-", "root_device":"-", "image_size":"-", "block_devices":"-", "virtualization":"", "state_reason":"-" } } var list_request = { "url":DcmgrGUI.Util.getPagePath('/images/show/',1) } var c_list = new DcmgrGUI.List({ element_id:'#display_images', template_id:'#imagesListTemplate' }); c_list.setDetailTemplate({ template_id:'#imagesDetailTemplate', detail_path:'/images/detail/' }); c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ c_list.setData(params.data); c_list.multiCheckList(c_list.detail_template); }); var c_pagenate = new DcmgrGUI.Pagenate({ row:10, total:30 //todo:get total from dcmgr }); var bt_refresh = new DcmgrGUI.Refresh(); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ list_request.url = DcmgrGUI.Util.getPagePath('/images/show/',c_pagenate.current_page); c_list.element.trigger('dcmgrGUI.updateList',{request:list_request}) //update detail $.each(c_list.checked_list,function(check_id,obj){ //remove $($('#detail').find('#'+check_id)).remove(); //update c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/images/detail/',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.url = DcmgrGUI.Util.getPagePath('/images/show/',c_pagenate.current_page); | c_list.page = c_pagenate.current_page; list_request.url = DcmgrGUI.Util.getPagePath('/images/list/',c_pagenate.current_page); list_request.data = DcmgrGUI.Util.getPagenateData(c_list.page,c_list.maxrow) | DcmgrGUI.prototype.imagePanel = function(){ DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "id":'', "wmi_id":'', "source":'', "owner":'', "visibility":'', "state":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "name" : "-", "description" : "-", "source" : "-", "owner" : "-", "visibility" : "-", "product_code" : "-", "state" : "-", "karnel_id":"-", "platform" : "-", "root_device_type":"-", "root_device":"-", "image_size":"-", "block_devices":"-", "virtualization":"", "state_reason":"-" } } var list_request = { "url":DcmgrGUI.Util.getPagePath('/images/show/',1) } var c_list = new DcmgrGUI.List({ element_id:'#display_images', template_id:'#imagesListTemplate' }); c_list.setDetailTemplate({ template_id:'#imagesDetailTemplate', detail_path:'/images/detail/' }); c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ c_list.setData(params.data); c_list.multiCheckList(c_list.detail_template); }); var c_pagenate = new DcmgrGUI.Pagenate({ row:10, total:30 //todo:get total from dcmgr }); var bt_refresh = new DcmgrGUI.Refresh(); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ list_request.url = DcmgrGUI.Util.getPagePath('/images/show/',c_pagenate.current_page); c_list.element.trigger('dcmgrGUI.updateList',{request:list_request}) //update detail $.each(c_list.checked_list,function(check_id,obj){ //remove $($('#detail').find('#'+check_id)).remove(); //update c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/images/detail/',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);} |
url:DcmgrGUI.Util.getPagePath('/images/detail/',check_id) | url:DcmgrGUI.Util.getPagePath('/images/show/',check_id) | DcmgrGUI.prototype.imagePanel = function(){ DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "id":'', "wmi_id":'', "source":'', "owner":'', "visibility":'', "state":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "name" : "-", "description" : "-", "source" : "-", "owner" : "-", "visibility" : "-", "product_code" : "-", "state" : "-", "karnel_id":"-", "platform" : "-", "root_device_type":"-", "root_device":"-", "image_size":"-", "block_devices":"-", "virtualization":"", "state_reason":"-" } } var list_request = { "url":DcmgrGUI.Util.getPagePath('/images/show/',1) } var c_list = new DcmgrGUI.List({ element_id:'#display_images', template_id:'#imagesListTemplate' }); c_list.setDetailTemplate({ template_id:'#imagesDetailTemplate', detail_path:'/images/detail/' }); c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ c_list.setData(params.data); c_list.multiCheckList(c_list.detail_template); }); var c_pagenate = new DcmgrGUI.Pagenate({ row:10, total:30 //todo:get total from dcmgr }); var bt_refresh = new DcmgrGUI.Refresh(); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ list_request.url = DcmgrGUI.Util.getPagePath('/images/show/',c_pagenate.current_page); c_list.element.trigger('dcmgrGUI.updateList',{request:list_request}) //update detail $.each(c_list.checked_list,function(check_id,obj){ //remove $($('#detail').find('#'+check_id)).remove(); //update c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/images/detail/',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);} |
var image_id = $('#image_id').val(); var host_pool_id = $('#host_pool_id').val(); var instance_spec = $('#instance_spec').val(); | var image_id = $(this).find('#image_id').val(); var host_pool_id = $(this).find('#host_pool_id').val(); var instance_spec = $(this).find('#instance_spec').val(); | DcmgrGUI.prototype.imagePanel = function(){ var total = 0; var maxrow = 10; var page = 1; var list_request = { "url":DcmgrGUI.Util.getPagePath('/images/list/',page), "data" : DcmgrGUI.Util.getPagenateData(page,maxrow) } DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "id":'', "wmi_id":'', "source":'', "owner":'', "visibility":'', "state":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "name" : "-", "description" : "-", "source" : "-", "owner" : "-", "visibility" : "-", "product_code" : "-", "state" : "-", "karnel_id":"-", "platform" : "-", "root_device_type":"-", "root_device":"-", "image_size":"-", "block_devices":"-", "virtualization":"", "state_reason":"-" } } var c_pagenate = new DcmgrGUI.Pagenate({ row:maxrow, total:total }); var c_list = new DcmgrGUI.List({ element_id:'#display_images', template_id:'#imagesListTemplate', maxrow:maxrow, page:page }); c_list.setDetailTemplate({ template_id:'#imagesDetailTemplate', detail_path:'/images/show/' }); c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ var image = params.data.image; c_pagenate.changeTotal(image.owner_total); c_list.setData(image.results); c_list.singleCheckList(c_list.detail_template); }); var bt_refresh = new DcmgrGUI.Refresh(); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ c_list.page = c_pagenate.current_page; list_request.url = DcmgrGUI.Util.getPagePath('/images/list/',c_pagenate.current_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){ //remove $($('#detail').find('#'+check_id)).remove(); //update c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/images/show/',check_id) },true); }); }); c_pagenate.element.bind('dcmgrGUI.updatePagenate',function(){ c_list.clearCheckedList(); $('#detail').html(''); bt_refresh.element.trigger('dcmgrGUI.refresh'); }); var bt_launch_instance = new DcmgrGUI.Dialog({ target:'.launch_instance', width:400, height:220, title:'Launch Instance', path:'/launch_instance', button:{ "Launch": function() { var image_id = $('#image_id').val(); var host_pool_id = $('#host_pool_id').val(); var instance_spec = $('#instance_spec').val(); var data = "image_id="+image_id +"&host_pool_id="+host_pool_id +"&instance_spec="+instance_spec; $.ajax({ "type": "POST", "async": true, "url": '/instances/create', "dataType": "json", "data": data, success: function(json,status){ console.log(json); } }); $(this).dialog("close"); } } }); bt_launch_instance.target.bind('click',function(){ var id = c_list.currentChecked(); if( id ){ bt_launch_instance.open({"ids":[id]}); } return false; }); //list c_list.setData(null); c_list.update(list_request,true);} |
bt_launch_instance.open(id); | bt_launch_instance.open({"ids":[id]}); | DcmgrGUI.prototype.imagePanel = function(){ var total = 0; var maxrow = 10; var page = 1; var list_request = { "url":DcmgrGUI.Util.getPagePath('/images/list/',page), "data" : DcmgrGUI.Util.getPagenateData(page,maxrow) } DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "id":'', "wmi_id":'', "source":'', "owner":'', "visibility":'', "state":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "name" : "-", "description" : "-", "source" : "-", "owner" : "-", "visibility" : "-", "product_code" : "-", "state" : "-", "karnel_id":"-", "platform" : "-", "root_device_type":"-", "root_device":"-", "image_size":"-", "block_devices":"-", "virtualization":"", "state_reason":"-" } } var c_pagenate = new DcmgrGUI.Pagenate({ row:maxrow, total:total }); var c_list = new DcmgrGUI.List({ element_id:'#display_images', template_id:'#imagesListTemplate', maxrow:maxrow, page:page }); c_list.setDetailTemplate({ template_id:'#imagesDetailTemplate', detail_path:'/images/show/' }); c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ var image = params.data.image; c_pagenate.changeTotal(image.owner_total); c_list.setData(image.results); c_list.singleCheckList(c_list.detail_template); }); var bt_refresh = new DcmgrGUI.Refresh(); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ c_list.page = c_pagenate.current_page; list_request.url = DcmgrGUI.Util.getPagePath('/images/list/',c_pagenate.current_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){ //remove $($('#detail').find('#'+check_id)).remove(); //update c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/images/show/',check_id) },true); }); }); c_pagenate.element.bind('dcmgrGUI.updatePagenate',function(){ c_list.clearCheckedList(); $('#detail').html(''); bt_refresh.element.trigger('dcmgrGUI.refresh'); }); var bt_launch_instance = new DcmgrGUI.Dialog({ target:'.launch_instance', width:400, height:200, title:'Launch Instance', path:'/launch_instance', button:{ "Launch": function() { var image_id = $('#image_id').text(); var host_pool_id = $('#host_pool_id').text(); var instance_spec = $('#instance_spec').text(); var data = "image_id="+image_id +"&host_pool_id="+host_pool_id +"&instance_spec="+instance_spec; $.ajax({ "type": "POST", "async": true, "url": '/instances/create', "dataType": "json", "data": data, success: function(json,status){ console.log(json); } }); $(this).dialog("close"); } } }); bt_launch_instance.target.bind('click',function(){ var id = c_list.currentChecked(); if( id ){ bt_launch_instance.open(id); } return false; }); //list c_list.setData(null); c_list.update(list_request,true);} |
height:200, | height:220, | DcmgrGUI.prototype.imagePanel = function(){ var total = 0; var maxrow = 10; var page = 1; var list_request = { "url":DcmgrGUI.Util.getPagePath('/images/list/',page), "data" : DcmgrGUI.Util.getPagenateData(page,maxrow) } DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "id":'', "wmi_id":'', "source":'', "owner":'', "visibility":'', "state":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "name" : "-", "description" : "-", "source" : "-", "owner" : "-", "visibility" : "-", "product_code" : "-", "state" : "-", "karnel_id":"-", "platform" : "-", "root_device_type":"-", "root_device":"-", "image_size":"-", "block_devices":"-", "virtualization":"", "state_reason":"-" } } var c_pagenate = new DcmgrGUI.Pagenate({ row:maxrow, total:total }); var c_list = new DcmgrGUI.List({ element_id:'#display_images', template_id:'#imagesListTemplate', maxrow:maxrow, page:page }); c_list.setDetailTemplate({ template_id:'#imagesDetailTemplate', detail_path:'/images/show/' }); c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ var image = params.data.image; c_pagenate.changeTotal(image.owner_total); c_list.setData(image.results); c_list.singleCheckList(c_list.detail_template); }); var bt_refresh = new DcmgrGUI.Refresh(); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ c_list.page = c_pagenate.current_page; list_request.url = DcmgrGUI.Util.getPagePath('/images/list/',c_pagenate.current_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){ //remove $($('#detail').find('#'+check_id)).remove(); //update c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/images/show/',check_id) },true); }); }); c_pagenate.element.bind('dcmgrGUI.updatePagenate',function(){ c_list.clearCheckedList(); $('#detail').html(''); bt_refresh.element.trigger('dcmgrGUI.refresh'); }); var bt_launch_instance = new DcmgrGUI.Dialog({ target:'.launch_instance', width:400, height:200, title:'Launch Instance', path:'/launch_instance', button:{ "Launch": function() { var image_id = $('#image_id').text(); var host_pool_id = $('#host_pool_id').text(); var instance_spec = $('#instance_spec').text(); var data = "image_id="+image_id +"&host_pool_id="+host_pool_id +"&instance_spec="+instance_spec; $.ajax({ "type": "POST", "async": true, "url": '/instances/create', "dataType": "json", "data": data, success: function(json,status){ console.log(json); } }); $(this).dialog("close"); } } }); bt_launch_instance.target.bind('click',function(){ var id = c_list.currentChecked(); if( id ){ bt_launch_instance.open({"ids":[id]}); } return false; }); //list c_list.setData(null); c_list.update(list_request,true);} |
var image_id = $('#image_id').text(); var host_pool_id = $('#host_pool_id').text(); var instance_spec = $('#instance_spec').text(); | var image_id = $('#image_id').val(); var host_pool_id = $('#host_pool_id').val(); var instance_spec = $('#instance_spec').val(); | DcmgrGUI.prototype.imagePanel = function(){ var total = 0; var maxrow = 10; var page = 1; var list_request = { "url":DcmgrGUI.Util.getPagePath('/images/list/',page), "data" : DcmgrGUI.Util.getPagenateData(page,maxrow) } DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "id":'', "wmi_id":'', "source":'', "owner":'', "visibility":'', "state":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "name" : "-", "description" : "-", "source" : "-", "owner" : "-", "visibility" : "-", "product_code" : "-", "state" : "-", "karnel_id":"-", "platform" : "-", "root_device_type":"-", "root_device":"-", "image_size":"-", "block_devices":"-", "virtualization":"", "state_reason":"-" } } var c_pagenate = new DcmgrGUI.Pagenate({ row:maxrow, total:total }); var c_list = new DcmgrGUI.List({ element_id:'#display_images', template_id:'#imagesListTemplate', maxrow:maxrow, page:page }); c_list.setDetailTemplate({ template_id:'#imagesDetailTemplate', detail_path:'/images/show/' }); c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ var image = params.data.image; c_pagenate.changeTotal(image.owner_total); c_list.setData(image.results); c_list.singleCheckList(c_list.detail_template); }); var bt_refresh = new DcmgrGUI.Refresh(); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ c_list.page = c_pagenate.current_page; list_request.url = DcmgrGUI.Util.getPagePath('/images/list/',c_pagenate.current_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){ //remove $($('#detail').find('#'+check_id)).remove(); //update c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/images/show/',check_id) },true); }); }); c_pagenate.element.bind('dcmgrGUI.updatePagenate',function(){ c_list.clearCheckedList(); $('#detail').html(''); bt_refresh.element.trigger('dcmgrGUI.refresh'); }); var bt_launch_instance = new DcmgrGUI.Dialog({ target:'.launch_instance', width:400, height:200, title:'Launch Instance', path:'/launch_instance', button:{ "Launch": function() { var image_id = $('#image_id').text(); var host_pool_id = $('#host_pool_id').text(); var instance_spec = $('#instance_spec').text(); var data = "image_id="+image_id +"&host_pool_id="+host_pool_id +"&instance_spec="+instance_spec; $.ajax({ "type": "POST", "async": true, "url": '/instances/create', "dataType": "json", "data": data, success: function(json,status){ console.log(json); } }); $(this).dialog("close"); } } }); bt_launch_instance.target.bind('click',function(){ var id = c_list.currentChecked(); if( id ){ bt_launch_instance.open({"ids":[id]}); } return false; }); //list c_list.setData(null); c_list.update(list_request,true);} |
c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ c_list.setData(params.data); c_list.multiCheckList(c_list.detail_template); }); | DcmgrGUI.prototype.imagePanel = function(){ DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "id":'', "wmi_id":'', "source":'', "owner":'', "visibility":'', "state":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "name" : "-", "description" : "-", "source" : "-", "owner" : "-", "visibility" : "-", "product_code" : "-", "state" : "-", "karnel_id":"-", "platform" : "-", "root_device_type":"-", "root_device":"-", "image_size":"-", "block_devices":"-", "virtualization":"", "state_reason":"-" } } var list_request = { "url":DcmgrGUI.Util.getPagePath('/images/show/',1) } var c_list = new DcmgrGUI.List({ element_id:'#display_images', template_id:'#imagesListTemplate' }); c_list.setDetailTemplate({ template_id:'#imagesDetailTemplate', detail_path:'/images/detail/' }); var c_pagenate = new DcmgrGUI.Pagenate({ row:10, total:30 //todo:get total from dcmgr }); var bt_refresh = new DcmgrGUI.Refresh(); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ list_request.url = DcmgrGUI.Util.getPagePath('/images/show/',c_pagenate.current_page); c_list.element.trigger('dcmgrGUI.updateList',{request:list_request}) //update detail $.each(c_list.checked_list,function(check_id,obj){ //remove $($('#detail').find('#'+check_id)).remove(); //update c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/images/detail/',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);} |
|
immediateDescendants: function(element) { if (!(element = $(element).firstChild)) return []; while (element && element.nodeType != 1) element = element.nextSibling; if (element) return [element].concat($(element).nextSiblings()); return []; }, | 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])*?\*\ | immediateDescendants: function(element) { if (!(element = $(element).firstChild)) return []; while (element && element.nodeType != 1) element = element.nextSibling; if (element) return [element].concat($(element).nextSiblings()); return []; }, |
ENV.log('\nError loading module:\n\tmodule path:', modulePath, '\n\tpath:', path, '\n\trequest:', request, '\n'); | ENV.log('\nError loading module:\n\trequested:', modulePath, '\n\tfrom:', path, '\n\tfull request:', request, '\n'); e.jsioLogged = true; | function importer(context, path, request, opts) { opts = opts || {}; // importer is bound to a module's (or global) context -- we can override this // by using opts.context context = opts.context || context || ENV.global; // parse the import request(s) var imports = resolveImportRequest(context, path, request, opts), numImports = imports.length, retVal = numImports > 1 ? {} : null; // import each requested item for(var i = 0; i < numImports; ++i) { var item = imports[i], modulePath = item.from, modules = jsio.__modules; // eval any packages that we don't know about already if(!(modulePath in modules)) { try { //ENV.log('loadModule base path: ' + path + ', module path: ', modulePath); var moduleDef = loadModule(path, modulePath, opts); } catch(e) { ENV.log('\nError loading module:\n\tmodule path:', modulePath, '\n\tpath:', path, '\n\trequest:', request, '\n'); throw e; } var newContext = makeContext(modulePath, moduleDef.filePath, item.external); modules[modulePath] = newContext.exports; if(item.external || item.grab) { var src = [';(function(){'], k = 1; for (var j in item['import']) { newContext.exports[j] = undefined; src[k++] = 'if(typeof '+j+'!="undefined"&&exports.'+j+'==undefined)exports.'+j+'='+j+';'; } src[k] = '})();'; moduleDef.src += src.join(''); } execModuleDef(newContext, moduleDef); modules[modulePath] = newContext.exports; } var module = modules[modulePath]; // return the module if we're only importing one module if (numImports == 1) { retVal = module; } if (!opts.dontExport) { // add the module to the current context if (item.as) { // remove trailing/leading dots var as = item.as.match(/^\.*(.*?)\.*$/)[1], segments = as.split('.'), kMax = segments.length - 1, c = context; // build the object in the context for(var k = 0; k < kMax; ++k) { var segment = segments[k]; if (!segment) continue; if (!c[segment]) { c[segment] = {}; } c = c[segment]; } c[segments[kMax]] = module; // there can be multiple module imports with this syntax (import foo, bar) if (numImports > 1) { retVal[as] = module; } } else if(item['import']) { // there can only be one module import with this syntax // (from foo import bar), so retVal will already be set here if(item['import']['*']) { for(var k in modules[modulePath]) { context[k] = module[k]; } } else { try { for(var k in item['import']) { context[item['import'][k]] = module[k]; } } catch(e) { ENV.log('module: ', modules); throw e; } } } } } return retVal; } |
function importer(context, path, request, opts) { | function importer(context, fromDir, fromFile, request, opts) { | function importer(context, path, request, opts) { opts = opts || {}; // importer is bound to a module's (or global) context -- we can override this // by using opts.context context = opts.context || context || ENV.global; // parse the import request(s) var imports = resolveImportRequest(context, path, request, opts), numImports = imports.length, retVal = numImports > 1 ? {} : null; // import each requested item for(var i = 0; i < numImports; ++i) { var item = imports[i], modulePath = item.from, modules = jsio.__modules; // eval any packages that we don't know about already if(!(modulePath in modules)) { try { //ENV.log('loadModule base path: ' + path + ', module path: ', modulePath); var moduleDef = loadModule(path, modulePath, opts); } catch(e) { if (!e.jsioLogged) { ENV.log('\nError loading module:\n\trequested:', modulePath, '\n\tfrom:', path, '\n\tfull request:', request, '\n'); e.jsioLogged = true; } throw e; } var newContext = makeContext(modulePath, moduleDef.filePath, item.external); modules[modulePath] = newContext.exports; if(item.external || item.grab) { var src = [';(function(){'], k = 1; for (var j in item['import']) { newContext.exports[j] = undefined; src[k++] = 'if(typeof '+j+'!="undefined"&&exports.'+j+'==undefined)exports.'+j+'='+j+';'; } src[k] = '})();'; moduleDef.src += src.join(''); } execModuleDef(newContext, moduleDef); modules[modulePath] = newContext.exports; } var module = modules[modulePath]; // return the module if we're only importing one module if (numImports == 1) { retVal = module; } if (!opts.dontExport) { // add the module to the current context if (item.as) { // remove trailing/leading dots var as = item.as.match(/^\.*(.*?)\.*$/)[1], segments = as.split('.'), kMax = segments.length - 1, c = context; // build the object in the context for(var k = 0; k < kMax; ++k) { var segment = segments[k]; if (!segment) continue; if (!c[segment]) { c[segment] = {}; } c = c[segment]; } c[segments[kMax]] = module; // there can be multiple module imports with this syntax (import foo, bar) if (numImports > 1) { retVal[as] = module; } } else if(item['import']) { // there can only be one module import with this syntax // (from foo import bar), so retVal will already be set here if(item['import']['*']) { for(var k in modules[modulePath]) { context[k] = module[k]; } } else { try { for(var k in item['import']) { context[item['import'][k]] = module[k]; } } catch(e) { ENV.log('module: ', modules); throw e; } } } } } return retVal; } |
var imports = resolveImportRequest(context, path, request, opts), | var imports = resolveImportRequest(context, request, opts), | function importer(context, path, request, opts) { opts = opts || {}; // importer is bound to a module's (or global) context -- we can override this // by using opts.context context = opts.context || context || ENV.global; // parse the import request(s) var imports = resolveImportRequest(context, path, request, opts), numImports = imports.length, retVal = numImports > 1 ? {} : null; // import each requested item for(var i = 0; i < numImports; ++i) { var item = imports[i], modulePath = item.from, modules = jsio.__modules; // eval any packages that we don't know about already if(!(modulePath in modules)) { try { //ENV.log('loadModule base path: ' + path + ', module path: ', modulePath); var moduleDef = loadModule(path, modulePath, opts); } catch(e) { if (!e.jsioLogged) { ENV.log('\nError loading module:\n\trequested:', modulePath, '\n\tfrom:', path, '\n\tfull request:', request, '\n'); e.jsioLogged = true; } throw e; } var newContext = makeContext(modulePath, moduleDef.filePath, item.external); modules[modulePath] = newContext.exports; if(item.external || item.grab) { var src = [';(function(){'], k = 1; for (var j in item['import']) { newContext.exports[j] = undefined; src[k++] = 'if(typeof '+j+'!="undefined"&&exports.'+j+'==undefined)exports.'+j+'='+j+';'; } src[k] = '})();'; moduleDef.src += src.join(''); } execModuleDef(newContext, moduleDef); modules[modulePath] = newContext.exports; } var module = modules[modulePath]; // return the module if we're only importing one module if (numImports == 1) { retVal = module; } if (!opts.dontExport) { // add the module to the current context if (item.as) { // remove trailing/leading dots var as = item.as.match(/^\.*(.*?)\.*$/)[1], segments = as.split('.'), kMax = segments.length - 1, c = context; // build the object in the context for(var k = 0; k < kMax; ++k) { var segment = segments[k]; if (!segment) continue; if (!c[segment]) { c[segment] = {}; } c = c[segment]; } c[segments[kMax]] = module; // there can be multiple module imports with this syntax (import foo, bar) if (numImports > 1) { retVal[as] = module; } } else if(item['import']) { // there can only be one module import with this syntax // (from foo import bar), so retVal will already be set here if(item['import']['*']) { for(var k in modules[modulePath]) { context[k] = module[k]; } } else { try { for(var k in item['import']) { context[item['import'][k]] = module[k]; } } catch(e) { ENV.log('module: ', modules); throw e; } } } } } return retVal; } |
if(!(modulePath in modules)) { try { var moduleDef = loadModule(path, modulePath, opts); } catch(e) { if (!e.jsioLogged) { ENV.log('\nError loading module:\n\trequested:', modulePath, '\n\tfrom:', path, '\n\tfull request:', request, '\n'); e.jsioLogged = true; } throw e; } var newContext = makeContext(modulePath, moduleDef.filePath, item.external); modules[modulePath] = newContext.exports; if(item.external || item.grab) { | var path = moduleDef.path; if(!(path in modules)) { var newContext = makeContext(modulePath, moduleDef, item.dontAddBase); modules[path] = newContext.exports; if(item.dontUseExports) { | function importer(context, path, request, opts) { opts = opts || {}; // importer is bound to a module's (or global) context -- we can override this // by using opts.context context = opts.context || context || ENV.global; // parse the import request(s) var imports = resolveImportRequest(context, path, request, opts), numImports = imports.length, retVal = numImports > 1 ? {} : null; // import each requested item for(var i = 0; i < numImports; ++i) { var item = imports[i], modulePath = item.from, modules = jsio.__modules; // eval any packages that we don't know about already if(!(modulePath in modules)) { try { //ENV.log('loadModule base path: ' + path + ', module path: ', modulePath); var moduleDef = loadModule(path, modulePath, opts); } catch(e) { if (!e.jsioLogged) { ENV.log('\nError loading module:\n\trequested:', modulePath, '\n\tfrom:', path, '\n\tfull request:', request, '\n'); e.jsioLogged = true; } throw e; } var newContext = makeContext(modulePath, moduleDef.filePath, item.external); modules[modulePath] = newContext.exports; if(item.external || item.grab) { var src = [';(function(){'], k = 1; for (var j in item['import']) { newContext.exports[j] = undefined; src[k++] = 'if(typeof '+j+'!="undefined"&&exports.'+j+'==undefined)exports.'+j+'='+j+';'; } src[k] = '})();'; moduleDef.src += src.join(''); } execModuleDef(newContext, moduleDef); modules[modulePath] = newContext.exports; } var module = modules[modulePath]; // return the module if we're only importing one module if (numImports == 1) { retVal = module; } if (!opts.dontExport) { // add the module to the current context if (item.as) { // remove trailing/leading dots var as = item.as.match(/^\.*(.*?)\.*$/)[1], segments = as.split('.'), kMax = segments.length - 1, c = context; // build the object in the context for(var k = 0; k < kMax; ++k) { var segment = segments[k]; if (!segment) continue; if (!c[segment]) { c[segment] = {}; } c = c[segment]; } c[segments[kMax]] = module; // there can be multiple module imports with this syntax (import foo, bar) if (numImports > 1) { retVal[as] = module; } } else if(item['import']) { // there can only be one module import with this syntax // (from foo import bar), so retVal will already be set here if(item['import']['*']) { for(var k in modules[modulePath]) { context[k] = module[k]; } } else { try { for(var k in item['import']) { context[item['import'][k]] = module[k]; } } catch(e) { ENV.log('module: ', modules); throw e; } } } } } return retVal; } |
modules[modulePath] = newContext.exports; | modules[path] = newContext.exports; | function importer(context, path, request, opts) { opts = opts || {}; // importer is bound to a module's (or global) context -- we can override this // by using opts.context context = opts.context || context || ENV.global; // parse the import request(s) var imports = resolveImportRequest(context, path, request, opts), numImports = imports.length, retVal = numImports > 1 ? {} : null; // import each requested item for(var i = 0; i < numImports; ++i) { var item = imports[i], modulePath = item.from, modules = jsio.__modules; // eval any packages that we don't know about already if(!(modulePath in modules)) { try { //ENV.log('loadModule base path: ' + path + ', module path: ', modulePath); var moduleDef = loadModule(path, modulePath, opts); } catch(e) { if (!e.jsioLogged) { ENV.log('\nError loading module:\n\trequested:', modulePath, '\n\tfrom:', path, '\n\tfull request:', request, '\n'); e.jsioLogged = true; } throw e; } var newContext = makeContext(modulePath, moduleDef.filePath, item.external); modules[modulePath] = newContext.exports; if(item.external || item.grab) { var src = [';(function(){'], k = 1; for (var j in item['import']) { newContext.exports[j] = undefined; src[k++] = 'if(typeof '+j+'!="undefined"&&exports.'+j+'==undefined)exports.'+j+'='+j+';'; } src[k] = '})();'; moduleDef.src += src.join(''); } execModuleDef(newContext, moduleDef); modules[modulePath] = newContext.exports; } var module = modules[modulePath]; // return the module if we're only importing one module if (numImports == 1) { retVal = module; } if (!opts.dontExport) { // add the module to the current context if (item.as) { // remove trailing/leading dots var as = item.as.match(/^\.*(.*?)\.*$/)[1], segments = as.split('.'), kMax = segments.length - 1, c = context; // build the object in the context for(var k = 0; k < kMax; ++k) { var segment = segments[k]; if (!segment) continue; if (!c[segment]) { c[segment] = {}; } c = c[segment]; } c[segments[kMax]] = module; // there can be multiple module imports with this syntax (import foo, bar) if (numImports > 1) { retVal[as] = module; } } else if(item['import']) { // there can only be one module import with this syntax // (from foo import bar), so retVal will already be set here if(item['import']['*']) { for(var k in modules[modulePath]) { context[k] = module[k]; } } else { try { for(var k in item['import']) { context[item['import'][k]] = module[k]; } } catch(e) { ENV.log('module: ', modules); throw e; } } } } } return retVal; } |
var module = modules[modulePath]; | var module = modules[path]; | function importer(context, path, request, opts) { opts = opts || {}; // importer is bound to a module's (or global) context -- we can override this // by using opts.context context = opts.context || context || ENV.global; // parse the import request(s) var imports = resolveImportRequest(context, path, request, opts), numImports = imports.length, retVal = numImports > 1 ? {} : null; // import each requested item for(var i = 0; i < numImports; ++i) { var item = imports[i], modulePath = item.from, modules = jsio.__modules; // eval any packages that we don't know about already if(!(modulePath in modules)) { try { //ENV.log('loadModule base path: ' + path + ', module path: ', modulePath); var moduleDef = loadModule(path, modulePath, opts); } catch(e) { if (!e.jsioLogged) { ENV.log('\nError loading module:\n\trequested:', modulePath, '\n\tfrom:', path, '\n\tfull request:', request, '\n'); e.jsioLogged = true; } throw e; } var newContext = makeContext(modulePath, moduleDef.filePath, item.external); modules[modulePath] = newContext.exports; if(item.external || item.grab) { var src = [';(function(){'], k = 1; for (var j in item['import']) { newContext.exports[j] = undefined; src[k++] = 'if(typeof '+j+'!="undefined"&&exports.'+j+'==undefined)exports.'+j+'='+j+';'; } src[k] = '})();'; moduleDef.src += src.join(''); } execModuleDef(newContext, moduleDef); modules[modulePath] = newContext.exports; } var module = modules[modulePath]; // return the module if we're only importing one module if (numImports == 1) { retVal = module; } if (!opts.dontExport) { // add the module to the current context if (item.as) { // remove trailing/leading dots var as = item.as.match(/^\.*(.*?)\.*$/)[1], segments = as.split('.'), kMax = segments.length - 1, c = context; // build the object in the context for(var k = 0; k < kMax; ++k) { var segment = segments[k]; if (!segment) continue; if (!c[segment]) { c[segment] = {}; } c = c[segment]; } c[segments[kMax]] = module; // there can be multiple module imports with this syntax (import foo, bar) if (numImports > 1) { retVal[as] = module; } } else if(item['import']) { // there can only be one module import with this syntax // (from foo import bar), so retVal will already be set here if(item['import']['*']) { for(var k in modules[modulePath]) { context[k] = module[k]; } } else { try { for(var k in item['import']) { context[item['import'][k]] = module[k]; } } catch(e) { ENV.log('module: ', modules); throw e; } } } } } return retVal; } |
for(var k in modules[modulePath]) { context[k] = module[k]; } | for(var k in modules[path]) { context[k] = module[k]; } | function importer(context, path, request, opts) { opts = opts || {}; // importer is bound to a module's (or global) context -- we can override this // by using opts.context context = opts.context || context || ENV.global; // parse the import request(s) var imports = resolveImportRequest(context, path, request, opts), numImports = imports.length, retVal = numImports > 1 ? {} : null; // import each requested item for(var i = 0; i < numImports; ++i) { var item = imports[i], modulePath = item.from, modules = jsio.__modules; // eval any packages that we don't know about already if(!(modulePath in modules)) { try { //ENV.log('loadModule base path: ' + path + ', module path: ', modulePath); var moduleDef = loadModule(path, modulePath, opts); } catch(e) { if (!e.jsioLogged) { ENV.log('\nError loading module:\n\trequested:', modulePath, '\n\tfrom:', path, '\n\tfull request:', request, '\n'); e.jsioLogged = true; } throw e; } var newContext = makeContext(modulePath, moduleDef.filePath, item.external); modules[modulePath] = newContext.exports; if(item.external || item.grab) { var src = [';(function(){'], k = 1; for (var j in item['import']) { newContext.exports[j] = undefined; src[k++] = 'if(typeof '+j+'!="undefined"&&exports.'+j+'==undefined)exports.'+j+'='+j+';'; } src[k] = '})();'; moduleDef.src += src.join(''); } execModuleDef(newContext, moduleDef); modules[modulePath] = newContext.exports; } var module = modules[modulePath]; // return the module if we're only importing one module if (numImports == 1) { retVal = module; } if (!opts.dontExport) { // add the module to the current context if (item.as) { // remove trailing/leading dots var as = item.as.match(/^\.*(.*?)\.*$/)[1], segments = as.split('.'), kMax = segments.length - 1, c = context; // build the object in the context for(var k = 0; k < kMax; ++k) { var segment = segments[k]; if (!segment) continue; if (!c[segment]) { c[segment] = {}; } c = c[segment]; } c[segments[kMax]] = module; // there can be multiple module imports with this syntax (import foo, bar) if (numImports > 1) { retVal[as] = module; } } else if(item['import']) { // there can only be one module import with this syntax // (from foo import bar), so retVal will already be set here if(item['import']['*']) { for(var k in modules[modulePath]) { context[k] = module[k]; } } else { try { for(var k in item['import']) { context[item['import'][k]] = module[k]; } } catch(e) { ENV.log('module: ', modules); throw e; } } } } } return retVal; } |
context = context || ENV.global; var imports = resolveImportRequest(path, request); | context = altContext || context || ENV.global; | function importer(context, path, request, altContext) { context = context || ENV.global; var imports = resolveImportRequest(path, request); // import each item in the request for(var i = 0, item, len = imports.length; (item = imports[i]) || i < len; ++i) { var pkg = item.from; var modules = jsio.modules; // eval any packages that we don't know about already if(!(pkg in modules)) { try { var module = sourceCache[pkg] || loadModule(pkg); } catch(e) { ENV.log('\nError executing \'', request, '\': could not load module', pkg, '\n\tpath:', path, '\n\trequest:', request, '\n'); throw e; } if(!item.external) { var newContext = makeContext(pkg, module.filePath); execModule(newContext, module); modules[pkg] = newContext.exports; } else { var newContext = {}; for(var j in item['import']) { newContext[j] = undefined; } execModule(newContext, module); modules[pkg] = newContext; for(var j in item['import']) { if(newContext[j] === undefined) { newContext[j] = ENV.global[j]; } } } } var c = altContext || context; if(item.as) { // remove trailing/leading dots var segments = item.as.match(/^\.*(.*?)\.*$/)[1].split('.'); for(var k = 0, slen = segments.length - 1, segment; (segment = segments[k]) && k < slen; ++k) { if(!segment) continue; if (!c[segment]) { c[segment] = {}; } c = c[segment]; } c[segments[slen]] = modules[pkg]; } else if(item['import']) { if(item['import']['*']) { for(var k in modules[pkg]) { c[k] = modules[pkg][k]; } } else { try { for(var k in item['import']) { c[item['import'][k]] = modules[pkg][k]; } } catch(e) { ENV.log('module: ', modules); throw e; } } } } } |
for(var i = 0, item, len = imports.length; (item = imports[i]) || i < len; ++i) { var pkg = item.from; var modules = jsio.modules; | var imports = resolveImportRequest(path, request), numImports = imports.length, retVal = numImports > 1 ? {} : null; for(var i = 0; i < numImports; ++i) { var item = imports[i], pkg = item.from, modules = jsio.modules; | function importer(context, path, request, altContext) { context = context || ENV.global; var imports = resolveImportRequest(path, request); // import each item in the request for(var i = 0, item, len = imports.length; (item = imports[i]) || i < len; ++i) { var pkg = item.from; var modules = jsio.modules; // eval any packages that we don't know about already if(!(pkg in modules)) { try { var module = sourceCache[pkg] || loadModule(pkg); } catch(e) { ENV.log('\nError executing \'', request, '\': could not load module', pkg, '\n\tpath:', path, '\n\trequest:', request, '\n'); throw e; } if(!item.external) { var newContext = makeContext(pkg, module.filePath); execModule(newContext, module); modules[pkg] = newContext.exports; } else { var newContext = {}; for(var j in item['import']) { newContext[j] = undefined; } execModule(newContext, module); modules[pkg] = newContext; for(var j in item['import']) { if(newContext[j] === undefined) { newContext[j] = ENV.global[j]; } } } } var c = altContext || context; if(item.as) { // remove trailing/leading dots var segments = item.as.match(/^\.*(.*?)\.*$/)[1].split('.'); for(var k = 0, slen = segments.length - 1, segment; (segment = segments[k]) && k < slen; ++k) { if(!segment) continue; if (!c[segment]) { c[segment] = {}; } c = c[segment]; } c[segments[slen]] = modules[pkg]; } else if(item['import']) { if(item['import']['*']) { for(var k in modules[pkg]) { c[k] = modules[pkg][k]; } } else { try { for(var k in item['import']) { c[item['import'][k]] = modules[pkg][k]; } } catch(e) { ENV.log('module: ', modules); throw e; } } } } } |
var newContext = {}; for(var j in item['import']) { newContext[j] = undefined; } | var newContext = modules[pkg] = {}; for(var j in item['import']) { newContext[j] = undefined; } | function importer(context, path, request, altContext) { context = context || ENV.global; var imports = resolveImportRequest(path, request); // import each item in the request for(var i = 0, item, len = imports.length; (item = imports[i]) || i < len; ++i) { var pkg = item.from; var modules = jsio.modules; // eval any packages that we don't know about already if(!(pkg in modules)) { try { var module = sourceCache[pkg] || loadModule(pkg); } catch(e) { ENV.log('\nError executing \'', request, '\': could not load module', pkg, '\n\tpath:', path, '\n\trequest:', request, '\n'); throw e; } if(!item.external) { var newContext = makeContext(pkg, module.filePath); execModule(newContext, module); modules[pkg] = newContext.exports; } else { var newContext = {}; for(var j in item['import']) { newContext[j] = undefined; } execModule(newContext, module); modules[pkg] = newContext; for(var j in item['import']) { if(newContext[j] === undefined) { newContext[j] = ENV.global[j]; } } } } var c = altContext || context; if(item.as) { // remove trailing/leading dots var segments = item.as.match(/^\.*(.*?)\.*$/)[1].split('.'); for(var k = 0, slen = segments.length - 1, segment; (segment = segments[k]) && k < slen; ++k) { if(!segment) continue; if (!c[segment]) { c[segment] = {}; } c = c[segment]; } c[segments[slen]] = modules[pkg]; } else if(item['import']) { if(item['import']['*']) { for(var k in modules[pkg]) { c[k] = modules[pkg][k]; } } else { try { for(var k in item['import']) { c[item['import'][k]] = modules[pkg][k]; } } catch(e) { ENV.log('module: ', modules); throw e; } } } } } |
modules[pkg] = newContext; | function importer(context, path, request, altContext) { context = context || ENV.global; var imports = resolveImportRequest(path, request); // import each item in the request for(var i = 0, item, len = imports.length; (item = imports[i]) || i < len; ++i) { var pkg = item.from; var modules = jsio.modules; // eval any packages that we don't know about already if(!(pkg in modules)) { try { var module = sourceCache[pkg] || loadModule(pkg); } catch(e) { ENV.log('\nError executing \'', request, '\': could not load module', pkg, '\n\tpath:', path, '\n\trequest:', request, '\n'); throw e; } if(!item.external) { var newContext = makeContext(pkg, module.filePath); execModule(newContext, module); modules[pkg] = newContext.exports; } else { var newContext = {}; for(var j in item['import']) { newContext[j] = undefined; } execModule(newContext, module); modules[pkg] = newContext; for(var j in item['import']) { if(newContext[j] === undefined) { newContext[j] = ENV.global[j]; } } } } var c = altContext || context; if(item.as) { // remove trailing/leading dots var segments = item.as.match(/^\.*(.*?)\.*$/)[1].split('.'); for(var k = 0, slen = segments.length - 1, segment; (segment = segments[k]) && k < slen; ++k) { if(!segment) continue; if (!c[segment]) { c[segment] = {}; } c = c[segment]; } c[segments[slen]] = modules[pkg]; } else if(item['import']) { if(item['import']['*']) { for(var k in modules[pkg]) { c[k] = modules[pkg][k]; } } else { try { for(var k in item['import']) { c[item['import'][k]] = modules[pkg][k]; } } catch(e) { ENV.log('module: ', modules); throw e; } } } } } |
|
var c = altContext || context; if(item.as) { | var module = modules[pkg]; if (numImports == 1) { retVal = module; } if (item.as) { | function importer(context, path, request, altContext) { context = context || ENV.global; var imports = resolveImportRequest(path, request); // import each item in the request for(var i = 0, item, len = imports.length; (item = imports[i]) || i < len; ++i) { var pkg = item.from; var modules = jsio.modules; // eval any packages that we don't know about already if(!(pkg in modules)) { try { var module = sourceCache[pkg] || loadModule(pkg); } catch(e) { ENV.log('\nError executing \'', request, '\': could not load module', pkg, '\n\tpath:', path, '\n\trequest:', request, '\n'); throw e; } if(!item.external) { var newContext = makeContext(pkg, module.filePath); execModule(newContext, module); modules[pkg] = newContext.exports; } else { var newContext = {}; for(var j in item['import']) { newContext[j] = undefined; } execModule(newContext, module); modules[pkg] = newContext; for(var j in item['import']) { if(newContext[j] === undefined) { newContext[j] = ENV.global[j]; } } } } var c = altContext || context; if(item.as) { // remove trailing/leading dots var segments = item.as.match(/^\.*(.*?)\.*$/)[1].split('.'); for(var k = 0, slen = segments.length - 1, segment; (segment = segments[k]) && k < slen; ++k) { if(!segment) continue; if (!c[segment]) { c[segment] = {}; } c = c[segment]; } c[segments[slen]] = modules[pkg]; } else if(item['import']) { if(item['import']['*']) { for(var k in modules[pkg]) { c[k] = modules[pkg][k]; } } else { try { for(var k in item['import']) { c[item['import'][k]] = modules[pkg][k]; } } catch(e) { ENV.log('module: ', modules); throw e; } } } } } |
var segments = item.as.match(/^\.*(.*?)\.*$/)[1].split('.'); for(var k = 0, slen = segments.length - 1, segment; (segment = segments[k]) && k < slen; ++k) { if(!segment) continue; | var as = item.as.match(/^\.*(.*?)\.*$/)[1], segments = as.split('.'), kMax = segments.length - 1, c = context; for(var k = 0; k < kMax; ++k) { var segment = segments[k]; if (!segment) continue; | function importer(context, path, request, altContext) { context = context || ENV.global; var imports = resolveImportRequest(path, request); // import each item in the request for(var i = 0, item, len = imports.length; (item = imports[i]) || i < len; ++i) { var pkg = item.from; var modules = jsio.modules; // eval any packages that we don't know about already if(!(pkg in modules)) { try { var module = sourceCache[pkg] || loadModule(pkg); } catch(e) { ENV.log('\nError executing \'', request, '\': could not load module', pkg, '\n\tpath:', path, '\n\trequest:', request, '\n'); throw e; } if(!item.external) { var newContext = makeContext(pkg, module.filePath); execModule(newContext, module); modules[pkg] = newContext.exports; } else { var newContext = {}; for(var j in item['import']) { newContext[j] = undefined; } execModule(newContext, module); modules[pkg] = newContext; for(var j in item['import']) { if(newContext[j] === undefined) { newContext[j] = ENV.global[j]; } } } } var c = altContext || context; if(item.as) { // remove trailing/leading dots var segments = item.as.match(/^\.*(.*?)\.*$/)[1].split('.'); for(var k = 0, slen = segments.length - 1, segment; (segment = segments[k]) && k < slen; ++k) { if(!segment) continue; if (!c[segment]) { c[segment] = {}; } c = c[segment]; } c[segments[slen]] = modules[pkg]; } else if(item['import']) { if(item['import']['*']) { for(var k in modules[pkg]) { c[k] = modules[pkg][k]; } } else { try { for(var k in item['import']) { c[item['import'][k]] = modules[pkg][k]; } } catch(e) { ENV.log('module: ', modules); throw e; } } } } } |
c[segments[slen]] = modules[pkg]; | c[segments[kMax]] = module; if (numImports > 1) { retVal[as] = module; } | function importer(context, path, request, altContext) { context = context || ENV.global; var imports = resolveImportRequest(path, request); // import each item in the request for(var i = 0, item, len = imports.length; (item = imports[i]) || i < len; ++i) { var pkg = item.from; var modules = jsio.modules; // eval any packages that we don't know about already if(!(pkg in modules)) { try { var module = sourceCache[pkg] || loadModule(pkg); } catch(e) { ENV.log('\nError executing \'', request, '\': could not load module', pkg, '\n\tpath:', path, '\n\trequest:', request, '\n'); throw e; } if(!item.external) { var newContext = makeContext(pkg, module.filePath); execModule(newContext, module); modules[pkg] = newContext.exports; } else { var newContext = {}; for(var j in item['import']) { newContext[j] = undefined; } execModule(newContext, module); modules[pkg] = newContext; for(var j in item['import']) { if(newContext[j] === undefined) { newContext[j] = ENV.global[j]; } } } } var c = altContext || context; if(item.as) { // remove trailing/leading dots var segments = item.as.match(/^\.*(.*?)\.*$/)[1].split('.'); for(var k = 0, slen = segments.length - 1, segment; (segment = segments[k]) && k < slen; ++k) { if(!segment) continue; if (!c[segment]) { c[segment] = {}; } c = c[segment]; } c[segments[slen]] = modules[pkg]; } else if(item['import']) { if(item['import']['*']) { for(var k in modules[pkg]) { c[k] = modules[pkg][k]; } } else { try { for(var k in item['import']) { c[item['import'][k]] = modules[pkg][k]; } } catch(e) { ENV.log('module: ', modules); throw e; } } } } } |
for(var k in modules[pkg]) { c[k] = modules[pkg][k]; } | for(var k in modules[pkg]) { context[k] = module[k]; } | function importer(context, path, request, altContext) { context = context || ENV.global; var imports = resolveImportRequest(path, request); // import each item in the request for(var i = 0, item, len = imports.length; (item = imports[i]) || i < len; ++i) { var pkg = item.from; var modules = jsio.modules; // eval any packages that we don't know about already if(!(pkg in modules)) { try { var module = sourceCache[pkg] || loadModule(pkg); } catch(e) { ENV.log('\nError executing \'', request, '\': could not load module', pkg, '\n\tpath:', path, '\n\trequest:', request, '\n'); throw e; } if(!item.external) { var newContext = makeContext(pkg, module.filePath); execModule(newContext, module); modules[pkg] = newContext.exports; } else { var newContext = {}; for(var j in item['import']) { newContext[j] = undefined; } execModule(newContext, module); modules[pkg] = newContext; for(var j in item['import']) { if(newContext[j] === undefined) { newContext[j] = ENV.global[j]; } } } } var c = altContext || context; if(item.as) { // remove trailing/leading dots var segments = item.as.match(/^\.*(.*?)\.*$/)[1].split('.'); for(var k = 0, slen = segments.length - 1, segment; (segment = segments[k]) && k < slen; ++k) { if(!segment) continue; if (!c[segment]) { c[segment] = {}; } c = c[segment]; } c[segments[slen]] = modules[pkg]; } else if(item['import']) { if(item['import']['*']) { for(var k in modules[pkg]) { c[k] = modules[pkg][k]; } } else { try { for(var k in item['import']) { c[item['import'][k]] = modules[pkg][k]; } } catch(e) { ENV.log('module: ', modules); throw e; } } } } } |
for(var k in item['import']) { c[item['import'][k]] = modules[pkg][k]; } | for(var k in item['import']) { context[item['import'][k]] = module[k]; } | function importer(context, path, request, altContext) { context = context || ENV.global; var imports = resolveImportRequest(path, request); // import each item in the request for(var i = 0, item, len = imports.length; (item = imports[i]) || i < len; ++i) { var pkg = item.from; var modules = jsio.modules; // eval any packages that we don't know about already if(!(pkg in modules)) { try { var module = sourceCache[pkg] || loadModule(pkg); } catch(e) { ENV.log('\nError executing \'', request, '\': could not load module', pkg, '\n\tpath:', path, '\n\trequest:', request, '\n'); throw e; } if(!item.external) { var newContext = makeContext(pkg, module.filePath); execModule(newContext, module); modules[pkg] = newContext.exports; } else { var newContext = {}; for(var j in item['import']) { newContext[j] = undefined; } execModule(newContext, module); modules[pkg] = newContext; for(var j in item['import']) { if(newContext[j] === undefined) { newContext[j] = ENV.global[j]; } } } } var c = altContext || context; if(item.as) { // remove trailing/leading dots var segments = item.as.match(/^\.*(.*?)\.*$/)[1].split('.'); for(var k = 0, slen = segments.length - 1, segment; (segment = segments[k]) && k < slen; ++k) { if(!segment) continue; if (!c[segment]) { c[segment] = {}; } c = c[segment]; } c[segments[slen]] = modules[pkg]; } else if(item['import']) { if(item['import']['*']) { for(var k in modules[pkg]) { c[k] = modules[pkg][k]; } } else { try { for(var k in item['import']) { c[item['import'][k]] = modules[pkg][k]; } } catch(e) { ENV.log('module: ', modules); throw e; } } } } } |
return retVal; | function importer(context, path, request, altContext) { context = context || ENV.global; var imports = resolveImportRequest(path, request); // import each item in the request for(var i = 0, item, len = imports.length; (item = imports[i]) || i < len; ++i) { var pkg = item.from; var modules = jsio.modules; // eval any packages that we don't know about already if(!(pkg in modules)) { try { var module = sourceCache[pkg] || loadModule(pkg); } catch(e) { ENV.log('\nError executing \'', request, '\': could not load module', pkg, '\n\tpath:', path, '\n\trequest:', request, '\n'); throw e; } if(!item.external) { var newContext = makeContext(pkg, module.filePath); execModule(newContext, module); modules[pkg] = newContext.exports; } else { var newContext = {}; for(var j in item['import']) { newContext[j] = undefined; } execModule(newContext, module); modules[pkg] = newContext; for(var j in item['import']) { if(newContext[j] === undefined) { newContext[j] = ENV.global[j]; } } } } var c = altContext || context; if(item.as) { // remove trailing/leading dots var segments = item.as.match(/^\.*(.*?)\.*$/)[1].split('.'); for(var k = 0, slen = segments.length - 1, segment; (segment = segments[k]) && k < slen; ++k) { if(!segment) continue; if (!c[segment]) { c[segment] = {}; } c = c[segment]; } c[segments[slen]] = modules[pkg]; } else if(item['import']) { if(item['import']['*']) { for(var k in modules[pkg]) { c[k] = modules[pkg][k]; } } else { try { for(var k in item['import']) { c[item['import'][k]] = modules[pkg][k]; } } catch(e) { ENV.log('module: ', modules); throw e; } } } } } |
|
pkg = item.from, modules = jsio.modules; | modulePath = item.from, modules = jsio.__modules; | function importer(context, path, request, opts) { opts = opts || {}; // importer is bound to a module's (or global) context -- we can override this // by using opts.context context = opts.context || context || ENV.global; // parse the import request(s) var imports = resolveImportRequest(context, path, request, opts), numImports = imports.length, retVal = numImports > 1 ? {} : null; // import each requested item for(var i = 0; i < numImports; ++i) { var item = imports[i], pkg = item.from, modules = jsio.modules; // eval any packages that we don't know about already if(!(pkg in modules)) { try { var moduleDef = sourceCache[pkg] || loadModule(pkg, opts); } catch(e) { ENV.log('\nError executing \'', request, '\': could not load module', pkg, '\n\tpath:', path, '\n\trequest:', request, '\n'); throw e; } var newContext = makeContext(pkg, moduleDef.filePath, item.external); modules[pkg] = newContext.exports; if(item.external || item.grab) { var src = [';(function(){'], k = 1; for (var j in item['import']) { newContext.exports[j] = undefined; src[k++] = 'if(typeof '+j+'!="undefined"&&exports.'+j+'==undefined)exports.'+j+'='+j+';'; } src[k] = '})();'; moduleDef.src += src.join(''); } execModuleDef(newContext, moduleDef); modules[pkg] = newContext.exports; } var module = modules[pkg]; // return the module if we're only importing one module if (numImports == 1) { retVal = module; } if (!opts.dontExport) { // add the module to the current context if (item.as) { // remove trailing/leading dots var as = item.as.match(/^\.*(.*?)\.*$/)[1], segments = as.split('.'), kMax = segments.length - 1, c = context; // build the object in the context for(var k = 0; k < kMax; ++k) { var segment = segments[k]; if (!segment) continue; if (!c[segment]) { c[segment] = {}; } c = c[segment]; } c[segments[kMax]] = module; // there can be multiple module imports with this syntax (import foo, bar) if (numImports > 1) { retVal[as] = module; } } else if(item['import']) { // there can only be one module import with this syntax // (from foo import bar), so retVal will already be set here if(item['import']['*']) { for(var k in modules[pkg]) { context[k] = module[k]; } } else { try { for(var k in item['import']) { context[item['import'][k]] = module[k]; } } catch(e) { ENV.log('module: ', modules); throw e; } } } } } return retVal; } |
if(!(pkg in modules)) { | if(!(modulePath in modules)) { | function importer(context, path, request, opts) { opts = opts || {}; // importer is bound to a module's (or global) context -- we can override this // by using opts.context context = opts.context || context || ENV.global; // parse the import request(s) var imports = resolveImportRequest(context, path, request, opts), numImports = imports.length, retVal = numImports > 1 ? {} : null; // import each requested item for(var i = 0; i < numImports; ++i) { var item = imports[i], pkg = item.from, modules = jsio.modules; // eval any packages that we don't know about already if(!(pkg in modules)) { try { var moduleDef = sourceCache[pkg] || loadModule(pkg, opts); } catch(e) { ENV.log('\nError executing \'', request, '\': could not load module', pkg, '\n\tpath:', path, '\n\trequest:', request, '\n'); throw e; } var newContext = makeContext(pkg, moduleDef.filePath, item.external); modules[pkg] = newContext.exports; if(item.external || item.grab) { var src = [';(function(){'], k = 1; for (var j in item['import']) { newContext.exports[j] = undefined; src[k++] = 'if(typeof '+j+'!="undefined"&&exports.'+j+'==undefined)exports.'+j+'='+j+';'; } src[k] = '})();'; moduleDef.src += src.join(''); } execModuleDef(newContext, moduleDef); modules[pkg] = newContext.exports; } var module = modules[pkg]; // return the module if we're only importing one module if (numImports == 1) { retVal = module; } if (!opts.dontExport) { // add the module to the current context if (item.as) { // remove trailing/leading dots var as = item.as.match(/^\.*(.*?)\.*$/)[1], segments = as.split('.'), kMax = segments.length - 1, c = context; // build the object in the context for(var k = 0; k < kMax; ++k) { var segment = segments[k]; if (!segment) continue; if (!c[segment]) { c[segment] = {}; } c = c[segment]; } c[segments[kMax]] = module; // there can be multiple module imports with this syntax (import foo, bar) if (numImports > 1) { retVal[as] = module; } } else if(item['import']) { // there can only be one module import with this syntax // (from foo import bar), so retVal will already be set here if(item['import']['*']) { for(var k in modules[pkg]) { context[k] = module[k]; } } else { try { for(var k in item['import']) { context[item['import'][k]] = module[k]; } } catch(e) { ENV.log('module: ', modules); throw e; } } } } } return retVal; } |
var moduleDef = sourceCache[pkg] || loadModule(pkg, opts); | var moduleDef = loadModule(path, modulePath, opts); | function importer(context, path, request, opts) { opts = opts || {}; // importer is bound to a module's (or global) context -- we can override this // by using opts.context context = opts.context || context || ENV.global; // parse the import request(s) var imports = resolveImportRequest(context, path, request, opts), numImports = imports.length, retVal = numImports > 1 ? {} : null; // import each requested item for(var i = 0; i < numImports; ++i) { var item = imports[i], pkg = item.from, modules = jsio.modules; // eval any packages that we don't know about already if(!(pkg in modules)) { try { var moduleDef = sourceCache[pkg] || loadModule(pkg, opts); } catch(e) { ENV.log('\nError executing \'', request, '\': could not load module', pkg, '\n\tpath:', path, '\n\trequest:', request, '\n'); throw e; } var newContext = makeContext(pkg, moduleDef.filePath, item.external); modules[pkg] = newContext.exports; if(item.external || item.grab) { var src = [';(function(){'], k = 1; for (var j in item['import']) { newContext.exports[j] = undefined; src[k++] = 'if(typeof '+j+'!="undefined"&&exports.'+j+'==undefined)exports.'+j+'='+j+';'; } src[k] = '})();'; moduleDef.src += src.join(''); } execModuleDef(newContext, moduleDef); modules[pkg] = newContext.exports; } var module = modules[pkg]; // return the module if we're only importing one module if (numImports == 1) { retVal = module; } if (!opts.dontExport) { // add the module to the current context if (item.as) { // remove trailing/leading dots var as = item.as.match(/^\.*(.*?)\.*$/)[1], segments = as.split('.'), kMax = segments.length - 1, c = context; // build the object in the context for(var k = 0; k < kMax; ++k) { var segment = segments[k]; if (!segment) continue; if (!c[segment]) { c[segment] = {}; } c = c[segment]; } c[segments[kMax]] = module; // there can be multiple module imports with this syntax (import foo, bar) if (numImports > 1) { retVal[as] = module; } } else if(item['import']) { // there can only be one module import with this syntax // (from foo import bar), so retVal will already be set here if(item['import']['*']) { for(var k in modules[pkg]) { context[k] = module[k]; } } else { try { for(var k in item['import']) { context[item['import'][k]] = module[k]; } } catch(e) { ENV.log('module: ', modules); throw e; } } } } } return retVal; } |
ENV.log('\nError executing \'', request, '\': could not load module', pkg, '\n\tpath:', path, '\n\trequest:', request, '\n'); | ENV.log('\nError loading module:\n\tmodule path:', modulePath, '\n\tpath:', path, '\n\trequest:', request, '\n'); | function importer(context, path, request, opts) { opts = opts || {}; // importer is bound to a module's (or global) context -- we can override this // by using opts.context context = opts.context || context || ENV.global; // parse the import request(s) var imports = resolveImportRequest(context, path, request, opts), numImports = imports.length, retVal = numImports > 1 ? {} : null; // import each requested item for(var i = 0; i < numImports; ++i) { var item = imports[i], pkg = item.from, modules = jsio.modules; // eval any packages that we don't know about already if(!(pkg in modules)) { try { var moduleDef = sourceCache[pkg] || loadModule(pkg, opts); } catch(e) { ENV.log('\nError executing \'', request, '\': could not load module', pkg, '\n\tpath:', path, '\n\trequest:', request, '\n'); throw e; } var newContext = makeContext(pkg, moduleDef.filePath, item.external); modules[pkg] = newContext.exports; if(item.external || item.grab) { var src = [';(function(){'], k = 1; for (var j in item['import']) { newContext.exports[j] = undefined; src[k++] = 'if(typeof '+j+'!="undefined"&&exports.'+j+'==undefined)exports.'+j+'='+j+';'; } src[k] = '})();'; moduleDef.src += src.join(''); } execModuleDef(newContext, moduleDef); modules[pkg] = newContext.exports; } var module = modules[pkg]; // return the module if we're only importing one module if (numImports == 1) { retVal = module; } if (!opts.dontExport) { // add the module to the current context if (item.as) { // remove trailing/leading dots var as = item.as.match(/^\.*(.*?)\.*$/)[1], segments = as.split('.'), kMax = segments.length - 1, c = context; // build the object in the context for(var k = 0; k < kMax; ++k) { var segment = segments[k]; if (!segment) continue; if (!c[segment]) { c[segment] = {}; } c = c[segment]; } c[segments[kMax]] = module; // there can be multiple module imports with this syntax (import foo, bar) if (numImports > 1) { retVal[as] = module; } } else if(item['import']) { // there can only be one module import with this syntax // (from foo import bar), so retVal will already be set here if(item['import']['*']) { for(var k in modules[pkg]) { context[k] = module[k]; } } else { try { for(var k in item['import']) { context[item['import'][k]] = module[k]; } } catch(e) { ENV.log('module: ', modules); throw e; } } } } } return retVal; } |
var newContext = makeContext(pkg, moduleDef.filePath, item.external); modules[pkg] = newContext.exports; | var newContext = makeContext(modulePath, moduleDef.filePath, item.external); modules[modulePath] = newContext.exports; | function importer(context, path, request, opts) { opts = opts || {}; // importer is bound to a module's (or global) context -- we can override this // by using opts.context context = opts.context || context || ENV.global; // parse the import request(s) var imports = resolveImportRequest(context, path, request, opts), numImports = imports.length, retVal = numImports > 1 ? {} : null; // import each requested item for(var i = 0; i < numImports; ++i) { var item = imports[i], pkg = item.from, modules = jsio.modules; // eval any packages that we don't know about already if(!(pkg in modules)) { try { var moduleDef = sourceCache[pkg] || loadModule(pkg, opts); } catch(e) { ENV.log('\nError executing \'', request, '\': could not load module', pkg, '\n\tpath:', path, '\n\trequest:', request, '\n'); throw e; } var newContext = makeContext(pkg, moduleDef.filePath, item.external); modules[pkg] = newContext.exports; if(item.external || item.grab) { var src = [';(function(){'], k = 1; for (var j in item['import']) { newContext.exports[j] = undefined; src[k++] = 'if(typeof '+j+'!="undefined"&&exports.'+j+'==undefined)exports.'+j+'='+j+';'; } src[k] = '})();'; moduleDef.src += src.join(''); } execModuleDef(newContext, moduleDef); modules[pkg] = newContext.exports; } var module = modules[pkg]; // return the module if we're only importing one module if (numImports == 1) { retVal = module; } if (!opts.dontExport) { // add the module to the current context if (item.as) { // remove trailing/leading dots var as = item.as.match(/^\.*(.*?)\.*$/)[1], segments = as.split('.'), kMax = segments.length - 1, c = context; // build the object in the context for(var k = 0; k < kMax; ++k) { var segment = segments[k]; if (!segment) continue; if (!c[segment]) { c[segment] = {}; } c = c[segment]; } c[segments[kMax]] = module; // there can be multiple module imports with this syntax (import foo, bar) if (numImports > 1) { retVal[as] = module; } } else if(item['import']) { // there can only be one module import with this syntax // (from foo import bar), so retVal will already be set here if(item['import']['*']) { for(var k in modules[pkg]) { context[k] = module[k]; } } else { try { for(var k in item['import']) { context[item['import'][k]] = module[k]; } } catch(e) { ENV.log('module: ', modules); throw e; } } } } } return retVal; } |
modules[pkg] = newContext.exports; | modules[modulePath] = newContext.exports; | function importer(context, path, request, opts) { opts = opts || {}; // importer is bound to a module's (or global) context -- we can override this // by using opts.context context = opts.context || context || ENV.global; // parse the import request(s) var imports = resolveImportRequest(context, path, request, opts), numImports = imports.length, retVal = numImports > 1 ? {} : null; // import each requested item for(var i = 0; i < numImports; ++i) { var item = imports[i], pkg = item.from, modules = jsio.modules; // eval any packages that we don't know about already if(!(pkg in modules)) { try { var moduleDef = sourceCache[pkg] || loadModule(pkg, opts); } catch(e) { ENV.log('\nError executing \'', request, '\': could not load module', pkg, '\n\tpath:', path, '\n\trequest:', request, '\n'); throw e; } var newContext = makeContext(pkg, moduleDef.filePath, item.external); modules[pkg] = newContext.exports; if(item.external || item.grab) { var src = [';(function(){'], k = 1; for (var j in item['import']) { newContext.exports[j] = undefined; src[k++] = 'if(typeof '+j+'!="undefined"&&exports.'+j+'==undefined)exports.'+j+'='+j+';'; } src[k] = '})();'; moduleDef.src += src.join(''); } execModuleDef(newContext, moduleDef); modules[pkg] = newContext.exports; } var module = modules[pkg]; // return the module if we're only importing one module if (numImports == 1) { retVal = module; } if (!opts.dontExport) { // add the module to the current context if (item.as) { // remove trailing/leading dots var as = item.as.match(/^\.*(.*?)\.*$/)[1], segments = as.split('.'), kMax = segments.length - 1, c = context; // build the object in the context for(var k = 0; k < kMax; ++k) { var segment = segments[k]; if (!segment) continue; if (!c[segment]) { c[segment] = {}; } c = c[segment]; } c[segments[kMax]] = module; // there can be multiple module imports with this syntax (import foo, bar) if (numImports > 1) { retVal[as] = module; } } else if(item['import']) { // there can only be one module import with this syntax // (from foo import bar), so retVal will already be set here if(item['import']['*']) { for(var k in modules[pkg]) { context[k] = module[k]; } } else { try { for(var k in item['import']) { context[item['import'][k]] = module[k]; } } catch(e) { ENV.log('module: ', modules); throw e; } } } } } return retVal; } |
var module = modules[pkg]; | var module = modules[modulePath]; | function importer(context, path, request, opts) { opts = opts || {}; // importer is bound to a module's (or global) context -- we can override this // by using opts.context context = opts.context || context || ENV.global; // parse the import request(s) var imports = resolveImportRequest(context, path, request, opts), numImports = imports.length, retVal = numImports > 1 ? {} : null; // import each requested item for(var i = 0; i < numImports; ++i) { var item = imports[i], pkg = item.from, modules = jsio.modules; // eval any packages that we don't know about already if(!(pkg in modules)) { try { var moduleDef = sourceCache[pkg] || loadModule(pkg, opts); } catch(e) { ENV.log('\nError executing \'', request, '\': could not load module', pkg, '\n\tpath:', path, '\n\trequest:', request, '\n'); throw e; } var newContext = makeContext(pkg, moduleDef.filePath, item.external); modules[pkg] = newContext.exports; if(item.external || item.grab) { var src = [';(function(){'], k = 1; for (var j in item['import']) { newContext.exports[j] = undefined; src[k++] = 'if(typeof '+j+'!="undefined"&&exports.'+j+'==undefined)exports.'+j+'='+j+';'; } src[k] = '})();'; moduleDef.src += src.join(''); } execModuleDef(newContext, moduleDef); modules[pkg] = newContext.exports; } var module = modules[pkg]; // return the module if we're only importing one module if (numImports == 1) { retVal = module; } if (!opts.dontExport) { // add the module to the current context if (item.as) { // remove trailing/leading dots var as = item.as.match(/^\.*(.*?)\.*$/)[1], segments = as.split('.'), kMax = segments.length - 1, c = context; // build the object in the context for(var k = 0; k < kMax; ++k) { var segment = segments[k]; if (!segment) continue; if (!c[segment]) { c[segment] = {}; } c = c[segment]; } c[segments[kMax]] = module; // there can be multiple module imports with this syntax (import foo, bar) if (numImports > 1) { retVal[as] = module; } } else if(item['import']) { // there can only be one module import with this syntax // (from foo import bar), so retVal will already be set here if(item['import']['*']) { for(var k in modules[pkg]) { context[k] = module[k]; } } else { try { for(var k in item['import']) { context[item['import'][k]] = module[k]; } } catch(e) { ENV.log('module: ', modules); throw e; } } } } } return retVal; } |
for(var k in modules[pkg]) { context[k] = module[k]; } | for(var k in modules[modulePath]) { context[k] = module[k]; } | function importer(context, path, request, opts) { opts = opts || {}; // importer is bound to a module's (or global) context -- we can override this // by using opts.context context = opts.context || context || ENV.global; // parse the import request(s) var imports = resolveImportRequest(context, path, request, opts), numImports = imports.length, retVal = numImports > 1 ? {} : null; // import each requested item for(var i = 0; i < numImports; ++i) { var item = imports[i], pkg = item.from, modules = jsio.modules; // eval any packages that we don't know about already if(!(pkg in modules)) { try { var moduleDef = sourceCache[pkg] || loadModule(pkg, opts); } catch(e) { ENV.log('\nError executing \'', request, '\': could not load module', pkg, '\n\tpath:', path, '\n\trequest:', request, '\n'); throw e; } var newContext = makeContext(pkg, moduleDef.filePath, item.external); modules[pkg] = newContext.exports; if(item.external || item.grab) { var src = [';(function(){'], k = 1; for (var j in item['import']) { newContext.exports[j] = undefined; src[k++] = 'if(typeof '+j+'!="undefined"&&exports.'+j+'==undefined)exports.'+j+'='+j+';'; } src[k] = '})();'; moduleDef.src += src.join(''); } execModuleDef(newContext, moduleDef); modules[pkg] = newContext.exports; } var module = modules[pkg]; // return the module if we're only importing one module if (numImports == 1) { retVal = module; } if (!opts.dontExport) { // add the module to the current context if (item.as) { // remove trailing/leading dots var as = item.as.match(/^\.*(.*?)\.*$/)[1], segments = as.split('.'), kMax = segments.length - 1, c = context; // build the object in the context for(var k = 0; k < kMax; ++k) { var segment = segments[k]; if (!segment) continue; if (!c[segment]) { c[segment] = {}; } c = c[segment]; } c[segments[kMax]] = module; // there can be multiple module imports with this syntax (import foo, bar) if (numImports > 1) { retVal[as] = module; } } else if(item['import']) { // there can only be one module import with this syntax // (from foo import bar), so retVal will already be set here if(item['import']['*']) { for(var k in modules[pkg]) { context[k] = module[k]; } } else { try { for(var k in item['import']) { context[item['import'][k]] = module[k]; } } catch(e) { ENV.log('module: ', modules); throw e; } } } } } return retVal; } |
M);c.ready()}};if(V)c.inArray=function(a,b){return V.call(b,a)};(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+K();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var e=d.getElementsByTagName("*"),i=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!i)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length, | true;if(ya)c.inArray=function(a,b){return ya.call(b,a)};T=c(s);if(s.addEventListener)L=function(){s.removeEventListener("DOMContentLoaded",L,false);c.ready()};else if(s.attachEvent)L=function(){if(s.readyState==="complete"){s.detachEvent("onreadystatechange",L);c.ready()}};(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+J();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>"; | M);c.ready()}};if(V)c.inArray=function(a,b){return V.call(b,a)};(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+K();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var e=d.getElementsByTagName("*"),i=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!i)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length, |
include: function(value) { if (value < this.start) return false; if (this.exclusive) return value < this.end; return value <= this.end; } | 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])*?\*\ | include: function(value) { if (value < this.start) return false; if (this.exclusive) return value < this.end; return value <= this.end; } |
index: function (tab) { if (tab) return Array.indexOf(config.tabbrowser.mTabs, tab); else return config.tabbrowser.mTabContainer.selectedIndex; | index: function (tab, visible) { let tabs = this[visible ? "visibleTabs" : "allTabs"]; return tabs.indexOf(tab || config.tabbrowser.mCurrentTab); | index: function (tab) { if (tab) return Array.indexOf(config.tabbrowser.mTabs, tab); else return config.tabbrowser.mTabContainer.selectedIndex; }, |
{},j;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){j=a[e];i[j]||(i[j]=c.expr.match.POS.test(j)?c(j,b||this.context):j)}for(;f&&f.ownerDocument&&f!==b;){for(j in i){e=i[j];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:j,elem:f});delete i[j]}}f=f.parentNode}}return d}var p=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,t){for(;t&&t.ownerDocument&&t!==b;){if(p?p.index(t)>-1:c(t).is(a))return t;t=t.parentNode}return null})},index:function(a){if(!a||typeof a=== "string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(sa(a[0])||sa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode", | {},i;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){i=a[e];j[i]||(j[i]=c.expr.match.POS.test(i)?c(i,b||this.context):i)}for(;f&&f.ownerDocument&&f!==b;){for(i in j){e=j[i];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a=== "string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode", | {},j;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){j=a[e];i[j]||(i[j]=c.expr.match.POS.test(j)?c(j,b||this.context):j)}for(;f&&f.ownerDocument&&f!==b;){for(j in i){e=i[j];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:j,elem:f});delete i[j]}}f=f.parentNode}}return d}var p=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,t){for(;t&&t.ownerDocument&&t!==b;){if(p?p.index(t)>-1:c(t).is(a))return t;t=t.parentNode}return null})},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(sa(a[0])||sa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode", |
let position = config.tabbrowser.mTabContainer.selectedIndex; let length = config.tabbrowser.mTabs.length; let last = length - 1; | if (spec instanceof Node) return this.allTabs.indexOf(spec); | indexFromSpec: function (spec, wrap) { let position = config.tabbrowser.mTabContainer.selectedIndex; let length = config.tabbrowser.mTabs.length; let last = length - 1; if (spec === undefined || spec === "") return position; if (typeof spec === "number") position = spec; else if (spec === "$") position = last; else if (/^[+-]\d+$/.test(spec)) position += parseInt(spec, 10); else if (/^\d+$/.test(spec)) position = parseInt(spec, 10); else return -1; if (position > last) position = wrap ? position % length : last; else if (position < 0) position = wrap ? (position % length) + length : 0; return position; } |
if (spec === undefined || spec === "") | let tabs = this.visibleTabs; let position = this.index(null, true); if (spec == null || spec === "") | indexFromSpec: function (spec, wrap) { let position = config.tabbrowser.mTabContainer.selectedIndex; let length = config.tabbrowser.mTabs.length; let last = length - 1; if (spec === undefined || spec === "") return position; if (typeof spec === "number") position = spec; else if (spec === "$") position = last; else if (/^[+-]\d+$/.test(spec)) position += parseInt(spec, 10); else if (/^\d+$/.test(spec)) position = parseInt(spec, 10); else return -1; if (position > last) position = wrap ? position % length : last; else if (position < 0) position = wrap ? (position % length) + length : 0; return position; } |
position = last; | position = tabs.length - 1; | indexFromSpec: function (spec, wrap) { let position = config.tabbrowser.mTabContainer.selectedIndex; let length = config.tabbrowser.mTabs.length; let last = length - 1; if (spec === undefined || spec === "") return position; if (typeof spec === "number") position = spec; else if (spec === "$") position = last; else if (/^[+-]\d+$/.test(spec)) position += parseInt(spec, 10); else if (/^\d+$/.test(spec)) position = parseInt(spec, 10); else return -1; if (position > last) position = wrap ? position % length : last; else if (position < 0) position = wrap ? (position % length) + length : 0; return position; } |
if (position > last) position = wrap ? position % length : last; | if (position >= tabs.length) position = wrap ? position % tabs.length : tabs.length - 1; | indexFromSpec: function (spec, wrap) { let position = config.tabbrowser.mTabContainer.selectedIndex; let length = config.tabbrowser.mTabs.length; let last = length - 1; if (spec === undefined || spec === "") return position; if (typeof spec === "number") position = spec; else if (spec === "$") position = last; else if (/^[+-]\d+$/.test(spec)) position += parseInt(spec, 10); else if (/^\d+$/.test(spec)) position = parseInt(spec, 10); else return -1; if (position > last) position = wrap ? position % length : last; else if (position < 0) position = wrap ? (position % length) + length : 0; return position; } |
position = wrap ? (position % length) + length : 0; | position = wrap ? (position % tabs.length) + tabs.length : 0; | indexFromSpec: function (spec, wrap) { let position = config.tabbrowser.mTabContainer.selectedIndex; let length = config.tabbrowser.mTabs.length; let last = length - 1; if (spec === undefined || spec === "") return position; if (typeof spec === "number") position = spec; else if (spec === "$") position = last; else if (/^[+-]\d+$/.test(spec)) position += parseInt(spec, 10); else if (/^\d+$/.test(spec)) position = parseInt(spec, 10); else return -1; if (position > last) position = wrap ? position % length : last; else if (position < 0) position = wrap ? (position % length) + length : 0; return position; } |
return position; } | return this.allTabs.indexOf(tabs[position]); }, | indexFromSpec: function (spec, wrap) { let position = config.tabbrowser.mTabContainer.selectedIndex; let length = config.tabbrowser.mTabs.length; let last = length - 1; if (spec === undefined || spec === "") return position; if (typeof spec === "number") position = spec; else if (spec === "$") position = last; else if (/^[+-]\d+$/.test(spec)) position += parseInt(spec, 10); else if (/^\d+$/.test(spec)) position = parseInt(spec, 10); else return -1; if (position > last) position = wrap ? position % length : last; else if (position < 0) position = wrap ? (position % length) + length : 0; return position; } |
for (let i in this.backward ? util.range(idx + 1, 0, -1) : util.range(idx, this.ranges.length)) | if (this.backward) var groups = [util.range(idx + 1, 0, -1), util.range(this.ranges.length, idx, -1)]; else var groups = [util.range(idx, this.ranges.length), util.range(0, idx + 1)]; for (let i in groups[0]) | function indices() { let idx = this.range.index; for (let i in this.backward ? util.range(idx + 1, 0, -1) : util.range(idx, this.ranges.length)) yield i; if (private_) return; this.wrapped = true; this.lastRange = null; for (let i in this.backward ? util.range(this.ranges.length, idx, -1) : util.range(0, idx + 1)) yield i; } |
if (private_) return; this.wrapped = true; this.lastRange = null; for (let i in this.backward ? util.range(this.ranges.length, idx, -1) : util.range(0, idx + 1)) yield i; | if (!private_) { this.wrapped = true; this.lastRange = null; for (let i in groups[1]) yield i; } | function indices() { let idx = this.range.index; for (let i in this.backward ? util.range(idx + 1, 0, -1) : util.range(idx, this.ranges.length)) yield i; if (private_) return; this.wrapped = true; this.lastRange = null; for (let i in this.backward ? util.range(this.ranges.length, idx, -1) : util.range(0, idx + 1)) yield i; } |
var style = document.createElement('link'); style.rel = 'stylesheet'; style.href = chrome.extension.getURL('styles/general.css'); document.head.appendChild(style); | init : function(config){ TBRL.config = config; document.addEventListener('mousemove', TBRL.mousehandler, false); document.addEventListener('unload', TBRL.unload, false); connection.onMessage.addListener(function(item){ var type = item.type; if(type === 'request'){ request_handler(item); } else if(type === 'post'){ post_handler(item); } }); var style = document.createElement('link'); style.rel = 'stylesheet'; style.href = chrome.extension.getURL('styles/general.css'); document.head.appendChild(style); window.addEventListener('Taberareloo.link', TBRL.link, false); window.addEventListener('Taberareloo.quote', TBRL.quote, false); window.addEventListener('Taberareloo.general', TBRL.general, false); !TBRL.config['post']['keyconfig'] && document.addEventListener('keydown', TBRL.keyhandler, false); (TBRL.userscripts = UserScripts.check()).forEach(function(script){ script.exec(); }); }, |
|
init: function (ary) { return { __proto__: ary, __iterator__: function () this.iteritems(), __noSuchMethod__: function (meth, args) { var res = util.Array[meth].apply(null, [this.__proto__].concat(args)); if (util.Array.isinstance(res)) return util.Array(res); return res; }, toString: function () this.__proto__.toString(), concat: function () this.__proto__.concat.apply(this.__proto__, arguments), map: function () this.__noSuchMethod__("map", Array.slice(arguments)) }; } | init: function () { this.Array = Util.Array; }, | init: function (ary) { return { __proto__: ary, __iterator__: function () this.iteritems(), __noSuchMethod__: function (meth, args) { var res = util.Array[meth].apply(null, [this.__proto__].concat(args)); if (util.Array.isinstance(res)) return util.Array(res); return res; }, toString: function () this.__proto__.toString(), concat: function () this.__proto__.concat.apply(this.__proto__, arguments), map: function () this.__noSuchMethod__("map", Array.slice(arguments)) }; } |
init: function (id) { this._completionElements = []; var iframe = document.getElementById(id); this._doc = iframe.contentDocument; this._win = iframe.contentWindow; this._container = iframe.parentNode; this._doc.body.id = id + "-content"; this._doc.body.className = iframe.className + "-content"; this._doc.body.appendChild(this._doc.createTextNode("")); this._doc.body.style.borderTop = "1px solid black"; this._gradient = template.gradient("GradientLeft", "GradientRight"); this._items = null; this._startIndex = -1; this._endIndex = -1; this._selIndex = -1; this._div = null; this._divNodes = {}; this._minHeight = 0; }, | init: function (inputField, mode) { this.mode = mode; this.input = inputField; this.store = storage["history-" + mode]; this.reset(); }, | init: function (id) { this._completionElements = []; var iframe = document.getElementById(id); this._doc = iframe.contentDocument; this._win = iframe.contentWindow; this._container = iframe.parentNode; this._doc.body.id = id + "-content"; this._doc.body.className = iframe.className + "-content"; this._doc.body.appendChild(this._doc.createTextNode("")); this._doc.body.style.borderTop = "1px solid black"; // FIXME: For cases where completions/MOW are shown at once, or ls=0. Should use :highlight. this._gradient = template.gradient("GradientLeft", "GradientRight"); this._items = null; this._startIndex = -1; // The index of the first displayed item this._endIndex = -1; // The index one *after* the last displayed item this._selIndex = -1; // The index of the currently selected element this._div = null; this._divNodes = {}; this._minHeight = 0; }, |
init: function (prop) update(this, { get: function () { if (desc.get) var val = desc.get.call(this, value); return val === undefined ? value : val; }, set: function (val) { modes.save(id, this, prop); if (desc.set) value = desc.set.call(this, val); value = !desc.set || value === undefined ? val : value; | init: function () { this.modeChars = {}; this._main = 1; this._extended = 0; this._lastShown = null; this._passNextKey = false; this._passAllKeys = false; this._isRecording = false; this._isReplaying = false; this._modeStack = update([], { pop: function pop() { if (this.length <= 1) { util.dumpStack("Trying to pop last element in mode stack"); throw Error("Trying to pop last element in mode stack"); | init: function (prop) update(this, { get: function () { if (desc.get) var val = desc.get.call(this, value); return val === undefined ? value : val; }, set: function (val) { modes.save(id, this, prop); if (desc.set) value = desc.set.call(this, val); value = !desc.set || value === undefined ? val : value; } }) }, desc)); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.