ajax_scaffold_plugin 3.2.3 → 3.2.4

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/CHANGELOG CHANGED
@@ -1,3 +1,10 @@
1
+
2
+ 3.2.4 ========
3
+
4
+ * Patched rico_corner.js to no longer touch Object.prototype.extend which was causing the new version of
5
+ Prototype (1.5.0) to choke on making Ajax requests, quite unfortunate. This is a re-patch of the problem
6
+ we thought we fixed in 3.2.3.
7
+
1
8
  3.2.3 ========
2
9
 
3
10
  * Fixed clash between Rico and Prototype
@@ -1,10 +1,10 @@
1
- <tr class="ajax-scaffold-totals">
2
- <% for scaffold_column in @scaffold_columns %>
3
- <td>
4
- <% if show_totals_for_column?(scaffold_column.name) %><p><%= scaffold_column.total %></p><% else %>&nbsp;<% end %>
5
- </td>
6
- <% end %>
7
- <% unless @no_edit && @no_delete %>
8
- <td class="actions">&nbsp;</td>
9
- <% end %>
1
+ <tr class="ajax-scaffold-totals">
2
+ <% for scaffold_column in @scaffold_columns %>
3
+ <td>
4
+ <% if show_totals_for_column?(scaffold_column.name) %><p><%= scaffold_column.total %></p><% else %>&nbsp;<% end %>
5
+ </td>
6
+ <% end %>
7
+ <% unless @no_edit && @no_delete %>
8
+ <td class="actions">&nbsp;</td>
9
+ <% end %>
10
10
  </tr>
@@ -1,23 +1,23 @@
1
- /*
1
+ /*
2
2
  AjaxScaffoldGenerator version 3.1.0
3
3
  (c) 2006 Richard White <rrwhite@gmail.com>
4
-
4
+
5
5
  AjaxScaffoldGenerator is freely distributable under the terms of an MIT-style license.
6
-
6
+
7
7
  For details, see the AjaxScaffoldGenerator web site: http://www.ajaxscaffold.com/
8
8
  */
9
9
 
10
10
  /*
11
11
  * The following is a cross browser way to move around <tr> elements in a <table> or <tbody>
12
12
  */
13
-
13
+
14
14
  var Abstract = new Object();
15
15
  Abstract.Table = function() {};
16
16
  Abstract.Table.prototype = {
17
17
  tagTest: function(element, tagName) {
18
18
  return $(element).tagName.toLowerCase() == tagName.toLowerCase();
19
- }
20
- };
19
+ }
20
+ };
21
21
 
22
22
  Abstract.TableRow = function() {};
