ex_cite 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -134,7 +134,7 @@ module ExCite
|
|
134
134
|
# The callback url is defined here
|
135
135
|
def callback
|
136
136
|
# Starts with current url minus the querystring..
|
137
|
-
callback = "#{export_citations_url.gsub(/https
|
137
|
+
callback = "#{export_citations_url.gsub(/https?/, @push_to.callback_protocol.to_s)}?"
|
138
138
|
citations.collect do |citation|
|
139
139
|
# then adds a resource key for each cached resource
|
140
140
|
callback += (!citation.respond_to? :new_record || citation.new_record?) ? "resource_key[]=#{citation.resource_key}&" : "id[]=#{citation.id}&"
|
@@ -2,7 +2,8 @@ module ExCite
|
|
2
2
|
# Citation class, holds data from format and/or resource key
|
3
3
|
class PushFormat
|
4
4
|
# Required fields
|
5
|
-
attr_accessor :name, :to_format, :action, :template, :url, :method, :enctype, :element_name, :
|
5
|
+
attr_accessor :name, :to_format, :action, :template, :url, :method, :enctype, :element_name, :callback_protocol
|
6
|
+
alias :protocol= :callback_protocol=
|
6
7
|
def initialize args = {}
|
7
8
|
self.name = (args[:name] or 'Service')
|
8
9
|
self.to_format = args[:to_format]
|
@@ -12,7 +13,7 @@ module ExCite
|
|
12
13
|
self.method = (args[:method] or "POST")
|
13
14
|
self.enctype = (args[:enctype] or "application/x-www-form-urlencoded")
|
14
15
|
self.element_name = (args[:element_name] or "data")
|
15
|
-
self.
|
16
|
+
self.callback_protocol = (args[:protocol] or :http)
|
16
17
|
end
|
17
18
|
end
|
18
19
|
end
|
data/lib/ex_cite/version.rb
CHANGED