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
| // Using only direct canvas method wrappers (which use the same | |
| // name as official canvas methods): | |
| ctx.shadowColor('green').shadowBlur(2).shadowOffsetX(5).shadowOffsetY(10); | |
| // Using one utility method (at the end) amongst direct canvas method wrappers: | |
| ctx.shadowColor('green').shadowBlur(2).$shadowOffset(5, 10); | |
| // Using custom utility exclusively with its own simplified | |
| // non-canvas (but easily derived) syntax: | |
| ctx.$shadow({color:'green', blur:2, offset:[5, 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
| var C2D2 = require('C2D2').C2D2([500, 400], {path: 'myImageFilePath.png'}) | |
| C2D2. | |
| $shadow({color:'green', blur:2, offset:[15, 10]}). | |
| $fill({color:'blue', xy:[[175, 150], [200,175], [200,125]]}); |
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
| <!--[if lte IE8]><script type="text/javascript" src="explorercanvas/excanvas.js"></script><![endif]--> | |
| <script type="text/javascript" src="canvas.js"></script> |
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
| /*globals mxqueryjs*/ | |
| // This code is from https://gist.github.com/900225 | |
| /* | |
| ("Unlicense") | |
| This is free and unencumbered software released into the public domain. | |
| Anyone is free to copy, modify, publish, use, compile, sell, or | |
| distribute this software, either in source code form or as a compiled | |
| binary, for any purpose, commercial or non-commercial, and by any | |
| means. |
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
| See https://gist.github.com/900225 for JS code and HTML demo code or http://brett-zamir.me/demos/XQueryHelper/ for the demo instead. |
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
| /** | |
| * @example | |
| * getCSSPropertyValue('.someClass', 'color'); | |
| */ | |
| function getCSSPropertyValue (selectorText, propertyName) { | |
| function _getPropertyFromStyleSheet (ss, selectorText, propertyName) { | |
| let value = null; | |
| [...ss.cssRules].some((rule) => { | |
| if (rule.type === CSSRule.STYLE_RULE && | |
| rule.selectorText === selectorText |
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
| /* Imports a commonjs style javascript file with loadSubScrpt | |
| * By Erik Vold <erikvvold@gmail.com> http://erikvold.com/ | |
| * | |
| * @param src (String) | |
| * The url of a javascript file. | |
| */ | |
| (function(global) { | |
| var modules = {}; | |
| global.require = function require(src) { | |
| if (modules[src]) return modules[src]; |
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
| /** | |
| Currently non-functional lite jQuery drop-in replacement. | |
| "Bottom Dollar" as name is to express there being a bargain for the | |
| amount of code, and the "_$" convention also spells this out). | |
| @ todos | |
| 1. Replace __noSuchMethod__ with Proxy | |
| */ | |
| var _$; |
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
| <!-- Add our shim to support array-like accessors on | |
| String objects (i.e., those invoked with new String()) --> | |
| <script src="String.js"></script> | |
| <script> | |
| // Regular string literals or String() invoked without 'new' will | |
| // behave the same as without the shim in all browsers (i.e., | |
| // accessors are not supported in IE < 9) | |
| var str = 'abc'; |
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
| /** | |
| * Add dataset support to elements | |
| * No globals, no overriding prototype with non-standard methods, | |
| * handles CamelCase properly, attempts to use standard | |
| * Object.defineProperty() (and Function bind()) methods, | |
| * falls back to native implementation when existing | |
| * Inspired by http://code.eligrey.com/html5/dataset/ | |
| * (via https://github.com/adalgiso/html5-dataset/blob/master/html5-dataset.js ) | |
| * Depends on Function.bind and Object.defineProperty/Object.getOwnPropertyDescriptor (polyfills below) | |
| * All code below is Licensed under the X11/MIT License |