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
| 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
| 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
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
| "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
| <head> | |
| <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> | |
| </head> | |
| <body onload="init();"> | |
| <script type="text/javascript" charset="utf-8"> | |
| var Sandbox = (function(){ |
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
| /* | |
| SubtleSandbox | |
| Copyright 2009 Thomas Aylott (subtleGradient.com) | |
| MIT License | |
| */ | |
| var SubtleSandbox = (function(){ | |
| // public | |
| function Sandbox(name){ | |
| this.window = makeIframe.call(this, name); |
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
| javascript:function%20SubtleClickAll(SELECTOR,timeout){timeout=timeout||0;var%20node,nodes=Array.prototype.slice.call(document.querySelectorAll(SELECTOR));function%20NEXT(){node=nodes.pop();if(node)setTimeout(function(){node.click();NEXT();},timeout);};NEXT();};SubtleClickAll(prompt(%22SubtleClickAll%20(Thomas%20Aylott%20subtleGradient.com)%22,%22CSS3%20Selector%22),10); |
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
| Array.makeSortByKey = function makeSortByKey(key){ | |
| return Array.makeSortByKey.cache[key] | |
| ||(Array.makeSortByKey.cache[key] = function sortBy(a,b){ | |
| if (a[key] == b[key]) return 0; | |
| return (a[key] < b[key]) ? -1 : 1; | |
| }); | |
| }; | |
| Array.makeSortByKey.cache = {}; |
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
| CURRENT CODE: | |
| <div> | |
| <a href="something.html"><img src="myimage.gif" /></a> | |
| </div> | |
| CHANGED CODE: | |
| <div> |
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 Matcher = (function(M){ | |
| function Matcher(context, selectorObj){ | |
| M.matcher = []; | |
| // GET | |
| M.matcher.push( | |
| M.getByAll (context, selectorObj) || | |
| M.getByClass (context, selectorObj) || |
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 regex = /\b(\w+)(?::(\w+)(?:\((\d+)\))?)?/; | |
| var result; | |
| result = "ease" .match(regex); | |
| console.assert(result[1] == 'ease', "Should match ease" ,result); | |
| result = "ease:in" .match(regex); |