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(){ | |
function brieflyAddCss(cssCode) { | |
var styleElement = document.createElement("style"); | |
styleElement.type = "text/css"; | |
if (styleElement.styleSheet) { | |
styleElement.styleSheet.cssText = cssCode; | |
} else { | |
styleElement.appendChild(document.createTextNode(cssCode)); | |
} | |
document.head.appendChild(styleElement); |
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
// LESS version | |
var less = require("less"); | |
var lessTask = { | |
parseTime: function(source, options, callback) { | |
less.parse(source, options, function(err, root, imports, options) { | |
if (err) { return callback(err); } | |
var result; | |
try { |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html> | |
<head> | |
<title></title> | |
<link href="/stylesheets/reset_min.css" media="screen" rel="stylesheet" type="text/css" /> | |
<link href="/stylesheets/apply.css" media="screen" rel="stylesheet" type="text/css" /> | |
<link href="/stylesheets/login.css" media="screen" rel="stylesheet" type="text/css" /> | |
<link href="/stylesheets/program.css" media="screen" rel="stylesheet" type="text/css" /> | |
<script> | |
<![-- |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html> | |
<head> | |
<title></title> | |
<link href="/stylesheets/reset_min.css" media="screen" rel="stylesheet" type="text/css" /> | |
<link href="/stylesheets/apply.css" media="screen" rel="stylesheet" type="text/css" /> | |
<link href="/stylesheets/login.css" media="screen" rel="stylesheet" type="text/css" /> | |
<link href="/stylesheets/program.css" media="screen" rel="stylesheet" type="text/css" /> | |
<script> | |
<![-- |
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
// DeferredThingy is a class that present the interface of a deferred | |
// plus provides public methods that will only run after it is resolved. | |
function DeferredThingy(opts) { | |
this.opts = opts; | |
_.extend(this, new $.Deferred()); | |
} | |
DeferredThingy.prototype.ready = function(){ | |
this.resolve(data); | |
}; |
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
(ns learn-logic.core) | |
(use 'clojure.core.logic) | |
; an attempt to solve the classic "Send more money" problem, where | |
; S E N D | |
; + M O R E | |
; ---------- | |
; M O N E Y | |
; |
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 Dragger = StatefulView.extend({ | |
states: { | |
"dragging": function(e){ el.css({ opacity: 0.5 }) }, | |
"inactive": function(e){ el.css({ opacity: 1 }); } | |
}, | |
transitions: { | |
"mousedown .handle": ["inactive", "dragging"], | |
"mouseup": ["dragging", "inactive"], | |
"mousemove": ["dragging", "dragging", function(e){ | |
el.css({ left: e.pageX, top: e.pageY }); |
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 draggable = $("#drag"); | |
var handle = draggable.find(".handle"); | |
handle.on("mousedown.drag", function mousedown(e){ | |
handle.off("mousedown.drag"); | |
draggable.animate({ opacity: 0.5 }); | |
draggable.on("mouseup.drag", function mouseup(e){ | |
draggable.off("mouseup.drag"); | |
$("body").off("mousemove.drag"); | |
handle.on("mousedown", mousedown); |
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 Component = require("montage/ui/Component").Component; | |
var Parent = Component.specialize({ | |
thingy: { | |
value: true | |
} | |
}); | |
var Child = Parent.specialize({ | |
thingies: { |
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
describe("makeRangeContentBinder", function () { | |
it("should work", function () { | |
var o = Bindings.defineBindings({ | |
source: [1, 2, 3] | |
}, { | |
target: {"<->": "source.rangeContent()"} | |
}); | |
expect(o.target).toEqual([1,2,3]); |
OlderNewer