webby 0.8.4 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (165) hide show
  1. data/History.txt +19 -0
  2. data/Manifest.txt +104 -91
  3. data/README.txt +27 -45
  4. data/Rakefile +4 -5
  5. data/bin/webby +2 -1
  6. data/bin/webby-gen +8 -0
  7. data/{data/Rakefile → examples/blog/Sitefile} +0 -2
  8. data/examples/{webby → blog}/tasks/blog.rake +5 -4
  9. data/{data → examples/blog}/templates/atom_feed.erb +10 -11
  10. data/{data → examples/blog}/templates/blog/month.erb +1 -1
  11. data/{data → examples/blog}/templates/blog/post.erb +1 -0
  12. data/{data → examples/blog}/templates/blog/year.erb +1 -1
  13. data/examples/presentation/{Rakefile → Sitefile} +0 -4
  14. data/examples/presentation/content/{_sample_code.txt → presentation/_sample_code.txt} +0 -0
  15. data/examples/presentation/content/{index.txt → presentation/index.txt} +0 -0
  16. data/{data/content → examples/presentation/content/presentation}/s5/blank.gif +0 -0
  17. data/{data/content → examples/presentation/content/presentation}/s5/bodybg.gif +0 -0
  18. data/{data/content → examples/presentation/content/presentation}/s5/framing.css +0 -0
  19. data/{data/content → examples/presentation/content/presentation}/s5/iepngfix.htc +0 -0
  20. data/{data/content → examples/presentation/content/presentation}/s5/opera.css +0 -0
  21. data/{data/content → examples/presentation/content/presentation}/s5/outline.css +0 -0
  22. data/{data/content → examples/presentation/content/presentation}/s5/pretty.css +0 -0
  23. data/{data/content → examples/presentation/content/presentation}/s5/print.css +0 -0
  24. data/{data/content → examples/presentation/content/presentation}/s5/s5-core.css +0 -0
  25. data/{data/content → examples/presentation/content/presentation}/s5/slides.css +0 -0
  26. data/{data/content → examples/presentation/content/presentation}/s5/slides.js +0 -0
  27. data/examples/presentation/layouts/{presentation.rhtml → presentation.txt} +3 -3
  28. data/examples/presentation/templates/{_partial.erb → _code_partial.erb} +0 -0
  29. data/examples/tumblog/Sitefile +9 -0
  30. data/examples/tumblog/content/css/tumblog.css +308 -0
  31. data/examples/tumblog/content/images/tumblog/permalink.gif +0 -0
  32. data/examples/tumblog/content/images/tumblog/rss.gif +0 -0
  33. data/examples/tumblog/content/tumblog/200806/the-noble-chicken/index.txt +12 -0
  34. data/examples/tumblog/content/tumblog/200807/historical-perspectives-on-the-classic-chicken-joke/index.txt +12 -0
  35. data/examples/tumblog/content/tumblog/200807/mad-city-chickens/index.txt +10 -0
  36. data/examples/tumblog/content/tumblog/200807/the-wisdom-of-the-dutch/index.txt +11 -0
  37. data/examples/tumblog/content/tumblog/200807/up-a-tree/index.txt +13 -0
  38. data/examples/tumblog/content/tumblog/index.txt +37 -0
  39. data/examples/tumblog/content/tumblog/rss.txt +37 -0
  40. data/examples/tumblog/layouts/tumblog/default.txt +44 -0
  41. data/examples/tumblog/layouts/tumblog/post.txt +15 -0
  42. data/examples/tumblog/lib/tumblog_helper.rb +32 -0
  43. data/examples/tumblog/tasks/tumblog.rake +30 -0
  44. data/examples/tumblog/templates/atom_feed.erb +40 -0
  45. data/examples/tumblog/templates/tumblog/conversation.erb +12 -0
  46. data/examples/tumblog/templates/tumblog/link.erb +10 -0
  47. data/examples/tumblog/templates/tumblog/photo.erb +13 -0
  48. data/examples/tumblog/templates/tumblog/post.erb +12 -0
  49. data/examples/tumblog/templates/tumblog/quote.erb +11 -0
  50. data/examples/webby/{Rakefile → Sitefile} +2 -2
  51. data/examples/webby/content/communicate/index.txt +28 -0
  52. data/examples/webby/content/css/background.gif +0 -0
  53. data/examples/webby/content/css/site.css +52 -20
  54. data/examples/webby/content/index.txt +7 -8
  55. data/examples/webby/content/learn/index.txt +28 -0
  56. data/examples/webby/content/reference/index.txt +3 -1
  57. data/examples/webby/content/release-notes/rel-0-9-0/index.txt +73 -0
  58. data/examples/webby/content/sitemap.txt +31 -0
  59. data/examples/webby/content/tips_and_tricks/index.txt +1 -1
  60. data/examples/webby/content/tutorial/index.txt +17 -17
  61. data/examples/webby/content/{manual → user-manual}/index.txt +53 -50
  62. data/examples/webby/layouts/{default.rhtml → default.txt} +8 -15
  63. data/examples/webby/templates/page.erb +1 -1
  64. data/examples/website/Sitefile +7 -0
  65. data/{data → examples/website}/content/css/blueprint/License.txt +0 -0
  66. data/{data → examples/website}/content/css/blueprint/Readme.txt +0 -0
  67. data/{data → examples/website}/content/css/blueprint/compressed/print.css +0 -0
  68. data/{data → examples/website}/content/css/blueprint/compressed/screen.css +0 -0
  69. data/{data → examples/website}/content/css/blueprint/lib/forms.css +0 -0
  70. data/{data → examples/website}/content/css/blueprint/lib/grid.css +0 -0
  71. data/{data → examples/website}/content/css/blueprint/lib/grid.png +0 -0
  72. data/{data → examples/website}/content/css/blueprint/lib/ie.css +0 -0
  73. data/{data → examples/website}/content/css/blueprint/lib/reset.css +0 -0
  74. data/{data → examples/website}/content/css/blueprint/lib/typography.css +0 -0
  75. data/{data → examples/website}/content/css/blueprint/plugins/buttons/Readme +0 -0
  76. data/{data → examples/website}/content/css/blueprint/plugins/buttons/buttons.css +0 -0
  77. data/{data → examples/website}/content/css/blueprint/plugins/buttons/icons/cross.png +0 -0
  78. data/{data → examples/website}/content/css/blueprint/plugins/buttons/icons/key.png +0 -0
  79. data/{data → examples/website}/content/css/blueprint/plugins/buttons/icons/tick.png +0 -0
  80. data/{data → examples/website}/content/css/blueprint/plugins/css-classes/Readme +0 -0
  81. data/{data → examples/website}/content/css/blueprint/plugins/css-classes/css-classes.css +0 -0
  82. data/{data → examples/website}/content/css/blueprint/plugins/fancy-type/Readme +0 -0
  83. data/{data → examples/website}/content/css/blueprint/plugins/fancy-type/fancy-type-compressed.css +0 -0
  84. data/{data → examples/website}/content/css/blueprint/plugins/fancy-type/fancy-type.css +0 -0
  85. data/{data → examples/website}/content/css/blueprint/print.css +0 -0
  86. data/{data → examples/website}/content/css/blueprint/screen.css +0 -0
  87. data/{data → examples/website}/content/css/coderay.css +0 -0
  88. data/{data → examples/website}/content/css/site.css +0 -0
  89. data/{data → examples/website}/content/index.txt +2 -1
  90. data/{data/layouts/default.rhtml → examples/website/layouts/default.txt} +1 -1
  91. data/{data → examples/website}/lib/breadcrumbs.rb +0 -0
  92. data/{data → examples/website}/templates/_partial.erb +0 -0
  93. data/{data → examples/website}/templates/page.erb +0 -0
  94. data/{data → examples/website}/templates/presentation.erb +0 -0
  95. data/lib/webby/apps/generator.rb +283 -0
  96. data/lib/webby/apps/main.rb +221 -0
  97. data/lib/webby/apps.rb +12 -0
  98. data/lib/webby/builder.rb +8 -10
  99. data/lib/webby/core_ext/enumerable.rb +11 -0
  100. data/lib/webby/{utils.rb → core_ext/hash.rb} +2 -26
  101. data/lib/webby/core_ext/kernel.rb +21 -0
  102. data/lib/webby/core_ext/string.rb +163 -0
  103. data/lib/webby/core_ext/time.rb +9 -0
  104. data/lib/webby/filters/haml.rb +13 -5
  105. data/lib/webby/filters/markdown.rb +12 -4
  106. data/lib/webby/filters/outline.rb +3 -2
  107. data/lib/webby/filters/sass.rb +12 -4
  108. data/lib/webby/filters/textile.rb +12 -4
  109. data/lib/webby/filters/tidy.rb +10 -8
  110. data/lib/webby/filters.rb +2 -0
  111. data/lib/webby/helpers/graphviz_helper.rb +1 -2
  112. data/lib/webby/helpers/tex_img_helper.rb +6 -10
  113. data/lib/webby/renderer.rb +5 -3
  114. data/lib/webby/resources/layout.rb +1 -1
  115. data/lib/webby/resources/page.rb +1 -1
  116. data/lib/webby/resources/resource.rb +13 -3
  117. data/lib/webby/resources.rb +16 -0
  118. data/{data → lib/webby}/tasks/build.rake +0 -0
  119. data/{examples/presentation → lib/webby}/tasks/create.rake +1 -1
  120. data/{data → lib/webby}/tasks/deploy.rake +0 -0
  121. data/{examples → lib}/webby/tasks/growl.rake +4 -1
  122. data/{data → lib/webby}/tasks/heel.rake +0 -0
  123. data/{data → lib/webby}/tasks/validate.rake +0 -0
  124. data/lib/webby.rb +11 -5
  125. data/spec/core_ext/hash_spec.rb +47 -0
  126. data/spec/core_ext/string_spec.rb +110 -0
  127. data/spec/core_ext/time_spec.rb +19 -0
  128. data/spec/webby/apps/generator_spec.rb +111 -0
  129. data/spec/webby/apps/main_spec.rb +75 -0
  130. data/spec/webby/helpers/capture_helper_spec.rb +1 -1
  131. data/spec/webby/resources_spec.rb +17 -0
  132. data/tasks/gem.rake +10 -2
  133. data/tasks/git.rake +41 -0
  134. data/tasks/rubyforge.rake +2 -2
  135. data/tasks/website.rake +38 -38
  136. metadata +125 -98
  137. data/data/tasks/blog.rake +0 -71
  138. data/data/tasks/create.rake +0 -22
  139. data/data/tasks/growl.rake +0 -12
  140. data/data/tasks/setup.rb +0 -17
  141. data/examples/presentation/content/s5/blank.gif +0 -0
  142. data/examples/presentation/content/s5/bodybg.gif +0 -0
  143. data/examples/presentation/content/s5/framing.css +0 -23
  144. data/examples/presentation/content/s5/iepngfix.htc +0 -42
  145. data/examples/presentation/content/s5/opera.css +0 -7
  146. data/examples/presentation/content/s5/outline.css +0 -15
  147. data/examples/presentation/content/s5/pretty.css +0 -86
  148. data/examples/presentation/content/s5/print.css +0 -1
  149. data/examples/presentation/content/s5/s5-core.css +0 -9
  150. data/examples/presentation/content/s5/slides.css +0 -3
  151. data/examples/presentation/content/s5/slides.js +0 -553
  152. data/examples/presentation/tasks/blog.rake +0 -71
  153. data/examples/presentation/tasks/build.rake +0 -27
  154. data/examples/presentation/tasks/deploy.rake +0 -22
  155. data/examples/presentation/tasks/growl.rake +0 -12
  156. data/examples/presentation/tasks/heel.rake +0 -28
  157. data/examples/presentation/tasks/setup.rb +0 -17
  158. data/examples/presentation/tasks/validate.rake +0 -19
  159. data/examples/webby/tasks/build.rake +0 -27
  160. data/examples/webby/tasks/create.rake +0 -22
  161. data/examples/webby/tasks/deploy.rake +0 -22
  162. data/examples/webby/tasks/heel.rake +0 -28
  163. data/examples/webby/tasks/setup.rb +0 -17
  164. data/examples/webby/tasks/validate.rake +0 -19
  165. data/lib/webby/main.rb +0 -227
