eyeballs 0.5.9 → 0.5.10

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,6 +1,11 @@
1
+ Thu Sep 30
2
+ - - - - - -
3
+ - Misc bugfixes
4
+ - Add support for query string style params
5
+
1
6
  Sun Aug 8
2
7
  - - - - -
3
- - Remove 'previx', 'url' is better ...
8
+ - Remove 'prefix', 'url' is better ...
4
9
 
5
10
  Fri Aug 6
6
11
  - - - - -
data/Rakefile CHANGED
@@ -27,7 +27,7 @@ begin
27
27
  require 'jeweler'
28
28
  Jeweler::Tasks.new do |s|
29
29
  s.name = "eyeballs"
30
- s.version = "0.5.9"
30
+ s.version = "0.5.10"
31
31
  s.author = "Paul Campbell"
32
32
  s.email = "paul@rslw.com"
33
33
  s.homepage = "http://www.github.com/paulca/eyeballs.js"
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{eyeballs}
8
- s.version = "0.5.9"
8
+ s.version = "0.5.10"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Paul Campbell"]
12
- s.date = %q{2010-09-25}
12
+ s.date = %q{2010-09-30}
13
13
  s.default_executable = %q{eyeballs}
14
14
  s.email = %q{paul@rslw.com}
15
15
  s.executables = ["eyeballs"]
@@ -58,7 +58,6 @@ o_O.routes = {
58
58
 
59
59
  draw: function(callback){
60
60
  $(function(){
61
-
62
61
  callback(o_O.routes.router());
63
62
  if(location.hash.o_O_trim() == '')
64
63
  {
@@ -70,7 +69,17 @@ o_O.routes = {
70
69
  }
71
70
 
72
71
  var route_on_hash = function(){
73
- var hash = location.hash.replace(/^(#)/, '').o_O_trim('/');
72
+ var parts = location.hash.split('?')
73
+ var hash = parts[0].replace(/^(#)/, '').o_O_trim('/');
74
+ var query_string_parts;
75
+ if(typeof parts[1] === 'string')
76
+ {
77
+ query_string_parts = parts[1].replace('&', '&').split('&');
78
+ }
79
+ else
80
+ {
81
+ query_string_parts = '';
82
+ }
74
83
  if(o_O.routes.urls.indexOf(hash) >= 0)
75
84
  {
76
85
  o_O.routes.rules[hash].action(o_O.routes.rules[hash].with_args);
@@ -88,6 +97,15 @@ o_O.routes = {
88
97
  {
89
98
  params[rule.matchers[j].replace(/^:/, '')] = match[j+1];
90
99
  }
100
+
101
+ if(query_string_parts.length > 0)
102
+ {
103
+ for(k = 0; k < query_string_parts.length; k++)
104
+ {
105
+ var param_parts = query_string_parts[k].split('=')
106
+ params[param_parts[0]] = param_parts[1];
107
+ }
108
+ }
91
109
  if(attr)
92
110
  {
93
111
  return params[attr];
@@ -40,7 +40,7 @@ o_O.render = function(template, data, options){
40
40
  }
41
41
  if(options.html)
42
42
  {
43
- $(options.html).replaceWith(rendered);
43
+ $(options.html).html(rendered);
44
44
  }
45
45
  }
46
46
  });
@@ -47,7 +47,7 @@
47
47
  return 'awesome!'
48
48
  },
49
49
  sending_params: function(params){
50
- $('div#with_params').html(params('test'));
50
+ $('div#with_params').html(params('test') + params('other_test'));
51
51
  }
52
52
  });
53
53
 
@@ -117,7 +117,7 @@
117
117
  asyncTest('withparams',function(){
118
118
  $('a#with-params').trigger('click');
119
119
  setTimeout(function(){
120
- equals($('div#with_params').html(), 'something', "should pass the params");
120
+ equals($('div#with_params').html(), 'somethingelse', "should pass the params");
121
121
  start();
122
122
  },100)
123
123
  })
@@ -168,7 +168,7 @@
168
168
  <a id="index-link" data-ajax-history="true" href="/reviews/index">Hello!</a>
169
169
  <a id="namespaced-index-link" data-ajax-history="true" href="/my/action">Hello!</a>
170
170
 
171
- <a id="with-params" data-ajax-history="true" href="/reviews/something">Hello!</a>
171
+ <a id="with-params" data-ajax-history="true" href="/reviews/something?other_test=else">Hello!</a>
172
172
 
173
173
  <div id="index">
174
174
  </div>
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eyeballs
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 9
10
- version: 0.5.9
9
+ - 10
10
+ version: 0.5.10
11
11
  platform: ruby
12
12
  authors:
13
13
  - Paul Campbell
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-25 00:00:00 +02:00
18
+ date: 2010-09-30 00:00:00 +01:00
19
19
  default_executable: eyeballs
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency