netzke-core 0.7.7 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +1 -2
- data/CHANGELOG.md +572 -0
- data/LICENSE +7 -1
- data/README.md +345 -29
- data/Rakefile +3 -3
- data/app/controllers/netzke_controller.rb +37 -48
- data/config/ci/before-travis.sh +3 -4
- data/javascripts/base.js +86 -150
- data/javascripts/ext.js +180 -210
- data/javascripts/{core_extensions.js → js_extensions.js} +0 -0
- data/lib/netzke-core.rb +16 -6
- data/lib/netzke/base.rb +84 -107
- data/lib/netzke/core.rb +7 -41
- data/lib/netzke/core/action_config.rb +37 -0
- data/lib/netzke/core/actions.rb +123 -0
- data/lib/netzke/core/client_class.rb +252 -0
- data/lib/netzke/core/component_config.rb +12 -0
- data/lib/netzke/core/composition.rb +274 -0
- data/lib/netzke/core/config_to_dsl_delegator.rb +69 -0
- data/lib/netzke/core/configuration.rb +63 -0
- data/lib/netzke/core/css_config.rb +51 -0
- data/lib/netzke/core/dynamic_assets.rb +19 -49
- data/lib/netzke/{embedding.rb → core/embedding.rb} +4 -6
- data/lib/netzke/core/endpoint_response.rb +15 -0
- data/lib/netzke/core/javascript.rb +111 -0
- data/lib/netzke/core/panel.rb +11 -0
- data/lib/netzke/{plugins.rb → core/plugins.rb} +10 -5
- data/lib/netzke/core/railz.rb +4 -0
- data/lib/netzke/{railz → core/railz}/action_view_ext.rb +22 -18
- data/lib/netzke/core/railz/action_view_ext/ext.rb +49 -0
- data/lib/netzke/core/railz/controller_extensions.rb +17 -0
- data/lib/netzke/core/railz/engine.rb +16 -0
- data/lib/netzke/core/railz/routes.rb +10 -0
- data/lib/netzke/core/ruby_ext.rb +5 -0
- data/lib/netzke/core/ruby_ext/array.rb +23 -0
- data/lib/netzke/core/ruby_ext/hash.rb +47 -0
- data/lib/netzke/{core_ext → core/ruby_ext}/string.rb +2 -7
- data/lib/netzke/core/ruby_ext/symbol.rb +13 -0
- data/lib/netzke/{core_ext → core/ruby_ext}/time_with_zone.rb +0 -0
- data/lib/netzke/core/services.rb +130 -0
- data/lib/netzke/core/session.rb +15 -19
- data/lib/netzke/core/state.rb +40 -0
- data/lib/netzke/core/stylesheets.rb +48 -0
- data/lib/netzke/core/version.rb +2 -2
- data/lib/netzke/plugin.rb +8 -11
- data/netzke-core.gemspec +69 -59
- data/test/core_test_app/Gemfile +2 -20
- data/test/core_test_app/Gemfile.lock +65 -74
- data/test/core_test_app/app/components/card_component_loader.rb +4 -4
- data/test/core_test_app/app/components/component_loader.rb +40 -120
- data/test/core_test_app/app/components/component_loader/javascripts/component_loader.js +49 -0
- data/test/core_test_app/app/components/component_with_actions.rb +61 -47
- data/test/core_test_app/app/components/component_with_custom_css.rb +8 -5
- data/test/core_test_app/app/components/component_with_js_mixin.rb +11 -5
- data/test/core_test_app/app/components/component_with_js_mixin/javascripts/extra_one.js +1 -1
- data/test/core_test_app/app/components/component_with_js_mixin/javascripts/extra_two.js +1 -1
- data/test/core_test_app/app/components/component_with_js_mixin/javascripts/method_set_one.js +1 -1
- data/test/core_test_app/app/components/component_with_nested_through.rb +2 -2
- data/test/core_test_app/app/components/component_with_prebuilt_toolbar_control.rb +12 -0
- data/test/core_test_app/app/components/component_with_prebuilt_toolbar_control/javascripts/component_with_prebuilt_toolbar_control.js +12 -0
- data/test/core_test_app/app/components/component_with_required_js.rb +24 -0
- data/test/core_test_app/app/components/configurable_on_class_level.rb +8 -0
- data/test/core_test_app/app/components/dsl_delegated_properties.rb +4 -0
- data/test/core_test_app/app/components/dsl_delegated_properties_base.rb +5 -0
- data/test/core_test_app/app/components/dynamic_tab_panel/javascripts/dynamic_tab_panel.js +2 -2
- data/test/core_test_app/app/components/ext_direct/composite.rb +32 -33
- data/test/core_test_app/app/components/ext_direct/details.rb +2 -4
- data/test/core_test_app/app/components/ext_direct/selector.rb +20 -22
- data/test/core_test_app/app/components/ext_direct/statistics.rb +2 -4
- data/test/core_test_app/app/components/extended_component_with_actions.rb +7 -3
- data/test/core_test_app/app/components/extended_component_with_js_mixin.rb +7 -4
- data/test/core_test_app/app/components/extended_component_with_js_mixin/javascripts/some_method_set.js +1 -1
- data/test/core_test_app/app/components/extended_server_caller.rb +20 -14
- data/test/core_test_app/app/components/hello_world.rb +23 -0
- data/test/core_test_app/app/components/hello_world/javascripts/hello_world.js +12 -0
- data/test/core_test_app/app/components/included.js +2 -2
- data/test/core_test_app/app/components/kinda_complex_component.rb +1 -3
- data/test/core_test_app/app/components/kinda_complex_component/basic_stuff.rb +15 -17
- data/test/core_test_app/app/components/kinda_complex_component/extra_stuff.rb +4 -5
- data/test/core_test_app/app/components/loader_of_component_with_custom_css.rb +14 -5
- data/test/core_test_app/app/components/localized_panel.rb +23 -25
- data/test/core_test_app/app/components/multipane_component_loader.rb +19 -20
- data/test/core_test_app/app/components/nested_component.rb +4 -5
- data/test/core_test_app/app/components/panel_with_plugin.rb +8 -3
- data/test/core_test_app/app/components/panel_with_tools.rb +15 -14
- data/test/core_test_app/app/components/plugin_with_components.rb +20 -12
- data/test/core_test_app/app/components/scoped_components/deep_scoped_components/some_deep_scoped_component.rb +5 -2
- data/test/core_test_app/app/components/scoped_components/extended_scoped_component.rb +5 -2
- data/test/core_test_app/app/components/scoped_components/some_scoped_component.rb +5 -2
- data/test/core_test_app/app/components/server_caller.rb +39 -17
- data/test/core_test_app/app/components/server_caller/javascripts/server_caller.js +42 -0
- data/test/core_test_app/app/components/server_counter.rb +18 -82
- data/test/core_test_app/app/components/server_counter/javascripts/server_counter.js +53 -0
- data/test/core_test_app/app/components/simple_authentication_component.rb +46 -0
- data/test/core_test_app/app/components/simple_component.rb +8 -3
- data/test/core_test_app/app/components/simple_composite.rb +12 -0
- data/test/core_test_app/app/components/simple_form_with_file_upload.rb +49 -0
- data/test/core_test_app/app/components/simple_panel.rb +2 -2
- data/test/core_test_app/app/components/simple_tab_panel.rb +24 -3
- data/test/core_test_app/app/components/simple_window.rb +4 -2
- data/test/core_test_app/app/components/some_composite.rb +77 -48
- data/test/core_test_app/app/components/some_plugin.rb +31 -30
- data/test/core_test_app/app/components/stateful_component.rb +46 -0
- data/test/core_test_app/app/components/stateful_component_with_shared_state.rb +11 -0
- data/test/core_test_app/app/components/window_with_simple_component.rb +14 -0
- data/test/core_test_app/app/views/layouts/application.html.erb +1 -1
- data/test/core_test_app/app/views/simple_rails/multiple_nested.html.erb +7 -19
- data/test/core_test_app/app/views/simple_rails/panel.html.erb +1 -0
- data/test/core_test_app/config/database.yml.travis +3 -5
- data/test/core_test_app/config/environments/production.rb +1 -1
- data/test/core_test_app/config/initializers/netzke.rb +3 -1
- data/test/core_test_app/config/locales/en.yml +9 -4
- data/test/core_test_app/config/locales/es.yml +4 -2
- data/test/core_test_app/config/routes.rb +2 -8
- data/test/core_test_app/db/schema.rb +3 -11
- data/test/core_test_app/features/actions_and_tools.feature +1 -0
- data/test/core_test_app/features/client-server.feature +7 -0
- data/test/core_test_app/features/component_loader.feature +13 -13
- data/test/core_test_app/features/composition.feature +14 -0
- data/test/core_test_app/features/config_to_dsl_delegation.feature +10 -0
- data/test/core_test_app/features/file_inclusion.feature +1 -1
- data/test/core_test_app/features/i18n.feature +4 -4
- data/test/core_test_app/features/js_include.feature +1 -1
- data/test/core_test_app/features/persistence.feature +21 -5
- data/test/core_test_app/features/step_definitions/generic_steps.rb +14 -0
- data/test/core_test_app/features/support/paths.rb +0 -3
- data/test/core_test_app/public/images/icons/accept.png +0 -0
- data/test/core_test_app/public/images/icons/anchor.png +0 -0
- data/test/core_test_app/public/images/icons/tick.png +0 -0
- data/test/core_test_app/spec/action_config_spec.rb +15 -0
- data/test/core_test_app/spec/{component/actions_spec.rb → actions_spec.rb} +38 -36
- data/test/core_test_app/spec/base_spec.rb +35 -0
- data/test/core_test_app/spec/client_class_spec.rb +17 -0
- data/test/core_test_app/spec/component +0 -0
- data/test/core_test_app/spec/composition_spec.rb +118 -0
- data/test/core_test_app/spec/core_ext_spec.rb +3 -14
- data/test/core_test_app/spec/endpoint_response_spec.rb +17 -0
- data/test/core_test_app/spec/javascript_spec.rb +33 -0
- data/test/core_test_app/spec/js_class_config_scope.rb +37 -0
- data/test/core_test_app/spec/panel_spec.rb +11 -0
- data/test/core_test_app/spec/services_spec.rb +16 -0
- data/test/core_test_app/spec/state_spec.rb +20 -0
- data/test/unit/core_ext_test.rb +0 -53
- data/test/unit/netzke_core_test.rb +11 -11
- metadata +76 -62
- data/CHANGELOG.rdoc +0 -325
- data/javascripts/touch.js +0 -58
- data/lib/netzke/actions.rb +0 -107
- data/lib/netzke/composition.rb +0 -224
- data/lib/netzke/config_to_dsl_delegator.rb +0 -43
- data/lib/netzke/configuration.rb +0 -195
- data/lib/netzke/core/masquerading.rb +0 -34
- data/lib/netzke/core_ext.rb +0 -6
- data/lib/netzke/core_ext/array.rb +0 -30
- data/lib/netzke/core_ext/hash.rb +0 -86
- data/lib/netzke/core_ext/symbol.rb +0 -21
- data/lib/netzke/ext_component.rb +0 -25
- data/lib/netzke/inheritance.rb +0 -31
- data/lib/netzke/javascript.rb +0 -382
- data/lib/netzke/javascript/scopes.rb +0 -39
- data/lib/netzke/railz.rb +0 -4
- data/lib/netzke/railz/action_view_ext/ext.rb +0 -64
- data/lib/netzke/railz/action_view_ext/touch.rb +0 -52
- data/lib/netzke/railz/controller_extensions.rb +0 -33
- data/lib/netzke/railz/engine.rb +0 -48
- data/lib/netzke/railz/routes.rb +0 -7
- data/lib/netzke/services.rb +0 -101
- data/lib/netzke/session.rb +0 -54
- data/lib/netzke/state.rb +0 -91
- data/lib/netzke/stylesheets.rb +0 -65
- data/test/core_test_app/app/components/component_with_included_js.rb +0 -16
- data/test/core_test_app/app/components/component_with_session_persistence.rb +0 -35
- data/test/core_test_app/app/components/deprecated/server_caller.rb +0 -20
- data/test/core_test_app/app/components/dynamic_tab_panel.rb +0 -19
- data/test/core_test_app/app/components/hello_world_component.rb +0 -31
- data/test/core_test_app/app/components/touch/hello_world_component.rb +0 -25
- data/test/core_test_app/app/components/touch/server_caller.rb +0 -28
- data/test/core_test_app/app/components/touch/simple_carousel.rb +0 -17
- data/test/core_test_app/app/controllers/touch_controller.rb +0 -6
- data/test/core_test_app/app/helpers/touch_helper.rb +0 -2
- data/test/core_test_app/app/views/layouts/touch.html.erb +0 -13
- data/test/core_test_app/db/migrate/20110110132720_create_netzke_component_states.rb +0 -20
- data/test/core_test_app/features/step_definitions/touch_steps.rb +0 -3
- data/test/core_test_app/features/touch.feature +0 -10
- data/test/core_test_app/gemfiles/rails3_1.gemfile +0 -16
- data/test/core_test_app/gemfiles/rails3_2.gemfile +0 -16
- data/test/core_test_app/spec/component/base_spec.rb +0 -36
- data/test/core_test_app/spec/component/component_spec.rb +0 -20
- data/test/core_test_app/spec/component/composition_spec.rb +0 -132
- data/test/core_test_app/spec/component/configuration_spec.rb +0 -61
- data/test/core_test_app/spec/component/javascript_spec.rb +0 -16
- data/test/core_test_app/spec/component/state_spec.rb +0 -18
data/CHANGELOG.rdoc
DELETED
@@ -1,325 +0,0 @@
|
|
1
|
-
= v0.7.7 - 2012-10-20
|
2
|
-
* Ext JS required version bump (4.1.x)
|
3
|
-
|
4
|
-
= v0.7.6 - 2012-07-27
|
5
|
-
* Rails 3.2
|
6
|
-
|
7
|
-
= v0.7.5 - 2012-03-05
|
8
|
-
* API changes
|
9
|
-
* The :class_name option must *always* include the full class name now. So, "Basepack::GridPanel" won't work, instead do "Netzke::Basepack::GridPanel"
|
10
|
-
|
11
|
-
* enhancements
|
12
|
-
* Set default Ext.Direct retry attempts to 0, as more than 0 may only be needed in special cases.
|
13
|
-
|
14
|
-
= v0.7.4 - 2011-10-20
|
15
|
-
* enhancements
|
16
|
-
* Less aggressive rescuing at constantizing a string, to let more descriptive exceptions get through.
|
17
|
-
* New +delegates_to_dsl+ class method to degelate default config options to class level. See the +ConfigToDslDelegator+ module.
|
18
|
-
|
19
|
-
= v0.7.3 - 2011-09-04
|
20
|
-
* Rails 3.1 compatibility. Really. Hopefully.
|
21
|
-
|
22
|
-
= v0.7.2 - 2011-08-31
|
23
|
-
* Rails 3.1
|
24
|
-
* bug fix
|
25
|
-
* When a component is dynamically loaded in a container, the load mask is now limited to that container
|
26
|
-
* enhancements
|
27
|
-
* New +append+ config option for loadNetzkeComponent, which prevents emptying the container when inserting the newly loaded component; can be used for loading components into layouts different from 'fit'
|
28
|
-
|
29
|
-
= v0.7.1 - 2011-08-17
|
30
|
-
* bug fix
|
31
|
-
* Multiple compound Netzke components in the same Rails view were causing JS errors
|
32
|
-
|
33
|
-
= v0.7.0 - 2011-08-09
|
34
|
-
* Ext JS 4 compatibility
|
35
|
-
|
36
|
-
* API changes
|
37
|
-
* New +ext_uri+ config option (defaults to "extjs") - relative URI to the Ext JS library on the server.
|
38
|
-
* New +ext3_compat_uri+ config option (defaults to +nil+) - relative URI to the Ext 3 compatibility layer. When nil, no compatibility layer is loaded.
|
39
|
-
* New +current_user_method+ config option (defaults to :current_user) to let Netzke::Core know which method to call on Rails controller to retrieve the current user.
|
40
|
-
* New +Netzke::Core.current_user+ method to retrieve the current user.
|
41
|
-
* Passing instructions from server back to the client now is only meant for single-argument methods on client; arrays are not expanded into arguments any longer.
|
42
|
-
* New +instantiateChildNetzkeComponent+ method to instantiate a Netzke component by name.
|
43
|
-
* Default component height (400) and border (false) are no longer set.
|
44
|
-
|
45
|
-
* broken API
|
46
|
-
* The +ext_location+ config option renamed to +ext_path+
|
47
|
-
* loadNetzkeComponent (ex loadComponent) won't automatically show a component with xtype 'window' any longer; use the callback to do that manually
|
48
|
-
|
49
|
-
* enhancements
|
50
|
-
* +js_mixin+ without parameters will assume :component_class_name_underscored
|
51
|
-
* Ext locale file is automatically included when I18n.locale is not :en
|
52
|
-
* Child components now have +itemId+ set to component's name, so that +getComponent(component_name)+ can be used to retrieve immediate child components
|
53
|
-
* +loadNetzkeComponent+ that should be used instead of loadComponent won't render the loaded component unless the container is specified (which can be an id or an instance)
|
54
|
-
* JS: +componentDeliveryFailed+ method added that is called by the +deliver_component+ endpoint
|
55
|
-
|
56
|
-
* bug fix
|
57
|
-
* Tolerate relative_url_root when calculating the URI to icons in actions
|
58
|
-
|
59
|
-
* deprecations
|
60
|
-
* instantiateAndRenderComponent
|
61
|
-
* getParent in favor of getParentNetzkeComponent
|
62
|
-
* getChildComponent in favor of getChildNetzkeComponent
|
63
|
-
* loadComponent in favor of loadNetzkeComponent
|
64
|
-
* feedback in favor of netzkeFeedback
|
65
|
-
* Ext.container.Container#instantiateChild should not be used
|
66
|
-
|
67
|
-
= v0.6.7 - 2011-08-16
|
68
|
-
* enhancements
|
69
|
-
* No more using +method_missing+ for invoking endpoints.
|
70
|
-
* New "cache" option for +netzke_init+ which gets passed to +javascript_include_tag+ (no support for css caching of this type yet)
|
71
|
-
* Netzke dynamic js and css-files such as ext.js, touch.css, now get generated at the application start, and put into "public/netzke". Solves a long standing problem with serving those files by HTTP servers in some cases. Enables caching naturally.
|
72
|
-
* Moved features and specs to test/core_test_app (tests should be run from that folder from now on)
|
73
|
-
* Introduced plugin functionality. We can create Netzke components that are pluggable into other components as Ext JS plugins.
|
74
|
-
|
75
|
-
= v0.6.6 - 2011-02-26
|
76
|
-
* enhancements
|
77
|
-
* Client-server communication is updated to use Ext.Direct (many thanks to @pschyska)
|
78
|
-
* Introduced +js_translate+ class method that allows specifying i18n properties used in the JavaScript class
|
79
|
-
* Better handling of actions i18n
|
80
|
-
* New +Netzke::Base.class_config_option+ method to specify a class-level configuration options for a component, e.g. (in GridPanel): +class_config_option :column_filters_available, true+. This option then can be set in Rails application configuration, e.g.: `config.netzke.basepack.grid_panel.column_filters_available = false`, or directly on `Netzke::Core.config`, e.g.: `Netzke::Core.config.netzke.basepack.grid_panel.column_filters_available = false`.
|
81
|
-
|
82
|
-
= v0.6.5 - 2011-01-14
|
83
|
-
* enhancements
|
84
|
-
* Various fixes for IE
|
85
|
-
* Support for Sencha Touch
|
86
|
-
* An endpoint can now "call" JavaScript functions that accept multiple parameters, by specifying an array, e.g.:
|
87
|
-
{:some_js_function => [arg1, arg2]}
|
88
|
-
* New API: +js_mixin+ method to "mixin" JavaScript objects from external files (see RDocs).
|
89
|
-
* New JS class +componentLoadMask+ property to configure a mask when a component gets dynamically loaded with +loadComponent+. Accepts the same configuration as Ext.LoadMask.
|
90
|
-
* +js_include+ and +css_include+ accept both symbols and strings, where strings would contain full paths to the included file, whereas symbols get expanded to full paths following simple conventions (see RDocs for details).
|
91
|
-
* Make some of +Netzke::Core+ setup happen earlier in the loading process, so that we can safely use it while defining components.
|
92
|
-
* Performance improvements by memoizing +Base.constantize_class_name+.
|
93
|
-
* I18n for actions, see +Netzke::Actions+.
|
94
|
-
|
95
|
-
* bug fix
|
96
|
-
* The "componentload" event now gets fired after a component is dynamically loaded. The handler receives the instance of the loaded component.
|
97
|
-
* Feedback does not insert a new div every time being called
|
98
|
-
* JS class caching was broken for name-scoped classes
|
99
|
-
* When a component was dynamically loaded into a hidden container, it wasn't shown when the container got shown next time
|
100
|
-
|
101
|
-
= v0.6.4 - 2010-11-05
|
102
|
-
* enhancements
|
103
|
-
* Implemented Netzke.isLoading(), useful for testing
|
104
|
-
* Persistence support
|
105
|
-
|
106
|
-
* API change
|
107
|
-
* +endpoint+ DSL call now results in a method called <endpoint_name>_endpoint, _not_ just <endpoint_name> (beware when overriding endpoint definitions, or calling endpoint methods on child components)
|
108
|
-
* Using +api+ for endpoint declaration is gone
|
109
|
-
|
110
|
-
= v0.6.3 - 2010-11-02
|
111
|
-
* The +ext_config+ option is back, deprecated.
|
112
|
-
|
113
|
-
= v0.6.2 - 2010-10-27
|
114
|
-
* Introduced the Symbol#component method to declare components in the config (instead of now deprecated js_component).
|
115
|
-
|
116
|
-
= v0.6.1 - 2010-10-26
|
117
|
-
* Disabled buggy implementation of rendering on-page JS classes in netzke.js instead of main page.
|
118
|
-
|
119
|
-
= v0.6.0 - 2010-10-24
|
120
|
-
* Rails3 compatibility, thorough rewrite
|
121
|
-
* Much more thorough testing
|
122
|
-
|
123
|
-
* API backward incompatibility
|
124
|
-
* +ext_config+ config level is removed; put all that configuration in the top level
|
125
|
-
* mentioning actions in the +bbar+, +tbar+, etc, should be explicit, e.g.:
|
126
|
-
|
127
|
-
:bbar => [:apply.action, :delete.action]
|
128
|
-
|
129
|
-
* +late_aggregatee+ is now +lazy_loading+
|
130
|
-
* +aggregatees+ are now +components+
|
131
|
-
* +widgets+ are now +components+, too
|
132
|
-
* +api+ is now +endpoint+
|
133
|
-
* +persistent_config_enabled?+ is now +persistence_enabled?+
|
134
|
-
* Using the +js_extend_properties+ class method in your components in deprecated (and maybe even broken). Use +js_property+ (or +js_properties+) and +js_method+ instead (see multiple examples in test/core_test_app)
|
135
|
-
* the +load_component_with_cache+ endpoint renamed to +deliver_component+
|
136
|
-
|
137
|
-
* New
|
138
|
-
* +ext+ helper in the views to embed any (pure) Ext component into a view
|
139
|
-
* +component+ DSL method to declare child components
|
140
|
-
* +config+ DSL method to set the configuration of an instance
|
141
|
-
* +action+ DSL method to configure actions
|
142
|
-
* +js_method+ DSL method to define (public) methods in JS class
|
143
|
-
* +js_property+ DSL method to define (public) properties in JS class
|
144
|
-
* +endpoint+ DSL method to define server endpoints
|
145
|
-
|
146
|
-
* Different deprecations throughout the code
|
147
|
-
|
148
|
-
= v0.5.3 - 2010-06-14
|
149
|
-
* Fix: Getting rid of deprecation warnings about tasks not sitting in lib.
|
150
|
-
|
151
|
-
= v0.5.2 - 2010-06-11
|
152
|
-
* Ext 3.2.1
|
153
|
-
* Fix: Netzke::Base.before_load is now also called for the widgets embedded directly into a view.
|
154
|
-
* New: support for external stylesheets.
|
155
|
-
* Fix: the "value" column type has been changed to text to prevent migration problems is some cases
|
156
|
-
* New: global_persistent_config method allows accessing persistent storage with no owner (widget) assigned
|
157
|
-
* New: any widget can now implement <tt>before_api_call</tt> interceptor. If it returns anything but empty hash, it'll be used as the result of *any* API call to this widget. The interceptor receives as parameter the name of the API call issued and the arguments. Use it to implement authorization.
|
158
|
-
* Fix: got the Ext's state provider out of the way (thank you for all the confusion)
|
159
|
-
|
160
|
-
= v0.5.1 - 2010-02-26
|
161
|
-
* Compatibility with Ext 3.1.1
|
162
|
-
* New: <tt>Netzke.page</tt> object now contains all the widgets declared on the page
|
163
|
-
* Code: replaced (references to) deprecated function names
|
164
|
-
|
165
|
-
= v0.5.0 - 2010-01-10
|
166
|
-
* Compatibility with Ext 3.1.0
|
167
|
-
* API change: Netzke widget's now should be declared directly in the views instead of controllers.
|
168
|
-
* API change: all ExtJS and Netzke JavaScript and styles are now loaded with the help of <tt>netzke_init</tt> helper.
|
169
|
-
* API change: <tt>persistence_key</tt> option replaces <tt>persistent_config_id</tt> option.
|
170
|
-
* Impr: headers in panels in the "config" mode now show the widget's global ID.
|
171
|
-
* New: required ExtJS version check introduced at initial Netzke load.
|
172
|
-
* Depr: :widget_class_name option is deprecated, use :class_name.
|
173
|
-
* DRY: now there's no need to always define "actions" method, use it to override the defaults, which are automatically calculated based on configuration for toolbars/menu.
|
174
|
-
* Impr: each generated JS class now has its unique xtype, e.g. "netzkegridpanel".
|
175
|
-
* Fix: FeedbackGhost moved over from netzke-basepack.
|
176
|
-
|
177
|
-
= v0.4.5.2 - 2009-11-09
|
178
|
-
* Fix: Hash#convert_keys and Array#convert_keys in core extensions are now renamed into deep_convert_keys, and now always plainly do what they're expected to do: recursively convert keys according to given block.
|
179
|
-
|
180
|
-
= v0.4.5.1 - 2009-11-09
|
181
|
-
* Regression: fixing inheritance and caching.
|
182
|
-
* FeedbackGhost is too simple to be a Netzke widget (having no server part), so, moved to static JavaScript.
|
183
|
-
|
184
|
-
= v0.4.5 - 2009-11-08
|
185
|
-
* API change: Netzke::Base: <tt>id_name</tt> accessor renamed to <tt>global_id</tt>
|
186
|
-
* Code: several internal code changes
|
187
|
-
* Code: lightly better test coverage
|
188
|
-
* New: <tt>Netzke::Base#global_id_by_reference</tt> method
|
189
|
-
* Compatibility: resolving conflicts with the <tt>api</tt> property in some Ext v3.0 components
|
190
|
-
* Fix: <tt>deliver_component</tt> was throwing exception when the requested component wasn't defined
|
191
|
-
* New: <tt>persistent_config_id</tt> configuration option allows specifying an id by which persistent configuration is identified for the widget. Handy if different homogeneous widgets need to share the same persistent configuration.
|
192
|
-
* New: <tt>Netzke::Base#persistent_config</tt> method now accepts an optional boolean parameter signalizing that the configuration is global (not bound to a widget)
|
193
|
-
* Impr: cleaner handling of actions and toolbars; fbar configuration introduced.
|
194
|
-
* Impr: calling an API method now provides for the result value (if return by the server) in the callback.
|
195
|
-
* Impr: allows name spaced creation of Netzke widgets, e.g. widgets can now be defined under any module under Netzke, not only *directly* under Netzke.
|
196
|
-
* New: support for Ext.Window-based widgets (it'll call show() on them when the "*_widget_render" helper is used).
|
197
|
-
|
198
|
-
= v0.4.4 - 2009-10-12
|
199
|
-
* API change: default handlers for actions and tools are now supposed to be prefixed with "on". E.g.: if you declare an action named <tt>clear_table</tt>, the handler must be called (in Ruby) <tt>on_clear_table</tt> (mapped to <tt>onClearTable</tt> in JavaScript).
|
200
|
-
* Internal: the JavaScript instance now knows if persistent config is enabled (by checking this.persistentConfig).
|
201
|
-
* Fix: solving the "Node cannot be inserted at the specified point in the hierarchy" problem by being more strict with duplicated IDs for elements on the same page.
|
202
|
-
* Fix: Ext 3.0 compatibility.
|
203
|
-
* Impr: <tt>getChildComponent</tt> now allows referring to a widget like this: "parent__parent__some_widget__some_nested_widget"
|
204
|
-
|
205
|
-
= v0.4.3
|
206
|
-
* Fix: reworking loadComponent()-related code, closing a security flaw when a malicious browser could send any configuration options to instantiate the widget being loaded.
|
207
|
-
|
208
|
-
= v0.4.2 - 2009-09-11
|
209
|
-
* Fix: the API call (at the JavaScript side) was ignoring the callback parameter.
|
210
|
-
* Impr: if the array of API points is empty, it's not added into js_config anymore.
|
211
|
-
* New: new testing widgets in netzke_controller.
|
212
|
-
* Fix: extra CSS includes now take effect.
|
213
|
-
* New: Support for masquerading as "World". In this mode all the "touched" persistent preferences will be overwritten for all roles and users.
|
214
|
-
|
215
|
-
= v0.4.1 - 2009-09-06
|
216
|
-
* Version bumb to force github rebuild the gem (Manifest is now included)
|
217
|
-
|
218
|
-
= v0.4.0 - 2009-09-05
|
219
|
-
* Major refactoring.
|
220
|
-
|
221
|
-
= v0.3.2 - 2009-06-05
|
222
|
-
* Netzke doesn't overwrite session[:user] anymore to not cause authentication-related problems.
|
223
|
-
|
224
|
-
= v0.3.1 - 2009-05-07
|
225
|
-
* Fix: persistent_config_manager can now be set to nil, and it will work fine
|
226
|
-
|
227
|
-
= v0.3.0 - 2009-05-07
|
228
|
-
* Refactor: got rid of NetzkeLayout model, now all layouts are stored in netzke_preferences
|
229
|
-
* New: persistent_config now has a method for_widget that accepts a block
|
230
|
-
* autotest compatibility
|
231
|
-
* New: String#to_b converts a string to true/false
|
232
|
-
* New: Netzke::Base.session introduced for session data
|
233
|
-
* New: weak_children_config and strong_children_config can now be declared by a widget, which specifies weak and strong configuration that every child of this widget will receive (e.g. display/hide configuration tool)
|
234
|
-
* Fix: (degradation) flash message is now shown again in case of erroneous attempt to load a widge
|
235
|
-
* New: widgets now can check session[:netzke_just_logged_in] and session[:netzke_just_logged_out] automatically set by Netzke after login/logout
|
236
|
-
|
237
|
-
= v0.2.11
|
238
|
-
* Introduction of getOwnerComponent()-method to Ext.Component. It provides the Netzke widget this Component belongs to.
|
239
|
-
|
240
|
-
= v0.2.10
|
241
|
-
* Removed dependency on 'json' gem.
|
242
|
-
* Rails v2.3.2 compatibility.
|
243
|
-
|
244
|
-
= v0.2.9
|
245
|
-
* Actions, toolbars and tools reworked for easier configuration.
|
246
|
-
* Menus introduced (based on actions).
|
247
|
-
* Significant code clean-up.
|
248
|
-
* Bug fix (nasty one): Ext.widgetMixIn was getting messed up along with dynamic widget loading.
|
249
|
-
* Must work in IE now.
|
250
|
-
|
251
|
-
= v0.2.8
|
252
|
-
* Support for extra javascripts and stylesheets per widget.
|
253
|
-
|
254
|
-
= v0.2.7
|
255
|
-
* QuickTips get initialized now, as otherwise Ext 2.2.1 doesn't properly destroy() BoxComponents for me.
|
256
|
-
|
257
|
-
= v0.2.6
|
258
|
-
* FeedackGhost is now capable of displaying multiple flash messages.
|
259
|
-
* Dependencies slightly refactored.
|
260
|
-
* An informative exception added to Base#component_instance.
|
261
|
-
* JS-level inheritance enabled.
|
262
|
-
* Work-around for the problem with Ext 2.2.1 in loadComponent.
|
263
|
-
* Events "<action_id>click" added to the widgets along with the actions.
|
264
|
-
* component_missing method added to Netzke::Base - called when a non-existing aggregate of a widget is tried to be invoked
|
265
|
-
* Code readability improvements.
|
266
|
-
|
267
|
-
= v0.2.5
|
268
|
-
* Minor code restructuring.
|
269
|
-
|
270
|
-
= v0.2.4
|
271
|
-
* Some minor improvements.
|
272
|
-
|
273
|
-
= v0.2.3
|
274
|
-
* FeedbackGhost will show the feedback on the top of the screen independent of the page scrolling.
|
275
|
-
* Ext.Panel#loadComponent will accept null as url to delete the currently loaded widget
|
276
|
-
* Bug fix: persistent_config works again
|
277
|
-
|
278
|
-
= v0.2.2
|
279
|
-
* js_ext_config instance method added for overwriting
|
280
|
-
* Multiuser support
|
281
|
-
* Using Rails.logger for logging
|
282
|
-
* "config"-class method for every class inheriting Netzke::Base - for class-level configurations
|
283
|
-
|
284
|
-
= v0.2.1
|
285
|
-
* Fixed the path to ext-base-min.js for production mode.
|
286
|
-
* Also works in Safari now.
|
287
|
-
|
288
|
-
= v0.2.0
|
289
|
-
* Some re-factoring and redesign. Now simple compound widgets can be created on the fly in the controller
|
290
|
-
* Added ext_widget[:quiet] configuration option to suppress widget's feedback
|
291
|
-
* Support for extra CSS sources, similar to JS
|
292
|
-
* NETZKE_BOOT_CONFIG introduced to specify which Netzke functionality should be disabled to reduce the size of /netzke/netzke.[js|css]
|
293
|
-
* FeedbackGhost widget added - invisible widget providing feedback to the user
|
294
|
-
* netzke_widget controller class-method renamed into netzke
|
295
|
-
* JS-comments now get stripped also from the extra files that get included in the netzke-* gems.
|
296
|
-
* Permissions joined js_config
|
297
|
-
* Bug fixes
|
298
|
-
|
299
|
-
= v0.1.4
|
300
|
-
* Helpers added to facilitate ExtJS/netzke.js inclusion
|
301
|
-
* The route defined for netzke_controller
|
302
|
-
* netzke.html.erb-layout is not needed anymore, so not produced by the generator
|
303
|
-
* Now compliant with Rails' forgery protection
|
304
|
-
|
305
|
-
= v0.1.3
|
306
|
-
* Generators fixed
|
307
|
-
|
308
|
-
= v0.1.2
|
309
|
-
* Fixed the bug with <widget>_class_definition returning empty string on sequential loading.
|
310
|
-
|
311
|
-
= v0.1.1.1
|
312
|
-
* Meta: moving from GitHub to RubyForge
|
313
|
-
|
314
|
-
= v0.1.1
|
315
|
-
* Inter-widget dependencies code reworked
|
316
|
-
* JS-class code generation code slightly reworked
|
317
|
-
|
318
|
-
= v0.1.0.2
|
319
|
-
* Meta: fix outdated Manifest
|
320
|
-
|
321
|
-
= v0.1.0.1
|
322
|
-
* Meta work: replacing underscore with dash in the name
|
323
|
-
|
324
|
-
= v0.1.0 - 2008-12-11
|
325
|
-
* Initial release
|
data/javascripts/touch.js
DELETED
@@ -1,58 +0,0 @@
|
|
1
|
-
Ext.ns("Netzke.classes.Core");
|
2
|
-
Ext.apply(Netzke.classes.Core.Mixin, {
|
3
|
-
/* initComponent common for all Netzke components */
|
4
|
-
initComponentWithNetzke: function(){
|
5
|
-
this.detectActions(this);
|
6
|
-
|
7
|
-
this.detectComponents(this.items);
|
8
|
-
|
9
|
-
this.processEndpoints();
|
10
|
-
|
11
|
-
// This is where the references to different callback functions will be stored
|
12
|
-
this.callbackHash = {};
|
13
|
-
|
14
|
-
// Call the original initComponent
|
15
|
-
this.initComponentWithoutNetzke();
|
16
|
-
},
|
17
|
-
|
18
|
-
/*
|
19
|
-
Dynamically creates methods for api points, so that we could later call them like: this.myEndpointMethod()
|
20
|
-
*/
|
21
|
-
processEndpoints: function(){
|
22
|
-
var endpoints = this.endpoints || [];
|
23
|
-
endpoints.push('deliver_component'); // all Netzke components get this endpoint
|
24
|
-
Ext.each(endpoints, function(intp){
|
25
|
-
this[intp.camelize(true)] = function(args, callback, scope){ this.callServer(intp, args, callback, scope); }
|
26
|
-
}, this);
|
27
|
-
},
|
28
|
-
|
29
|
-
/*
|
30
|
-
Detects action configs in the passed object, and replaces them with instances of Ext.Action created by normalizeActions().
|
31
|
-
This detects action in arbitrary level of nesting, which means you can put any other components in your toolbar, and inside of them specify menus/items or even toolbars.
|
32
|
-
*/
|
33
|
-
detectActions: function(o){
|
34
|
-
if (Ext.isObject(o)) {
|
35
|
-
if ((typeof o.handler === 'string') && Ext.isFunction(this[o.handler.camelize(true)])) {
|
36
|
-
// This button config has a handler specified as string - replace it with reference to a real function if it exists
|
37
|
-
o.handler = this[o.handler.camelize(true)];
|
38
|
-
o.scope = this;
|
39
|
-
}
|
40
|
-
// TODO: this should be configurable!
|
41
|
-
Ext.each(["items", "dockedItems"], function(key){
|
42
|
-
if (o[key]) {
|
43
|
-
var items = [].concat(o[key]); // we need to do it in order to esure that this instance has a separate bbar/tbar/etc, NOT shared via class' prototype
|
44
|
-
delete(o[key]);
|
45
|
-
o[key] = items;
|
46
|
-
this.detectActions(o[key]);
|
47
|
-
}
|
48
|
-
}, this);
|
49
|
-
} else if (Ext.isArray(o)) {
|
50
|
-
var a = o;
|
51
|
-
Ext.each(a, function(el, i){
|
52
|
-
if (Ext.isObject(el)) {
|
53
|
-
this.detectActions(el);
|
54
|
-
}
|
55
|
-
}, this);
|
56
|
-
}
|
57
|
-
}
|
58
|
-
});
|
data/lib/netzke/actions.rb
DELETED
@@ -1,107 +0,0 @@
|
|
1
|
-
module Netzke
|
2
|
-
# Netzke components allow specifying Ext actions (see http://dev.sencha.com/deploy/dev/docs/?class=Ext.Action)
|
3
|
-
#
|
4
|
-
# == Defining actions in a component
|
5
|
-
# The 2 ways to define an action are:
|
6
|
-
# * as a hash, e.g:
|
7
|
-
#
|
8
|
-
# action :bug_server, :text => "Call server", :icon => :phone
|
9
|
-
#
|
10
|
-
# (if the same action was defined in the super class, the superclass's definition get merged with the current definition)
|
11
|
-
#
|
12
|
-
# * as a block, in case you need access to the component's instance, e.g.:
|
13
|
-
# action :bug_server do
|
14
|
-
# {:text => config[:text], :disabled => true}
|
15
|
-
# end
|
16
|
-
#
|
17
|
-
# Both of the ways result in a definition of an instance method named {action_name}_action. So, overriding an action in the child class is done be redefining the method, e.g.:
|
18
|
-
#
|
19
|
-
# def bug_server_action
|
20
|
-
# # super will have the superclass's action definition
|
21
|
-
# end
|
22
|
-
#
|
23
|
-
# == I18n of actions
|
24
|
-
# The text and tooltip for an action will be automatically picked up from a locale file when possible.
|
25
|
-
# E.g., an action named "some_action" and defined in the component +MyComponents::CoolComponent+, will look for its text in:
|
26
|
-
#
|
27
|
-
# I18n.t('my_components.cool_component.actions.some_action')
|
28
|
-
#
|
29
|
-
# and for its tooltip in:
|
30
|
-
#
|
31
|
-
# I18n.t('my_components.cool_component.actions.some_action_tooltip')
|
32
|
-
module Actions
|
33
|
-
extend ActiveSupport::Concern
|
34
|
-
|
35
|
-
ACTION_METHOD_NAME = "%s_action"
|
36
|
-
|
37
|
-
included do
|
38
|
-
alias_method_chain :js_config, :actions
|
39
|
-
|
40
|
-
# Returns registered actions
|
41
|
-
class_attribute :registered_actions
|
42
|
-
self.registered_actions = []
|
43
|
-
end
|
44
|
-
|
45
|
-
module ClassMethods
|
46
|
-
def action(name, config = {}, &block)
|
47
|
-
register_action(name)
|
48
|
-
config[:name] = name.to_s
|
49
|
-
method_name = ACTION_METHOD_NAME % name
|
50
|
-
|
51
|
-
if block_given?
|
52
|
-
define_method(method_name, &block)
|
53
|
-
else
|
54
|
-
if superclass.instance_methods.map(&:to_s).include?(method_name)
|
55
|
-
define_method(method_name) do
|
56
|
-
super().merge(config)
|
57
|
-
end
|
58
|
-
else
|
59
|
-
define_method(method_name) do
|
60
|
-
config
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
# Register an action
|
67
|
-
def register_action(name)
|
68
|
-
self.registered_actions |= [name]
|
69
|
-
end
|
70
|
-
|
71
|
-
end
|
72
|
-
|
73
|
-
# All actions for this instance
|
74
|
-
def actions
|
75
|
-
@actions ||= self.class.registered_actions.inject({}){ |res, name| res.merge(name.to_sym => normalize_action_config(send(ACTION_METHOD_NAME % name).merge(:name => name.to_s))) }
|
76
|
-
end
|
77
|
-
|
78
|
-
def js_config_with_actions #:nodoc
|
79
|
-
actions.empty? ? js_config_without_actions : js_config_without_actions.merge(:actions => actions)
|
80
|
-
end
|
81
|
-
|
82
|
-
private
|
83
|
-
|
84
|
-
def normalize_action_config(config)
|
85
|
-
config.tap do |c|
|
86
|
-
if c[:icon].is_a?(Symbol)
|
87
|
-
c[:icon] = uri_to_icon(c[:icon])
|
88
|
-
end
|
89
|
-
|
90
|
-
# Default text and tooltip
|
91
|
-
c[:text] ||= c[:name].humanize
|
92
|
-
c[:tooltip] ||= c[:name].humanize
|
93
|
-
|
94
|
-
# If we have an I18n for it, use it
|
95
|
-
default_text = I18n.t(i18n_id + ".actions." + c[:name], :default => "")
|
96
|
-
c[:text] = default_text if default_text.present?
|
97
|
-
default_tooltip = I18n.t(i18n_id + ".actions." + c[:name] + "_tooltip", :default => default_text)
|
98
|
-
c[:tooltip] = default_tooltip if default_tooltip.present?
|
99
|
-
end
|
100
|
-
end
|
101
|
-
|
102
|
-
def uri_to_icon(icon)
|
103
|
-
Netzke::Core.with_icons ? [Netzke::Core.controller.config.relative_url_root, Netzke::Core.icons_uri, '/', icon.to_s, ".png"].join : nil
|
104
|
-
end
|
105
|
-
|
106
|
-
end
|
107
|
-
end
|