Skip to content
This repository has been archived by the owner on Dec 25, 2020. It is now read-only.

Commit

Permalink
modificiation to run again with the current version of Wee
Browse files Browse the repository at this point in the history
  • Loading branch information
mneumann committed Jan 26, 2005
1 parent bec3840 commit 440385d
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions examples/calendar.rb
Expand Up @@ -3,7 +3,7 @@
$LOAD_PATH.unshift << "../lib"
require 'wee'
require 'wee/adaptors/webrick'
require 'wee/utils/cache'
require 'wee/utils'
require 'date'

class Date
Expand Down Expand Up @@ -184,7 +184,7 @@ def render_styles
#
def render_header
r.table_row do
r.table_header.colspan(4).with { r.encoded_text(month_heading) }
r.table_header.colspan(4).with { r.encode_text(month_heading) }
r.table_header { r.anchor.callback { go_prev }.with(prev_month_abbr) }
r.table_header { r.anchor.callback { go_next }.with(next_month_abbr) }
r.table_header { browse? ? r.space : r.anchor.callback { back }.style('color: black').with('X') }
Expand All @@ -194,7 +194,7 @@ def render_header
# Render Calendar footer
#
def render_footer
r.table_row { r.table_header.colspan(7).with { r.encoded_text(today_string) } }
r.table_row { r.table_header.colspan(7).with { r.encode_text(today_string) } }
end

# Render Calendar
Expand Down Expand Up @@ -316,7 +316,7 @@ def backtrack_state(snap)
#
def render_icon
icon = 'http://www.softcomplex.com/products/tigra_calendar/img/cal.gif'
r.img.src(icon).width(16).height(16).border(0).alt('Calendar')
r.image.src(icon).width(16).height(16).border(0).alt('Calendar')
end

# Render Calendar demo
Expand Down Expand Up @@ -349,18 +349,6 @@ def calendar()
end
end

class MySession < Wee::Session
def initialize
super do
self.root_component = CustomCalendarDemo.new
self.page_store = Wee::Utils::LRUCache.new(10) # backtrack up to 10 pages
end
end
end

app = Wee::Application.new {|app|
app.default_request_handler { MySession.new }
app.id_generator = Wee::SimpleIdGenerator.new(rand(1_000_000))
}
app = Wee::Utils.app_for(CustomCalendarDemo)
Wee::WEBrickAdaptor.register('/app' => app).start
end

0 comments on commit 440385d

Please sign in to comment.