netzke-basepack 0.3.8 → 0.3.9
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +7 -0
- data/Manifest +2 -1
- data/lib/netzke/accordion_panel.rb +14 -12
- data/lib/netzke/basic_app.rb +7 -13
- data/lib/netzke/configuration_tool.rb +1 -1
- data/lib/netzke/tab_panel.rb +37 -31
- data/lib/netzke/table_editor.rb +1 -1
- data/netzke-basepack.gemspec +4 -4
- data/test/accordion_panel_test.rb +21 -0
- data/test/tab_panel_test.rb +21 -0
- metadata +7 -3
data/CHANGELOG
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
v0.3.9
|
2
|
+
AccordionPanel tests added
|
3
|
+
TabPanel works now
|
4
|
+
AccordionPanel replaced with more intuitive TabPanel in the configuration window
|
5
|
+
Code clean-up by using "single" option to call appLoaded() on "afterlayout"
|
6
|
+
Table editor bug fix
|
7
|
+
|
1
8
|
v0.3.8
|
2
9
|
Fixing Ext's EditableItem render problem.
|
3
10
|
Filters by default enabled again in GridPanel.
|
data/Manifest
CHANGED
@@ -38,11 +38,11 @@ lib/netzke/wrapper.rb
|
|
38
38
|
lib/netzke-basepack.rb
|
39
39
|
LICENSE
|
40
40
|
Manifest
|
41
|
-
netzke-basepack.gemspec
|
42
41
|
Rakefile
|
43
42
|
README.rdoc
|
44
43
|
stylesheets/basepack.css
|
45
44
|
tasks/netzke_basepack_tasks.rake
|
45
|
+
test/accordion_panel_test.rb
|
46
46
|
test/app_root/app/controllers/application.rb
|
47
47
|
test/app_root/app/models/book.rb
|
48
48
|
test/app_root/app/models/category.rb
|
@@ -84,6 +84,7 @@ test/fixtures/genres.yml
|
|
84
84
|
test/grid_panel_test.rb
|
85
85
|
test/netzke_basepack_test.rb
|
86
86
|
test/schema.rb
|
87
|
+
test/tab_panel_test.rb
|
87
88
|
test/test_helper.rb
|
88
89
|
TODO
|
89
90
|
uninstall.rb
|
@@ -4,7 +4,7 @@ module Netzke
|
|
4
4
|
#
|
5
5
|
# Features:
|
6
6
|
# * Dynamically loads widgets for the panels that get expanded for the first time
|
7
|
-
# *
|
7
|
+
# * Is loaded along with the active widget - saves a request to the server
|
8
8
|
#
|
9
9
|
# TODO:
|
10
10
|
# * Stores the last active panel in persistent_config
|
@@ -18,7 +18,7 @@ module Netzke
|
|
18
18
|
def js_default_config
|
19
19
|
super.merge({
|
20
20
|
:layout => 'accordion',
|
21
|
-
:defaults => {:layout => 'fit'}, #
|
21
|
+
:defaults => {:layout => 'fit'}, # Container's items will be of type Panel with layout 'fit' ("fit-panels")
|
22
22
|
:listeners => {
|
23
23
|
# every item gets an expand event set, which dynamically loads a widget into this item
|
24
24
|
:add => {
|
@@ -37,7 +37,7 @@ module Netzke
|
|
37
37
|
# loads widget into the panel if it wasn't loaded yet
|
38
38
|
:load_item_widget => <<-JS.l,
|
39
39
|
function(panel) {
|
40
|
-
if (!panel.getWidget()) panel.loadWidget(this.id + "__" + panel.
|
40
|
+
if (!panel.getWidget()) panel.loadWidget(this.id + "__" + panel.widget + "__get_widget");
|
41
41
|
}
|
42
42
|
JS
|
43
43
|
|
@@ -45,8 +45,11 @@ module Netzke
|
|
45
45
|
function(){
|
46
46
|
// immediately instantiate the active panel
|
47
47
|
var activePanel = this.findById(this.id + "_active");
|
48
|
+
|
48
49
|
var activeItemConfig = this.initialConfig[this.initialConfig.expandedItem+"Config"];
|
49
|
-
if (activeItemConfig)
|
50
|
+
if (activeItemConfig) {
|
51
|
+
activePanel.add(new Ext.netzke.cache[activeItemConfig.widgetClassName](activeItemConfig));
|
52
|
+
}
|
50
53
|
}
|
51
54
|
JS
|
52
55
|
}
|
@@ -73,9 +76,9 @@ module Netzke
|
|
73
76
|
end
|
74
77
|
|
75
78
|
def js_config
|
76
|
-
expanded_widget_config = config[:items].
|
79
|
+
expanded_widget_config = config[:items].detect{|i| i[:active]}
|
77
80
|
super.merge({
|
78
|
-
:items =>
|
81
|
+
:items => fit_panels,
|
79
82
|
:expanded_item => expanded_widget_config && expanded_widget_config[:name]
|
80
83
|
})
|
81
84
|
end
|
@@ -90,17 +93,16 @@ module Netzke
|
|
90
93
|
res
|
91
94
|
end
|
92
95
|
|
93
|
-
#
|
94
|
-
def
|
96
|
+
# fit-panels - panels of layout 'fit' that will contain the widgets (items)
|
97
|
+
def fit_panels
|
95
98
|
res = []
|
96
99
|
config[:items].each_with_index do |item, i|
|
97
|
-
|
98
|
-
:id => item[:active] && id_name + '_active',
|
100
|
+
res << {
|
101
|
+
:id => item[:active] && id_name + '_active', # to mark the fit-panel which will contain the active widget
|
99
102
|
:title => item[:title] || (item[:name] && item[:name].humanize),
|
100
|
-
:
|
103
|
+
:widget => item[:name], # to know which fit panel will load which widget
|
101
104
|
:collapsed => !(item[:active] || false)
|
102
105
|
}
|
103
|
-
res << item_config
|
104
106
|
end
|
105
107
|
res
|
106
108
|
end
|
data/lib/netzke/basic_app.rb
CHANGED
@@ -4,11 +4,11 @@ module Netzke
|
|
4
4
|
#
|
5
5
|
# Features:
|
6
6
|
# * dynamic loading of widgets
|
7
|
-
# * restoring of the last loaded widget
|
7
|
+
# * restoring of the last loaded widget (FIXME: not working for now)
|
8
8
|
# * authentification support
|
9
9
|
# * browser history support (press the "Back"-button to go to the previously loaded widget)
|
10
10
|
# * FeedbackGhost-powered feedback
|
11
|
-
# *
|
11
|
+
# * hosting widget's own menus
|
12
12
|
#
|
13
13
|
class BasicApp < Base
|
14
14
|
interface :app_get_widget # to dynamically load the widgets that are defined in initial_late_aggregatees
|
@@ -44,9 +44,11 @@ module Netzke
|
|
44
44
|
})
|
45
45
|
end
|
46
46
|
|
47
|
-
#
|
48
|
-
def
|
49
|
-
|
47
|
+
# Call appLoaded after the application is completely visible (e.g. load the initial widget, etc)
|
48
|
+
def js_after_constructor
|
49
|
+
<<-JS.l
|
50
|
+
this.on("afterlayout", function(){this.appLoaded();}, this, {single:true});
|
51
|
+
JS
|
50
52
|
end
|
51
53
|
|
52
54
|
# Set the Logout button if Netzke::Base.user is set
|
@@ -140,14 +142,6 @@ module Netzke
|
|
140
142
|
}
|
141
143
|
JS
|
142
144
|
|
143
|
-
# Work around to fire "appLoaded" event only once
|
144
|
-
:on_after_layout => <<-JS.l,
|
145
|
-
function(){
|
146
|
-
this.un('afterlayout', this.onAfterLayout, this); // avoid multiple calls
|
147
|
-
this.appLoaded();
|
148
|
-
}
|
149
|
-
JS
|
150
|
-
|
151
145
|
# Event handler for history change
|
152
146
|
:process_history => <<-JS.l,
|
153
147
|
function(token){
|
@@ -65,7 +65,7 @@ module Netzke
|
|
65
65
|
def initial_aggregatees_with_properties
|
66
66
|
res = initial_aggregatees_without_properties
|
67
67
|
# Add the accordion as aggregatee, which in its turn aggregates widgets from the configuration_widgets method
|
68
|
-
res.merge!(:properties => {:widget_class_name => '
|
68
|
+
res.merge!(:properties => {:widget_class_name => 'TabPanel', :items => configuration_widgets, :ext_config => {:title => false}, :late_aggregation => true}) if config[:ext_config][:config_tool]
|
69
69
|
res
|
70
70
|
end
|
71
71
|
|
data/lib/netzke/tab_panel.rb
CHANGED
@@ -1,7 +1,14 @@
|
|
1
1
|
module Netzke
|
2
2
|
#
|
3
|
-
#
|
3
|
+
# TabPanel
|
4
|
+
#
|
5
|
+
# Features:
|
6
|
+
# * Dynamically loads widgets for the tabs that get activated for the first time
|
7
|
+
# * Is loaded along with the active widget - saves a request to the server
|
4
8
|
#
|
9
|
+
# TODO:
|
10
|
+
# * Stores the last active tab in persistent_config
|
11
|
+
#
|
5
12
|
class TabPanel < Base
|
6
13
|
def self.js_base_class
|
7
14
|
"Ext.TabPanel"
|
@@ -10,42 +17,44 @@ module Netzke
|
|
10
17
|
def self.js_extend_properties
|
11
18
|
{
|
12
19
|
# loads widget into the panel if it wasn't loaded yet
|
13
|
-
:load_item_widget => <<-JS.l
|
20
|
+
:load_item_widget => <<-JS.l
|
14
21
|
function(panel) {
|
15
|
-
if (!panel.getWidget())
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
22
|
+
if (!panel.getWidget()) {
|
23
|
+
if (panel.id === this.id+"_active"){
|
24
|
+
// active widget only needs to be instantiated, as its class has been loaded already
|
25
|
+
var activeItemConfig = this.initialConfig[panel.widget+"Config"];
|
26
|
+
panel.add(new Ext.netzke.cache[activeItemConfig.widgetClassName](activeItemConfig));
|
27
|
+
panel.doLayout(); // always needed after adding a component
|
28
|
+
} else {
|
29
|
+
// load the widget from the server
|
30
|
+
panel.loadWidget(this.id + "__" + panel.widget + "__get_widget");
|
31
|
+
}
|
32
|
+
}
|
25
33
|
}
|
26
34
|
JS
|
27
35
|
}
|
28
36
|
end
|
29
37
|
|
30
38
|
def js_config
|
31
|
-
active_item_config = config[:items].
|
39
|
+
active_item_config = config[:items].detect{|i| i[:active]}
|
32
40
|
super.merge({
|
33
|
-
:
|
34
|
-
:
|
41
|
+
:items => fit_panels,
|
42
|
+
:active_tab => active_item_config && id_name + '_active'
|
35
43
|
})
|
36
44
|
end
|
37
45
|
|
38
46
|
# some configuration normalization
|
39
47
|
def initialize(*args)
|
40
48
|
super
|
41
|
-
|
49
|
+
|
50
|
+
# to remove duplicated active panels
|
42
51
|
seen_active = false
|
43
52
|
|
44
53
|
config[:items].each_with_index do |item, i|
|
45
|
-
# if
|
54
|
+
# if the item is provided without a name, give it a generated name
|
46
55
|
item[:name] ||= "item#{i}"
|
47
56
|
|
48
|
-
# remove
|
57
|
+
# remove duplicated "active" configuration
|
49
58
|
if item[:active]
|
50
59
|
item[:active] = nil if seen_active
|
51
60
|
seen_active = true
|
@@ -53,7 +62,7 @@ module Netzke
|
|
53
62
|
end
|
54
63
|
end
|
55
64
|
|
56
|
-
# the items are late aggregatees, besides the
|
65
|
+
# the items are late aggregatees, besides the one that is configured active
|
57
66
|
def initial_aggregatees
|
58
67
|
res = {}
|
59
68
|
config[:items].each_with_index do |item, i|
|
@@ -62,34 +71,31 @@ module Netzke
|
|
62
71
|
end
|
63
72
|
res
|
64
73
|
end
|
65
|
-
|
66
74
|
|
67
75
|
def self.js_default_config
|
68
76
|
super.merge({
|
69
|
-
:
|
70
|
-
:
|
71
|
-
:defaults => {:layout => 'fit'}, # all items will be of type Panel with layout 'fit'
|
77
|
+
:id_delimiter => "___", # the default is "__", and it conflicts with Netzke
|
78
|
+
:defaults => {:layout => 'fit'}, # all tabs will be Ext.Panel-s with layout 'fit' ("fit-panels")
|
72
79
|
:listeners => {
|
73
|
-
#
|
80
|
+
# when tab is activated, its content gets loaded from the server
|
74
81
|
:tabchange => {
|
75
82
|
:fn => <<-JS.l
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
}
|
83
|
+
function(self, tab){
|
84
|
+
this.loadItemWidget(tab);
|
85
|
+
}
|
80
86
|
JS
|
81
87
|
}
|
82
88
|
}
|
83
89
|
})
|
84
90
|
end
|
85
91
|
|
86
|
-
def
|
92
|
+
def fit_panels
|
87
93
|
res = []
|
88
94
|
config[:items].each_with_index do |item, i|
|
89
95
|
item_config = {
|
90
|
-
|
96
|
+
:id => item[:active] && id_name + '_active',
|
91
97
|
:title => item[:title] || (item[:name] && item[:name].humanize),
|
92
|
-
:
|
98
|
+
:widget => item[:name] # to know which fit-panel will load which widget
|
93
99
|
}
|
94
100
|
res << item_config
|
95
101
|
end
|
data/lib/netzke/table_editor.rb
CHANGED
data/netzke-basepack.gemspec
CHANGED
@@ -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.
|
5
|
+
s.version = "0.3.9"
|
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-
|
9
|
+
s.date = %q{2009-04-15}
|
10
10
|
s.description = %q{Base Netzke widgets - grid, form, tree, and more}
|
11
11
|
s.email = %q{sergei@writelesscode.com}
|
12
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/configuration_tool.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/xcheckbox.js", "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/property_editor.rb", "lib/netzke/property_editor_extras/helper_model.rb", "lib/netzke/tab_panel.rb", "lib/netzke/table_editor.rb", "lib/netzke/tree_panel.rb", "lib/netzke/wrapper.rb", "lib/netzke-basepack.rb", "LICENSE", "README.rdoc", "tasks/netzke_basepack_tasks.rake", "TODO"]
|
13
|
-
s.files = ["CHANGELOG", "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/configuration_tool.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/xcheckbox.js", "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/property_editor.rb", "lib/netzke/property_editor_extras/helper_model.rb", "lib/netzke/tab_panel.rb", "lib/netzke/table_editor.rb", "lib/netzke/tree_panel.rb", "lib/netzke/wrapper.rb", "lib/netzke-basepack.rb", "LICENSE", "Manifest", "
|
13
|
+
s.files = ["CHANGELOG", "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/configuration_tool.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/xcheckbox.js", "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/property_editor.rb", "lib/netzke/property_editor_extras/helper_model.rb", "lib/netzke/tab_panel.rb", "lib/netzke/table_editor.rb", "lib/netzke/tree_panel.rb", "lib/netzke/wrapper.rb", "lib/netzke-basepack.rb", "LICENSE", "Manifest", "Rakefile", "README.rdoc", "stylesheets/basepack.css", "tasks/netzke_basepack_tasks.rake", "test/accordion_panel_test.rb", "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/tab_panel_test.rb", "test/test_helper.rb", "TODO", "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"]
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.rubyforge_project = %q{netzke-basepack}
|
19
19
|
s.rubygems_version = %q{1.3.1}
|
20
20
|
s.summary = %q{Base Netzke widgets - grid, form, tree, and more}
|
21
|
-
s.test_files = ["test/ar_ext_test.rb", "test/border_layout_panel_test.rb", "test/grid_panel_test.rb", "test/netzke_basepack_test.rb"]
|
21
|
+
s.test_files = ["test/accordion_panel_test.rb", "test/ar_ext_test.rb", "test/border_layout_panel_test.rb", "test/grid_panel_test.rb", "test/netzke_basepack_test.rb", "test/tab_panel_test.rb"]
|
22
22
|
|
23
23
|
if s.respond_to? :specification_version then
|
24
24
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
require 'rubygems'
|
3
|
+
require 'netzke-core'
|
4
|
+
|
5
|
+
class AccordionPanelTest < ActiveSupport::TestCase
|
6
|
+
|
7
|
+
test "active item" do
|
8
|
+
accordion = Netzke::AccordionPanel.new(:items => [{
|
9
|
+
:widget_class_name => "Panel"
|
10
|
+
},{
|
11
|
+
:widget_class_name => "Panel", :name => "second_panel", :active => true
|
12
|
+
}])
|
13
|
+
|
14
|
+
assert_equal(2, accordion.initial_aggregatees.keys.size)
|
15
|
+
assert_equal("item0", accordion.aggregatees[:item0][:name])
|
16
|
+
assert_equal("second_panel", accordion.aggregatees[:second_panel][:name])
|
17
|
+
assert_equal("second_panel", accordion.js_config[:expanded_item])
|
18
|
+
assert_equal("Panel", accordion.js_config[:second_panel_config][:widget_class_name])
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
require 'rubygems'
|
3
|
+
require 'netzke-core'
|
4
|
+
|
5
|
+
class TabPanelTest < ActiveSupport::TestCase
|
6
|
+
|
7
|
+
test "active item" do
|
8
|
+
tab_panel = Netzke::TabPanel.new(:items => [{
|
9
|
+
:widget_class_name => "Panel"
|
10
|
+
},{
|
11
|
+
:widget_class_name => "Panel", :name => "second_panel", :active => true
|
12
|
+
}])
|
13
|
+
|
14
|
+
assert_equal(2, tab_panel.initial_aggregatees.keys.size)
|
15
|
+
assert_equal("item0", tab_panel.aggregatees[:item0][:name])
|
16
|
+
assert_equal("second_panel", tab_panel.aggregatees[:second_panel][:name])
|
17
|
+
assert(tab_panel.aggregatees[:second_panel][:active])
|
18
|
+
assert_equal("Panel", tab_panel.js_config[:second_panel_config][:widget_class_name])
|
19
|
+
end
|
20
|
+
|
21
|
+
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
|
+
version: 0.3.9
|
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-
|
12
|
+
date: 2009-04-15 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -116,11 +116,11 @@ files:
|
|
116
116
|
- lib/netzke-basepack.rb
|
117
117
|
- LICENSE
|
118
118
|
- Manifest
|
119
|
-
- netzke-basepack.gemspec
|
120
119
|
- Rakefile
|
121
120
|
- README.rdoc
|
122
121
|
- stylesheets/basepack.css
|
123
122
|
- tasks/netzke_basepack_tasks.rake
|
123
|
+
- test/accordion_panel_test.rb
|
124
124
|
- test/app_root/app/controllers/application.rb
|
125
125
|
- test/app_root/app/models/book.rb
|
126
126
|
- test/app_root/app/models/category.rb
|
@@ -162,9 +162,11 @@ files:
|
|
162
162
|
- test/grid_panel_test.rb
|
163
163
|
- test/netzke_basepack_test.rb
|
164
164
|
- test/schema.rb
|
165
|
+
- test/tab_panel_test.rb
|
165
166
|
- test/test_helper.rb
|
166
167
|
- TODO
|
167
168
|
- uninstall.rb
|
169
|
+
- netzke-basepack.gemspec
|
168
170
|
has_rdoc: true
|
169
171
|
homepage: http://writelesscode.com
|
170
172
|
post_install_message:
|
@@ -197,7 +199,9 @@ signing_key:
|
|
197
199
|
specification_version: 2
|
198
200
|
summary: Base Netzke widgets - grid, form, tree, and more
|
199
201
|
test_files:
|
202
|
+
- test/accordion_panel_test.rb
|
200
203
|
- test/ar_ext_test.rb
|
201
204
|
- test/border_layout_panel_test.rb
|
202
205
|
- test/grid_panel_test.rb
|
203
206
|
- test/netzke_basepack_test.rb
|
207
|
+
- test/tab_panel_test.rb
|