modeljs 0.0.6 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,6 +4,7 @@ Author: William Barry (william@nine.is)
4
4
  Description: Abstract form class to encapsulate add and edit forms for models.
5
5
  */
6
6
 
7
+
7
8
  Model.Form = Class.extend({
8
9
 
9
10
  class_name: 'Model.Form',
@@ -82,15 +83,20 @@ Model.Form = Class.extend({
82
83
  var div = $('<div/>')
83
84
  .append($('<table/>').append(tbody))
84
85
  .append($('<div/>').attr('id', this.message));
85
- var p = $('<p/>')
86
- var back = $('<input/>')
87
- .attr('type', 'button')
88
- .val('Back')
89
- .click(m.back_button_click ? m.back_button_click : function() { window.location = Model.parse_url(m.listing_url).url; });
90
- p.append(back).append(' ');
91
- if (m.show_delete_button)
92
- p.append($('<input/>').attr('type', 'button').val('Delete ' + m.name).click(function() { m.ajax_delete(); }));
93
- div.append(p);
86
+ if (m.show_back_button || m.show_delete_button)
87
+ {
88
+ var p = $('<p/>')
89
+ if (m.show_back_button)
90
+ {
91
+ if (!m.back_button_click)
92
+ m.back_button_click = function() { window.location = Model.parse_url(m.listing_url).url; };
93
+ p.append($('<input/>').attr('type', 'button').val('Back').click(m.back_button_click));
94
+ p.append(' ');
95
+ }
96
+ if (m.show_delete_button)
97
+ p.append($('<input/>').attr('type', 'button').val('Delete ' + m.name).click(function() { m.ajax_delete(); }));
98
+ div.append(p);
99
+ }
94
100
  return div;
95
101
  },
96
102
 
@@ -70,6 +70,7 @@ Model.prototype = {
70
70
  form: 'Model.Form', // Name of the class that generates add/edit forms for the model
71
71
  back_button_click: false, // Click handler for the back button
72
72
  show_delete_button: true, // Whether or not we should show the delete button on the main model
73
+ show_back_button: true, // Whether or not we should show the back button on the main model
73
74
 
74
75
  // Urls of CRUD events
75
76
  create_url: false,
@@ -1,3 +1,3 @@
1
1
  module Modeljs
2
- VERSION = '0.0.6'
2
+ VERSION = '0.0.8'
3
3
  end
metadata CHANGED
@@ -1,71 +1,70 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: modeljs
3
- version: !ruby/object:Gem::Version
4
- version: 0.0.6
5
- prerelease:
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 8
9
+ version: 0.0.8
6
10
  platform: ruby
7
- authors:
11
+ authors:
8
12
  - William Barry
9
13
  autorequire:
10
14
  bindir: bin
11
15
  cert_chain: []
12
- date: 2013-06-17 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
16
+
17
+ date: 2013-06-19 00:00:00 -05:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
15
21
  name: rails
16
- requirement: !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ~>
20
- - !ruby/object:Gem::Version
21
- version: 3.2.13
22
- type: :runtime
23
22
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
27
25
  - - ~>
28
- - !ruby/object:Gem::Version
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 3
29
+ - 2
30
+ - 13
29
31
  version: 3.2.13
30
- - !ruby/object:Gem::Dependency
31
- name: jquery-rails
32
- requirement: !ruby/object:Gem::Requirement
33
- none: false
34
- requirements:
35
- - - ! '>='
36
- - !ruby/object:Gem::Version
37
- version: '0'
38
32
  type: :runtime
33
+ version_requirements: *id001
34
+ - !ruby/object:Gem::Dependency
35
+ name: jquery-rails
39
36
  prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ! '>='
44
- - !ruby/object:Gem::Version
45
- version: '0'
46
- - !ruby/object:Gem::Dependency
47
- name: activesupport
48
- requirement: !ruby/object:Gem::Requirement
49
- none: false
50
- requirements:
51
- - - ! '>='
52
- - !ruby/object:Gem::Version
53
- version: '0'
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ segments:
42
+ - 0
43
+ version: "0"
54
44
  type: :runtime
45
+ version_requirements: *id002
46
+ - !ruby/object:Gem::Dependency
47
+ name: activesupport
55
48
  prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ! '>='
60
- - !ruby/object:Gem::Version
61
- version: '0'
49
+ requirement: &id003 !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ segments:
54
+ - 0
55
+ version: "0"
56
+ type: :runtime
57
+ version_requirements: *id003
62
58
  description: A javascript model framework.
63
- email:
59
+ email:
64
60
  - william@nine.is
65
61
  executables: []
62
+
66
63
  extensions: []
64
+
67
65
  extra_rdoc_files: []
68
- files:
66
+
67
+ files:
69
68
  - app/assets/images/loading.gif
70
69
  - app/assets/images/loading_small.gif
71
70
  - app/assets/javascripts/attribute/checkbox-multiple.js
@@ -97,28 +96,35 @@ files:
97
96
  - MIT-LICENSE
98
97
  - Rakefile
99
98
  - README.md
99
+ has_rdoc: true
100
100
  homepage: http://github.com/williambarry007/modeljs
101
101
  licenses: []
102
+
102
103
  post_install_message:
103
104
  rdoc_options: []
104
- require_paths:
105
+
106
+ require_paths:
105
107
  - lib
106
- required_ruby_version: !ruby/object:Gem::Requirement
107
- none: false
108
- requirements:
109
- - - ! '>='
110
- - !ruby/object:Gem::Version
111
- version: '0'
112
- required_rubygems_version: !ruby/object:Gem::Requirement
113
- none: false
114
- requirements:
115
- - - ! '>='
116
- - !ruby/object:Gem::Version
117
- version: '0'
108
+ required_ruby_version: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ segments:
113
+ - 0
114
+ version: "0"
115
+ required_rubygems_version: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - ">="
118
+ - !ruby/object:Gem::Version
119
+ segments:
120
+ - 0
121
+ version: "0"
118
122
  requirements: []
123
+
119
124
  rubyforge_project:
120
- rubygems_version: 1.8.25
125
+ rubygems_version: 1.3.6
121
126
  signing_key:
122
127
  specification_version: 3
123
128
  summary: A javascript model framework.
124
129
  test_files: []
130
+