Pimki 1.3.092 → 1.4.092

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. data/README +145 -131
  2. data/README-PIMKI +15 -5
  3. data/app/controllers/wiki.rb +167 -54
  4. data/app/models/author.rb +3 -3
  5. data/app/models/chunks/chunk.rb +3 -3
  6. data/app/models/chunks/engines.rb +18 -21
  7. data/app/models/chunks/include.rb +29 -29
  8. data/app/models/chunks/literal.rb +20 -20
  9. data/app/models/chunks/match.rb +19 -19
  10. data/app/models/chunks/nowiki.rb +31 -31
  11. data/app/models/chunks/nowiki_test.rb +14 -14
  12. data/app/models/chunks/test.rb +18 -18
  13. data/app/models/chunks/todo.rb +44 -23
  14. data/app/models/chunks/uri.rb +97 -97
  15. data/app/models/chunks/uri_test.rb +92 -92
  16. data/app/models/chunks/wiki.rb +4 -4
  17. data/app/models/chunks/wiki_symbols.rb +22 -22
  18. data/app/models/chunks/wiki_test.rb +36 -36
  19. data/app/models/page.rb +39 -7
  20. data/app/models/page_lock.rb +23 -23
  21. data/app/models/page_set.rb +72 -72
  22. data/app/models/page_test.rb +75 -75
  23. data/app/models/revision.rb +1 -1
  24. data/app/models/revision_test.rb +251 -251
  25. data/app/models/web.rb +19 -6
  26. data/app/models/web_test.rb +52 -52
  27. data/app/models/wiki_content.rb +131 -119
  28. data/app/models/wiki_service.rb +31 -16
  29. data/app/models/wiki_service_test.rb +15 -15
  30. data/app/models/wiki_words.rb +1 -1
  31. data/app/models/wiki_words_test.rb +12 -12
  32. data/app/views/bottom.rhtml +3 -3
  33. data/app/views/markdown_help.rhtml +15 -15
  34. data/app/views/menu.rhtml +20 -20
  35. data/app/views/navigation.rhtml +26 -26
  36. data/app/views/rdoc_help.rhtml +15 -15
  37. data/app/views/static_style_sheet.rhtml +237 -237
  38. data/app/views/style.rhtml +178 -178
  39. data/app/views/textile_help.rhtml +27 -27
  40. data/app/views/top.rhtml +7 -2
  41. data/app/views/wiki/authors.rhtml +15 -15
  42. data/app/views/wiki/bliki.rhtml +101 -101
  43. data/app/views/wiki/bliki_edit.rhtml +3 -0
  44. data/app/views/wiki/bliki_new.rhtml +3 -0
  45. data/app/views/wiki/bliki_revision.rhtml +90 -90
  46. data/app/views/wiki/edit.rhtml +12 -3
  47. data/app/views/wiki/edit_menu.rhtml +64 -47
  48. data/app/views/wiki/edit_web.rhtml +65 -18
  49. data/app/views/wiki/export.rhtml +14 -14
  50. data/app/views/wiki/feeds.rhtml +10 -10
  51. data/app/views/wiki/list.rhtml +17 -15
  52. data/app/views/wiki/locked.rhtml +13 -13
  53. data/app/views/wiki/login.rhtml +10 -10
  54. data/app/views/wiki/mind.rhtml +0 -1
  55. data/app/views/wiki/new.rhtml +8 -3
  56. data/app/views/wiki/new_system.rhtml +77 -77
  57. data/app/views/wiki/new_web.rhtml +63 -63
  58. data/app/views/wiki/page.rhtml +88 -82
  59. data/app/views/wiki/print.rhtml +15 -15
  60. data/app/views/wiki/published.rhtml +2 -1
  61. data/app/views/wiki/recently_revised.rhtml +31 -31
  62. data/app/views/wiki/revision.rhtml +1 -7
  63. data/app/views/wiki/rollback.rhtml +31 -0
  64. data/app/views/wiki/rss_feed.rhtml +21 -21
  65. data/app/views/wiki/search.rhtml +48 -48
  66. data/app/views/wiki/tex.rhtml +22 -22
  67. data/app/views/wiki/tex_web.rhtml +34 -34
  68. data/app/views/wiki/todo.rhtml +90 -67
  69. data/app/views/wiki/web_list.rhtml +12 -12
  70. data/app/views/wiki_words_help.rhtml +1 -1
  71. data/favicon.png +0 -0
  72. data/libraries/action_controller_servlet.rb +17 -2
  73. data/libraries/bluecloth.rb +1127 -1127
  74. data/libraries/diff/diff.rb +474 -474
  75. data/libraries/diff/diff_test.rb +79 -79
  76. data/libraries/erb.rb +490 -490
  77. data/libraries/madeleine/automatic.rb +418 -357
  78. data/libraries/madeleine/clock.rb +94 -94
  79. data/libraries/madeleine/files.rb +19 -0
  80. data/libraries/madeleine/zmarshal.rb +60 -0
  81. data/libraries/madeleine_service.rb +14 -15
  82. data/libraries/rdocsupport.rb +155 -155
  83. data/libraries/redcloth_for_tex.rb +869 -869
  84. data/libraries/redcloth_for_tex_test.rb +40 -40
  85. data/libraries/view_helper.rb +32 -32
  86. data/libraries/web_controller_server.rb +96 -94
  87. data/pimki.rb +47 -6
  88. metadata +18 -4
