instiki 0.9.2 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. data/CHANGELOG +165 -0
  2. data/README +68 -172
  3. data/app/controllers/admin_controller.rb +94 -0
  4. data/app/controllers/application.rb +131 -0
  5. data/app/controllers/file_controller.rb +129 -0
  6. data/app/controllers/wiki_controller.rb +354 -0
  7. data/{libraries/view_helper.rb → app/helpers/application_helper.rb} +68 -33
  8. data/app/models/author.rb +3 -3
  9. data/app/models/chunks/category.rb +33 -31
  10. data/app/models/chunks/chunk.rb +86 -20
  11. data/app/models/chunks/engines.rb +54 -38
  12. data/app/models/chunks/include.rb +41 -29
  13. data/app/models/chunks/literal.rb +31 -19
  14. data/app/models/chunks/nowiki.rb +28 -31
  15. data/app/models/chunks/test.rb +18 -18
  16. data/app/models/chunks/uri.rb +182 -97
  17. data/app/models/chunks/wiki.rb +141 -82
  18. data/app/models/file_yard.rb +58 -0
  19. data/app/models/page.rb +112 -86
  20. data/app/models/page_lock.rb +22 -23
  21. data/app/models/page_set.rb +89 -64
  22. data/app/models/revision.rb +123 -90
  23. data/app/models/web.rb +176 -89
  24. data/app/models/wiki_content.rb +207 -105
  25. data/app/models/wiki_service.rb +233 -83
  26. data/app/models/wiki_words.rb +23 -25
  27. data/app/views/{wiki/new_system.rhtml → admin/create_system.rhtml} +83 -78
  28. data/app/views/{wiki/new_web.rhtml → admin/create_web.rhtml} +69 -64
  29. data/app/views/admin/edit_web.rhtml +136 -0
  30. data/app/views/file/file.rhtml +19 -0
  31. data/app/views/file/import.rhtml +23 -0
  32. data/app/views/layouts/default.rhtml +85 -0
  33. data/app/views/markdown_help.rhtml +12 -16
  34. data/app/views/mixed_help.rhtml +7 -0
  35. data/app/views/navigation.rhtml +30 -19
  36. data/app/views/rdoc_help.rhtml +12 -16
  37. data/app/views/textile_help.rhtml +24 -28
  38. data/app/views/wiki/authors.rhtml +11 -13
  39. data/app/views/wiki/edit.rhtml +39 -31
  40. data/app/views/wiki/export.rhtml +12 -14
  41. data/app/views/wiki/feeds.rhtml +14 -10
  42. data/app/views/wiki/list.rhtml +64 -57
  43. data/app/views/wiki/locked.rhtml +23 -14
  44. data/app/views/wiki/login.rhtml +14 -11
  45. data/app/views/wiki/new.rhtml +31 -27
  46. data/app/views/wiki/page.rhtml +115 -81
  47. data/app/views/wiki/print.rhtml +14 -16
  48. data/app/views/wiki/published.rhtml +9 -10
  49. data/app/views/wiki/recently_revised.rhtml +27 -30
  50. data/app/views/wiki/revision.rhtml +103 -81
  51. data/app/views/wiki/rollback.rhtml +14 -9
  52. data/app/views/wiki/rss_feed.rhtml +22 -22
  53. data/app/views/wiki/search.rhtml +38 -15
  54. data/app/views/wiki/tex.rhtml +22 -22
  55. data/app/views/wiki/tex_web.rhtml +34 -34
  56. data/app/views/wiki/web_list.rhtml +18 -13
  57. data/app/views/wiki_words_help.rhtml +9 -8
  58. data/config/environment.rb +82 -0
  59. data/config/environments/development.rb +5 -0
  60. data/config/environments/production.rb +4 -0
  61. data/config/environments/test.rb +17 -0
  62. data/config/routes.rb +18 -0
  63. data/instiki +6 -67
  64. data/instiki.rb +3 -0
  65. data/lib/active_record_stub.rb +31 -0
  66. data/{libraries/diff → lib}/diff.rb +444 -475
  67. data/lib/instiki_errors.rb +15 -0
  68. data/{libraries → lib}/rdocsupport.rb +151 -155
  69. data/lib/redcloth_for_tex.rb +736 -0
  70. data/natives/osx/desktop_launcher/AppDelegate.h +18 -0
  71. data/natives/osx/desktop_launcher/AppDelegate.mm +109 -0
  72. data/natives/osx/desktop_launcher/Credits.html +16 -0
  73. data/natives/osx/desktop_launcher/English.lproj/InfoPlist.strings +0 -0
  74. data/natives/osx/desktop_launcher/English.lproj/MainMenu.nib/classes.nib +13 -0
  75. data/natives/osx/desktop_launcher/English.lproj/MainMenu.nib/info.nib +24 -0
  76. data/natives/osx/desktop_launcher/English.lproj/MainMenu.nib/objects.nib +0 -0
  77. data/natives/osx/desktop_launcher/Info.plist +13 -0
  78. data/natives/osx/desktop_launcher/Instiki.xcode/project.pbxproj +592 -0
  79. data/natives/osx/desktop_launcher/Instiki_Prefix.pch +7 -0
  80. data/natives/osx/desktop_launcher/MakeDMG.sh +9 -0
  81. data/natives/osx/desktop_launcher/main.mm +14 -0
  82. data/natives/osx/desktop_launcher/version.plist +16 -0
  83. data/public/404.html +6 -0
  84. data/public/500.html +6 -0
  85. data/public/dispatch.rb +10 -0
  86. data/public/favicon.ico +0 -0
  87. data/public/javascripts/edit_web.js +52 -0
  88. data/public/javascripts/prototype.js +336 -0
  89. data/{app/views/static_style_sheet.rhtml → public/stylesheets/instiki.css} +221 -198
  90. data/script/breakpointer +4 -0
  91. data/script/server +93 -0
  92. metadata +59 -32
  93. data/app/controllers/wiki.rb +0 -389
  94. data/app/models/chunks/match.rb +0 -19
  95. data/app/views/bottom.rhtml +0 -4
  96. data/app/views/top.rhtml +0 -49
  97. data/app/views/wiki/edit_web.rhtml +0 -138
  98. data/libraries/action_controller_servlet.rb +0 -177
  99. data/libraries/erb.rb +0 -490
  100. data/libraries/madeleine_service.rb +0 -68
  101. data/libraries/redcloth_for_tex.rb +0 -869
  102. data/libraries/web_controller_server.rb +0 -81
@@ -1,199 +1,222 @@
1
- #Container {
2
- float: none;
3
- margin: 0 auto;
4
- text-align: center;
5
- }
6
-
7
- #Content {
8
- margin: 0;
9
- padding: 5px;
10
- text-align: left;
11
- border-top: none;
12
- float: left;
13
- }
14
-
15
- body { background-color: #fff; color: #333; }
16
-
17
- body, p, ol, ul, td {
18
- font-family: verdana, arial, helvetica, sans-serif;
19
- font-size: 13px;
20
- line-height: 18px;
21
- }
22
-
23
- a { color: #000; }
24
-
25
- .newWikiWord { background-color: #eee; }
26
- .newWikiWord a:hover { background-color: white; }
27
-
28
- a:visited { color: #666; }
29
- a:hover { color: #fff; background-color:#000; }
30
-
31
- /* a.edit:link, a.edit:visited { color: #DA0006; } */
32
-
33
-
34
- h1, h2, h3 { color: #333; font-family: georgia, verdana; }
35
- h1 { font-size: 28px }
36
- h2 { font-size: 19px }
37
- h3 { font-size: 16px }
38
-
39
- h1#pageName {
40
- margin: 5px 0px 0px 0px;
41
- padding: 0px 0px 0px 0px;
42
- line-height: 28px;
43
- }
44
-
45
- h1#pageName small {
46
- color: grey;
47
- line-height: 10px;
48
- font-size: 10px;
49
- padding: 0px;
50
- }
51
-
52
- a.nav, a.nav:link, a.nav:visited { color: #000; }
53
- a.nav:hover { color: #fff; background-color:#000; }
54
-
55
- li { margin-bottom: 7px }
56
-
57
- .navigation {
58
- margin-top: 5px;
59
- font-size : 12px;
60
- color: #999;
61
- }
62
-
63
- .navigation a:hover { color: #fff; background-color:#000; }
64
-
65
- .navigation a {
66
- font-size: 11px;
67
- color: black;
68
- font-weight: bold;
69
- }
70
-
71
- .navigation small a {
72
- font-weight: normal;
73
- font-size: 11px;
74
- }
75
-
76
- .navOn{
77
- font-size: 11px;
78
- color: grey;
79
- font-weight: bold;
80
- text-decoration: none;
81
- }
82
-
83
- .help {
84
- font-family: verdana, arial, helvetica, sans-serif;
85
- font-size: 11px;
86
- }
87
-
88
- .inputBox {
89
- font-family: verdana, arial, helvetica, sans-serif;
90
- font-size: 11px;
91
- background-color: #eee;
92
- padding: 5px;
93
- margin-bottom: 20px;
94
- }
95
-
96
- blockquote {
97
- display: block;
98
- margin: 0px 0px 20px 0px;
99
- padding: 0px 30px;
100
- font-size:11px;
101
- line-height:17px;
102
- font-style: italic;
103
- }
104
-
105
- pre {
106
- background-color: #eee;
107
- padding: 10px;
108
- font-size: 11px;
109
- }
110
-
111
- ol.setup {
112
- font-size: 19px;
113
- font-family: georgia, verdana;
114
- padding-left: 25px;
115
- }
116
-
117
- ol.setup li {
118
- margin-bottom: 20px
119
- }
120
-
121
- .byline {
122
- font-size: 10px;
123
- font-style: italic;
124
- margin-bottom: 10px;
125
- color: #999;
126
- }
127
-
128
- .references {
129
- font-size: 10px;
130
- }
131
-
132
- .diffdel {
133
- background: pink;
134
- }
135
-
136
- .diffins {
137
- background: lightgreen;
138
- }
139
-
140
- #TextileHelp table {
141
- margin-bottom: 0;
142
- }
143
-
144
- #TextileHelp table+h3 {
145
- margin-top: 11px;
146
- }
147
-
148
- #TextileHelp table td {
149
- font-size: 11px;
150
- padding: 3px;
151
- vertical-align: top;
152
- border-top: 1px dotted #ccc;
153
- }
154
-
155
- #TextileHelp table td.arrow {
156
- padding-right: 5px;
157
- padding-left: 10px;
158
- color: #999;
159
- }
160
-
161
- #TextileHelp table td.label {
162
- font-weight: bold;
163
- white-space: nowrap;
164
- font-size: 10px;
165
- padding-right: 15px;
166
- color: #000;
167
- }
168
-
169
- #TextileHelp h3 {
170
- font-size: 11px;
171
- font-weight: bold;
172
- font-weight: normal;
173
- margin: 0 0 5px 0;
174
- padding: 5px 0 0 0;
175
- }
176
-
177
- #TextileHelp p {
178
- font-size: 10px;
179
- }
180
-
181
- .rightHandSide {
182
- float: right;
183
- width: 147px;
184
- margin-left: 10px;
185
- padding-left: 20px;
186
- border-left: 1px dotted #ccc;
187
- }
188
-
189
- .rightHandSide p {
190
- font-size: 10px;
191
- }
192
-
193
- .newsList {
194
- margin-top: 20px;
195
- }
196
-
197
- .newsList p {
198
- margin-bottom:30px
1
+ #Container {
2
+ float: none;
3
+ margin: 0 auto;
4
+ text-align: center;
5
+ }
6
+
7
+ #Content {
8
+ margin: 0;
9
+ padding: 5px;
10
+ text-align: left;
11
+ border-top: none;
12
+ float: left;
13
+ }
14
+
15
+ body { background-color: #fff; color: #333; }
16
+
17
+ body, p, ol, ul, td {
18
+ font-family: verdana, arial, helvetica, sans-serif;
19
+ font-size: 13px;
20
+ line-height: 18px;
21
+ }
22
+
23
+ a { color: #000; }
24
+
25
+ .newWikiWord { background-color: #eee; }
26
+ .newWikiWord a:hover { background-color: white; }
27
+
28
+ a:visited { color: #666; }
29
+ a:hover { color: #fff; background-color:#000; }
30
+
31
+ h1, h2, h3 { color: #333; font-family: georgia, verdana; }
32
+ h1 { font-size: 28px }
33
+ h2 { font-size: 19px }
34
+ h3 { font-size: 16px }
35
+
36
+ h1#pageName {
37
+ margin: 5px 0px 0px 0px;
38
+ padding: 0px 0px 0px 0px;
39
+ line-height: 28px;
40
+ }
41
+
42
+ h1#pageName small {
43
+ color: grey;
44
+ line-height: 10px;
45
+ font-size: 10px;
46
+ padding: 0px;
47
+ }
48
+
49
+ a.nav, a.nav:link, a.nav:visited { color: #000; }
50
+ a.nav:hover { color: #fff; background-color:#000; }
51
+
52
+ li { margin-bottom: 7px }
53
+
54
+ .navigation {
55
+ margin-top: 5px;
56
+ font-size : 12px;
57
+ color: #999;
58
+ }
59
+
60
+ .navigation a:hover { color: #fff; background-color:#000; }
61
+
62
+ .navigation a {
63
+ font-size: 11px;
64
+ color: black;
65
+ font-weight: bold;
66
+ }
67
+
68
+ .navigation small a {
69
+ font-weight: normal;
70
+ font-size: 11px;
71
+ }
72
+
73
+ .navOn{
74
+ font-size: 11px;
75
+ color: grey;
76
+ font-weight: bold;
77
+ text-decoration: none;
78
+ }
79
+
80
+ .help {
81
+ font-family: verdana, arial, helvetica, sans-serif;
82
+ font-size: 11px;
83
+ }
84
+
85
+ .inputBox {
86
+ font-family: verdana, arial, helvetica, sans-serif;
87
+ font-size: 11px;
88
+ background-color: #eee;
89
+ padding: 5px;
90
+ margin-bottom: 20px;
91
+ }
92
+
93
+ blockquote {
94
+ display: block;
95
+ margin: 0px 0px 20px 0px;
96
+ padding: 0px 30px;
97
+ font-size:11px;
98
+ line-height:17px;
99
+ font-style: italic;
100
+ }
101
+
102
+ pre {
103
+ background-color: #eee;
104
+ padding: 10px;
105
+ font-size: 11px;
106
+ }
107
+
108
+ ol.setup {
109
+ font-size: 19px;
110
+ font-family: georgia, verdana;
111
+ padding-left: 25px;
112
+ }
113
+
114
+ ol.setup li {
115
+ margin-bottom: 20px
116
+ }
117
+
118
+ .byline {
119
+ font-size: 10px;
120
+ font-style: italic;
121
+ margin-bottom: 10px;
122
+ color: #999;
123
+ }
124
+
125
+ .references {
126
+ font-size: 10px;
127
+ }
128
+
129
+ .diffdel, del.diffmod {
130
+ background: pink;
131
+ }
132
+
133
+ .diffins, ins.diffmod {
134
+ background: lightgreen;
135
+ }
136
+
137
+ #footer {
138
+ height: 14px;
139
+ padding: .25em 0;
140
+ }
141
+
142
+ #footer p {
143
+ font-size: 10px;
144
+ color: gray;
145
+ font-style: italic;
146
+ margin: 0;
147
+ float: right;
148
+ text-align: right;
149
+ }
150
+
151
+ #error {
152
+ color: darkred;
153
+ font-style: italic;
154
+ width: 600px;
155
+ }
156
+
157
+ #info {
158
+ color: darkgreen;
159
+ font-style: italic;
160
+ width: 600px;
161
+ }
162
+
163
+ #TextileHelp table {
164
+ margin-bottom: 0;
165
+ }
166
+
167
+ #TextileHelp table+h3 {
168
+ margin-top: 11px;
169
+ }
170
+
171
+ #TextileHelp table td {
172
+ font-size: 11px;
173
+ padding: 3px;
174
+ vertical-align: top;
175
+ border-top: 1px dotted #ccc;
176
+ }
177
+
178
+ #TextileHelp table td.arrow {
179
+ padding-right: 5px;
180
+ padding-left: 10px;
181
+ color: #999;
182
+ }
183
+
184
+ #TextileHelp table td.label {
185
+ font-weight: bold;
186
+ white-space: nowrap;
187
+ font-size: 10px;
188
+ padding-right: 15px;
189
+ color: #000;
190
+ }
191
+
192
+ #TextileHelp h3 {
193
+ font-size: 11px;
194
+ font-weight: bold;
195
+ font-weight: normal;
196
+ margin: 0 0 5px 0;
197
+ padding: 5px 0 0 0;
198
+ }
199
+
200
+ #TextileHelp p {
201
+ font-size: 10px;
202
+ }
203
+
204
+ .rightHandSide {
205
+ float: right;
206
+ width: 147px;
207
+ margin-left: 10px;
208
+ padding-left: 20px;
209
+ border-left: 1px dotted #ccc;
210
+ }
211
+
212
+ .rightHandSide p {
213
+ font-size: 10px;
214
+ }
215
+
216
+ .newsList {
217
+ margin-top: 20px;
218
+ }
219
+
220
+ .newsList p {
221
+ margin-bottom:30px
199
222
  }
