hobix 0.4 → 0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (129) hide show
  1. data/COPYING +18 -0
  2. data/README +18 -0
  3. data/Rakefile +96 -0
  4. data/bin/hobix +7 -3
  5. data/contrib/blosxom-to-hobix.rb +253 -0
  6. data/contrib/txp-to-hobix.rb +56 -0
  7. data/contrib/webrick-all-mine.rb +20 -0
  8. data/doc/CHANGELOG +285 -0
  9. data/doc/rdoc/classes/Hobix/API.html +382 -0
  10. data/doc/rdoc/classes/Hobix/Article.html +111 -0
  11. data/doc/rdoc/classes/Hobix/BaseContent.html +692 -0
  12. data/doc/rdoc/classes/Hobix/BaseEntry.html +218 -0
  13. data/doc/rdoc/classes/Hobix/BaseFacet.html +205 -0
  14. data/doc/rdoc/classes/Hobix/BaseOutput.html +122 -0
  15. data/doc/rdoc/classes/Hobix/BasePlugin.html +201 -0
  16. data/doc/rdoc/classes/Hobix/BaseProperties/ClassMethods.html +243 -0
  17. data/doc/rdoc/classes/Hobix/BaseProperties.html +218 -0
  18. data/doc/rdoc/classes/Hobix/BasePublish.html +157 -0
  19. data/doc/rdoc/classes/Hobix/BaseStorage.html +417 -0
  20. data/doc/rdoc/classes/Hobix/BixWik/Entry.html +196 -0
  21. data/doc/rdoc/classes/Hobix/BixWik/IndexEntry.html +170 -0
  22. data/doc/rdoc/classes/Hobix/BixWik/WikiRedCloth.html +111 -0
  23. data/doc/rdoc/classes/Hobix/BixWik.html +418 -0
  24. data/doc/rdoc/classes/Hobix/BixWikPlugin.html +158 -0
  25. data/doc/rdoc/classes/Hobix/CommandLine.html +1970 -0
  26. data/doc/rdoc/classes/Hobix/Comment.html +113 -0
  27. data/doc/rdoc/classes/Hobix/Config.html +212 -0
  28. data/doc/rdoc/classes/Hobix/DataMarsh.html +667 -0
  29. data/doc/rdoc/classes/Hobix/Entry.html +178 -0
  30. data/doc/rdoc/classes/Hobix/EntryEnum.html +162 -0
  31. data/doc/rdoc/classes/Hobix/Enumerable.html +170 -0
  32. data/doc/rdoc/classes/Hobix/Facets/WikiEdit.html +180 -0
  33. data/doc/rdoc/classes/Hobix/Facets.html +111 -0
  34. data/doc/rdoc/classes/Hobix/LinkList.html +182 -0
  35. data/doc/rdoc/classes/Hobix/Out/Quick.html +412 -0
  36. data/doc/rdoc/classes/Hobix/Out.html +119 -0
  37. data/doc/rdoc/classes/Hobix/Page.html +381 -0
  38. data/doc/rdoc/classes/Hobix/Trackback.html +113 -0
  39. data/doc/rdoc/classes/Hobix/UriStr.html +198 -0
  40. data/doc/rdoc/classes/Hobix/WebApp/QueryString.html +207 -0
  41. data/doc/rdoc/classes/Hobix/WebApp/QueryValidationFailure.html +111 -0
  42. data/doc/rdoc/classes/Hobix/WebApp.html +1383 -0
  43. data/doc/rdoc/classes/Hobix/Weblog/AuthorNotFound.html +111 -0
  44. data/doc/rdoc/classes/Hobix/Weblog.html +2082 -0
  45. data/doc/rdoc/classes/Hobix.html +399 -0
  46. data/doc/rdoc/classes/Kernel.html +139 -0
  47. data/doc/rdoc/classes/Regexp.html +154 -0
  48. data/doc/rdoc/classes/YAML/Omap.html +144 -0
  49. data/doc/rdoc/classes/YAML.html +111 -0
  50. data/doc/rdoc/created.rid +1 -0
  51. data/doc/rdoc/files/COPYING.html +129 -0
  52. data/doc/rdoc/files/README.html +131 -0
  53. data/doc/rdoc/files/doc/CHANGELOG.html +101 -0
  54. data/doc/rdoc/files/lib/hobix/api_rb.html +119 -0
  55. data/doc/rdoc/files/lib/hobix/article_rb.html +126 -0
  56. data/doc/rdoc/files/lib/hobix/base_rb.html +128 -0
  57. data/doc/rdoc/files/lib/hobix/bixwik_rb.html +126 -0
  58. data/doc/rdoc/files/lib/hobix/commandline_rb.html +140 -0
  59. data/doc/rdoc/files/lib/hobix/comments_rb.html +126 -0
  60. data/doc/rdoc/files/lib/hobix/config_rb.html +125 -0
  61. data/doc/rdoc/files/lib/hobix/datamarsh_rb.html +108 -0
  62. data/doc/rdoc/files/lib/hobix/entry_rb.html +118 -0
  63. data/doc/rdoc/files/lib/hobix/linklist_rb.html +127 -0
  64. data/doc/rdoc/files/lib/hobix/publisher_rb.html +126 -0
  65. data/doc/rdoc/files/lib/hobix/trackbacks_rb.html +128 -0
  66. data/doc/rdoc/files/lib/hobix/webapp_rb.html +127 -0
  67. data/doc/rdoc/files/lib/hobix/weblog_rb.html +135 -0
  68. data/doc/rdoc/files/lib/hobix_rb.html +127 -0
  69. data/doc/rdoc/fr_class_index.html +67 -0
  70. data/doc/rdoc/fr_file_index.html +44 -0
  71. data/doc/rdoc/fr_method_index.html +307 -0
  72. data/doc/rdoc/index.html +24 -0
  73. data/doc/rdoc/rdoc-style.css +208 -0
  74. data/git_hobix_update.php +13 -0
  75. data/lib/hobix/base.rb +6 -3
  76. data/lib/hobix/bixwik.rb +12 -12
  77. data/lib/hobix/commandline.rb +18 -2
  78. data/lib/hobix/comments.rb +4 -5
  79. data/lib/hobix/entry.rb +2 -1
  80. data/lib/hobix/facets/comments.rb +31 -6
  81. data/lib/hobix/linklist.rb +6 -1
  82. data/lib/hobix/out/atom.rb +29 -20
  83. data/lib/hobix/out/quick.rb +8 -6
  84. data/lib/hobix/out/rss.rb +16 -3
  85. data/lib/hobix/plugin/akismet.rb +196 -0
  86. data/lib/hobix/plugin/calendar.rb +6 -14
  87. data/lib/hobix/plugin/recent_comments.rb +4 -2
  88. data/lib/hobix/plugin/tags.rb +1 -1
  89. data/lib/hobix/storage/filesys.rb +41 -31
  90. data/lib/hobix/trackbacks.rb +1 -2
  91. data/lib/hobix/weblog.rb +73 -40
  92. data/lib/hobix.rb +9 -2
  93. data/share/default-blog/hobix.yaml +16 -0
  94. data/share/default-blog/htdocs/site.css +174 -0
  95. data/share/default-blog/skel/entry.html.quick +0 -0
  96. data/share/default-blog/skel/index.atom.atom +0 -0
  97. data/share/default-blog/skel/index.html.quick-summary +0 -0
  98. data/share/default-blog/skel/index.xml.rss +0 -0
  99. data/share/default-blog/skel/index.yaml.okaynews +0 -0
  100. data/share/default-blog/skel/monthly.html.quick-archive +0 -0
  101. data/share/default-blog/skel/section.html.quick-archive +0 -0
  102. data/share/default-blog/skel/yearly.html.quick-archive +0 -0
  103. data/share/default-blog-modes.yaml +7 -0
  104. data/share/default-blog.apache-cgi.patch +8 -0
  105. data/share/default-blog.apache-ssi.patch +38 -0
  106. data/share/default-blog.apache2-ssi.patch +3 -0
  107. data/share/default-blog.cgi.patch +8 -0
  108. data/share/default-blog.comments.patch +5 -0
  109. data/share/default-blog.prototype.patch +766 -0
  110. data/share/default-blog.publisher.patch +5 -0
  111. data/share/default-blog.wiki.patch +29 -0
  112. data/share/publisher/css/control.css +90 -0
  113. data/share/publisher/css/form.css +238 -0
  114. data/share/publisher/css/form.import.css +72 -0
  115. data/share/publisher/css/main-menu.css +134 -0
  116. data/share/publisher/i/hobix-emblazen-1.png +0 -0
  117. data/share/publisher/i/hobix-emblazen-2.png +0 -0
  118. data/share/publisher/i/hobix-emblazen-3.png +0 -0
  119. data/share/publisher/i/hobix-emblazen-4.png +0 -0
  120. data/share/publisher/i/hobix-emblazen-5.png +0 -0
  121. data/share/publisher/i/hobix-emblazen-6.png +0 -0
  122. data/share/publisher/i/hobix-emblazen-7.png +0 -0
  123. data/share/publisher/index.erb +66 -0
  124. data/share/publisher/js/controls.js +261 -0
  125. data/share/publisher/js/dragdrop.js +476 -0
  126. data/share/publisher/js/effects.js +570 -0
  127. data/share/publisher/js/prototype.js +1011 -0
  128. metadata +196 -53
  129. checksums.yaml +0 -7
@@ -0,0 +1,261 @@
1
+ // Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
2
+ //
3
+ // Permission is hereby granted, free of charge, to any person obtaining
4
+ // a copy of this software and associated documentation files (the
5
+ // "Software"), to deal in the Software without restriction, including
6
+ // without limitation the rights to use, copy, modify, merge, publish,
7
+ // distribute, sublicense, and/or sell copies of the Software, and to
8
+ // permit persons to whom the Software is furnished to do so, subject to
9
+ // the following conditions:
10
+ //
11
+ // The above copyright notice and this permission notice shall be
12
+ // included in all copies or substantial portions of the Software.
13
+ //
14
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
22
+
23
+ Element.collectTextNodesIgnoreClass = function(element, ignoreclass) {
24
+ var children = $(element).childNodes;
25
+ var text = "";
26
+ var classtest = new RegExp("^([^ ]+ )*" + ignoreclass+ "( [^ ]+)*$","i");
27
+
28
+ for (var i = 0; i < children.length; i++) {
29
+ if(children[i].nodeType==3) {
30
+ text+=children[i].nodeValue;
31
+ } else {
32
+ if((!children[i].className.match(classtest)) && children[i].hasChildNodes())
33
+ text += Element.collectTextNodesIgnoreClass(children[i], ignoreclass);
34
+ }
35
+ }
36
+
37
+ return text;
38
+ }
39
+
40
+ Ajax.Autocompleter = Class.create();
41
+ Ajax.Autocompleter.prototype = (new Ajax.Base()).extend({
42
+ initialize: function(element, update, url, options) {
43
+ this.element = $(element);
44
+ this.update = $(update);
45
+ this.has_focus = false;
46
+ this.changed = false;
47
+ this.active = false;
48
+ this.index = 0;
49
+ this.entry_count = 0;
50
+ this.url = url;
51
+
52
+ this.setOptions(options);
53
+ this.options.asynchronous = true;
54
+ this.options.onComplete = this.onComplete.bind(this)
55
+ this.options.frequency = this.options.frequency || 0.4;
56
+ this.options.min_chars = this.options.min_chars || 1;
57
+ this.options.method = 'post';
58
+
59
+ this.options.onShow = this.options.onShow ||
60
+ function(element, update){
61
+ if(!update.style.position || update.style.position=='absolute') {
62
+ update.style.position = 'absolute';
63
+ var offsets = Position.cumulativeOffset(element);
64
+ update.style.left = offsets[0] + 'px';
65
+ update.style.top = (offsets[1] + element.offsetHeight) + 'px';
66
+ update.style.width = element.offsetWidth + 'px';
67
+ }
68
+ new Effect.Appear(update,{duration:0.3});
69
+ };
70
+ this.options.onHide = this.options.onHide ||
71
+ function(element, update){ new Effect.Fade(update,{duration:0.3}) };
72
+
73
+
74
+ if(this.options.indicator)
75
+ this.indicator = $(this.options.indicator);
76
+
77
+ this.observer = null;
78
+
79
+ Element.hide(this.update);
80
+
81
+ Event.observe(this.element, "blur", this.onBlur.bindAsEventListener(this));
82
+ Event.observe(this.element, "keypress", this.onKeyPress.bindAsEventListener(this));
83
+ },
84
+
85
+ show: function() {
86
+ if(this.update.style.display=='none') this.options.onShow(this.element, this.update);
87
+ if(!this.iefix && (navigator.appVersion.indexOf('MSIE')>0) && this.update.style.position=='absolute') {
88
+ new Insertion.After(this.update,
89
+ '<iframe id="' + this.update.id + '_iefix" '+
90
+ 'style="display:none;filter:progid:DXImageTransform.Microsoft.Alpha(apacity=0);" ' +
91
+ 'src="javascript:;" frameborder="0" scrolling="no"></iframe>');
92
+ this.iefix = $(this.update.id+'_iefix');
93
+ }
94
+ if(this.iefix) {
95
+ Position.clone(this.update, this.iefix);
96
+ this.iefix.style.zIndex = 1;
97
+ this.update.style.zIndex = 2;
98
+ Element.show(this.iefix);
99
+ }
100
+ },
101
+
102
+ hide: function() {
103
+ if(this.update.style.display=='') this.options.onHide(this.element, this.update);
104
+ if(this.iefix) Element.hide(this.iefix);
105
+ },
106
+
107
+ startIndicator: function() {
108
+ if(this.indicator) Element.show(this.indicator);
109
+ },
110
+
111
+ stopIndicator: function() {
112
+ if(this.indicator) Element.hide(this.indicator);
113
+ },
114
+
115
+ onObserverEvent: function() {
116
+ this.changed = false;
117
+ if(this.element.value.length>=this.options.min_chars) {
118
+ this.startIndicator();
119
+ this.options.parameters = this.options.callback ?
120
+ this.options.callback(this.element, Form.Element.getValue(this.element)) :
121
+ Form.Element.serialize(this.element);
122
+ new Ajax.Request(this.url, this.options);
123
+ } else {
124
+ this.active = false;
125
+ this.hide();
126
+ }
127
+ },
128
+
129
+ addObservers: function(element) {
130
+ Event.observe(element, "mouseover", this.onHover.bindAsEventListener(this));
131
+ Event.observe(element, "click", this.onClick.bindAsEventListener(this));
132
+ },
133
+
134
+ onComplete: function(request) {
135
+ if(!this.changed && this.has_focus) {
136
+ this.update.innerHTML = request.responseText;
137
+ Element.cleanWhitespace(this.update);
138
+ Element.cleanWhitespace(this.update.firstChild);
139
+
140
+ if(this.update.firstChild && this.update.firstChild.childNodes) {
141
+ this.entry_count =
142
+ this.update.firstChild.childNodes.length;
143
+ for (var i = 0; i < this.entry_count; i++) {
144
+ entry = this.get_entry(i);
145
+ entry.autocompleteIndex = i;
146
+ this.addObservers(entry);
147
+ }
148
+ } else {
149
+ this.entry_count = 0;
150
+ }
151
+
152
+ this.stopIndicator();
153
+
154
+ this.index = 0;
155
+ this.render();
156
+ }
157
+ },
158
+
159
+ onKeyPress: function(event) {
160
+ if(this.active)
161
+ switch(event.keyCode) {
162
+ case Event.KEY_TAB:
163
+ case Event.KEY_RETURN:
164
+ this.select_entry();
165
+ Event.stop(event);
166
+ case Event.KEY_ESC:
167
+ this.hide();
168
+ this.active = false;
169
+ return;
170
+ case Event.KEY_LEFT:
171
+ case Event.KEY_RIGHT:
172
+ return;
173
+ case Event.KEY_UP:
174
+ this.mark_previous();
175
+ this.render();
176
+ if(navigator.appVersion.indexOf('AppleWebKit')>0) Event.stop(event);
177
+ return;
178
+ case Event.KEY_DOWN:
179
+ this.mark_next();
180
+ this.render();
181
+ if(navigator.appVersion.indexOf('AppleWebKit')>0) Event.stop(event);
182
+ return;
183
+ }
184
+ else
185
+ if(event.keyCode==Event.KEY_TAB || event.keyCode==Event.KEY_RETURN)
186
+ return;
187
+
188
+ this.changed = true;
189
+ this.has_focus = true;
190
+
191
+ if(this.observer) clearTimeout(this.observer);
192
+ this.observer =
193
+ setTimeout(this.onObserverEvent.bind(this), this.options.frequency*1000);
194
+ },
195
+
196
+ onHover: function(event) {
197
+ var element = Event.findElement(event, 'LI');
198
+ if(this.index != element.autocompleteIndex)
199
+ {
200
+ this.index = element.autocompleteIndex;
201
+ this.render();
202
+ }
203
+ Event.stop(event);
204
+ },
205
+
206
+ onClick: function(event) {
207
+ var element = Event.findElement(event, 'LI');
208
+ this.index = element.autocompleteIndex;
209
+ this.select_entry();
210
+ Event.stop(event);
211
+ },
212
+
213
+ onBlur: function(event) {
214
+ // needed to make click events working
215
+ setTimeout(this.hide.bind(this), 250);
216
+ this.has_focus = false;
217
+ this.active = false;
218
+ },
219
+
220
+ render: function() {
221
+ if(this.entry_count > 0) {
222
+ for (var i = 0; i < this.entry_count; i++)
223
+ this.index==i ?
224
+ Element.addClassName(this.get_entry(i),"selected") :
225
+ Element.removeClassName(this.get_entry(i),"selected");
226
+
227
+ if(this.has_focus) {
228
+ if(this.get_current_entry().scrollIntoView)
229
+ this.get_current_entry().scrollIntoView(false);
230
+
231
+ this.show();
232
+ this.active = true;
233
+ }
234
+ } else this.hide();
235
+ },
236
+
237
+ mark_previous: function() {
238
+ if(this.index > 0) this.index--
239
+ else this.index = this.entry_count-1;
240
+ },
241
+
242
+ mark_next: function() {
243
+ if(this.index < this.entry_count-1) this.index++
244
+ else this.index = 0;
245
+ },
246
+
247
+ get_entry: function(index) {
248
+ return this.update.firstChild.childNodes[index];
249
+ },
250
+
251
+ get_current_entry: function() {
252
+ return this.get_entry(this.index);
253
+ },
254
+
255
+ select_entry: function() {
256
+ this.active = false;
257
+ value = Element.collectTextNodesIgnoreClass(this.get_current_entry(), 'informal').unescapeHTML();
258
+ this.element.value = value;
259
+ this.element.focus();
260
+ }
261
+ });