livefyre 0.1.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/.gitignore +1 -1
- data/Gemfile +0 -0
- data/LICENSE.txt +21 -0
- data/README.md +47 -127
- data/Rakefile +2 -9
- data/lib/livefyre/core.rb +102 -0
- data/lib/livefyre/version.rb +1 -1
- data/lib/livefyre.rb +4 -51
- data/livefyre.gemspec +24 -34
- data/spec/livefyre/core_spec.rb +33 -0
- metadata +58 -172
- checksums.yaml.gz.sig +0 -0
- data/LICENSE +0 -22
- data/app/assets/javascripts/livefyre.js +0 -180
- data/app/assets/javascripts/livefyre.js.coffee +0 -109
- data/gem-public_cert.pem +0 -21
- data/lib/livefyre/activity.rb +0 -43
- data/lib/livefyre/client.rb +0 -141
- data/lib/livefyre/comment.rb +0 -190
- data/lib/livefyre/controller_extensions.rb +0 -82
- data/lib/livefyre/conversation.rb +0 -133
- data/lib/livefyre/domain.rb +0 -220
- data/lib/livefyre/engine.rb +0 -6
- data/lib/livefyre/helpers.rb +0 -57
- data/lib/livefyre/model_extensions.rb +0 -64
- data/lib/livefyre/site.rb +0 -237
- data/lib/livefyre/user.rb +0 -162
- data/railties/railtie.rb +0 -9
- data/spec/livefyre/client_spec.rb +0 -104
- data/spec/livefyre/domain_spec.rb +0 -294
- data/spec/livefyre/livefyre_spec.rb +0 -30
- data/spec/livefyre/model_spec.rb +0 -96
- data/spec/livefyre/site_spec.rb +0 -212
- data/spec/livefyre/user_spec.rb +0 -111
- data/spec/spec_helper.rb +0 -26
- data.tar.gz.sig +0 -1
- metadata.gz.sig +0 -0
metadata
CHANGED
@@ -1,261 +1,147 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: livefyre
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Livefyre
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
|
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vB+fp4YlkdLF
|
27
|
-
0kmAyz4RIesM0lERf1VqBKoNbHtKFZS/xhIOWL2fAu8THLpP5a9eVA2rdYfhP/ci
|
28
|
-
ka+Vu7ZE8592V3oc58mrVM23aSbXcayMAhxisdl861ivx4HOx2uUa1uXRDKQeUu6
|
29
|
-
b+eVzkQQqG4wHTlqW9E3ZtQP5tzg/ysTziZPMxwdO2jPq6TnN/eVHSXNUj8KFvCM
|
30
|
-
3SGzoShdNQygjL3WAVzfODhd9S5immxeoFdoNy2bMaQ56xcnhaQo+oObjGfUHXfG
|
31
|
-
r/Yw+hd3zY0RL8eCvGhd6dDlhmPPIBMc
|
32
|
-
-----END CERTIFICATE-----
|
33
|
-
date: 2014-03-20 00:00:00.000000000 Z
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-03-27 00:00:00.000000000 Z
|
34
12
|
dependencies:
|
35
13
|
- !ruby/object:Gem::Dependency
|
36
|
-
name:
|
14
|
+
name: bundler
|
37
15
|
requirement: !ruby/object:Gem::Requirement
|
38
16
|
requirements:
|
39
|
-
- -
|
17
|
+
- - ~>
|
40
18
|
- !ruby/object:Gem::Version
|
41
|
-
version: '
|
42
|
-
type: :
|
19
|
+
version: '1.3'
|
20
|
+
type: :development
|
43
21
|
prerelease: false
|
44
22
|
version_requirements: !ruby/object:Gem::Requirement
|
45
23
|
requirements:
|
46
|
-
- -
|
24
|
+
- - ~>
|
47
25
|
- !ruby/object:Gem::Version
|
48
|
-
version: '
|
26
|
+
version: '1.3'
|
49
27
|
- !ruby/object:Gem::Dependency
|
50
|
-
name:
|
28
|
+
name: rake
|
51
29
|
requirement: !ruby/object:Gem::Requirement
|
52
30
|
requirements:
|
53
|
-
- - '>='
|
31
|
+
- - ! '>='
|
54
32
|
- !ruby/object:Gem::Version
|
55
33
|
version: '0'
|
56
|
-
type: :
|
34
|
+
type: :development
|
57
35
|
prerelease: false
|
58
36
|
version_requirements: !ruby/object:Gem::Requirement
|
59
37
|
requirements:
|
60
|
-
- - '>='
|
38
|
+
- - ! '>='
|
61
39
|
- !ruby/object:Gem::Version
|
62
40
|
version: '0'
|
63
41
|
- !ruby/object:Gem::Dependency
|
64
|
-
name:
|
42
|
+
name: rest-client
|
65
43
|
requirement: !ruby/object:Gem::Requirement
|
66
44
|
requirements:
|
67
|
-
- -
|
45
|
+
- - ~>
|
68
46
|
- !ruby/object:Gem::Version
|
69
|
-
version: '
|
70
|
-
|
71
|
-
prerelease: false
|
72
|
-
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
requirements:
|
74
|
-
- - '>='
|
47
|
+
version: '1.6'
|
48
|
+
- - ! '>='
|
75
49
|
- !ruby/object:Gem::Version
|
76
|
-
version:
|
77
|
-
- !ruby/object:Gem::Dependency
|
78
|
-
name: rspec
|
79
|
-
requirement: !ruby/object:Gem::Requirement
|
80
|
-
requirements:
|
81
|
-
- - '>='
|
82
|
-
- !ruby/object:Gem::Version
|
83
|
-
version: '0'
|
50
|
+
version: 1.6.7
|
84
51
|
type: :development
|
85
52
|
prerelease: false
|
86
53
|
version_requirements: !ruby/object:Gem::Requirement
|
87
54
|
requirements:
|
88
|
-
- -
|
55
|
+
- - ~>
|
89
56
|
- !ruby/object:Gem::Version
|
90
|
-
version: '
|
91
|
-
- !
|
92
|
-
name: simplecov
|
93
|
-
requirement: !ruby/object:Gem::Requirement
|
94
|
-
requirements:
|
95
|
-
- - '>='
|
57
|
+
version: '1.6'
|
58
|
+
- - ! '>='
|
96
59
|
- !ruby/object:Gem::Version
|
97
|
-
version:
|
98
|
-
type: :development
|
99
|
-
prerelease: false
|
100
|
-
version_requirements: !ruby/object:Gem::Requirement
|
101
|
-
requirements:
|
102
|
-
- - '>='
|
103
|
-
- !ruby/object:Gem::Version
|
104
|
-
version: '0'
|
60
|
+
version: 1.6.7
|
105
61
|
- !ruby/object:Gem::Dependency
|
106
|
-
name:
|
62
|
+
name: jwt
|
107
63
|
requirement: !ruby/object:Gem::Requirement
|
108
64
|
requirements:
|
109
|
-
- -
|
65
|
+
- - ~>
|
110
66
|
- !ruby/object:Gem::Version
|
111
|
-
version: '0'
|
112
|
-
|
113
|
-
prerelease: false
|
114
|
-
version_requirements: !ruby/object:Gem::Requirement
|
115
|
-
requirements:
|
116
|
-
- - '>='
|
67
|
+
version: '0.1'
|
68
|
+
- - ! '>='
|
117
69
|
- !ruby/object:Gem::Version
|
118
|
-
version:
|
119
|
-
- !ruby/object:Gem::Dependency
|
120
|
-
name: rails
|
121
|
-
requirement: !ruby/object:Gem::Requirement
|
122
|
-
requirements:
|
123
|
-
- - '>='
|
124
|
-
- !ruby/object:Gem::Version
|
125
|
-
version: '0'
|
70
|
+
version: 0.1.11
|
126
71
|
type: :development
|
127
72
|
prerelease: false
|
128
73
|
version_requirements: !ruby/object:Gem::Requirement
|
129
74
|
requirements:
|
130
|
-
- -
|
75
|
+
- - ~>
|
131
76
|
- !ruby/object:Gem::Version
|
132
|
-
version: '0'
|
133
|
-
- !
|
134
|
-
name: resque
|
135
|
-
requirement: !ruby/object:Gem::Requirement
|
136
|
-
requirements:
|
137
|
-
- - '>='
|
138
|
-
- !ruby/object:Gem::Version
|
139
|
-
version: '0'
|
140
|
-
type: :development
|
141
|
-
prerelease: false
|
142
|
-
version_requirements: !ruby/object:Gem::Requirement
|
143
|
-
requirements:
|
144
|
-
- - '>='
|
77
|
+
version: '0.1'
|
78
|
+
- - ! '>='
|
145
79
|
- !ruby/object:Gem::Version
|
146
|
-
version:
|
80
|
+
version: 0.1.11
|
147
81
|
- !ruby/object:Gem::Dependency
|
148
|
-
name:
|
82
|
+
name: rspec
|
149
83
|
requirement: !ruby/object:Gem::Requirement
|
150
84
|
requirements:
|
151
|
-
- -
|
152
|
-
- !ruby/object:Gem::Version
|
153
|
-
version: '0'
|
154
|
-
type: :development
|
155
|
-
prerelease: false
|
156
|
-
version_requirements: !ruby/object:Gem::Requirement
|
157
|
-
requirements:
|
158
|
-
- - '>='
|
85
|
+
- - ~>
|
159
86
|
- !ruby/object:Gem::Version
|
160
|
-
version: '
|
161
|
-
- !
|
162
|
-
name: yard-tomdoc
|
163
|
-
requirement: !ruby/object:Gem::Requirement
|
164
|
-
requirements:
|
165
|
-
- - '>='
|
87
|
+
version: '2.14'
|
88
|
+
- - ! '>='
|
166
89
|
- !ruby/object:Gem::Version
|
167
|
-
version:
|
90
|
+
version: 2.14.1
|
168
91
|
type: :development
|
169
92
|
prerelease: false
|
170
93
|
version_requirements: !ruby/object:Gem::Requirement
|
171
94
|
requirements:
|
172
|
-
- -
|
173
|
-
- !ruby/object:Gem::Version
|
174
|
-
version: '0'
|
175
|
-
- !ruby/object:Gem::Dependency
|
176
|
-
name: redcarpet
|
177
|
-
requirement: !ruby/object:Gem::Requirement
|
178
|
-
requirements:
|
179
|
-
- - '>='
|
95
|
+
- - ~>
|
180
96
|
- !ruby/object:Gem::Version
|
181
|
-
version: '
|
182
|
-
|
183
|
-
prerelease: false
|
184
|
-
version_requirements: !ruby/object:Gem::Requirement
|
185
|
-
requirements:
|
186
|
-
- - '>='
|
97
|
+
version: '2.14'
|
98
|
+
- - ! '>='
|
187
99
|
- !ruby/object:Gem::Version
|
188
|
-
version:
|
189
|
-
description:
|
100
|
+
version: 2.14.1
|
101
|
+
description: Livefyre Ruby utility classes
|
190
102
|
email:
|
191
|
-
-
|
103
|
+
- tools@livefyre.com
|
192
104
|
executables: []
|
193
105
|
extensions: []
|
194
106
|
extra_rdoc_files: []
|
195
107
|
files:
|
196
108
|
- .gitignore
|
197
109
|
- Gemfile
|
198
|
-
- LICENSE
|
110
|
+
- LICENSE.txt
|
199
111
|
- README.md
|
200
112
|
- Rakefile
|
201
|
-
- app/assets/javascripts/livefyre.js
|
202
|
-
- app/assets/javascripts/livefyre.js.coffee
|
203
|
-
- gem-public_cert.pem
|
204
113
|
- lib/livefyre.rb
|
205
|
-
- lib/livefyre/
|
206
|
-
- lib/livefyre/client.rb
|
207
|
-
- lib/livefyre/comment.rb
|
208
|
-
- lib/livefyre/controller_extensions.rb
|
209
|
-
- lib/livefyre/conversation.rb
|
210
|
-
- lib/livefyre/domain.rb
|
211
|
-
- lib/livefyre/engine.rb
|
212
|
-
- lib/livefyre/helpers.rb
|
213
|
-
- lib/livefyre/model_extensions.rb
|
214
|
-
- lib/livefyre/site.rb
|
215
|
-
- lib/livefyre/user.rb
|
114
|
+
- lib/livefyre/core.rb
|
216
115
|
- lib/livefyre/version.rb
|
217
116
|
- livefyre.gemspec
|
218
|
-
-
|
219
|
-
|
220
|
-
|
221
|
-
-
|
222
|
-
- spec/livefyre/model_spec.rb
|
223
|
-
- spec/livefyre/site_spec.rb
|
224
|
-
- spec/livefyre/user_spec.rb
|
225
|
-
- spec/spec_helper.rb
|
226
|
-
homepage: http://github.com/mashable/livefyre
|
227
|
-
licenses: []
|
117
|
+
- spec/livefyre/core_spec.rb
|
118
|
+
homepage: http://github.com/livefyre/livefyre-ruby-utils
|
119
|
+
licenses:
|
120
|
+
- MIT
|
228
121
|
metadata: {}
|
229
|
-
post_install_message:
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
! And: https://github.com/mashable/livefyre
|
122
|
+
post_install_message: ! " ! Note: this is a completely new version of the livefyre
|
123
|
+
gem from Livefyre.\n ! Users that were using the previous livefyre gem (v.0.1.2)
|
124
|
+
should now refer to livefyre-mashable.\n ! These two gems cannot be used in conjunction
|
125
|
+
with one another as they share the same namespace.\n"
|
234
126
|
rdoc_options: []
|
235
127
|
require_paths:
|
236
128
|
- lib
|
237
129
|
required_ruby_version: !ruby/object:Gem::Requirement
|
238
130
|
requirements:
|
239
|
-
- - '>='
|
131
|
+
- - ! '>='
|
240
132
|
- !ruby/object:Gem::Version
|
241
133
|
version: '0'
|
242
134
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
243
135
|
requirements:
|
244
|
-
- - '>='
|
136
|
+
- - ! '>='
|
245
137
|
- !ruby/object:Gem::Version
|
246
138
|
version: '0'
|
247
139
|
requirements: []
|
248
140
|
rubyforge_project:
|
249
|
-
rubygems_version: 2.
|
141
|
+
rubygems_version: 2.2.2
|
250
142
|
signing_key:
|
251
143
|
specification_version: 4
|
252
|
-
summary:
|
144
|
+
summary: Livefyre Ruby utility classes
|
253
145
|
test_files:
|
254
|
-
- spec/livefyre/
|
255
|
-
- spec/livefyre/domain_spec.rb
|
256
|
-
- spec/livefyre/livefyre_spec.rb
|
257
|
-
- spec/livefyre/model_spec.rb
|
258
|
-
- spec/livefyre/site_spec.rb
|
259
|
-
- spec/livefyre/user_spec.rb
|
260
|
-
- spec/spec_helper.rb
|
146
|
+
- spec/livefyre/core_spec.rb
|
261
147
|
has_rdoc:
|
checksums.yaml.gz.sig
DELETED
Binary file
|
data/LICENSE
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
Copyright (c) 2012 Mashable, Inc
|
2
|
-
|
3
|
-
MIT License
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
-
a copy of this software and associated documentation files (the
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
11
|
-
the following conditions:
|
12
|
-
|
13
|
-
The above copyright notice and this permission notice shall be
|
14
|
-
included in all copies or substantial portions of the Software.
|
15
|
-
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -1,180 +0,0 @@
|
|
1
|
-
// Generated by CoffeeScript 1.6.3
|
2
|
-
(function() {
|
3
|
-
var cookie, defaultDelegate, load, utils, _initialized;
|
4
|
-
|
5
|
-
defaultDelegate = function(options) {
|
6
|
-
var authDelegate, k, v, _ref;
|
7
|
-
authDelegate = new fyre.conv.RemoteAuthDelegate();
|
8
|
-
_ref = options.auth;
|
9
|
-
for (k in _ref) {
|
10
|
-
v = _ref[k];
|
11
|
-
authDelegate[k] = v;
|
12
|
-
}
|
13
|
-
return authDelegate;
|
14
|
-
};
|
15
|
-
|
16
|
-
load = null;
|
17
|
-
|
18
|
-
(function() {
|
19
|
-
var fjs, __loadedScripts;
|
20
|
-
__loadedScripts = [];
|
21
|
-
fjs = null;
|
22
|
-
return load = function(source, id, options) {
|
23
|
-
var js, k, v;
|
24
|
-
if (document.getElementById(id)) {
|
25
|
-
return;
|
26
|
-
}
|
27
|
-
if (__loadedScripts[id]) {
|
28
|
-
return;
|
29
|
-
}
|
30
|
-
__loadedScripts[id] = true;
|
31
|
-
if (!fjs) {
|
32
|
-
fjs = document.getElementsByTagName('script')[0];
|
33
|
-
}
|
34
|
-
js = document.createElement("script");
|
35
|
-
js.id = id;
|
36
|
-
js.async = true;
|
37
|
-
js.src = source;
|
38
|
-
if (options) {
|
39
|
-
for (k in options) {
|
40
|
-
v = options[k];
|
41
|
-
js[k] = v;
|
42
|
-
}
|
43
|
-
}
|
44
|
-
fjs.parentNode.insertBefore(js, fjs);
|
45
|
-
return js;
|
46
|
-
};
|
47
|
-
})();
|
48
|
-
|
49
|
-
cookie = function(token) {
|
50
|
-
var m;
|
51
|
-
m = document.cookie.match(new RegExp(token + "=([^;]+)"));
|
52
|
-
if (m) {
|
53
|
-
return m[1];
|
54
|
-
} else {
|
55
|
-
return null;
|
56
|
-
}
|
57
|
-
};
|
58
|
-
|
59
|
-
utils = function(options) {
|
60
|
-
var obj;
|
61
|
-
return obj = {
|
62
|
-
load: load,
|
63
|
-
startLogin: function(url, width, height, callback, windowName) {
|
64
|
-
var left, popup, top;
|
65
|
-
if (width == null) {
|
66
|
-
width = 600;
|
67
|
-
}
|
68
|
-
if (height == null) {
|
69
|
-
height = 400;
|
70
|
-
}
|
71
|
-
if (callback == null) {
|
72
|
-
callback = null;
|
73
|
-
}
|
74
|
-
if (windowName == null) {
|
75
|
-
windowName = null;
|
76
|
-
}
|
77
|
-
left = (screen.width / 2) - (width / 2);
|
78
|
-
top = (screen.height / 2) - (height / 2);
|
79
|
-
popup = window.open(url, windowName, "menubar=no,toolbar=no,status=no,width=" + width + ",height=" + height + ",toolbar=no,left=" + left + ",top=" + top);
|
80
|
-
this.finishCallback = callback;
|
81
|
-
return this.startLoginPopup(popup);
|
82
|
-
},
|
83
|
-
startLoginPopup: function(popup) {
|
84
|
-
var _this = this;
|
85
|
-
this.tries = 0;
|
86
|
-
this.popup = popup;
|
87
|
-
return this.timer = setInterval(function() {
|
88
|
-
return _this.__checkLogin();
|
89
|
-
}, 100);
|
90
|
-
},
|
91
|
-
__checkLogin: function() {
|
92
|
-
var err, token;
|
93
|
-
token = cookie(options.cookie_name || "livefyre_utoken");
|
94
|
-
if (token && this.timer) {
|
95
|
-
clearInterval(this.timer);
|
96
|
-
if (this.popup) {
|
97
|
-
this.popup.close();
|
98
|
-
}
|
99
|
-
this.popup = null;
|
100
|
-
this.timer = null;
|
101
|
-
if (this.finishCallback) {
|
102
|
-
this.finishCallback();
|
103
|
-
}
|
104
|
-
return window.fyre.conv.login(token);
|
105
|
-
} else if (this.popup && this.popup.closed) {
|
106
|
-
try {
|
107
|
-
this.tries += 1;
|
108
|
-
if (this.tries > 30) {
|
109
|
-
clearInterval(this.timer);
|
110
|
-
this.timer = null;
|
111
|
-
return this.popup = null;
|
112
|
-
}
|
113
|
-
} catch (_error) {
|
114
|
-
err = _error;
|
115
|
-
}
|
116
|
-
}
|
117
|
-
}
|
118
|
-
};
|
119
|
-
};
|
120
|
-
|
121
|
-
_initialized = false;
|
122
|
-
|
123
|
-
this.initLivefyre = function(options) {
|
124
|
-
var e, element, returnable;
|
125
|
-
if (_initialized && !options.force) {
|
126
|
-
throw "Livefyre has already been initialized";
|
127
|
-
}
|
128
|
-
_initialized = true;
|
129
|
-
e = document.getElementById(options.element_id || "livefyre_comments");
|
130
|
-
if (e) {
|
131
|
-
options.config || (options.config = {
|
132
|
-
checksum: e.getAttribute("data-checksum"),
|
133
|
-
collectionMeta: e.getAttribute("data-collection-meta"),
|
134
|
-
articleId: e.getAttribute("data-article-id"),
|
135
|
-
siteId: e.getAttribute("data-site-id"),
|
136
|
-
postToButtons: JSON.parse(e.getAttribute("data-post-to-buttons")),
|
137
|
-
el: e.id
|
138
|
-
});
|
139
|
-
options.network || (options.network = e.getAttribute("data-network"));
|
140
|
-
options.domain || (options.domain = e.getAttribute("data-domain"));
|
141
|
-
options.root || (options.root = e.getAttribute("data-root"));
|
142
|
-
returnable = utils(options);
|
143
|
-
this.FYRE_LOADED_CB = function() {
|
144
|
-
var opts;
|
145
|
-
if (options.preLoad) {
|
146
|
-
options.preLoad(fyre);
|
147
|
-
}
|
148
|
-
opts = {
|
149
|
-
network: options.network,
|
150
|
-
authDelegate: options.delegate || defaultDelegate(options)
|
151
|
-
};
|
152
|
-
console.log(options.config);
|
153
|
-
return fyre.conv.load(opts, [options.config], function(widget) {
|
154
|
-
var error, token;
|
155
|
-
returnable.widget = widget;
|
156
|
-
token = cookie(options.cookie_name || "livefyre_utoken");
|
157
|
-
if (token) {
|
158
|
-
try {
|
159
|
-
return fyre.conv.login(token);
|
160
|
-
} catch (_error) {
|
161
|
-
error = _error;
|
162
|
-
if (window.console) {
|
163
|
-
return window.console.log("Error logging in:", e);
|
164
|
-
}
|
165
|
-
}
|
166
|
-
}
|
167
|
-
});
|
168
|
-
};
|
169
|
-
if (!options.manualLoad) {
|
170
|
-
element = load("http://" + options.root + "/wjs/v3.0/javascripts/livefyre.js", null, {
|
171
|
-
"data-lf-domain": options.network
|
172
|
-
});
|
173
|
-
}
|
174
|
-
return returnable;
|
175
|
-
} else {
|
176
|
-
return null;
|
177
|
-
}
|
178
|
-
};
|
179
|
-
|
180
|
-
}).call(this);
|
@@ -1,109 +0,0 @@
|
|
1
|
-
defaultDelegate = (options) ->
|
2
|
-
authDelegate = new fyre.conv.RemoteAuthDelegate()
|
3
|
-
authDelegate[k] = v for k, v of options.auth
|
4
|
-
authDelegate
|
5
|
-
|
6
|
-
load = null
|
7
|
-
(->
|
8
|
-
__loadedScripts = []
|
9
|
-
fjs = null
|
10
|
-
load = (source, id, options) ->
|
11
|
-
return if (document.getElementById(id))
|
12
|
-
return if __loadedScripts[id]
|
13
|
-
__loadedScripts[id] = true
|
14
|
-
fjs = document.getElementsByTagName('script')[0] unless fjs
|
15
|
-
js = document.createElement("script")
|
16
|
-
js.id = id
|
17
|
-
js.async = true
|
18
|
-
js.src = source
|
19
|
-
js[k] = v for k, v of options if options
|
20
|
-
|
21
|
-
fjs.parentNode.insertBefore(js, fjs)
|
22
|
-
js
|
23
|
-
)()
|
24
|
-
|
25
|
-
cookie = (token) ->
|
26
|
-
m = document.cookie.match(new RegExp(token + "=([^;]+)"))
|
27
|
-
if m then m[1] else null
|
28
|
-
|
29
|
-
utils = (options) ->
|
30
|
-
obj =
|
31
|
-
load: load
|
32
|
-
# At some point, callback should move to the last param
|
33
|
-
# keeping this order for backwards compat for now.
|
34
|
-
startLogin: (url, width = 600, height = 400, callback = null, windowName = null) ->
|
35
|
-
left = (screen.width / 2) - (width / 2)
|
36
|
-
top = (screen.height / 2) - (height / 2)
|
37
|
-
popup = window.open url, windowName, "menubar=no,toolbar=no,status=no,width=#{width},height=#{height},toolbar=no,left=#{left},top=#{top}"
|
38
|
-
@finishCallback = callback
|
39
|
-
@startLoginPopup(popup)
|
40
|
-
|
41
|
-
startLoginPopup: (popup) ->
|
42
|
-
@tries = 0
|
43
|
-
@popup = popup
|
44
|
-
@timer = setInterval(=>
|
45
|
-
@__checkLogin()
|
46
|
-
, 100)
|
47
|
-
|
48
|
-
__checkLogin: ->
|
49
|
-
token = cookie(options.cookie_name || "livefyre_utoken")
|
50
|
-
|
51
|
-
if token and @timer
|
52
|
-
clearInterval(@timer)
|
53
|
-
@popup.close() if @popup
|
54
|
-
@popup = null
|
55
|
-
@timer = null
|
56
|
-
@finishCallback() if @finishCallback
|
57
|
-
window.fyre.conv.login(token)
|
58
|
-
else if @popup and @popup.closed
|
59
|
-
try
|
60
|
-
@tries += 1
|
61
|
-
if @tries > 30 # 3 seconds
|
62
|
-
clearInterval(@timer)
|
63
|
-
@timer = null
|
64
|
-
@popup = null
|
65
|
-
catch err
|
66
|
-
|
67
|
-
_initialized = false
|
68
|
-
@initLivefyre = (options) ->
|
69
|
-
if _initialized and !options.force
|
70
|
-
throw "Livefyre has already been initialized"
|
71
|
-
_initialized = true
|
72
|
-
e = document.getElementById(options.element_id || "livefyre_comments")
|
73
|
-
if e
|
74
|
-
options.config ||=
|
75
|
-
checksum: e.getAttribute("data-checksum")
|
76
|
-
collectionMeta: e.getAttribute("data-collection-meta")
|
77
|
-
articleId: e.getAttribute("data-article-id")
|
78
|
-
siteId: e.getAttribute("data-site-id")
|
79
|
-
postToButtons: JSON.parse(e.getAttribute("data-post-to-buttons"))
|
80
|
-
el: e.id
|
81
|
-
|
82
|
-
options.network ||= e.getAttribute("data-network")
|
83
|
-
options.domain ||= e.getAttribute("data-domain")
|
84
|
-
options.root ||= e.getAttribute("data-root")
|
85
|
-
|
86
|
-
returnable = utils(options)
|
87
|
-
|
88
|
-
@FYRE_LOADED_CB = ->
|
89
|
-
options.preLoad(fyre) if options.preLoad
|
90
|
-
opts =
|
91
|
-
network: options.network
|
92
|
-
authDelegate: options.delegate || defaultDelegate(options)
|
93
|
-
|
94
|
-
console.log options.config
|
95
|
-
fyre.conv.load opts, [options.config], (widget) ->
|
96
|
-
returnable.widget = widget
|
97
|
-
token = cookie(options.cookie_name || "livefyre_utoken")
|
98
|
-
if token
|
99
|
-
try
|
100
|
-
fyre.conv.login(token)
|
101
|
-
catch error
|
102
|
-
window.console.log "Error logging in:", e if window.console
|
103
|
-
|
104
|
-
unless options.manualLoad
|
105
|
-
element = load "http://#{options.root}/wjs/v3.0/javascripts/livefyre.js", null, {"data-lf-domain": options.network}
|
106
|
-
returnable
|
107
|
-
|
108
|
-
else
|
109
|
-
null
|
data/gem-public_cert.pem
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
-----BEGIN CERTIFICATE-----
|
2
|
-
MIIDdDCCAlygAwIBAgIBATANBgkqhkiG9w0BAQUFADBAMQ8wDQYDVQQDDAZjaGVh
|
3
|
-
bGQxGDAWBgoJkiaJk/IsZAEZFghtYXNoYWJsZTETMBEGCgmSJomT8ixkARkWA2Nv
|
4
|
-
bTAeFw0xNDAzMjAyMTUyMzNaFw0xNTAzMjAyMTUyMzNaMEAxDzANBgNVBAMMBmNo
|
5
|
-
ZWFsZDEYMBYGCgmSJomT8ixkARkWCG1hc2hhYmxlMRMwEQYKCZImiZPyLGQBGRYD
|
6
|
-
Y29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4AMfgtORekddgqRx
|
7
|
-
mHdKSRuQ7Pks2LN96uINU9lWhmppM/mrbHUvkW28wdfC27MTtR1cQUZWAzS8eWsH
|
8
|
-
Fq0hdm5R5tsrXLM8Y7tUcoKu5qTJEmDyN2TH3lx9hH/fzwhU2rhb/DrIhtOJNBsg
|
9
|
-
5AERbX/LA6nmQLEQlbVoVHH5tmIGnAYY96WfCNeJyexLfuOeAn1NFyBJqsU7VhFf
|
10
|
-
JBhyHKdMDRY3HkQD6LHVVDidwEOyi+vKb13GlHwproUPutp3qTEG24IhuQGARV+f
|
11
|
-
zSwQ1Ay6L7CmMZmznwPaPBd/zOMbe1RGg5ofCvNAgxspbNGQPJvNp+DxRENdY06N
|
12
|
-
qeO/GQIDAQABo3kwdzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFg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