RubyApp 0.0.10 → 0.0.11

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.10)
4
+ RubyApp (0.0.11)
5
5
  BlueCloth
6
6
  chronic_duration
7
7
  facets
@@ -5,4 +5,4 @@ require 'ruby_app/application'
5
5
 
6
6
  puts "Running #{__FILE__.inspect}"
7
7
 
8
- RubyApp::Application.create
8
+ RubyApp::Application.create!
@@ -1,10 +1,8 @@
1
1
  - self.rendered?(__FILE__) do
2
2
  :sass
3
3
  /* #{__FILE__}
4
- div.month
5
- > table
6
- tr
7
- > td
8
- text-align: center
9
- vertical-align: middle
4
+ div.month
5
+ td
6
+ text-align: center
7
+ vertical-align: middle
10
8
  = yield
@@ -2,15 +2,15 @@
2
2
  :plain
3
3
  // #{__FILE__}
4
4
  $(document).ready(function() {
5
- $("div.month table thead tr td a.previous").live('click', function(event) {
5
+ $('div.month > table > thead > tr > td.left > a.previous').live('click', function(event) {
6
6
  event.preventDefault();
7
7
  RubyApp.sendEvent({_class:'RubyApp::Elements::Calendars::Month::MovedEvent', source_id:$(this).parents('div.month').attr('id'), unit:'month', amount:-1});
8
8
  });
9
- $("div.month table thead tr td a.next").live('click', function(event) {
9
+ $('div.month > table > thead > tr > td.right > a.next').live('click', function(event) {
10
10
  event.preventDefault();
11
11
  RubyApp.sendEvent({_class:'RubyApp::Elements::Calendars::Month::MovedEvent', source_id:$(this).parents('div.month').attr('id'), unit:'month', amount:1});
12
12
  });
13
- $("div.month table tbody tr td a.day").live('click', function(event) {
13
+ $('div.month > table > tbody > tr > td > a.day').live('click', function(event) {
14
14
  event.preventDefault();
15
15
  RubyApp.sendEvent({_class:'RubyApp::Elements::Calendars::Month::ChangedEvent', source_id:$(this).parents('div.month').attr('id'), date:$(this).attr('date')});
16
16
  });
@@ -7,9 +7,9 @@
7
7
  > div.footer
8
8
  text-align: right
9
9
  width: 100%
10
- a:first-child
10
+ > a:first-child
11
11
  padding-left: 0px
12
- a
12
+ > a
13
13
  padding-left: 10px
14
14
  = RubyApp::Elements::Link.render(:css)
15
15
  = yield
@@ -4,6 +4,7 @@ module RubyApp
4
4
 
5
5
  module Dialogs
6
6
  require 'ruby_app/elements/dialogs/close_dialog'
7
+ require 'ruby_app/session'
7
8
 
8
9
  class ExceptionDialog < RubyApp::Elements::Dialogs::CloseDialog
9
10
 
@@ -14,6 +15,14 @@ module RubyApp
14
15
  @exception = exception
15
16
  end
16
17
 
18
+ def self.show(event)
19
+ begin
20
+ yield
21
+ rescue Exception => exception
22
+ RubyApp::Session.show(event, RubyApp::Elements::Dialogs::ExceptionDialog.new(exception))
23
+ end
24
+ end
25
+
17
26
  end
18
27
 
19
28
  end
@@ -3,6 +3,7 @@
3
3
  // #{__FILE__}
4
4
  $(document).ready(function() {
5
5
  $('input[type="text"]').live('change', function(event) {
6
+ event.preventDefault();
6
7
  RubyApp.sendEvent({_class:'RubyApp::Elements::Input::ChangedEvent', source_id:$(this).attr('id'), value:$(this).val()});
7
8
  });
8
9
  });
@@ -2,9 +2,9 @@
2
2
  :plain
3
3
  // #{__FILE__}
4
4
  $(document).ready(function() {
5
- $("ul.list > li.item > a.item").live('click', function(event) {
5
+ $('ul.list > li.item > a.item').live('click', function(event) {
6
6
  event.preventDefault();
7
- RubyApp.sendEvent({_class:'RubyApp::Elements::List::ClickedEvent', source_id:$(this).parent().parent().attr('id'), index:$(this).attr('index')});
7
+ RubyApp.sendEvent({_class:'RubyApp::Elements::List::ClickedEvent', source_id:$(this).parents('ul.list').attr('id'), index:$(this).attr('index')});
8
8
  });
9
9
  });
10
10
  = yield
@@ -2,9 +2,9 @@
2
2
  :plain
3
3
  // #{__FILE__}
4
4
  $(document).ready(function() {
5
- $("ul.select > li.item > a.item").live('click', function(event) {
5
+ $('ul.select > li.item > a.item').live('click', function(event) {
6
6
  event.preventDefault();
7
- RubyApp.sendEvent({_class:'RubyApp::Elements::List::ClickedEvent', source_id:$(this).parent().parent().attr('id'), index:$(this).attr('index')});
7
+ RubyApp.sendEvent({_class:'RubyApp::Elements::List::ClickedEvent', source_id:$(this).parents('ul.select').attr('id'), index:$(this).attr('index')});
8
8
  });
9
9
  });
10
10
  = yield
@@ -2,9 +2,9 @@
2
2
  :plain
3
3
  // #{__FILE__}
4
4
  $(document).ready(function() {
5
- $("div.breadcrumbs a").click(function(event) {
5
+ $('div.breadcrumbs > a.breadcrumb').click(function(event) {
6
6
  event.preventDefault();
7
- RubyApp.sendEvent({_class:'RubyApp::Elements::Navigation::Breadcrumbs::ClickedEvent', source_id:$(this).parent().attr('id'), page_id:$(this).attr('page_id')});
7
+ RubyApp.sendEvent({_class:'RubyApp::Elements::Navigation::Breadcrumbs::ClickedEvent', source_id:$(this).parents('div.breadcrumbs').attr('id'), page_id:$(this).attr('page_id')});
8
8
  });
9
9
  });
10
10
  = yield
@@ -2,9 +2,9 @@
2
2
  :plain
3
3
  // #{__FILE__}
4
4
  $(document).ready(function() {
5
- $("span.link a.page").click(function(event) {
5
+ $('span.link > a.page').click(function(event) {
6
6
  event.preventDefault();
7
- RubyApp.sendEvent({_class:'RubyApp::Elements::Navigation::PageLink::ClickedEvent', source_id:$(this).parent().attr('id'), page:$(this).attr('page')});
7
+ RubyApp.sendEvent({_class:'RubyApp::Elements::Navigation::PageLink::ClickedEvent', source_id:$(this).parents('span.link').attr('id'), page:$(this).attr('page')});
8
8
  });
9
9
  });
10
10
  = yield
@@ -35,10 +35,8 @@ module RubyApp
35
35
  self.translate.confirmation_dialog.message_dialog.message(response)))
36
36
  end
37
37
  when 'do_exception_dialog'
38
- begin
38
+ RubyApp::Elements::Dialogs::ExceptionDialog.show(event) do
39
39
  raise self.translate.exception
40
- rescue Exception => exception
41
- RubyApp::Session.show(event, RubyApp::Elements::Dialogs::ExceptionDialog.new(exception))
42
40
  end
43
41
  when 'do_message_dialog'
44
42
  RubyApp::Session.show(event, RubyApp::Elements::Dialogs::MessageDialog.new(self.translate.message_dialog.message.title,
@@ -13,4 +13,4 @@ options = { :application_class => _APPLICATION_UPCODE_::Application,
13
13
  :default_language => :en,
14
14
  :translations_paths => File.join(_APPLICATION_UPCODE_::ROOT, %w[translations]) }
15
15
 
16
- _APPLICATION_UPCODE_::Application.create options
16
+ _APPLICATION_UPCODE_::Application.create! options
@@ -9,6 +9,6 @@
9
9
  padding-bottom: 10px
10
10
  > div.footer
11
11
  padding-top: 10px
12
- a
12
+ > a
13
13
  padding-left: 10px
14
14
  = yield
@@ -1,4 +1,4 @@
1
1
  module RubyApp
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
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: 11
4
+ hash: 9
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 10
10
- version: 0.0.10
9
+ - 11
10
+ version: 0.0.11
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: 2011-11-09 00:00:00 Z
18
+ date: 2011-11-20 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  version_requirements: &id001 !ruby/object:Gem::Requirement
@@ -416,9 +416,6 @@ files:
416
416
  - lib/ruby_app/elements/navigation/page_link.html.haml
417
417
  - lib/ruby_app/elements/navigation/page_link.js.haml
418
418
  - lib/ruby_app/elements/navigation/page_link.rb
419
- - lib/ruby_app/elements/navigation/page_menu.html.haml
420
- - lib/ruby_app/elements/navigation/page_menu.js.haml
421
- - lib/ruby_app/elements/navigation/page_menu.rb
422
419
  - lib/ruby_app/elements/page.rb
423
420
  - lib/ruby_app/elements/pages/authentication/open_id/authentication_page.css.haml
424
421
  - lib/ruby_app/elements/pages/authentication/open_id/authentication_page.js.haml
@@ -1,12 +0,0 @@
1
- /
2
- #{__FILE__}
3
- %div.menu{attributes}
4
- - self.pages.each do |page|
5
- - if page == self.current_page
6
- %div.current
7
- %span.current{:page => page}
8
- = page.translate.title
9
- - else
10
- %div.page
11
- %a.page{:href => '', :page => page}
12
- = page.translate.title
@@ -1,10 +0,0 @@
1
- - self.rendered?(__FILE__) do
2
- :plain
3
- // #{__FILE__}
4
- $(document).ready(function() {
5
- $("div.menu a.page").click(function(event) {
6
- event.preventDefault();
7
- RubyApp.sendEvent({_class:'RubyApp::Elements::Navigation::PageMenu::ClickedEvent', source_id:$(this).parent().parent().attr('id'), page:$(this).attr('page')});
8
- });
9
- });
10
- = yield
@@ -1,57 +0,0 @@
1
- module RubyApp
2
-
3
- module Elements
4
-
5
- module Navigation
6
- require 'ruby_app/element'
7
-
8
- class PageMenu < RubyApp::Element
9
-
10
- class ClickedEvent < RubyApp::Element::Event
11
-
12
- attr_reader :page
13
-
14
- def initialize(data)
15
- super(data)
16
- @page = eval(data['page'])
17
- end
18
-
19
- def to_hash
20
- super.merge('page' => @page)
21
- end
22
-
23
- end
24
-
25
- template_path(:all, File.dirname(__FILE__))
26
-
27
- attr_reader :pages
28
-
29
- def initialize
30
- super
31
- @pages = []
32
- end
33
-
34
- def current_page
35
- RubyApp::Session.pages.last.class
36
- end
37
-
38
- protected
39
-
40
- def on_event(event)
41
- on_clicked(event) if event.is_a?(RubyApp::Elements::Navigation::PageMenu::ClickedEvent)
42
- super(event)
43
- end
44
-
45
- def on_clicked(event)
46
- RubyApp::Session.pages.pop
47
- RubyApp::Session.pages.push(event.page.new)
48
- event.refresh
49
- end
50
-
51
- end
52
-
53
- end
54
-
55
- end
56
-
57
- end