Table of Contents:
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
| /***************************************** | |
| /* DOM touch support module | |
| /*****************************************/ | |
| if (!window.CustomEvent) { | |
| window.CustomEvent = function (event, params) { | |
| params = params || { bubbles: false, cancelable: false, detail: undefined }; | |
| var evt = document.createEvent('CustomEvent'); | |
| evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); | |
| return evt; | |
| }; |
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 animating = false; | |
| // Define an animator consisting of optional incoming and outgoing animations. | |
| // alwaysAnimate is false unless specified as true: false means an incoming animation will only trigger if an outgoing animation is also in progress. | |
| // forcing dontClone to true means the outward animation will use the original element rather than a clone. This could improve performance by recycling elements, but can lead to trouble: clones have the advantage of being stripped of all event listeners. | |
| function animator( incoming, outgoing, alwaysAnimate, dontClone ){ | |
| // The resulting animator can be applied to any number of components | |
| return function animate( x, y, z ){ | |
| var config; | |
| var parent; |
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
| /* global require, module */ | |
| var isString = require('lodash/lang/isString'); | |
| var htmlTags = ( | |
| '^(html|base|head|link|meta|style|title|address|article|' + | |
| 'body|footer|header|h[1-6]|hgroup|nav|section|dd|div|dl|dt|' + | |
| 'figcaption|figure|hr|li|main|ol|p|pre|ul|a|abbr|b|bdi|bdo|br|' + | |
| 'cite|code|data|dfn|em|i|kbd|mark|q|rp|rt|rtc|ruby|s|samp|small|span|strong|sub|' + | |
| 'time|u|var|wbr|area|audio|img|map|track|video|embed|iframe|object|param|source|' + | |
| 'canvas|noscript|script|del|ins|caption|col|colgroup|table|tbody|td|tfoot|th|thead|tr|' + |
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 you need a license, this is under the ISC license. | |
| // In golfed ES6, just because I could... (84 characters) | |
| this.m=(o=>Object.assign((...a)=>(typeof a[0]=='string'?o:o.component)(...a),o))(m); |
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
| /** | |
| * JSX version of https://github.com/jpmonette/todomvc-mithril/blob/1d627f1d5dc0890d0a99cdcb16d09387f68f6df0/js/views/todo-view.js | |
| * Assumes the use of the vanilla JSX Transformer and an "mshim" object to translate tag calls to the format m() expects. | |
| * @jsx mshim | |
| */ | |
| 'use strict'; | |
| var m = require('mithril') |
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'; | |
| var m = require('mithril'); | |
| var extend = require('lodash').extend; | |
| var setFocus = require('../util/viewhelper').setFocus; | |
| var keymage = require('keymage'); | |
| function noop(){} | |
| function addClass(el, className) { |
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 Location = (function LocationClosure(){ | |
| var properties = {}; | |
| // Create and return a link with the given URI | |
| function makeLink( URI ){ | |
| var link = document.createElement( 'a' ); | |
| link.href = URI; | |
| return link; |
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 net = require('net') | |
| var sock = net.connect(1337) | |
| process.stdin.pipe(sock) | |
| sock.pipe(process.stdout) | |
| sock.on('connect', function () { | |
| process.stdin.resume(); | |
| process.stdin.setRawMode(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
| /* | |
| * object.watch polyfill | |
| * | |
| * 2012-04-03 | |
| * | |
| * By Eli Grey, http://eligrey.com | |
| * Public Domain. | |
| * NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. | |
| */ |