wiki 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/README.md +10 -2
  4. data/bin/wiki +4 -0
  5. data/default-data/pages/how-to-wiki +1069 -0
  6. data/default-data/pages/welcome-visitors +336 -0
  7. data/default-data/status/favicon.png +0 -0
  8. data/default-data/status/local-identity +7 -0
  9. data/lib/wiki/favicon.rb +0 -1
  10. data/lib/wiki/page.rb +3 -6
  11. data/lib/wiki/server.rb +7 -3
  12. data/lib/wiki/version.rb +1 -1
  13. data/package.json +70 -0
  14. data/wiki.gemspec +20 -13
  15. metadata +205 -58
  16. data/lib/wiki/views/client/Gruntfile.js +0 -50
  17. data/lib/wiki/views/client/ReadMe.md +0 -67
  18. data/lib/wiki/views/client/build-test.bat +0 -10
  19. data/lib/wiki/views/client/build.bat +0 -8
  20. data/lib/wiki/views/client/builder.pl +0 -41
  21. data/lib/wiki/views/client/client.coffee +0 -3
  22. data/lib/wiki/views/client/client.js +0 -3607
  23. data/lib/wiki/views/client/crosses.png +0 -0
  24. data/lib/wiki/views/client/images/external-link-ltr-icon.png +0 -0
  25. data/lib/wiki/views/client/images/noise.png +0 -0
  26. data/lib/wiki/views/client/images/oops.jpg +0 -0
  27. data/lib/wiki/views/client/js/d3/d3.behavior.js +0 -198
  28. data/lib/wiki/views/client/js/d3/d3.chart.js +0 -984
  29. data/lib/wiki/views/client/js/d3/d3.csv.js +0 -92
  30. data/lib/wiki/views/client/js/d3/d3.geo.js +0 -566
  31. data/lib/wiki/views/client/js/d3/d3.geom.js +0 -825
  32. data/lib/wiki/views/client/js/d3/d3.js +0 -3597
  33. data/lib/wiki/views/client/js/d3/d3.layout.js +0 -1923
  34. data/lib/wiki/views/client/js/d3/d3.time.js +0 -660
  35. data/lib/wiki/views/client/js/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  36. data/lib/wiki/views/client/js/images/ui-icons_222222_256x240.png +0 -0
  37. data/lib/wiki/views/client/js/jquery-1.6.2.min.js +0 -18
  38. data/lib/wiki/views/client/js/jquery-1.7.1.min.js +0 -4
  39. data/lib/wiki/views/client/js/jquery-1.9.1.min.js +0 -5
  40. data/lib/wiki/views/client/js/jquery-migrate-1.1.1.min.js +0 -3
  41. data/lib/wiki/views/client/js/jquery-ui-1.10.1.custom.min.css +0 -5
  42. data/lib/wiki/views/client/js/jquery-ui-1.10.1.custom.min.js +0 -6
  43. data/lib/wiki/views/client/js/jquery-ui-1.8.16.custom.css +0 -339
  44. data/lib/wiki/views/client/js/jquery-ui-1.8.16.custom.min.js +0 -315
  45. data/lib/wiki/views/client/js/jquery.ie.cors.js +0 -310
  46. data/lib/wiki/views/client/js/jquery.ui.touch-punch.min.js +0 -11
  47. data/lib/wiki/views/client/js/modernizr.custom.63710.js +0 -824
  48. data/lib/wiki/views/client/js/sockjs-0.3.min.js +0 -27
  49. data/lib/wiki/views/client/js/underscore-min.js +0 -30
  50. data/lib/wiki/views/client/mkplugin.sh +0 -97
  51. data/lib/wiki/views/client/package.json +0 -36
  52. data/lib/wiki/views/client/runtests.html +0 -26
  53. data/lib/wiki/views/client/style.css +0 -339
  54. data/lib/wiki/views/client/test/mocha.css +0 -231
  55. data/lib/wiki/views/client/test/mocha.js +0 -5340
  56. data/lib/wiki/views/client/test/testclient.js +0 -17133
  57. data/lib/wiki/views/client/testclient.coffee +0 -18
  58. data/lib/wiki/views/client/theme/granite.css +0 -59
  59. data/lib/wiki/views/client/theme/stoneSeamless.jpg +0 -0
  60. data/lib/wiki/views/client/twitter-maintainance.jpg +0 -0
