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 Person = Class.create(function(){ | |
initialize: function(firstName, lastName){ | |
this.firstName = firstName; | |
this.lastName = lastName; | |
}, | |
toString: function(){ | |
return this.firstName + ' ' + this.lastName; | |
} | |
}); |
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
// more on Event.register: https://prototype.lighthouseapp.com/projects/8886/tickets/477-custom-event-register#ticket-477-4 | |
(function(){ | |
// mouse:wheel ( DOMMouseScroll ) | |
function wheel(event){ | |
var realDelta; | |
// normalize the delta | |
if (event.detail){ | |
realDelta = -event.detail / 3; // W3C | |
} else if (event.wheelDelta){ |
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
$H(Element.Storage).inject(0, function(m, p){ | |
var registry; | |
if (p.value.get && (registry = p.value.get('prototype_event_registry'))){ | |
m += registry.values().flatten().size(); | |
} | |
return m; | |
}); | |
// bookmarked, witch uses Element.Storage or Event.cache dependent on the Prototype version | |
(Element.Storage ? $H(Element.Storage).values().slice(1).invoke('get', 'prototype_event_registry').compact() : |
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
//= require "http://gist.github.com/66568" | |
//= require "http://gist.github.com/162593" | |
<div class="tab_panel"> | |
<nav> | |
<ul> | |
<li class="tab selected" tabindex="1">tab 1</li> | |
<li class="tab" tabindex="2">tab 2</li> | |
<li class="tab" tabindex="3">tab 3</li> | |
</ul> |
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
//= require "http://gist.github.com/66568" | |
//= require "http://gist.github.com/162593" | |
<div class="tab-panel"> | |
<nav class="tabs"> | |
<ul> | |
<li href="#sect-1" tagindex="1">tab 1</li> | |
<li href="#sect-2" tagindex="2">tab 2</li> | |
<li href="#sect-3" tagindex="3">tab 3</li> | |
</ul> |
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
<div class="tab-panel"> | |
<nav class="tabs"> | |
<ul> | |
<li href="#sect-1" tabindex="1">tab 1</li> | |
<li href="#sect-2" tabindex="2">tab 2</li> | |
<li href="#sect-3" tabindex="3">tab 3</li> | |
</ul> | |
</nav> | |
<section id="sect-1"></section> | |
<section id="sect-2"></section> |
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
Event.allHandlers = function(eventName){ | |
return $H(Element.Storage).inject([], function(m, p){ | |
var registry; | |
if (!p.value.get || !(registry = p.value.get('prototype_event_registry'))){ | |
return m; | |
} | |
if (!eventName){ | |
return m.concat(registry.values().flatten().pluck('handler')); |
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
// | |
// ------------------------ | |
// Class.Mixin.Delegator | |
// ------------------------ | |
// | |
// Usage: | |
// adding: | |
// - MyClass.addMethods(Class.Mixin); | |
// usage (in MyClass): | |
// this.delegate('element', 'observe', 'setPosition'); |
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
<?php | |
class JsConcatinator { | |
private $path; | |
private $included; | |
public function __construct($path){ | |
$this->path = rtrim($path, '/') . '/'; | |
$this->included = array(); | |
} |
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(){ | |
var CODE_FOR_KEYS = { | |
8: 'backspace', | |
9: 'tab', | |
13: 'return', | |
27: 'esc', | |
37: 'left', | |
38: 'up', | |
39: 'right', | |
40: 'down', |