Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

jquery noConflic mode - tests passes

  • Loading branch information...
commit 7b141be7ed52a556c86bd0ed7d1ab64eb1ef7c01 1 parent 78a2bc3
@kristianmandrup authored
View
6 README.rdoc
@@ -188,7 +188,7 @@ Also, updating the page is in your hands. Where Apotomo provides handy helpers a
Look, +replace+ basically generates
- $("comments").replaceWith(<the rendered view>);
+ jQuery("comments").replaceWith(<the rendered view>);
If that's not what you want, do
@@ -316,7 +316,7 @@ Widget.TopBar = {
toggleActive: function(widget_id, options) {
item = options['item'];
// do some toggle magic!!!
- $(widget_id).find(item).toggleClass('active');
+ jQuery(widget_id).find(item).toggleClass('active');
}
}
```
@@ -387,7 +387,7 @@ namespace "Widget"
toggleActive: (options) ->
item = options.item
- $(@widget_id).find(item).toggleClass 'active'
+ jQuery(@widget_id).find(item).toggleClass 'active'
```
`rails g apotomo:widget TopBar::SuperThang show -e haml`
View
2  lib/apotomo/javascript_generator.rb
@@ -49,7 +49,7 @@ module Jquery
def jquery; end
def element(selector)
selector = jq_helper.calc_selector selector
- "$(#{selector})"
+ "jQuery(#{selector})"
end
def update(*args, &block)
View
4 lib/apotomo/javascript_generator/jquery_helper.rb
@@ -19,7 +19,7 @@ def jq_action *args, action
def inv_markup_action(selector, markup, action)
selector = calc_selector selector
action = js_camelize(action)
- "$(#{escaped(markup)}).#{action}(#{selector});"
+ "jQuery(#{escaped(markup)}).#{action}(#{selector});"
end
def markup_act name, *args, &block
@@ -89,7 +89,7 @@ def apo_match? selector
def element(selector)
selector = calc_selector selector
- "$(#{selector})"
+ "jQuery(#{selector})"
end
# id, selector, markup, action
View
2  lib/apotomo/rails/view_helper/ajax.rb
@@ -3,7 +3,7 @@ module Ajax
# fx
# ajax_url "#trashbin", "&id=" + ui.draggable.attr("data-id")
def ajax_url selector, params
- %Q{$.ajax({url: $("#{selector}").attr("data-event-url") + #{params};})}
+ %Q{jQuery.ajax({url: jQuery("#{selector}").attr("data-event-url") + #{params};})}
end
end
end
View
2  lib/apotomo/rails/view_helper/dragn_drop.rb
@@ -3,7 +3,7 @@ module DragnDrop
# fx
# droppable "#trashbin", ajax_url("#trashbin", "&id=" + ui.draggable.attr("data-id"))
def droppable selector, &block
- %Q{$("#{selector}").droppable({
+ %Q{jQuery("#{selector}").droppable({
drop: function(event, ui) {
#{yield}
}
Please sign in to comment.
Something went wrong with that request. Please try again.