@@ -24,7 +24,7 @@
24
24
  <div class="inputBox">
25
25
  Markup:
26
26
  <select name="markup">
27
- <%= html_options({ "Textile" => :textile, "Markdown" => :markdown, "RDoc" => :rdoc }, @web.markup) %>
27
+ <%= html_options({ "Textile" => :textile, "Markdown via RedCloth (experimental)" => :red_markdown, "Markdown via BlueCloth" => :blue_markdown, "RDoc" => :rdoc }, @web.markup) %>
28
28
  </select>
29
29
 
30
30
  &nbsp;&nbsp;
@@ -56,11 +56,13 @@
56
56
 
57
57
  <h2 style="margin-bottom: 3px">Password protection for this web (<%= @web.name %>)</h2>
58
58
  <div class="help">
59
- This is the password that visitors need to view and edit this web. Setting the password to nothing will remove the password protection.
59
+ This is the password that visitors need to login to view and edit this web. Setting the password to nothing will remove the password protection.
60
60
  </div>
61
61
  <div class="inputBox">
62
62
  Password: <input type="password" id="password" name="password" value="<%= @web.password %>"> &nbsp;&nbsp;
63
- Verify: <input type="password" id="password_check" value="<%= @web.password %>" name="password_check">
63
+ Verify: <input type="password" id="password_check" value="<%= @web.password %>" name="password_check"><br />
64
+ <input type="radio" id="check_pass_on_edit" name="check_pass_on_edit" value='each_edit' <%= 'checked' if @web.check_pass_on_edit %>>Require password for each edit
65
+ <input type="radio" id="check_pass_on_edit" name="check_pass_on_edit" value='login_only' <%= 'checked' if @web.check_pass_on_edit %>>Require password once on logon
64
66
  </div>
65
67
 
66
68
  <h2 style="margin-bottom: 3px">Publish read-only version of this web (<%= @web.name %>)</h2>
@@ -72,18 +74,63 @@
72
74
  <input type="checkbox" name="published"<%= " CHECKED" if @web.published %>> Publish this web
73
75
  </div>
74
76
 
75
- <h2 style="margin-bottom: 3px">Customise this PIM (<%= @web.name %>)</h2>
77
+ <h2 style="margin-bottom: 3px">Customise this PIM</h2>
76
78
  <div class="help">
77
- Here are a few setting you can use to tweak the appearance of your Pimki.
79
+ Here are a few setting you can use to tweak the appearance and behaviour of your Pimki.
78
80
  </div>
79
81
  <div class="inputBox">
82
+ <h4>Interface Options</h4>
83
+ <input type="checkbox" name="enable_dclick_edit" <%= "checked" if @web.enable_dclick_edit %>> Edit page on double click.
84
+
85
+ <h4>Mind Map</h4>
86
+ <i>Size</i>:<br />
80
87
  Limit the size of the Mind Map image. Format is "width,height" in inches. Leave blank for no size limit.<br />
81
88
  <input type="text" name="mind_map_size" id="mind_map_size" value="<%= web.mind_map_size %>">
89
+ <table>
90
+ <tr style="font-style:italic;">
91
+ <td>Graph Type</td>
92
+ <td style="width:200px">Layout Type</td>
93
+ <td style="width:500px">Content Options</td>
94
+ <td>Categories</td>
95
+ </tr>
96
+ <tr>
97
+ <td style="vertical-align:top;" width="30%">
98
+ <input type="radio" name="graph_type" value="normal" <%= 'checked' if @graph_type == 'normal' %>>Draw Normal Graph<br>
99
+ <input type="radio" name="graph_type" value="author" <%= 'checked' if @graph_type == 'author' %>>Draw Authors Graph<br>
100
+ <input type="radio" name="graph_type" value="category" <%= 'checked' if @graph_type == 'category' %>>Draw Category Graph<br>
101
+ </td>
102
+ <td width="100" style="vertical-align:top;" >
103
+ <input type="radio" name="draw_type" value="neato" <% if @prog == 'neato' %> checked <% end %>>Neato<br>
104
+ <input type="radio" name="draw_type" value="dot" <% if @prog == 'dot' %> checked <% end %>>Dot</br>
105
+ <input type="radio" name="draw_type" value="circo" <% if @prog == 'circo' %> checked <% end %>>Circo</br>
106
+ <input type="radio" name="draw_type" value="twopi" <% if @prog == 'twopi' %> checked <% end %>>Twopi</br>
107
+ </td>
108
+ <td style="vertical-align:top;width:400px;">
109
+ <input type="checkbox" id="show_authors" name="show_authors" <%= 'checked' if @show_authors %>>Show author pages<br>
110
+ <input type="checkbox" id="missing" name="missing" <%= 'checked' if @missing %>>Show missing pages<br>
111
+ <input type="checkbox" id="show_leaves" name="show_leaves" <%= 'checked' if @show_leaves %>>Show leaf pages<br>
112
+ </td>
113
+ <td>
114
+ <select id="selected_categs" name="selected_categs" size="4" style="width:120px;" multiple>
115
+ <option value="all" <%= 'selected' if @selected_categories.empty? %>>&lt;all categories&gt;</option>
116
+ <option value="none" <%= 'selected' if @selected_categories.include? 'none' %>>&lt;no categories&gt;</option>
117
+ <% for category in @categories %>
118
+ <option value="<%= category %>" <%= 'selected' if @selected_categories.include? category %>><%= category %></option>
119
+ <% end %>
120
+ </select>
121
+ </td>
122
+ </tr>
123
+ </table>
124
+
82
125
 
83
126
  <!--
84
127
 
85
128
  <br /><br />
86
-
129
+ <h4>Bliki Options</h4>
130
+
131
+ <br /><br />
132
+ <h4>Content & Symbols mapping</h4>
133
+
87
134
  Extra special symbols. The format of the map is: "code=text" on separate lines. This will map an element of <i>&lt;:code&gt;</i> to <i>text</i>, e.g. &lt;:cbx&gt; is mapped to &lt;input type="checkbox" disabled /&gt;<br />
88
135
  <textarea name="symbols_map" id="symbols_map" style="width: 100%; height: 100px"></textarea>
89
136
 
@@ -93,18 +140,18 @@
93
140
  <textarea name="links_map" id="links_map" style="width: 100%; height: 100px"></textarea>
94
141
 
95
142
  -->
96
- </div>
97
-
98
- <p align="right">
99
- <small>
100
- Enter system password
101
- <input type="password" id="system_password" name="system_password">
102
- and
103
- <input type="submit" value="Update Web">
104
- <br/><br/>
105
- ...or forget changes and <a href="/new_web/">create a new web</a>
106
- </small>
107
- </p>
143
+ </div>
144
+
145
+ <p align="right">
146
+ <small>
147
+ Enter system password
148
+ <input type="password" id="system_password" name="system_password">
149
+ and
150
+ <input type="submit" value="Update Web">
151
+ <br/><br/>
152
+ ...or forget changes and <a href="/new_web/">create a new web</a>
153
+ </small>
154
+ </p>
108
155
 
109
156
  </form>
110
157
 
@@ -1,14 +1,14 @@
1
- <% @title = "Export" %><%= sub_template "top" %>
2
-
3
- <p>You can export all the pages in this web as a zip file in either HTML (with working links and all) or the pure markup (to import in another wiki).</p>
4
-
5
- <ul id="feedsList">
6
- <li><a href="../export_html">HTML</a>
7
- <li><a href="../export_markup">Markup (<%= @web.markup %>)</a>
8
- <% if OPTIONS[:pdflatex] && @web.markup == :textile %>
9
- <li><a href="../export_tex">TeX</a>
10
- <li><a href="../export_pdf">PDF</a>
11
- <% end %>
12
- </ul>
13
-
14
- <%= sub_template "bottom" %>
1
+ <% @title = "Export" %><%= sub_template "top" %>
2
+
3
+ <p>You can export all the pages in this web as a zip file in either HTML (with working links and all) or the pure markup (to import in another wiki).</p>
4
+
5
+ <ul id="feedsList">
6
+ <li><a href="../export_html">HTML</a>
7
+ <li><a href="../export_markup">Markup (<%= @web.markup %>)</a>
8
+ <% if OPTIONS[:pdflatex] && @web.markup == :textile %>
9
+ <li><a href="../export_tex">TeX</a>
10
+ <li><a href="../export_pdf">PDF</a>
11
+ <% end %>
12
+ </ul>
13
+
14
+ <%= sub_template "bottom" %>
@@ -1,10 +1,10 @@
1
- <% @title = "Feeds" %><%= sub_template "top" %>
2
-
3
- <p>You can subscribe to this wiki by RSS and get either just the headlines of the pages that change or the entire page.</p>
4
-
5
- <ul id="feedsList">
6
- <li><a href="../rss_with_content<%= "?password=#{web.password}" if web.password %>">Full content (RSS 2.0)</a>
7
- <li><a href="../rss_with_headlines<%= "?password=#{web.password}" if web.password %>">Headlines (RSS 2.0)</a>
8
- </ul>
9
-
10
- <%= sub_template "bottom" %>
1
+ <% @title = "Feeds" %><%= sub_template "top" %>
2
+
3
+ <p>You can subscribe to this wiki by RSS and get either just the headlines of the pages that change or the entire page.</p>
4
+
5
+ <ul id="feedsList">
6
+ <li><a href="../rss_with_content<%= "?password=#{web.password}" if web.password %>">Full content (RSS 2.0)</a>
7
+ <li><a href="../rss_with_headlines<%= "?password=#{web.password}" if web.password %>">Headlines (RSS 2.0)</a>
8
+ </ul>
9
+
10
+ <%= sub_template "bottom" %>
@@ -3,21 +3,22 @@
3
3
 
4
4
  <% unless @categories.empty? %>
5
5
  <div id="categories">
6
- <strong>Categories</strong>:
6
+ <p><strong>Categories</strong>:
7
7
 
8
8
  <% if @params["category"].nil? %>
9
- [Any]
9
+ [<span class='selected'>Any</span>]
10
10
  <% else %>
11
11
  <a href=".">Any</a>
12
12
  <% end %>
13
13
 
14
14
  <% if @params["category"] == 'none' %>
15
- [None]
15
+ [<span class='selected'>None</span>]
16
16
  <% else %>
17
17
  <a href="?category=none">None</a>
18
18
  <% end %>
19
19
 
20
20
  <%= @category_links.join(', ') %>
21
+ </p>
21
22
  </div>
22
23
  <% end %>
23
24
 
@@ -103,8 +104,13 @@
103
104
  <h2>Page Administration</h2>
104
105
 
105
106
  <table border="0" style="font-size:10px">
106
- <!-- Delete Page -->
107
- <form class="navigation" action="list/" action="get" onSubmit="return validateSelection('sel_delete') && verifyDelete();">
107
+ <form class="navigation" action="list/" action="get">
108
+ <% if @web.check_pass_on_edit %>
109
+ <tr>
110
+ <td colspan="2">Enter edit Password <input type="password" name="password" id="password" size="11"> and...</td>
111
+ </tr>
112
+ <% end %>
113
+ <!-- Delete Page -->
108
114
  <tr>
109
115
  <td>Delete page:</td>
110
116
  <td><select id="sel_delete" name="sel_page_name" size="1" style="width:195">
@@ -118,12 +124,10 @@
118
124
  <tr>
119
125
  <td>&nbsp;</td>
120
126
  <td align="right">
121
- <input type="submit" name="Action" value="Delete">
127
+ <input type="submit" name="Action" value="Delete" onClick="return validateSelection('sel_delete') && verifyDelete();">
122
128
  </td>
123
129
  </tr>
124
- </form>
125
- <!-- Rename Page -->
126
- <form class="navigation" action="../list/" action="get" onSubmit="return validateSelection('sel_rename') && verifyRename() && validatePageName('ren_newpage');">
130
+ <!-- Rename Page -->
127
131
  <tr>
128
132
  <td>Rename:</td>
129
133
  <td><select id="sel_rename" name="sel_page_name" size="1" style="width:195">
@@ -143,22 +147,20 @@
143
147
  <tr>
144
148
  <td>&nbsp;</td>
145
149
  <td align="right">
146
- <input type="submit" name="Action" value="Rename">
150
+ <input type="submit" name="Action" value="Rename" onClick="return validateSelection('sel_rename') && verifyRename() && validatePageName('ren_newpage');">
147
151
  </td>
148
152
  </tr>
149
- </form>
150
- <!-- Create Page -->
151
- <form class="navigation" action="../list/" action="get" onSubmit="return validatePageName('newpage');">
153
+ <!-- Create Page -->
152
154
  <tr>
153
155
  <td>Create New Page:</td>
154
156
  <td>
155
- <input type="text" name="newpage" id="newpage" size="28">
157
+ <input type="text" name="newpage" id="newpage" size="28">
156
158
  </td>
157
159
  </tr>
158
160
  <tr>
159
161
  <td>&nbsp;</td>
160
162
  <td align="right">
161
- <input type="submit" name="Action" value="Create">
163
+ <input type="submit" name="Action" value="Create" onClick="return validatePageName('newpage');">
162
164
  </td>
163
165
  </td>
164
166
  </tr>
@@ -1,14 +1,14 @@
1
- <% @title = "#{@page.plain_name} is locked" %><%= sub_template "top" %>
2
-
3
- <% if @page.lock_duration(Time.now) == 0 %>
4
- <p><%= @page.locked_by_link %> just started editing this page.</p>
5
- <% else %>
6
- <p><%= @page.locked_by_link %> has been editing this page for <%= @page.lock_duration(Time.now) %> minutes.</p>
7
- <% end %>
8
-
9
- <p>
10
- <a href="<%= @page.name %>?break_lock=1">Edit the page anyway</a> |
11
- <a href="../show/<%= @page.name %>">Cancel</a>
12
- </p>
13
-
1
+ <% @title = "#{@page.plain_name} is locked" %><%= sub_template "top" %>
2
+
3
+ <% if @page.lock_duration(Time.now) == 0 %>
4
+ <p><%= @page.locked_by_link %> just started editing this page.</p>
5
+ <% else %>
6
+ <p><%= @page.locked_by_link %> has been editing this page for <%= @page.lock_duration(Time.now) %> minutes.</p>
7
+ <% end %>
8
+
9
+ <p>
10
+ <a href="<%= @page.name %>?break_lock=1">Edit the page anyway</a> |
11
+ <a href="../show/<%= @page.name %>">Cancel</a>
12
+ </p>
13
+
14
14
  <%= sub_template "bottom" %>
@@ -1,11 +1,11 @@
1
- <% @title = "#{@web_name} Login" %><% @hide_navigation = true %><%= sub_template "top" %>
2
-
3
- <form action="authenticate" method="post">
4
- <p>
5
- <b>Password</b><br />
6
- <input type="password" name="password" />
7
- </p>
8
- </form>
9
-
10
-
1
+ <% @title = "#{@web_name} Login" %><% @hide_navigation = true %><%= sub_template "top" %>
2
+
3
+ <form action="authenticate" method="post">
4
+ <p>
5
+ <b>Password</b><br />
6
+ <input type="password" name="password" />
7
+ </p>
8
+ </form>
9
+
10
+
11
11
  <%= sub_template "bottom" %>
@@ -34,7 +34,6 @@
34
34
  <input type="checkbox" id="show_authors" name="show_authors" <%= 'checked' if @req.query['show_authors'] == 'on' %>>Show author pages<br>
35
35
  <input type="checkbox" id="missing" name="missing" <%= 'checked' if @req.query['missing'] == 'on' %>>Show missing pages<br>
36
36
  <input type="checkbox" id="show_leaves" name="show_leaves" <%= 'checked' if @req.query.empty? || @req.query['show_leaves'] == 'on' %>>Show leaf pages<br>
37
- <!-- <input type="checkbox" id="limit_categs" name="limit_categs" <%= 'checked' if @req.query['limit_categ'] == 'on' %>>Limit to selected cetegories<br> -->
38
37
  </td>
39
38
  <td>
40
39
  <select id="selected_categs" name="selected_categs" size="4" style="width:120px;" multiple>
@@ -1,16 +1,21 @@
1
1
  <%
2
2
  @title = "Creating #{WikiWords.separate(CGI.unescape(@page_name))}"
3
- @content_width = 720
3
+ @content_width = 800
4
4
  @hide_navigation = true
5
- %><%= sub_template "top" %>
5
+ @style_additions = "#Container, #Content {padding-left:100px;}"
6
+ %>
7
+ <%= sub_template "top" %>
6
8
 
7
9
  <%= render_markup_help %>
8
10
 
9
11
  <form action="../save/<%= @page_name %>" method="post" onSubmit="cleanAuthorName();">
10
12
  <p>
11
- <textarea name="content" style="width: 450px; height: 430px"></textarea>
13
+ <textarea name="content" style="width: 550px; height: 430px"></textarea>
12
14
  </p>
13
15
  <p>
16
+ <% if @web.check_pass_on_edit %>
17
+ Please enter edit password: <input type="password" name="password" id="password"><br />
18
+ <% end %>
14
19
  <input type="submit" value="Create"> as
15
20
  <input type="text" name="author" id="authorName" value="<%= @author %>" onClick="this.value == 'AnonymousCoward' ? this.value = '' : true">
16
21
  </p>
@@ -1,78 +1,78 @@
1
- <% @title = "Instiki Setup"; @content_width = 500 %><%= sub_template "top" %>
2
-
3
- <p>
4
- Congratulations on succesfully installing and starting Instiki.
5
- Since this is the first time Instiki has been run on this port, you'll need to do a brief one-time setup.
6
- </p>
7
-
8
- <form action="../create_system" id="setup" method="post" onSubmit="return validateSetup()">
9
- <ol class="setup">
10
- <li>
11
-
12
- <h2 style="margin-bottom: 3px">Name and address for your first web</h2>
13
- <div class="help">
14
- 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. Ex: the address "rails" gives URLs like <i>/rails/show/HomePage</i>. The address can only consist of letters & digits.
15
- </div>
16
- <div class="inputBox">
17
- Name: <input type="text" id="web_name" name="web_name" value="Wiki" onChange="proposeAddress();"
18
- onClick="this.value == 'Pimki' ? this.value = '' : true"> &nbsp;&nbsp;
19
- Address: <input type="text" id="web_address" name="web_address" onChange="cleanAddress();" value="pimki">
20
- </div>
21
- </li>
22
-
23
- <li>
24
- <h2 style="margin-bottom: 3px">Password for creating and changing webs</h2>
25
- <div class="help">
26
- Administrative access allows you to make new webs and change existing ones.<br/>
27
- Everyone with this password will be able to do this, so pick it carefully.
28
- </div>
29
- <div class="inputBox">
30
- Password: <input type="password" id="password" name="password"> &nbsp;&nbsp;
31
- Verify: <input type="password" id="password_check" name="password_check">
32
- </div>
33
- </li>
34
- </ol>
35
-
36
- <p align="right">
37
- <input type="submit" value="Setup" style="margin-left: 40px">
38
- </p>
39
- </form>
40
-
41
- <script>
42
- function proposeAddress() {
43
- document.getElementById('web_address').value =
44
- document.getElementById('web_name').value.replace(/[^a-zA-Z0-9]/g, "").toLowerCase();
45
- }
46
-
47
- function cleanAddress() {
48
- document.getElementById('web_address').value =
49
- document.getElementById('web_address').value.replace(/[^a-zA-Z0-9]/g, "").toLowerCase();
50
- }
51
-
52
- function validateSetup() {
53
- if (document.getElementById('web_name').value == "") {
54
- alert("You must pick a name for the first web");
55
- return false;
56
- }
57
-
58
- if (document.getElementById('web_address').value == "") {
59
- alert("You must pick an address for the first web");
60
- return false;
61
- }
62
-
63
- if (document.getElementById('password').value == "") {
64
- alert("You must pick a system password");
65
- return false;
66
- }
67
-
68
- if (document.getElementById('password_check').value == "" ||
69
- document.getElementById('password').value != document.getElementById('password_check').value) {
70
- alert("The password and its verification doesn't match");
71
- return false;
72
- }
73
-
74
- return true;
75
- }
76
- </script>
77
-
1
+ <% @title = "Instiki Setup"; @content_width = 500 %><%= sub_template "top" %>
2
+
3
+ <p>
4
+ Congratulations on succesfully installing and starting Instiki.
5
+ Since this is the first time Instiki has been run on this port, you'll need to do a brief one-time setup.
6
+ </p>
7
+
8
+ <form action="../create_system" id="setup" method="post" onSubmit="return validateSetup()">
9
+ <ol class="setup">
10
+ <li>
11
+
12
+ <h2 style="margin-bottom: 3px">Name and address for your first web</h2>
13
+ <div class="help">
14
+ 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. Ex: the address "rails" gives URLs like <i>/rails/show/HomePage</i>. The address can only consist of letters & digits.
15
+ </div>
16
+ <div class="inputBox">
17
+ Name: <input type="text" id="web_name" name="web_name" value="Wiki" onChange="proposeAddress();"
18
+ onClick="this.value == 'Pimki' ? this.value = '' : true"> &nbsp;&nbsp;
19
+ Address: <input type="text" id="web_address" name="web_address" onChange="cleanAddress();" value="pimki">
20
+ </div>
21
+ </li>
22
+
23
+ <li>
24
+ <h2 style="margin-bottom: 3px">Password for creating and changing webs</h2>
25
+ <div class="help">
26
+ Administrative access allows you to make new webs and change existing ones.<br/>
27
+ Everyone with this password will be able to do this, so pick it carefully.
28
+ </div>
29
+ <div class="inputBox">
30
+ Password: <input type="password" id="password" name="password"> &nbsp;&nbsp;
31
+ Verify: <input type="password" id="password_check" name="password_check">
32
+ </div>
33
+ </li>
34
+ </ol>
35
+
36
+ <p align="right">
37
+ <input type="submit" value="Setup" style="margin-left: 40px">
38
+ </p>
39
+ </form>
40
+
41
+ <script>
42
+ function proposeAddress() {
43
+ document.getElementById('web_address').value =
44
+ document.getElementById('web_name').value.replace(/[^a-zA-Z0-9]/g, "").toLowerCase();
45
+ }
46
+
47
+ function cleanAddress() {
48
+ document.getElementById('web_address').value =
49
+ document.getElementById('web_address').value.replace(/[^a-zA-Z0-9]/g, "").toLowerCase();
50
+ }
51
+
52
+ function validateSetup() {
53
+ if (document.getElementById('web_name').value == "") {
54
+ alert("You must pick a name for the first web");
55
+ return false;
56
+ }
57
+
58
+ if (document.getElementById('web_address').value == "") {
59
+ alert("You must pick an address for the first web");
60
+ return false;
61
+ }
62
+
63
+ if (document.getElementById('password').value == "") {
64
+ alert("You must pick a system password");
65
+ return false;
66
+ }
67
+
68
+ if (document.getElementById('password_check').value == "" ||
69
+ document.getElementById('password').value != document.getElementById('password_check').value) {
70
+ alert("The password and its verification doesn't match");
71
+ return false;
72
+ }
73
+
74
+ return true;
75
+ }
76
+ </script>
77
+
78
78
  <%= sub_template "bottom" %>