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 +4 -4
- data/README.md +0 -13
- data/lib/assets/javascripts/turbograft/turbolinks.coffee +2 -1
- data/lib/turbograft/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 908ca189eb5f9c51f6e061d844528bde62953db6
|
4
|
+
data.tar.gz: 2b6f48a3f32d885e7d23ce33cd1f5fbdb2d2a6a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/turbograft/version.rb
CHANGED
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.
|
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-
|
16
|
+
date: 2016-09-06 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: coffee-rails
|