Created
December 3, 2008 10:24
-
-
Save edbond/31498 to your computer and use it in GitHub Desktop.
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
# AV/base.rb | |
def render(options = {}, local_assigns = {}, &block) #:nodoc: | |
local_assigns ||= {} | |
"<!--DBG #{options[:layout]} #{options[:file]} #{options[:partial]} #{options[:text]}-->"+ | |
if options.is_a?(String) | |
ActiveSupport::Deprecation.warn( | |
"Calling render with a string will render a partial from Rails 2.3. " + | |
"Change this call to render(:file => '#{options}', :locals => locals_hash)." | |
) | |
render(:file => options, :locals => local_assigns) | |
elsif options == :update | |
update_page(&block) | |
elsif options.is_a?(Hash) | |
options = options.reverse_merge(:locals => {}) | |
if options[:layout] | |
_render_with_layout(options, local_assigns, &block) | |
elsif options[:file] | |
_pick_template(options[:file]).render_template(self, options[:locals]) | |
elsif options[:partial] | |
render_partial(options) | |
elsif options[:inline] | |
InlineTemplate.new(options[:inline], options[:type]).render(self, options[:locals]) | |
elsif options[:text] | |
options[:text] | |
end | |
end+ | |
"<!--ENDDBG #{options[:file]} #{options[:partial]}-->" | |
end |
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
// js | |
Event.addBehavior({ | |
'*:mousemove':function(evt) { | |
var el=this; | |
var s=null; | |
do { | |
el=el.parentNode; | |
if (!el) | |
break; | |
// look for comments | |
s=el.previousSibling; | |
while (s) { | |
if (s.nodeType==Node.COMMENT_NODE) { | |
console.log(s.textContent); | |
}; | |
s=s.previousSibling; | |
} | |
} while (el != null); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment