instiki 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README +172 -0
- data/app/controllers/wiki.rb +389 -0
- data/app/models/author.rb +4 -0
- data/app/models/chunks/category.rb +31 -0
- data/app/models/chunks/chunk.rb +20 -0
- data/app/models/chunks/engines.rb +38 -0
- data/app/models/chunks/include.rb +29 -0
- data/app/models/chunks/literal.rb +19 -0
- data/app/models/chunks/match.rb +19 -0
- data/app/models/chunks/nowiki.rb +31 -0
- data/app/models/chunks/test.rb +18 -0
- data/app/models/chunks/uri.rb +97 -0
- data/app/models/chunks/wiki.rb +82 -0
- data/app/models/page.rb +86 -0
- data/app/models/page_lock.rb +24 -0
- data/app/models/page_set.rb +64 -0
- data/app/models/revision.rb +90 -0
- data/app/models/web.rb +89 -0
- data/app/models/wiki_content.rb +105 -0
- data/app/models/wiki_service.rb +83 -0
- data/app/models/wiki_words.rb +25 -0
- data/app/views/bottom.rhtml +4 -0
- data/app/views/markdown_help.rhtml +16 -0
- data/app/views/navigation.rhtml +19 -0
- data/app/views/rdoc_help.rhtml +16 -0
- data/app/views/static_style_sheet.rhtml +199 -0
- data/app/views/textile_help.rhtml +28 -0
- data/app/views/top.rhtml +49 -0
- data/app/views/wiki/authors.rhtml +13 -0
- data/app/views/wiki/edit.rhtml +31 -0
- data/app/views/wiki/edit_web.rhtml +138 -0
- data/app/views/wiki/export.rhtml +14 -0
- data/app/views/wiki/feeds.rhtml +10 -0
- data/app/views/wiki/list.rhtml +57 -0
- data/app/views/wiki/locked.rhtml +14 -0
- data/app/views/wiki/login.rhtml +11 -0
- data/app/views/wiki/new.rhtml +27 -0
- data/app/views/wiki/new_system.rhtml +78 -0
- data/app/views/wiki/new_web.rhtml +64 -0
- data/app/views/wiki/page.rhtml +81 -0
- data/app/views/wiki/print.rhtml +16 -0
- data/app/views/wiki/published.rhtml +10 -0
- data/app/views/wiki/recently_revised.rhtml +30 -0
- data/app/views/wiki/revision.rhtml +81 -0
- data/app/views/wiki/rollback.rhtml +31 -0
- data/app/views/wiki/rss_feed.rhtml +22 -0
- data/app/views/wiki/search.rhtml +15 -0
- data/app/views/wiki/tex.rhtml +23 -0
- data/app/views/wiki/tex_web.rhtml +35 -0
- data/app/views/wiki/web_list.rhtml +13 -0
- data/app/views/wiki_words_help.rhtml +8 -0
- data/instiki +67 -0
- data/libraries/action_controller_servlet.rb +177 -0
- data/libraries/diff/diff.rb +475 -0
- data/libraries/erb.rb +490 -0
- data/libraries/madeleine_service.rb +68 -0
- data/libraries/rdocsupport.rb +156 -0
- data/libraries/redcloth_for_tex.rb +869 -0
- data/libraries/view_helper.rb +33 -0
- data/libraries/web_controller_server.rb +81 -0
- metadata +142 -0
@@ -0,0 +1,25 @@
|
|
1
|
+
# Contains all the methods for finding and replacing wiki words
|
2
|
+
module WikiWords
|
3
|
+
# In order of appearance: Latin, greek, cyrillian, armenian
|
4
|
+
I18N_HIGHER_CASE_LETTERS =
|
5
|
+
"ÀÁÂÃÄÅĀĄĂÆÇĆČĈĊĎĐÈÉÊËĒĘĚĔĖĜĞĠĢĤĦÌÍÎÏĪĨĬĮİIJĴĶŁĽĹĻĿÑŃŇŅŊÒÓÔÕÖØŌŐŎŒŔŘŖŚŠŞŜȘŤŢŦȚÙÚÛÜŪŮŰŬŨŲŴÝŶŸŹŽŻ" +
|
6
|
+
"ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ" +
|
7
|
+
"ΆΈΉΊΌΎΏѠѢѤѦѨѪѬѮѰѲѴѶѸѺѼѾҀҊҌҎҐҒҔҖҘҚҜҞҠҢҤҦҨҪҬҮҰҲҴҶҸҺҼҾӁӃӅӇӉӋӍӐӒӔӖӘӚӜӞӠӢӤӦӨӪӬӮӰӲӴӸЖ" +
|
8
|
+
"ԱԲԳԴԵԶԷԸԹԺԻԼԽԾԿՀՁՂՃՄՅՆՇՈՉՊՋՌՍՏՐՑՒՓՔՕՖ"
|
9
|
+
|
10
|
+
I18N_LOWER_CASE_LETTERS =
|
11
|
+
"àáâãäåāąăæçćčĉċďđèéêëēęěĕėƒĝğġģĥħìíîïīĩĭįıijĵķĸłľĺļŀñńňņʼnŋòóôõöøōőŏœŕřŗśšşŝșťţŧțùúûüūůűŭũųŵýÿŷžżźÞþßſÐð" +
|
12
|
+
"άέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώΐ" +
|
13
|
+
"абвгдежзийклмнопрстуфхцчшщъыьэюяѐёђѓєѕіїјљћќѝўџѡѣѥѧѩѫѭѯѱѳѵѷѹѻѽѿҁҋҍҏґғҕҗҙқҝҟҡңҥҧҩҫҭүұҳҵҷҹһҽҿӀӂӄӆӈӊӌӎӑӓӕӗәӛӝӟӡӣӥӧөӫӭӯӱӳӵӹ" +
|
14
|
+
"աբգդեզէըթժիլխծկհձղճմյնշոչպջռսվտրցւփքօֆև"
|
15
|
+
|
16
|
+
WIKI_WORD_PATTERN = '[A-Z' + I18N_HIGHER_CASE_LETTERS + '][a-z' + I18N_LOWER_CASE_LETTERS + ']+[A-Z' + I18N_HIGHER_CASE_LETTERS + ']\w+'
|
17
|
+
|
18
|
+
def self.separate(wiki_word, ignore_separation = false)
|
19
|
+
if ignore_separation
|
20
|
+
wiki_word
|
21
|
+
else
|
22
|
+
wiki_word.gsub(/([a-z#{I18N_LOWER_CASE_LETTERS}])([A-Z#{I18N_HIGHER_CASE_LETTERS}])/u, '\1 \2')
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<div id="TextileHelp" style="float: right; width: 250px; margin-top: 5px">
|
2
|
+
<h3>Markdown formatting tips (<a target="_new" href="http://daringfireball.net/projects/markdown/syntax">advanced</a>)</h3>
|
3
|
+
<table cellspacing="0" cellpadding="0">
|
4
|
+
<tr><td>_your text_</td><td class="arrow">→</td><td><em>your text</em></td></tr>
|
5
|
+
<tr><td>**your text**</td><td class="arrow">→</td><td><strong>your text</strong></td></tr>
|
6
|
+
<tr><td>`my code`</td><td class="arrow">→</td><td><code>my code</code></td></tr>
|
7
|
+
<tr><td>* Bulleted list<br />* Second item</td><td class="arrow">→</td><td>• Bulleted list<br />• Second item</td></tr>
|
8
|
+
<tr><td>1. Numbered list<br />1. Second item</td><td class="arrow">→</td><td>1. Numbered list<br />2. Second item</td></tr>
|
9
|
+
<tr><td>[link name](URL)</td><td class="arrow">→</td><td><a href="URL">link name</a></td></tr>
|
10
|
+
<tr><td>***</td><td class="arrow">→</td><td>Horizontal ruler</td></tr>
|
11
|
+
<tr><td><http://url><br /><email@add.com></td><td class="arrow">→</td><td>Auto-linked</td></tr>
|
12
|
+
<tr><td>![Alt text](URL)</td><td class="arrow">→</td><td>Image</td></tr>
|
13
|
+
</table>
|
14
|
+
|
15
|
+
<%= sub_template "wiki_words_help" %>
|
16
|
+
</div>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<%
|
2
|
+
def list_item(title, url, description, accesskey = nil)
|
3
|
+
if @title == title
|
4
|
+
"<b class=\"navOn\" title=\"#{description}\" accesskey=\"#{accesskey}\">#{title}</b>"
|
5
|
+
else
|
6
|
+
"<a href=\"#{url}\" title=\"#{description}\" accesskey=\"#{accesskey}\">#{title}</a>"
|
7
|
+
end
|
8
|
+
end
|
9
|
+
%>
|
10
|
+
|
11
|
+
<form id="navigationForm" class="navigation" action="../search/" action="get" style="font-size: 10px">
|
12
|
+
<%= list_item "Home Page", "../show/HomePage", "Home, Sweet Home", "H" %> |
|
13
|
+
<%= list_item "All Pages", "../list/", "Alphabetically sorted list of pages", "A" %> |
|
14
|
+
<%= list_item "Recently Revised", "../recently_revised/", "Pages sorted by when they were last changed", "U" %> |
|
15
|
+
<%= list_item "Authors", "../authors/", "Who wrote what" %> |
|
16
|
+
<%= list_item "Feeds", "../feeds/", "Subscribe to changes by RSS" %> |
|
17
|
+
<%= list_item "Export", "../export/", "Download a zip with all the pages in this wiki", "X" %> |
|
18
|
+
<input type="text" id="searchField" name="query" style="font-size: 10px" value="Search" onClick="this.value == 'Search' ? this.value = '' : true">
|
19
|
+
</form>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<div id="TextileHelp" style="float: right; width: 250px; margin-top: 5px">
|
2
|
+
<h3>RDoc formatting tips (<a target="_new" href="http://rdoc.sourceforge.net/doc/files/markup/simple_markup_rb.html">advanced</a>)</h3>
|
3
|
+
<table cellspacing="0" cellpadding="0">
|
4
|
+
<tr><td>_your text_</td><td class="arrow">→</td><td><em>your text</em></td></tr>
|
5
|
+
<tr><td>*your text*</td><td class="arrow">→</td><td><strong>your text</strong></td></tr>
|
6
|
+
<tr><td>* Bulleted list<br />* Second item</td><td class="arrow">→</td><td>• Bulleted list<br />• Second item</td></tr>
|
7
|
+
<tr><td>1. Numbered list<br />2. Second item</td><td class="arrow">→</td><td>1. Numbered list<br />2. Second item</td></tr>
|
8
|
+
<tr><td>+my_code+</td><td class="arrow">→</td><td><code>my_code</code></td></tr>
|
9
|
+
<tr><td>---</td><td class="arrow">→</td><td>Horizontal ruler</td></tr>
|
10
|
+
<tr><td>[[URL linkname]]</td><td class="arrow">→</td><td><a href="URL">linkname</a></td></tr>
|
11
|
+
<tr><td>http://url<br />mailto:e@add.com</td><td class="arrow">→</td><td>Auto-linked</td></tr>
|
12
|
+
<tr><td>imageURL</td><td class="arrow">→</td><td>Image</td></tr>
|
13
|
+
</table>
|
14
|
+
|
15
|
+
<%= sub_template "wiki_words_help" %>
|
16
|
+
</div>
|
@@ -0,0 +1,199 @@
|
|
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
|
199
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<div id="TextileHelp" style="float: right; width: 250px; margin-top: 5px">
|
2
|
+
<h3>Textile formatting tips (<a href="#" onClick="quickRedReference(); return false;">advanced</a>)</h3>
|
3
|
+
<table cellspacing="0" cellpadding="0">
|
4
|
+
<tr><td>_your text_</td><td class="arrow">→</td><td><em>your text</em></td></tr>
|
5
|
+
<tr><td>*your text*</td><td class="arrow">→</td><td><strong>your text</strong></td></tr>
|
6
|
+
<tr><td>%{color:red}hello%</td><td class="arrow">→</td><td><span style="color: red;">hello</span></td></tr>
|
7
|
+
<tr><td>* Bulleted list<br />* Second item</td><td class="arrow">→</td><td>• Bulleted list<br />• Second item</td></tr>
|
8
|
+
<tr><td># Numbered list<br /># Second item</td><td class="arrow">→</td><td>1. Numbered list<br />2. Second item</td></tr>
|
9
|
+
<tr><td>"linkname":URL</td><td class="arrow">→</td><td><a href="URL">linkname</a></td></tr>
|
10
|
+
<tr><td>|a|table|row|<br />|b|table|row|</td><td class="arrow">→</td><td>Table</td></tr>
|
11
|
+
<tr><td>http://url<br />email@address.com</td><td class="arrow">→</td><td>Auto-linked</td></tr>
|
12
|
+
<tr><td>!imageURL!</td><td class="arrow">→</td><td>Image</td></tr>
|
13
|
+
</table>
|
14
|
+
|
15
|
+
<%= sub_template "wiki_words_help" %>
|
16
|
+
</div>
|
17
|
+
|
18
|
+
<script language="JavaScript">
|
19
|
+
function quickRedReference() {
|
20
|
+
window.open(
|
21
|
+
"http://hobix.com/textile/quick.html",
|
22
|
+
"redRef",
|
23
|
+
"height=600,width=550,channelmode=0,dependent=0," +
|
24
|
+
"directories=0,fullscreen=0,location=0,menubar=0," +
|
25
|
+
"resizable=0,scrollbars=1,status=1,toolbar=0"
|
26
|
+
);
|
27
|
+
}
|
28
|
+
</script>
|
data/app/views/top.rhtml
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
3
|
+
<head>
|
4
|
+
<title>
|
5
|
+
<% if @web && @page && @page.name == "HomePage" && %( show published print ).include?(@action_name) %>
|
6
|
+
<%= @web.name %>
|
7
|
+
<% elsif @web %>
|
8
|
+
<%= @title %> in <%= @web.name %>
|
9
|
+
<% else %>
|
10
|
+
<%= @title %>
|
11
|
+
<% end %>
|
12
|
+
</title>
|
13
|
+
|
14
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
15
|
+
|
16
|
+
<style type="text/css">
|
17
|
+
h1#pageName, .newWikiWord a, a.existingWikiWord, .newWikiWord a:hover, #TextileHelp h3 {
|
18
|
+
color: #<%= @web ? @web.color : "393" %>;
|
19
|
+
}
|
20
|
+
|
21
|
+
#Container, #Content {
|
22
|
+
width: <%= @content_width || "600" %>px;
|
23
|
+
}
|
24
|
+
<%= sub_template("static_style_sheet") if @inline_style %>
|
25
|
+
</style>
|
26
|
+
|
27
|
+
<link rel="Stylesheet" href="../static_style_sheet/" type="text/css" media="screen" />
|
28
|
+
|
29
|
+
<style type="text/css">
|
30
|
+
<%= @style_additions %>
|
31
|
+
<%= @web ? web.additional_style : "" %>
|
32
|
+
</style>
|
33
|
+
</head>
|
34
|
+
<body>
|
35
|
+
<div id="Container">
|
36
|
+
<div id="Content">
|
37
|
+
|
38
|
+
<h1 id="pageName">
|
39
|
+
<% if @web && @page && @page.name == "HomePage" && %( show published print ).include?(@action_name) %>
|
40
|
+
<%= @web.name %>
|
41
|
+
<% elsif @web %>
|
42
|
+
<small><%= @web.name %></small><br />
|
43
|
+
<%= @title %>
|
44
|
+
<% else %>
|
45
|
+
<%= @title %>
|
46
|
+
<% end %>
|
47
|
+
</h1>
|
48
|
+
|
49
|
+
<%= sub_template "navigation" unless @web.nil? || @hide_navigation %>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<% @title = "Authors" %><%= sub_template "top" %>
|
2
|
+
|
3
|
+
<ul id="authorList">
|
4
|
+
<% for author in @authors %>
|
5
|
+
<li>
|
6
|
+
<%= @web.make_link(author) %>
|
7
|
+
co- or authored:
|
8
|
+
<%= @web.select.pages_authored_by(author).collect { |page| page.link }.join ", " %>
|
9
|
+
</li>
|
10
|
+
<% end %>
|
11
|
+
</ul>
|
12
|
+
|
13
|
+
<%= sub_template "bottom" %>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<%
|
2
|
+
@title = "Editing #{@page.name}"
|
3
|
+
@content_width = 720
|
4
|
+
@hide_navigation = true
|
5
|
+
%><%= sub_template "top" %>
|
6
|
+
|
7
|
+
<%= "<p style='color:red'>Please correct the error that caused this error in rendering:<br/><small>#{@params["msg"]}</small></p>" if @params["msg"] %>
|
8
|
+
|
9
|
+
<%= render_markup_help %>
|
10
|
+
|
11
|
+
<form id="editForm" action="../save/<%= @page.name %>" method="post" onSubmit="cleanAuthorName();">
|
12
|
+
<p>
|
13
|
+
<textarea name="content" style="width: 450px; height: 500px"><%= @page.content %></textarea>
|
14
|
+
</p>
|
15
|
+
<p>
|
16
|
+
<input type="submit" value="Update"> as
|
17
|
+
<input type="text" name="author" id="authorName" value="<%= @author %>"
|
18
|
+
onClick="this.value == 'AnonymousCoward' ? this.value = '' : true">
|
19
|
+
| <a href="../cancel_edit/<%= @page.name %>">Cancel</a> <small>(unlocks page)</small>
|
20
|
+
</p>
|
21
|
+
</form>
|
22
|
+
|
23
|
+
<script language="JavaScript1.2">
|
24
|
+
function cleanAuthorName() {
|
25
|
+
if (document.getElementById('authorName').value == "") {
|
26
|
+
document.getElementById('authorName').value = 'AnonymousCoward';
|
27
|
+
}
|
28
|
+
}
|
29
|
+
</script>
|
30
|
+
|
31
|
+
<%= sub_template "bottom" %>
|
@@ -0,0 +1,138 @@
|
|
1
|
+
<% @title = "Edit Web" %><%= sub_template "top" %>
|
2
|
+
|
3
|
+
<form action="../update_web" id="setup" method="post" onSubmit="cleanAddress(); return validateSetup()">
|
4
|
+
<h2 style="margin-bottom: 3px">Name and address</h2>
|
5
|
+
<div class="help">
|
6
|
+
The name of the web is included in the title on all pages. The address is the base path that all pages within the web live beneath.
|
7
|
+
Ex: the address "rails" gives URLs like <i>/rails/show/HomePage</i>.
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<div class="inputBox">
|
11
|
+
Name: <input type="text" id="name" name="name" value="<%= @web.name %>" onChange="proposeAddress();">
|
12
|
+
Address: <input type="text" id="address" name="address" value="<%= @web.address %>" onChange="cleanAddress();">
|
13
|
+
<i>(Letters & digits only)</i>
|
14
|
+
</div>
|
15
|
+
|
16
|
+
<h2 style="margin-bottom: 3px">Specialize</h2>
|
17
|
+
<div class="help">
|
18
|
+
Turning safe mode on will strip HTML tags and stylesheet options from the content of all pages.
|
19
|
+
Turning on "brackets only" will require all wiki words to be as [[wiki word]] and WikiWord won't work.
|
20
|
+
Additions to the stylesheet take precedence over the existing styles. <i>Hint:</i> View source on a page you want to
|
21
|
+
style to find ID names on individual tags. <a href="#" onClick="document.getElementById('additionalStyle').style.display='block';return false;">See styles >></a>
|
22
|
+
</div>
|
23
|
+
<div class="inputBox">
|
24
|
+
Markup:
|
25
|
+
<select name="markup">
|
26
|
+
<%= html_options({ "Textile" => :textile, "Markdown" => :markdown, "RDoc" => :rdoc }, @web.markup) %>
|
27
|
+
</select>
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
Color:
|
32
|
+
<select name="color">
|
33
|
+
<%= html_options({ "Green" => "008B26", "Purple" => "504685", "Red" => "DA0006", "Orange" => "FA6F00", "Grey" => "8BA2B0" },
|
34
|
+
@web.color) %>
|
35
|
+
</select>
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
<small>
|
40
|
+
|
41
|
+
<input type="checkbox" name="safe_mode"<%= " CHECKED" if @web.safe_mode %>> Safe mode
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
<input type="checkbox" name="brackets_only"<%= " CHECKED" if @web.brackets_only %>> Brackets only
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<input type="checkbox" name="count_pages"<%= " CHECKED" if @web.count_pages %>> Count pages
|
50
|
+
|
51
|
+
</small>
|
52
|
+
|
53
|
+
<textarea id="additionalStyle" style="display: none; margin-top: 10px; margin-bottom: 5px; width: 560px; height: 200px" name="additional_style"><%= @web.additional_style %></textarea>
|
54
|
+
</div>
|
55
|
+
|
56
|
+
<h2 style="margin-bottom: 3px">Password protection for this web (<%= @web.name %>)</h2>
|
57
|
+
<div class="help">
|
58
|
+
This is the password that visitors need to view and edit this web. Setting the password to nothing will remove the password protection.
|
59
|
+
</div>
|
60
|
+
<div class="inputBox">
|
61
|
+
Password: <input type="password" id="password" name="password" value="<%= @web.password %>">
|
62
|
+
Verify: <input type="password" id="password_check" value="<%= @web.password %>" name="password_check">
|
63
|
+
</div>
|
64
|
+
|
65
|
+
<h2 style="margin-bottom: 3px">Publish read-only version of this web (<%= @web.name %>)</h2>
|
66
|
+
<div class="help">
|
67
|
+
You can turn on a read-only version of this web that's accessible even when the regular web is password protected.
|
68
|
+
The published version is accessible through URLs like /wiki/published/HomePage.
|
69
|
+
</div>
|
70
|
+
<div class="inputBox">
|
71
|
+
<input type="checkbox" name="published"<%= " CHECKED" if @web.published %>> Publish this web
|
72
|
+
</div>
|
73
|
+
|
74
|
+
<p align="right">
|
75
|
+
<small>
|
76
|
+
Enter system password
|
77
|
+
<input type="password" id="system_password" name="system_password">
|
78
|
+
and
|
79
|
+
<input type="submit" value="Update Web">
|
80
|
+
<br/><br/>
|
81
|
+
...or forget changes and <a href="/new_web/">create a new web</a>
|
82
|
+
</small>
|
83
|
+
</p>
|
84
|
+
|
85
|
+
</form>
|
86
|
+
|
87
|
+
<br/>
|
88
|
+
<h1>Other administrative tasks</h1>
|
89
|
+
|
90
|
+
<form action="../remove_orphaned_pages" id="remove_orphaned_pages" method="post">
|
91
|
+
|
92
|
+
<p align="right">
|
93
|
+
<small>
|
94
|
+
Clean up by entering system password
|
95
|
+
<input type="password" id="system_password" name="system_password">
|
96
|
+
and
|
97
|
+
<input type="submit" value="Delete Orphan Pages">
|
98
|
+
</small>
|
99
|
+
</p>
|
100
|
+
|
101
|
+
<script>
|
102
|
+
function proposeAddress() {
|
103
|
+
document.getElementById('address').value =
|
104
|
+
document.getElementById('name').value.replace(/[^a-zA-Z0-9]/g, "").toLowerCase();
|
105
|
+
}
|
106
|
+
|
107
|
+
function cleanAddress() {
|
108
|
+
document.getElementById('address').value =
|
109
|
+
document.getElementById('address').value.replace(/[^a-zA-Z0-9]/g, "").toLowerCase();
|
110
|
+
}
|
111
|
+
|
112
|
+
function validateSetup() {
|
113
|
+
if (document.getElementById('system_password').value == "") {
|
114
|
+
alert("You must enter the system password");
|
115
|
+
return false;
|
116
|
+
}
|
117
|
+
|
118
|
+
if (document.getElementById('name').value == "") {
|
119
|
+
alert("You must pick a name for the web");
|
120
|
+
return false;
|
121
|
+
}
|
122
|
+
|
123
|
+
if (document.getElementById('address').value == "") {
|
124
|
+
alert("You must pick an address for the web");
|
125
|
+
return false;
|
126
|
+
}
|
127
|
+
|
128
|
+
if (document.getElementById('password').value != "" &&
|
129
|
+
document.getElementById('password').value != document.getElementById('password_check').value) {
|
130
|
+
alert("The password and its verification doesn't match");
|
131
|
+
return false;
|
132
|
+
}
|
133
|
+
|
134
|
+
return true;
|
135
|
+
}
|
136
|
+
</script>
|
137
|
+
|
138
|
+
<%= sub_template "bottom" %>
|