@@ -0,0 +1,336 @@
1
+ {
2
+ "title": "Welcome Visitors",
3
+ "story": [
4
+ {
5
+ "text": "Welcome to the [[Smallest Federated Wiki]]. From this page you can find who we are and what we do. New sites provide this information and then claim the site as their own. You will need your own site to participate.",
6
+ "id": "7b56f22a4b9ee974",
7
+ "type": "paragraph"
8
+ },
9
+ {
10
+ "type": "paragraph",
11
+ "id": "821827c99b90cfd1",
12
+ "text": "Pages about us."
13
+ },
14
+ {
15
+ "type": "factory",
16
+ "id": "63ad2e58eecdd9e5",
17
+ "prompt": "Create a page about yourself. Start by making a link to that page right here. Double-click the gray box below. That opens an editor. Type your name enclosed in double square brackets. Then press Command/ALT-S to save."
18
+ },
19
+ {
20
+ "type": "paragraph",
21
+ "id": "2bbd646ff3f44b51",
22
+ "text": "Pages where we do and share."
23
+ },
24
+ {
25
+ "type": "factory",
26
+ "id": "05e2fa92643677ca",
27
+ "prompt": "Create a page about things you do on this wiki. Double-click the gray box below. Type a descriptive name of something you will be writing about. Enclose it in square brackets. Then press Command/ALT-S to save."
28
+ },
29
+ {
30
+ "type": "paragraph",
31
+ "id": "0cbb4ef5f5d7e472",
32
+ "text": "Look for the <i>claim</i> button below this page. If you have your own OpenID you can use it to claim these pages so that only you can edit them. If you have a Google account you can use that too. Press the (G) button. Press the (Y) button to use your Yahoo account. You get the idea."
33
+ },
34
+ {
35
+ "type": "paragraph",
36
+ "id": "ee416d431ebf4fb4",
37
+ "text": "You can edit your copy of these pages. Press [+] to add more writing spaces. Read [[How to Wiki]] for more ideas. Follow [[Recent Changes]] here and nearby."
38
+ }
39
+ ],
40
+ "journal": [
41
+ {
42
+ "type": "create",
43
+ "id": "7b56f22a30118509",
44
+ "date": 1309114800000,
45
+ "item": {
46
+ "title": "Welcome Visitors"
47
+ }
48
+ },
49
+ {
50
+ "id": "7b56f22a4b9ee974",
51
+ "type": "edit",
52
+ "date": 1309114800000,
53
+ "item": {
54
+ "text": "Welcome to the [[Smallest Federated Wiki]]. This page was first drafted Sunday, June 26th, 2011, at [[Indie Web Camp]]. You are welcome to copy this page to any server you own and revise its welcoming message as you see fit. You can assume this has happened many times already.",
55
+ "id": "7b56f22a4b9ee974",
56
+ "type": "paragraph"
57
+ }
58
+ },
59
+ {
60
+ "type": "edit",
61
+ "id": "7b56f22a4b9ee974",
62
+ "item": {
63
+ "text": "Welcome to the [[Smallest Federated Wiki]]. You may be seeing this page because you have just entered a wiki of your own. If so, you have three things to do before you go on.",
64
+ "id": "7b56f22a4b9ee974",
65
+ "type": "paragraph"
66
+ },
67
+ "date": 1344306124590
68
+ },
69
+ {
70
+ "type": "add",
71
+ "item": {
72
+ "type": "paragraph",
73
+ "id": "821827c99b90cfd1",
74
+ "text": "<b>One:</b> Create a page about yourself. Start by making a link to that page right here. Double-click the gray box below. That opens an editor. Type your name enclosed in double square brackets. Then press Command/ALT-S to save."
75
+ },
76
+ "after": "7b56f22a4b9ee974",
77
+ "id": "821827c99b90cfd1",
78
+ "date": 1344306133455
79
+ },
80
+ {
81
+ "type": "add",
82
+ "item": {
83
+ "type": "factory",
84
+ "id": "63ad2e58eecdd9e5"
85
+ },
86
+ "after": "821827c99b90cfd1",
87
+ "id": "63ad2e58eecdd9e5",
88
+ "date": 1344306138935
89
+ },
90
+ {
91
+ "type": "add",
92
+ "item": {
93
+ "type": "paragraph",
94
+ "id": "2bbd646ff3f44b51",
95
+ "text": "<b>Two:</b> Create a page about things you do on this wiki. Double-click the gray box below. Type a descriptive name of something you will be writing about. Enclose it in square brackets. Then press Command/ALT-S to save."
96
+ },
97
+ "after": "63ad2e58eecdd9e5",
98
+ "id": "2bbd646ff3f44b51",
99
+ "date": 1344306143742
100
+ },
101
+ {
102
+ "type": "add",
103
+ "item": {
104
+ "type": "factory",
105
+ "id": "05e2fa92643677ca"
106
+ },
107
+ "after": "2bbd646ff3f44b51",
108
+ "id": "05e2fa92643677ca",
109
+ "date": 1344306148580
110
+ },
111
+ {
112
+ "type": "add",
113
+ "item": {
114
+ "type": "paragraph",
115
+ "id": "0cbb4ef5f5d7e472",
116
+ "text": "<b>Three:</b> Look for the <i>claim</i> button below this page. If you have your own OpenID you can use it to claim these pages so that only you can edit them. If you have a Google account you can use that too. Press the (G) button. Press the (Y) button to use your Yahoo account. You get the idea."
117
+ },
118
+ "after": "05e2fa92643677ca",
119
+ "id": "0cbb4ef5f5d7e472",
120
+ "date": 1344306151782
121
+ },
122
+ {
123
+ "type": "add",
124
+ "item": {
125
+ "type": "paragraph",
126
+ "id": "ee416d431ebf4fb4",
127
+ "text": "Start writing. Click either link. Press [+] to add more writing spaces. Read [[How to Wiki]] for more ideas. Track changes with [[Recent Changes]] and [[Local Editing]]."
128
+ },
129
+ "after": "0cbb4ef5f5d7e472",
130
+ "id": "ee416d431ebf4fb4",
131
+ "date": 1344306168918
132
+ },
133
+ {
134
+ "type": "edit",
135
+ "id": "821827c99b90cfd1",
136
+ "item": {
137
+ "type": "paragraph",
138
+ "id": "821827c99b90cfd1",
139
+ "text": "<b>One:</b> A page about myself."
140
+ },
141
+ "date": 1361751371185
142
+ },
143
+ {
144
+ "type": "edit",
145
+ "id": "2bbd646ff3f44b51",
146
+ "item": {
147
+ "type": "paragraph",
148
+ "id": "2bbd646ff3f44b51",
149
+ "text": "<b>Two:</b> Pages about what we do here."
150
+ },
151
+ "date": 1361751496155
152
+ },
153
+ {
154
+ "type": "edit",
155
+ "id": "821827c99b90cfd1",
156
+ "item": {
157
+ "type": "paragraph",
158
+ "id": "821827c99b90cfd1",
159
+ "text": "<b>One:</b> Pages about us."
160
+ },
161
+ "date": 1361751512280
162
+ },
163
+ {
164
+ "type": "edit",
165
+ "id": "7b56f22a4b9ee974",
166
+ "item": {
167
+ "text": "Welcome to the [[Smallest Federated Wiki]]. From this page you can find who we are and what we do.",
168
+ "id": "7b56f22a4b9ee974",
169
+ "type": "paragraph"
170
+ },
171
+ "date": 1361751649467
172
+ },
173
+ {
174
+ "type": "edit",
175
+ "id": "7b56f22a4b9ee974",
176
+ "item": {
177
+ "text": "Welcome to the [[Smallest Federated Wiki]]. From this introductory page you can find who we are and what we do.",
178
+ "id": "7b56f22a4b9ee974",
179
+ "type": "paragraph"
180
+ },
181
+ "date": 1361751711554
182
+ },
183
+ {
184
+ "type": "edit",
185
+ "id": "2bbd646ff3f44b51",
186
+ "item": {
187
+ "type": "paragraph",
188
+ "id": "2bbd646ff3f44b51",
189
+ "text": "<b>Two:</b> Pages where we do and share."
190
+ },
191
+ "date": 1361751811972
192
+ },
193
+ {
194
+ "type": "edit",
195
+ "id": "7b56f22a4b9ee974",
196
+ "item": {
197
+ "text": "Welcome to the [[Smallest Federated Wiki]]. From this page you can find who we are and what we do. New sites provide this information and then claim the site as their own. You will need your own site to participate.",
198
+ "id": "7b56f22a4b9ee974",
199
+ "type": "paragraph"
200
+ },
201
+ "date": 1361751965824
202
+ },
203
+ {
204
+ "type": "edit",
205
+ "id": "821827c99b90cfd1",
206
+ "item": {
207
+ "type": "paragraph",
208
+ "id": "821827c99b90cfd1",
209
+ "text": "Pages about us."
210
+ },
211
+ "date": 1361752195146
212
+ },
213
+ {
214
+ "type": "edit",
215
+ "id": "2bbd646ff3f44b51",
216
+ "item": {
217
+ "type": "paragraph",
218
+ "id": "2bbd646ff3f44b51",
219
+ "text": "Pages where we do and share."
220
+ },
221
+ "date": 1361752202873
222
+ },
223
+ {
224
+ "type": "edit",
225
+ "id": "0cbb4ef5f5d7e472",
226
+ "item": {
227
+ "type": "paragraph",
228
+ "id": "0cbb4ef5f5d7e472",
229
+ "text": "Look for the <i>claim</i> button below this page. If you have your own OpenID you can use it to claim these pages so that only you can edit them. If you have a Google account you can use that too. Press the (G) button. Press the (Y) button to use your Yahoo account. You get the idea."
230
+ },
231
+ "date": 1361752223856
232
+ },
233
+ {
234
+ "type": "edit",
235
+ "id": "ee416d431ebf4fb4",
236
+ "item": {
237
+ "type": "paragraph",
238
+ "id": "ee416d431ebf4fb4",
239
+ "text": "Click either link. Press [+] to add more writing spaces. Read [[How to Wiki]] for more ideas. Track changes with [[Recent Changes]] and [[Local Editing]]."
240
+ },
241
+ "date": 1361752251367
242
+ },
243
+ {
244
+ "type": "edit",
245
+ "id": "ee416d431ebf4fb4",
246
+ "item": {
247
+ "type": "paragraph",
248
+ "id": "ee416d431ebf4fb4",
249
+ "text": "You can your copy of these pages. Press [+] to add more writing spaces. Read [[How to Wiki]] for more ideas. Discover [[Recent Changes]] here and nearby."
250
+ },
251
+ "date": 1361752421212
252
+ },
253
+ {
254
+ "type": "edit",
255
+ "id": "ee416d431ebf4fb4",
256
+ "item": {
257
+ "type": "paragraph",
258
+ "id": "ee416d431ebf4fb4",
259
+ "text": "You can your copy of these pages. Press [+] to add more writing spaces."
260
+ },
261
+ "date": 1361752436556
262
+ },
263
+ {
264
+ "item": {
265
+ "type": "paragraph",
266
+ "id": "78a8278db93c6ed2",
267
+ "text": "Read [[How to Wiki]] for more ideas. Discover [[Recent Changes]] here and nearby."
268
+ },
269
+ "id": "78a8278db93c6ed2",
270
+ "type": "add",
271
+ "after": "ee416d431ebf4fb4",
272
+ "date": 1361752437061
273
+ },
274
+ {
275
+ "type": "edit",
276
+ "id": "78a8278db93c6ed2",
277
+ "item": {
278
+ "type": "paragraph",
279
+ "id": "78a8278db93c6ed2",
280
+ "text": "Read [[How to Wiki]] for more ideas."
281
+ },
282
+ "date": 1361752441155
283
+ },
284
+ {
285
+ "item": {
286
+ "type": "paragraph",
287
+ "id": "67a126ec849b55ed",
288
+ "text": "Discover [[Recent Changes]] here and nearby."
289
+ },
290
+ "id": "67a126ec849b55ed",
291
+ "type": "add",
292
+ "after": "78a8278db93c6ed2",
293
+ "date": 1361752441668
294
+ },
295
+ {
296
+ "type": "remove",
297
+ "id": "78a8278db93c6ed2",
298
+ "date": 1361752452012
299
+ },
300
+ {
301
+ "type": "edit",
302
+ "id": "ee416d431ebf4fb4",
303
+ "item": {
304
+ "type": "paragraph",
305
+ "id": "ee416d431ebf4fb4",
306
+ "text": "You can your copy of these pages. Press [+] to add more writing spaces. Read [[How to Wiki]] for more ideas."
307
+ },
308
+ "date": 1361752459193
309
+ },
310
+ {
311
+ "type": "remove",
312
+ "id": "67a126ec849b55ed",
313
+ "date": 1361752461793
314
+ },
315
+ {
316
+ "type": "edit",
317
+ "id": "ee416d431ebf4fb4",
318
+ "item": {
319
+ "type": "paragraph",
320
+ "id": "ee416d431ebf4fb4",
321
+ "text": "You can your copy of these pages. Press [+] to add more writing spaces. Read [[How to Wiki]] for more ideas. Follow [[Recent Changes]] here and nearby."
322
+ },
323
+ "date": 1361752483992
324
+ },
325
+ {
326
+ "type": "edit",
327
+ "id": "ee416d431ebf4fb4",
328
+ "item": {
329
+ "type": "paragraph",
330
+ "id": "ee416d431ebf4fb4",
331
+ "text": "You can edit your copy of these pages. Press [+] to add more writing spaces. Read [[How to Wiki]] for more ideas. Follow [[Recent Changes]] here and nearby."
332
+ },
333
+ "date": 1361752498310
334
+ }
335
+ ]
336
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "site": "fw.example.com",
3
+ "title": "New Simplest Federated Wiki Install",
4
+ "root": "welcome-visitors",
5
+ "owner": "example.com",
6
+ "launch": "1309112042"
7
+ }
@@ -1,4 +1,3 @@
1
- require 'rubygems'
2
1
  require 'png'
