junebug 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -1,6 +1,6 @@
1
1
  = Junebug: Minimalist Ruby Wiki
2
2
 
3
- Junebug is a minimalist wiki, running on a minimalist web framework.
3
+ Junebug is a minimalist wiki, running on Camping.
4
4
 
5
5
 
6
6
  == Status
@@ -14,12 +14,15 @@ input.button {
14
14
  input, textarea {
15
15
  padding: 2px;
16
16
  margin-bottom: 5px;
17
- font-family:"Bitstream Vera Sans Mono", "Monaco", "Courier", monospace;
17
+ /* font-family:"Bitstream Vera Sans Mono", "Monaco", "Courier", monospace;*/
18
+ }
19
+
20
+ input, textarea, pre, code {
21
+ font-family: monospace;
18
22
  }
19
23
 
20
24
  textarea {
21
25
  width: 100%;
22
- font-size: 92%;
23
26
  }
24
27
 
25
28
  del {
@@ -47,7 +50,6 @@ body {
47
50
  border-top: 6px solid #4e0dc4;
48
51
  background-color: #3f276a;
49
52
  padding: 8px 25px;
50
- /* font-size: 100%;*/
51
53
  color: #ffffff;
52
54
  }
53
55
 
@@ -78,15 +80,12 @@ body {
78
80
  border-width:0 5px 5px 0;
79
81
  padding: 25px;
80
82
  min-height: 300px;
81
- /* font-size: 100%;*/
82
83
  }
83
84
 
84
85
  #yui-main{
85
- /* font-size: 100%;*/
86
86
  }
87
87
 
88
88
  .yui-b{
89
- /* font-size: 100%;*/
90
89
  }
91
90
 
92
91
  #ft {
@@ -135,12 +134,12 @@ body {
135
134
 
136
135
 
137
136
  /* WIKI CONTENT STYLES */
138
- .content {
137
+ .content {
139
138
  font-size: 100%;
140
139
  }
141
140
 
142
141
  .content h2, .content h3, .content h4 {
143
- margin-top: 20px;
142
+ margin-top: 25px;
144
143
  margin-bottom: 10px;
145
144
  }
146
145
 
@@ -179,8 +178,12 @@ body {
179
178
  }
180
179
 
181
180
  .content p {
181
+ line-height: 140%;
182
182
  margin: 10px 0px;
183
- font-size: 114%;
183
+ }
184
+
185
+ .content em {
186
+ font-style: italic;
184
187
  }
185
188
 
186
189
  .content strong {
@@ -191,21 +194,28 @@ body {
191
194
  font-weight: bold;
192
195
  }
193
196
 
197
+ .content code {
198
+ /* font-family:"Bitstream Vera Sans Mono", "Monaco", "Courier", monospace;*/
199
+ background: #eee;
200
+ padding: 2px;
201
+ }
202
+
194
203
  .content pre code{
195
- display: block;
196
- color: #000000;
197
- background: #eee;
198
- /* overflow: auto;*/
199
- font-size: 92%;
200
- font-family:"Bitstream Vera Sans Mono", "Monaco", "Courier", monospace;
201
- padding: 8px 20px;
204
+ padding: 0px;
202
205
  }
203
206
 
204
- asdf {
207
+ .content pre {
208
+ /* font-family:"Bitstream Vera Sans Mono", "Monaco", "Courier", monospace;*/
209
+ display: block;
210
+ background: #eee;
211
+ padding: 8px 20px;
212
+ }
213
+
214
+ .content th, .content td {
215
+ padding: 2px 5px;
216
+ }
217
+
218
+ .content th {
219
+ font-weight: bold;
220
+ }
205
221
  /* http://longren.org/2006/09/27/wrapping-text-inside-pre-tags */
206
- white-space: pre-wrap; /* css-3 */
207
- white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
208
- white-space: -pre-wrap; /* Opera 4-6 */
209
- white-space: -o-pre-wrap; /* Opera 7 */
210
- word-wrap: break-word; /* Internet Explorer 5.5+ */
211
- }
@@ -24,7 +24,7 @@ select, input, textarea {font:99% arial,helvetica,clean,sans-serif;}
24
24
  /**
25
25
  * Bump up !IE to get to 13px equivalent
26
26
  */
27
- pre, code {font:115% monospace;*font-size:100%;}
27
+ /*pre, code {font:115% monospace;*font-size:100%;}*/
28
28
 
29
29
  /**
30
30
  * Default line-height based on font-size rather than "computed-value"
File without changes
File without changes
@@ -1,5 +1,5 @@
1
1
  ---
2
- - updated_at: 2006-11-05 20:20:26 -08:00
2
+ - updated_at: 2006-11-06 09:15:45 -08:00
3
3
  title: JunebugWiki
4
4
  readonly: true
5
5
  body: |
@@ -34,7 +34,7 @@
34
34
  version: 1
35
35
  user_id: 1
36
36
  created_at: 2006-10-29 16:19:34 -08:00
37
- - updated_at: 2006-11-05 19:48:57 -08:00
37
+ - updated_at: 2006-11-06 09:15:45 -08:00
38
38
  title: JunebugHelp
39
39
  readonly:
40
40
  body: This is a work in progress
@@ -42,3 +42,103 @@
42
42
  version: 1
43
43
  user_id: 1
44
44
  created_at: 2006-11-01 00:10:07 -08:00
45
+ - updated_at: 2006-11-06 21:49:04 -08:00
46
+ title: FormatTest
47
+ readonly:
48
+ body: |-
49
+ See "this page":http://hobix.com/textile/ for the full range of formatting options
50
+
51
+ h2. Headers
52
+
53
+ h1. Header 1
54
+
55
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
56
+
57
+ h2. Header 2
58
+
59
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
60
+
61
+ h3. Header 3
62
+
63
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
64
+
65
+ h4. Header 4
66
+
67
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
68
+
69
+ h2. Structural emphasis
70
+
71
+ This is _emphasis_ (italic)
72
+
73
+ This is *strong* (bold)
74
+
75
+ This is @code@
76
+
77
+ more code
78
+ @difftext = diff( @v1_markup , @v2_markup)
79
+
80
+ This is -deleted- text
81
+
82
+ This is +inserted+ text
83
+
84
+ Arbitrary style: I'm %{color:red}unaware% of most soft drinks.
85
+
86
+
87
+ h2. Arbitrary html, pre, and code
88
+
89
+ Inserting arbitrary html (pre/code)
90
+
91
+ <pre><code>a.gsub!( /</, '' )</code></pre>
92
+
93
+ Inserting arbitrary html (pre/code)
94
+
95
+ <pre>
96
+ <code>a.gsub!( /</, '' )</code>
97
+ </pre>
98
+
99
+ Arbitrary html (pre)
100
+
101
+ <pre>
102
+ a.gsub!( /</, '' )
103
+ </pre>
104
+
105
+ Code by indenting
106
+
107
+ more code
108
+ @difftext = diff( @v1_markup , @v2_markup)
109
+
110
+ h2. Lists
111
+
112
+ # A first item
113
+ # A second item
114
+ # A third
115
+
116
+ # Fuel could be:
117
+ ## Coal
118
+ ## Gasoline
119
+ ## Electricity
120
+ # Humans need only:
121
+ ## Water
122
+ ## Protein
123
+
124
+ * A first item
125
+ * A second item
126
+ * A third
127
+
128
+ h2. External references
129
+
130
+ This is a link: "Google":http://google.com
131
+
132
+ Images: !/static/images/feed-icon-14x14.png!
133
+
134
+
135
+ h2. Tables
136
+
137
+ |_. name |_. age |_. sex |
138
+ | joan | 24 | f |
139
+ | archie | 29 | m |
140
+ | bella | 45 | f |
141
+ id: 3
142
+ version: 1
143
+ user_id: 1
144
+ created_at: 2006-11-06 09:40:53 -08:00
@@ -96,13 +96,16 @@ module Junebug::Controllers
96
96
 
97
97
  class Static < R '/static/(.+)'
98
98
  MIME_TYPES = {'.css' => 'text/css', '.js' => 'text/javascript', '.jpg' => 'image/jpeg'}
99
- # PATH = __FILE__[/(.*)\//, 1]
99
+ #PATH = __FILE__[/(.*)\//, 1]
100
100
  PATH = '.'
101
- #puts `pwd`
102
101
 
103
102
  def get(path)
104
103
  @headers['Content-Type'] = MIME_TYPES[path[/\.\w+$/, 0]] || "text/plain"
105
- @headers['X-Sendfile'] = "#{PATH}/static/#{path}"
104
+ unless path =~ /\.\./ # sample test to prevent directory traversal attacks
105
+ @headers['X-Sendfile'] = "#{PATH}/static/#{path}"
106
+ else
107
+ "404 - Invalid path"
108
+ end
106
109
  end
107
110
  end
108
111
 
data/lib/junebug/views.rb CHANGED
@@ -5,10 +5,10 @@ module Junebug::Views
5
5
  html {
6
6
  head {
7
7
  title @page_title ? @page_title : @page.title
8
- link :href=>'/static/yui/reset.css', :type=>'text/css', :rel=>'stylesheet'
9
- link :href=>'/static/yui/fonts.css', :type=>'text/css', :rel=>'stylesheet'
10
- link :href=>'/static/yui/grids.css', :type=>'text/css', :rel=>'stylesheet'
11
- link :href=>'/static/base.css', :type=>'text/css', :rel=>'stylesheet'
8
+ link :href=>'/static/style/yui/reset.css', :type=>'text/css', :rel=>'stylesheet'
9
+ link :href=>'/static/style/yui/fonts.css', :type=>'text/css', :rel=>'stylesheet'
10
+ link :href=>'/static/style/yui/grids.css', :type=>'text/css', :rel=>'stylesheet'
11
+ link :href=>'/static/style/base.css', :type=>'text/css', :rel=>'stylesheet'
12
12
  }
13
13
  body {
14
14
  div :id=>'doc', :class=>'yui-t7' do
@@ -24,6 +24,7 @@ module Junebug::Views
24
24
  div.content {
25
25
  _button 'Edit page', {:href => R(Edit, @page.title, @version.version), :style=>'float: right; margin: 0 0 5px 5px;'} if (@version.version == @page.version && (! @page.readonly || @state.user_id == 1))
26
26
  _markup @version.body
27
+ _button 'Edit page', {:href => R(Edit, @page.title, @version.version), :style=>'float: right; margin: 0 0 5px 5px;'} if (@version.version == @page.version && (! @page.readonly || @state.user_id == 1)) && @version.body.size > 100
27
28
  }
28
29
  }
29
30
  _footer {
@@ -50,7 +51,7 @@ module Junebug::Views
50
51
  def edit
51
52
  _header :backlinks, @page.title
52
53
  _body {
53
- h1 @page_title
54
+ div.content {
54
55
  div.formbox {
55
56
  form :method => 'post', :action => R(Edit, @page.title) do
56
57
  p {
@@ -78,6 +79,7 @@ module Junebug::Views
78
79
  a 'syntax help', :href => 'http://hobix.com/textile/', :target=>'_blank'
79
80
  br :clear=>'all'
80
81
  }
82
+ }
81
83
  }
82
84
  _footer { '' }
83
85
  end
@@ -252,6 +254,10 @@ module Junebug::Views
252
254
  span :style=>'float: right;' do
253
255
  text 'Powered by '
254
256
  a 'JunebugWiki', :href => 'http://www.junebugwiki.com/'
257
+ text ' '
258
+ a :href => Junebug.config['feed'] do
259
+ img :src => '/static/images/feed-icon-14x14.png'
260
+ end
255
261
  end
256
262
  yield
257
263
  br :clear=>'all'
@@ -273,11 +279,11 @@ module Junebug::Views
273
279
 
274
280
  pages.each do |page|
275
281
  xml.entry do
276
- xml.id Junebug.config['url'] + '/s/' + page.title
282
+ xml.id Junebug.config['url'] + '/' + page.title
277
283
  xml.title page.title
278
- xml.author { xml.name "Anonymous" }
284
+ xml.author { xml.name page.user.username }
279
285
  xml.updated page.updated_at.xmlschema
280
- xml.link "rel" => "alternate", "href" => Junebug.config['url'] + '/s/' + page.title
286
+ xml.link "rel" => "alternate", "href" => Junebug.config['url'] + '/' + page.title
281
287
  xml.summary "#{page.title}"
282
288
  xml.content 'type' => 'html' do
283
289
  xml.text! page.body.gsub("\n", '<br/>').gsub("\r", '')
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: junebug
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.0.4
7
- date: 2006-11-05 00:00:00 -08:00
6
+ version: 0.0.5
7
+ date: 2006-11-06 00:00:00 -08:00
8
8
  summary: Junebug is a minimalist ruby wiki.
9
9
  require_paths:
10
10
  - lib
@@ -45,11 +45,14 @@ files:
45
45
  - deploy/console
46
46
  - deploy/static
47
47
  - deploy/wiki
48
- - deploy/static/base.css
49
- - deploy/static/yui
50
- - deploy/static/yui/fonts.css
51
- - deploy/static/yui/grids.css
52
- - deploy/static/yui/reset.css
48
+ - deploy/static/images
49
+ - deploy/static/style
50
+ - deploy/static/images/feed-icon-14x14.png
51
+ - deploy/static/style/base.css
52
+ - deploy/static/style/yui
53
+ - deploy/static/style/yui/fonts.css
54
+ - deploy/static/style/yui/grids.css
55
+ - deploy/static/style/yui/reset.css
53
56
  - fixtures/junebug_pages.yml
54
57
  test_files: []
55
58