RubyApp 0.0.46 → 0.0.47

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.
Files changed (40) hide show
  1. data/Gemfile.lock +1 -1
  2. data/features/elements/dialog.feature +0 -10
  3. data/lib/ruby_app/element.rb +4 -4
  4. data/lib/ruby_app/elements/base/base_page.css.haml +12 -0
  5. data/lib/ruby_app/elements/base/base_page.html.haml +3 -0
  6. data/lib/ruby_app/elements/base/base_page.js.haml +58 -27
  7. data/lib/ruby_app/elements/dialogs/base/base_close_dialog.rb +1 -1
  8. data/lib/ruby_app/elements/dialogs/base/base_yes_no_dialog.rb +2 -2
  9. data/lib/ruby_app/elements/dialogs/calendars/month_dialog.rb +3 -3
  10. data/lib/ruby_app/elements/dialogs/exception_dialog.rb +2 -2
  11. data/lib/ruby_app/elements/pages/authentication/open_id/base/base_authentication_page.css.haml +1 -1
  12. data/lib/ruby_app/elements/pages/authentication/open_id/base/base_authentication_page.html.haml +1 -1
  13. data/lib/ruby_app/elements/pages/test_pages/default_test_page.css.haml +0 -1
  14. data/lib/ruby_app/elements/pages/test_pages/default_test_page.js.haml +0 -1
  15. data/lib/ruby_app/elements/pages/test_pages/default_test_page.rb +0 -1
  16. data/lib/ruby_app/elements/pages/test_pages/dialog_test_page.css.haml +0 -1
  17. data/lib/ruby_app/elements/pages/test_pages/dialog_test_page.js.haml +0 -1
  18. data/lib/ruby_app/elements/pages/test_pages/dialog_test_page.rb +6 -11
  19. data/lib/ruby_app/elements/pages/test_pages/input_test_page.rb +2 -2
  20. data/lib/ruby_app/elements/pages/test_pages/list_test_page.rb +2 -2
  21. data/lib/ruby_app/elements/pages/test_pages/select_test_page.rb +1 -1
  22. data/lib/ruby_app/elements/pages/test_pages/test_page.rb +1 -1
  23. data/lib/ruby_app/rack/route.rb +3 -0
  24. data/lib/ruby_app/resources/elements/{dialogs/base/base_busy_dialog.gif → base/base_page.gif} +0 -0
  25. data/lib/ruby_app/session.rb +3 -3
  26. data/lib/ruby_app/themes/mobile.rb +0 -2
  27. data/lib/ruby_app/themes/mobile/base/base_page.html.haml +3 -0
  28. data/lib/ruby_app/themes/mobile/page.css.haml +8 -0
  29. data/lib/ruby_app/themes/mobile/pages/authentication/open_id/authentication_page.css.haml +1 -1
  30. data/lib/ruby_app/translations/en.yml +24 -6
  31. data/lib/ruby_app/version.rb +1 -1
  32. data/spec/element_spec.rb +2 -2
  33. data/spec/session_spec.rb +1 -1
  34. metadata +4 -10
  35. data/lib/ruby_app/elements/dialogs/base/base_busy_dialog.css.haml +0 -9
  36. data/lib/ruby_app/elements/dialogs/base/base_busy_dialog.html.haml +0 -7
  37. data/lib/ruby_app/elements/dialogs/base/base_busy_dialog.rb +0 -27
  38. data/lib/ruby_app/elements/dialogs/busy_dialog.rb +0 -22
  39. data/lib/ruby_app/elements/pages/authentication/open_id/base/base_authentication_page.js.haml +0 -1
  40. data/lib/ruby_app/themes/mobile/dialogs/busy_dialog.css.haml +0 -9
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- RubyApp (0.0.46)
4
+ RubyApp (0.0.47)
5
5
  BlueCloth
6
6
  chronic
7
7
  chronic_duration
@@ -1,15 +1,5 @@
1
1
  Feature: Dialog Test Page
2
2
 
3
- @broken
4
- Scenario: Show a busy dialog
5
- Given I go to the test pages
6
- When I click "DialogTestPage"
7
- When I click "BusyDialog"
8
- Then I should see "Busy dialog"
9
- When I wait 30 seconds
10
- Then I should not see "Busy dialog"
11
- Then I quit
12
-
13
3
  Scenario: Show a confirmation dialog
14
4
  Given I go to the test pages
15
5
  When I click "DialogTestPage"
@@ -58,12 +58,12 @@ module RubyApp
58
58
  execute("RubyApp.confirm_refresh(#{message.to_json});")
59
59
  end
60
60
 
61
- def show(dialog)
62
- execute("RubyApp.show('#{dialog.element_id}');")
61
+ def show_dialog(dialog)
62
+ execute("RubyApp.showDialog('#{dialog.element_id}');")
63
63
  end
