wiselinks 0.4.0 → 0.4.1

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.0
1
+ 0.4.1
@@ -19,8 +19,8 @@ class Wiselinks
19
19
  @assets_digest = $("meta[name='assets-digest']").attr("content")
20
20
 
21
21
  if History.emulated.pushState && @options.html4 == true
22
- if window.location.href.indexOf('#!') == -1 && window.location.pathname != '/'
23
- window.location.href = "#{window.location.protocol}//#{window.location.host}/#!#{window.location.pathname}"
22
+ if window.location.href.indexOf('#!') == -1 && @options.html4_root_path != null && window.location.pathname != @options.html4_root_path
23
+ window.location.href = "#{window.location.protocol}//#{window.location.host}#{@options.html4_root_path}#!#{window.location.pathname}"
24
24
 
25
25
  if window.location.hash.indexOf('#!') != -1
26
26
  self._call(window.location.hash.substring(2))
@@ -28,9 +28,7 @@ class Wiselinks
28
28
  History.Adapter.bind(
29
29
  window,
30
30
  "statechange"
31
- (event, data) ->
32
- return false if (!History.ready)
33
-
31
+ (event, data) ->
34
32
  state = History.getState()
35
33
  self._call(state.url, state.data.target, state.data.render)
36
34
  )
@@ -58,16 +56,15 @@ class Wiselinks
58
56
  enabled: ->
59
57
  !History.emulated.pushState || @options.html4 == true
60
58
 
61
- load: (url, target, render = 'template') ->
62
- History.ready = true
59
+ load: (url, target, render = 'template') ->
63
60
  History.pushState({ timestamp: (new Date().getTime()), render: render, target: target }, document.title, url )
64
61
 
65
- reload: () ->
66
- History.ready = true
62
+ reload: () ->
67
63
  History.replaceState({ timestamp: (new Date().getTime()), render: 'template' }, document.title, History.getState().url )
68
64
 
69
65
  _defaults: ->
70
66
  html4: true
67
+ html4_root_path: '/'
71
68
 
72
69
  _call: (url, target, render = 'template') ->
73
70
  self = this
@@ -13,8 +13,8 @@ module Wiselinks
13
13
 
14
14
  def render(options = {}, *args, &block)
15
15
  if self.request.wiselinks?
16
- response.headers['Cache-Control'] = 'no-cache, no-store, max-age=0, must-revalidate'
17
- response.headers['Pragma'] = 'no-cache'
16
+ self.headers['Cache-Control'] = 'no-cache, no-store, max-age=0, must-revalidate'
17
+ self.headers['Pragma'] = 'no-cache'
18
18
 
19
19
  if self.request.wiselinks_partial?
20
20
  Wiselinks.log("processing partial request")
data/wiselinks.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "wiselinks"
8
- s.version = "0.4.0"
8
+ s.version = "0.4.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Igor Alexandrov", "Alexey Solilin", "Julia Egorova"]
12
- s.date = "2013-01-25"
12
+ s.date = "2013-01-27"
13
13
  s.email = "igor.alexandrov@gmail.com"
14
14
  s.extra_rdoc_files = [
15
15
  "LICENSE",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wiselinks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-01-25 00:00:00.000000000 Z
14
+ date: 2013-01-27 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: shoulda
@@ -186,7 +186,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
186
186
  version: '0'
187
187
  segments:
188
188
  - 0
189
- hash: 2445381620792209055
189
+ hash: 4302143187740040934
190
190
  required_rubygems_version: !ruby/object:Gem::Requirement
191
191
  none: false
192
192
  requirements: