rocky 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,7 +14,7 @@ module Rocky
|
|
14
14
|
|
15
15
|
def inject_middleware
|
16
16
|
inject_into_file "app/assets/javascripts/application.js", :after => "//= require jquery_ujs" do
|
17
|
-
"\n//= require underscore\n//= require backbone\n//= require
|
17
|
+
"\n//= require underscore\n//= require backbone\n//= require middleware\n//= require application/#{application_name.underscore}"
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
data/lib/rocky/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rocky
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -75,7 +75,6 @@ files:
|
|
75
75
|
- vendor/assets/javascripts/middleware/component/modal.js.coffee
|
76
76
|
- vendor/assets/javascripts/middleware/component/puppet.js.coffee
|
77
77
|
- vendor/assets/javascripts/underscore.js
|
78
|
-
- vendor/assets/javascripts/xdomain.js
|
79
78
|
- vendor/assets/javascripts/backbone.js
|
80
79
|
- vendor/assets/javascripts/middleware.js.coffee
|
81
80
|
- Rakefile
|
@@ -1,75 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* jQuery.ajax mid - CROSS DOMAIN AJAX
|
3
|
-
* ---
|
4
|
-
* @author James Padolsey (http://james.padolsey.com)
|
5
|
-
* @version 0.11
|
6
|
-
* @updated 12-JAN-10
|
7
|
-
* ---
|
8
|
-
* Note: Read the README!
|
9
|
-
* ---
|
10
|
-
* @info http://james.padolsey.com/javascript/cross-domain-requests-with-jquery/
|
11
|
-
*/
|
12
|
-
|
13
|
-
jQuery.ajax = (function(_ajax){
|
14
|
-
|
15
|
-
var protocol = location.protocol,
|
16
|
-
hostname = location.hostname,
|
17
|
-
exRegex = RegExp(protocol + '//' + hostname),
|
18
|
-
YQL = 'http' + (/^https/.test(protocol)?'s':'') + '://query.yahooapis.com/v1/public/yql?callback=?',
|
19
|
-
query = 'select * from html where url="{URL}" and xpath="*"';
|
20
|
-
|
21
|
-
function isExternal(url) {
|
22
|
-
return !exRegex.test(url) && /:\/\//.test(url);
|
23
|
-
}
|
24
|
-
|
25
|
-
return function(o) {
|
26
|
-
|
27
|
-
var url = o.url;
|
28
|
-
|
29
|
-
if ( /get/i.test(o.type) && !/json/i.test(o.dataType) && isExternal(url) ) {
|
30
|
-
|
31
|
-
// Manipulate options so that JSONP-x request is made to YQL
|
32
|
-
|
33
|
-
o.url = YQL;
|
34
|
-
o.dataType = 'json';
|
35
|
-
|
36
|
-
o.data = {
|
37
|
-
q: query.replace(
|
38
|
-
'{URL}',
|
39
|
-
url + (o.data ?
|
40
|
-
(/\?/.test(url) ? '&' : '?') + jQuery.param(o.data)
|
41
|
-
: '')
|
42
|
-
),
|
43
|
-
format: 'xml'
|
44
|
-
};
|
45
|
-
|
46
|
-
// Since it's a JSONP request
|
47
|
-
// complete === success
|
48
|
-
if (!o.success && o.complete) {
|
49
|
-
o.success = o.complete;
|
50
|
-
delete o.complete;
|
51
|
-
}
|
52
|
-
|
53
|
-
o.success = (function(_success){
|
54
|
-
return function(data) {
|
55
|
-
|
56
|
-
if (_success) {
|
57
|
-
// Fake XHR callback.
|
58
|
-
_success.call(this, {
|
59
|
-
responseText: (data.results[0] || '')
|
60
|
-
// YQL screws with <script>s
|
61
|
-
// Get rid of them
|
62
|
-
.replace(/<script[^>]+?\/>|<script(.|\s)*?\/script>/gi, '')
|
63
|
-
}, 'success');
|
64
|
-
}
|
65
|
-
|
66
|
-
};
|
67
|
-
})(o.success);
|
68
|
-
|
69
|
-
}
|
70
|
-
|
71
|
-
return _ajax.apply(this, arguments);
|
72
|
-
|
73
|
-
};
|
74
|
-
|
75
|
-
})(jQuery.ajax);
|