kf5 0.3.2 → 0.3.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 29dc0e29988f56fa9b40dc51e8c6401d3742bc8e
4
- data.tar.gz: 81c05d4b48dfb389319fc2be05b326878004e9ca
3
+ metadata.gz: 067e0f1ed75a0789fa7b36b14a2ad25b767894fb
4
+ data.tar.gz: ddb5dc544d6a5dfba2903f5dcc8c523bb1f2b31e
5
5
  SHA512:
6
- metadata.gz: 37b2772be1712255bd61b193f33d95c048f308bcc43bb4a64ce0007b312947bce02cffe6ef58c8adca114453dc72b7c1deb44603727adc0dacff67d6ec93f08f
7
- data.tar.gz: b7d2b348205228468bee86c05b7cd0bc7aab4b0c664e70bc98d8b8bcb2222a317444b116d4eee6f4d2b8179c9d516ceb88878bdc4de4f432bcaa50899ce4a0c8
6
+ metadata.gz: fd12d8e5636bdc901f94785f7a90d11c6208a32f4d9c6d16515b847a31547e82d7a7f269aa352d933868165a05518d873f16b3c44ecf937484ca49f4383da359
7
+ data.tar.gz: 7faeaf7f17290d95ad23222238d2afecd27a76641bcb9a024ef2b278ee9d3104dbd26dd3352f293c39e325db0aaee2416cdf7b0198b62e8321071ebd0bd40fc3
@@ -1,3 +1,8 @@
1
+ # v0.3.3 / 2015-11-17
2
+
3
+ * Disable SSO if key is nil.
4
+ * Enhance performance of turbolinks support.
5
+
1
6
  # v0.3.2 / 2015-10-30
2
7
 
3
8
  * Fixed wrong namespace.
data/README.md CHANGED
@@ -13,6 +13,12 @@ Add this line to your application's Gemfile:
13
13
  gem 'kf5'
14
14
  ```
15
15
 
16
+ Make sure you have:
17
+
18
+ ```ruby
19
+ gem 'jquery-rails'
20
+ ```
21
+
16
22
  And then execute:
17
23
 
18
24
  bundle
@@ -24,8 +30,11 @@ Or install it yourself as:
24
30
  For rails, create config `config/initializers/kf5.rb`
25
31
  ```ruby
26
32
  KF5.configure do |config|
33
+ config.domain = "your.domain"
34
+
35
+ # do not set key to disable SSO
27
36
  config.key = "your key of KF5 service"
28
- config.domain = "your domain of KF5 service"
37
+
29
38
  # 1: login for 30 days, 0: login for 30 minutes
30
39
  # config.remember_me = 1
31
40
 
@@ -1,3 +1,5 @@
1
+ //= require kf5.turbolinks
2
+
1
3
  (function(window, config)
2
4
  {
3
5
  "use strict";
@@ -226,10 +228,10 @@
226
228
  var supportbox;
227
229
  function onload()
228
230
  {
229
- // if(supportbox)
230
- // {
231
- // return;
232
- // }
231
+ if(supportbox)
232
+ {
233
+ return;
234
+ }
233
235
 
234
236
  var script = window.document.createElement('script'),
235
237
  configURL = supportboxConfigURL;
@@ -249,7 +251,6 @@
249
251
  });
250
252
  }
251
253
 
252
- document.addEventListener('page:load', onload, false);
253
254
  window.addEventListener('load', onload, false);
254
255
 
255
256
  if(!window.initializeKF5SupportBox)
@@ -0,0 +1,15 @@
1
+ ;(function($, undefined) {
2
+ var widgets = $();
3
+
4
+ $(document).on('page:before-unload', function store() {
5
+ if(!widgets.length) {
6
+ widgets = $('#kf5-support-123456789');
7
+ if(widgets.length) {
8
+ widgets = $([widgets[0], widgets.prev()[0], widgets.prev().prev()[0]]);
9
+ }
10
+ }
11
+ });
12
+ $(document).on('page:load', function (argument) {
13
+ $('body').append(widgets);
14
+ });
15
+ })(jQuery);
@@ -21,7 +21,7 @@ module KF5
21
21
  end
22
22
 
23
23
  def redirect_to_kf5(options = {})
24
- if Helper.indifferent_access(options, :sso) == false
24
+ if Helper.indifferent_access(options, :sso) == false || KF5.configuration.key.nil?
25
25
  redirect_to "https://#{KF5.configuration.domain}.kf5.com/"
26
26
  else
27
27
  redirect_to current_user_kf5_url(options)
@@ -1,3 +1,3 @@
1
1
  module KF5
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kf5
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chen Yi-Cyuan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-10-30 00:00:00.000000000 Z
11
+ date: 2015-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -96,6 +96,7 @@ files:
96
96
  - README.md
97
97
  - Rakefile
98
98
  - app/assets/javascripts/kf5.js
99
+ - app/assets/javascripts/kf5.turbolinks.js
99
100
  - kf5.gemspec
100
101
  - lib/kf5.rb
101
102
  - lib/kf5/configuration.rb
@@ -125,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
126
  version: '0'
126
127
  requirements: []
127
128
  rubyforge_project:
128
- rubygems_version: 2.4.5
129
+ rubygems_version: 2.4.8
129
130
  signing_key:
130
131
  specification_version: 4
131
132
  summary: A simple presenter pattern for ruby. It can work in rails.