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 Widget = new Class({ | |
Implements: Options, | |
options: { | |
color: '#fff', | |
size: { | |
width: 100, | |
height: 100 | |
} | |
}, | |
initialize: function(options){ |
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 MyClass extends Configurable { | |
protected static $_defaults = array ( | |
"option1" => "blah blah blah", | |
"option2" => 35, | |
"option3" => true | |
); | |
public function __construct($param, $options = null) | |
{ |
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
/* | |
* Base class for configurable classes | |
* Based off a class that was included with the Solarium library | |
* This new version lets you declare defaults which are inherited down the inheritance tree | |
* | |
* All classes extending this class are configurable using the constructor or setOption calls. | |
* | |
*/ | |
class Configurable | |
{ |
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
Behavior.addGlobalFilters ({ | |
AnimatedAnchor: { | |
defaults: { | |
duration: 'short', | |
transition: 'quad:in:out' | |
}, | |
setup: function (link, api) { |
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
window.addEvent('domready', function () { | |
Behavior.addGlobalFilters ({ | |
LinkHijack: { | |
defaults: { | |
"text": "Default Text", // the text you want output | |
"useAlert": false, // false to use console, true to use alert | |
"preventDefault": true // true to make hijacked link stop from proceding |
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
window.addEvent('domready', function () { | |
Behavior.addGlobalFilters ({ | |
LinkHijack: { | |
setup: function (elem, api) { | |
elem.addEvent ("click", function (e) { | |
e.preventDefault(); | |
console.log ("Ooga Booga"); | |
} |
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
window.addEvent('domready', function () { | |
document.getElementById("sillylink").addEvent ("click", function (e) { | |
e.preventDefault(); | |
console.log ("ooga booga"); | |
} | |
} |