Take the 2008 Git User's Survey and help out! [ hide ]

public
Description: An OS X application to build a standalone web site as an export from my photo album.
Homepage: http://bleu.west.spy.net/~dustin/projects/photosync/
Clone URL: git://github.com/dustin/photosync.git
Search Repo:
collapsed index view
dustin (author)
Sun Aug 21 00:36:30 -0700 2005
commit  ebc86f3af3c05a8710cf1b05587681bdbb00acdd
tree    5fa9f2b9d0c3556cd23b8ab891e39134f4ca1ac9
parent  f35128674d4484ee1f25908c6787bdce7be27d6b
...
139
140
141
 
 
142
143
144
...
216
217
218
 
 
219
220
221
...
225
226
227
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
228
229
230
...
139
140
141
142
143
144
145
146
...
218
219
220
221
222
223
224
225
...
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
0
@@ -139,6 +139,8 @@
0
 // Format for the index on the index page
0
 #define INDEX_INDEX_FMT \
0
   @"<li><a href=\"pages/%@.html\">%@ (%d %@)</a></li>\n"
0
+#define INDEX_DECADE_FMT \
0
+ @"<li id=\"y%d\" onclick=\"toggleDisplay('y%d')\">%ds (%d %@)\n\t<ul>\n"
0
 // Format for the month list on a year page
0
 #define YEAR_MONTH_INDEX_FMT \
0
   @"<li><a href=\"%@/%02d.html\">%02d (%d %@)</a></li>"
0
@@ -216,6 +218,8 @@
0
   NSMutableString *yearIdx=[[NSMutableString alloc] initWithCapacity:256];
0
   [indexIdx setString:@""];
0
 
0
+ int decade=0;
0
+
0
   e=[years objectEnumerator];
0
   while(year = [e nextObject]) {
0
     [yearIdx setString:@""];
0
@@ -225,6 +229,26 @@
0
       [location destDir], year];
0
     [self ensureDir:yearDir];
0
 
0
+ int yearInt=[year intValue];
0
+ if(((yearInt / 10) * 10) != decade) {
0
+
0
+ if(decade != 0) {
0
+ [indexIdx appendString: @"</ul></li>\n"];
0
+ }
0
+
0
+ decade=((yearInt / 10) * 10);
0
+ int decadeCount=0;
0
+ int i=0;
0
+ for(i=0; i<10; i++) {
0
+ decadeCount+=[yearSet countForObject:
0
+ [NSString stringWithFormat:@"%d", decade+i]];
0
+ }
0
+
0
+ [indexIdx appendFormat:INDEX_DECADE_FMT,
0
+ decade, decade, decade, decadeCount,
0
+ (decadeCount == 1 ? @"image":@"images")];
0
+ }
0
+
0
     // Set up the index line
0
     int yearCount=[yearSet countForObject: year];
0
     [indexIdx appendFormat:INDEX_INDEX_FMT,
...
5
6
7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
9
 
 
 
10
11
 
 
 
 
12
13
14
 
 
15
 
16
17
...
5
6
7
8
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
0
@@ -5,13 +5,47 @@
0
   <head>
0
     <title>Photos</title>
0
     <link rel="stylesheet" href="style.css" />
0
+ <style type="text/css">
0
+ .hidden { display: none; }
0
+ .displayed { display: block; }
0
+ </style>
0
+ <script type="text/javascript">
0
+ // <![CDATA[
0
+ function init() {
0
+ var years=document.getElementsByTagName("li");
0
+ for(var i=0; i<years.length; i++) {
0
+ if(years[i].id != undefined && years[i].id[0] == 'y') {
0
+ years[i].getElementsByTagName("ul")[0].className="hidden";
0
+ }
0
+ }
0
+ }
0
+
0
+ function toggleDisplay(y) {
0
+ var theYear=document.getElementById(y);
0
+ var theChild=theYear.getElementsByTagName("ul")[0];
0
+ if(theChild.className == 'hidden') {
0
+ theChild.className='displayed';
0
+ } else {
0
+ theChild.className='hidden';
0
+ }
0
+ }
0
+ // ]]>
0
+ </script>
0
   </head>
0
- <body>
0
+
0
+ <body onload="init()">
0
+
0
     <h1>Search</h1>
0
- <a href="search.html">Search</a>
0
+ <p>
0
+ <a href="search.html">Search</a>
0
+ </p>
0
+
0
     <h1>Years</h1>
0
     <ul>
0
       %YEARS%
0
+ </ul>
0
+ </li>
0
     </ul>
0
+
0
   </body>
0
 </html>

Comments

    No one has commented yet.