bhf 0.9.0 → 0.9.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: 9a150d40a54e77d010bc76b4a3666557abb43bdf
4
- data.tar.gz: 759e4befe47a872927043a511fb73cd2bd8464fa
3
+ metadata.gz: dae4152f9ff30476941024292a0b3c14084e75f0
4
+ data.tar.gz: 7a0608945e50916118d4fa32648c55b311fa0226
5
5
  SHA512:
6
- metadata.gz: ae700d5c4b7332dec3dd870e859f99fc1df6bcbf254863a1b5bbb74dd0e49746f36067453baf362e85225d84bcb097ec5b5b2ea4bcd0cb63ccb89c48240f3378
7
- data.tar.gz: c7205812e3cecb943a26add9c945c87cb5202d542f4bc5da7c756e766d8ff5bacb0c09971ebc26cb89a6e8234a2e000eab5b7f1fec5ed415d39f4baae19ea7a5
6
+ metadata.gz: 7018abe3d2bd151236bd0bbbfc78e4f4fd8aedd717340f36498d1088b4015f5644a5fb7193a4c6509b92499427d6434f063e2924e402efa2473d18b8880b923d
7
+ data.tar.gz: 225e770798d889438e68a884a590c8f75eec8a021c5dfb7dbfc62ea6dc0386b9a04fee7653ec4fbca36a79a8143230abaf0e94c261053d8b51c5af7aba1eff1e
data/Gemfile CHANGED
@@ -2,7 +2,7 @@ source 'http://rubygems.org'
2
2
 
3
3
  gem 'rails', '~> 4'
4
4
  gem 'turbolinks', '~> 2.1'
5
- gem 'kaminari', '~> 0.15'
5
+ gem 'kaminari', '~> 0.16'
6
6
  gem 'haml-rails', '~> 0.4'
7
7
  gem 'sass-rails', '~> 4.0'
8
8
 
data/Gemfile.lock CHANGED
@@ -1,27 +1,27 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- actionmailer (4.1.1)
5
- actionpack (= 4.1.1)
6
- actionview (= 4.1.1)
4
+ actionmailer (4.1.4)
5
+ actionpack (= 4.1.4)
6
+ actionview (= 4.1.4)
7
7
  mail (~> 2.5.4)
8
- actionpack (4.1.1)
9
- actionview (= 4.1.1)
10
- activesupport (= 4.1.1)
8
+ actionpack (4.1.4)
9
+ actionview (= 4.1.4)
10
+ activesupport (= 4.1.4)
11
11
  rack (~> 1.5.2)
12
12
  rack-test (~> 0.6.2)
13
- actionview (4.1.1)
14
- activesupport (= 4.1.1)
13
+ actionview (4.1.4)
14
+ activesupport (= 4.1.4)
15
15
  builder (~> 3.1)
16
16
  erubis (~> 2.7.0)
17
- activemodel (4.1.1)
18
- activesupport (= 4.1.1)
17
+ activemodel (4.1.4)
18
+ activesupport (= 4.1.4)
19
19
  builder (~> 3.1)
20
- activerecord (4.1.1)
21
- activemodel (= 4.1.1)
22
- activesupport (= 4.1.1)
20
+ activerecord (4.1.4)
21
+ activemodel (= 4.1.4)
22
+ activesupport (= 4.1.4)
23
23
  arel (~> 5.0.0)
24
- activesupport (4.1.1)
24
+ activesupport (4.1.4)
25
25
  i18n (~> 0.6, >= 0.6.9)
26
26
  json (~> 1.7, >= 1.7.7)
27
27
  minitest (~> 5.1)
@@ -39,9 +39,9 @@ GEM
39
39
  coffee-script-source (1.7.0)
40
40
  descendants_tracker (0.0.4)
41
41
  thread_safe (~> 0.3, >= 0.3.1)
42
- docile (1.1.3)
42
+ docile (1.1.4)
43
43
  erubis (2.7.0)