23
23
  Abstract.TableRow.prototype = Object.extend(new Abstract.Table(), {
@@ -25,14 +25,14 @@ Abstract.TableRow.prototype = Object.extend(new Abstract.Table(), {
25
25
  try {
26
26
  var sourceTableRow = $(sourceTableRow);
27
27
  var targetTableRow = $(targetTableRow);
28
-
29
- if (targetTableRow == null || !this.tagTest(targetTableRow,'tr')
28
+
29
+ if (targetTableRow == null || !this.tagTest(targetTableRow,'tr')
30
30
  || sourceTableRow == null || !this.tagTest(sourceTableRow,'tr')) {
31
31
  throw("TableRow: both parameters must be a <tr> tag.");
32
32
  }
33
-
33
+
34
34
  var tableOrTbody = this.findParentTableOrTbody(targetTableRow);
35
-
35
+
36
36
  var newRow = tableOrTbody.insertRow(this.getNewRowIndex(targetTableRow) - this.getRowOffset(tableOrTbody));
37
37
  newRow.parentNode.replaceChild(sourceTableRow, newRow);
38
38
 
@@ -42,7 +42,7 @@ Abstract.TableRow.prototype = Object.extend(new Abstract.Table(), {
42
42
  },
43
43
  getRowOffset: function(tableOrTbody) {
44
44
  //If we are inserting into a tablebody we would need figure out the rowIndex of the first
45
- // row in that tbody and subtract that offset from the new row index
45
+ // row in that tbody and subtract that offset from the new row index
46
46
  var rowOffset = 0;
47
47
  if (this.tagTest(tableOrTbody,'tbody')) {
48
48
  rowOffset = tableOrTbody.rows[0].rowIndex;
@@ -62,7 +62,7 @@ Abstract.TableRow.prototype = Object.extend(new Abstract.Table(), {
62
62
  }
63
63
  currentSearchDepth++;
64
64
  }
65
- }
65
+ }
66
66
  });
67
67
 
68
68
  var TableRow = new Object();
@@ -84,20 +84,20 @@ TableRow.MoveAfter.prototype = Object.extend(new Abstract.TableRow(), {
84
84
  /*
85
85
  * The following are simple utility methods
86
86
  */
87
-
88
- var AjaxScaffold = {
87
+
88
+ var AjaxScaffold = {
89
89
  stripe: function(tableBody) {
90
90
  var even = false;
91
91
  var tableBody = $(tableBody);
92
92
  var tableRows = tableBody.getElementsByTagName("tr");
93
93
  var length = tableBody.rows.length;
94
-
94
+
95
95
  for (var i = 0; i < length; i++) {
96
96
  var tableRow = tableBody.rows[i];
97
97
  //Make sure to skip rows that are create or edit rows or messages
98
- if (!Element.hasClassName(tableRow, "create")
98
+ if (!Element.hasClassName(tableRow, "create")
99
99
  && !Element.hasClassName(tableRow, "update")) {
100
-
100
+
101
101
  if (even) {
102
102
  Element.addClassName(tableRow, "even");
103
103
  } else {
@@ -123,44 +123,4 @@ var AjaxScaffold = {
123
123
  Element.removeClassName(element, "desc");
124
124
  });
125
125
  }
126
- }
127
-
128
- Ajax.Request.prototype = Object.extend(new Ajax.Request(), {
129
- setRequestHeaders: function() {
130
- var headers = {
131
- 'X-Requested-With': 'XMLHttpRequest',
132
- 'X-Prototype-Version': Prototype.Version,
133
- 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'
134
- };
135
-
136
- if (this.method == 'post') {
137
- headers['Content-type'] = this.options.contentType +
138
- (this.options.encoding ? '; charset=' + this.options.encoding : '');
139
-
140
- /* Force "Connection: close" for older Mozilla browsers to work
141
- * around a bug where XMLHttpRequest sends an incorrect
142
- * Content-length header. See Mozilla Bugzilla #246651.
143
- */
144
- if (this.transport.overrideMimeType &&
145
- (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005)
146
- headers['Connection'] = 'close';
147
- }
148
-
149
- // user-defined headers
150
- if (typeof this.options.requestHeaders == 'object') {
151
- var extras = this.options.requestHeaders;
152
-
153
- if (typeof extras.push == 'function')
154
- for (var i = 0, length = extras.length; i < length; i += 2)
155
- headers[extras[i]] = extras[i+1];
156
- else
157
- $H(extras).each(function(pair) { headers[pair.key] = pair.value });
158
- }
159
-
160
- for( var name in headers ) {
161
- if( typeof( headers[name] ) != 'function' ) {
162
- this.transport.setRequestHeader(name, headers[name]);
163
- }
164
- }
165
- }
166
- });
126
+ }
@@ -117,9 +117,9 @@ Rico.Color.prototype = {
117
117
 
118
118
  Rico.Color.createFromHex = function(hexCode) {
119
119
  if(hexCode.length==4) {
120
- var shortHexCode = hexCode;
120
+ var shortHexCode = hexCode;
121
121
  var hexCode = '#';
122
- for(var i=1;i<4;i++) hexCode += (shortHexCode.charAt(i) +
122
+ for(var i=1;i<4;i++) hexCode += (shortHexCode.charAt(i) +
123
123
  shortHexCode.charAt(i));
124
124
  }
125
125
  if ( hexCode.indexOf('#') == 0 )
@@ -484,6 +484,11 @@ Rico.Corner = {
484
484
 
485
485
  //-------------------- ricoUtil.js
486
486
  Rico.ArrayExtensions = new Array();
487
+ /*
488
+ rrwhite 1.25.2007 - Removing this since it conflicts with the new version of
489
+ Prototype (1.5.0) and effectively kills all AJAX calls (bummer). This call
490
+ appears to be something that only the larger Rico library needs and doesn't
491
+ need to be in the corners abstraction at all.
487
492
 
488
493
  if (Object.prototype.extend) {
489
494
  // in prototype.js...
@@ -494,6 +499,7 @@ if (Object.prototype.extend) {
494
499
  }
495
500
  Rico.ArrayExtensions[ Rico.ArrayExtensions.length ] = Object.prototype.extend;
496
501
  }
502
+ */
497
503
 
498
504
  if (Array.prototype.push) {
499
505
  // in prototype.js...
@@ -635,7 +641,7 @@ var RicoUtil = {
635
641
  },
636
642
 
637
643
  getContentAsString: function( parentNode ) {
638
- return parentNode.xml != undefined ?
644
+ return parentNode.xml != undefined ?
639
645
  this._getContentAsStringIE(parentNode) :
640
646
  this._getContentAsStringMozilla(parentNode);
641
647
  },
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: ajax_scaffold_plugin
5
5
  version: !ruby/object:Gem::Version
6
- version: 3.2.3
7
- date: 2007-01-23 00:00:00 +00:00
6
+ version: 3.2.4
7
+ date: 2007-01-25 00:00:00 -08:00
8
8
  summary: Ajax Scaffold plugin is a rails plugin for ajaxified scaffolds
9
9
  require_paths:
10
10
  - lib
@@ -36,14 +36,6 @@ files:
36
36
  - app/
37
37
  - app/views
38
38
  - app/views/ajax_scaffold
39
- - app/views/ajax_scaffold/update.rjs
40
- - app/views/ajax_scaffold/table.rhtml
41
- - app/views/ajax_scaffold/new.rjs
42
- - app/views/ajax_scaffold/list.rhtml
43
- - app/views/ajax_scaffold/edit.rjs
44
- - app/views/ajax_scaffold/destroy.rjs
45
- - app/views/ajax_scaffold/create.rjs
46
- - app/views/ajax_scaffold/cancel.rjs
47
39
  - app/views/ajax_scaffold/_row.rhtml
48
40
  - app/views/ajax_scaffold/_pagination_links.rhtml
49
41
  - app/views/ajax_scaffold/_new_edit.rhtml
@@ -52,8 +44,14 @@ files:
52
44
  - app/views/ajax_scaffold/_form.rhtml
53
45
  - app/views/ajax_scaffold/_column_totals.rhtml
54
46
  - app/views/ajax_scaffold/_column_headings.rhtml
55
- - app/views/.DS_Store
56
- - app/.DS_Store
47
+ - app/views/ajax_scaffold/update.rjs
48
+ - app/views/ajax_scaffold/table.rhtml
49
+ - app/views/ajax_scaffold/new.rjs
50
+ - app/views/ajax_scaffold/list.rhtml
51
+ - app/views/ajax_scaffold/edit.rjs
52
+ - app/views/ajax_scaffold/destroy.rjs
53
+ - app/views/ajax_scaffold/create.rjs
54
+ - app/views/ajax_scaffold/cancel.rjs
57
55
  - lib/
58
56
  - lib/base
59
57
  - lib/base/ajax_scaffold.rb
@@ -71,9 +69,7 @@ files:
71
69
  - public/images/arrow_up.gif
72
70
  - public/images/arrow_down.gif
73
71
  - public/images/add.gif
74
- - public/images/.DS_Store
75
72
  - public/blank.html
76
- - public/.DS_Store
77
73
  - tasks/
78
74
  - tasks/ajax_scaffold_tasks.rake
79
75
  - test/
data/app/.DS_Store DELETED
Binary file
data/app/views/.DS_Store DELETED
Binary file
data/public/.DS_Store DELETED
Binary file
Binary file