netzke-core 0.8.4 → 0.9.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (165) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/Gemfile +4 -1
  4. data/README.md +8 -8
  5. data/TODO.md +6 -34
  6. data/javascripts/ext.js +15 -12
  7. data/lib/netzke/core/component_config.rb +1 -1
  8. data/lib/netzke/core/composition.rb +13 -10
  9. data/lib/netzke/core/dsl_support.rb +0 -1
  10. data/lib/netzke/core/dynamic_assets.rb +2 -6
  11. data/lib/netzke/core/railz/action_view_ext.rb +12 -11
  12. data/lib/netzke/core/railz/action_view_ext/ext.rb +3 -3
  13. data/lib/netzke/core/railz/routes.rb +5 -1
  14. data/lib/netzke/core/version.rb +4 -3
  15. data/tasks/rake_helper.rb +1 -1
  16. metadata +36 -320
  17. data/test/core_test_app/README +0 -15
  18. data/test/core_test_app/Rakefile +0 -7
  19. data/test/core_test_app/app/assets/javascripts/expect/expect.js +0 -1253
  20. data/test/core_test_app/app/assets/javascripts/mocha/mocha.js +0 -5340
  21. data/test/core_test_app/app/assets/stylesheets/mocha/mocha.css +0 -231
  22. data/test/core_test_app/app/components/actions.rb +0 -73
  23. data/test/core_test_app/app/components/component_with_prebuilt_toolbar_control.rb +0 -12
  24. data/test/core_test_app/app/components/component_with_prebuilt_toolbar_control/javascripts/component_with_prebuilt_toolbar_control.js +0 -12
  25. data/test/core_test_app/app/components/composition.rb +0 -106
  26. data/test/core_test_app/app/components/configurable_on_class_level.rb +0 -8
  27. data/test/core_test_app/app/components/css_inclusion.rb +0 -12
  28. data/test/core_test_app/app/components/css_inclusion/stylesheets/custom.css +0 -3
  29. data/test/core_test_app/app/components/dynamic_loading.rb +0 -62
  30. data/test/core_test_app/app/components/dynamic_loading/javascripts/dynamic_loading.js +0 -57
  31. data/test/core_test_app/app/components/dynamic_tab_panel/javascripts/dynamic_tab_panel.js +0 -9
  32. data/test/core_test_app/app/components/endpoints.rb +0 -63
  33. data/test/core_test_app/app/components/endpoints/javascripts/endpoints.js +0 -50
  34. data/test/core_test_app/app/components/endpoints_extended.rb +0 -27
  35. data/test/core_test_app/app/components/ext_direct/composite.rb +0 -51
  36. data/test/core_test_app/app/components/ext_direct/details.rb +0 -11
  37. data/test/core_test_app/app/components/ext_direct/selector.rb +0 -29
  38. data/test/core_test_app/app/components/ext_direct/statistics.rb +0 -11
  39. data/test/core_test_app/app/components/feedback.rb +0 -26
  40. data/test/core_test_app/app/components/haml_panel.rb +0 -32
  41. data/test/core_test_app/app/components/haml_panel/html/body.html.haml +0 -10
  42. data/test/core_test_app/app/components/haml_panel/html/server_response.html.haml +0 -3
  43. data/test/core_test_app/app/components/hello_user.rb +0 -12
  44. data/test/core_test_app/app/components/hello_world.rb +0 -24
  45. data/test/core_test_app/app/components/hello_world/javascripts/hello_world.js +0 -12
  46. data/test/core_test_app/app/components/js_inclusion.rb +0 -17
  47. data/test/core_test_app/app/components/js_inclusion/javascripts/extra_one.js +0 -2
  48. data/test/core_test_app/app/components/js_inclusion/javascripts/extra_two.js +0 -2
  49. data/test/core_test_app/app/components/js_inclusion/javascripts/js_inclusion.js +0 -5
  50. data/test/core_test_app/app/components/js_inclusion/javascripts/method_set_one.js +0 -6
  51. data/test/core_test_app/app/components/js_inclusion/javascripts/method_set_two.js +0 -5
  52. data/test/core_test_app/app/components/js_inclusion_extended.rb +0 -6
  53. data/test/core_test_app/app/components/js_inclusion_extended/javascripts/some_method_set.js +0 -5
  54. data/test/core_test_app/app/components/loaded_css_inclusion.rb +0 -22
  55. data/test/core_test_app/app/components/localization.rb +0 -35
  56. data/test/core_test_app/app/components/localization_extended.rb +0 -2
  57. data/test/core_test_app/app/components/multi_instance_loading.rb +0 -18
  58. data/test/core_test_app/app/components/multi_instance_loading/javascripts/multi_instance_loading.js +0 -18
  59. data/test/core_test_app/app/components/persistence.rb +0 -60
  60. data/test/core_test_app/app/components/persistence_with_shared_state.rb +0 -7
  61. data/test/core_test_app/app/components/plugin_with_actions.rb +0 -24
  62. data/test/core_test_app/app/components/plugin_with_components.rb +0 -22
  63. data/test/core_test_app/app/components/plugin_with_endpoints.rb +0 -29
  64. data/test/core_test_app/app/components/plugins.rb +0 -9
  65. data/test/core_test_app/app/components/ruby_modules.rb +0 -5
  66. data/test/core_test_app/app/components/ruby_modules/basic_stuff.rb +0 -33
  67. data/test/core_test_app/app/components/ruby_modules/extra_stuff.rb +0 -15
  68. data/test/core_test_app/app/components/scoped/deeply_scoped/scoping.rb +0 -10
  69. data/test/core_test_app/app/components/scoped/scoping.rb +0 -8
  70. data/test/core_test_app/app/components/scoped/scoping_extended.rb +0 -8
  71. data/test/core_test_app/app/components/self_reloading.rb +0 -25
  72. data/test/core_test_app/app/components/server_counter.rb +0 -59
  73. data/test/core_test_app/app/components/server_counter/javascripts/server_counter.js +0 -53
  74. data/test/core_test_app/app/components/session_expiration.rb +0 -21
  75. data/test/core_test_app/app/components/simple_authentication_component.rb +0 -47
  76. data/test/core_test_app/app/components/simple_component.rb +0 -7
  77. data/test/core_test_app/app/components/simple_composite.rb +0 -12
  78. data/test/core_test_app/app/components/simple_form_with_file_upload.rb +0 -48
  79. data/test/core_test_app/app/components/simple_panel.rb +0 -2
  80. data/test/core_test_app/app/components/simple_tab_panel.rb +0 -27
  81. data/test/core_test_app/app/components/simple_window.rb +0 -5
  82. data/test/core_test_app/app/components/tools.rb +0 -20
  83. data/test/core_test_app/app/components/window_with_simple_component.rb +0 -15
  84. data/test/core_test_app/app/controllers/alternative_controller.rb +0 -10
  85. data/test/core_test_app/app/controllers/application_controller.rb +0 -10
  86. data/test/core_test_app/app/controllers/components_controller.rb +0 -17
  87. data/test/core_test_app/app/controllers/simple_rails_controller.rb +0 -2
  88. data/test/core_test_app/app/controllers/specs_controller.rb +0 -11
  89. data/test/core_test_app/app/controllers/welcome_controller.rb +0 -5
  90. data/test/core_test_app/app/helpers/application_helper.rb +0 -2
  91. data/test/core_test_app/app/views/components/panel_with_autoload.html.erb +0 -2
  92. data/test/core_test_app/app/views/components/some_tab_panel.html.erb +0 -11
  93. data/test/core_test_app/app/views/layouts/application.html.erb +0 -31
  94. data/test/core_test_app/app/views/layouts/nested.html.erb +0 -5
  95. data/test/core_test_app/app/views/simple_rails/multiple_nested.html.erb +0 -11
  96. data/test/core_test_app/app/views/simple_rails/multiple_of_different_class.html.erb +0 -3
  97. data/test/core_test_app/app/views/simple_rails/multiple_of_same_class.html.erb +0 -2
  98. data/test/core_test_app/app/views/simple_rails/panel.html.erb +0 -1
  99. data/test/core_test_app/config.ru +0 -4
  100. data/test/core_test_app/config/application.rb +0 -51
  101. data/test/core_test_app/config/boot.rb +0 -6
  102. data/test/core_test_app/config/database.yml +0 -22
  103. data/test/core_test_app/config/environment.rb +0 -6
  104. data/test/core_test_app/config/environments/development.rb +0 -23
  105. data/test/core_test_app/config/environments/production.rb +0 -49
  106. data/test/core_test_app/config/environments/test.rb +0 -35
  107. data/test/core_test_app/config/initializers/backtrace_silencers.rb +0 -7
  108. data/test/core_test_app/config/initializers/inflections.rb +0 -10
  109. data/test/core_test_app/config/initializers/javascripts/session_expiration.js +0 -6
  110. data/test/core_test_app/config/initializers/mime_types.rb +0 -5
  111. data/test/core_test_app/config/initializers/netzke.rb +0 -11
  112. data/test/core_test_app/config/initializers/secret_token.rb +0 -7
  113. data/test/core_test_app/config/initializers/session_store.rb +0 -8
  114. data/test/core_test_app/config/locales/en.yml +0 -30
  115. data/test/core_test_app/config/locales/es.yml +0 -11
  116. data/test/core_test_app/config/routes.rb +0 -76
  117. data/test/core_test_app/core_test_app.tmproj +0 -254
  118. data/test/core_test_app/db/development.sqlite3 +0 -0
  119. data/test/core_test_app/db/development_structure.sql +0 -4
  120. data/test/core_test_app/db/seeds.rb +0 -7
  121. data/test/core_test_app/db/test.sqlite3 +0 -0
  122. data/test/core_test_app/log/development.log +0 -125211
  123. data/test/core_test_app/log/production.log +0 -18
  124. data/test/core_test_app/log/test.log +0 -192676
  125. data/test/core_test_app/public/404.html +0 -26
  126. data/test/core_test_app/public/422.html +0 -26
  127. data/test/core_test_app/public/500.html +0 -26
  128. data/test/core_test_app/public/favicon.ico +0 -0
  129. data/test/core_test_app/public/images/icons/accept.png +0 -0
  130. data/test/core_test_app/public/images/icons/anchor.png +0 -0
  131. data/test/core_test_app/public/images/icons/tick.png +0 -0
  132. data/test/core_test_app/public/images/rails.png +0 -0
  133. data/test/core_test_app/public/robots.txt +0 -5
  134. data/test/core_test_app/rails_app.tmproj +0 -324
  135. data/test/core_test_app/script/rails +0 -6
  136. data/test/core_test_app/tmp/cache/assets/C8B/BF0/sprockets%2F54de2792b036d1dab855f88599503551 +0 -0
  137. data/test/core_test_app/tmp/cache/assets/C92/5A0/sprockets%2F39e75754782ee12179bf35c9a0971d80 +0 -0
  138. data/test/core_test_app/tmp/cache/assets/C99/720/sprockets%2F981d5a1b957a012e380b22011a6d176d +0 -0
  139. data/test/core_test_app/tmp/cache/assets/C9F/750/sprockets%2F20ce3d64040a5d3a0a8883bd60754356 +0 -0
  140. data/test/core_test_app/tmp/cache/assets/CC4/C00/sprockets%2Fc615df52887d8c2e67e8413576a419c5 +0 -0
  141. data/test/core_test_app/tmp/cache/assets/CF1/3F0/sprockets%2Fc69ee42924fab565a3533d56473ce878 +0 -0
  142. data/test/core_test_app/tmp/cache/assets/D0E/870/sprockets%2Fa593bf4fac106add88c9434141a49663 +0 -0
  143. data/test/core_test_app/tmp/cache/assets/D14/8E0/sprockets%2F20748e8d1d7d090d122904a9fe6f18fc +0 -0
  144. data/test/core_test_app/tmp/cache/assets/D3E/DA0/sprockets%2Fa175f1ac5996544b908ba3ba3f64c4f3 +0 -0
  145. data/test/core_test_app/tmp/cache/assets/D43/C00/sprockets%2F7bc60c758776356d615ab5edff201ee2 +0 -0
  146. data/test/core_test_app/tmp/cache/assets/D4B/C50/sprockets%2F8483b7e322da338e8f9eb3b30a957e9a +0 -0
  147. data/test/core_test_app/tmp/cache/assets/D64/090/sprockets%2F5a01ff309c3f2503eb5e4f5667cca4b3 +0 -0
  148. data/test/core_test_app/tmp/cache/assets/D8B/FB0/sprockets%2F7a86225caaa389f1be600b4f3a2d1ef0 +0 -0
  149. data/test/core_test_app/tmp/cache/assets/D98/9C0/sprockets%2F18b80e8fe200aebc522e561a867ea6fb +0 -0
  150. data/test/core_test_app/tmp/cache/assets/DB0/6E0/sprockets%2F03e33f5a4779eeb48bcfc86ee717fb55 +0 -0
  151. data/test/core_test_app/tmp/cache/assets/DED/7E0/sprockets%2Feaedd52ba538f19e4ab543a3e20ce2c4 +0 -0
  152. data/test/core_test_app/tmp/cache/assets/E07/FF0/sprockets%2Fb3c071e0a6de36f041adbbdaa8ab060b +0 -0
  153. data/test/core_test_app/tmp/capybara/capybara-20101214105940.html +0 -40
  154. data/test/core_test_app/tmp/capybara/capybara-20101214110642.html +0 -40
  155. data/test/core_test_app/tmp/capybara/capybara-20101214110749.html +0 -40
  156. data/test/core_test_app/tmp/capybara/capybara-20101214110750.html +0 -40
  157. data/test/core_test_app/tmp/capybara/capybara-20101214111025.html +0 -40
  158. data/test/core_test_app/tmp/capybara/capybara-20101214111027.html +0 -40
  159. data/test/core_test_app/tmp/capybara/capybara-20101214111213.html +0 -40
  160. data/test/core_test_app/tmp/capybara/capybara-20101214111214.html +0 -40
  161. data/test/core_test_app/tmp/capybara/capybara-20101214111332.html +0 -40
  162. data/test/core_test_app/tmp/capybara/capybara-20101214111333.html +0 -40
  163. data/test/core_test_app/tmp/pids/passenger.3000.pid.lock +0 -0
  164. data/test/core_test_app/tmp/restart.txt +0 -0
  165. data/test/test_helper.rb +0 -3
