netzke-basepack 0.3.4 → 0.3.5

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,6 @@
1
+ v0.3.5
2
+ netzke-core v0.2.8 compatibility
3
+
1
4
  v0.3.4
2
5
  Quick tips added to the "tools"
3
6
  Regression: the "General" configuration panel for GridPanel works again
data/LICENSE CHANGED
@@ -1,20 +1,3 @@
1
- Copyright (c) 2008 Sergei Kozlov
1
+ Copyright (c) 2008-2009 Sergei Kozlov
2
2
 
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3
+ GNU GPL license v3
data/Manifest CHANGED
@@ -9,8 +9,6 @@ generators/netzke_grid_panel/templates/create_netzke_grid_panel_columns.rb
9
9
  init.rb
10
10
  install.rb
11
11
  javascripts/basepack.js
12
- javascripts/check_column.js
13
- javascripts/filters.js
14
12
  lib/app/models/netzke_form_panel_field.rb
15
13
  lib/app/models/netzke_grid_panel_column.rb
16
14
  lib/netzke/accordion_panel.rb
@@ -22,14 +20,18 @@ lib/netzke/db_fields.rb
22
20
  lib/netzke/fields_configurator.rb
23
21
  lib/netzke/form_panel.rb
24
22
  lib/netzke/form_panel_extras/interface.rb
23
+ lib/netzke/form_panel_extras/javascripts/xdatetime.js
25
24
  lib/netzke/form_panel_extras/js_builder.rb
26
25
  lib/netzke/grid_panel.rb
27
26
  lib/netzke/grid_panel_extras/interface.rb
27
+ lib/netzke/grid_panel_extras/javascripts/check_column.js
28
+ lib/netzke/grid_panel_extras/javascripts/filters.js
28
29
  lib/netzke/grid_panel_extras/js_builder.rb
29
30
  lib/netzke/panel.rb
30
31
  lib/netzke/preference_grid.rb
31
32
  lib/netzke/properties_tool.rb
32
33
  lib/netzke/property_grid.rb
34
+ lib/netzke/tab_panel.rb
33
35
  lib/netzke/table_editor.rb
34
36
  lib/netzke/wrapper.rb
35
37
  lib/netzke-basepack.rb
data/README.rdoc CHANGED
@@ -84,4 +84,4 @@ TODO: this part will be covered later
84
84
  = Credentials
85
85
  Testing done with the help of http://github.com/pluginaweek/plugin_test_helper
86
86
 
87
- Copyright (c) 2008-2009 Sergei Kozlov, released under the MIT license
87
+ Copyright (c) 2008-2009 Sergei Kozlov, released under the GNU GPL license v3
data/Rakefile CHANGED
@@ -5,7 +5,7 @@ Echoe.new("netzke-basepack") do |p|
5
5
  p.email = "sergei@writelesscode.com"
6
6
  p.summary = "Base Netzke widgets - grid, form, tree, and more"
7
7
  p.url = "http://writelesscode.com"
8
- p.runtime_dependencies = ["searchlogic >=1.6.2", "netzke-core >= 0.2.7"]
8
+ p.runtime_dependencies = ["searchlogic >=1.6.2", "netzke-core >= 0.2.8"]
9
9
  p.development_dependencies = []
10
10
  p.test_pattern = 'test/**/*_test.rb'
11
11
 
