flammarion_rails 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a55e88a87d1b7bdc4049bea5528a942d810abf3e
4
- data.tar.gz: 8dd1cfb136a953685dc13b259e25a1ac149c153c
3
+ metadata.gz: 533ef538f980cf22d44c98c61bd2bf56102f3fd9
4
+ data.tar.gz: d9c0c69d88f1345265a743e9e77c7ea824e5cd37
5
5
  SHA512:
6
- metadata.gz: c5b984e9ad01608614cae0833727c06978a39cc060224c316472b21ee48354ac758f5f9e39de468cadb1fc95fa877437d834ed254cf9c735b664628332c6d36b
7
- data.tar.gz: f9a1f9d770d83bbfa7cdb6fc4fa5a9714fea1b4ec638e9e7cd1b8119d023c4d3679df8aed01b013e3c0a7748848f23a88f37103b01e404fb37746557288b8cf6
6
+ metadata.gz: 39f3d6135d5c3e641b7b6f22d7a97324259f34e3493c0bbaa50f4093264e9e418aafdaa54bc740a39b36f8dc85988b126cc598edd50222ee3a55bb89b19771d7
7
+ data.tar.gz: 8300f6a42c09ccb9534cc40676de7e7a504668a5ed76827049dffb5a3486589cab36120202474418997a532b039908f5941240f48d677c6bf889018d688a47ff
@@ -7,6 +7,25 @@ history.pushState(null, null, document.URL)
7
7
  window.addEventListener 'popstate', ->
8
8
  history.pushState(null, null, document.URL)
9
9
 
10
+ # Page
11
+ ########################################
12
+ # Note: allow to skip css reloading which causes unstyled page sudden burst
13
+
14
+ extract_first_tag = (html, tag) ->
15
+ start_match = ///<#{tag}.*>///.exec(html)
16
+ end_match = html.indexOf("</#{tag}>")
17
+ html.substring(start_match.index + start_match[0].length, end_match)
18
+
19
+ ws.onmessage_actions.page = (event) ->
20
+ head = extract_first_tag(ws_data.body, 'head')
21
+ head = head.replace(/\s\/>/g, ">").replace(/'/g, '"')
22
+ body = extract_first_tag(ws_data.body, 'body')
23
+ unless head == document.head.innerHTML
24
+ $('head').html(head)
25
+ $('body').html(body)
26
+ $(window).scrollTop(0)
27
+ $.ready()
28
+
10
29
  # NProgress
11
30
  ########################################
12
31
 
@@ -1,3 +1,3 @@
1
1
  module FlammarionRails
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flammarion_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrice Lebel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-02 00:00:00.000000000 Z
11
+ date: 2017-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails