pinkman 0.9.9.7 → 0.9.9.8
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ec8ab661ccda4c67faf843cba2a7d97fb0661b7
|
4
|
+
data.tar.gz: 53eaa3fe6eb113fbefc4a0d574e87d2c45b6a3a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 955019c32e6475e3d331fea4e9ac04a95688eafb3c345c5c527e1ac6b2dbbe92bea7c1f38163394947517694e87b2ad8f0aa880252a9f0ea203d3211dbed9191
|
7
|
+
data.tar.gz: 290826d5bb0b5a2f3737b71207ccb3843acb59f27f1674d28c85c4a75a20bc70e1f7c1d2d186f2caeea4a2d0dad39c08c155b16651a3d3f72428591c8b18d985
|
@@ -0,0 +1,4 @@
|
|
1
|
+
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
2
|
+
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
3
|
+
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
4
|
+
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
@@ -150,13 +150,34 @@ class window.PinkmanRouter
|
|
150
150
|
# console.log o.position
|
151
151
|
o.position = 0 unless o.position?
|
152
152
|
window.scrollTo(0,o.position)
|
153
|
+
|
154
|
+
@analytics:
|
155
|
+
create: (id) ->
|
156
|
+
console.log 'chamou'
|
157
|
+
console.log id
|
158
|
+
ga('create', id, 'auto');
|
159
|
+
ga('send', 'pageview');
|
160
|
+
|
161
|
+
send: (route,path) ->
|
162
|
+
unless @created? and @created
|
163
|
+
console.log this
|
164
|
+
@create(Pinkman.router._config.analytics)
|
165
|
+
@created = true
|
166
|
+
else
|
167
|
+
host = new RegExp(window.location.origin)
|
168
|
+
path = if host.test(path) then path.replace(host,'') else path
|
169
|
+
ga('set', 'page', path)
|
170
|
+
ga('send', 'pageview', path)
|
153
171
|
|
172
|
+
|
173
|
+
|
154
174
|
@render: (r, callback) ->
|
155
175
|
@saveWindowScroll(Pinkman.routes.current.controller) if Pinkman.routes.current?
|
156
176
|
Pinkman.state.initialize()
|
157
177
|
yieldIn = r.route.yieldIn() || @_config.yield
|
158
178
|
$(yieldIn).html("<div class='pink-yield' id='#{r.controller}'></div>") if r.route.blank
|
159
179
|
r.initialize (args...) =>
|
180
|
+
@analytics.send(args...) if @_config.analytics?
|
160
181
|
callback() if typeof callback == 'function'
|
161
182
|
@_config.callback(args...) if typeof @_config.callback == 'function'
|
162
183
|
Pinkman.routes.set('current',r.route)
|
data/lib/pinkman/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pinkman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.9.
|
4
|
+
version: 0.9.9.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Agilso Oliveira
|
@@ -188,6 +188,7 @@ files:
|
|
188
188
|
- app/assets/javascripts/pinkman_base/controller.coffee
|
189
189
|
- app/assets/javascripts/pinkman_base/css_and_config.coffee
|
190
190
|
- app/assets/javascripts/pinkman_base/glue.coffee
|
191
|
+
- app/assets/javascripts/pinkman_base/google_analytics.js
|
191
192
|
- app/assets/javascripts/pinkman_base/mixins.coffee
|
192
193
|
- app/assets/javascripts/pinkman_base/object.coffee.erb
|
193
194
|
- app/assets/javascripts/pinkman_base/pinkman.coffee
|