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
<html> | |
<head> | |
<script> | |
function init () { | |
var el = document.getElementById ("textarea"); | |
if (el.addEventListener) { // Firefox, Opera and Safari? | |
el.addEventListener('textInput', onTextInput, false); // Safari? | |
el.addEventListener('input', onTextInput, false); // FF? | |
el.addEventListener('propertychange', onTextInput, false); | |
} |
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 that = this; // this is a CarouselPane | |
this._focusable.on('beforeActivate', function(e) { | |
var toActivate = e.toActivateIndex; // index of the item that will become active | |
if (!that._inMotion) { // the CarouselPane wants to prevent move flooding | |
that.moveTo(toActivate, {callback: function() { // put the toActivate item in the spotlight | |
that._focusable.activateItem(toActivate); // now can manually activate the toActivate item | |
}}); | |
} |
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
glow.ready(function() { | |
var myAnimation = new glow.anim.css("#cycle", 5, { | |
"background-color": {from:"white", to:"black"} | |
}); | |
myAnimation.start(); | |
}); |
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
function f(key, val) { | |
return function(k) { | |
if (k === key) { return val; } | |
else return undefined; | |
}; | |
}; | |
var o = f(1, 2); | |
// what value does each alert? | |
alert(o(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
(function (a) { | |
a.event.special.textchange = { | |
setup: function () { | |
a(this).bind("keyup", a.event.special.textchange.handler); | |
a(this).bind("cut paste input", a.event.special.textchange.delayedHandler) | |
}, teardown: function () { | |
a(this).unbind("keyup", a.event.special.textchange.keyuphandler); | |
a(this).unbind("cut", a.event.special.textchange.cuthandler) | |
}, handler: function () { | |
a.event.special.textchange.triggerIfChanged(a(this)) |
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
<!-- hypothetically... | |
All teams share a single loader tool. This loader will asynchronously pull in | |
one (or more) jquery versions and cache them. | |
--> | |
<script src="qLoader.js"></script> | |
<script type="text/javascript"> // Team 1 | |
qLoader.load('jquery-1.3').then(function($) { |
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
/** | |
@method foo | |
@description generic | |
@signature getter | |
@description this is an accessor | |
@param bar | |
@param baz | |
@return bool |
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
// create an overlay off the jquery object | |
$('mydiv').geluiOverlay(opts).css(...); // keep on chaining | |
// get the instance of the overlay back | |
myOverlay = $('mydiv').data('geluiOverlay'); | |
// or | |
// get the instance of the overlay bac | |
myOverlay = $('mydiv').geluiOverlay('instance'); // no chain |
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
javascript:var%20d=document,c=d.selection?d.selection.createRange().text:d.getSelection();d.location.href='codebox:add?code='+encodeURIComponent(c)+'&relatedurl='+encodeURIComponent(d.location.href)+'&name='+encodeURIComponent(d.title); |
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
/** | |
* @name Logging Utility | |
* @description Adds logging functions to window namespace. | |
* Adds console logging to browsers that don't have a console (E.G.: IE 6,7 & 8, Safari 2) | |
* @author Rob Taylor <[email protected]> | |
*/ | |
define('iplayer/utils/logging', | |
['iplayer/models/cookie'], | |
function (cookie) { |