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
'use strict'; | |
// http://davidbcalhoun.com/2014/what-is-amd-commonjs-and-umd/ | |
(function(root, factory) { | |
if (typeof define === 'function' && define.amd) { | |
// AMD | |
define([], factory); | |
} else if (typeof exports === 'object') { | |
// Node, CommonJS-like | |
module.exports = factory(); |
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
// Refer to: | |
// https://gist.github.com/remy/350433 | |
// https://gist.github.com/jarrodirwin/0ce4c0888336b533b2c4 | |
try { | |
// Test webstorage existence. | |
if (!window.localStorage || !window.sessionStorage) throw "exception"; | |
// Test webstorage accessibility - Needed for Safari private browsing. | |
localStorage.setItem('storage_test', 1); | |
localStorage.removeItem('storage_test'); |
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
// The point of this trick is to put a transparent overflow over the part of the page | |
// and fully prevent elements on the page from being clicked while not changing their | |
// appearance in any way. Effectivelly when someone tries to click on an element | |
// this transparent surface is being clicked. | |
.disableSelect { | |
/* Display it on the layer with index 1001. | |
Make sure this is the highest z-index value | |
used by layers on that page */ |
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 View = Backbone.View.extend({ | |
callFunc : function(funcName) { | |
// Use array notation to fetch the function definition and call it... | |
this[funcName](); | |
}, | |
foo : function() { | |
console.log('called foo'); | |
}, |