public
Fork of sr/git-wiki
Description: A wiki engine that uses a Git repository as its data store.
Homepage: http://atonie.org/2008/02/git-wiki
Clone URL: git://github.com/al3x/git-wiki.git
Search Repo:
better looking search box, search results, remove origin/master from 
branches page, cleaner edit-in-place method, more.
al3x (author)
Sat Mar 15 12:19:51 -0700 2008
commit  046dceb6dabaadb56ea088a53ecc31dd08e5a618
tree    00069f4a2afdca299cc97226ca37576cb43b1e1e
parent  952375327cd420439ce22c44f688a6fbd0526116
...
5
6
7
8
9
10
11
 
12
13
14
...
40
41
42
43
44
45
46
...
59
60
61
 
 
 
 
 
 
 
62
63
64
...
136
137
138
 
 
139
140
141
...
5
6
7
 
 
 
 
8
9
10
11
...
37
38
39
 
40
41
42
...
55
56
57
58
59
60
61
62
63
64
65
66
67
...
139
140
141
142
143
144
145
146
0
@@ -5,10 +5,7 @@ require 'lib/sinatra/lib/sinatra'
0
 
0
 get('/') { redirect "/#{HOMEPAGE}" }
0
 
0
-get '/a/list' do
0
- @pages = $repo.log.first.gtree.children.map { |name, blob| Page.new(name) } rescue []
0
- show(:list, 'Listing pages')
0
-end
0
+# page paths
0
 
0
 get '/:page' do
0
   @page = Page.new(params[:page])
0
@@ -40,7 +37,6 @@ end
0
 post '/eip/:page' do
0
   @page = Page.new(params[:page])
0
   @page.update(params[:body])
0
- @page = Page.new(params[:page])
0
   @page.body
0
 end
0
 
0
@@ -59,6 +55,13 @@ get '/d/:page/:rev' do
0
   show :delta, "Diff of #{@page.name}"
0
 end
0
 
0
+# application paths (/a/ namespace)
0
+
0
+get '/a/list' do
0
+ @pages = $repo.log.first.gtree.children.map { |name, blob| Page.new(name) } rescue []
0
+ show(:list, 'Listing pages')
0
+end
0
+
0
 get '/a/patch/:page/:rev' do
0
   @page = Page.new(params[:page])
0
   header 'Content-Type' => 'text/x-diff'
0
@@ -136,6 +139,8 @@ get '/a/search' do
0
   show :search, 'Search Results'
0
 end
0
 
0
+# support methods
0
+
0
 def page_url(page)
0
   "#{request.env["rack.url_scheme"]}://#{request.env["HTTP_HOST"]}/#{page}"
0
 end
...
37
38
39
 
 
40
41
42
...
37
38
39
40
41
42
43
44
0
@@ -37,6 +37,8 @@ class Page
0
     rescue
0
       nil
0
     end
0
+ @body = nil; @raw_body = nil
0
+ @body
0
   end
0
 
0
   def tracked?
...
24
25
26
27
28
 
 
 
 
 
29
30
...
24
25
26
 
 
27
28
29
30
31
32
33
0
@@ -24,6 +24,9 @@ function distance_of_time_in_words(to, from) {
0
   return "over " + years_ago + " years"
0
 }
0
 
0
-function clearField(field_id) {
0
- document.getElementById(field_id).value = "";
0
+function clearField(e) {
0
+ if (e.cleared) { return; }
0
+ e.cleared = true;
0
+ e.value = '';
0
+ e.style.color = '#333';
0
 }
0
\ No newline at end of file
...
63
64
65
66
 
67
68
69
...
105
106
107
108
109
110
 
111
112
113
114
115
116
 
 
117
118
 
119
120
121
122
 
 
 
 
123
124
125
...
147
148
149
 
 
 
 
 
...
63
64
65
 
66
67
68
69
...
105
106
107
 
 
 
108
109
110
111
112
113
114
115
116
117
 
118
119
120
121
 
122
123
124
125
126
127
128
...
150
151
152
153
154
155
156
157
0
@@ -63,7 +63,7 @@ ul {
0
 
0
 .content {
0
   margin-left: 35%;
0
- padding: 0 10px 2px 10px;
0
+ padding: 10px 10px 2px 10px;
0
 }
0
 
0
 .delta {
0
@@ -105,21 +105,24 @@ ul {
0
 
0
 .right { text-align: right; }
0
 
0
-.search_result {
0
- margin-bottom: 15px;
0
-}
0
+.search_result { margin-bottom: 15px; }
0
 
0
 .search_result .match {
0
   line-height: 1em;
0
   margin-bottom: 15px;
0
 }
0
 
0
+.search_term { color: #999; }
0
+
0
 .submit {
0
- font-size: large;
0
+ font-size: 1.2em;
0
   font-weight: bold;
0
 }
0
 
0
-.sub_nav { float: left; }
0
+.sub_nav {
0
+ float: left;
0
+ padding-top: 8px;
0
+}
0
 
0
 .sub_nav .details {
0
   color: #888;
0
@@ -147,3 +150,8 @@ ul {
0
 
0
 #footer { clear: both; }
0
 #footer a, #footer a:visited { color: #666; }
0
+
0
+#search_field {
0
+ border: 1px solid #ccc;
0
+ color: #999;
0
+}
...
2
3
4
 
5
6
7
...
2
3
4
5
6
7
8
0
@@ -2,6 +2,7 @@
0
 
0
 <div class="sub_nav">
0
   <% @branches.each do |b| %>
0
+ <% next if b.full == 'origin/master' %>
0
     <% if b.current %>
0
       <strong><%= b.full %></strong>
0
     <% else %>
...
17
18
19
20
 
21
22
23
...
17
18
19
 
20
21
22
23
0
@@ -17,7 +17,7 @@
0
           <li><a href="/a/history" class="nav_link">history</a></li>
0
           <li><a href="/a/list" class="nav_link">pages</a></li>
0
           <li><a href="/a/tarball" class="nav_link">export</a></li>
0
- <li><input type="text" name="search" size="15" value="search" id="search_field" onfocus="clearField('search_field');" /></li>
0
+ <li><input type="text" name="search" size="15" value="search" id="search_field" onfocus="clearField(this);" /></li>
0
         </ul>
0
       </form>
0
       <%= yield %>
...
1
2
3
4
 
5
6
7
...
1
2
3
 
4
5
6
7
0
@@ -1,7 +1,7 @@
0
 <% if @grep.empty? %>
0
   <h1>No pages match</h1>
0
 <% else %>
0
- <h1>Results for '<%= @search %>'</h1>
0
+ <h1>Results for '<span class="search_term"><%= @search %></span>'</h1>
0
 <% end %>
0
 
0
 <div class="sub_nav">

Comments

    No one has commented yet.