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
| let extractBitmapSize = (bitmap, callback) => { | |
| let imageElement = new Image(); | |
| imageElement.onload = () => { | |
| callback(imageElement.naturalWidth, imageElement.naturalHeight); | |
| }; | |
| imageElement.src = bitmap; | |
| }; |
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
| // @info | |
| // Slider widget heavily inspired by sliders from Blender and Expression Design. | |
| import {Stepper} from './Stepper'; | |
| import {HTML} from '../utils/dom'; | |
| import {getKeysForEvent} from '../utils/event'; | |
| import {normalize, round, log, exp} from '../utils/math'; | |
| import {mergeOptions} from '../utils/object'; | |
| import {makeSelectionFromNodeContent, getSelection} from '../utils/text'; |
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 traceur = require('traceur'); | |
| traceur.options.blockBinding = true; | |
| traceur.options.sourceMaps = true; | |
| //traceur.options.strictSemicolons = true; // @bug: does not work with classes currently | |
| traceur.options.deferredFunctions = true; | |
| traceur.options.modules = true; // 'nodejs' | |
| // | |
| // Compile the content from ES6 to ES5 |
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
| export class AlignPanel { | |
| constructor() { | |
| commandsManager.register({ | |
| id: 'alignPanel', | |
| shortcut: ['A'], | |
| getState: () => { | |
| return (panelsDock.openedPanelID === this.id); | |
| }, | |
| getLabel: () => { |
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
| #!/usr/bin/env node | |
| var fs = require('fs'); | |
| var path = require('path'); | |
| var traceur = require('./traceur-compiler'); | |
| traceur.options.sourceMaps = true; | |
| traceur.options.deferredFunctions = true; | |
| traceur.options.blockBinding = true; | |
| traceur.options.modules = true; // 'nodejs' |
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
| # @copyright | |
| # © 2012-2013 Jarosław Foksa | |
| # | |
| # @info | |
| # Prototype object representing CSS color, based on http://www.w3.org/TR/css3-color/ and | |
| # https://developer.mozilla.org/en/CSS/color_value | |
| # | |
| # rgb - 'rgb(255, 255, 255)' | |
| # rgba - 'rgba(255, 255, 255, 1)' |
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
| # @copyright | |
| # © 2012-2013 Jarosław Foksa | |
| {createSVGMatrix} = imports 'utils/dom' | |
| {createSVGTransform} = imports 'utils/transform' | |
| {sin, cos, tan, sqrt, atan2, radToDeg, degToRad, abs, pow, signum} = imports 'utils/math' | |
| # https://github.com/WebKit/webkit/blob/master/Source/WebCore/platform/graphics/transforms/AffineTransform.cpp | |
| # https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html |
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
| lettersSchema = | |
| qwerty: [ | |
| ["f", "j"], | |
| ["d", "k"], | |
| ["f", "j", "d", "k"], | |
| ["s", "l"], | |
| ["f", "j", "d", "k", "s", "l"], | |
| ["a", "g", "h"], | |
| ["f", "j", "d", "k", "s", "l", "a", "g", "h"], | |
| ["r", "u"], |
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
| window.global = window | |
| global.modules = {} | |
| imports = (moduleName) -> | |
| if not modules[moduleName] | |
| console.error "imports '#{moduleName}': module not found." | |
| return null | |
| else if modules[moduleName].exports | |
| return modules[moduleName].exports |
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.prototype.listen = (eventName, callback) -> | |
| if @addEventListener | |
| @addEventListener eventName, callback | |
| else | |
| if @hasOwnProperty('__events__') == false | |
| setDescriptor @, '__events__', | |
| value: {} | |
| enumerable: false | |
| if @__events__[eventName] == undefined |