44
- execjs (2.2.0)
44
+ execjs (2.2.1)
45
45
  faraday (0.9.0)
46
46
  multipart-post (>= 1.2, < 3)
47
47
  git (1.2.7)
@@ -60,7 +60,7 @@ GEM
60
60
  activesupport (>= 4.0.1)
61
61
  haml (>= 3.1, < 5.0)
62
62
  railties (>= 4.0.1)
63
- hashie (3.0.0)
63
+ hashie (3.1.0)
64
64
  highline (1.6.21)
65
65
  hike (1.2.3)
66
66
  i18n (0.6.9)
@@ -75,7 +75,7 @@ GEM
75
75
  rdoc
76
76
  json (1.8.1)
77
77
  jwt (1.0.0)
78
- kaminari (0.15.1)
78
+ kaminari (0.16.1)
79
79
  actionpack (>= 3.0.0)
80
80
  activesupport (>= 3.0.0)
81
81
  mail (2.5.4)
@@ -83,7 +83,7 @@ GEM
83
83
  treetop (~> 1.4.8)
84
84
  mime-types (1.25.1)
85
85
  mini_portile (0.6.0)
86
- minitest (5.3.4)
86
+ minitest (5.4.0)
87
87
  multi_json (1.10.1)
88
88
  multi_xml (0.5.5)
89
89
  multipart-post (2.0.0)
@@ -99,19 +99,19 @@ GEM
99
99
  rack (1.5.2)
100
100
  rack-test (0.6.2)
101
101
  rack (>= 1.0)
102
- rails (4.1.1)
103
- actionmailer (= 4.1.1)
104
- actionpack (= 4.1.1)
105
- actionview (= 4.1.1)
106
- activemodel (= 4.1.1)
107
- activerecord (= 4.1.1)
108
- activesupport (= 4.1.1)
102
+ rails (4.1.4)
103
+ actionmailer (= 4.1.4)
104
+ actionpack (= 4.1.4)
105
+ actionview (= 4.1.4)
106
+ activemodel (= 4.1.4)
107
+ activerecord (= 4.1.4)
108
+ activesupport (= 4.1.4)
109
109
  bundler (>= 1.3.0, < 2.0)
110
- railties (= 4.1.1)
110
+ railties (= 4.1.4)
111
111
  sprockets-rails (~> 2.0)
112
- railties (4.1.1)
113
- actionpack (= 4.1.1)
114
- activesupport (= 4.1.1)
112
+ railties (4.1.4)
113
+ actionpack (= 4.1.4)
114
+ activesupport (= 4.1.4)
115
115
  rake (>= 0.8.7)
116
116
  thor (>= 0.18.1, < 2.0)
117
117
  rake (10.3.2)
@@ -161,7 +161,7 @@ DEPENDENCIES
161
161
  bundler (~> 1.0)
162
162
  haml-rails (~> 0.4)
163
163
  jeweler (~> 2.0)
164
- kaminari (~> 0.15)
164
+ kaminari (~> 0.16)
165
165
  rails (~> 4)
166
166
  rdoc (~> 3.12)
167
167
  sass-rails (~> 4.0)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.0
1
+ 0.9.1
@@ -31,15 +31,14 @@ Turbolinks.pagesCached(0);
31
31
  var linkElem = this.linkElem;
32
32
  var rowElem = this.linkElem.getParent('tr');
33
33
  if (rowElem) {
34
- linkElem = rowElem;
34
+ rowElem.addClass('animate');
35
+ setTimeout(function(){
36
+ rowElem.removeClass('animate');
37
+ }, 600);
35
38
  }
36
- linkElem.addClass('animate');
37
39
  setTimeout(function(){
38
40
  linkElem.removeClass('live_edit');
39
41
  });
40
- setTimeout(function(){
41
- linkElem.removeClass('animate');
42
- }, 600);
43
42
  }
44
43
  }
45
44
  });
