This file contains 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 inject_binding = function (allBindings, key, value) { | |
//https://github.com/knockout/knockout/pull/932#issuecomment-26547528 | |
return { | |
has: function (bindingKey) { | |
return (bindingKey == key) || allBindings.has(bindingKey); | |
}, | |
get: function (bindingKey) { | |
var binding = allBindings.get(bindingKey); | |
if (bindingKey == key) { | |
binding = binding ? [].concat(binding, value) : value; |
This file contains 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
//http://stackoverflow.com/questions/13210663/how-to-order-knockout-bindings | |
ko.bindingHandlers.chosen = { | |
init: function(element, valueAccessor, allBindingsAccessor, viewModel) { | |
var allBindings = allBindingsAccessor(); | |
var options = {default: 'Select one...'}; | |
$.extend(options, allBindings.chosen) | |
$(element).attr('data-placeholder', options.default); |
This file contains 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() { | |
/* | |
Mouse/Touch Interactions as bindings for Knockout | |
Heavily inspired by Tap.js - https://github.com/alexgibson/tap.js | |
*/ | |
var hasTouch = 'ontouchstart' in window || 'createTouch' in document, | |
offsetX, offsetY; | |
function InteractionController( element, interactions ) { | |
this.element = element; |
This file contains 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
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible). | |
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export. | |
var FORMAT_ONELINE = 'One-line'; | |
var FORMAT_MULTILINE = 'Multi-line'; | |
var FORMAT_PRETTY = 'Pretty'; | |
var LANGUAGE_JS = 'JavaScript'; | |
var LANGUAGE_PYTHON = 'Python'; |
This file contains 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
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
// MIT license | |
(function() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; |