RubyApp 0.0.60 → 0.0.61

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.60)
4
+ RubyApp (0.0.61)
5
5
  BlueCloth
6
6
  chronic
7
7
  chronic_duration
@@ -50,3 +50,17 @@ Feature: Dialog Test Page
50
50
  And I should not see "15/"
51
51
  And I should see "-15"
52
52
  Then I quit
53
+
54
+ Scenario: Show an acknowledgement dialog
55
+ Given I go to the test pages
56
+ When I click "DialogTestPage"
57
+ And I click "AcknowledgementDialog"
58
+ Then I should see "Acknowledgement Dialog"
59
+ And I should see "This will happen."
60
+ When I click "OK"
61
+ Then I should not see "Acknowledgement Dialog"
62
+ And I should not see "This will happen."
63
+ And I should see "You clicked"
64
+ And I should see "true"
65
+ Then I click "Close"
66
+ Then I quit
@@ -29,7 +29,7 @@ Then /^the "([^\"]*)" field should contain "([^\"]*)"$/ do |field, value|
29
29
  field_labeled(field).value.should =~ /#{value}/
30
30
  end
31
31
 
32
- When /^I (un)?check the "([^"]*)" field?$/ do |uncheck, field|
32
+ When /^I (un)?check the "([^"]*)" field$/ do |uncheck, field|
33
33
  unless uncheck
34
34
  check(field)
35
35
  else