64
64
 
65
- def hide(dialog)
66
- execute("RubyApp.hide('#{dialog.element_id}');")
65
+ def hide_dialog(dialog)
66
+ execute("RubyApp.hideDialog('#{dialog.element_id}');")
67
67
  end
68
68
 
69
69
  def update_element(element)
@@ -10,4 +10,16 @@
10
10
  top: 0px
11
11
  width: 100%
12
12
  z-index: 1
13
+ > div.wait
14
+ display: none
15
+ height: 100%
16
+ left: 0px
17
+ position: absolute
18
+ top: 0px
19
+ width: 100%
20
+ z-index: 2
21
+ > div.image
22
+ text-align: center
23
+ position: absolute
24
+ width: 16px
13
25
  = yield
@@ -18,3 +18,6 @@
18
18
  %div.body
19
19
  = yield :body
20
20
  %div.overlay
21
+ %div.wait
22
+ %div.image
23
+ %img{:src => '/ruby_app/resources/elements/base/base_page.gif'}
@@ -3,12 +3,39 @@
3
3
  // #{__FILE__}
4
4
  var RubyApp = new function() {
5
5
  this.translation = {code:'#{RubyApp::Language.locale.code}', title:'#{RubyApp::Language.locale.title}'},
6
- this.interval = #{self.interval * 1000};
7
- this._interval = 0;
6
+ this.interval = #{self.interval * 1000},
7
+ this._interval = 0,
8
+ this.maximize = function(selector) {
9
+ var element = $(selector);
10
+ var _document = $(document);
11
+ element.css('width', '0px');
12
+ element.css('height', '0px');
13
+ element.css('width', _document.width() + 'px');
14
+ element.css('height', _document.height() + 'px');
15
+ },
16
+ this.center = function(selector) {
17
+ var element = $(selector);
18
+ var _window = $(window);
19
+ element.css('top', _window.scrollTop() + (_window.height() - element.outerHeight(true)) / 2 + 'px');
20
+ element.css('left', _window.scrollLeft() + (_window.width() - element.outerWidth(true)) / 2 + 'px');
21
+ },
22
+ this.maximizeWait = function() {
23
+ RubyApp.maximize('body div.wait');
24
+ },
25
+ this.centerWaitImage = function() {
26
+ RubyApp.center('body div.wait > div.image');
27
+ },
28
+ this.maximizeOverlay = function() {
29
+ RubyApp.maximize('body div.overlay');
30
+ },
31
+ this.centerDialog = function(id) {
32
+ RubyApp.center('#'+id);
33
+ },
8
34
  this.queueEvent = function(event) {
9
35
  event.session_id = '#{RubyApp::Session.session_id}';
10
36
  event.now = new Date().toString();
11
37
  $(window).queue( function() {
38
+ RubyApp.showWait();
12
39
  request = $.post(location.href, event);
13
40
  request
14
41
  .success( function(event) {
@@ -18,8 +45,10 @@
18
45
  $(window).dequeue();
19
46
  } );
20
47
  } );
48
+ RubyApp.hideWait();
21
49
  } )
