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
| /* | |
| * Complete reworking of JS from https://gist.github.com/803410 | |
| * Removes external `request` dependency | |
| * Caveats: | |
| * * No error checking | |
| * * Largely a POC. `data` URI is accurate, but this code cannot simply be inserted into an `express` app | |
| */ | |
| var URL = require('url'), | |
| sURL = 'http://nodejs.org/logo.png', | |
| oURL = URL.parse(sURL), |
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
| // Forked from paul irish's https://gist.github.com/601751 | |
| // desire: localStorage and sessionStorage should accept objects | |
| // in fact they do according to spec. | |
| // http://code.google.com/p/chromium/issues/detail?id=43666 | |
| // but so far that part isnt implemented anywhere. | |
| // so we duckpunch set/getItem() to stringify/parse on the way in/out | |
| // this seems to work in chrome |
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
| B.plugin = (function(){ | |
| var val = 42; | |
| return { | |
| some: function(){ console.log('some', val); }, | |
| method: function(){ console.log('method', val); } | |
| }; | |
| })(); |
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
| require("jsdom").env({ | |
| html: "<html><body></body></html>", | |
| scripts: [ | |
| 'http://code.jquery.com/jquery-1.5.min.js', | |
| 'http://jsno.de/javascripts/jquery.flot.svn.js', // please don't hotlink | |
| 'http://jsno.de/javascripts/jquery.flot.text.js' // please don't hotlink | |
| ], | |
| done: function (errors, window) | |
| { | |
| var i, d1 = [], d2 = [], d3 = []; |
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
| function preloadFlot() | |
| { | |
| var jsdom = require("jsdom"), | |
| document = jsdom.jsdom(), | |
| window = document.createWindow(), | |
| flot_location = 'http://jsno.de/javascripts/jquery.flot.svn.js', | |
| text_location = 'http://jsno.de/javascripts/jquery.flot.text.js', | |
| jquery_location = 'http://code.jquery.com/jquery-1.5.min.js', | |
| loadScript = function ( location, callback ) | |
| { |
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
| 137c137,139 | |
| < hooks: {} | |
| --- | |
| > hooks: {}, | |
| > width: null, | |
| > height: null | |
| 687c689,694 | |
| < var c = document.createElement('canvas'); | |
| --- | |
| > var c; |
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
| (function (define) { | |
| define(function (exports) { | |
| function Color(){} | |
| return Color; | |
| }); | |
| }( | |
| // provide define if it's not available | |
| this.define || (function (global, moduleId) { |
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
| (function () { | |
| /*! | |
| * expose.js | |
| * | |
| * @author Oleg Slobodskoi | |
| * @website https://github.com/kof/expose.js | |
| * @licence Dual licensed under the MIT or GPL Version 2 licenses. | |
| */ | |
| function expose(namespace, api) { | |
| var env = {}; |
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
| (function(){ | |
| function Klass(id){ this._id = id; } | |
| Klass.prototype.id = function(){ console.log(this._id); } | |
| var freeExports = typeof exports == 'object' && exports; | |
| if (freeExports) { | |
| for (var prop in Klass) freeExports[prop] = Klass[prop]; | |
| } else if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { | |
| define(function() { return Klass; }); |
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
| (function(){ | |
| function Klass(id){ this._id = id; } | |
| Klass.prototype.id = function(){ console.log(this._id); } | |
| expose('Klass', Klass); | |
| /*! | |
| * expose.js | |
| * | |
| * @author Oleg Slobodskoi |