@@ -0,0 +1,8 @@
1
+ - self.content_for(:title) do
2
+ /
3
+ #{__FILE__}
4
+ = @title
5
+ - self.content_for(:content) do
6
+ /
7
+ #{__FILE__}
8
+ = @message
@@ -0,0 +1,26 @@
1
+ module RubyApp
2
+
3
+ module Elements
4
+
5
+ module Dialogs
6
+ require 'ruby_app/elements/dialogs/ok_dialog'
7
+
8
+ class AcknowledgementDialog < RubyApp::Elements::Dialogs::OkDialog
9
+
10
+ template_path(:all, File.dirname(__FILE__))
11
+
12
+ def initialize(title, message)
13
+ super()
14
+
15
+ @title = title
16
+ @message = message
17
+
18
+ end
19
+
20
+ end
21
+
22
+ end
23
+
24
+ end
25
+
26
+ end
@@ -0,0 +1,11 @@
1
+ - self.rendered?(__FILE__) do
2
+ :sass
3
+ /* #{__FILE__}
4
+ body
5
+ > div.overlay
6
+ > div.dialog
7
+ > div.footer
8
+ text-align: right
9
+ width: 100%
10
+ = RubyApp::Elements::Link.render(:css)
11
+ = yield
@@ -0,0 +1,6 @@
1
+ - self.content_for(:footer) do
2
+ /
3
+ #{__FILE__}
4
+ = @ok.render(:html) do |element|
5
+ - element.content_for(:body, RubyApp::Elements::Dialogs::Base::BaseOkDialog.translate.ok.body)
6
+ = yield
@@ -0,0 +1,2 @@
1
+ = RubyApp::Elements::Link.render(:js)
2
+ = yield
@@ -0,0 +1,34 @@
1
+ module RubyApp
2
+
3
+ module Elements
4
+
5
+ module Dialogs
6
+
7
+ module Base
8
+ require 'ruby_app/elements/dialogs/blank_dialog'
9
+ require 'ruby_app/elements/link'
10
+
11
+ class BaseOkDialog < RubyApp::Elements::Dialogs::BlankDialog
12
+
13
+ template_path(:all, File.dirname(__FILE__))
14
+
15
+ def initialize
16
+ super
17
+
18
+ @ok = RubyApp::Elements::Link.new
19
+ @ok.clicked do |element, event|
20
+ @response = true
21
+ event.hide_dialog(self)
22
+ end
23
+
24
+ end
25
+
26
+ end
27
+
28
+ end
29
+
30
+ end
31
+
32
+ end
33
+
34
+ end
@@ -0,0 +1,22 @@
1
+ module RubyApp
2
+
3
+ module Elements
4
+
5
+ module Dialogs
6
+ require 'ruby_app/elements/dialogs/base/base_ok_dialog'
7
+
8
+ class OkDialog < RubyApp::Elements::Dialogs::Base::BaseOkDialog
9
+
10
+ template_path(:all, File.dirname(__FILE__))
11
+
12
+ def initialize
13
+ super
14
+ end
15
+
16
+ end
17
+
18
+ end
19
+
20
+ end
21
+
22
+ end
@@ -1,4 +1,5 @@
1
1
  = RubyApp::Elements::Markdown.render(:css)
2
+ = RubyApp::Elements::Dialogs::AcknowledgementDialog.render(:css)
2
3
  = RubyApp::Elements::Dialogs::ConfirmationDialog.render(:css)
3
4
  = RubyApp::Elements::Dialogs::ExceptionDialog.render(:css)
4
5
  = RubyApp::Elements::Dialogs::MessageDialog.render(:css)
@@ -1,4 +1,5 @@
1
1
  = RubyApp::Elements::Markdown.render(:js)
2
+ = RubyApp::Elements::Dialogs::AcknowledgementDialog.render(:js)
2
3
  = RubyApp::Elements::Dialogs::ConfirmationDialog.render(:js)
3
4
  = RubyApp::Elements::Dialogs::ExceptionDialog.render(:js)
4
5
  = RubyApp::Elements::Dialogs::MessageDialog.render(:js)
@@ -7,6 +7,7 @@ module RubyApp
7
7
  module TestPages
8
8
  require 'ruby_app/elements/markdown'
9
9
  require 'ruby_app/elements/dialogs/calendars/month_dialog'
10
+ require 'ruby_app/elements/dialogs/acknowledgement_dialog'
10
11
  require 'ruby_app/elements/dialogs/confirmation_dialog'
11
12
  require 'ruby_app/elements/dialogs/exception_dialog'
12
13
  require 'ruby_app/elements/dialogs/message_dialog'
@@ -25,9 +26,9 @@ module RubyApp
25
26
  case event.name
26
27
  when 'do_confirmation_dialog'
27
28
  RubyApp::Session.show_dialog(event, RubyApp::Elements::Dialogs::ConfirmationDialog.new(self.translate.confirmation_dialog.title,
28
- self.translate.confirmation_dialog.message)) do |_event, response|
29
+ self.translate.confirmation_dialog.message)) do |_event, response|
29
30
  RubyApp::Session.show_dialog(_event, RubyApp::Elements::Dialogs::MessageDialog.new(self.translate.confirmation_dialog.message_dialog.title,
30
- self.translate.confirmation_dialog.message_dialog.message(response)))
31
+ self.translate.confirmation_dialog.message_dialog.message(response)))
31
32
  end
32
33
  when 'do_exception_dialog'
33
34
  RubyApp::Elements::Dialogs::ExceptionDialog.show_dialog(event) do
@@ -37,14 +38,20 @@ module RubyApp
37
38
  raise self.translate.exception
38
39
  when 'do_message_dialog'
39
40
  RubyApp::Session.show_dialog(event, RubyApp::Elements::Dialogs::MessageDialog.new(self.translate.message_dialog.message.title,
40
- self.translate.message_dialog.message.message))
41
+ self.translate.message_dialog.message.message))
41
42
  when 'do_month_dialog'
42
43
  RubyApp::Session.show_dialog(event, RubyApp::Elements::Dialogs::Calendars::MonthDialog.new(self.translate.month_dialog.title, event.today)) do |_event, response|
43
44
  RubyApp::Session.show_dialog(_event, RubyApp::Elements::Dialogs::MessageDialog.new(self.translate.month_dialog.message_dialog.title,
44
- self.translate.month_dialog.message_dialog.message(response))) do |__event, _response|
45
+ self.translate.month_dialog.message_dialog.message(response))) do |__event, _response|
45
46
  __event.execute("$('#last_value').text('#{response}');")
46
47
  end
47
48
  end
49
+ when 'do_acknowledgement_dialog'
50
+ RubyApp::Session.show_dialog(event, RubyApp::Elements::Dialogs::AcknowledgementDialog.new(self.translate.acknowledgement_dialog.title,
51
+ self.translate.acknowledgement_dialog.message)) do |_event, response|
52
+ RubyApp::Session.show_dialog(_event, RubyApp::Elements::Dialogs::MessageDialog.new(self.translate.acknowledgement_dialog.message_dialog.title,
53
+ self.translate.acknowledgement_dialog.message_dialog.message(response)))
54
+ end
48
55
  end
49
56
  end
50
57
 
@@ -7,6 +7,10 @@
7
7
  = self.translate.label.input
8
8
  = @input.render(:html)
9
9
  %br
10
+ %label{:for => @toggle_input.element_id}
11
+ = self.translate.label.toggle_input
12
+ = @toggle_input.render(:html)
13
+ %br
10
14
  %label{:for => @duration_input.element_id}
11
15
  = self.translate.label.duration_input
12
16
  = @duration_input.render(:html)
@@ -18,7 +22,3 @@
18
22
  %label{:for => @email_input.element_id}
19
23
  = self.translate.label.email_input
20
24
  = @email_input.render(:html)
21
- %br
22
- %label{:for => @toggle_input.element_id}
23
- = self.translate.label.toggle_input
24
- = @toggle_input.render(:html)
@@ -11,6 +11,7 @@ require 'ruby_app/elements/dialog'
11
11
  require 'ruby_app/elements/dialogs/blank_dialog'
12
12
  require 'ruby_app/elements/dialogs/close_dialog'
13
13
  require 'ruby_app/elements/dialogs/yes_no_dialog'
14
+ require 'ruby_app/elements/input'
14
15
  require 'ruby_app/elements/inputs/toggle_input'
15
16
  require 'ruby_app/elements/list'
16
17
  require 'ruby_app/elements/lists/select'
@@ -27,6 +28,7 @@ RubyApp::Elements::Dialog.template_path(:css, File.join(File.dirname(__FILE__),
27
28
  RubyApp::Elements::Dialogs::BlankDialog.template_path(:css, File.join(File.dirname(__FILE__), %w[mobile dialogs]))
28
29
  RubyApp::Elements::Dialogs::CloseDialog.template_path(:css, File.join(File.dirname(__FILE__), %w[mobile dialogs]))
29
30
  RubyApp::Elements::Dialogs::YesNoDialog.template_path(:css, File.join(File.dirname(__FILE__), %w[mobile dialogs]))
31
+ RubyApp::Elements::Input.template_path(:css, File.join(File.dirname(__FILE__), %w[mobile]))
30
32
  RubyApp::Elements::Inputs::ToggleInput.template_path(:css, File.join(File.dirname(__FILE__), %w[mobile inputs]))
31
33
  RubyApp::Elements::List.template_path(:css, File.join(File.dirname(__FILE__), %w[mobile]))
32
34
  RubyApp::Elements::Lists::Select.template_path(:css, File.join(File.dirname(__FILE__), %w[mobile lists]))
@@ -0,0 +1,10 @@
1
+ - self.rendered?(__FILE__) do
2
+ :sass
3
+ /* #{__FILE__}
4
+ input[type="text"]
5
+ background: inherit
6
+ border: 0px
7
+ color: inherit
8
+ font-size: inherit
9
+ padding: 0px
10
+ = yield
@@ -5,11 +5,12 @@
5
5
  input[type="checkbox"]
6
6
  -webkit-appearance: none
7
7
  border: 2px solid $page_foreground
8
- border-radius: 5px
9
- width: 25px
10
- height: 25px
8
+ border-radius: 3px
9
+ width: 20px
10
+ height: 20px
11
11
  background-position: center center
12
12
  background-repeat: no-repeat
13
+ margin: 0px
13
14
  &:checked
14
15
  background-image: url('/ruby_app/resources/themes/mobile/inputs/toggle.png')
15
16
  = yield
@@ -8,6 +8,9 @@ ruby_app:
8
8
  error: An error occurred sending the event. The page will refresh so you can try again.
9
9
  dialogs:
10
10
  base:
11
+ base_ok_dialog:
12
+ ok:
13
+ body: 'OK'
11
14
  base_close_dialog:
12
15
  close:
13
16
  body: Close
@@ -81,6 +84,8 @@ ruby_app:
81
84
 
82
85
  [`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
86
 
87
+ [`AcknowledgementDialog`](do_acknowledgement_dialog) ... Expect acknowledgementment.
88
+
84
89
  ---
85
90
 
86
91
  [`ConfirmationDialog`](do_confirmation_dialog) ... Ask for confirmation.
@@ -92,6 +97,14 @@ ruby_app:
92
97
  [`MessageDialog`](do_message_dialog) ... Show a sample message dialog.
93
98
 
94
99
  [`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>).
100
+
101
+ [`AcknowledgementDialog`](do_acknowledgement_dialog) ... Expect acknowledgementment.
102
+ acknowledgement_dialog:
103
+ title: Acknowledgement Dialog
104
+ message: This will happen.
105
+ message_dialog:
106
+ title: You clicked ...
107
+ message: %1
95
108
  confirmation_dialog:
96
109
  title: Confirmation Dialog
97
110
  message: Are you sure?
@@ -1,4 +1,4 @@
1
1
  module RubyApp
2
- VERSION = "0.0.60"
2
+ VERSION = "0.0.61"
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: 103
4
+ hash: 101
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 60
10
- version: 0.0.60
9
+ - 61
10
+ version: 0.0.61
11
11
  platform: ruby
12
12
  authors:
13
13
  - Frank G. Ficnar
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-01-10 00:00:00 Z
18
+ date: 2012-01-12 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  version_requirements: &id001 !ruby/object:Gem::Requirement
@@ -378,10 +378,16 @@ 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/acknowledgement_dialog.html.haml
382
+ - lib/ruby_app/elements/dialogs/acknowledgement_dialog.rb
381
383
  - lib/ruby_app/elements/dialogs/base/base_close_dialog.css.haml
382
384
  - lib/ruby_app/elements/dialogs/base/base_close_dialog.html.haml
383
385
  - lib/ruby_app/elements/dialogs/base/base_close_dialog.js.haml
384
386
  - lib/ruby_app/elements/dialogs/base/base_close_dialog.rb
387
+ - lib/ruby_app/elements/dialogs/base/base_ok_dialog.css.haml
388
+ - lib/ruby_app/elements/dialogs/base/base_ok_dialog.html.haml
389
+ - lib/ruby_app/elements/dialogs/base/base_ok_dialog.js.haml
390
+ - lib/ruby_app/elements/dialogs/base/base_ok_dialog.rb
385
391
  - lib/ruby_app/elements/dialogs/base/base_yes_no_dialog.css.haml
386
392
  - lib/ruby_app/elements/dialogs/base/base_yes_no_dialog.html.haml
387
393
  - lib/ruby_app/elements/dialogs/base/base_yes_no_dialog.js.haml
@@ -399,6 +405,7 @@ files:
399
405
  - lib/ruby_app/elements/dialogs/exception_dialog.rb
400
406
  - lib/ruby_app/elements/dialogs/message_dialog.html.haml
401
407
  - lib/ruby_app/elements/dialogs/message_dialog.rb
408
+ - lib/ruby_app/elements/dialogs/ok_dialog.rb
402
409
  - lib/ruby_app/elements/dialogs/yes_no_dialog.rb
403
410
  - lib/ruby_app/elements/exception_element.html.haml
404
411
  - lib/ruby_app/elements/exception_element.rb
@@ -549,6 +556,7 @@ files:
549
556
  - lib/ruby_app/themes/mobile/dialogs/blank_dialog.css.haml
550
557
  - lib/ruby_app/themes/mobile/dialogs/close_dialog.css.haml
551
558
  - lib/ruby_app/themes/mobile/dialogs/yes_no_dialog.css.haml
559
+ - lib/ruby_app/themes/mobile/input.css.haml
552
560
  - lib/ruby_app/themes/mobile/inputs/toggle_input.css.haml
553
561
  - lib/ruby_app/themes/mobile/list.css.haml
554
562
  - lib/ruby_app/themes/mobile/lists/select.css.haml