turbograft 0.4.0 → 0.4.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: 67edae73737f3b56016f637e17650cb6f2687fb9
4
- data.tar.gz: 39ca6585568e5854ea8b2a1b043d0f5989d4384d
3
+ metadata.gz: 908ca189eb5f9c51f6e061d844528bde62953db6
4
+ data.tar.gz: 2b6f48a3f32d885e7d23ce33cd1f5fbdb2d2a6a2
5
5
  SHA512:
6
- metadata.gz: 0bb4419a7514de8a92d9312b3a2389372752069ef8f214bf6ee31660aa3b084b459206cedb83a83528bdc11bf7f784b24dfb9ab7b978e3f8b4bd41e8f585a2af
7
- data.tar.gz: 1f8b7574f1a0815f6aafd6d948219339fe033b7c89a6ae246cd19b92afba557c1f5dc805b567b2493438e1533367122020f2c0b4b91410d28b1c0fdc9fa07f9d
6
+ metadata.gz: 5bc193a959af440b4af8312deea19d8356ac11a640d2d8189e7f9cb6fe10debb5f245033f6eff715287b85f4d665ea989eb6118e583e91e6111052ac3b03ba28
7
+ data.tar.gz: 922997e629e3d77b3c6a2024273524149d8d5fceedb3d01d6c00d559eda8e8cf6ac3adacaa8bb49ac6b03180676d6a65650d5ceba61abf1ad4dd5761342678f7
data/README.md CHANGED
@@ -78,19 +78,6 @@ The `data-tg-refresh-never` attribute will cause a node only appear once in the
78
78
  ### updatePushState
79
79
  Defaults to `true`. When set to false it prevents `Page.refresh()` from updating the url in the browser.
80
80
 
81
- ## Head Asset Tracking
82
- The Turbohead module allows you to track css and javascript assets in the head of the document and change them intelligently. This can be useful in large applications which want to lighten their
83
- asset weight by splitting their script and style bundles by area.
84
-
85
- ### Link Tracking
86
- When navigating, Turbograft will perform a full diff of `<link>` tags with `data-turbolinks-track` between the upstream and currently active `<head>`. It will attempt to perform the minimum number of DOM manipulations
87
- to move from the current set to the upstream one. `<link>` tags will always be removed if they are not present in the upstream document, and order will be maintained.
88
-
89
- ### Script Tracking
90
- When a `<script>` tag with `data-turbolinks-track` and a unique `src` is encountered in a response document Turbograft will insert it into the active DOM and force it to execute. Unlike links, scripts from previous pages are *not* removed once added.
91
-
92
- If marked with a `data-turbolinks-track-as` attribute, scripts will additionally have their `track-as` values compared. If a script with a different `src` but the same `data-turbolinks-track-as` value is found upstream, turbograft will force a full page refresh. This prevents potential multiple executions of a script bundle when a new version of your app is shipped.
93
-
94
81
  ## data-tg-remote
95
82
 
96
83
  The `data-tg-remote` option allows you to query methods on or submit forms to different endpoints, and gives partial page replacement on specified refresh keys depending on the response status.
@@ -131,13 +131,14 @@ class window.Turbolinks
131
131
  triggerEvent 'page:receive'
132
132
  options.updatePushState ?= true
133
133
  if upstreamDocument = processResponse(xhr)
134
- reflectNewUrl url if options.updatePushState
135
134
  if options.partialReplace
135
+ reflectNewUrl url if options.updatePushState
136
136
  updateBody(upstreamDocument, xhr, options)
137
137
  else
138
138
  turbohead = new TurboHead(document, upstreamDocument)
139
139
  if turbohead.hasAssetConflicts()
140
140
  return Turbolinks.fullPageNavigate(url.absolute)
141
+ reflectNewUrl url if options.updatePushState
141
142
  turbohead.insertNewAssets(-> updateBody(upstreamDocument, xhr, options))
142
143
  else
143
144
  triggerEvent 'page:error', xhr
@@ -1,3 +1,3 @@
1
1
  module TurboGraft
2
- VERSION = '0.4.0'
2
+ VERSION = '0.4.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turbograft
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kristian Plettenberg-Dussault
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2016-09-02 00:00:00.000000000 Z
16
+ date: 2016-09-06 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: coffee-rails