RubyApp 0.0.28 → 0.0.29

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.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- RubyApp (0.0.28)
4
+ RubyApp (0.0.29)
5
5
  BlueCloth
6
6
  chronic
7
7
  chronic_duration
@@ -23,6 +23,7 @@ module RubyApp
23
23
  include RubyApp::Mixins::RenderMixin
24
24
 
25
25
  class Event
26
+ extend RubyApp::Mixins::TranslateMixin
26
27
 
27
28
  attr_reader :now, :source
28
29
 
@@ -53,6 +54,10 @@ module RubyApp
53
54
  execute("RubyApp.refresh();")
54
55
  end
55
56
 
57
+ def confirm_refresh(message)
58
+ execute("RubyApp.confirm_refresh(#{message.to_json});")
59
+ end
60
+
56
61
  def show(dialog)
57
62
  execute("RubyApp.show('#{dialog.element_id}');")
58
63
  end
@@ -112,7 +117,7 @@ module RubyApp
112
117
 
113
118
  def initialize(exception)
114
119
  super()
115
- self.alert(exception.message)
120
+ self.confirm_refresh(RubyApp::Element::ExceptionEvent.translate.message(exception.message))
116
121
  end
117
122
 
118
123
  end
@@ -16,10 +16,7 @@
16
16
  } );
17
17
  } )
18
18
  .error( function(request, message, exception) {
19
- if (confirm(#{RubyApp::Elements::Base::BasePage.translate.error.to_json}))
20
- {
21
- RubyApp.refresh();
22
- }
19
+ RubyApp.confirm_refresh(#{RubyApp::Elements::Base::BasePage.translate.error.to_json});
23
20
  } )
24
21
  },
25
22
  this.alert = function(message) {
@@ -28,6 +25,12 @@
28
25
  this.refresh = function() {
29
26
  location.assign(location.pathname);
30
27
  },
28
+ this.confirm_refresh = function(message) {
29
+ if (confirm(message))
30
+ {
31
+ RubyApp.refresh();
32
+ }
33
+ },
31
34
  this.go = function(url) {
32
35
  location.assign(url);
33
36
  },
@@ -38,6 +38,8 @@ module RubyApp
38
38
  RubyApp::Elements::Dialogs::ExceptionDialog.show(event) do
39
39
  raise self.translate.exception
40
40
  end
41
+ when 'do_unhandled_exception_dialog'
42
+ raise self.translate.exception
41
43
  when 'do_message_dialog'
42
44
  RubyApp::Session.show(event, RubyApp::Elements::Dialogs::MessageDialog.new(self.translate.message_dialog.message.title,
43
45
  self.translate.message_dialog.message.message))
@@ -1,4 +1,7 @@
1
1
  ruby_app:
2
+ element:
3
+ exception_event:
4
+ message: %1. Do you want to refresh the page and try again?
2
5
  elements:
3
6
  base:
4
7
  base_page:
@@ -76,6 +79,8 @@ ruby_app:
76
79
 
77
80
  [`ExceptionDialog`](do_exception_dialog) ... Raise an exception and show the `class` and `message` properties.
78
81
 
82
+ [`Exception`](do_unhandled_exception_dialog) ... Raise an unhandled exception.
83
+
79
84
  [`MessageDialog`](do_message_dialog) ... Show a sample message dialog.
80
85
 
81
86
  [`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>).
@@ -170,7 +175,7 @@ ruby_app:
170
175
  Click [here](go_test) to go to the test pages.
171
176
  loaded:
172
177
  Loaded at %1
173
- authentication:
178
+ authentication:
174
179
  open_id:
175
180
  base:
176
181
  base_authentication_page:
@@ -198,4 +203,4 @@ ruby_app:
198
203
  title: Quit
199
204
  exceptions:
200
205
  session_invalid_exception:
201
- message: The session is invalid or has expired. Refresh the page and try again.
206
+ message: The session is invalid or has expired
@@ -1,4 +1,4 @@
1
1
  module RubyApp
2
- VERSION = "0.0.28"
2
+ VERSION = "0.0.29"
3
3
  ROOT = File.expand_path(File.dirname(__FILE__))
4
4
  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: 39
4
+ hash: 37
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 28
10
- version: 0.0.28
9
+ - 29
10
+ version: 0.0.29
11
11
  platform: ruby
12
12
  authors:
13
13
  - Frank G. Ficnar