This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Shape.Circle = new Shape({ | |
| Extends:Shape, | |
| outline:{ | |
| // rules for drawing a circle | |
| } | |
| }); | |
| Shape.Rectangle = new Shape({ | |
| Extends:Shape, | |
| outline:{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var SubtleSlickParse = (function(){ | |
| function SubtleSlickParse(CSS3_Selectors){ | |
| var selector = ''+CSS3_Selectors; | |
| // if(cache[selector]) return cache[selector]; | |
| parsedSelectors = []; | |
| while (selector != (selector = selector.replace(parseregexp, parser))); | |
| return cache[''+CSS3_Selectors] = parsedSelectors; | |
| }; | |
| var parseregexp = new RegExp("\ | |
| (?x)\ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var SubtleSlickParse = (function(){ | |
| function SubtleSlickParse(CSS3_Selectors){ | |
| var selector = ''+CSS3_Selectors; | |
| if(!SubtleSlickParse.debug && cache[selector]) return cache[selector]; | |
| parsedSelectors = []; | |
| while (selector != (selector = selector.replace(parseregexp, parser))); | |
| parsedSelectors.type={}; | |
| if (!(parsedSelectors.length-1 || parsedSelectors[0].length-1 || parsedSelectors[0][0].bits-1) && parsedSelectors[0][0].tag ) parsedSelectors.type={ tag:true }; | |
| if (!(parsedSelectors.length-1 || parsedSelectors[0].length-1 || parsedSelectors[0][0].bits-1) && parsedSelectors[0][0].id ) parsedSelectors.type={ id:true }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Object.merge=function(){var mix={};for(var i=0,l=arguments.length;i<l;i++){var object=arguments[i];if(Object.type(object)!='object')continue;for(var key in object){var op=object[key],mp=mix[key];mix[key]=(mp&&Object.type(op)=='object'&&Object.type(mp)=='object')?Object.merge(mp,op):$unlink(op);}} | |
| return mix;};Object.type=function(obj){if(obj==undefined)return false;if(Object.prototype.toString.call(obj)==='[object Array]')return'array';if(obj.nodeName){switch(obj.nodeType){case 1:return'element';case 3:return(/\S/).test(obj.nodeValue)?'textnode':'whitespace';}}else if(typeof obj.length=='number'){if(obj.callee)return'arguments';else if(obj.item)return'collection';} | |
| return typeof obj;};function $pick(){for(var i=0,l=arguments.length;i<l;i++){if(arguments[i]!=undefined)return arguments[i];} | |
| return null;};function $unlink(object){var unlinked;switch(Object.type(object)){case'object':unlinked={};for(var p in object)unlinked[p]=$unlink(object[p]);break;case'array':unlinked=[];for(var i=0,l=object.length;i<l;i++ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Object.merge=function(){var mix={};for(var i=0,l=arguments.length;i<l;i++){var object=arguments[i];if(Object.type(object)!='object')continue;for(var key in object){var op=object[key],mp=mix[key];mix[key]=(mp&&Object.type(op)=='object'&&Object.type(mp)=='object')?Object.merge(mp,op):$unlink(op);}} | |
| return mix;};Object.type=function(obj){if(obj==undefined)return false;if(Object.prototype.toString.call(obj)==='[object Array]')return'array';if(obj.nodeName){switch(obj.nodeType){case 1:return'element';case 3:return(/\S/).test(obj.nodeValue)?'textnode':'whitespace';}}else if(typeof obj.length=='number'){if(obj.callee)return'arguments';else if(obj.item)return'collection';} | |
| return typeof obj;};function $pick(){for(var i=0,l=arguments.length;i<l;i++){if(arguments[i]!=undefined)return arguments[i];} | |
| return null;};function $unlink(object){var unlinked;switch(Object.type(object)){case'object':unlinked={};for(var p in object)unlinked[p]=$unlink(object[p]);break;case'array':unlinked=[];for(var i=0,l=object.length;i<l;i++)un |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Object.merge=function(){var mix={};for(var i=0,l=arguments.length;i<l;i++){var object=arguments[i];if(Object.type(object)!='object')continue;for(var key in object){var op=object[key],mp=mix[key];mix[key]=(mp&&Object.type(op)=='object'&&Object.type(mp)=='object')?Object.merge(mp,op):$unlink(op);}} | |
| return mix;};Object.type=function(obj){if(obj==undefined)return false;if(Object.prototype.toString.call(obj)==='[object Array]')return'array';if(obj.nodeName){switch(obj.nodeType){case 1:return'element';case 3:return(/\S/).test(obj.nodeValue)?'textnode':'whitespace';}}else if(typeof obj.length=='number'){if(obj.callee)return'arguments';else if(obj.item)return'collection';} | |
| return typeof obj;};function $pick(){for(var i=0,l=arguments.length;i<l;i++){if(arguments[i]!=undefined)return arguments[i];} | |
| return null;};function $unlink(object){var unlinked;switch(Object.type(object)){case'object':unlinked={};for(var p in object)unlinked[p]=$unlink(object[p]);break;case'array':unlinked=[];for(var i=0,l=object.length;i<l;i++)un |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Object.merge=function(){var mix={};for(var i=0,l=arguments.length;i<l;i++){var object=arguments[i];if(Object.type(object)!='object')continue;for(var key in object){var op=object[key],mp=mix[key];mix[key]=(mp&&Object.type(op)=='object'&&Object.type(mp)=='object')?Object.merge(mp,op):$unlink(op);}} | |
| return mix;};Object.type=function(obj){if(obj==undefined)return false;if(Object.prototype.toString.call(obj)==='[object Array]')return'array';if(obj.nodeName){switch(obj.nodeType){case 1:return'element';case 3:return(/\S/).test(obj.nodeValue)?'textnode':'whitespace';}}else if(typeof obj.length=='number'){if(obj.callee)return'arguments';else if(obj.item)return'collection';} | |
| return typeof obj;};function $pick(){for(var i=0,l=arguments.length;i<l;i++){if(arguments[i]!=undefined)return arguments[i];} | |
| return null;};function $unlink(object){var unlinked;switch(Object.type(object)){case'object':unlinked={};for(var p in object)unlinked[p]=$unlink(object[p]);break;case'array':unlinked=[];for(var i=0,l=object.length;i<l;i++)un |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $$('*') === document.getElementsByTagName('*') | |
| $$('A') === document.getElementsByTagName('A') | |
| $$('A[foo]') === document.getElementsByTagName('A').filterBy(hasAttribute('foo')) | |
| $$('A[foo="bar"]') === document.getElementsByTagName('A').filterBy(hasAttribute('foo','bar')) | |
| $$('A[foo~="bar"]') === document.getElementsByTagName('A').filterBy(hasAttribute('foo','bar',' ')) | |
| $$('A[hreflang|="en"]') === document.getElementsByTagName('A').filterBy(hasAttribute('hreflang','en','|')) | |
| $$('A[foo^="bar"]') === document.getElementsByTagName('A').filterBy(hasAttribute('foo',/^bar/)) | |
| $$('A[foo$="bar"]') === document.getElementsByTagName('A').filterBy(hasAttribute('foo',/bar$/)) | |
| $$('A[foo*="bar"]') === document.getElementsByTagName('A').filterBy(hasAttribute('foo',/bar/)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // RegExp.prototype.x= | |
| // var myRegex = /fred/.x(); | |
| // RegExp.fromString(regexString, properties) | |
| // | |
| var RegExpX = function(pattern, flags){ | |
| flags = flags && flags.split('') || [pattern.global?'g':'', pattern.ignoreCase?'i':'', pattern.multiline?'m':'', pattern.extended?'x':''].join(''); | |
| if (flags.indexOf('x')+1) { | |
| flags = flags.replace('x',''); | |
| pattern | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var key = 'key'; | |
| var KEY = {some: object}; | |
| var val = {other: object}; | |
| // "normal" stuff | |
| object.set(key, val) // -> object | |
| object.set({key: val}) // -> object | |
| object.get(key) // -> someValue |