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
/* | |
--- | |
name: ART.Wedge | |
description: Wedge shape for ART | |
authors: [Sebastian Markbåge](http://calyptus.eu) | |
provides: [ART.Wedge] |
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
<html> | |
<head> | |
<script src="mootools.js"></script> | |
<script src="mootools-1.2.4.4-more.js"></script> | |
<script src="rx.js"></script> | |
<script src="rx.mootools.js"></script> | |
<script> | |
window.addEvent('domready', function() { |
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
public static Messages.Decimal BuildDecimal(decimal d) | |
{ | |
int[] bits = decimal.GetBits(d.Value); | |
if (bits[2] != 0 || bits[1] < 0) throw new Exception("Unrepresentable decimal number. Out of range."); | |
long value = (((long)bits[1]) << 32) | ((long)bits[0] & 0xFFFFFFFFL); | |
if ((bits[3] & 0x80000000) != 0) value = -value; | |
uint scale = ((uint)bits[3] >> 16) & 0xF; |
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 playhead, art, keyframe1, keyframe2; | |
addEvent('load', function(){ | |
art = new ART(400, 400).inject(document.body); | |
playhead = new ART.Rectangle(200, 200) | |
.inject(art) | |
.fill('#00F'); |
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
// A nicer comparison of CoffeeScript syntax compared to manual ECMAScript Harmony style syntax | |
// Assignment: | |
let number = 42, | |
opposite = true | |
// Conditions: | |
if (opposite) number = -42 | |
// Functions: |
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
.Lightbox | |
{ | |
position: absolute; | |
background: #fff; | |
border: 10px solid #fff; | |
width: 200px; | |
height: 200px; | |
top: 50%; | |
left: 50%; | |
margin: -100px; |
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
el.set('contentEditable', true) | |
.addEvents({ | |
keydown: function(e){ if (e.key == 'enter') e.preventDefault(); }, | |
keypress: function(e){ if (e.event.which == 0 && e.code == 13) e.preventDefault(); }, | |
blur: function(){ var text = this.get('text'); this.set('text', text); } | |
}); |
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 myiframe = document.getElementById('#frame'); | |
import 'MyLegacyClass' with { document: myiframe.contentWindow.document }; | |
var frameBody = myiframe.contentWindow.document.body | |
new MyLegacyClass().toElement().inject(framebody); // Doesn't work without proper IoC |
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 readSVG = function(text, doc){ | |
var svg = doc.documentElement; | |
var w = +svg.getAttribute('width'), h = +svg.getAttribute('height'); | |
w = 500; | |
h = 400; | |
var art = new ART(w, h); | |
art.element.setAttribute('viewBox', svg.getAttribute('viewBox')); |
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
/* | |
--- | |
name: ART.Events | |
description: "Extends ART.Element with listen/ignore event subscriptions." | |
requires: [ART/ART.Element, More/Table] | |
provides: [ART.Events] | |
... | |
*/ | |
ART.Element.implement({ |