@@ -243,7 +242,6 @@ Turbolinks.pagesCached(0);
243
242
  },
244
243
  onSearchSuccess: function(request){
245
244
  window.fireEvent('platformUpdate', [p.getParent()]);
246
- // TODO: remove the mootools hack for request.url don't
247
245
  window.history.pushState({ turbolinks: true, url: request.url }, '', request.url);
248
246
  }
249
247
  });
@@ -23,7 +23,7 @@ var PlatformHelper = new Class({
23
23
  if (hidden_search) {
24
24
  hidden_search.destroy();
25
25
  }
26
- var request = new Request.HTML({
26
+ var request = new Request.bhf({
27
27
  method: 'get',
28
28
  url: e.target.get('action'),
29
29
  onFailure: function(){
@@ -0,0 +1,80 @@
1
+ Request.bhf = new Class({
2
+ Extends: Request.HTML,
3
+
4
+ send: function(options){
5
+ var progressSupport = ('onprogress' in new Browser.Request);
6
+
7
+ if (!this.check(options)) return this;
8
+
9
+ this.options.isSuccess = this.options.isSuccess || this.isSuccess;
10
+ this.running = true;
11
+
12
+ var type = typeOf(options);
13
+ if (type == 'string' || type == 'element') options = {data: options};
14
+
15
+ var old = this.options;
16
+ options = Object.append({data: old.data, url: old.url, method: old.method}, options);
17
+ var data = options.data, url = String(options.url), method = options.method.toLowerCase();
18
+
19
+ switch (typeOf(data)){
20
+ case 'element': data = document.id(data).toQueryString(); break;
21
+ case 'object': case 'hash': data = Object.toQueryString(data);
22
+ }
23
+
24
+ if (this.options.format){
25
+ var format = 'format=' + this.options.format;
26
+ data = (data) ? format + '&' + data : format;
27
+ }
28
+
29
+ if (this.options.emulation && !['get', 'post'].contains(method)){
30
+ var _method = '_method=' + method;
31
+ data = (data) ? _method + '&' + data : _method;
32
+ method = 'post';
33
+ }
34
+
35
+ if (this.options.urlEncoded && ['post', 'put'].contains(method)){
36
+ var encoding = (this.options.encoding) ? '; charset=' + this.options.encoding : '';
37
+ this.headers['Content-type'] = 'application/x-www-form-urlencoded' + encoding;
38
+ }
39
+
40
+ if (!url) url = document.location.pathname;
41
+
42
+ var trimPosition = url.lastIndexOf('/');
43
+ if (trimPosition > -1 && (trimPosition = url.indexOf('#')) > -1) url = url.substr(0, trimPosition);
44
+
45
+ if (this.options.noCache)
46
+ url += (url.indexOf('?') > -1 ? '&' : '?') + String.uniqueID();
47
+
48
+ if (data && (method == 'get' || method == 'delete')){
49
+ url += (url.indexOf('?') > -1 ? '&' : '?') + data;
50
+ data = null;
51
+ }
52
+
53
+ var xhr = this.xhr;
54
+ if (progressSupport){
55
+ xhr.onloadstart = this.loadstart.bind(this);
56
+ xhr.onprogress = this.progress.bind(this);
57
+ }
58
+
59
+ xhr.open(method.toUpperCase(), url, this.options.async, this.options.user, this.options.password);
60
+ if (this.options.user && 'withCredentials' in xhr) xhr.withCredentials = true;
61
+
62
+ xhr.onreadystatechange = this.onStateChange.bind(this);
63
+
64
+ Object.each(this.headers, function(value, key){
65
+ try {
66
+ xhr.setRequestHeader(key, value);
67
+ } catch (e){
68
+ this.fireEvent('exception', [key, value]);
69
+ }
70
+ }, this);
71
+
72
+ this.fireEvent('request');
73
+ this.url = url;
74
+ xhr.send(data);
75
+ if (!this.options.async) this.onStateChange();
76
+ else if (this.options.timeout) this.timer = this.timeout.delay(this.options.timeout, this);
77
+ return this;
78
+ }
79
+ });
80
+
@@ -6029,7 +6029,6 @@ var Request = this.Request = new Class({
6029
6029
  }, this);
6030
6030
 
6031
6031
  this.fireEvent('request');
6032
- this.url = url;
6033
6032
  xhr.send(data);
6034
6033
  if (!this.options.async) this.onStateChange();
6035
6034
  else if (this.options.timeout) this.timer = this.timeout.delay(this.options.timeout, this);
@@ -1,3 +1,4 @@
1
+ - cached_partials = {}
1
2
  - platform.pagination.template = self
2
3
  - referral_id = nil
3
4
  - if flash[:referral_entry] && referral_entry = flash[:referral_entry].clone.symbolize_keys
@@ -50,8 +51,10 @@
50
51
  - if column.display_type == :string
51
52
  - column_value
52
53
  - else
53
- - # Haml::Engine.new(File.read(File.expand_path File.dirname(__FILE__)+"/../table/#{column.macro}/_#{column.display_type}.haml")).render(OpenStruct.new({column_value: column_value, object: object}))
54
- - render(partial: "bhf/table/#{column.macro}/#{column.display_type}", locals: {column_value: column_value, object: object})
54
+ - partial_name = "#{column.macro}/#{column.display_type}"
55
+ - cached_partials[partial_name] ||= lookup_context.find_template(partial_name, ['bhf/table'], true, [:column_value, :object])
56
+ - cached_partials[partial_name].render(self, {column_value: column_value, object: object})
57
+ -# render(partial: "bhf/table/#{column.macro}/#{column.display_type}", locals: {column_value: column_value, object: object})
55
58
  = link_to value, (platform.custom_link ? custom_link : edit_link), class: ('quick_edit' if !platform.custom_link && platform.table_quick_edit)
56
59
 
57
60
  %td.action{class: ('wider' if platform.show_duplicate && !platform.hide_edit && !platform.hide_delete)}
@@ -68,7 +71,6 @@
68
71
  - unless platform.hide_create
69
72
  = link_to new_t(platform), new_entry_path(platform.name)
70
73
 
71
-
72
74
  %template.quick_edit_template{type: 'text/template'}
73
75
  %tr.quick_edit_entry{id: "{object_id}_#{platform.name}"}
74
76
  - edit_link = edit_entry_path(platform.name, '{object_id}')
data/bhf.gemspec CHANGED
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: bhf 0.9.0 ruby lib
5
+ # stub: bhf 0.9.1 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "bhf"
9
- s.version = "0.9.0"
9
+ s.version = "0.9.1"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Anton Pawlik"]
14
- s.date = "2014-07-07"
14
+ s.date = "2014-07-09"
15
15
  s.description = "Gets you there on time"
16
16
  s.email = "anton.pawlik@gmail.com"
17
17
  s.extra_rdoc_files = [
@@ -48,6 +48,7 @@ Gem::Specification.new do |s|
48
48
  "app/assets/javascripts/bhf/classes/PlatformHelper.js",
49
49
  "app/assets/javascripts/bhf/classes/QuickEdit.js",
50
50
  "app/assets/javascripts/bhf/classes/QuickEditStack.js",
51
+ "app/assets/javascripts/bhf/classes/Request_bhf.js",
51
52
  "app/assets/javascripts/bhf/classes/Setlatlng.js",
52
53
  "app/assets/javascripts/bhf/classes/showdown.js",
53
54
  "app/assets/javascripts/bhf/classes/wmd.js",
@@ -165,7 +166,7 @@ Gem::Specification.new do |s|
165
166
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
166
167
  s.add_runtime_dependency(%q<rails>, ["~> 4"])
167
168
  s.add_runtime_dependency(%q<turbolinks>, ["~> 2.1"])
168
- s.add_runtime_dependency(%q<kaminari>, ["~> 0.15"])
169
+ s.add_runtime_dependency(%q<kaminari>, ["~> 0.16"])
169
170
  s.add_runtime_dependency(%q<haml-rails>, ["~> 0.4"])
170
171
  s.add_runtime_dependency(%q<sass-rails>, ["~> 4.0"])
171
172
  s.add_development_dependency(%q<shoulda>, ["~> 3.5"])
@@ -176,7 +177,7 @@ Gem::Specification.new do |s|
176
177
  else
177
178
  s.add_dependency(%q<rails>, ["~> 4"])
178
179
  s.add_dependency(%q<turbolinks>, ["~> 2.1"])
179
- s.add_dependency(%q<kaminari>, ["~> 0.15"])
180
+ s.add_dependency(%q<kaminari>, ["~> 0.16"])
180
181
  s.add_dependency(%q<haml-rails>, ["~> 0.4"])
181
182
  s.add_dependency(%q<sass-rails>, ["~> 4.0"])
182
183
  s.add_dependency(%q<shoulda>, ["~> 3.5"])
@@ -188,7 +189,7 @@ Gem::Specification.new do |s|
188
189
  else
189
190
  s.add_dependency(%q<rails>, ["~> 4"])
190
191
  s.add_dependency(%q<turbolinks>, ["~> 2.1"])
191
- s.add_dependency(%q<kaminari>, ["~> 0.15"])
192
+ s.add_dependency(%q<kaminari>, ["~> 0.16"])
192
193
  s.add_dependency(%q<haml-rails>, ["~> 0.4"])
193
194
  s.add_dependency(%q<sass-rails>, ["~> 4.0"])
194
195
  s.add_dependency(%q<shoulda>, ["~> 3.5"])
@@ -8,7 +8,6 @@ de:
8
8
  form:
9
9
  file_field:
10
10
  select: Datei wählen
11
- form:
12
11
  buttons:
13
12
  save: '%{platform_title} speichern'
14
13
  and_edit: und editieren
@@ -24,7 +24,7 @@ module Bhf::ActiveRecord
24
24
 
25
25
  module ClassMethods
26
26
  def bhf_default_search(search_params)
27
- return self if (search_term = search_params[:text]).blank?
27
+ return self if (search_term = search_params['text']).blank?
28
28
  where_statement = []
29
29
  columns_hash.each_pair do |name, props|
30
30
  is_number = search_term.to_i.to_s == search_term || search_term.to_f.to_s == search_term
@@ -90,7 +90,7 @@ module Bhf::Mongoid
90
90
  end
91
91
 
92
92
  def bhf_default_search(search_params)
93
- return self if (search_term = search_params[:text]).blank?
93
+ return self if (search_term = search_params['text']).blank?
94
94
 
95
95
  arr = []
96
96
  columns_hash.each_pair do |column, props|
@@ -34,7 +34,7 @@ module Bhf::Platform
34
34
  chain = chain.send data_source if data_source
35
35
  end
36
36
 
37
- unless options[:order].blank?
37
+ if options[:order].present? and options[:direction].present?
38
38
  chain = chain.reorder("#{options[:order]} #{options[:direction]}")
39
39
  end
40
40
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bhf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Pawlik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-07 00:00:00.000000000 Z
11
+ date: 2014-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0.15'
47
+ version: '0.16'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0.15'
54
+ version: '0.16'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: haml-rails
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -187,6 +187,7 @@ files:
187
187
  - app/assets/javascripts/bhf/classes/PlatformHelper.js
188
188
  - app/assets/javascripts/bhf/classes/QuickEdit.js
189
189
  - app/assets/javascripts/bhf/classes/QuickEditStack.js
190
+ - app/assets/javascripts/bhf/classes/Request_bhf.js
190
191
  - app/assets/javascripts/bhf/classes/Setlatlng.js
191
192
  - app/assets/javascripts/bhf/classes/showdown.js
192
193
  - app/assets/javascripts/bhf/classes/wmd.js