Pimki 1.0.092 → 1.1.092

Sign up to get free protection for your applications and to get access to all the features.
data/README-PIMKI CHANGED
@@ -1,10 +1,11 @@
1
- <pre>
2
1
  What is Pimki?
3
2
  ================
4
3
 
5
4
  Pimki is a Personal Information Manager based on Instiki's Wiki technology.
6
5
 
7
- It has some added features over Instiki, while keeping the simplicity of
6
+ It has some added features over Instiki, while keeping (most of) the simplicity
7
+ of Instiki. Add added complication is installing GraphViz on the path. GraphViz
8
+ is available from: http://www.research.att.com/sw/tools/graphviz.
8
9
 
9
10
  Instiki Features:
10
11
  * Regular expression search: Find deep stuff really fast
@@ -24,19 +25,21 @@ Instiki Features:
24
25
  Pimki added features:
25
26
  * Mind Map: a graph of wiki connections (made with GraphViz). All graphs can be
26
27
  laid-out with the 4 GraphViz engines. Graph contents can be arranged as:
27
- * Page ? linked pages
28
- * Authors ? pages
29
- * Categories ? pages
28
+ * Page -> linked pages
29
+ * Authors -> pages
30
+ * Categories -> pages
30
31
  * Bliki: a blog integrated with the wiki. Blog entries are simply wiki-pages in
31
- a special space. Can link from an entry to wiki pages.
32
+ a special space. Can link from an entry to wiki pages via PageName or [[page name]]
33
+ and from pages to Bliki entries via [bliki[page name]].
32
34
  * Todo Items & List:
33
- * todo:� items are highlighted on each page.
35
+ * 'todo:' items are highlighted on each page.
34
36
  * Added a capacity to pull and list todo items from all pages.
35
37
  * On main list, items are highlighted according to date (if there is one).
36
38
  * Added capacity to (persistently :) delete/rename pages through the 'All Pages'
37
39
  list.
38
40
  * Added left-side menu. Content options are:
39
41
  * Only pages that reference other pages (default)
42
+ * Only pages that belong to a specific category
40
43
  * All pages: by name
41
44
  * All pages: recently revised
42
45
  * All pages: recently visited
@@ -47,15 +50,16 @@ Pimki added features:
47
50
  * Now showing part of sentance around match in search-results page
48
51
  * Removed unnecessary (for me) stuff from the nav-bar: RSS, authors, export.
49
52
  Moved to bottom of Home Page.
53
+ * Minor stylesheet tweaks.
50
54
 
51
55
  Missing:
52
56
 
53
57
  * Expand todo with more task types?
54
58
  * Expand Search
55
- * Highlight on individual page when clicked form search results
59
+ * Highlight match on individual page when clicked form search results
56
60
  * Advanced Search (not just regexp, case sensitivity)?
57
61
  * Editable left-side menu options: by search results? by author?
58
- * Bliki: allow linking from wiki-pages to bliki entries.
62
+ * Bliki entries revision diff.
59
63
 
60
64
 
61
65
  Command-line options:
@@ -63,15 +67,40 @@ Run "ruby pimki.rb --help"
63
67
 
64
68
  History:
65
69
 
70
+ 1.1.092 Bug-fix and minor enhancements release
71
+ - Changed storage path to be relative to CWD to avoid storing under gem
72
+ version directory. When running/installing service should normally
73
+ provide the --storage command-line parameter. (Chad)
74
+ - Fixed a problem with the bliki_new form that prevented saving the entry
75
+ due to debug code in the JS validation code of the entry name. (PragDave)
76
+ - Fixed problem with export and storage path relating to app-dir instead
77
+ of storage dir in Instiki core. (Prag Dave)
78
+ - Fixed problem of missing files in in tgz packaging (rake needs
79
+ PackagingTask defined _before_ GemPackageTask). (Ruben)
80
+ - Fixed require 'YAML' to correct 'yaml' in Instiki core. (Chad)
81
+ - Added capability to link from pages to Bliki entries. To use link via:
82
+ [bliki[entry name]]
83
+ - ToDo list picks up items from bliki entries and links to the entry (Ruben)
84
+ - Menu can be set as all pages belonging to a specific category. If you set
85
+ some page to a category e.g. 'menu', only those pages will appear on the
86
+ left-side menu.
87
+
88
+ 1.0.092 Updated Initial Release
89
+ - Finalized Numbering scheme.
90
+ - Made available as a gem.
91
+
66
92
  0.9.2-7 Initial Public Release
67
- I have been working on Pimki for my own use for quite some time. It is
68
- fairly mature and stable. The version number reflects the base Instiki
69
- version (0.9.2; or actually the latest CVS that's markes so) and the
70
- running number of my feature-addition releases.
93
+ I have been working on Pimki for my own use for quite some time. It is
94
+ fairly mature and stable. The version number reflects the base Instiki
95
+ version (0.9.2; or actually the latest CVS that's markes so) and the
96
+ running number of my feature-addition releases.
71
97
 
72
98
 
73
99
  Download latest from:
74
- <a href="http://rubyforge.org/project/showfiles.php?group_id=447">http://rubyforge.org/project/showfiles.php?group_id=447</a>
100
+ http://rubyforge.org/project/showfiles.php?group_id=447
101
+
102
+ Or go the Gem way and install through:
103
+ gem install pimki
75
104
 
76
105
  Visit the official Pimki home page at:
77
106
  http://pimki.rubyforge.org/
@@ -84,4 +113,4 @@ License is the same as Ruby's.
84
113
  --
85
114
  Assaph Mehr
86
115
  assaph@gmail.com
87
- </pre>
116
+
@@ -2,7 +2,7 @@ require "cgi"
2
2
  require "redcloth_for_tex"
3
3
 
4
4
  class WikiController < ActionControllerServlet
5
- EXPORT_DIRECTORY = File.dirname(__FILE__) + "/../../storage/" unless const_defined?("EXPORT_DIRECTORY")
5
+ EXPORT_DIRECTORY = WikiService.storage_path unless const_defined?("EXPORT_DIRECTORY")
6
6
 
7
7
  def index
8
8
  if web_address
@@ -184,6 +184,7 @@ class WikiController < ActionControllerServlet
184
184
  set_menu_pages
185
185
  @pages_by_name = @pages_in_category.by_name
186
186
  @todo_items = Hash.new { Array.new }
187
+ @bliki_todo_items = Hash.new { Array.new }
187
188
  @pages_by_name.each do |page|
188
189
  if page.content =~ Todo.pattern
189
190
  # Page has todo items. Get the rendered version (marked-up and with links):
@@ -192,16 +193,26 @@ class WikiController < ActionControllerServlet
192
193
  end
193
194
  end
194
195
  @todo_items = @todo_items.sort_by { |page, items| page.name }
196
+ web.bliki.each do |pname, entry|
197
+ if entry.content =~ Todo.pattern
198
+ # Entry has todo items. Get the rendered version (marked-up and with links):
199
+ content = entry.revisions.last.display_content
200
+ @bliki_todo_items[entry] = content.scan /<span class="todo"><strong>TODO:<\/strong> (.*?)<\/span>/
201
+ end
202
+ end
203
+ @bliki_todo_items = @bliki_todo_items.sort_by { |entry, items| entry.name }
195
204
  end #}}}
196
205
 
197
206
  def set_menu_pages #{{{
198
207
  parse_category
208
+ @all_pages = web.select { true }
199
209
  @menu_pages = case web.menu_type
200
- when 'all' then @pages_in_category.by_name
201
- when 'recent' then @pages_in_category.by_last_visited
202
- when 'viewed' then @pages_in_category.by_most_viewed
203
- when 'revised' then @pages_in_category.by_revision
204
- when 'user' then @menu_content = web.rendered_menu; nil
210
+ when 'all' then @all_pages.by_name
211
+ when 'recent' then @all_pages.by_last_visited
212
+ when 'viewed' then @all_pages.by_most_viewed
213
+ when 'revised' then @all_pages.by_revision
214
+ when 'user' then @menu_content = web.rendered_menu; nil
215
+ when 'category' then web.select { |page| page.in_category?(web.menu_category) }
205
216
  when 'linkers'
206
217
  web.select { |page|
207
218
  page.wiki_words.size > 0
@@ -254,15 +265,16 @@ class WikiController < ActionControllerServlet
254
265
 
255
266
  def save_menu #{{{
256
267
  unless @req.query['action'] == 'Cancel Update'
257
- type = @req.query['type']
258
- content = @req.query['content']
268
+ type = @req.query['type']
269
+ content = @req.query['content']
270
+ category = @req.query['category']
259
271
 
260
272
  limit = @req.query['limit'].to_i rescue nil
261
273
  limit = 20 unless limit
262
274
  limit -= 1 if limit >= 0
263
275
 
264
276
  # need to go through the WikiService to persist the command:
265
- wiki.save_menu_pref web, type, limit, content
277
+ wiki.save_menu_pref web, type, limit, content, category
266
278
  end
267
279
 
268
280
  if web_address
@@ -417,7 +429,7 @@ class WikiController < ActionControllerServlet
417
429
 
418
430
  def rollback_bliki
419
431
  @page = wiki.read_bliki_entry(web_address, page_name)
420
- wiki.rollback_bliki_entry(web_address, page_name, @params["rev"].to_i-1, Time.now)
432
+ wiki.rollback_bliki_entry(web_address, page_name, @params["rev"].to_i, Time.now)
421
433
  redirect_bliki
422
434
  end
423
435
 
@@ -455,7 +467,10 @@ class WikiController < ActionControllerServlet
455
467
  redirect_path "/#{web}/#{action}"
456
468
  end
457
469
 
458
-
470
+ def link_to_bliki(entry, web = web_address) #{{{
471
+ "<a class='existingWikiWord' href='/#{web}/bliki_revision/#{entry.name}?rev=#{entry.revisions.size-1}'>#{entry.name}</a>"
472
+ end #}}}
473
+
459
474
 
460
475
  private
461
476
  def wiki
@@ -12,8 +12,8 @@ class Category < Chunk::Abstract
12
12
 
13
13
  attr_reader :hidden, :list
14
14
 
15
- def initialize(match_data)
16
- super(match_data)
15
+ def initialize(match_data, revision)
16
+ super(match_data, revision)
17
17
  @hidden = match_data[1]
18
18
  @list = match_data[2].split(',').map { |c| c.strip }
19
19
  end
@@ -8,9 +8,9 @@ require 'uri/common'
8
8
  # match by its pattern.
9
9
  module Chunk
10
10
  class Abstract
11
- attr_reader :text
11
+ attr_reader :text, :revision
12
12
 
13
- def initialize(match_data) @text = match_data[0] end
13
+ def initialize(match_data, revision) @text = match_data[0]; @revision = revision end
14
14
  def pre_mask() "chunk#{self.id}start " end
15
15
  def post_mask() " chunk#{self.id}end" end
16
16
  def mask(content) "chunk#{self.id}chunk" end
@@ -11,8 +11,8 @@ class Include < WikiChunk::WikiLink
11
11
 
12
12
  attr_reader :page_name
13
13
 
14
- def initialize(match_data)
15
- super(match_data)
14
+ def initialize(match_data, revision)
15
+ super(match_data, revision)
16
16
  @page_name = match_data[1].strip
17
17
  end
18
18
 
@@ -19,8 +19,8 @@ class NoWiki < Chunk::Abstract
19
19
 
20
20
  attr_reader :plain_text
21
21
 
22
- def initialize(match_data)
23
- super(match_data)
22
+ def initialize(match_data, revision)
23
+ super(match_data, revision)
24
24
  @plain_text = match_data[1]
25
25
  end
26
26
 
@@ -6,8 +6,8 @@ require 'parsedate'
6
6
  class Todo < Chunk::Abstract
7
7
  def self.pattern() /todo: ([^\n]+)/i end
8
8
 
9
- def initialize(match_data)
10
- super(match_data)
9
+ def initialize(match_data, revision)
10
+ super(match_data, revision)
11
11
  end
12
12
 
13
13
  def escaped_text() nil end
@@ -52,8 +52,8 @@ class URIChunk < Chunk::Abstract
52
52
 
53
53
  attr_reader :uri, :scheme, :user, :host, :port, :path, :query, :fragment, :link_text
54
54
 
55
- def initialize(match_data)
56
- super(match_data)
55
+ def initialize(match_data, revision)
56
+ super(match_data, revision)
57
57
  # Since the URI_PATTERN is tried twice, there are two sets of
58
58
  # groups, one from \1 to \7 and the second from \8 to \14.
59
59
  # The fields are set by which ever group matches.
@@ -41,8 +41,8 @@ module WikiChunk
41
41
 
42
42
  attr_reader :page_name
43
43
 
44
- def initialize(match_data)
45
- super(match_data)
44
+ def initialize(match_data, revision)
45
+ super(match_data, revision)
46
46
  @escape = match_data[1]
47
47
  @page_name = match_data[2]
48
48
  end
@@ -66,8 +66,8 @@ module WikiChunk
66
66
 
67
67
  attr_reader :page_name, :link_text
68
68
 
69
- def initialize(match_data)
70
- super(match_data)
69
+ def initialize(match_data, revision)
70
+ super(match_data, revision)
71
71
 
72
72
  # If the like is aliased, set the page name to the first bit
73
73
  # and the link text to the second, otherwise set both to the
@@ -79,4 +79,25 @@ module WikiChunk
79
79
  end
80
80
  end
81
81
  end
82
+
83
+ # This chunk handles [bliki[entry name]].
84
+ # This format can be easily duplicated for any other pre-configured redirection.
85
+ class BlikiLink < WikiLink
86
+ def self.pattern() /\[bliki\[([\w\d\s]+)\]\]/ end
87
+
88
+ attr_reader :page_name, :link_text, :entry
89
+
90
+ def initialize(match_data, revision)
91
+ super(match_data, revision)
92
+ @page_name, @link_text = match_data[1], match_data[1]
93
+ end
94
+
95
+ def unmask(content)
96
+ return self if content.sub!(regexp) { |match|
97
+ web = revision.page.web
98
+ entry = web.bliki[page_name]
99
+ "<a class='existingWikiWord' href='/#{web.address}/bliki_revision/#{entry.name}?rev=#{entry.revisions.size-1}'>#{entry.name}</a>"
100
+ }
101
+ end
102
+ end
82
103
  end
data/app/models/web.rb CHANGED
@@ -5,7 +5,7 @@ require "wiki_words"
5
5
  require "zip/zip"
6
6
 
7
7
  class Web
8
- attr_accessor :pages, :name, :address, :password, :menu_type, :menu_content, :rendered_menu, :menu_limit
8
+ attr_accessor :pages, :name, :address, :password, :menu_type, :menu_content, :rendered_menu, :menu_limit, :menu_category
9
9
  attr_accessor :markup, :color, :safe_mode, :additional_style, :published, :brackets_only, :count_pages
10
10
 
11
11
  @@BLIKI_TEMPLATE = "Try a weekly worksheet:\n\n| / | *Morning* | *Afternoon* |\n" +
@@ -103,9 +103,10 @@ class Web
103
103
 
104
104
  # Graph properties:
105
105
  file.puts "digraph G {"
106
- file.puts 'size = "9,11";'
107
- file.puts 'concentrate = true;'
108
- file.puts 'node [fontsize=8,fontname="Tahoma"];'
106
+ file.puts 'size="8,8";'
107
+ file.puts 'ratio=fill;'
108
+ file.puts 'concentrate=true;'
109
+ file.puts 'node [fontsize=10,fontname="Tahoma"];'
109
110
  file.puts 'edge [len=1.5];'
110
111
 
111
112
  # Page Special nodes properties:
@@ -133,7 +134,7 @@ class Web
133
134
  # find missing pages:
134
135
  if missing
135
136
  missing.each do |wanted|
136
- file.puts "#{wanted} [URL=\"/#{@address}/show/#{wanted}\", fontsize=8,style=filled,color=grey];"
137
+ file.puts "#{wanted} [URL=\"/#{@address}/show/#{wanted}\", fontsize=10,style=filled,color=grey];"
137
138
  end
138
139
  pages.values.each do |page|
139
140
  missing.each do |wanted|
@@ -162,9 +163,10 @@ class Web
162
163
 
163
164
  # Graph properties:
164
165
  file.puts "digraph G {"
165
- file.puts 'size = "9,11";'
166
- file.puts 'concentrate = true;'
167
- file.puts 'node [fontsize=8,fontname="Tahoma"];'
166
+ file.puts 'size="8,8";'
167
+ file.puts 'ratio=fill;'
168
+ file.puts 'concentrate=true;'
169
+ file.puts 'node [fontsize=10,fontname="Tahoma"];'
168
170
  file.puts 'edge [len=1.5];'
169
171
 
170
172
  # Links and node properties:
@@ -199,15 +201,16 @@ class Web
199
201
  File.open(dotFile, "w") do |file|
200
202
  # Graph properties:
201
203
  file.puts "digraph G {"
202
- file.puts 'size = "9,11";'
203
- file.puts 'concentrate = true;'
204
- file.puts 'node [fontsize=8,fontname="Tahoma"];'
204
+ file.puts 'size="8,8";'
205
+ file.puts 'ratio=fill;'
206
+ file.puts 'concentrate=true;'
207
+ file.puts 'node [fontsize=10,fontname="Tahoma"];'
205
208
  file.puts 'edge [len=1.5];'
206
209
 
207
210
  # Page Special nodes properties:
208
211
  file.puts "HomePage [color=\"##{color}\",style=bold];"
209
212
  categories.each do |category|
210
- file.puts "#{category} [style=filled,color=grey];"
213
+ file.puts "#{category} [fontsize=20,style=filled,color=grey,comment=\"#{category}\"];"
211
214
  end
212
215
 
213
216
  # Links and node properties:
@@ -43,7 +43,7 @@ class WikiContent < String
43
43
 
44
44
  # Moved URIChunk from pre-engine to post-engine, as it clashed with the textile
45
45
  # markup of "link":URL.
46
- PRE_ENGINE_ACTIONS = [ NoWiki, Category, Include, WikiChunk::Link, WikiChunk::Word ]
46
+ PRE_ENGINE_ACTIONS = [ NoWiki, Category, Include, WikiChunk::BlikiLink, WikiChunk::Link, WikiChunk::Word ]
47
47
  POST_ENGINE_ACTIONS = [ Literal::Pre, Literal::Tags, URIChunk, Todo ]
48
48
 
49
49
 
@@ -106,7 +106,7 @@ class WikiContent < String
106
106
  # in this content with its mask.
107
107
  def apply_type!(chunk_type)
108
108
  self.gsub!( chunk_type.pattern ) do |match|
109
- @chunks << chunk_type.new($~)
109
+ @chunks << chunk_type.new($~, @revision)
110
110
  @chunks.last.mask(self)
111
111
  end
112
112
  end
@@ -86,10 +86,11 @@ class WikiService < MadeleineService
86
86
  web.pages[new_page_name] = page
87
87
  end #}}}
88
88
 
89
- def save_menu_pref(web, type, limit, content) #{{{
89
+ def save_menu_pref(web, type, limit, content, category) #{{{
90
90
  web.menu_type = type
91
91
  web.menu_limit = limit
92
92
  web.menu_content = content
93
+ web.menu_category = category
93
94
  if web.menu_type == 'user'
94
95
  # only calculate the rendered content once:
95
96
  web.rendered_menu = Page.new(
@@ -21,8 +21,7 @@
21
21
  | *Tue* | - | - |
22
22
  | *Wed* | - | - |
23
23
  | *Thu* | - | - |
24
- | *Fri* | - | - |
25
- </textarea></td>
24
+ | *Fri* | - | - |</textarea></td>
26
25
  </tr>
27
26
  <tr style="background-color:efe">
28
27
  <th colspan="2" align="right">
@@ -39,17 +38,17 @@
39
38
  </p>
40
39
  </form>
41
40
 
42
- <script language="JavaScript1.2">
41
+ <script language="JavaScript">
43
42
  function validateWikiWords() {
44
- alert(escape(document.getElementById('newPageName').value));
45
- return false;
43
+ // alert(escape(document.getElementById('newPageName').value));
44
+ // return false;
46
45
  if (/^([A-Z][a-z]+[A-Z]\w+)$/.test(document.getElementById('authorName').value)) {
47
46
  // return true; skip to validate page name
48
47
  } else {
49
48
  alert('You wrote "' + document.getElementById('authorName').value + '" as your name, but it needs to be a wiki word. Try concating first name and last name, like DavidHeinemeierHansson.');
50
49
  return false;
51
50
  }
52
- if (/^[\w\s\d]+)$/.test(document.getElementById('newPageName').value)) {
51
+ if (/^([\w\s\d]+)$/.test(document.getElementById('newPageName').value)) {
53
52
  return true;
54
53
  } else {
55
54
  alert('You wrote "' + document.getElementById('newPageName').value + '" as the entry name, but it can only contain letters, digits and space.');
@@ -20,23 +20,23 @@
20
20
  </div>
21
21
 
22
22
  <div class="navigation">
23
+ <a href="../bliki_edit/<%= @page.name %>" class="navlink">Edit</a> |
23
24
  <% if @revision.previous_revision %>
24
25
  <a href="../bliki_revision/<%= @page.name %>?rev=<%= @revision.previous_revision.number %>" class="navlink">Lower</a>
25
- <% @lower = true
26
- end
27
- if @revision.next_revision
28
- if @lower %>
29
- -
30
- <% end %>
31
- <a href="../bliki_revision/<%= @page.name %>?rev=<%= @revision.next_revision.number %>" class="navlink">Higher</a>
26
+ <% else %>
27
+ <span style="color:grey">Lower</span>
28
+ <% end %> -
29
+ <% if @revision.next_revision %>
30
+ <a href="../bliki_revision/<%= @page.name %>?rev=<%= @revision.next_revision.number %>" class="navlink">Higher</a>
31
+ <% else %>
32
+ <span style="color:grey">Higher</span>
32
33
  <% end %>
33
34
 
34
35
  <%= '|' if @revision.previous_revision or @revision.next_revision %>
35
36
  <a href="../bliki_delete/<%= @page.name %>" class="navlink" onClick="return confirm('Are you sure you want delete this entry completely?')">Delete All</a>
36
37
  <% if @revision.next_revision %>
37
- | <a href="../bliki_revision/<%= @page.name %>?rev=<%= @page.revisions.length - 1 %>" class="navlink">Back to current</a>
38
- <% else %>
39
- | <a href="../rollback_bliki/<%= @page.name %>?rev=<%= @revision.number - 1 %>"
38
+ | <a href="../bliki_revision/<%= @page.name %>?rev=<%= @page.revisions.length - 1 %>" class="navlink">Back to current</a>
39
+ | <a href="../rollback_bliki/<%= @page.name %>?rev=<%= @revision.number %>"
40
40
  class="navlink" onClick="return confirm('Are you sure you want reset the page to this revision?')">Rollback to here</a>
41
41
  <% end %>
42
42
 
@@ -9,11 +9,19 @@
9
9
 
10
10
  <form id="editForm" action="../save_menu" method="post">
11
11
  <p>Please choose the format you prefer for the left-size menu:</p>
12
+ <p><input type="radio" name="type" value="linkers" <%= 'checked' if @menu_type == 'linkers' %>>Only pages that link other pages (default)</p>
12
13
  <p><input type="radio" name="type" value="all" <%= 'checked' if @menu_type == 'all' %>>All Pages</p>
13
14
  <p><input type="radio" name="type" value="revised" <%= 'checked' if @menu_type == 'revised' %>>Recently revised pages</p>
14
15
  <p><input type="radio" name="type" value="recent" <%= 'checked' if @menu_type == 'recent' %>>Recently visited pages</p>
15
16
  <p><input type="radio" name="type" value="viewed" <%= 'checked' if @menu_type == 'viewed' %>>Most viewed pages</p>
16
- <p><input type="radio" name="type" value="linkers" <%= 'checked' if @menu_type == 'linkers' %>>Only pages that link other pages (default)</p>
17
+ <p><input type="radio" name="type" value="category" <%= 'checked' if @menu_type == 'category' %>>Pages in a specific category:
18
+ <select id="category" name="category" size="1" style="width:190">
19
+ <option value="noselect">------------
20
+ <% for category in web.categories %>
21
+ <option value="<%= category %>"><%= category %>
22
+ <% end %>
23
+ </select>
24
+ </p>
17
25
  <p>For the above options you can choose if you want to limit the number of results. Enter the number of items you wish, or 0 for all items: <input type="textfield" size="20", name="limit" value="<%= @list_limit %>" /></p>
18
26
  <p><input type="radio" name="type" value="user" <%= 'checked' if @menu_type == 'user' %>>Or just write your own menu contents (as a regular Wiki page):
19
27
  <textarea name="content" style="width: 400px; height: 300px"><%= @menu_content %></textarea>
@@ -100,7 +100,7 @@
100
100
  <tr>
101
101
  <form class="navigation" action="list/" action="get" onSubmit="return validateSelection('sel_delete') && verifyDelete();">
102
102
  <td>Delete page:</td>
103
- <td><select id="sel_delete" name="sel_page_name" size="1">
103
+ <td><select id="sel_delete" name="sel_page_name" size="1" style="width:190">
104
104
  <option value="noselect">------------
105
105
  <% for page in @pages_by_name %>
106
106
  <option value="<%= page.name %>"><%= page.name %>
@@ -119,7 +119,7 @@
119
119
  <tr>
120
120
  <form class="navigation" action="../list/" action="get" onSubmit="return validateSelection('sel_rename') && verifyRename() && validatePageName('ren_newpage');">
121
121
  <td>Rename:</td>
122
- <td><select id="sel_rename" name="sel_page_name" size="1">
122
+ <td><select id="sel_rename" name="sel_page_name" size="1" style="width:190">
123
123
  <option value="noselect">------------
124
124
  <% for page in @pages_by_name %>
125
125
  <option value="<%= page.name %>"><%= page.name %>
@@ -130,7 +130,7 @@
130
130
  <tr>
131
131
  <td align="center">To:</td>
132
132
  <td>
133
- <input type="text" name="newpage" id="ren_newpage" size=28>
133
+ <input type="text" name="newpage" id="ren_newpage" size="28">
134
134
  </td>
135
135
  </tr>
136
136
  <tr>
@@ -145,7 +145,7 @@
145
145
  <form class="navigation" action="../list/" action="get" onSubmit="return validatePageName('newpage');">
146
146
  <td>Create New Page:</td>
147
147
  <td>
148
- <input type="text" name="newpage" id="newpage" size=28>
148
+ <input type="text" name="newpage" id="newpage" size="28">
149
149
  </td>
150
150
  </tr>
151
151
  <tr>
@@ -1,12 +1,14 @@
1
- <% @title = "Mind Map" %>
1
+ <% @title = "Mind Map"
2
+ @style_additions = "img { width: 8in; }"
3
+ %>
2
4
  <%= sub_template "top" %>
3
5
 
4
6
  <h4>A "Mind Map" created from the Wiki links.</h4>
5
7
 
6
8
  <table border=0>
7
9
  <tr>
8
- <td colspan=3>
9
- <img src="file://<%= @pngFile %>" usemap="#graph.map">
10
+ <td colspan='3' id='mapcell'>
11
+ <img src="file://<%= @pngFile %>" usemap="#graph.map" />
10
12
  <map name="graph.map"><%= File.read(@mapFile) %></map>
11
13
  </td>
12
14
  </tr>
@@ -15,8 +15,8 @@
15
15
  </div>
16
16
  <div class="inputBox">
17
17
  Name: <input type="text" id="web_name" name="web_name" value="Wiki" onChange="proposeAddress();"
18
- onClick="this.value == 'Wiki' ? this.value = '' : true"> &nbsp;&nbsp;
19
- Address: <input type="text" id="web_address" name="web_address" onChange="cleanAddress();" value="wiki">
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
20
  </div>
21
21
  </li>
22
22
 
@@ -1,8 +1,9 @@
1
1
  <% @title = "ToDo" %>
2
2
  <%= sub_template "top" %>
3
-
4
- <% num_items = @todo_items.inject(0) { |n, (p,i)| n += i.size } %>
5
- <h3>There <%= num_items == 1 ? 'is' : 'are' %> <%= num_items.zero? ? "no" : @todo_items.size %> ToDo item<%= num_items != 1 ? 's' : '' %>.
3
+ <% num_items = @todo_items.inject(0) { |n, (p,i)| n += i.size }
4
+ num_items += @bliki_todo_items.inject(0) { |n, (p,i)| n += i.size }
5
+ %>
6
+ <h3>There <%= num_items == 1 ? 'is' : 'are' %> <%= num_items.zero? ? "no" : num_items %> ToDo item<%= num_items != 1 ? 's' : '' %>.
6
7
  </h3>
7
8
 
8
9
  <ul>
@@ -29,6 +30,33 @@
29
30
  <% end %>
30
31
  </ul>
31
32
 
33
+ <% if @bliki_todo_items.size > 0 %>
34
+ <h4>ToDo items from Bliki:</h4>
35
+ <ul>
36
+ <% @bliki_todo_items.each do |page, items| %>
37
+ <li><%= link_to_bliki(page) %>
38
+ <ul>
39
+ <% items.each do |item|
40
+ # default is the muted 'darkred', to prevent to many bright red
41
+ # items on one page: (See also chunks/todo.rb)
42
+ tclass = "todoFuture"
43
+ # next check is the item is dated:
44
+ d = ParseDate.parsedate(item[0]) rescue nil
45
+ if not d.nil? and not d.all? { |x| x.nil? }
46
+ # there's a date in the todo. display it accordingly
47
+ d[0] ||= today.year # make sure there's a 'year' component
48
+ d = Date.new(*d[0..2]) rescue nil
49
+ tclass = 'todo' if (not d.nil?) and ((today <=> d) > -1)
50
+ end %>
51
+ <li class="<%= tclass %>"><%= item %></li>
52
+ <% end %>
53
+ </ul>
54
+ </li>
55
+ <% end %>
56
+ </ul>
57
+ <% end %>
58
+
59
+
32
60
  <% if num_items == 0 %>
33
61
  <p>To make ToDo items appear here insert a 'todo' item in any page. Simply write at the start of any line 'todo' followed by a colon (':'), followed by a space and some text. For example:
34
62
  <pre>todo: some text</pre></p>
@@ -1,7 +1,7 @@
1
1
  require 'madeleine/automatic'
2
2
  require 'madeleine'
3
3
  require 'singleton'
4
- require 'YAML'
4
+ require 'yaml'
5
5
 
6
6
  class MadeleineService
7
7
  include Madeleine::Automatic::Interceptor
@@ -34,7 +34,7 @@ class MadeleineService
34
34
  end
35
35
 
36
36
  class MadeleineServer
37
- SNAPSHOT_INTERVAL = 60 * 60 # Each hour * 24 # Each day
37
+ SNAPSHOT_INTERVAL = 60 * 60 * 24 # seconds * minutes * hours => Each day
38
38
  AUTOMATIC_SNAPSHOTS = true
39
39
 
40
40
  # Clears all the command_log and snapshot files located in the storage directory, so the
data/pimki.rb CHANGED
@@ -44,7 +44,7 @@ end
44
44
  OPTIONS = {
45
45
  :server_type => fork_available ? Daemon : SimpleServer,
46
46
  :port => 2500,
47
- :storage => "#{cdir}/storage",
47
+ :storage => "#{Dir.pwd}/storage",
48
48
  :pdflatex => pdflatex_available
49
49
  }
50
50
 
@@ -62,7 +62,7 @@ ARGV.options do |opts|
62
62
  ) { OPTIONS[:server_type] = SimpleServer }
63
63
  opts.on("-t", "--storage=storage", String,
64
64
  "Makes Instiki use the specified directory for storage.",
65
- "Default: ./storage/[port]") { |OPTIONS[:storage]| }
65
+ "Default: [cwd]/storage/[port]") { |OPTIONS[:storage]| }
66
66
 
67
67
  opts.separator ""
68
68
 
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.1
3
3
  specification_version: 1
4
4
  name: Pimki
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.0.092
7
- date: 2004-11-24
6
+ version: 1.1.092
7
+ date: 2004-12-04
8
8
  summary: A Personal Information Manager (PIM) based on the Wiki technology of Instiki.
9
9
  require_paths:
10
10
  - libraries