@@ -1,15 +0,0 @@
1
- class RubyModules < Netzke::Base
2
- module ExtraStuff
3
- extend ActiveSupport::Concern
4
-
5
- included do
6
- component :endpoints
7
- end
8
-
9
- # Let's add another tab with a Netzke component in it
10
- def configure(c)
11
- super
12
- c.items += [:endpoints]
13
- end
14
- end
15
- end
@@ -1,10 +0,0 @@
1
- module Scoped
2
- module DeeplyScoped
3
- class Scoping < Scoped::Scoping
4
- def configure(c)
5
- super
6
- c.title = c.title + " extended in DeeplyScoped"
7
- end
8
- end
9
- end
10
- end
@@ -1,8 +0,0 @@
1
- module Scoped
2
- class Scoping < Netzke::Base
3
- def configure(c)
4
- super
5
- c.title = "Scoping component"
6
- end
7
- end
8
- end
@@ -1,8 +0,0 @@
1
- module Scoped
2
- class ScopingExtended < Scoping
3
- def configure(c)
4
- super
5
- c.title = c.title + " extended"
6
- end
7
- end
8
- end
@@ -1,25 +0,0 @@
1
- # For demo purposes. Not used for testing.
2
- class SelfReloading < Netzke::Base
3
- action :reload
4
-
5
- def configure(c)
6
- super
7
- c.bbar = [:reload]
8
- end
9
-
10
- def js_configure(c)
11
- super
12
- state[:loaded_times] ||= 0
13
- state[:loaded_times] += 1
14
-
15
- c.title = "Loaded #{state[:loaded_times]} time(s)"
16
- end
17
-
18
- js_configure do |c|
19
- c.on_reload = <<-JS
20
- function(){
21
- this.netzkeReload();
22
- }
23
- JS
24
- end
25
- end
@@ -1,59 +0,0 @@
1
- class ServerCounter < Netzke::Base
2
- action :count_one_time # 1 request
3
- action :count_seven_times # 7 requests (should be batched)
4
- action :count_eight_times_special # passing multiple arguments
5
- action :fail_in_the_middle # calls 3 endpoints of which the second fails
6
- action :do_ordered # used for test if call order is preserved
7
- action :fail_two_out_of_five # sends 5 requests, 2 will fail, but the request should be processed in order
8
-
9
- js_configure do |c|
10
- c.mixin
11
- end
12
-
13
- def configure(c)
14
- super
15
- c.bbar = [:count_one_time, :count_seven_times, :count_eight_times_special, :fail_in_the_middle, :do_ordered, :fail_two_out_of_five]
16
- c.title = "Server Counter"
17
- end
18
-
19
- endpoint :count do |params, this|
20
- component_session[:count] ||= 0
21
- component_session[:count] += params[:how_many]
22
- this.set_title("I am at " + component_session[:count].to_s + (params[:special] ? ' and i was invoked specially' : ''))
23
- end
24
-
25
- endpoint :successing_endpoint do |params, this|
26
- this.set_title("Something successed ")
27
- end
28
-
29
- endpoint :failing_endpoint do |params, this|
30
- throw "something happened"
31
- end
32
-
33
- endpoint :first_ep do |params, this|
34
- component_session[:count2]||=0
35
- component_session[:count2]+=1
36
- this.set_title("First. "+ component_session[:count2].to_s)
37
- end
38
-
39
- endpoint :second_ep do |params, this|
40
- component_session[:count2]||=0
41
- component_session[:count2]+=1
42
- this.set_title("Second. "+ component_session[:count2].to_s)
43
- end
44
-
45
- endpoint :fail_two_out_of_five do |count, this|
46
- component_session[:count] ||= 0
47
- component_session[:count] += 1
48
-
49
- # 2nd and 4th request fail, but only first time, not at a retry
50
- if ([2,4].include?(component_session[:count]) && !component_session[:is_retry])
51
- component_session[:is_retry] = true
52
- throw "Oops..."
53
- end
54
-
55
- component_session[:is_retry] = false
56
- this.append_to_title(count)
57
- end
58
-
59
- end
@@ -1,53 +0,0 @@
1
- {
2
- onCountOneTime: function(){
3
- this.count({how_many: 1});
4
- },
5
-
6
- initComponent: function () {
7
- this.callParent();
8
- Ext.Ajax.on('beforerequest',function (conn, options ) {
9
- Netzke.connectionCount = Netzke.connectionCount || 0;
10
- Netzke.connectionCount++;
11
- Netzke.lastOptions=options;
12
- });
13
- },
14
-
15
- onCountSevenTimes: function(){
16
- for(var i=0; i<7; i++) {
17
- this.count({how_many: 1});
18
- }
19
- },
20
-
21
- onCountEightTimesSpecial: function(){
22
- for(var i=0;i<8;i++) {
23
- this.count({how_many: 1, special: true});
24
- }
25
- },
26
-
27
- onFailInTheMiddle: function() {
28
- this.successingEndpoint();
29
- this.failingEndpoint();
30
- this.successingEndpoint();
31
- },
32
-
33
- onDoOrdered: function () {
34
- this.firstEp();
35
- this.secondEp();
36
- },
37
-
38
- updateContent: function(html){
39
- this.update(html);
40
- },
41
-
42
- appendToTitle: function(html){
43
- this.titl += " " + html;
44
- this.setTitle(this.titl)
45
- },
46
-
47
- onFailTwoOutOfFive: function(){
48
- this.titl = "0";
49
- for(var i=1; i<=5; i++) {
50
- this.failTwoOutOfFive(i);
51
- }
52
- }
53
- }
@@ -1,21 +0,0 @@
1
- # Exends Endpoints test component by adding a button to desctroy the session, after which pressing any other button should result in the notification about expired session.
2
- class SessionExpiration < Endpoints
3
- action :destroy_session
4
-
5
- js_configure do |c|
6
- c.on_destroy_session = <<-JS
7
- function(){
8
- this.serverDestroySession();
9
- }
10
- JS
11
- end
12
-
13
- def configure(c)
14
- super
15
- c.bbar << :destroy_session
16
- end
17
-
18
- endpoint :server_destroy_session do |params,this|
19
- Netzke::Base.session.delete(:netzke_components)
20
- end
21
- end
@@ -1,47 +0,0 @@
1
- # For demo purposes. Not used in testing.
2
- class SimpleAuthenticationComponent < Netzke::Base
3
- action :sign_in
4
-
5
- action :sign_out
6
-
7
- def configure(c)
8
- super
9
- c.tbar = signed_in? ? [current_user_info, "->", :sign_out] : ["->", :sign_in]
10
- end
11
-
12
- js_configure do |c|
13
- c.on_sign_in = <<-JS
14
- function(){
15
- this.signIn();
16
- }
17
- JS
18
-
19
- c.on_sign_out = <<-JS
20
- function(){
21
- this.signOut();
22
- }
23
- JS
24
-
25
- c.reload_page = <<-JS
26
- function(){window.location = window.location;}
27
- JS
28
- end
29
-
30
- endpoint :sign_in do |params,this|
31
- session[:user_id] = 1
32
- this.reload_page
33
- end
34
-
35
- endpoint :sign_out do |params,this|
36
- session.delete(:user_id)
37
- this.reload_page
38
- end
39
-
40
- def current_user_info
41
- session[:user_id] && "Signed in as user#: #{session[:user_id]}" || ""
42
- end
43
-
44
- def signed_in?
45
- !!session[:user_id]
46
- end
47
- end
@@ -1,7 +0,0 @@
1
- class SimpleComponent < Netzke::Base
2
- def configure(c)
3
- c.bbar = ["Hello"]
4
- c.title = c.client_config[:title] || "SimpleComponent"
5
- super
6
- end
7
- end
@@ -1,12 +0,0 @@
1
- # For demo purposes. Not used in testing.
2
- class SimpleComposite < Netzke::Base
3
- def configure(c)
4
- c.layout = :fit
5
- c.items = [:child]
6
- super
7
- end
8
-
9
- component :child do |c|
10
- c.klass = SimpleComponent
11
- end
12
- end
@@ -1,48 +0,0 @@
1
- # For demo purposes. Not used in testing.
2
- class SimpleFormWithFileUpload < Netzke::Base
3
- js_configure do |c|
4
- c.extend = "Ext.form.Panel"
5
- c.body_padding = 10
6
- c.on_submit = <<-JS
7
- function(){
8
- var msg = function(title, msg) {
9
- Ext.Msg.show({
10
- title: title,
11
- msg: msg,
12
- minWidth: 200,
13
- modal: true,
14
- icon: Ext.Msg.INFO,
15
- buttons: Ext.Msg.OK
16
- });
17
- };
18
-
19
- var me = this;
20
-
21
- this.getForm().submit({
22
- url: this.netzkeEndpointUrl('server_submit'),
23
- success: function(fp, o){
24
- msg("Success", 'Your file is uploaded!');
25
- },
26
- failure: function(){msg("Failure", 'Server did not inform us about success');}
27
- });
28
- }
29
- JS
30
- end
31
-
32
- action :submit
33
-
34
- def configure(c)
35
- super
36
- c.items = [{ xtype: :filefield, emptyText: 'Select an image', fieldLabel: 'Photo', buttonText: '...' }]
37
-
38
- c.bbar = [:submit]
39
- end
40
-
41
- endpoint :server_submit do |params, this|
42
- # because this endpoint wasn't called in the normal way, we cannot do anything like this (it won't have any effect):
43
- # this.set_title('File uploaded')
44
-
45
- # But this will define whether the client is informed about success or not:
46
- this.success = true
47
- end
48
- end
@@ -1,2 +0,0 @@
1
- class SimplePanel < Netzke::Core::Panel
2
- end
@@ -1,27 +0,0 @@
1
- class SimpleTabPanel < Netzke::Base
2
- js_configure do |c|
3
- c.extend = "Ext.tab.Panel"
4
- c.active_tab = 0
5
- end
6
-
7
- component :endpoints
8
-
9
- component :hello_world do |c|
10
- c.excluded = true
11
- end
12
-
13
- component :endpoints_extended
14
-
15
- component :simple_panel_one do |c|
16
- c.klass = SimplePanel
17
- end
18
-
19
- component :simple_panel_two do |c|
20
- c.klass = SimplePanel
21
- end
22
-
23
- def configure(c)
24
- c.items = [:endpoints, :hello_world, :endpoints_extended, :simple_panel_one, :simple_panel_two]
25
- super
26
- end
27
- end
@@ -1,5 +0,0 @@
1
- class SimpleWindow < Netzke::Base
2
- js_configure do |c|
3
- c.extend = "Ext.window.Window"
4
- end
5
- end
@@ -1,20 +0,0 @@
1
- class Tools < Netzke::Base
2
- def configure(c)
3
- super
4
- c.tools = [:refresh, :gear]
5
- end
6
-
7
- js_configure do |c|
8
- c.on_refresh = <<-JS
9
- function(){
10
- this.setTitle("Refresh tool clicked");
11
- }
12
- JS
13
-
14
- c.on_gear = <<-JS
15
- function(){
16
- this.setTitle("Gear tool clicked")
17
- }
18
- JS
19
- end
20
- end
@@ -1,15 +0,0 @@
1
- # Used in DynamicLoading
2
- class WindowWithSimpleComponent < SimpleWindow
3
- js_configure do |c|
4
- c.layout = :fit
5
- end
6
-
7
- def configure(c)
8
- c.items = [:simple_component]
9
- super
10
- end
11
-
12
- component :simple_component do |c|
13
- c.title = "Simple Component Inside Window"
14
- end
15
- end
@@ -1,10 +0,0 @@
1
- # Controller that can be configured in config/routes.rb to be used as NetzkeController, i.e. for processing endpoint calls. All it does is respond to any endpoint call with the same response.
2
- class AlternativeController < ActionController::Base
3
- include Netzke::Railz::ControllerExtensions
4
-
5
- before_filter :do_static_endpoint_response, only: :direct
6
-
7
- def do_static_endpoint_response
8
- render text: direct_response(params, {netzke_feedback: ["Hit AlternativeController's before filter"]}).to_json
9
- end
10
- end
@@ -1,10 +0,0 @@
1
- class ApplicationController < ActionController::Base
2
- # protect_from_forgery
3
-
4
- before_filter :set_locale
5
- def set_locale
6
- # if params[:locale] is nil then I18n.default_locale will be used
7
- I18n.locale = params[:locale]
8
- end
9
-
10
- end
@@ -1,17 +0,0 @@
1
- class ComponentsController < ApplicationController
2
- def index
3
- component_name = params[:component].gsub("::", "_").underscore
4
- render :inline => "<%= netzke :#{component_name}, :class_name => '#{params[:component]}', :height => 400 %>", :layout => true
5
- end
6
-
7
- # For panel_with_autoload
8
- def autoloaded_content
9
- render :inline => "<%= netzke :simple_panel, :height => 300, :bbar => ['->', 'Some text'], :html => 'Autoloaded Panel' %>", :layout => "nested"
10
- end
11
-
12
- # Just a test for a pure Ext component - not sure if it's useful.
13
- def ext
14
- component_name = params[:component].gsub("::", "_").underscore
15
- render :inline => "<%= ext :#{component_name} %>", :layout => true
16
- end
17
- end