Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Started making less-clever, but more usuable lists |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA3-256: |
c2b66f157010296e0834e3b2a8d9a4b8 |
| User & Date: | i5ivem@gmail.com 2010-04-06 16:16:35 |
Context
|
2010-04-07
| ||
| 16:12 | Redraw calendar each time check-in: d43fb93b4f user: i5ivem@gmail.com tags: trunk | |
|
2010-04-06
| ||
| 16:16 | Started making less-clever, but more usuable lists check-in: c2b66f1570 user: i5ivem@gmail.com tags: trunk | |
| 15:17 | Playing about with re-using list drop downs check-in: 6475c16072 user: i5ivem@gmail.com tags: trunk | |
Changes
Changes to shoefiti.rb.
| ︙ | ︙ | |||
9 10 11 12 13 14 15 | #only works once. #class listsel # url #extend the list_box method? I.e. what gets executed on selection? # | > | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | | > > > > | > | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
#only works once.
#class listsel
# url
#extend the list_box method? I.e. what gets executed on selection?
#
#must reset
@stack_list = stack :margin => 10 do
@list_list = list_box do |list|
@stack_day.hide
download(URL+list.text) do |resp|
@list_year.items = eval(resp.response.body)[1]
@stack_year.show
end
end
end
@stack_year = stack :margin => 10 do
@list_year = list_box do |year|
download(URL+@list_list.text+year.text) do |resp|
@list_day.items = eval(resp.response.body)[1]
@stack_day.show
end
end
end
@stack_day = stack :margin => 10 do
@list_day = list_box do |day|
download(URL+@list_list.text+@list_year.text+day.text) do |resp|
@place = eval(resp.response.body)[0].split("/")
drawcalendar(@place.pop.to_i, @place.pop.to_i, @place.pop.to_s, eval(resp.response.body)[1])
drawmailpane
end
end
end
def init
download(URL) do |resp|
@list_list.items = eval(resp.response.body)[1]
@stack_list.show
end
end
=begin
@place = eval(list.response.body)[0].split("/")
#debug(@lists)
#debug(@place)
stack :margin => 10 do
@loading.hide
@animate.stop
@loaded.show
|
| ︙ | ︙ | |||
49 50 51 52 53 54 55 | def make_list_box(lists) list_box :items => lists do |list| @listurl += list.text debug(lists) getlist end end | | > | | 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
def make_list_box(lists)
list_box :items => lists do |list|
@listurl += list.text
debug(lists)
getlist
end
end
=end
#Need to clear and redraw like mailpane
def drawcalendar(month, year, list, maildays)
off=Date.new(year, month, 01).wday-1 #Offset, not sure why I need the -1 here, but I do.
mdays=(Date.new(year, 12, 31) << (12-month)).day #Days in the month
rows=((mdays+off+1).to_f/7.0).ceil #Number of rows in calendar, plus 1 to compensate for -1 above. Have confused myself
days = %w{Su Mo Tu We Th Fr Sa}
days.each do |column|
i = days.index(column)
row = 0
stack :left => i*40+250, :top => 0 do
para column
until row == rows do
calday = i-off+7*row
if (1..mdays) === calday #Only want to draw if greater than zero and less than max days
if calday.to_s.length == 1
caldaystr = "0"+calday.to_s #need "0" in front of single digits
else
|
| ︙ | ︙ | |||
136 137 138 139 140 141 142 | end def drawmailpane @messagelist = stack :height => 425, :scroll => true end | | > > > | > > > > | 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 | end def drawmailpane @messagelist = stack :height => 425, :scroll => true end =begin @loading = para "Loading Lists...", :margin => 10 @animate = animate(5) do |frame| weight = ["bold", "normal"] @loading.style(:weight => weight[frame&1]) end @loaded = para "Pick list to browse", :margin => 10 @loaded.hide =end URL = "http://librelist.com/archives/" @listurl = "" @stack_list.hide @stack_year.hide @stack_day.hide init end |