wiki 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +17 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +29 -0
  6. data/Rakefile +1 -0
  7. data/lib/wiki.rb +2 -0
  8. data/lib/wiki/ReadMe.md +89 -0
  9. data/lib/wiki/config.ru +2 -0
  10. data/lib/wiki/favicon.rb +31 -0
  11. data/lib/wiki/page.rb +74 -0
  12. data/lib/wiki/random_id.rb +5 -0
  13. data/lib/wiki/server.rb +336 -0
  14. data/lib/wiki/server_helpers.rb +66 -0
  15. data/lib/wiki/stores/ReadMe.md +26 -0
  16. data/lib/wiki/stores/all.rb +3 -0
  17. data/lib/wiki/stores/couch.rb +121 -0
  18. data/lib/wiki/stores/file.rb +53 -0
  19. data/lib/wiki/stores/store.rb +38 -0
  20. data/lib/wiki/version.rb +3 -0
  21. data/lib/wiki/views/client/Gruntfile.js +50 -0
  22. data/lib/wiki/views/client/ReadMe.md +67 -0
  23. data/lib/wiki/views/client/build-test.bat +10 -0
  24. data/lib/wiki/views/client/build.bat +8 -0
  25. data/lib/wiki/views/client/builder.pl +41 -0
  26. data/lib/wiki/views/client/client.coffee +3 -0
  27. data/lib/wiki/views/client/client.js +3607 -0
  28. data/lib/wiki/views/client/crosses.png +0 -0
  29. data/lib/wiki/views/client/images/external-link-ltr-icon.png +0 -0
  30. data/lib/wiki/views/client/images/noise.png +0 -0
  31. data/lib/wiki/views/client/images/oops.jpg +0 -0
  32. data/lib/wiki/views/client/js/d3/d3.behavior.js +198 -0
  33. data/lib/wiki/views/client/js/d3/d3.chart.js +984 -0
  34. data/lib/wiki/views/client/js/d3/d3.csv.js +92 -0
  35. data/lib/wiki/views/client/js/d3/d3.geo.js +566 -0
  36. data/lib/wiki/views/client/js/d3/d3.geom.js +825 -0
  37. data/lib/wiki/views/client/js/d3/d3.js +3597 -0
  38. data/lib/wiki/views/client/js/d3/d3.layout.js +1923 -0
  39. data/lib/wiki/views/client/js/d3/d3.time.js +660 -0
  40. data/lib/wiki/views/client/js/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  41. data/lib/wiki/views/client/js/images/ui-icons_222222_256x240.png +0 -0
  42. data/lib/wiki/views/client/js/jquery-1.6.2.min.js +18 -0
  43. data/lib/wiki/views/client/js/jquery-1.7.1.min.js +4 -0
  44. data/lib/wiki/views/client/js/jquery-1.9.1.min.js +5 -0
  45. data/lib/wiki/views/client/js/jquery-migrate-1.1.1.min.js +3 -0
  46. data/lib/wiki/views/client/js/jquery-ui-1.10.1.custom.min.css +5 -0
  47. data/lib/wiki/views/client/js/jquery-ui-1.10.1.custom.min.js +6 -0
  48. data/lib/wiki/views/client/js/jquery-ui-1.8.16.custom.css +339 -0
  49. data/lib/wiki/views/client/js/jquery-ui-1.8.16.custom.min.js +315 -0
  50. data/lib/wiki/views/client/js/jquery.ie.cors.js +310 -0
  51. data/lib/wiki/views/client/js/jquery.ui.touch-punch.min.js +11 -0
  52. data/lib/wiki/views/client/js/modernizr.custom.63710.js +824 -0
  53. data/lib/wiki/views/client/js/sockjs-0.3.min.js +27 -0
  54. data/lib/wiki/views/client/js/underscore-min.js +30 -0
  55. data/lib/wiki/views/client/mkplugin.sh +97 -0
  56. data/lib/wiki/views/client/package.json +36 -0
  57. data/lib/wiki/views/client/runtests.html +26 -0
  58. data/lib/wiki/views/client/style.css +339 -0
  59. data/lib/wiki/views/client/test/mocha.css +231 -0
  60. data/lib/wiki/views/client/test/mocha.js +5340 -0
  61. data/lib/wiki/views/client/test/testclient.js +17133 -0
  62. data/lib/wiki/views/client/testclient.coffee +18 -0
  63. data/lib/wiki/views/client/theme/granite.css +59 -0
  64. data/lib/wiki/views/client/theme/stoneSeamless.jpg +0 -0
  65. data/lib/wiki/views/client/twitter-maintainance.jpg +0 -0
  66. data/lib/wiki/views/layout.haml +56 -0
  67. data/lib/wiki/views/oops.haml +5 -0
  68. data/lib/wiki/views/page.haml +20 -0
  69. data/lib/wiki/views/static.html +30 -0
  70. data/lib/wiki/views/view.haml +2 -0
  71. data/wiki.gemspec +28 -0
  72. metadata +121 -0
@@ -0,0 +1,18 @@
1
+ mocha.setup('bdd')
2
+
3
+ window.wiki = require('wiki-client/lib/wiki')
4
+
5
+ require('wiki-client/test/util')
6
+ require('wiki-client/test/active')
7
+ require('wiki-client/test/pageHandler')
8
+ require('wiki-client/test/refresh')
9
+ require('wiki-client/test/page')
10
+ require('wiki-client/test/plugin')
11
+ require('wiki-client/test/revision')
12
+ require('wiki-client/test/neighborhood')
13
+ require('wiki-client/test/search')
14
+
15
+ $ ->
16
+ $('<hr><h2> Testing artifacts:</h2>').appendTo('body')
17
+ mocha.run()
18
+
@@ -0,0 +1,59 @@
1
+ a {
2
+ color: #c14615; }
3
+
4
+ a:hover {
5
+ color: #ffba00;
6
+ text-shadow: 0 0 1px #d9a513; }
7
+
8
+ h1 {
9
+ color: #566a6c;
10
+ font-weight: 400; }
11
+
12
+ body {
13
+ background: url("/theme/stoneSeamless.jpg"); }
14
+
15
+ .journal {
16
+ border-radius: 5px; }
17
+
18
+ .action {
19
+ font-size: 1.3em;
20
+ -webkit-border-radius: 5px;
21
+ -moz-border-radius: 5px;
22
+ border-radius: 5px;
23
+ padding: 0.1em;
24
+ margin: 4px;
25
+ float: left;
26
+ width: 26px; }
27
+
28
+ .control-buttons {
29
+ right: 3px;
30
+ }
31
+
32
+ .button {
33
+ left: 0;
34
+ color: #c14615;
35
+ font-size: 21px;
36
+ padding: 0.1em;
37
+ margin: 1px;
38
+ width: 26px; }
39
+
40
+ .action:hover {
41
+ color: #2c3f39;
42
+ text-shadow: 0 0 1px #2c3f39; }
43
+
44
+ .target {
45
+ background-color: #c9e1d4 !important; }
46
+
47
+ .page {
48
+ padding: 0 16px;
49
+ border-radius: 5px;
50
+ border-style:solid;
51
+ border-width:1px;
52
+ border-color: #878984;
53
+ box-shadow: inset 0px 0px 7px rgba(0, 0, 0, 0.5); }
54
+ .page.active {
55
+ border-color: #515d75; }
56
+
57
+ .ghost {
58
+ opacity: 0.8;
59
+ border-color: #eef2fe; }
@@ -0,0 +1,56 @@
1
+ !!! 5
2
+ %html( class="no-js" )
3
+ %head
4
+ %title Smallest Federated Wiki
5
+ /
6
+ = settings.versions
7
+
8
+ %meta(http-equiv="Content-Type" content="text/html; charset=UTF-8")
9
+ %meta(name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, user-scalable=no")
10
+ %link(type="image/png" href="/favicon.png" rel="icon")
11
+ %link(type="text/css" href="/style.css" rel="stylesheet")
12
+ %script(type="text/javascript" src="/js/jquery-1.9.1.min.js")
13
+ %script(type="text/javascript" src="/js/jquery-migrate-1.1.1.min.js")
14
+ %script(type="text/javascript" src="/js/jquery-ui-1.10.1.custom.min.js")
15
+ %link(type="text/css" href="/js/jquery-ui-1.10.1.custom.min.css" rel="stylesheet")
16
+ %script(type="text/javascript" src="/js/modernizr.custom.63710.js")
17
+ %script(type="text/javascript" src="/js/underscore-min.js")
18
+ %script(type="text/javascript" src="/client.js")
19
+ :javascript
20
+ Modernizr.load([
21
+ {
22
+ test: Modernizr.cors,
23
+ nope: '/js/jquery.ie.cors.js'}
24
+ ]);
25
+ %meta(name="apple-mobile-web-app-capable" content="yes")
26
+ %meta(name="apple-mobile-web-app-status-bar-style" content="black")
27
+ %meta(name="apple-mobile-web-app-title" content="SF Wiki")
28
+
29
+ %link(rel="apple-touch-icon" href="/favicon.png")
30
+ %link(rel="shortcut icon" href="/favicon.png")
31
+ %body
32
+ %section.main
33
+ =yield
34
+ %footer{:class => authenticated? ? "logout" : identified? ? "login" : claimed? ? "login" : "claim"}
35
+ - if authenticated?
36
+ %form{:method => 'POST', :action => "/logout"}
37
+ %input{:type => 'submit', :value => "Logout"}
38
+ - else
39
+ - if identified?
40
+ %form{:method => 'POST', :action => "/login"}
41
+ %input{:type => 'submit', :value => "Login"}
42
+ - else
43
+ %form{:method => 'POST', :action => "/login"}
44
+ OpenID:
45
+ %input{:type => 'text', :name => 'identifier'}
46
+ %input{:type => 'submit', :value => claimed? ? "Login" : "Claim"}
47
+ or use:
48
+ %span{:class => 'provider'}
49
+ %input{:type => 'button', :title => 'google', :value => 'G', 'data-provider' => 'https://www.google.com/accounts/o8/id'}
50
+ %input{:type => 'button', :title => 'yahoo', :value => 'Y', 'data-provider' => 'https://me.yahoo.com'}
51
+ %input{:type => 'button', :title => 'aol', :value => 'A', 'data-provider' => 'https://www.aol.com'}
52
+ %input{:type => 'button', :title => 'livejournal', :value => 'L', 'data-provider' => 'http://www.livejournal.com/openid/server.bml'}
53
+ %span
54
+ Search:
55
+ %input.search(name='search' type='text')
56
+ %span.neighborhood
@@ -0,0 +1,5 @@
1
+ %body{:style => 'font-family: "Helvetica Neue", helvetica, Verdana, Arial, Sans;'}
2
+ %center
3
+ %img{:src => '/images/oops.jpg'}
4
+ %h1{:style => 'width:400; color:#f10'}
5
+ = message
@@ -0,0 +1,20 @@
1
+ .page{:id => page_name, "data-server-generated" => "true"}
2
+ %h1
3
+ %a{:href => '/', :style => "text-decoration: none"}
4
+ %img{:src => '/favicon.png', :height => '32px'}
5
+ = page['title']
6
+ .story
7
+ - page['story'].each do |item|
8
+ %div{:class => ['item', type=item['type']], :id => item['id'], "data-static-item" => item.to_json}
9
+ - case type
10
+ - when 'paragraph'
11
+ %p= resolve_links(item['text'])
12
+ - when 'image'
13
+ %img{:src => item['url'], :class => 'thumbnail'}
14
+ %p= resolve_links(item['text'] || item['caption'] || 'uploaded image')
15
+ - else
16
+ %p.error= type
17
+ .footer
18
+ %a{:id => "license", :href => "http://creativecommons.org/licenses/by-sa/3.0/"} CC BY-SA 3.0
19
+ ='.'
20
+ %a{:class => "show-page-source", :href => "/#{page_name}.json"} JSON
@@ -0,0 +1,30 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Smallest Federated Wiki</title>
5
+ <meta content='text/html; charset=UTF-8' http-equiv='Content-Type'>
6
+ <meta content='width=device-width, height=device-height, initial-scale=1.0, user-scalable=no' name='viewport'>
7
+ <link href='/favicon.png' rel='icon' type='image/png'>
8
+ <link href='/style.css' rel='stylesheet' type='text/css'>
9
+ <script src='/js/jquery-1.6.2.min.js' type='text/javascript'></script>
10
+ <script src='/js/jquery-ui-1.8.16.custom.min.js' type='text/javascript'></script>
11
+ <link href='/js/jquery-ui-1.8.16.custom.css' rel='stylesheet' type='text/css'>
12
+ <script src='/js/history.min.js' type='text/javascript'></script>
13
+ <script src='/js/history.jquery.min.js' type='text/javascript'></script>
14
+ <script src='/js/underscore-min.js' type='text/javascript'></script>
15
+ <script src='/client.js' type='text/javascript'></script>
16
+ </head>
17
+ <body>
18
+ <header></header>
19
+ <section class='main'>
20
+ <div class='page' id='welcome-visitors'></div>
21
+ </section>
22
+ <footer class='login'>
23
+ <form action='/login' method='POST'>
24
+ OpenID:
25
+ <input name='identifier' type='text'>
26
+ <input type='submit' value='Login'>
27
+ </form>
28
+ </footer>
29
+ </body>
30
+ </html>
@@ -0,0 +1,2 @@
1
+ - pages.each do |page_tuple|
2
+ .page{:id => page_tuple[:id], 'data-site' => page_tuple[:site]}
@@ -0,0 +1,28 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'wiki/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "wiki"
8
+ spec.version = Wiki::VERSION
9
+ spec.authors = ["Daniel Stark", "Ward Cunningham"]
10
+ spec.email = ["daniel@studiostark.com", "ward@c2.com"]
11
+ spec.description = %q{A Federated Wiki Server}
12
+ spec.summary = %q{Wiki is a single-page application for browsing and editing content distributed throughout a federation of similar creative-commons licensed sites. What is a federated wiki, and why does federation matter? Authors thoughout the federation pull content towards themselves as they edit. With this package authors publish their own edits back to the federation as they edit.}
13
+ spec.homepage = "http://fed.wiki.org"
14
+ spec.licenses = ['MIT', 'GPL-2']
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ # spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ # spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ # spec.add_dependency "openid"
22
+ # spec.add_dependency "png"
23
+ # spec.add_dependency "sinatra"
24
+ # spec.add_dependency "haml"
25
+
26
+ # spec.add_development_dependency "bundler", "~> 1.3"
27
+ # spec.add_development_dependency "rake"
28
+ end
metadata ADDED
@@ -0,0 +1,121 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: wiki
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Daniel Stark
8
+ - Ward Cunningham
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-12-09 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: A Federated Wiki Server
15
+ email:
16
+ - daniel@studiostark.com
17
+ - ward@c2.com
18
+ executables: []
19
+ extensions: []
20
+ extra_rdoc_files: []
21
+ files:
22
+ - .gitignore
23
+ - Gemfile
24
+ - LICENSE.txt
25
+ - README.md
26
+ - Rakefile
27
+ - lib/wiki.rb
28
+ - lib/wiki/ReadMe.md
29
+ - lib/wiki/config.ru
30
+ - lib/wiki/favicon.rb
31
+ - lib/wiki/page.rb
32
+ - lib/wiki/random_id.rb
33
+ - lib/wiki/server.rb
34
+ - lib/wiki/server_helpers.rb
35
+ - lib/wiki/stores/ReadMe.md
36
+ - lib/wiki/stores/all.rb
37
+ - lib/wiki/stores/couch.rb
38
+ - lib/wiki/stores/file.rb
39
+ - lib/wiki/stores/store.rb
40
+ - lib/wiki/version.rb
41
+ - lib/wiki/views/client/Gruntfile.js
42
+ - lib/wiki/views/client/ReadMe.md
43
+ - lib/wiki/views/client/build-test.bat
44
+ - lib/wiki/views/client/build.bat
45
+ - lib/wiki/views/client/builder.pl
46
+ - lib/wiki/views/client/client.coffee
47
+ - lib/wiki/views/client/client.js
48
+ - lib/wiki/views/client/crosses.png
49
+ - lib/wiki/views/client/images/external-link-ltr-icon.png
50
+ - lib/wiki/views/client/images/noise.png
51
+ - lib/wiki/views/client/images/oops.jpg
52
+ - lib/wiki/views/client/js/d3/d3.behavior.js
53
+ - lib/wiki/views/client/js/d3/d3.chart.js
54
+ - lib/wiki/views/client/js/d3/d3.csv.js
55
+ - lib/wiki/views/client/js/d3/d3.geo.js
56
+ - lib/wiki/views/client/js/d3/d3.geom.js
57
+ - lib/wiki/views/client/js/d3/d3.js
58
+ - lib/wiki/views/client/js/d3/d3.layout.js
59
+ - lib/wiki/views/client/js/d3/d3.time.js
60
+ - lib/wiki/views/client/js/images/ui-bg_glass_65_ffffff_1x400.png
61
+ - lib/wiki/views/client/js/images/ui-icons_222222_256x240.png
62
+ - lib/wiki/views/client/js/jquery-1.6.2.min.js
63
+ - lib/wiki/views/client/js/jquery-1.7.1.min.js
64
+ - lib/wiki/views/client/js/jquery-1.9.1.min.js
65
+ - lib/wiki/views/client/js/jquery-migrate-1.1.1.min.js
66
+ - lib/wiki/views/client/js/jquery-ui-1.10.1.custom.min.css
67
+ - lib/wiki/views/client/js/jquery-ui-1.10.1.custom.min.js
68
+ - lib/wiki/views/client/js/jquery-ui-1.8.16.custom.css
69
+ - lib/wiki/views/client/js/jquery-ui-1.8.16.custom.min.js
70
+ - lib/wiki/views/client/js/jquery.ie.cors.js
71
+ - lib/wiki/views/client/js/jquery.ui.touch-punch.min.js
72
+ - lib/wiki/views/client/js/modernizr.custom.63710.js
73
+ - lib/wiki/views/client/js/sockjs-0.3.min.js
74
+ - lib/wiki/views/client/js/underscore-min.js
75
+ - lib/wiki/views/client/mkplugin.sh
76
+ - lib/wiki/views/client/package.json
77
+ - lib/wiki/views/client/runtests.html
78
+ - lib/wiki/views/client/style.css
79
+ - lib/wiki/views/client/test/mocha.css
80
+ - lib/wiki/views/client/test/mocha.js
81
+ - lib/wiki/views/client/test/testclient.js
82
+ - lib/wiki/views/client/testclient.coffee
83
+ - lib/wiki/views/client/theme/granite.css
84
+ - lib/wiki/views/client/theme/stoneSeamless.jpg
85
+ - lib/wiki/views/client/twitter-maintainance.jpg
86
+ - lib/wiki/views/layout.haml
87
+ - lib/wiki/views/oops.haml
88
+ - lib/wiki/views/page.haml
89
+ - lib/wiki/views/static.html
90
+ - lib/wiki/views/view.haml
91
+ - wiki.gemspec
92
+ homepage: http://fed.wiki.org
93
+ licenses:
94
+ - MIT
95
+ - GPL-2
96
+ metadata: {}
97
+ post_install_message:
98
+ rdoc_options: []
99
+ require_paths:
100
+ - lib
101
+ required_ruby_version: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - '>='
104
+ - !ruby/object:Gem::Version
105
+ version: '0'
106
+ required_rubygems_version: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ requirements: []
112
+ rubyforge_project:
113
+ rubygems_version: 2.1.11
114
+ signing_key:
115
+ specification_version: 4
116
+ summary: Wiki is a single-page application for browsing and editing content distributed
117
+ throughout a federation of similar creative-commons licensed sites. What is a federated
118
+ wiki, and why does federation matter? Authors thoughout the federation pull content
119
+ towards themselves as they edit. With this package authors publish their own edits
120
+ back to the federation as they edit.
121
+ test_files: []