22
50
  .error( function(request, message, exception) {
51
+ RubyApp.hideWait();
23
52
  RubyApp.confirm_refresh(#{RubyApp::Elements::Base::BasePage.translate.error.to_json});
24
53
  } )
25
54
  .complete( function() {
@@ -44,42 +73,44 @@
44
73
  $(window).clearQueue();
45
74
  location.assign(url);
46
75
  },
47
- this.show = function(id) {
76
+ this.showWait = function() {
77
+ var wait = $('body div.wait');
78
+ wait.show();
79
+ RubyApp.maximizeWait();
80
+ RubyApp.centerWaitImage();
81
+ $(window).bind('resize.wait', function() {
82
+ RubyApp.maximizeWait();
83
+ RubyApp.centerWaitImage();
84
+ } );
85
+ $(window).bind('scroll.wait', function() {
86
+ RubyApp.centerWaitImage();
87
+ } );
88
+ },
89
+ this.hideWait = function() {
90
+ $(window).unbind('.wait');
91
+ $('body div.wait').hide();
92
+ },
93
+ this.showDialog = function(id) {
48
94
  request = $.get('/#{RubyApp::Language.locale.code}/elements/' + id + '.html');
49
95
  request
50
96
  .success( function(dialog) {
51
97
  var overlay = $('body div.overlay');
52
98
  overlay.append(dialog);
53
99
  overlay.show();
54
- centerOverlay = function() {
55
- var overlay = $('body div.overlay');
56
- var _document = $(document);
57
- overlay.css('width', '0px');
58
- overlay.css('height', '0px');
59
- overlay.css('width', _document.width() + 'px');
60
- overlay.css('height', _document.height() + 'px');
61
- };
62
- centerDialog = function(id) {
63
- var dialog = $('#'+id);
64
- var _window = $(window);
65
- dialog.css('top', _window.scrollTop() + (_window.height() - dialog.outerHeight(true)) / 2 + 'px');
66
- dialog.css('left', _window.scrollLeft() + (_window.width() - dialog.outerWidth(true)) / 2 + 'px');
67
- };
68
- centerOverlay();
69
- centerDialog(id);
70
- $(window).bind('resize', function() {
71
- centerOverlay();
72
- centerDialog(id);
100
+ RubyApp.maximizeOverlay();
101
+ RubyApp.centerDialog(id);
102
+ $(window).bind('resize.dialog', function() {
103
+ RubyApp.maximizeOverlay();
104
+ RubyApp.centerDialog(id);
73
105
  } );
74
- $(window).bind('scroll', function() {
75
- centerDialog(id);
106
+ $(window).bind('scroll.dialog', function() {
107
+ RubyApp.centerDialog(id);
76
108
  } );
77
109
  RubyApp.queueEvent({_class:'RubyApp::Elements::Dialog::ShownEvent', source_id:id});
78
110
  } );
79
111
  },
80
- this.hide = function(id) {
81
- $(window).unbind('scroll');
82
- $(window).unbind('resize');
112
+ this.hideDialog = function(id) {
113
+ $(window).unbind('.dialog');
83
114
  $('body div.overlay').hide();
84
115
  $('#'+id).remove();
85
116
  RubyApp.queueEvent({_class:'RubyApp::Elements::Dialog::HiddenEvent', source_id:id});
@@ -17,7 +17,7 @@ module RubyApp
17
17
 
18
18
  @close = RubyApp::Elements::Link.new
19
19
  @close.clicked do |element, event|
20
- event.hide(self)
20
+ event.hide_dialog(self)
21
21
  end
22
22
 
23
23
  end
@@ -18,13 +18,13 @@ module RubyApp
18
18
  @yes = RubyApp::Elements::Link.new
19
19
  @yes.clicked do |element, event|
20
20
  @response = true
21
- event.hide(self)
21
+ event.hide_dialog(self)
22
22
  end
23
23
 
24
24
  @no = RubyApp::Elements::Link.new
25
25
  @no.clicked do |element, event|
26
26
  @response = false
27
- event.hide(self)
27
+ event.hide_dialog(self)
28
28
  end
29
29
 
30
30
  end
@@ -23,18 +23,18 @@ module RubyApp
23
23
  @month = RubyApp::Elements::Calendars::Month.new(today, display, value)
24
24
  @month.changed do |element, event|
25
25
  @response = event.value
26
- event.hide(self)
26
+ event.hide_dialog(self)
27
27
  end
28
28
 
29
29
  @today = RubyApp::Elements::Link.new
30
30
  @today.clicked do |element, event|
31
31
  @response = event.today
32
- event.hide(self)
32
+ event.hide_dialog(self)
33
33
  end
34
34
 
35
35
  @cancel = RubyApp::Elements::Link.new
36
36
  @cancel.clicked do |element, event|
37
- event.hide(self)
37
+ event.hide_dialog(self)
38
38
  end
39
39
 
40
40
  end
@@ -16,12 +16,12 @@ module RubyApp
16
16
  @exception = exception
17
17
  end
18
18
 
19
- def self.show(event)
19
+ def self.show_dialog(event)
20
20
  begin
21
21
  yield
22
22
  rescue Exception => exception
23
23
  RubyApp::Log.exception(exception)
24
- RubyApp::Session.show(event, RubyApp::Elements::Dialogs::ExceptionDialog.new(exception))
24
+ RubyApp::Session.show_dialog(event, RubyApp::Elements::Dialogs::ExceptionDialog.new(exception))
25
25
  end
26
26
  end
27
27
 
@@ -1,7 +1,7 @@
1
1
  - self.rendered?(__FILE__) do
2
2
  :sass
3
3
  /* #{__FILE__}
4
- div.wait
4
+ div.authenticating
5
5
  margin: 40px auto 0px auto
6
6
  width: 40%
7
7
  > div.image
@@ -1,7 +1,7 @@
1
1
  - self.content_for(:body) do
2
2
  /
3
3
  #{__FILE__}
4
- %div.wait
4
+ %div.authenticating
5
5
  %div.image
6
6
  %img{:src => '/ruby_app/resources/elements/pages/authentication/open_id/base/base_authentication_page.gif'}
7
7
  %div.content
@@ -1,4 +1,3 @@
1
- = RubyApp::Elements::Dialogs::BusyDialog.render(:css)
2
1
  = RubyApp::Elements::Dialogs::ExceptionDialog.render(:css)
3
2
  = RubyApp::Elements::Markdown.render(:css)
4
3
  = yield
@@ -1,4 +1,3 @@
1
- = RubyApp::Elements::Dialogs::BusyDialog.render(:js)
2
1
  = RubyApp::Elements::Dialogs::ExceptionDialog.render(:js)
3
2
  = RubyApp::Elements::Markdown.render(:js)
4
3
  = yield
@@ -5,7 +5,6 @@ module RubyApp
5
5
  module Pages
6
6
 
7
7
  module TestPages
8
- require 'ruby_app/elements/dialogs/busy_dialog'
9
8
  require 'ruby_app/elements/dialogs/exception_dialog'
10
9
  require 'ruby_app/elements/markdown'
11
10
  require 'ruby_app/elements/pages/authentication/open_id/google_authentication_page'
@@ -1,5 +1,4 @@
1
1
  = RubyApp::Elements::Markdown.render(:css)
2
- = RubyApp::Elements::Dialogs::BusyDialog.render(:css)
3
2
  = RubyApp::Elements::Dialogs::ConfirmationDialog.render(:css)
4
3
  = RubyApp::Elements::Dialogs::ExceptionDialog.render(:css)
5
4
  = RubyApp::Elements::Dialogs::MessageDialog.render(:css)
@@ -1,5 +1,4 @@
1
1
  = RubyApp::Elements::Markdown.render(:js)
2
- = RubyApp::Elements::Dialogs::BusyDialog.render(:js)
3
2
  = RubyApp::Elements::Dialogs::ConfirmationDialog.render(:js)
4
3
  = RubyApp::Elements::Dialogs::ExceptionDialog.render(:js)
5
4
  = RubyApp::Elements::Dialogs::MessageDialog.render(:js)
@@ -6,7 +6,6 @@ module RubyApp
6
6
 
7
7
  module TestPages
8
8
  require 'ruby_app/elements/markdown'
9
- require 'ruby_app/elements/dialogs/busy_dialog'
10
9
  require 'ruby_app/elements/dialogs/calendars/month_dialog'
11
10
  require 'ruby_app/elements/dialogs/confirmation_dialog'
12
11
  require 'ruby_app/elements/dialogs/exception_dialog'
@@ -24,28 +23,24 @@ module RubyApp
24
23
  @markdown = RubyApp::Elements::Markdown.new
25
24
  @markdown.clicked do |element, event|
26
25
  case event.name
27
- when 'do_busy_dialog'
28
- RubyApp::Session.show(event, RubyApp::Elements::Dialogs::BusyDialog.new(self.translate.busy_dialog.message)) do |_event|
29
- sleep 30
30
- end
31
26
  when 'do_confirmation_dialog'
32
- RubyApp::Session.show(event, RubyApp::Elements::Dialogs::ConfirmationDialog.new(self.translate.confirmation_dialog.title,
27
+ RubyApp::Session.show_dialog(event, RubyApp::Elements::Dialogs::ConfirmationDialog.new(self.translate.confirmation_dialog.title,
33
28
  self.translate.confirmation_dialog.message)) do |_event, response|
34
- RubyApp::Session.show(_event, RubyApp::Elements::Dialogs::MessageDialog.new(self.translate.confirmation_dialog.message_dialog.title,
29
+ RubyApp::Session.show_dialog(_event, RubyApp::Elements::Dialogs::MessageDialog.new(self.translate.confirmation_dialog.message_dialog.title,
35
30
  self.translate.confirmation_dialog.message_dialog.message(response)))
36
31
  end
37
32
  when 'do_exception_dialog'
38
- RubyApp::Elements::Dialogs::ExceptionDialog.show(event) do
33
+ RubyApp::Elements::Dialogs::ExceptionDialog.show_dialog(event) do
39
34
  raise self.translate.exception
40
35
  end
41
36
  when 'do_unhandled_exception_dialog'
42
37
  raise self.translate.exception
43
38
  when 'do_message_dialog'
44
- RubyApp::Session.show(event, RubyApp::Elements::Dialogs::MessageDialog.new(self.translate.message_dialog.message.title,
39
+ RubyApp::Session.show_dialog(event, RubyApp::Elements::Dialogs::MessageDialog.new(self.translate.message_dialog.message.title,
45
40
  self.translate.message_dialog.message.message))
46
41
  when 'do_month_dialog'
47
- RubyApp::Session.show(event, RubyApp::Elements::Dialogs::Calendars::MonthDialog.new(self.translate.month_dialog.title, event.today)) do |_event, response|
48
- RubyApp::Session.show(_event, RubyApp::Elements::Dialogs::MessageDialog.new(self.translate.month_dialog.message_dialog.title,
42
+ RubyApp::Session.show_dialog(event, RubyApp::Elements::Dialogs::Calendars::MonthDialog.new(self.translate.month_dialog.title, event.today)) do |_event, response|
43
+ RubyApp::Session.show_dialog(_event, RubyApp::Elements::Dialogs::MessageDialog.new(self.translate.month_dialog.message_dialog.title,
49
44
  self.translate.month_dialog.message_dialog.message(response))) do |__event, _response|
50
45
  __event.execute("$('#last_value').text('#{response}');")
51
46
  end
@@ -23,13 +23,13 @@ module RubyApp
23
23
 
24
24
  @input = RubyApp::Elements::Input.new
25
25
  @input.changed do |element, event|
26
- RubyApp::Session.show(event, RubyApp::Elements::Dialogs::MessageDialog.new(self.translate.message_dialog.message.title,
26
+ RubyApp::Session.show_dialog(event, RubyApp::Elements::Dialogs::MessageDialog.new(self.translate.message_dialog.message.title,
27
27
  self.translate.message_dialog.message.message(@input.value)))
28
28
  end
29
29
 
30
30
  @duration_input = RubyApp::Elements::Inputs::DurationInput.new
31
31
  @duration_input.changed do |element, event|
32
- RubyApp::Session.show(event, RubyApp::Elements::Dialogs::MessageDialog.new(self.translate.message_dialog.message.title,
32
+ RubyApp::Session.show_dialog(event, RubyApp::Elements::Dialogs::MessageDialog.new(self.translate.message_dialog.message.title,
33
33
  self.translate.message_dialog.message.message(@duration_input.duration)))
34
34
  end
35
35
 
@@ -28,7 +28,7 @@ module RubyApp
28
28
  'Item 04',
29
29
  'Item 05' ]
30
30
  @list.clicked do |element, event|
31
- RubyApp::Session.show(event, RubyApp::Elements::Dialogs::MessageDialog.new(self.translate.message_dialog.message.title,
31
+ RubyApp::Session.show_dialog(event, RubyApp::Elements::Dialogs::MessageDialog.new(self.translate.message_dialog.message.title,
32
32
  self.translate.message_dialog.message.message(event.item)))
33
33
  end
34
34
 
@@ -39,7 +39,7 @@ module RubyApp
39
39
  'Item 14',
40
40
  'Item 15' ]
41
41
  @select.clicked do |element, event|
42
- RubyApp::Session.show(event, RubyApp::Elements::Dialogs::MessageDialog.new(self.translate.message_dialog.message.title,
42
+ RubyApp::Session.show_dialog(event, RubyApp::Elements::Dialogs::MessageDialog.new(self.translate.message_dialog.message.title,
43
43
  self.translate.message_dialog.message.message(@select.selected_item)))
44
44
  end
45
45
 
@@ -27,7 +27,7 @@ module RubyApp
27
27
  'Item 04',
28
28
  'Item 05' ]
29
29
  @select.clicked do |element, event|
30
- RubyApp::Session.show(event, RubyApp::Elements::Dialogs::MessageDialog.new(self.translate.message_dialog.message.title,
30
+ RubyApp::Session.show_dialog(event, RubyApp::Elements::Dialogs::MessageDialog.new(self.translate.message_dialog.message.title,
31
31
  self.translate.message_dialog.message.message(@select.selected_item)))
32
32
  end
33
33
 
@@ -34,7 +34,7 @@ module RubyApp
34
34
  @input = RubyApp::Elements::Input.new
35
35
  @input.changed do |element, event|
36
36
  event.set_cookie('_cookie', @input.value)
37
- RubyApp::Session.show(event, RubyApp::Elements::Dialogs::MessageDialog.new(self.translate.message_dialog.message.title,
37
+ RubyApp::Session.show_dialog(event, RubyApp::Elements::Dialogs::MessageDialog.new(self.translate.message_dialog.message.title,
38
38
  self.translate.message_dialog.message.message(@input.value)))
39
39
  end
40
40
 
@@ -76,6 +76,9 @@ module RubyApp
76
76
 
77
77
  route(RubyApp::Mixins::RouteMixin::POST, /.*/) do |method, path|
78
78
  RubyApp::Log.debug("#{self}.route method=#{method.inspect} path=#{path.inspect} POST=#{RubyApp::Request.POST.inspect}")
79
+ #RubyApp::Log.debug("#{self}.route sleeping ...")
80
+ #sleep(5)
81
+ #RubyApp::Log.debug("#{self}.route ... done")
79
82
  begin
80
83
  if RubyApp::Session.session_id == RubyApp::Request.POST['session_id']
81
84
  event = RubyApp::Element::Event.from_hash(RubyApp::Request.POST)
@@ -45,14 +45,14 @@ module RubyApp
45
45
  @data[key] = value
46
46
  end
47
47
 
48
- def show(event, dialog, &block)
48
+ def show_dialog(event, dialog, &block)
49
49
 
50
50
  @dialogs.push(dialog)
51
51
 
52
52
  if block_given? and block.arity == 1
53
53
  dialog.shown do |element, _event|
54
54
  yield _event
55
- _event.hide(element)
55
+ _event.hide_dialog(element)
56
56
  end
57
57
  end
58
58
  dialog.hidden do |element, _event|
@@ -62,7 +62,7 @@ module RubyApp
62
62
  @dialogs.delete(dialog)
63
63
  end
64
64
 
65
- event.show(dialog)
65
+ event.show_dialog(dialog)
66
66
 
67
67
  end
68
68
 
@@ -9,7 +9,6 @@ require 'ruby_app/elements/base/base_page'
9
9
  require 'ruby_app/elements/calendars/month'
10
10
  require 'ruby_app/elements/dialog'
11
11
  require 'ruby_app/elements/dialogs/blank_dialog'
12
- require 'ruby_app/elements/dialogs/busy_dialog'
13
12
  require 'ruby_app/elements/dialogs/close_dialog'
14
13
  require 'ruby_app/elements/dialogs/yes_no_dialog'
15
14
  require 'ruby_app/elements/list'
@@ -25,7 +24,6 @@ RubyApp::Elements::Base::BasePage.template_path(:html, File.join(File.dirname(__
25
24
  RubyApp::Elements::Calendars::Month.template_path(:css, File.join(File.dirname(__FILE__), %w[mobile calendars]))
26
25
  RubyApp::Elements::Dialog.template_path(:css, File.join(File.dirname(__FILE__), %w[mobile]))
27
26
  RubyApp::Elements::Dialogs::BlankDialog.template_path(:css, File.join(File.dirname(__FILE__), %w[mobile dialogs]))
28
- RubyApp::Elements::Dialogs::BusyDialog.template_path(:css, File.join(File.dirname(__FILE__), %w[mobile dialogs]))
29
27
  RubyApp::Elements::Dialogs::CloseDialog.template_path(:css, File.join(File.dirname(__FILE__), %w[mobile dialogs]))
30
28
  RubyApp::Elements::Dialogs::YesNoDialog.template_path(:css, File.join(File.dirname(__FILE__), %w[mobile dialogs]))
31
29
  RubyApp::Elements::List.template_path(:css, File.join(File.dirname(__FILE__), %w[mobile]))
@@ -28,3 +28,6 @@
28
28
  %div.body
29
29
  = yield :body
30
30
  %div.overlay
31
+ %div.wait
32
+ %div.image
33
+ %img{:src => '/ruby_app/resources/elements/base/base_page.gif'}
@@ -11,6 +11,14 @@
11
11
  margin: 0px
12
12
  > div.overlay
13
13
  background-color: $overlay_background
14
+ > div.wait
15
+ background-color: $overlay_background
16
+ > div.image
17
+ background-color: $dialog_background
18
+ color: $dialog_foreground
19
+ border-radius: 10px
20
+ padding: 20px
21
+ width: 42px
14
22
  a
15
23
  color: $page_link
16
24
  font-weight: bold
@@ -2,7 +2,7 @@
2
2
  :sass
3
3
  /* #{__FILE__}
4
4
  @import '#{File.join(File.dirname(__FILE__), %w[.. .. .. colors.sass])}'
5
- div.wait
5
+ div.authenticating
6
6
  background-color: $dialog_background
7
7
  color: $dialog_foreground
8
8
  border-radius: 10px
@@ -40,7 +40,7 @@ ruby_app:
40
40
  body: |
41
41
  [`ButtonTestPage`](RubyApp::Elements::Pages::TestPages::ButtonTestPage) ... A page with a single, clickable button
42
42
 
43
- [`DialogTestPage`](RubyApp::Elements::Pages::TestPages::DialogTestPage) ... A page with links to show a variety of dialogs (e.g. busy dialog, exception dialog, message dialog, month dialog, etc.)
43
+ [`DialogTestPage`](RubyApp::Elements::Pages::TestPages::DialogTestPage) ... A page with links to show a variety of dialogs (e.g. exception dialog, message dialog, month dialog, etc.)
44
44
 
45
45
  [`InputTestPage`](RubyApp::Elements::Pages::TestPages::InputTestPage) ... A page with a variety of input controls (e.g. simple input, duration input, etc.)
46
46
 
@@ -60,8 +60,6 @@ ruby_app:
60
60
 
61
61
  [`YahooAuthenticationPage`](RubyApp::Elements::Pages::Authentication::OpenID::YahooAuthenticationPage) ... re/authenticate using Yahoo!
62
62
 
63
- busy_dialog:
64
- message: Retrieving authentication information ...
65
63
  button_test_page:
66
64
  title: Button Test Page
67
65
  content:
@@ -73,7 +71,29 @@ ruby_app:
73
71
  title: Dialog Test Page
74
72
  content:
75
73
  body: |
76
- [`BusyDialog`](do_busy_dialog) ... Show and then hide a 'busy' dialog for 30 seconds.
74
+ [`ConfirmationDialog`](do_confirmation_dialog) ... Ask for confirmation.
75
+
76
+ [`ExceptionDialog`](do_exception_dialog) ... Raise an exception and show the `class` and `message` properties.
77
+
78
+ [`Exception`](do_unhandled_exception_dialog) ... Raise an unhandled exception.
79
+
80
+ [`MessageDialog`](do_message_dialog) ... Show a sample message dialog.
81
+
82
+ [`MonthDialog`](do_month_dialog) ... Show a calendar month dialog, hide it when a date is clicked, and then show the clicked date (the last date clicked was <span id='last_value'>(nothing)</span>).
83
+
84
+ ---
85
+
86
+ [`ConfirmationDialog`](do_confirmation_dialog) ... Ask for confirmation.
87
+
88
+ [`ExceptionDialog`](do_exception_dialog) ... Raise an exception and show the `class` and `message` properties.
89
+
90
+ [`Exception`](do_unhandled_exception_dialog) ... Raise an unhandled exception.
91
+
92
+ [`MessageDialog`](do_message_dialog) ... Show a sample message dialog.
93
+
94
+ [`MonthDialog`](do_month_dialog) ... Show a calendar month dialog, hide it when a date is clicked, and then show the clicked date (the last date clicked was <span id='last_value'>(nothing)</span>).
95
+
96
+ ---
77
97
 
78
98
  [`ConfirmationDialog`](do_confirmation_dialog) ... Ask for confirmation.
79
99
 
@@ -84,8 +104,6 @@ ruby_app:
84
104
  [`MessageDialog`](do_message_dialog) ... Show a sample message dialog.
85
105
 
86
106
  [`MonthDialog`](do_month_dialog) ... Show a calendar month dialog, hide it when a date is clicked, and then show the clicked date (the last date clicked was <span id='last_value'>(nothing)</span>).
87
- busy_dialog:
88
- message: Busy dialog ...
89
107
  confirmation_dialog:
90
108
  title: Confirmation Dialog
91
109
  message: Are you sure?
@@ -1,4 +1,4 @@
1
1
  module RubyApp
2
- VERSION = "0.0.46"
2
+ VERSION = "0.0.47"
3
3
  ROOT = File.expand_path(File.dirname(__FILE__))
4
4
  end
data/spec/element_spec.rb CHANGED
@@ -28,8 +28,8 @@ describe RubyApp::Element do
28
28
  specify { event.should respond_to('process!') }
29
29
  specify { event.should respond_to('alert') }
30
30
  specify { event.should respond_to('refresh') }
31
- specify { event.should respond_to('show') }
32
- specify { event.should respond_to('hide') }
31
+ specify { event.should respond_to('show_dialog') }
32
+ specify { event.should respond_to('hide_dialog') }
33
33
  specify { event.should respond_to('update_element') }
34
34
  specify { event.should respond_to('update_text') }
35
35
  specify { event.should respond_to('update_value') }
data/spec/session_spec.rb CHANGED
@@ -26,7 +26,7 @@ describe RubyApp::Session do
26
26
  specify { session.should respond_to('[]=') }
27
27
  specify { session.should respond_to('identity') }
28
28
  specify { session.should respond_to('identity=') }
29
- specify { session.should respond_to('show') }
29
+ specify { session.should respond_to('show_dialog') }
30
30
  specify { session.should respond_to('quit') }
31
31
 
32
32
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: RubyApp
3
3
  version: !ruby/object:Gem::Version
4
- hash: 67
4
+ hash: 65
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 46
10
- version: 0.0.46
9
+ - 47
10
+ version: 0.0.47
11
11
  platform: ruby
12
12
  authors:
13
13
  - Frank G. Ficnar
@@ -378,9 +378,6 @@ files:
378
378
  - lib/ruby_app/elements/click.js.haml
379
379
  - lib/ruby_app/elements/click.rb
380
380
  - lib/ruby_app/elements/dialog.rb
381
- - lib/ruby_app/elements/dialogs/base/base_busy_dialog.css.haml
382
- - lib/ruby_app/elements/dialogs/base/base_busy_dialog.html.haml
383
- - lib/ruby_app/elements/dialogs/base/base_busy_dialog.rb
384
381
  - lib/ruby_app/elements/dialogs/base/base_close_dialog.css.haml
385
382
  - lib/ruby_app/elements/dialogs/base/base_close_dialog.html.haml
386
383
  - lib/ruby_app/elements/dialogs/base/base_close_dialog.js.haml
@@ -391,7 +388,6 @@ files:
391
388
  - lib/ruby_app/elements/dialogs/base/base_yes_no_dialog.rb
392
389
  - lib/ruby_app/elements/dialogs/blank_dialog.html.haml
393
390
  - lib/ruby_app/elements/dialogs/blank_dialog.rb
394
- - lib/ruby_app/elements/dialogs/busy_dialog.rb
395
391
  - lib/ruby_app/elements/dialogs/calendars/month_dialog.css.haml
396
392
  - lib/ruby_app/elements/dialogs/calendars/month_dialog.html.haml
397
393
  - lib/ruby_app/elements/dialogs/calendars/month_dialog.js.haml
@@ -435,7 +431,6 @@ files:
435
431
  - lib/ruby_app/elements/pages/authentication/open_id/ax_authentication_page.rb
436
432
  - lib/ruby_app/elements/pages/authentication/open_id/base/base_authentication_page.css.haml
437
433
  - lib/ruby_app/elements/pages/authentication/open_id/base/base_authentication_page.html.haml
438
- - lib/ruby_app/elements/pages/authentication/open_id/base/base_authentication_page.js.haml
439
434
  - lib/ruby_app/elements/pages/authentication/open_id/base/base_authentication_page.rb
440
435
  - lib/ruby_app/elements/pages/authentication/open_id/email_authentication_page.rb
441
436
  - lib/ruby_app/elements/pages/authentication/open_id/google_authentication_page.rb
@@ -508,7 +503,7 @@ files:
508
503
  - lib/ruby_app/rack/application.rb
509
504
  - lib/ruby_app/rack/route.rb
510
505
  - lib/ruby_app/request.rb
511
- - lib/ruby_app/resources/elements/dialogs/base/base_busy_dialog.gif
506
+ - lib/ruby_app/resources/elements/base/base_page.gif
512
507
  - lib/ruby_app/resources/elements/pages/authentication/open_id/base/base_authentication_page.gif
513
508
  - lib/ruby_app/resources/favicon.ico
514
509
  - lib/ruby_app/resources/scripts/jquery-1.7.1.min.js
@@ -543,7 +538,6 @@ files:
543
538
  - lib/ruby_app/themes/mobile/colors.sass
544
539
  - lib/ruby_app/themes/mobile/dialog.css.haml
545
540
  - lib/ruby_app/themes/mobile/dialogs/blank_dialog.css.haml
546
- - lib/ruby_app/themes/mobile/dialogs/busy_dialog.css.haml
547
541
  - lib/ruby_app/themes/mobile/dialogs/close_dialog.css.haml
548
542
  - lib/ruby_app/themes/mobile/dialogs/yes_no_dialog.css.haml
549
543
  - lib/ruby_app/themes/mobile/list.css.haml
@@ -1,9 +0,0 @@
1
- - self.rendered?(__FILE__) do
2
- :sass
3
- /* #{__FILE__}
4
- body
5
- > div.overlay
6
- > div.dialog
7
- > div.image
8
- float: left
9
- = yield
@@ -1,7 +0,0 @@
1
- - self.content_for(:body) do
2
- /
3
- #{__FILE__}
4
- %div.image
5
- %img{:src => '/ruby_app/resources/elements/dialogs/base/base_busy_dialog.gif'}
6
- %div.content
7
- = @message
@@ -1,27 +0,0 @@
1
- module RubyApp
2
-
3
- module Elements
4
-
5
- module Dialogs
6
-
7
- module Base
8
- require 'ruby_app/elements/dialog'
9
-
10
- class BaseBusyDialog < RubyApp::Elements::Dialog
11
-
12
- template_path(:all, File.dirname(__FILE__))
13
-
14
- def initialize(message)
15
- super()
16
- @message = message
17
- end
18
-
19
- end
20
-
21
- end
22
-
23
- end
24
-
25
- end
26
-
27
- end
@@ -1,22 +0,0 @@
1
- module RubyApp
2
-
3
- module Elements
4
-
5
- module Dialogs
6
- require 'ruby_app/elements/dialogs/base/base_busy_dialog'
7
-
8
- class BusyDialog < RubyApp::Elements::Dialogs::Base::BaseBusyDialog
9
-
10
- template_path(:all, File.dirname(__FILE__))
11
-
12
- def initialize(message)
13
- super(message)
14
- end
15
-
16
- end
17
-
18
- end
19
-
20
- end
21
-
22
- end
@@ -1,9 +0,0 @@
1
- - self.rendered?(__FILE__) do
2
- :sass
3
- /* #{__FILE__}
4
- body
5
- > div.overlay
6
- > div.dialog
7
- > div.image
8
- padding-right: 10px
9
- = yield