3
2
 
4
3
  class Favicon
@@ -16,14 +16,11 @@ class Page
16
16
  attr_accessor :plugins_directory
17
17
 
18
18
  def plugin_page_path name
19
- Dir.glob(File.join(plugins_directory, '*/pages')) do |dir|
20
- probe = "#{dir}/#{name}"
21
- return probe if File.exists? probe
19
+ if pages = Dir.glob(File.join(plugins_directory, 'wiki-plugin-*', 'pages', name))
20
+ return pages.first
22
21
  end
23
- return nil
24
22
  end
25
23
 
26
-
27
24
  # Get a page
28
25
  #
29
26
  # @param [String] name - The name of the file to retrieve, relative to Page.directory.
@@ -39,7 +36,7 @@ class Page
39
36
  FileStore.get_page(default_path)
40
37
  elsif (path = plugin_page_path name)
41
38
  page = FileStore.get_page(path)
42
- page['plugin'] = path.match(/plugins\/(.*?)\/pages/)[1]
39
+ page['plugin'] = path.match(/#{self.plugins_directory}\/wiki-plugin-(.*?)\/pages/)[1]
43
40
  page
44
41
  else
45
42
  halt 404
@@ -1,4 +1,4 @@
1
- require 'rubygems'
1
+ require 'sinatra'
2
2
  require 'bundler'
3
3
  require 'pathname'
4
4
  Bundler.require
@@ -20,7 +20,7 @@ require 'openid/store/filesystem'
20
20
 
21
21
  class Controller < Sinatra::Base
22
22
  set :port, 1111
23
- set :public, File.join(APP_ROOT, "client")
23
+ set :public_folder, File.join(APP_ROOT, "node_modules/wiki-client/client")
24
24
  set :views , File.join(SINATRA_ROOT, "views")
25
25
  set :haml, :format => :html5
26
26
  set :versions, `git log -10 --oneline` || "no git log"
@@ -43,7 +43,7 @@ class Controller < Sinatra::Base
43
43
  page = Page.new
44
44
  page.directory = File.join data_dir(site), "pages"
45
45
  page.default_directory = File.join APP_ROOT, "default-data", "pages"
46
- page.plugins_directory = File.join APP_ROOT, "client", "plugins"
46
+ page.plugins_directory = File.join APP_ROOT, "node_modules"
47
47
  Store.mkdir page.directory
48
48
  page
49
49
  end
@@ -65,6 +65,10 @@ class Controller < Sinatra::Base
65
65
  id_data ||= Store.put_hash(real_path, FileStore.get_hash(default_path))
66
66
  end
67
67
 
68
+ get /\/plugins\/(.*?)\/(.*)/ do |plugin, file|
69
+ send_file File.join(APP_ROOT, "node_modules/wiki-plugin-#{plugin}/client", file)
70
+ end
71
+
68
72
  post "/logout" do
69
73
  session.delete :authenticated
70
74
  redirect "/"
@@ -1,3 +1,3 @@
1
1
  module Wiki
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -0,0 +1,70 @@
1
+ {
2
+ "name": "wiki",
3
+ "version": "0.1.5",
4
+ "bin": {
5
+ "wiki": "./bin/server.js"
6
+ },
7
+ "description": "Federated Wiki",
8
+ "author": {
9
+ "name": "Ward Cunningham",
10
+ "email": "ward@c2.com",
11
+ "url": "http://fed.wiki.org"
12
+ },
13
+ "contributors": [
14
+ {
15
+ "name": "Jonan Scheffler",
16
+ "email": "jonanscheffler@gmail.com"
17
+ },
18
+ {
19
+ "name": "Daniel Stark",
20
+ "email": "daniel@studiostark.com"
21
+ }
22
+ ],
23
+ "license": "MIT",
24
+ "dependencies": {
25
+ "wiki-client": "0.1",
26
+ "wiki-plugin-activity": "0.1",
27
+ "wiki-plugin-bars": "0.1",
28
+ "wiki-plugin-bytebeat": "0.1",
29
+ "wiki-plugin-calculator": "0.1",
30
+ "wiki-plugin-calendar": "0.1",
31
+ "wiki-plugin-changes": "0.1",
32
+ "wiki-plugin-chart": "0.1",
33
+ "wiki-plugin-code": "0.1",
34
+ "wiki-plugin-data": "0.1",
35
+ "wiki-plugin-efficiency": "0.1",
36
+ "wiki-plugin-factory": "0.1",
37
+ "wiki-plugin-favicon": "0.1",
38
+ "wiki-plugin-federatedwiki": "0.1",
39
+ "wiki-plugin-force": "0.1",
40
+ "wiki-plugin-future": "0.1",
41
+ "wiki-plugin-image": "0.1",
42
+ "wiki-plugin-line": "0.1",
43
+ "wiki-plugin-linkmap": "0.1",
44
+ "wiki-plugin-logwatch": "0.1",
45
+ "wiki-plugin-map": "0.1",
46
+ "wiki-plugin-mathjax": "0.1",
47
+ "wiki-plugin-metabolism": "0.1",
48
+ "wiki-plugin-method": "0.1",
49
+ "wiki-plugin-pagefold": "0.1",
50
+ "wiki-plugin-paragraph": "0.1",
51
+ "wiki-plugin-parse": "0.1",
52
+ "wiki-plugin-pushpin": "0.1",
53
+ "wiki-plugin-radar": "0.1",
54
+ "wiki-plugin-reduce": "0.1",
55
+ "wiki-plugin-reference": "0.1",
56
+ "wiki-plugin-report": "0.1",
57
+ "wiki-plugin-rollup": "0.1",
58
+ "wiki-plugin-scatter": "0.1",
59
+ "wiki-plugin-twadio": "0.1",
60
+ "wiki-plugin-txtzyme": "0.1"
61
+ },
62
+ "devDependencies": {},
63
+ "repository": {
64
+ "type": "git",
65
+ "url": "https://github.com/fedwiki/wiki-gem.git"
66
+ },
67
+ "bugs": {
68
+ "url": "https://github.com/fedwiki/wiki-gem/issues"
69
+ }
70
+ }