Module: Apotomo::JavascriptGenerator::Jquery

Defined in:
lib/apotomo/javascript_generator.rb

Instance Method Summary collapse

Instance Method Details

#element(id) ⇒ Object


45
# File 'lib/apotomo/javascript_generator.rb', line 45

def element(id);            "jQuery(\"#{id}\")"; end

#jqueryObject


44
# File 'lib/apotomo/javascript_generator.rb', line 44

def jquery;                 end

#replace(id, markup) ⇒ Object


47
# File 'lib/apotomo/javascript_generator.rb', line 47

def replace(id, markup);    element(id) + '.replaceWith("'+escape(markup)+'");'; end

#replace_id(id, markup) ⇒ Object


49
# File 'lib/apotomo/javascript_generator.rb', line 49

def replace_id(id, markup); replace("##{id}", markup); end

#update(id, markup) ⇒ Object


46
# File 'lib/apotomo/javascript_generator.rb', line 46

def update(id, markup);     element(id) + '.html("'+escape(markup)+'");'; end

#update_id(id, markup) ⇒ Object


48
# File 'lib/apotomo/javascript_generator.rb', line 48

def update_id(id, markup);  update("##{id}", markup); end