@@ -0,0 +1,4 @@
1
+ #!e:/ruby/bin/ruby
2
+ require 'rubygems'
3
+ require_gem 'rails'
4
+ require 'breakpoint_client'
@@ -0,0 +1,93 @@
1
+ #!/usr/bin/ruby
2
+
3
+ require 'webrick'
4
+ require 'optparse'
5
+ require 'fileutils'
6
+
7
+ pwd = File.expand_path(File.dirname(__FILE__) + "/..")
8
+
9
+ OPTIONS = {
10
+ # Overridable options
11
+ :port => 2500,
12
+ :ip => '0.0.0.0',
13
+ :environment => 'production',
14
+ :server_root => File.expand_path(File.dirname(__FILE__) + '/../public/'),
15
+ :server_type => WEBrick::SimpleServer,
16
+ :storage => "#{File.expand_path(FileUtils.pwd)}/storage",
17
+ }
18
+
19
+ ARGV.options do |opts|
20
+ script_name = File.basename($0)
21
+ opts.banner = "Usage: ruby #{script_name} [options]"
22
+
23
+ opts.separator ''
24
+
25
+ opts.on('-p', '--port=port', Integer,
26
+ 'Runs Instiki on the specified port.',
27
+ 'Default: 2500') { |OPTIONS[:port]| }
28
+ opts.on('-b', '--binding=ip', String,
29
+ 'Binds Rails to the specified ip.',
30
+ 'Default: 0.0.0.0') { |OPTIONS[:ip]| }
31
+ opts.on('-e', '--environment=name', String,
32
+ 'Specifies the environment to run this server under (test/development/production).',
33
+ 'Default: production') { |OPTIONS[:environment]| }
34
+ opts.on('-d', '--daemon',
35
+ 'Make Instiki run as a Daemon (only works if fork is available -- meaning on *nix).'
36
+ ) { OPTIONS[:server_type] = WEBrick::Daemon }
37
+ opts.on('-s', '--simple', '--simple-server',
38
+ '[deprecated] Forces Instiki not to run as a Daemon if fork is available.',
39
+ 'Since version 0.10.0 this option is ignored.'
40
+ ) { puts "Warning: -s (--simple) option is deprecated. See instiki --help for details." }
41
+ opts.on('-t', '--storage=storage', String,
42
+ 'Makes Instiki use the specified directory for storage.',
43
+ 'Default: ./storage/[port]') { |OPTIONS[:storage]| }
44
+ opts.on('-x', '--notex',
45
+ 'Blocks wiki exports to TeX and PDF, even when pdflatex is available.'
46
+ ) { |OPTIONS[:notex]| }
47
+ opts.on('-v', '--verbose',
48
+ 'Enables debug-level logging'
49
+ ) { OPTIONS[:verbose] = true }
50
+
51
+ opts.separator ''
52
+
53
+ opts.on('-h', '--help',
54
+ 'Show this help message.') { puts opts; exit }
55
+
56
+ opts.parse!
57
+ end
58
+
59
+ if OPTIONS[:environment] == 'production'
60
+ storage_path = "#{OPTIONS[:storage]}/#{OPTIONS[:port]}"
61
+ else
62
+ storage_path = "#{OPTIONS[:storage]}/#{OPTIONS[:environment]}/#{OPTIONS[:port]}"
63
+ end
64
+ FileUtils.mkdir_p(storage_path)
65
+
66
+ ENV['RAILS_ENV'] = OPTIONS[:environment]
67
+ INSTIKI_DEBUG_LOG = OPTIONS[:verbose]
68
+ require File.expand_path(File.dirname(__FILE__) + '/../config/environment')
69
+ WikiService.storage_path = storage_path
70
+
71
+ if OPTIONS[:notex]
72
+ OPTIONS[:pdflatex] = false
73
+ else
74
+ begin
75
+ OPTIONS[:pdflatex] = system "pdflatex -version"
76
+ rescue Errno::ENOENT
77
+ OPTIONS[:pdflatex] = false
78
+ end
79
+ end
80
+
81
+ if defined? INSTIKI_BATCH_JOB
82
+ require 'application'
83
+ else
84
+ puts "=> Starting Instiki on http://#{OPTIONS[:ip]}:#{OPTIONS[:port]}"
85
+ puts "=> Data files are stored in #{storage_path}"
86
+
87
+ require 'webrick_server'
88
+ require_dependency 'application'
89
+
90
+ OPTIONS[:index_controller] = 'wiki'
91
+ ApplicationController.wiki = WikiService.instance
92
+ DispatchServlet.dispatch(OPTIONS)
93
+ end