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 parent_removal_behavior = { | |
click: function() { | |
this.parent().hide(); | |
} | |
}; | |
// assigning to css-rules | |
".remove_parent".behave(parent_removal_behavior); | |
".some_other_rule".behave(parent_removal_behavior); |
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
Behavior.delegate = function(rules) { | |
return function(e) { | |
var element = $(e.target); | |
for (var selector in rules) | |
if (element.match(selector)) return rules[selector].apply(this, arguments); | |
} | |
}; | |
".something".behave('click', Behavior.delegate({ | |
".foo": function() { return 'foo'; }, |
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 Klass = new Class((function() { | |
var private_method = function() { | |
// bla bla bla | |
}; | |
return { | |
initialize: 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
RightJS.run(function(_) { | |
with (_) { | |
var Klass = new Class(Observer, { | |
EVENTS: $w('some darn events'), | |
initialize: function() { | |
alert("Holy Jack!") | |
} | |
}); | |
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
/** | |
* the old Autocompleter constructor | |
* uses RightJS 1 and `Class` | |
*/ | |
initialize: function(input, options) { | |
this.input = $(input); // don't low it down! | |
this.$super(options); | |
// storing the callbacks so we could detach them later | |
this._watch = this.watch.bind(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
module Boo | |
module Hoo | |
class Doo | |
def Zoo | |
text <<-EOS.gsub(/^ *\|/, '') | |
|<?xml version="1.0" encoding="UTF-8"?> | |
|<response> | |
| <sid>#{sid}</sid> | |
|</response> | |
EOS |
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
"#title".onClick(function() { | |
this.highlight(); | |
}); | |
"#boom".onClick(function(event) { | |
event.stop(); | |
$('title').fade(); | |
}); | |
"#time".onClick(function(event) { |
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
<dl id="tutorials-index"> | |
<dt>Beginner Topics</dt> | |
<ul> | |
<%= menu_link_to "Getting Started", tutorial_path('getting-started') %> | |
<%= menu_link_to "Top 12 Features", tutorial_path('top-features') %> | |
</ul> | |
<dt>Basic Features</dt> | |
<ul> | |
<%= menu_link_to "Call By Name", tutorial_path('call-by-name') %> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> | |
<title>RightJS Growl Example</title> | |
<link href="demo.css" media="screen" rel="stylesheet" type="text/css"/> | |
<script type="text/javascript" src="http://rightjs.org/hotlink/right.js"></script> | |
<script type="text/javascript" src="../src/rightjs-growl.js"></script> | |
<script type="text/javascript"> | |
"a.regular-growl".onClick(function(e){ |
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 Keyboard = new Class({ | |
prebind: 'handler', | |
initialize: function() { | |
$(document).on({ | |
keypress: this.handler, | |
keyup: this.handler | |
}); | |
}, |
OlderNewer