@@ -16,25 +16,11 @@ Netzke::Base.config.merge!({
16
16
  ActiveSupport::Dependencies.load_once_paths.delete(path)
17
17
  end
18
18
 
19
- # Include the javascript
20
- Netzke::Base.config[:javascripts] << "#{File.dirname(__FILE__)}/../javascripts/basepack.js"
21
- Netzke::Base.config[:javascripts] << "#{File.dirname(__FILE__)}/../javascripts/check_column.js"
22
-
23
- extjs_dir = "#{RAILS_ROOT}/public/extjs"
24
-
25
- # Filters in GridPanel
26
- if Netzke::Base.config[:grid_panel][:filters]
27
- Netzke::Base.config[:javascripts] << "#{extjs_dir}/examples/grid-filtering/menu/EditableItem.js"
28
- Netzke::Base.config[:javascripts] << "#{extjs_dir}/examples/grid-filtering/menu/RangeMenu.js"
29
- Netzke::Base.config[:javascripts] << "#{extjs_dir}/examples/grid-filtering/grid/GridFilters.js"
30
- %w{Boolean Date List Numeric String}.unshift("").each do |f|
31
- Netzke::Base.config[:javascripts] << "#{extjs_dir}/examples/grid-filtering/grid/filter/#{f}Filter.js"
32
- end
33
- Netzke::Base.config[:javascripts] << "#{File.dirname(__FILE__)}/../javascripts/filters.js"
34
- end
35
-
36
19
  # Make this plugin reloadable for easier development
37
20
  ActiveSupport::Dependencies.load_once_paths.delete(File.join(File.dirname(__FILE__)))
38
21
 
22
+ # Include the javascript
23
+ Netzke::Base.config[:javascripts] << "#{File.dirname(__FILE__)}/../javascripts/basepack.js"
24
+
39
25
  # Include CSS
40
26
  Netzke::Base.config[:css] << "#{File.dirname(__FILE__)}/../css/basepack.css"
data/lib/netzke/ar_ext.rb CHANGED
@@ -174,6 +174,15 @@ module Netzke
174
174
 
175
175
  DEFAULT_COLUMN_WIDTH = 100
176
176
 
177
+ # identify Ext editor for the data type
178
+ TYPE_EDITOR_MAP = {
179
+ :integer => :number_field,
180
+ :boolean => :checkbox,
181
+ :date => :date_field,
182
+ :datetime => :datetime,
183
+ :string => :text_field
184
+ }
185
+
177
186
  # Returns default column config understood by Netzke::GridPanel
178
187
  # Argument: column name (as Symbol) or column config
179
188
  def default_column_config(config)
@@ -184,8 +193,28 @@ module Netzke
184
193
  # Used by Netzke::FormPanel
185
194
  #
186
195
 
187
- DEFAULT_FIELD_WIDTH = 100
188
- DEFAULT_FIELD_HEIGHT = nil
196
+ # default configuration as a function of ActivRecord's column type
197
+ DEFAULTS_FOR_FIELD = {
198
+ :integer => {
199
+ :xtype => :numberfield
200
+ },
201
+ :boolean => {
202
+ :xtype => :numberfield
203
+ },
204
+ :date => {
205
+ :xtype => :datefield
206
+ },
207
+ :datetime => {
208
+ :xtype => :xdatetime
209
+ # :date_format => "Y-m-d",
210
+ # :time_format => "H:i",
211
+ # :time_width => 60
212
+ },
213
+ :string => {
214
+ :xtype => :textfield
215
+ }
216
+ }
217
+
189
218
  def default_field_config(config)
190
219
  # default_dbfield_config(config, :form)
191
220
  config = config.is_a?(Symbol) ? {:name => config} : config.dup
@@ -193,42 +222,17 @@ module Netzke
193
222
  # detect ActiveRecord column type (if the column is "real") or fall back to :virtual
194
223
  type = (columns_hash[config[:name].to_s] && columns_hash[config[:name].to_s].type) || :virtual
195
224
 
196
- defaults = {
225
+ common = {
197
226
  :field_label => config[:name].to_s.gsub('__', '_').humanize,
198
- :xtype => XTYPE_MAP[type],
199
227
  :hidden => config[:name] == :id
200
228
  }
201
229
 
202
- res = defaults.merge(config)
203
-
204
- # res = {
205
- # :name => config[:name].to_s || "unnamed",
206
- # :field_label => config[:field_label] || config[:name].to_s.gsub('__', '_').humanize,
207
- # # :disabled => config[:name] == :id, # make "id" column disabled by default
208
- # # :hidden => config[:name] == :id, # hide "id" column by default
209
- # :xtype => XTYPE_MAP[type]
210
- # }
211
-
230
+ default = DEFAULTS_FOR_FIELD[type] || DEFAULTS_FOR_FIELD[:string] # fallback to plain textfield
231
+
232
+ res = default.merge(common).merge(config)
212
233
  end
213
234
 
214
235
  private
215
- # identify Ext editor for the data type
216
- TYPE_EDITOR_MAP = {
217
- :integer => :number_field,
218
- :boolean => :checkbox,
219
- :date => :date_field,
220
- :datetime => :datetime,
221
- :string => :text_field
222
- }
223
-
224
- XTYPE_MAP = {
225
- :integer => :numberfield,
226
- :boolean => :textfield,
227
- :date => :datefield,
228
- :datetime => :datefield,
229
- :string => :textfield
230
- }
231
-
232
236
  def ext_editor(type)
233
237
  TYPE_EDITOR_MAP[type] || :text_field # fall back to :text_field
234
238
  end
@@ -1,6 +1,10 @@
1
1
  module Netzke
2
2
  class FormPanel < Base
3
- include_extras(__FILE__)
3
+ # so that some inherited methods would know our real location
4
+ self.widget_file = __FILE__
5
+
6
+ include_extras
7
+
4
8
  interface :submit, :load
5
9
 
6
10
  include Netzke::DbFields
@@ -0,0 +1,634 @@
1
+ /*global Ext */
2
+ /**
3
+ * @class Ext.ux.form.DateTime
4
+ * @extends Ext.form.Field
5
+ *
6
+ * DateTime field, combination of DateField and TimeField
7
+ *
8
+ * @author Ing. Jozef Sak�lo�
9
+ * @copyright (c) 2008, Ing. Jozef Sak�lo�
10
+ * @version 2.0
11
+ * @revision $Id: Ext.ux.form.DateTime.js 513 2009-01-29 19:59:22Z jozo $
12
+ *
13
+ * @license Ext.ux.form.DateTime is licensed under the terms of
14
+ * the Open Source LGPL 3.0 license. Commercial use is permitted to the extent
15
+ * that the code/component(s) do NOT become part of another Open Source or Commercially
16
+ * licensed development library or toolkit without explicit permission.
17
+ *
18
+ * <p>License details: <a href="http://www.gnu.org/licenses/lgpl.html"
19
+ * target="_blank">http://www.gnu.org/licenses/lgpl.html</a></p>
20
+ *
21
+ * @forum 22661
22
+ */
23
+
24
+ Ext.ns('Ext.ux.form');
25
+
26
+ /**
27
+ * @constructor
28
+ * Creates new DateTime
29
+ * @param {Object} config The config object
30
+ */
31
+ Ext.ux.form.DateTime = Ext.extend(Ext.form.Field, {
32
+ /**
33
+ * @cfg {String/Object} defaultAutoCreate DomHelper element spec
34
+ * Let superclass to create hidden field instead of textbox. Hidden will be submittend to server
35
+ */
36
+ defaultAutoCreate:{tag:'input', type:'hidden'}
37
+ /**
38
+ * @cfg {Number} timeWidth Width of time field in pixels (defaults to 100)
39
+ */
40
+ ,timeWidth:100
41
+ /**
42
+ * @cfg {String} dtSeparator Date - Time separator. Used to split date and time (defaults to ' ' (space))
43
+ */
44
+ ,dtSeparator:' '
45
+ /**
46
+ * @cfg {String} hiddenFormat Format of datetime used to store value in hidden field
47
+ * and submitted to server (defaults to 'Y-m-d H:i:s' that is mysql format)
48
+ */
49
+ ,hiddenFormat:'Y-m-d H:i:s'
50
+ /**
51
+ * @cfg {Boolean} otherToNow Set other field to now() if not explicly filled in (defaults to true)
52
+ */
53
+ ,otherToNow:true
54
+ /**
55
+ * @cfg {Boolean} emptyToNow Set field value to now on attempt to set empty value.
56
+ * If it is true then setValue() sets value of field to current date and time (defaults to false)
57
+ */
58
+ /**
59
+ * @cfg {String} timePosition Where the time field should be rendered. 'right' is suitable for forms
60
+ * and 'below' is suitable if the field is used as the grid editor (defaults to 'right')
61
+ */
62
+ ,timePosition:'right' // valid values:'below', 'right'
63
+ /**
64
+ * @cfg {String} dateFormat Format of DateField. Can be localized. (defaults to 'm/y/d')
65
+ */
66
+ ,dateFormat:'m/d/y'
67
+ /**
68
+ * @cfg {String} timeFormat Format of TimeField. Can be localized. (defaults to 'g:i A')
69
+ */
70
+ ,timeFormat:'g:i A'
71
+ /**
72
+ * @cfg {Object} dateConfig Config for DateField constructor.
73
+ */
74
+ /**
75
+ * @cfg {Object} timeConfig Config for TimeField constructor.
76
+ */
77
+
78
+ // {{{
79
+ /**
80
+ * @private
81
+ * creates DateField and TimeField and installs the necessary event handlers
82
+ */
83
+ ,initComponent:function() {
84
+ // call parent initComponent
85
+ Ext.ux.form.DateTime.superclass.initComponent.call(this);
86
+
87
+ // create DateField
88
+ var dateConfig = Ext.apply({}, {
89
+ id:this.id + '-date'
90
+ ,format:this.dateFormat || Ext.form.DateField.prototype.format
91
+ ,width:this.timeWidth
92
+ ,selectOnFocus:this.selectOnFocus
93
+ ,listeners:{
94
+ blur:{scope:this, fn:this.onBlur}
95
+ ,focus:{scope:this, fn:this.onFocus}
96
+ }
97
+ }, this.dateConfig);
98
+ this.df = new Ext.form.DateField(dateConfig);
99
+ this.df.ownerCt = this;
100
+ delete(this.dateFormat);
101
+
102
+
103
+ // create TimeField
104
+ var timeConfig = Ext.apply({}, {
105
+ id:this.id + '-time'
106
+ ,format:this.timeFormat || Ext.form.TimeField.prototype.format
107
+ ,width:this.timeWidth
108
+ ,selectOnFocus:this.selectOnFocus
109
+ ,listeners:{
110
+ blur:{scope:this, fn:this.onBlur}
111
+ ,focus:{scope:this, fn:this.onFocus}
112
+ }
113
+ }, this.timeConfig);
114
+ this.tf = new Ext.form.TimeField(timeConfig);
115
+ this.tf.ownerCt = this;
116
+ delete(this.timeFormat);
117
+
118
+ // relay events
119
+ this.relayEvents(this.df, ['focus', 'specialkey', 'invalid', 'valid']);
120
+ this.relayEvents(this.tf, ['focus', 'specialkey', 'invalid', 'valid']);
121
+
122
+ } // eo function initComponent
123
+ // }}}
124
+ // {{{
125
+ /**
126
+ * @private
127
+ * Renders underlying DateField and TimeField and provides a workaround for side error icon bug
128
+ */
129
+ ,onRender:function(ct, position) {
130
+ // don't run more than once
131
+ if(this.isRendered) {
132
+ return;
133
+ }
134
+
135
+ // render underlying hidden field
136
+ Ext.ux.form.DateTime.superclass.onRender.call(this, ct, position);
137
+
138
+ // render DateField and TimeField
139
+ // create bounding table
140
+ var t;
141
+ if('below' === this.timePosition || 'bellow' === this.timePosition) {
142
+ t = Ext.DomHelper.append(ct, {tag:'table',style:'border-collapse:collapse',children:[
143
+ {tag:'tr',children:[{tag:'td', style:'padding-bottom:1px', cls:'ux-datetime-date'}]}
144
+ ,{tag:'tr',children:[{tag:'td', cls:'ux-datetime-time'}]}
145
+ ]}, true);
146
+ }
147
+ else {
148
+ t = Ext.DomHelper.append(ct, {tag:'table',style:'border-collapse:collapse',children:[
149
+ {tag:'tr',children:[
150
+ {tag:'td',style:'padding-right:4px', cls:'ux-datetime-date'},{tag:'td', cls:'ux-datetime-time'}
151
+ ]}
152
+ ]}, true);
153
+ }
154
+
155
+ this.tableEl = t;
156
+ // this.wrap = t.wrap({cls:'x-form-field-wrap'});
157
+ this.wrap = t.wrap();
158
+ this.wrap.on("mousedown", this.onMouseDown, this, {delay:10});
159
+
160
+ // render DateField & TimeField
161
+ this.df.render(t.child('td.ux-datetime-date'));
162
+ this.tf.render(t.child('td.ux-datetime-time'));
163
+
164
+ // workaround for IE trigger misalignment bug
165
+ if(Ext.isIE && Ext.isStrict) {
166
+ t.select('input').applyStyles({top:0});
167
+ }
168
+
169
+ this.on('specialkey', this.onSpecialKey, this);
170
+ this.df.el.swallowEvent(['keydown', 'keypress']);
171
+ this.tf.el.swallowEvent(['keydown', 'keypress']);
172
+
173
+ // create icon for side invalid errorIcon
174
+ if('side' === this.msgTarget) {
175
+ var elp = this.el.findParent('.x-form-element', 10, true);
176
+ this.errorIcon = elp.createChild({cls:'x-form-invalid-icon'});
177
+
178
+ this.df.errorIcon = this.errorIcon;
179
+ this.tf.errorIcon = this.errorIcon;
180
+ }
181
+
182
+ // setup name for submit
183
+ this.el.dom.name = this.hiddenName || this.name || this.id;
184
+
185
+ // prevent helper fields from being submitted
186
+ this.df.el.dom.removeAttribute("name");
187
+ this.tf.el.dom.removeAttribute("name");
188
+
189
+ // we're rendered flag
190
+ this.isRendered = true;
191
+
192
+ // update hidden field
193
+ this.updateHidden();
194
+
195
+ } // eo function onRender
196
+ // }}}
197
+ // {{{
198
+ /**
199
+ * @private
200
+ */
201
+ ,adjustSize:Ext.BoxComponent.prototype.adjustSize
202
+ // }}}
203
+ // {{{
204
+ /**
205
+ * @private
206
+ */
207
+ ,alignErrorIcon:function() {
208
+ this.errorIcon.alignTo(this.tableEl, 'tl-tr', [2, 0]);
209
+ }
210
+ // }}}
211
+ // {{{
212
+ /**
213
+ * @private initializes internal dateValue
214
+ */
215
+ ,initDateValue:function() {
216
+ this.dateValue = this.otherToNow ? new Date() : new Date(1970, 0, 1, 0, 0, 0);
217
+ }
218
+ // }}}
219
+ // {{{
220
+ /**
221
+ * Calls clearInvalid on the DateField and TimeField
222
+ */
223
+ ,clearInvalid:function(){
224
+ this.df.clearInvalid();
225
+ this.tf.clearInvalid();
226
+ } // eo function clearInvalid
227
+ // }}}
228
+ // {{{
229
+ /**
230
+ * @private
231
+ * called from Component::destroy.
232
+ * Destroys all elements and removes all listeners we've created.
233
+ */
234
+ ,beforeDestroy:function() {
235
+ if(this.isRendered) {
236
+ // this.removeAllListeners();
237
+ this.wrap.removeAllListeners();
238
+ this.wrap.remove();
239
+ this.tableEl.remove();
240
+ this.df.destroy();
241
+ this.tf.destroy();
242
+ }
243
+ } // eo function beforeDestroy
244
+ // }}}
245
+ // {{{
246
+ /**
247
+ * Disable this component.
248
+ * @return {Ext.Component} this
249
+ */
250
+ ,disable:function() {
251
+ if(this.isRendered) {
252
+ this.df.disabled = this.disabled;
253
+ this.df.onDisable();
254
+ this.tf.onDisable();
255
+ }
256
+ this.disabled = true;
257
+ this.df.disabled = true;
258
+ this.tf.disabled = true;
259
+ this.fireEvent("disable", this);
260
+ return this;
261
+ } // eo function disable
262
+ // }}}
263
+ // {{{
264
+ /**
265
+ * Enable this component.
266
+ * @return {Ext.Component} this
267
+ */
268
+ ,enable:function() {
269
+ if(this.rendered){
270
+ this.df.onEnable();
271
+ this.tf.onEnable();
272
+ }
273
+ this.disabled = false;
274
+ this.df.disabled = false;
275
+ this.tf.disabled = false;
276
+ this.fireEvent("enable", this);
277
+ return this;
278
+ } // eo function enable
279
+ // }}}
280
+ // {{{
281
+ /**
282
+ * @private Focus date filed
283
+ */
284
+ ,focus:function() {
285
+ this.df.focus();
286
+ } // eo function focus
287
+ // }}}
288
+ // {{{
289
+ /**
290
+ * @private
291
+ */
292
+ ,getPositionEl:function() {
293
+ return this.wrap;
294
+ }
295
+ // }}}
296
+ // {{{
297
+ /**
298
+ * @private
299
+ */
300
+ ,getResizeEl:function() {
301
+ return this.wrap;
302
+ }
303
+ // }}}
304
+ // {{{
305
+ /**
306
+ * @return {Date/String} Returns value of this field
307
+ */
308
+ ,getValue:function() {
309
+ // create new instance of date
310
+ return this.dateValue ? new Date(this.dateValue) : '';
311
+ } // eo function getValue
312
+ // }}}
313
+ // {{{
314
+ /**
315
+ * @return {Boolean} true = valid, false = invalid
316
+ * @private Calls isValid methods of underlying DateField and TimeField and returns the result
317
+ */
318
+ ,isValid:function() {
319
+ return this.df.isValid() && this.tf.isValid();
320
+ } // eo function isValid
321
+ // }}}
322
+ // {{{
323
+ /**
324
+ * Returns true if this component is visible
325
+ * @return {boolean}
326
+ */
327
+ ,isVisible : function(){
328
+ return this.df.rendered && this.df.getActionEl().isVisible();
329
+ } // eo function isVisible
330
+ // }}}
331
+ // {{{
332
+ /**
333
+ * @private Handles blur event
334
+ */
335
+ ,onBlur:function(f) {
336
+ // called by both DateField and TimeField blur events
337
+
338
+ // revert focus to previous field if clicked in between
339
+ if(this.wrapClick) {
340
+ f.focus();
341
+ this.wrapClick = false;
342
+ }
343
+
344
+ // update underlying value
345
+ if(f === this.df) {
346
+ this.updateDate();
347
+ }
348
+ else {
349
+ this.updateTime();
350
+ }
351
+ this.updateHidden();
352
+
353
+ // fire events later
354
+ (function() {
355
+ if(!this.df.hasFocus && !this.tf.hasFocus) {
356
+ var v = this.getValue();
357
+ if(String(v) !== String(this.startValue)) {
358
+ this.fireEvent("change", this, v, this.startValue);
359
+ }
360
+ this.hasFocus = false;
361
+ this.fireEvent('blur', this);
362
+ }
363
+ }).defer(100, this);
364
+
365
+ } // eo function onBlur
366
+ // }}}
367
+ // {{{
368
+ /**
369
+ * @private Handles focus event
370
+ */
371
+ ,onFocus:function() {
372
+ if(!this.hasFocus){
373
+ this.hasFocus = true;
374
+ this.startValue = this.getValue();
375
+ this.fireEvent("focus", this);
376
+ }
377
+ }
378
+ // }}}
379
+ // {{{
380
+ /**
381
+ * @private Just to prevent blur event when clicked in the middle of fields
382
+ */
383
+ ,onMouseDown:function(e) {
384
+ if(!this.disabled) {
385
+ this.wrapClick = 'td' === e.target.nodeName.toLowerCase();
386
+ }
387
+ }
388
+ // }}}
389
+ // {{{
390
+ /**
391
+ * @private
392
+ * Handles Tab and Shift-Tab events
393
+ */
394
+ ,onSpecialKey:function(t, e) {
395
+ var key = e.getKey();
396
+ if(key === e.TAB) {
397
+ if(t === this.df && !e.shiftKey) {
398
+ e.stopEvent();
399
+ this.tf.focus();
400
+ }
401
+ if(t === this.tf && e.shiftKey) {
402
+ e.stopEvent();
403
+ this.df.focus();
404
+ }
405
+ }
406
+ // otherwise it misbehaves in editor grid
407
+ if(key === e.ENTER) {
408
+ this.updateValue();
409
+ }
410
+
411
+ } // eo function onSpecialKey
412
+ // }}}
413
+ // {{{
414
+ /**
415
+ * @private Sets the value of DateField
416
+ */
417
+ ,setDate:function(date) {
418
+ this.df.setValue(date);
419
+ } // eo function setDate
420
+ // }}}
421
+ // {{{
422
+ /**
423
+ * @private Sets the value of TimeField
424
+ */
425
+ ,setTime:function(date) {
426
+ this.tf.setValue(date);
427
+ } // eo function setTime
428
+ // }}}
429
+ // {{{
430
+ /**
431
+ * @private
432
+ * Sets correct sizes of underlying DateField and TimeField
433
+ * With workarounds for IE bugs
434
+ */
435
+ ,setSize:function(w, h) {
436
+ if(!w) {
437
+ return;
438
+ }
439
+ if('below' === this.timePosition) {
440
+ this.df.setSize(w, h);
441
+ this.tf.setSize(w, h);
442
+ if(Ext.isIE) {
443
+ this.df.el.up('td').setWidth(w);
444
+ this.tf.el.up('td').setWidth(w);
445
+ }
446
+ }
447
+ else {
448
+ this.df.setSize(w - this.timeWidth - 4, h);
449
+ this.tf.setSize(this.timeWidth, h);
450
+
451
+ if(Ext.isIE) {
452
+ this.df.el.up('td').setWidth(w - this.timeWidth - 4);
453
+ this.tf.el.up('td').setWidth(this.timeWidth);
454
+ }
455
+ }
456
+ } // eo function setSize
457
+ // }}}
458
+ // {{{
459
+ /**
460
+ * @param {Mixed} val Value to set
461
+ * Sets the value of this field
462
+ */
463
+ ,setValue:function(val) {
464
+ if(!val && true === this.emptyToNow) {
465
+ this.setValue(new Date());
466
+ return;
467
+ }
468
+ else if(!val) {
469
+ this.setDate('');
470
+ this.setTime('');
471
+ this.updateValue();
472
+ return;
473
+ }
474
+ if ('number' === typeof val) {
475
+ val = new Date(val);
476
+ }
477
+ else if('string' === typeof val && this.hiddenFormat) {
478
+ val = Date.parseDate(val, this.hiddenFormat)
479
+ }
480
+ val = val ? val : new Date(1970, 0 ,1, 0, 0, 0);
481
+ var da, time;
482
+ if(val instanceof Date) {
483
+ this.setDate(val);
484
+ this.setTime(val);
485
+ this.dateValue = new Date(val);
486
+ }
487
+ else {
488
+ da = val.split(this.dtSeparator);
489
+ this.setDate(da[0]);
490
+ if(da[1]) {
491
+ if(da[2]) {
492
+ // add am/pm part back to time
493
+ da[1] += da[2];
494
+ }
495
+ this.setTime(da[1]);
496
+ }
497
+ }
498
+ this.updateValue();
499
+ } // eo function setValue
500
+ // }}}
501
+ // {{{
502
+ /**
503
+ * Hide or show this component by boolean
504
+ * @return {Ext.Component} this
505
+ */
506
+ ,setVisible: function(visible){
507
+ if(visible) {
508
+ this.df.show();
509
+ this.tf.show();
510
+ }else{
511
+ this.df.hide();
512
+ this.tf.hide();
513
+ }
514
+ return this;
515
+ } // eo function setVisible
516
+ // }}}
517
+ //{{{
518
+ ,show:function() {
519
+ return this.setVisible(true);
520
+ } // eo function show
521
+ //}}}
522
+ //{{{
523
+ ,hide:function() {
524
+ return this.setVisible(false);
525
+ } // eo function hide
526
+ //}}}
527
+ // {{{
528
+ /**
529
+ * @private Updates the date part
530
+ */
531
+ ,updateDate:function() {
532
+
533
+ var d = this.df.getValue();
534
+ if(d) {
535
+ if(!(this.dateValue instanceof Date)) {
536
+ this.initDateValue();
537
+ if(!this.tf.getValue()) {
538
+ this.setTime(this.dateValue);
539
+ }
540
+ }
541
+ this.dateValue.setMonth(0); // because of leap years
542
+ this.dateValue.setFullYear(d.getFullYear());
543
+ this.dateValue.setMonth(d.getMonth(), d.getDate());
544
+ // this.dateValue.setDate(d.getDate());
545
+ }
546
+ else {
547
+ this.dateValue = '';
548
+ this.setTime('');
549
+ }
550
+ } // eo function updateDate
551
+ // }}}
552
+ // {{{
553
+ /**
554
+ * @private
555
+ * Updates the time part
556
+ */
557
+ ,updateTime:function() {
558
+ var t = this.tf.getValue();
559
+ if(t && !(t instanceof Date)) {
560
+ t = Date.parseDate(t, this.tf.format);
561
+ }
562
+ if(t && !this.df.getValue()) {
563
+ this.initDateValue();
564
+ this.setDate(this.dateValue);
565
+ }
566
+ if(this.dateValue instanceof Date) {
567
+ if(t) {
568
+ this.dateValue.setHours(t.getHours());
569
+ this.dateValue.setMinutes(t.getMinutes());
570
+ this.dateValue.setSeconds(t.getSeconds());
571
+ }
572
+ else {
573
+ this.dateValue.setHours(0);
574
+ this.dateValue.setMinutes(0);
575
+ this.dateValue.setSeconds(0);
576
+ }
577
+ }
578
+ } // eo function updateTime
579
+ // }}}
580
+ // {{{
581
+ /**
582
+ * @private Updates the underlying hidden field value
583
+ */
584
+ ,updateHidden:function() {
585
+ if(this.isRendered) {
586
+ var value = this.dateValue instanceof Date ? this.dateValue.format(this.hiddenFormat) : '';
587
+ this.el.dom.value = value;
588
+ }
589
+ }
590
+ // }}}
591
+ // {{{
592
+ /**
593
+ * @private Updates all of Date, Time and Hidden
594
+ */
595
+ ,updateValue:function() {
596
+
597
+ this.updateDate();
598
+ this.updateTime();
599
+ this.updateHidden();
600
+
601
+ return;
602
+ } // eo function updateValue
603
+ // }}}
604
+ // {{{
605
+ /**
606
+ * @return {Boolean} true = valid, false = invalid
607
+ * calls validate methods of DateField and TimeField
608
+ */
609
+ ,validate:function() {
610
+ return this.df.validate() && this.tf.validate();
611
+ } // eo function validate
612
+ // }}}
613
+ // {{{
614
+ /**
615
+ * Returns renderer suitable to render this field
616
+ * @param {Object} Column model config
617
+ */
618
+ ,renderer: function(field) {
619
+ var format = field.editor.dateFormat || Ext.ux.form.DateTime.prototype.dateFormat;
620
+ format += ' ' + (field.editor.timeFormat || Ext.ux.form.DateTime.prototype.timeFormat);
621
+ var renderer = function(val) {
622
+ var retval = Ext.util.Format.date(val, format);
623
+ return retval;
624
+ };
625
+ return renderer;
626
+ } // eo function renderer
627
+ // }}}
628
+
629
+ }); // eo extend
630
+
631
+ // register xtype
632
+ Ext.reg('xdatetime', Ext.ux.form.DateTime);
633
+
634
+ // eof
@@ -12,11 +12,26 @@ module Netzke
12
12
  # * properties and column configuration
13
13
  #
14
14
  class GridPanel < Base
15
- include_extras(__FILE__)
15
+ # so that some inherited methods would know our real location
16
+ self.widget_file = __FILE__
17
+
18
+ # include javascripts from Ext examples
19
+ ext_js_include "examples/grid-filtering/menu/EditableItem.js",
20
+ "examples/grid-filtering/menu/RangeMenu.js",
21
+ "examples/grid-filtering/grid/GridFilters.js"
22
+
23
+ %w{Boolean Date List Numeric String}.unshift("").each do |f|
24
+ ext_js_include "examples/grid-filtering/grid/filter/#{f}Filter.js"
25
+ end
16
26
 
17
- # define connection points between client side and server side of GridPanel. See implementation of equally named methods in the GridPanelInterface module.
27
+ # include ruby code in grid_panel_extras
28
+ include_extras
29
+
30
+ # define connection points between client side and server side of GridPanel.
31
+ # See implementation of equally named methods in the GridPanelExtras::Interface module.
18
32
  interface :get_data, :post_data, :delete_data, :resize_column, :move_column, :get_cb_choices
19
33
 
34
+ # database field operations
20
35
  include Netzke::DbFields
21
36
 
22
37
  module ClassMethods
@@ -27,7 +42,7 @@ module Netzke
27
42
  # Global GridPanel configuration
28
43
  def config
29
44
  set_default_config({
30
- :column_manager => "NetzkeGridPanelColumn"
45
+ :column_manager => "NetzkeGridPanelColumn"
31
46
  })
32
47
  end
33
48
 
@@ -36,6 +51,7 @@ module Netzke
36
51
  rescue
37
52
  nil
38
53
  end
54
+
39
55
  end
40
56
  extend ClassMethods
41
57
 
@@ -0,0 +1,97 @@
1
+ module Netzke
2
+ class TabPanel < Base
3
+ def self.js_base_class
4
+ "Ext.TabPanel"
5
+ end
6
+
7
+ def self.js_extend_properties
8
+ {
9
+ # loads widget into the panel if it wasn't loaded yet
10
+ :load_item_widget => <<-JS.l,
11
+ function(panel) {
12
+ if (!panel.getWidget()) panel.loadWidget(this.id + "__" + panel.containerFor + "__get_widget");
13
+ }
14
+ JS
15
+
16
+ :on_widget_load => <<-JS.l
17
+ function(){
18
+ // immediately instantiate the active panel
19
+ var activePanel = this.findById(this.id + "_active");
20
+ var activeItemConfig = this.initialConfig[this.initialConfig.expandedItem+"Config"];
21
+ if (activeItemConfig) activePanel.add(new Ext.netzke.cache[activeItemConfig.widgetClassName](activeItemConfig));
22
+ }
23
+ JS
24
+ }
25
+ end
26
+
27
+ def js_config
28
+ active_item_config = config[:items].select{|i| i[:active]}.first
29
+ super.merge({
30
+ :active_item => active_item_config && active_item_config[:name],
31
+ :items => items
32
+ })
33
+ end
34
+
35
+ # some configuration normalization
36
+ def initialize(*args)
37
+ super
38
+
39
+ seen_active = false
40
+
41
+ config[:items].each_with_index do |item, i|
42
+ # if some items are provided without names, give them generated names
43
+ item[:name] ||= "item#{i}"
44
+
45
+ # remove duplucated :active configuration
46
+ if item[:active]
47
+ item[:active] = nil if seen_active
48
+ seen_active = true
49
+ end
50
+ end
51
+ end
52
+
53
+ # the items are late aggregatees, besides the ones that are marked "active"
54
+ def initial_aggregatees
55
+ res = {}
56
+ config[:items].each_with_index do |item, i|
57
+ item[:late_aggregation] = !item[:active]
58
+ res.merge!(item[:name].to_sym => item)
59
+ end
60
+ res
61
+ end
62
+
63
+
64
+ def self.js_default_config
65
+ super.merge({
66
+ :active_tab => 0,
67
+ :id_delimiter => "___", # otherwise it conflicts with Netzke
68
+ :defaults => {:layout => 'fit'}, # all items will be of type Panel with layout 'fit'
69
+ :listeners => {
70
+ # every item gets an expand event set, which dynamically loads a widget into this item
71
+ :tabchange => {
72
+ :fn => <<-JS.l
73
+ function(self, tab){
74
+ this.loadItemWidget(tab);
75
+ // comp.on('expand', this.loadItemWidget, self)
76
+ }
77
+ JS
78
+ }
79
+ }
80
+ })
81
+ end
82
+
83
+ def items
84
+ res = []
85
+ config[:items].each_with_index do |item, i|
86
+ item_config = {
87
+ # :id => item[:active] && id_name + '_active',
88
+ :title => item[:title] || (item[:name] && item[:name].humanize),
89
+ :container_for => item[:name] # to know which fit panel will load which widget
90
+ }
91
+ res << item_config
92
+ end
93
+ res
94
+ end
95
+
96
+ end
97
+ end
@@ -2,15 +2,15 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{netzke-basepack}
5
- s.version = "0.3.4"
5
+ s.version = "0.3.5"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Sergei Kozlov"]
9
- s.date = %q{2009-02-13}
9
+ s.date = %q{2009-03-03}
10
10
  s.description = %q{Base Netzke widgets - grid, form, tree, and more}
11
11
  s.email = %q{sergei@writelesscode.com}
12
- s.extra_rdoc_files = ["CHANGELOG", "lib/app/models/netzke_form_panel_field.rb", "lib/app/models/netzke_grid_panel_column.rb", "lib/netzke/accordion_panel.rb", "lib/netzke/ar_ext.rb", "lib/netzke/basic_app.rb", "lib/netzke/border_layout_panel.rb", "lib/netzke/container.rb", "lib/netzke/db_fields.rb", "lib/netzke/fields_configurator.rb", "lib/netzke/form_panel.rb", "lib/netzke/form_panel_extras/interface.rb", "lib/netzke/form_panel_extras/js_builder.rb", "lib/netzke/grid_panel.rb", "lib/netzke/grid_panel_extras/interface.rb", "lib/netzke/grid_panel_extras/js_builder.rb", "lib/netzke/panel.rb", "lib/netzke/preference_grid.rb", "lib/netzke/properties_tool.rb", "lib/netzke/property_grid.rb", "lib/netzke/table_editor.rb", "lib/netzke/wrapper.rb", "lib/netzke-basepack.rb", "LICENSE", "README.rdoc", "tasks/netzke_basepack_tasks.rake"]
13
- s.files = ["CHANGELOG", "css/basepack.css", "generators/netzke_basepack/netzke_basepack_generator.rb", "generators/netzke_basepack/USAGE", "generators/netzke_form_panel/netzke_form_panel_generator.rb", "generators/netzke_form_panel/templates/create_netzke_form_panel_fields.rb", "generators/netzke_grid_panel/netzke_grid_panel_generator.rb", "generators/netzke_grid_panel/templates/create_netzke_grid_panel_columns.rb", "init.rb", "install.rb", "javascripts/basepack.js", "javascripts/check_column.js", "javascripts/filters.js", "lib/app/models/netzke_form_panel_field.rb", "lib/app/models/netzke_grid_panel_column.rb", "lib/netzke/accordion_panel.rb", "lib/netzke/ar_ext.rb", "lib/netzke/basic_app.rb", "lib/netzke/border_layout_panel.rb", "lib/netzke/container.rb", "lib/netzke/db_fields.rb", "lib/netzke/fields_configurator.rb", "lib/netzke/form_panel.rb", "lib/netzke/form_panel_extras/interface.rb", "lib/netzke/form_panel_extras/js_builder.rb", "lib/netzke/grid_panel.rb", "lib/netzke/grid_panel_extras/interface.rb", "lib/netzke/grid_panel_extras/js_builder.rb", "lib/netzke/panel.rb", "lib/netzke/preference_grid.rb", "lib/netzke/properties_tool.rb", "lib/netzke/property_grid.rb", "lib/netzke/table_editor.rb", "lib/netzke/wrapper.rb", "lib/netzke-basepack.rb", "LICENSE", "Manifest", "Rakefile", "README.rdoc", "tasks/netzke_basepack_tasks.rake", "test/app_root/app/controllers/application.rb", "test/app_root/app/models/book.rb", "test/app_root/app/models/category.rb", "test/app_root/app/models/city.rb", "test/app_root/app/models/continent.rb", "test/app_root/app/models/country.rb", "test/app_root/app/models/genre.rb", "test/app_root/config/boot.rb", "test/app_root/config/database.yml", "test/app_root/config/environment.rb", "test/app_root/config/environments/in_memory.rb", "test/app_root/config/environments/mysql.rb", "test/app_root/config/environments/postgresql.rb", "test/app_root/config/environments/sqlite.rb", "test/app_root/config/environments/sqlite3.rb", "test/app_root/config/routes.rb", "test/app_root/db/migrate/20081222033343_create_books.rb", "test/app_root/db/migrate/20081222033440_create_genres.rb", "test/app_root/db/migrate/20081222035855_create_netzke_preferences.rb", "test/app_root/db/migrate/20081223024935_create_categories.rb", "test/app_root/db/migrate/20081223025635_create_countries.rb", "test/app_root/db/migrate/20081223025653_create_continents.rb", "test/app_root/db/migrate/20081223025732_create_cities.rb", "test/app_root/db/migrate/20090102223630_create_netzke_layouts.rb", "test/app_root/db/migrate/20090102223811_create_netzke_grid_panel_columns.rb", "test/app_root/script/console", "test/app_root/vendor/plugins/acts_as_list/init.rb", "test/app_root/vendor/plugins/acts_as_list/lib/active_record/acts/list.rb", "test/app_root/vendor/plugins/acts_as_list/README", "test/ar_ext_test.rb", "test/border_layout_panel_test.rb", "test/console_with_fixtures.rb", "test/fixtures/books.yml", "test/fixtures/categories.yml", "test/fixtures/cities.yml", "test/fixtures/continents.yml", "test/fixtures/countries.yml", "test/fixtures/genres.yml", "test/grid_panel_test.rb", "test/netzke_basepack_test.rb", "test/schema.rb", "test/test_helper.rb", "uninstall.rb", "netzke-basepack.gemspec"]
12
+ s.extra_rdoc_files = ["CHANGELOG", "lib/app/models/netzke_form_panel_field.rb", "lib/app/models/netzke_grid_panel_column.rb", "lib/netzke/accordion_panel.rb", "lib/netzke/ar_ext.rb", "lib/netzke/basic_app.rb", "lib/netzke/border_layout_panel.rb", "lib/netzke/container.rb", "lib/netzke/db_fields.rb", "lib/netzke/fields_configurator.rb", "lib/netzke/form_panel.rb", "lib/netzke/form_panel_extras/interface.rb", "lib/netzke/form_panel_extras/javascripts/xdatetime.js", "lib/netzke/form_panel_extras/js_builder.rb", "lib/netzke/grid_panel.rb", "lib/netzke/grid_panel_extras/interface.rb", "lib/netzke/grid_panel_extras/javascripts/check_column.js", "lib/netzke/grid_panel_extras/javascripts/filters.js", "lib/netzke/grid_panel_extras/js_builder.rb", "lib/netzke/panel.rb", "lib/netzke/preference_grid.rb", "lib/netzke/properties_tool.rb", "lib/netzke/property_grid.rb", "lib/netzke/tab_panel.rb", "lib/netzke/table_editor.rb", "lib/netzke/wrapper.rb", "lib/netzke-basepack.rb", "LICENSE", "README.rdoc", "tasks/netzke_basepack_tasks.rake"]
13
+ s.files = ["CHANGELOG", "css/basepack.css", "generators/netzke_basepack/netzke_basepack_generator.rb", "generators/netzke_basepack/USAGE", "generators/netzke_form_panel/netzke_form_panel_generator.rb", "generators/netzke_form_panel/templates/create_netzke_form_panel_fields.rb", "generators/netzke_grid_panel/netzke_grid_panel_generator.rb", "generators/netzke_grid_panel/templates/create_netzke_grid_panel_columns.rb", "init.rb", "install.rb", "javascripts/basepack.js", "lib/app/models/netzke_form_panel_field.rb", "lib/app/models/netzke_grid_panel_column.rb", "lib/netzke/accordion_panel.rb", "lib/netzke/ar_ext.rb", "lib/netzke/basic_app.rb", "lib/netzke/border_layout_panel.rb", "lib/netzke/container.rb", "lib/netzke/db_fields.rb", "lib/netzke/fields_configurator.rb", "lib/netzke/form_panel.rb", "lib/netzke/form_panel_extras/interface.rb", "lib/netzke/form_panel_extras/javascripts/xdatetime.js", "lib/netzke/form_panel_extras/js_builder.rb", "lib/netzke/grid_panel.rb", "lib/netzke/grid_panel_extras/interface.rb", "lib/netzke/grid_panel_extras/javascripts/check_column.js", "lib/netzke/grid_panel_extras/javascripts/filters.js", "lib/netzke/grid_panel_extras/js_builder.rb", "lib/netzke/panel.rb", "lib/netzke/preference_grid.rb", "lib/netzke/properties_tool.rb", "lib/netzke/property_grid.rb", "lib/netzke/tab_panel.rb", "lib/netzke/table_editor.rb", "lib/netzke/wrapper.rb", "lib/netzke-basepack.rb", "LICENSE", "Manifest", "Rakefile", "README.rdoc", "tasks/netzke_basepack_tasks.rake", "test/app_root/app/controllers/application.rb", "test/app_root/app/models/book.rb", "test/app_root/app/models/category.rb", "test/app_root/app/models/city.rb", "test/app_root/app/models/continent.rb", "test/app_root/app/models/country.rb", "test/app_root/app/models/genre.rb", "test/app_root/config/boot.rb", "test/app_root/config/database.yml", "test/app_root/config/environment.rb", "test/app_root/config/environments/in_memory.rb", "test/app_root/config/environments/mysql.rb", "test/app_root/config/environments/postgresql.rb", "test/app_root/config/environments/sqlite.rb", "test/app_root/config/environments/sqlite3.rb", "test/app_root/config/routes.rb", "test/app_root/db/migrate/20081222033343_create_books.rb", "test/app_root/db/migrate/20081222033440_create_genres.rb", "test/app_root/db/migrate/20081222035855_create_netzke_preferences.rb", "test/app_root/db/migrate/20081223024935_create_categories.rb", "test/app_root/db/migrate/20081223025635_create_countries.rb", "test/app_root/db/migrate/20081223025653_create_continents.rb", "test/app_root/db/migrate/20081223025732_create_cities.rb", "test/app_root/db/migrate/20090102223630_create_netzke_layouts.rb", "test/app_root/db/migrate/20090102223811_create_netzke_grid_panel_columns.rb", "test/app_root/script/console", "test/app_root/vendor/plugins/acts_as_list/init.rb", "test/app_root/vendor/plugins/acts_as_list/lib/active_record/acts/list.rb", "test/app_root/vendor/plugins/acts_as_list/README", "test/ar_ext_test.rb", "test/border_layout_panel_test.rb", "test/console_with_fixtures.rb", "test/fixtures/books.yml", "test/fixtures/categories.yml", "test/fixtures/cities.yml", "test/fixtures/continents.yml", "test/fixtures/countries.yml", "test/fixtures/genres.yml", "test/grid_panel_test.rb", "test/netzke_basepack_test.rb", "test/schema.rb", "test/test_helper.rb", "uninstall.rb", "netzke-basepack.gemspec"]
14
14
  s.has_rdoc = true
15
15
  s.homepage = %q{http://writelesscode.com}
16
16
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Netzke-basepack", "--main", "README.rdoc"]
@@ -26,13 +26,13 @@ Gem::Specification.new do |s|
26
26
 
27
27
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
28
28
  s.add_runtime_dependency(%q<searchlogic>, [">= 1.6.2"])
29
- s.add_runtime_dependency(%q<netzke-core>, [">= 0", "= 0.2.7"])
29
+ s.add_runtime_dependency(%q<netzke-core>, [">= 0", "= 0.2.8"])
30
30
  else
31
31
  s.add_dependency(%q<searchlogic>, [">= 1.6.2"])
32
- s.add_dependency(%q<netzke-core>, [">= 0", "= 0.2.7"])
32
+ s.add_dependency(%q<netzke-core>, [">= 0", "= 0.2.8"])
33
33
  end
34
34
  else
35
35
  s.add_dependency(%q<searchlogic>, [">= 1.6.2"])
36
- s.add_dependency(%q<netzke-core>, [">= 0", "= 0.2.7"])
36
+ s.add_dependency(%q<netzke-core>, [">= 0", "= 0.2.8"])
37
37
  end
38
38
  end
@@ -9,16 +9,17 @@ require 'netzke/db_fields'
9
9
  require 'netzke/grid_panel'
10
10
 
11
11
  class BorderLayoutPanelTest < ActiveSupport::TestCase
12
- test "dependencies" do
13
- widget = Netzke::BorderLayoutPanel.new(:name => 'Bla', :regions => {:center => {:widget_class_name => 'Panel'}, :east => {:widget_class_name => 'GridPanel'}})
14
-
15
- assert(%w{BorderLayoutPanel Panel GridPanel}.all?{|k| widget.dependencies.include?(k)})
16
-
17
- assert(widget.js_missing_code.index("Ext.netzke.cache['BorderLayoutPanel']"))
18
- # assert(widget.js_missing_code.index("Ext.netzke.cache['Panel']"))
19
- assert(!widget.js_missing_code(%w{GridPanel Panel}).index("Ext.netzke.cache['GridPanel']"))
20
- # assert(!widget.js_missing_code(%w{GridPanel Panel}).index("Ext.netzke.cache['Panel']"))
21
- # assert(!widget.js_missing_code(%w{BorderLayoutPanel}).index("Ext.netzke.cache['BorderLayoutPanel']"))
22
-
23
- end
12
+ # TODO: rethink the test
13
+ # test "dependencies" do
14
+ # widget = Netzke::BorderLayoutPanel.new(:name => 'Bla', :regions => {:center => {:widget_class_name => 'Panel'}, :east => {:widget_class_name => 'GridPanel'}})
15
+ #
16
+ # assert(%w{BorderLayoutPanel Panel GridPanel}.all?{|k| widget.dependencies.include?(k)})
17
+ #
18
+ # assert(widget.js_missing_code.index("Ext.netzke.cache['BorderLayoutPanel']"))
19
+ # # assert(widget.js_missing_code.index("Ext.netzke.cache['Panel']"))
20
+ # assert(!widget.js_missing_code(%w{GridPanel Panel}).index("Ext.netzke.cache['GridPanel']"))
21
+ # # assert(!widget.js_missing_code(%w{GridPanel Panel}).index("Ext.netzke.cache['Panel']"))
22
+ # # assert(!widget.js_missing_code(%w{BorderLayoutPanel}).index("Ext.netzke.cache['BorderLayoutPanel']"))
23
+ #
24
+ # end
24
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: netzke-basepack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergei Kozlov
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-02-13 00:00:00 +01:00
12
+ date: 2009-03-03 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -33,7 +33,7 @@ dependencies:
33
33
  version: "0"
34
34
  - - "="
35
35
  - !ruby/object:Gem::Version
36
- version: 0.2.7
36
+ version: 0.2.8
37
37
  version:
38
38
  description: Base Netzke widgets - grid, form, tree, and more
39
39
  email: sergei@writelesscode.com
@@ -54,14 +54,18 @@ extra_rdoc_files:
54
54
  - lib/netzke/fields_configurator.rb
55
55
  - lib/netzke/form_panel.rb
56
56
  - lib/netzke/form_panel_extras/interface.rb
57
+ - lib/netzke/form_panel_extras/javascripts/xdatetime.js
57
58
  - lib/netzke/form_panel_extras/js_builder.rb
58
59
  - lib/netzke/grid_panel.rb
59
60
  - lib/netzke/grid_panel_extras/interface.rb
61
+ - lib/netzke/grid_panel_extras/javascripts/check_column.js
62
+ - lib/netzke/grid_panel_extras/javascripts/filters.js
60
63
  - lib/netzke/grid_panel_extras/js_builder.rb
61
64
  - lib/netzke/panel.rb
62
65
  - lib/netzke/preference_grid.rb
63
66
  - lib/netzke/properties_tool.rb
64
67
  - lib/netzke/property_grid.rb
68
+ - lib/netzke/tab_panel.rb
65
69
  - lib/netzke/table_editor.rb
66
70
  - lib/netzke/wrapper.rb
67
71
  - lib/netzke-basepack.rb
@@ -80,8 +84,6 @@ files:
80
84
  - init.rb
81
85
  - install.rb
82
86
  - javascripts/basepack.js
83
- - javascripts/check_column.js
84
- - javascripts/filters.js
85
87
  - lib/app/models/netzke_form_panel_field.rb
86
88
  - lib/app/models/netzke_grid_panel_column.rb
87
89
  - lib/netzke/accordion_panel.rb
@@ -93,14 +95,18 @@ files:
93
95
  - lib/netzke/fields_configurator.rb
94
96
  - lib/netzke/form_panel.rb
95
97
  - lib/netzke/form_panel_extras/interface.rb
98
+ - lib/netzke/form_panel_extras/javascripts/xdatetime.js
96
99
  - lib/netzke/form_panel_extras/js_builder.rb
97
100
  - lib/netzke/grid_panel.rb
98
101
  - lib/netzke/grid_panel_extras/interface.rb
102
+ - lib/netzke/grid_panel_extras/javascripts/check_column.js
103
+ - lib/netzke/grid_panel_extras/javascripts/filters.js
99
104
  - lib/netzke/grid_panel_extras/js_builder.rb
100
105
  - lib/netzke/panel.rb
101
106
  - lib/netzke/preference_grid.rb
102
107
  - lib/netzke/properties_tool.rb
103
108
  - lib/netzke/property_grid.rb
109
+ - lib/netzke/tab_panel.rb
104
110
  - lib/netzke/table_editor.rb
105
111
  - lib/netzke/wrapper.rb
106
112
  - lib/netzke-basepack.rb