Pimki 1.7.092 → 1.8.092

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. data/README-PIMKI +182 -178
  2. data/app/controllers/wiki.rb +950 -942
  3. data/app/models/chunks/category.rb +33 -33
  4. data/app/models/chunks/category_test.rb +21 -21
  5. data/app/models/chunks/chunk.rb +20 -20
  6. data/app/models/chunks/engines.rb +48 -48
  7. data/app/models/chunks/include.rb +1 -1
  8. data/app/models/chunks/match.rb +1 -1
  9. data/app/models/chunks/nowiki.rb +1 -1
  10. data/app/models/chunks/nowiki_test.rb +5 -0
  11. data/app/models/chunks/todo.rb +1 -0
  12. data/app/models/chunks/wiki.rb +130 -130
  13. data/app/models/page.rb +124 -124
  14. data/app/models/revision.rb +92 -92
  15. data/app/models/web.rb +314 -316
  16. data/app/models/wiki_content.rb +2 -2
  17. data/app/models/wiki_service.rb +170 -166
  18. data/app/models/wiki_words.rb +28 -28
  19. data/app/views/error.rhtml +37 -37
  20. data/app/views/navigation.rhtml +1 -1
  21. data/app/views/static_style_sheet.rhtml +10 -5
  22. data/app/views/top.rhtml +1 -1
  23. data/app/views/wiki/adv_search.rhtml +61 -61
  24. data/app/views/wiki/bliki.rhtml +7 -6
  25. data/app/views/wiki/bliki_edit.rhtml +26 -37
  26. data/app/views/wiki/bliki_new.rhtml +58 -64
  27. data/app/views/wiki/bliki_revision.rhtml +5 -3
  28. data/app/views/wiki/edit.rhtml +44 -44
  29. data/app/views/wiki/edit_menu.rhtml +26 -19
  30. data/app/views/wiki/edit_web.rhtml +303 -305
  31. data/app/views/wiki/glossary.rhtml +35 -27
  32. data/app/views/wiki/list.rhtml +175 -174
  33. data/app/views/wiki/list.rhtml.bak +175 -0
  34. data/app/views/wiki/mind.rhtml +70 -70
  35. data/app/views/wiki/new.rhtml +34 -32
  36. data/app/views/wiki/published.rhtml +34 -49
  37. data/app/views/wiki/revision.rhtml +88 -87
  38. data/app/views/wiki/rollback.rhtml +36 -35
  39. data/app/views/wiki/todo.rhtml +2 -2
  40. data/app/views/wiki_words_help.rhtml +8 -8
  41. data/libraries/action_controller_servlet.rb +202 -202
  42. data/libraries/madeleine_service.rb +162 -162
  43. data/pimki.rb +181 -181
  44. metadata +11 -12
  45. data/README +0 -172
  46. data/app/models/chunks/acronym.rb +0 -19
  47. data/app/views/wiki/test.rhtml +0 -25
  48. data/libraries/secure_web_controller_server.rb +0 -106
@@ -1,70 +1,70 @@
1
- <% @title = "Mind Map"
2
- #@hide_menu = true
3
- #@style_additions = "#Container { width: 100%; } #Content { float: left; }"
4
- %>
5
- <%= sub_template "top" %>
6
-
7
- <h4>A "Mind Map" created from the Wiki links.</h4>
8
- <p style="font-size: 9px; margin-top: -20px; margin-bottom: 10px;">A printable version (just the image) can be found <a href="../get_map_img">here</a>.</p>
9
-
10
- <img src="../get_map_img" usemap="#graph.map" />
11
- <map name="graph.map" id="graph.map">
12
- <%= File.read(@mapFile) %>
13
- </map>
14
-
15
- <table border="0" width="100%">
16
- <form name="mapOpts" id="mapOpts" action="../mind/" method="post">
17
- <tr style="font-weight:bold;">
18
- <td>Graph Type</td>
19
- <td style="width:200px">Layout Type</td>
20
- <td style="width:500px">Content Options</td>
21
- <td>Categories</td>
22
- </tr>
23
- <tr>
24
- <td style="vertical-align:top;" width="30%">
25
- <input type="radio" name="graph_type" value="normal" <%= 'checked' if @graph_type == 'normal' %>>Draw Normal Graph<br>
26
- <input type="radio" name="graph_type" value="author" <%= 'checked' if @graph_type == 'author' %>>Draw Authors Graph<br>
27
- <input type="radio" name="graph_type" value="category" <%= 'checked' if @graph_type == 'category' %>>Draw Category Graph<br>
28
- </td>
29
- <td width="100" style="vertical-align:top;" >
30
- <input type="radio" name="draw_type" value="neato" <% if @prog == 'neato' %> checked <% end %>>Neato<br>
31
- <input type="radio" name="draw_type" value="dot" <% if @prog == 'dot' %> checked <% end %>>Dot</br>
32
- <input type="radio" name="draw_type" value="circo" <% if @prog == 'circo' %> checked <% end %>>Circo</br>
33
- <input type="radio" name="draw_type" value="twopi" <% if @prog == 'twopi' %> checked <% end %>>Twopi</br>
34
- </td>
35
- <td style="vertical-align:top;width:400px;">
36
- <input type="checkbox" id="show_authors" name="show_authors" <%= 'checked' if @req.query['show_authors'] == 'on' %>>Show author pages<br>
37
- <input type="checkbox" id="missing" name="missing" <%= 'checked' if @req.query['missing'] == 'on' %>>Show missing pages<br>
38
- <input type="checkbox" id="show_leaves" name="show_leaves" <%= 'checked' if @req.query.empty? || @req.query['show_leaves'] == 'on' %>>Show leaf pages<br>
39
- </td>
40
- <td>
41
- <select id="selected_categs" name="selected_categs" size="4" style="width:120px;" multiple>
42
- <option value="all" <%= 'selected' if @selected_categories.empty? %>>&lt;all categories&gt;</option>
43
- <option value="none" <%= 'selected' if @selected_categories.include? 'none' %>>&lt;no categories&gt;</option>
44
- <% for category in @categories %>
45
- <option value="<%= category %>" <%= 'selected' if @selected_categories.include? category %>><%= category %></option>
46
- <% end %>
47
- </select>
48
- </td>
49
- </tr>
50
- <tr>
51
- <td>Size: <input type="text" name="mind_map_size" id="mind_map_size" value="<%= @req.query['mind_map_size'] || web.mind_map_size %>"></td>
52
- <td colspan='3' align='center'><input type="submit" value="Redraw" name="Go" onClick='return validateMMSize();'></td>
53
- </tr>
54
- </form>
55
- </table>
56
-
57
- <p>Graphs generated with <a href='http://www.research.att.com/sw/tools/graphviz/'>GraphViz</a>.
58
-
59
- <script>
60
- function validateMMSize() {
61
- if (document.getElementById('mind_map_size').value != "" &&
62
- !(/^\d+,\d+$/.test(document.getElementById('mind_map_size').value))) {
63
- alert("The Mind Map size must be in the format of 'digit(s),digit(s)'!");
64
- return false;
65
- }
66
- return true;
67
- }
68
- </script>
69
- <%= sub_template "bottom" %>
70
-
1
+ <% @title = "Mind Map"
2
+ @hide_menu = true
3
+ @style_additions = "#Container { width: 100%; } #Content { float: left; width: 98% }"
4
+ %>
5
+ <%= sub_template "top" %>
6
+
7
+ <h4>A "Mind Map" created from the Wiki links.</h4>
8
+ <p style="font-size: 9px; margin-top: -20px; margin-bottom: 10px;">A printable version (just the image) can be found <a href="/<%= web.address %>/get_map_img">here</a>.</p>
9
+
10
+ <img src="/<%= web.address %>/get_map_img" usemap="#graph.map" />
11
+ <map name="graph.map" id="graph.map">
12
+ <%= File.read(@mapFile) %>
13
+ </map>
14
+
15
+ <table border="0" width="100%">
16
+ <form name="mapOpts" id="mapOpts" action="../mind/" method="post">
17
+ <tr style="font-weight:bold;">
18
+ <td>Graph Type</td>
19
+ <td style="width:200px">Layout Type</td>
20
+ <td style="width:500px">Content Options</td>
21
+ <td>Categories</td>
22
+ </tr>
23
+ <tr>
24
+ <td style="vertical-align:top;" width="30%">
25
+ <input type="radio" name="graph_type" value="normal" <%= 'checked' if @graph_type == 'normal' %>>Draw Normal Graph<br>
26
+ <input type="radio" name="graph_type" value="author" <%= 'checked' if @graph_type == 'author' %>>Draw Authors Graph<br>
27
+ <input type="radio" name="graph_type" value="category" <%= 'checked' if @graph_type == 'category' %>>Draw Category Graph<br>
28
+ </td>
29
+ <td width="100" style="vertical-align:top;" >
30
+ <input type="radio" name="draw_type" value="neato" <% if @prog == 'neato' %> checked <% end %>>Neato<br>
31
+ <input type="radio" name="draw_type" value="dot" <% if @prog == 'dot' %> checked <% end %>>Dot</br>
32
+ <input type="radio" name="draw_type" value="circo" <% if @prog == 'circo' %> checked <% end %>>Circo</br>
33
+ <input type="radio" name="draw_type" value="twopi" <% if @prog == 'twopi' %> checked <% end %>>Twopi</br>
34
+ </td>
35
+ <td style="vertical-align:top;width:400px;">
36
+ <input type="checkbox" id="show_authors" name="show_authors" <%= 'checked' if @req.query['show_authors'] == 'on' %>>Show author pages<br>
37
+ <input type="checkbox" id="missing" name="missing" <%= 'checked' if @req.query['missing'] == 'on' %>>Show missing pages<br>
38
+ <input type="checkbox" id="show_leaves" name="show_leaves" <%= 'checked' if @req.query.empty? || @req.query['show_leaves'] == 'on' %>>Show leaf pages<br>
39
+ </td>
40
+ <td>
41
+ <select id="selected_categs" name="selected_categs" size="4" style="width:120px;" multiple>
42
+ <option value="all" <%= 'selected' if @selected_categories.empty? %>>&lt;all categories&gt;</option>
43
+ <option value="none" <%= 'selected' if @selected_categories.include? 'none' %>>&lt;no categories&gt;</option>
44
+ <% for category in @categories %>
45
+ <option value="<%= category %>" <%= 'selected' if @selected_categories.include? category %>><%= category %></option>
46
+ <% end %>
47
+ </select>
48
+ </td>
49
+ </tr>
50
+ <tr>
51
+ <td>Size: <input type="text" name="mind_map_size" id="mind_map_size" value="<%= @req.query['mind_map_size'] || web.mind_map_size %>"></td>
52
+ <td colspan='3' align='center'><input type="submit" value="Redraw" name="Go" onClick='return validateMMSize();'></td>
53
+ </tr>
54
+ </form>
55
+ </table>
56
+
57
+ <p>Graphs generated with <a href='http://www.research.att.com/sw/tools/graphviz/'>GraphViz</a>.
58
+
59
+ <script>
60
+ function validateMMSize() {
61
+ if (document.getElementById('mind_map_size').value != "" &&
62
+ !(/^\d+,\d+$/.test(document.getElementById('mind_map_size').value))) {
63
+ alert("The Mind Map size must be in the format of 'digit(s),digit(s)'!");
64
+ return false;
65
+ }
66
+ return true;
67
+ }
68
+ </script>
69
+ <%= sub_template "bottom" %>
70
+
@@ -1,33 +1,35 @@
1
- <%
2
- @title = "Creating #{WikiWords.separate(CGI.unescape(@page_name))}"
3
- @content_width = 800
4
- @hide_navigation = true
5
- @hide_menu = true
6
- @style_additions = "#Container, #Content {padding-left:100px;}"
7
- %>
8
- <%= sub_template "top" %>
9
-
10
- <%= render_markup_help %>
11
-
12
- <form action="../save/<%= @page_name %>" method="post" onSubmit="cleanAuthorName();">
13
- <p>
14
- <textarea name="content" style="width: 550px; height: 430px"></textarea>
15
- </p>
16
- <p>
17
- <% if @web.check_pass_on_edit %>
18
- Please enter edit password: <input type="password" name="password" id="password"><br />
19
- <% end %>
20
- <input type="submit" value="Create"> as
21
- <input type="text" name="author" id="authorName" value="<%= @author %>" onClick="this.value == 'AnonymousCoward' ? this.value = '' : true">
22
- </p>
23
- </form>
24
-
25
- <script language="JavaScript1.2">
26
- function cleanAuthorName() {
27
- if (document.getElementById('authorName').value == "") {
28
- document.getElementById('authorName').value = 'AnonymousCoward';
29
- }
30
- }
31
- </script>
32
-
1
+ <%
2
+ @title = "Creating #{WikiWords.separate(CGI.unescape(@page_name))}"
3
+ @content_width = 800
4
+ @hide_navigation = true
5
+ @hide_menu = true
6
+ @style_additions = "#Container, #Content {padding-left:100px;}"
7
+ %>
8
+ <%= sub_template "top" %>
9
+
10
+ <%= render_markup_help %>
11
+
12
+ <form action="../save/<%= @page_name %>" method="post" onSubmit="cleanAuthorName();">
13
+ <p>
14
+ <textarea name="content" style="width: 550px; height: 75%"></textarea>
15
+ </p>
16
+ <p>
17
+ <% if @web.check_pass_on_edit %>
18
+ Please enter edit password: <input type="password" name="password" id="password"><br />
19
+ <% end %>
20
+ <input type="submit" value="Create"> as
21
+ <input type="text" name="author" id="authorName" value="<%= @author %>" onClick="this.value == 'AnonymousCoward' ? this.value = '' : true">
22
+ |
23
+ <a href='../list/'>Cancel</a>
24
+ </p>
25
+ </form>
26
+
27
+ <script language="JavaScript1.2">
28
+ function cleanAuthorName() {
29
+ if (document.getElementById('authorName').value == "") {
30
+ document.getElementById('authorName').value = 'AnonymousCoward';
31
+ }
32
+ }
33
+ </script>
34
+
33
35
  <%= sub_template "bottom" %>
@@ -1,50 +1,35 @@
1
- <%
2
- @title = @page.plain_name
3
- @hide_navigation = true
4
- @style_additions = ".newWikiWord { background-color: white; font-style: italic; }"
5
- #Container, #Content { width: 600px; padding-left: 180px;}"
6
- @inline_style = true
7
- %>
8
- <%= sub_template "top" %>
9
-
10
- <div id="revision">
11
- <%= @page.display_published %>
12
- </div>
13
-
14
- <div class="byline">
15
- <%= @page.revisions? ? "Revised" : "Created" %> on <%= @page.pretty_created_at %>
16
- by
17
- <%= @page.author_link({ :mode => :export }) %>
18
- </div>
19
-
20
- <div class="navigation">
21
- <small>
22
- | Views: <a href="../print/<%= @page.name %>">Print</a>
23
- <% if OPTIONS[:pdflatex] && @web.markup == :textile %>
24
- | <a href="../tex/<%= @page.name %>">TeX</a> | <a href="../pdf/<%= @page.name %>">PDF</a>
25
- <% end %>
26
- </small>
27
-
28
- <% if @page.references.length > 0 %>
29
- <small>
30
- <br />| Linked from: <%= @page.references.collect { |ref| ref.link }.join(", ").gsub('/show/', '/published/') %>
31
- </small>
32
- <% end %>
33
-
34
- <!-- TODO: fix this one the Bliki has a published interface
35
- <% if @page.bliki_references.length > 0 %>
36
- <small>
37
- <br />| Bliki Linked from: <%= @page.bliki_references.collect { |ref| link_to_bliki(ref) }.join(", ") %>
38
- </small>
39
- <% end %>
40
- -->
41
-
42
- <br />
43
- <!-- TODO: fix this one the published interface is better for all special templates.
44
- <%= list_item "Authors", "../authors/", "Who wrote what" %>
45
- | <%= list_item "Feeds", "../feeds/", "Subscribe to changes by RSS" %>
46
- | <%= list_item "Export", "../export/", "Download a zip with all the pages in this wiki", "X" %>
47
- -->
48
- </div>
49
-
1
+ <%
2
+ @title = @page.plain_name
3
+ @hide_navigation = true
4
+ @style_additions = ".newWikiWord { background-color: white; font-style: italic; }"
5
+ #Container, #Content { width: 600px; padding-left: 180px;}"
6
+ @inline_style = true
7
+ %>
8
+ <%= sub_template "top" %>
9
+
10
+ <div id="revision">
11
+ <%= @page.display_published %>
12
+ </div>
13
+
14
+ <div class="byline">
15
+ <%= @page.revisions? ? "Revised" : "Created" %> on <%= @page.pretty_created_at %>
16
+ by
17
+ <%= @page.author_link({ :mode => :publish }) %>
18
+ </div>
19
+
20
+ <div class="navigation">
21
+ <small>
22
+ | Views: <a href="../print/<%= @page.name %>">Print</a>
23
+ <% if OPTIONS[:pdflatex] && @web.markup == :textile %>
24
+ | <a href="../tex/<%= @page.name %>">TeX</a> | <a href="../pdf/<%= @page.name %>">PDF</a>
25
+ <% end %>
26
+ </small>
27
+
28
+ <% if @page.references.length > 0 %>
29
+ <small>
30
+ <br />| Linked from: <%= @page.references.collect { |ref| ref.link }.join(", ").gsub('/show/', '/published/') %>
31
+ </small>
32
+ <% end %>
33
+ </div>
34
+
50
35
  <%= sub_template "bottom" %>
@@ -1,87 +1,88 @@
1
- <% @title = "#{@page.plain_name} (Rev ##{@revision.number})" %><%= sub_template "top" %>
2
-
3
- <div id="revision">
4
- <%= @revision.display_content %>
5
- </div>
6
-
7
- <div id="changes" style="display: none">
8
- <p style="background: #eee; padding: 3px; border: 1px solid silver">
9
- <small>
10
- Showing changes from revision #<%= @revision.number - 1 %> to #<%= @revision.number %>:
11
- <ins class="diffins">Added</ins> | <del class="diffdel">Removed</del>
12
- </small>
13
- </p>
14
-
15
- <%= @revision.display_diff %>
16
- </div>
17
-
18
-
19
- <div class="byline">
20
- <%= "Revision from #{@revision.pretty_created_at} by" %>
21
- <%= @page.web.make_link(@revision.author) %>
22
- </div>
23
-
24
- <div class="navigation">
25
-
26
- <% if @revision.previous_revision %>
27
- <a href="../revision/<%= @page.name %>?rev=<%= @revision.previous_revision.number %>" class="navlink">Back in time</a>
28
- (<%= @revision.previous_revision.number + 1 %> more)
29
- <% end %>
30
-
31
- <% if @revision.next_revision && @revision.previous_revision %>
32
- |
33
- <% end %>
34
-
35
- <% if @revision.next_revision %>
36
- <% if @revision.next_revision.number < (@page.revisions.length - 1) %>
37
- <a href="../revision/<%= @page.name %>?rev=<%= @revision.next_revision.number %>" class="navlink">
38
- <% else %>
39
- <a href="../show/<%= @page.name %>" class="navlink">
40
- <% end %>
41
- Forward in time</a>
42
- (<%= @revision.page.revisions.length - @revision.next_revision.number %> more)
43
- <% end %>
44
-
45
- | <a href="../show/<%= @page.name %>" class="navlink">Show current</a>
46
-
47
- <% if @revision.previous_revision %>
48
- <span id="show_changes">
49
- | <a href="#" onClick="toggleChanges(); return false;">Show changes</a>
50
- </span>
51
- <span id="hide_changes" style="display: none">
52
- | <a href="#" onClick="toggleChanges(); return false;">Hide changes</a>
53
- </span>
54
- <% end %>
55
-
56
- | <a href="../rollback/<%= @page.name %>?rev=<%= @revision.number %>" class="navlink">Rollback</a>
57
-
58
- <% if @page.references.length > 0 %>
59
- <small>
60
- | Linked from: <%= @page.references.collect { |ref| "<a href='#{ref.name}'>#{ref.name}</a>" }.join(", ") %>
61
- </small>
62
- <% end %>
63
-
64
- <% if @page.bliki_references.length > 0 %>
65
- <small>
66
- <br />| Bliki Linked from: <%= @page.bliki_references.collect { |ref| link_to_bliki(ref) }.join(", ") %>
67
- </small>
68
- <% end %>
69
- </div>
70
-
71
- <script language="Javascript">
72
- function toggleChanges() {
73
- if (document.getElementById("changes").style.display == "none") {
74
- document.getElementById("changes").style.display = "block";
75
- document.getElementById("revision").style.display = "none";
76
- document.getElementById("show_changes").style.display = "none";
77
- document.getElementById("hide_changes").style.display = "inline";
78
- } else {
79
- document.getElementById("changes").style.display = "none";
80
- document.getElementById("revision").style.display = "block";
81
- document.getElementById("show_changes").style.display = "inline";
82
- document.getElementById("hide_changes").style.display = "none";
83
- }
84
- }
85
- </script>
86
-
87
- <%= sub_template "bottom" %>
1
+ <% @title = "#{@page.plain_name} (Rev ##{@revision.number})" %><%= sub_template "top" %>
2
+
3
+ <div id="revision">
4
+ <%= @revision.display_content %>
5
+ </div>
6
+
7
+ <div id="changes" style="display: none">
8
+ <p style="background: #eee; padding: 3px; border: 1px solid silver">
9
+ <small>
10
+ Showing changes from revision #<%= @revision.number - 1 %> to #<%= @revision.number %>:
11
+ <ins class="diffins">Added</ins> | <del class="diffdel">Removed</del>
12
+ </small>
13
+ </p>
14
+
15
+ <%= @revision.display_diff %>
16
+ </div>
17
+
18
+
19
+ <div class="byline">
20
+ <%= "Revision from #{@revision.pretty_created_at} by" %>
21
+ <%= @page.web.make_link(@revision.author) %>
22
+ </div>
23
+
24
+ <div class="navigation">
25
+
26
+ <% if @revision.previous_revision %>
27
+ <a href="../revision/<%= @page.name %>?rev=<%= @revision.previous_revision.number %>" class="navlink">Back in time</a>
28
+ (<%= @revision.previous_revision.number + 1 %> more)
29
+ <% end %>
30
+
31
+ <% if @revision.next_revision && @revision.previous_revision %>
32
+ |
33
+ <% end %>
34
+
35
+ <% if @revision.next_revision %>
36
+ <% if @revision.next_revision.number < (@page.revisions.length - 1) %>
37
+ <a href="../revision/<%= @page.name %>?rev=<%= @revision.next_revision.number %>" class="navlink">
38
+ <% else %>
39
+ <a href="../show/<%= @page.name %>" class="navlink">
40
+ <% end %>
41
+ Forward in time</a>
42
+ (<%= @revision.page.revisions.length - @revision.next_revision.number %> more)
43
+ <% end %>
44
+
45
+ | <a href="../show/<%= @page.name %>" class="navlink">Show current</a>
46
+
47
+ <% if @revision.previous_revision %>
48
+ <span id="show_changes">
49
+ | <a href="#" onClick="toggleChanges(); return false;">Show changes</a>
50
+ </span>
51
+ <span id="hide_changes" style="display: none">
52
+ | <a href="#" onClick="toggleChanges(); return false;">Hide changes</a>
53
+ </span>
54
+ <% end %>
55
+
56
+ | <a href="../rollback/<%= @page.name %>?rev=<%= @revision.number %>" class="navlink">Rollback</a>
57
+
58
+ <% if @page.references.length > 0 %>
59
+ <small>
60
+ | Linked from: <%= @page.references.collect { |ref| "<a href='#{ref.name}'>#{ref.name}</a>" }.join(", ") %>
61
+ </small>
62
+ <% end %>
63
+
64
+ <% if @page.bliki_references.length > 0 %>
65
+ <small>
66
+ <br />| Bliki Linked from: <%= @page.bliki_references.collect { |ref| link_to_bliki(ref) }.join(", ") %>
67
+ </small>
68
+ <% end %>
69
+ </div>
70
+
71
+ <script language="Javascript">
72
+ function toggleChanges() {
73
+ if (document.getElementById("changes").style.display == "none") {
74
+ document.getElementById("changes").style.display = "block";
75
+ document.getElementById("revision").style.display = "none";
76
+ document.getElementById("show_changes").style.display = "none";
77
+ document.getElementById("hide_changes").style.display = "inline";
78
+ } else {
79
+ document.getElementById("changes").style.display = "none";
80
+ document.getElementById("revision").style.display = "block";
81
+ document.getElementById("show_changes").style.display = "inline";
82
+ document.getElementById("hide_changes").style.display = "none";
83
+ }
84
+ }
85
+ toggleChanges();
86
+ </script>
87
+
88
+ <%= sub_template "bottom" %>