@@ -1,553 +0,0 @@
1
- // S5 v1.1 slides.js -- released into the Public Domain
2
- //
3
- // Please see http://www.meyerweb.com/eric/tools/s5/credits.html for information
4
- // about all the wonderful and talented contributors to this code!
5
-
6
- var undef;
7
- var slideCSS = '';
8
- var snum = 0;
9
- var smax = 1;
10
- var incpos = 0;
11
- var number = undef;
12
- var s5mode = true;
13
- var defaultView = 'slideshow';
14
- var controlVis = 'visible';
15
-
16
- var isIE = navigator.appName == 'Microsoft Internet Explorer' && navigator.userAgent.indexOf('Opera') < 1 ? 1 : 0;
17
- var isOp = navigator.userAgent.indexOf('Opera') > -1 ? 1 : 0;
18
- var isGe = navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('Safari') < 1 ? 1 : 0;
19
-
20
- function hasClass(object, className) {
21
- if (!object.className) return false;
22
- return (object.className.search('(^|\\s)' + className + '(\\s|$)') != -1);
23
- }
24
-
25
- function hasValue(object, value) {
26
- if (!object) return false;
27
- return (object.search('(^|\\s)' + value + '(\\s|$)') != -1);
28
- }
29
-
30
- function removeClass(object,className) {
31
- if (!object) return;
32
- object.className = object.className.replace(new RegExp('(^|\\s)'+className+'(\\s|$)'), RegExp.$1+RegExp.$2);
33
- }
34
-
35
- function addClass(object,className) {
36
- if (!object || hasClass(object, className)) return;
37
- if (object.className) {
38
- object.className += ' '+className;
39
- } else {
40
- object.className = className;
41
- }
42
- }
43
-
44
- function GetElementsWithClassName(elementName,className) {
45
- var allElements = document.getElementsByTagName(elementName);
46
- var elemColl = new Array();
47
- for (var i = 0; i< allElements.length; i++) {
48
- if (hasClass(allElements[i], className)) {
49
- elemColl[elemColl.length] = allElements[i];
50
- }
51
- }
52
- return elemColl;
53
- }
54
-
55
- function isParentOrSelf(element, id) {
56
- if (element == null || element.nodeName=='BODY') return false;
57
- else if (element.id == id) return true;
58
- else return isParentOrSelf(element.parentNode, id);
59
- }
60
-
61
- function nodeValue(node) {
62
- var result = "";
63
- if (node.nodeType == 1) {
64
- var children = node.childNodes;
65
- for (var i = 0; i < children.length; ++i) {
66
- result += nodeValue(children[i]);
67
- }
68
- }
69
- else if (node.nodeType == 3) {
70
- result = node.nodeValue;
71
- }
72
- return(result);
73
- }
74
-
75
- function slideLabel() {
76
- var slideColl = GetElementsWithClassName('*','slide');
77
- var list = document.getElementById('jumplist');
78
- smax = slideColl.length;
79
- for (var n = 0; n < smax; n++) {
80
- var obj = slideColl[n];
81
-
82
- var did = 'slide' + n.toString();
83
- obj.setAttribute('id',did);
84
- if (isOp) continue;
85
-
86
- var otext = '';
87
- var menu = obj.firstChild;
88
- if (!menu) continue; // to cope with empty slides
89
- while (menu && menu.nodeType == 3) {
90
- menu = menu.nextSibling;
91
- }
92
- if (!menu) continue; // to cope with slides with only text nodes
93
-
94
- var menunodes = menu.childNodes;
95
- for (var o = 0; o < menunodes.length; o++) {
96
- otext += nodeValue(menunodes[o]);
97
- }
98
- list.options[list.length] = new Option(n + ' : ' + otext, n);
99
- }
100
- }
101
-
102
- function currentSlide() {
103
- var cs;
104
- if (document.getElementById) {
105
- cs = document.getElementById('currentSlide');
106
- } else {
107
- cs = document.currentSlide;
108
- }
109
- cs.innerHTML = '<span id="csHere">' + snum + '<\/span> ' +
110
- '<span id="csSep">\/<\/span> ' +
111
- '<span id="csTotal">' + (smax-1) + '<\/span>';
112
- if (snum == 0) {
113
- cs.style.visibility = 'hidden';
114
- } else {
115
- cs.style.visibility = 'visible';
116
- }
117
- }
118
-
119
- function go(step) {
120
- if (document.getElementById('slideProj').disabled || step == 0) return;
121
- var jl = document.getElementById('jumplist');
122
- var cid = 'slide' + snum;
123
- var ce = document.getElementById(cid);
124
- if (incrementals[snum].length > 0) {
125
- for (var i = 0; i < incrementals[snum].length; i++) {
126
- removeClass(incrementals[snum][i], 'current');
127
- removeClass(incrementals[snum][i], 'incremental');
128
- }
129
- }
130
- if (step != 'j') {
131
- snum += step;
132
- lmax = smax - 1;
133
- if (snum > lmax) snum = lmax;
134
- if (snum < 0) snum = 0;
135
- } else
136
- snum = parseInt(jl.value);
137
- var nid = 'slide' + snum;
138
- var ne = document.getElementById(nid);
139
- if (!ne) {
140
- ne = document.getElementById('slide0');
141
- snum = 0;
142
- }
143
- if (step < 0) {incpos = incrementals[snum].length} else {incpos = 0;}
144
- if (incrementals[snum].length > 0 && incpos == 0) {
145
- for (var i = 0; i < incrementals[snum].length; i++) {
146
- if (hasClass(incrementals[snum][i], 'current'))
147
- incpos = i + 1;
148
- else
149
- addClass(incrementals[snum][i], 'incremental');
150
- }
151
- }
152
- if (incrementals[snum].length > 0 && incpos > 0)
153
- addClass(incrementals[snum][incpos - 1], 'current');
154
- ce.style.visibility = 'hidden';
155
- ne.style.visibility = 'visible';
156
- jl.selectedIndex = snum;
157
- currentSlide();
158
- number = 0;
159
- }
160
-
161
- function goTo(target) {
162
- if (target >= smax || target == snum) return;
163
- go(target - snum);
164
- }
165
-
166
- function subgo(step) {
167
- if (step > 0) {
168
- removeClass(incrementals[snum][incpos - 1],'current');
169
- removeClass(incrementals[snum][incpos], 'incremental');
170
- addClass(incrementals[snum][incpos],'current');
171
- incpos++;
172
- } else {
173
- incpos--;
174
- removeClass(incrementals[snum][incpos],'current');
175
- addClass(incrementals[snum][incpos], 'incremental');
176
- addClass(incrementals[snum][incpos - 1],'current');
177
- }
178
- }
179
-
180
- function toggle() {
181
- var slideColl = GetElementsWithClassName('*','slide');
182
- var slides = document.getElementById('slideProj');
183
- var outline = document.getElementById('outlineStyle');
184
- if (!slides.disabled) {
185
- slides.disabled = true;
186
- outline.disabled = false;
187
- s5mode = false;
188
- fontSize('1em');
189
- for (var n = 0; n < smax; n++) {
190
- var slide = slideColl[n];
191
- slide.style.visibility = 'visible';
192
- }
193
- } else {
194
- slides.disabled = false;
195
- outline.disabled = true;
196
- s5mode = true;
197
- fontScale();
198
- for (var n = 0; n < smax; n++) {
199
- var slide = slideColl[n];
200
- slide.style.visibility = 'hidden';
201
- }
202
- slideColl[snum].style.visibility = 'visible';
203
- }
204
- }
205
-
206
- function showHide(action) {
207
- var obj = GetElementsWithClassName('*','hideme')[0];
208
- switch (action) {
209
- case 's': obj.style.visibility = 'visible'; break;
210
- case 'h': obj.style.visibility = 'hidden'; break;
211
- case 'k':
212
- if (obj.style.visibility != 'visible') {
213
- obj.style.visibility = 'visible';
214
- } else {
215
- obj.style.visibility = 'hidden';
216
- }
217
- break;
218
- }
219
- }
220
-
221
- // 'keys' code adapted from MozPoint (http://mozpoint.mozdev.org/)
222
- function keys(key) {
223
- if (!key) {
224
- key = event;
225
- key.which = key.keyCode;
226
- }
227
- if (key.which == 84) {
228
- toggle();
229
- return;
230
- }
231
- if (s5mode) {
232
- switch (key.which) {
233
- case 10: // return
234
- case 13: // enter
235
- if (window.event && isParentOrSelf(window.event.srcElement, 'controls')) return;
236
- if (key.target && isParentOrSelf(key.target, 'controls')) return;
237
- if(number != undef) {
238
- goTo(number);
239
- break;
240
- }
241
- case 32: // spacebar
242
- case 34: // page down
243
- case 39: // rightkey
244
- case 40: // downkey
245
- if(number != undef) {
246
- go(number);
247
- } else if (!incrementals[snum] || incpos >= incrementals[snum].length) {
248
- go(1);
249
- } else {
250
- subgo(1);
251
- }
252
- break;
253
- case 33: // page up
254
- case 37: // leftkey
255
- case 38: // upkey
256
- if(number != undef) {
257
- go(-1 * number);
258
- } else if (!incrementals[snum] || incpos <= 0) {
259
- go(-1);
260
- } else {
261
- subgo(-1);
262
- }
263
- break;
264
- case 36: // home
265
- goTo(0);
266
- break;
267
- case 35: // end
268
- goTo(smax-1);
269
- break;
270
- case 67: // c
271
- showHide('k');
272
- break;
273
- }
274
- if (key.which < 48 || key.which > 57) {
275
- number = undef;
276
- } else {
277
- if (window.event && isParentOrSelf(window.event.srcElement, 'controls')) return;
278
- if (key.target && isParentOrSelf(key.target, 'controls')) return;
279
- number = (((number != undef) ? number : 0) * 10) + (key.which - 48);
280
- }
281
- }
282
- return false;
283
- }
284
-
285
- function clicker(e) {
286
- number = undef;
287
- var target;
288
- if (window.event) {
289
- target = window.event.srcElement;
290
- e = window.event;
291
- } else target = e.target;
292
- if (target.getAttribute('href') != null || hasValue(target.rel, 'external') || isParentOrSelf(target, 'controls') || isParentOrSelf(target,'embed') || isParentOrSelf(target,'object')) return true;
293
- if (!e.which || e.which == 1) {
294
- if (!incrementals[snum] || incpos >= incrementals[snum].length) {
295
- go(1);
296
- } else {
297
- subgo(1);
298
- }
299
- }
300
- }
301
-
302
- function findSlide(hash) {
303
- var target = null;
304
- var slides = GetElementsWithClassName('*','slide');
305
- for (var i = 0; i < slides.length; i++) {
306
- var targetSlide = slides[i];
307
- if ( (targetSlide.name && targetSlide.name == hash)
308
- || (targetSlide.id && targetSlide.id == hash) ) {
309
- target = targetSlide;
310
- break;
311
- }
312
- }
313
- while(target != null && target.nodeName != 'BODY') {
314
- if (hasClass(target, 'slide')) {
315
- return parseInt(target.id.slice(5));
316
- }
317
- target = target.parentNode;
318
- }
319
- return null;
320
- }
321
-
322
- function slideJump() {
323
- if (window.location.hash == null) return;
324
- var sregex = /^#slide(\d+)$/;
325
- var matches = sregex.exec(window.location.hash);
326
- var dest = null;
327
- if (matches != null) {
328
- dest = parseInt(matches[1]);
329
- } else {
330
- dest = findSlide(window.location.hash.slice(1));
331
- }
332
- if (dest != null)
333
- go(dest - snum);
334
- }
335
-
336
- function fixLinks() {
337
- var thisUri = window.location.href;
338
- thisUri = thisUri.slice(0, thisUri.length - window.location.hash.length);
339
- var aelements = document.getElementsByTagName('A');
340
- for (var i = 0; i < aelements.length; i++) {
341
- var a = aelements[i].href;
342
- var slideID = a.match('\#slide[0-9]{1,2}');
343
- if ((slideID) && (slideID[0].slice(0,1) == '#')) {
344
- var dest = findSlide(slideID[0].slice(1));
345
- if (dest != null) {
346
- if (aelements[i].addEventListener) {
347
- aelements[i].addEventListener("click", new Function("e",
348
- "if (document.getElementById('slideProj').disabled) return;" +
349
- "go("+dest+" - snum); " +
350
- "if (e.preventDefault) e.preventDefault();"), true);
351
- } else if (aelements[i].attachEvent) {
352
- aelements[i].attachEvent("onclick", new Function("",
353
- "if (document.getElementById('slideProj').disabled) return;" +
354
- "go("+dest+" - snum); " +
355
- "event.returnValue = false;"));
356
- }
357
- }
358
- }
359
- }
360
- }
361
-
362
- function externalLinks() {
363
- if (!document.getElementsByTagName) return;
364
- var anchors = document.getElementsByTagName('a');
365
- for (var i=0; i<anchors.length; i++) {
366
- var anchor = anchors[i];
367
- if (anchor.getAttribute('href') && hasValue(anchor.rel, 'external')) {
368
- anchor.target = '_blank';
369
- addClass(anchor,'external');
370
- }
371
- }
372
- }
373
-
374
- function createControls() {
375
- var controlsDiv = document.getElementById("controls");
376
- if (!controlsDiv) return;
377
- var hider = ' onmouseover="showHide(\'s\');" onmouseout="showHide(\'h\');"';
378
- var hideDiv, hideList = '';
379
- if (controlVis == 'hidden') {
380
- hideDiv = hider;
381
- } else {
382
- hideList = hider;
383
- }
384
- controlsDiv.innerHTML = '<form action="#" id="controlForm"' + hideDiv + '>' +
385
- '<div id="navLinks">' +
386
- '<a accesskey="t" id="toggle" href="javascript:toggle();">&#216;<\/a>' +
387
- '<a accesskey="z" id="prev" href="javascript:go(-1);">&laquo;<\/a>' +
388
- '<a accesskey="x" id="next" href="javascript:go(1);">&raquo;<\/a>' +
389
- '<div id="navList"' + hideList + '><select id="jumplist" onchange="go(\'j\');"><\/select><\/div>' +
390
- '<\/div><\/form>';
391
- if (controlVis == 'hidden') {
392
- var hidden = document.getElementById('navLinks');
393
- } else {
394
- var hidden = document.getElementById('jumplist');
395
- }
396
- addClass(hidden,'hideme');
397
- }
398
-
399
- function fontScale() { // causes layout problems in FireFox that get fixed if browser's Reload is used; same may be true of other Gecko-based browsers
400
- if (!s5mode) return false;
401
- var vScale = 22; // both yield 32 (after rounding) at 1024x768
402
- var hScale = 32; // perhaps should auto-calculate based on theme's declared value?
403
- if (window.innerHeight) {
404
- var vSize = window.innerHeight;
405
- var hSize = window.innerWidth;
406
- } else if (document.documentElement.clientHeight) {
407
- var vSize = document.documentElement.clientHeight;
408
- var hSize = document.documentElement.clientWidth;
409
- } else if (document.body.clientHeight) {
410
- var vSize = document.body.clientHeight;
411
- var hSize = document.body.clientWidth;
412
- } else {
413
- var vSize = 700; // assuming 1024x768, minus chrome and such
414
- var hSize = 1024; // these do not account for kiosk mode or Opera Show
415
- }
416
- var newSize = Math.min(Math.round(vSize/vScale),Math.round(hSize/hScale));
417
- fontSize(newSize + 'px');
418
- if (isGe) { // hack to counter incremental reflow bugs
419
- var obj = document.getElementsByTagName('body')[0];
420
- obj.style.display = 'none';
421
- obj.style.display = 'block';
422
- }
423
- }
424
-
425
- function fontSize(value) {
426
- if (!(s5ss = document.getElementById('s5ss'))) {
427
- if (!isIE) {
428
- document.getElementsByTagName('head')[0].appendChild(s5ss = document.createElement('style'));
429
- s5ss.setAttribute('media','screen, projection');
430
- s5ss.setAttribute('id','s5ss');
431
- } else {
432
- document.createStyleSheet();
433
- document.s5ss = document.styleSheets[document.styleSheets.length - 1];
434
- }
435
- }
436
- if (!isIE) {
437
- while (s5ss.lastChild) s5ss.removeChild(s5ss.lastChild);
438
- s5ss.appendChild(document.createTextNode('body {font-size: ' + value + ' !important;}'));
439
- } else {
440
- document.s5ss.addRule('body','font-size: ' + value + ' !important;');
441
- }
442
- }
443
-
444
- function notOperaFix() {
445
- slideCSS = document.getElementById('slideProj').href;
446
- var slides = document.getElementById('slideProj');
447
- var outline = document.getElementById('outlineStyle');
448
- slides.setAttribute('media','screen');
449
- outline.disabled = true;
450
- if (isGe) {
451
- slides.setAttribute('href','null'); // Gecko fix
452
- slides.setAttribute('href',slideCSS); // Gecko fix
453
- }
454
- if (isIE && document.styleSheets && document.styleSheets[0]) {
455
- document.styleSheets[0].addRule('img', 'behavior: url(ui/default/iepngfix.htc)');
456
- document.styleSheets[0].addRule('div', 'behavior: url(ui/default/iepngfix.htc)');
457
- document.styleSheets[0].addRule('.slide', 'behavior: url(ui/default/iepngfix.htc)');
458
- }
459
- }
460
-
461
- function getIncrementals(obj) {
462
- var incrementals = new Array();
463
- if (!obj)
464
- return incrementals;
465
- var children = obj.childNodes;
466
- for (var i = 0; i < children.length; i++) {
467
- var child = children[i];
468
- if (hasClass(child, 'incremental')) {
469
- if (child.nodeName == 'OL' || child.nodeName == 'UL') {
470
- removeClass(child, 'incremental');
471
- for (var j = 0; j < child.childNodes.length; j++) {
472
- if (child.childNodes[j].nodeType == 1) {
473
- addClass(child.childNodes[j], 'incremental');
474
- }
475
- }
476
- } else {
477
- incrementals[incrementals.length] = child;
478
- removeClass(child,'incremental');
479
- }
480
- }
481
- if (hasClass(child, 'show-first')) {
482
- if (child.nodeName == 'OL' || child.nodeName == 'UL') {
483
- removeClass(child, 'show-first');
484
- if (child.childNodes[isGe].nodeType == 1) {
485
- removeClass(child.childNodes[isGe], 'incremental');
486
- }
487
- } else {
488
- incrementals[incrementals.length] = child;
489
- }
490
- }
491
- incrementals = incrementals.concat(getIncrementals(child));
492
- }
493
- return incrementals;
494
- }
495
-
496
- function createIncrementals() {
497
- var incrementals = new Array();
498
- for (var i = 0; i < smax; i++) {
499
- incrementals[i] = getIncrementals(document.getElementById('slide'+i));
500
- }
501
- return incrementals;
502
- }
503
-
504
- function defaultCheck() {
505
- var allMetas = document.getElementsByTagName('meta');
506
- for (var i = 0; i< allMetas.length; i++) {
507
- if (allMetas[i].name == 'defaultView') {
508
- defaultView = allMetas[i].content;
509
- }
510
- if (allMetas[i].name == 'controlVis') {
511
- controlVis = allMetas[i].content;
512
- }
513
- }
514
- }
515
-
516
- // Key trap fix, new function body for trap()
517
- function trap(e) {
518
- if (!e) {
519
- e = event;
520
- e.which = e.keyCode;
521
- }
522
- try {
523
- modifierKey = e.ctrlKey || e.altKey || e.metaKey;
524
- }
525
- catch(e) {
526
- modifierKey = false;
527
- }
528
- return modifierKey || e.which == 0;
529
- }
530
-
531
- function startup() {
532
- defaultCheck();
533
- if (!isOp)
534
- createControls();
535
- slideLabel();
536
- fixLinks();
537
- externalLinks();
538
- fontScale();
539
- if (!isOp) {
540
- notOperaFix();
541
- incrementals = createIncrementals();
542
- slideJump();
543
- if (defaultView == 'outline') {
544
- toggle();
545
- }
546
- document.onkeyup = keys;
547
- document.onkeypress = trap;
548
- document.onclick = clicker;
549
- }
550
- }
551
-
552
- window.onload = startup;
553
- window.onresize = function(){setTimeout('fontScale()', 50);}
@@ -1,71 +0,0 @@
1
-
2
- namespace :blog do
3
-
4
- # iterate over all the files in the "templates/blog" folder and create a
5
- # rake task corresponding to each file found
6
- FileList["#{Webby.site.template_dir}/blog/*"].each do |template|
7
- next unless test(?f, template)
8
- name = template.pathmap('%n')
9
- next if name =~ %r/^(month|year)$/ # skip month/year blog entries
10
-
11
- desc "Create a new blog #{name}"
12
- task name => [:create_year_index, :create_month_index] do |t|
13
- page, title, dir = Webby::Builder.new_page_info(t)
14
-
15
- # if no directory was given use the default blog directory (underneath
16
- # the content directory)
17
- dir = Webby.site.blog_dir if dir.empty?
18
- dir = File.join(dir, Time.now.strftime('%Y/%m/%d'))
19
-
20
- page = File.join(dir, File.basename(page))
21
- page = Webby::Builder.create(page, :from => template,
22
- :locals => {:title => title, :directory => dir})
23
- exec(::Webby.editor, page) unless ::Webby.editor.nil?
24
- end
25
- end # each
26
-
27
- # this task is used to create the year index file (blog/2008/index.txt)
28
- task :create_year_index do |t|
29
- # parse out information about the page to create
30
- _, _, dir = Webby::Builder.new_page_info(t)
31
- year = Time.now.strftime '%Y'
32
-
33
- # if no directory was given use the default blog directory (underneath
34
- # the content directory)
35
- dir = Webby.site.blog_dir if dir.empty?
36
- dir = File.join(dir, year)
37
-
38
- # determine the filename and template name
39
- fn = File.join(dir, 'index.txt')
40
- tmpl = Dir.glob(File.join(Webby.site.template_dir, 'blog/year.*')).first.to_s
41
-
42
- if test(?f, tmpl) and not test(?f, File.join(Webby.site.content_dir, fn))
43
- Webby::Builder.create(fn, :from => tmpl,
44
- :locals => {:title => year, :directory => dir})
45
- end
46
- end
47
-
48
- # this task is used to create the month index file (blog/2008/04/index.txt)
49
- task :create_month_index do |t|
50
- # parse out information about the page to create
51
- _, _, dir = Webby::Builder.new_page_info(t)
52
- now = Time.now
53
-
54
- # if no directory was given use the default blog directory (underneath
55
- # the content directory)
56
- dir = Webby.site.blog_dir if dir.empty?
57
- dir = File.join(dir, now.strftime('%Y/%m'))
58
-
59
- # determine the filename and template name
60
- fn = File.join(dir, 'index.txt')
61
- tmpl = Dir.glob(File.join(Webby.site.template_dir, 'blog/month.*')).first.to_s
62
-
63
- if test(?f, tmpl) and not test(?f, File.join(Webby.site.content_dir, fn))
64
- Webby::Builder.create(fn, :from => tmpl,
65
- :locals => {:title => year, :directory => dir})
66
- end
67
- end
68
-
69
- end # namespace :blog
70
-
71
- # EOF
@@ -1,27 +0,0 @@
1
-
2
- task :configure_basepath do
3
- Webby.site.base = ENV['BASE'] if ENV.has_key?('BASE')
4
- end
5
-
6
- desc "Build the website"
7
- task :build => :configure_basepath do |t|
8
- Webby::Builder.run
9
- end
10
-
11
- desc "Rebuild the website"
12
- task :rebuild => :configure_basepath do |t|
13
- Webby::Builder.run :rebuild => true
14
- end
15
-
16
- desc "Continuously build the website"
17
- task :autobuild => :configure_basepath do |t|
18
- Webby::AutoBuilder.run
19
- end
20
-
21
- desc "Delete the website"
22
- task :clobber do |t|
23
- rm_rf Webby.site.output_dir
24
- mkdir Webby.site.output_dir
25
- end
26
-
27
- # EOF
@@ -1,22 +0,0 @@
1
-
2
- require 'rake/contrib/sshpublisher'
3
-
4
- namespace :deploy do
5
-
6
- desc 'Deploy to the server using rsync'
7
- task :rsync do
8
- cmd = "rsync #{SITE.rsync_args.join(' ')} "
9
- cmd << "#{SITE.output_dir}/ #{SITE.user}@#{SITE.host}:#{SITE.remote_dir}"
10
- sh cmd
11
- end
12
-
13
- desc 'Deploy to the server using ssh'
14
- task :ssh do
15
- Rake::SshDirPublisher.new(
16
- "#{SITE.user}@#{SITE.host}", SITE.remote_dir, SITE.output_dir
17
- ).upload
18
- end
19
-
20
- end # deploy
21
-
22
- # EOF
@@ -1,12 +0,0 @@
1
-
2
- desc 'Send log events to Growl (Mac OS X only)'
3
- task :growl do
4
- Logging::Logger['Webby'].add_appenders(Logging::Appenders::Growl.new(
5
- "Webby",
6
- :layout => Logging::Layouts::Pattern.new(:pattern => "%5l - Webby\000%m"),
7
- :coalesce => true,
8
- :separator => "\000"
9
- ))
10
- end
11
-
12
- # EOF