stiki 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -48,8 +48,8 @@ To configure Stiki, create a config in config/initializers/stiki.rb
48
48
  # Optional, use cancan for authorization
49
49
  stiki.authorize_by = :cancan
50
50
 
51
- # Optional, enable jQuery javascript
52
- javascript_enabled = true
51
+ # Optional, disable javascript
52
+ javascript_enabled = false
53
53
  end
54
54
 
55
55
  === Reloading Stiki in the development environment
@@ -11,6 +11,14 @@
11
11
  }
12
12
  }
13
13
 
14
+ .wiki-cheatsheet {
15
+ margin: 20px 0;
16
+
17
+ h4 {
18
+ margin-left: 18px;
19
+ }
20
+ }
21
+
14
22
  .page-list {
15
23
  cursor:pointer;
16
24
 
@@ -7,18 +7,18 @@
7
7
  .space {
8
8
  .action {
9
9
  float: right;
10
+ }
11
+ .update {
12
+ margin-right: 5px;
13
+ }
10
14
 
11
- .update {
12
- margin-right: 5px;
13
- }
14
-
15
- .delete {
16
- border: 0;
17
- background-color: white;
18
- }
15
+ .delete {
16
+ border: 0;
17
+ background-color: white;
19
18
  }
20
19
 
21
20
 
21
+
22
22
  .title {
23
23
  float: left;
24
24
  }
@@ -1,86 +1,151 @@
1
1
  <div class="stiki">
2
- <div class="row-fluid page">
2
+ <div class="page">
3
+ <div class="row-fluid">
4
+ <div class="span12 well">
5
+ <div class="row-fluid">
6
+ <div class="span7 title">
7
+ <%= link_to '<i class="icon-chevron-left"></i>'.html_safe, stiki_routes.space_pages_path(@space), :style => "float:left" %>
8
+ <h1>
9
+ <%= @page.title %>
10
+ </h1>
11
+ </div>
12
+ <div class="span5">
13
+ <ul class="breadcrumb">
14
+ <li>
15
+ <span class="divider">/</span>
16
+ </li>
17
+ <li>
18
+ <div class="btn-group">
19
+ <button class="btn dropdown-toggle" data-toggle="dropdown"><%= @space.name %> <span class="caret"></span></button>
20
+ <ul class="dropdown-menu">
21
+ <li><a href="<%= stiki_routes.spaces_path %>">All Spaces</a></li>
22
+ <li class="divider"></li>
23
+ <%- @spaces.each do |space| %>
24
+ <li><a href="<%= stiki_routes.space_pages_path(space) %>"><%= space.name %></a></li>
25
+ <% end -%>
26
+ </ul>
27
+ </div>
28
+ </li>
29
+ <li>
30
+ <span class="divider">/</span>
31
+ </li>
32
+ <li>
33
+ <div class="btn-group">
34
+ <button class="btn dropdown-toggle" data-toggle="dropdown"><%= @page.title %> <span class="caret"></span></button>
35
+ <ul class="dropdown-menu">
36
+ <li><a href="<%= stiki_routes.space_pages_path(@space) %>">All Pages</a></li>
37
+ <li class="divider"></li>
38
+ <%- @pages.each do |page| %>
39
+ <li><a href="<%= stiki_routes.space_page_path(@space,page) %>"><%= page.title %></a></li>
40
+ <% end -%>
41
+ </ul>
42
+ </div>
43
+ </li>
44
+
45
+ </ul>
46
+ </div>
47
+ </div>
48
+ </div>
49
+ <div class="row-fluid">
50
+ <div class="span9">
51
+ <div class="row-fluid">
52
+ <div class="span12 well"><%= @markup %></div>
53
+ </div>
54
+ <div class="row-fluid">
3
55
  <div class="span12 well">
4
- <div class="row-fluid">
5
- <div class="span7 title">
6
- <%= link_to '<i class="icon-chevron-left"></i>'.html_safe, stiki_routes.space_pages_path(@space), :style => "float:left" %>
7
- <h1>
8
- <%= @page.title %>
9
- </h1>
56
+ <%- if has_access( :update, @page ) %>
57
+ <div class="span2">
58
+ <%= link_to 'Edit', stiki_routes.edit_space_page_path(@space,@page), :class => 'btn btn-large btn-primary' %>
10
59
  </div>
11
- <div class="span5">
12
- <ul class="breadcrumb">
13
- <li>
14
- <span class="divider">/</span>
15
- </li>
16
- <li>
17
- <div class="btn-group">
18
- <button class="btn dropdown-toggle" data-toggle="dropdown"><%= @space.name %> <span class="caret"></span></button>
19
- <ul class="dropdown-menu">
20
- <li><a href="<%= stiki_routes.spaces_path %>">All Spaces</a></li>
21
- <li class="divider"></li>
22
- <%- @spaces.each do |space| %>
23
- <li><a href="<%= stiki_routes.space_pages_path(space) %>"><%= space.name %></a></li>
24
- <% end -%>
25
- </ul>
26
- </div>
27
- </li>
28
- <li>
29
- <span class="divider">/</span>
30
- </li>
31
- <li>
32
- <div class="btn-group">
33
- <button class="btn dropdown-toggle" data-toggle="dropdown"><%= @page.title %> <span class="caret"></span></button>
34
- <ul class="dropdown-menu">
35
- <li><a href="<%= stiki_routes.space_pages_path(@space) %>">All Pages</a></li>
36
- <li class="divider"></li>
37
- <%- @pages.each do |page| %>
38
- <li><a href="<%= stiki_routes.space_page_path(@space,page) %>"><%= page.title %></a></li>
39
- <% end -%>
40
- </ul>
41
- </div>
42
- </li>
43
-
44
- </ul>
60
+ <% end -%>
61
+ <%- if has_access( :delete, @page ) %>
62
+ <div class="span2 delete">
63
+ <%= button_to "Delete", stiki_routes.space_page_path( @space, @page ), :method => :delete,
64
+ :class => 'btn', :confirm => 'Are you sure you want to delete this Wiki Page?' %>
45
65
  </div>
66
+ <% end -%>
46
67
  </div>
47
- </div>
48
- <div class="row-fluid">
49
- <div class="span9">
50
- <div class="row-fluid">
51
- <div class="span12 well"><%= @markup %></div>
68
+ </div>
52
69
  </div>
53
- <div class="row-fluid">
54
- <div class="span12 well">
55
- <%- if has_access( :update, @page ) %>
56
- <div class="span2">
57
- <%= link_to 'Edit', stiki_routes.edit_space_page_path(@space,@page), :class => 'btn btn-large btn-primary' %>
70
+ <div class="span3">
71
+ <div class="row-fluid">
72
+ <div class="span12 well">
73
+ <div>
74
+ <ul class="nav nav-list author">
75
+ <li class="nav-header">Contributors</li>
76
+ <%- @page.authors.each do |author| %>
77
+ <li>
78
+ <%= user_name( author ) %>
79
+ <%= "<span class='badge badge-success' title='Author'>A</span>".html_safe if author.creator %>
80
+ <%= "<span class='badge badge-info' title='Last Edit'>L</span>".html_safe if author.last_edit %></li>
81
+ </li>
82
+ <% end -%>
83
+ </ul>
58
84
  </div>
59
- <% end -%>
60
- <%- if has_access( :delete, @page ) %>
61
- <div class="span2 delete">
62
- <%= button_to "Delete", stiki_routes.space_page_path( @space, @page ), :method => :delete,
63
- :class => 'btn', :confirm => 'Are you sure you want to delete this Wiki Page?' %>
85
+ <div class="wiki-cheatsheet">
86
+ <h4><a data-toggle="modal" href="#cheatsheet">Wiki Syntax</a></h4>
87
+ <div id="cheatsheet" class="<%= 'modal' if Stiki.javascript_enabled %>" style="<%= 'display:none' if Stiki.javascript_enabled %>">
88
+ <%- if Stiki.javascript_enabled %>
89
+ <div class="modal-header">
90
+ <button type="button" class="close" data-dismiss="modal">×</button>
91
+ <h3>Markdown Wiki Syntax</h3>
92
+ </div>
93
+ <div class="modal-body">
94
+ <% end -%>
95
+ <pre>
96
+ # Header 1
97
+ ## Header 2
98
+ ### Header 3
99
+ #### Header 4
100
+ ##### Header 5
101
+
102
+ For a link:
103
+ [text](http://link.com)
104
+
105
+ Also a link:
106
+ &lt;http://link.com/&gt;
107
+
108
+ _italics_
109
+ **bold**
110
+ `code()`
111
+
112
+ For an image:
113
+ ![alt](/path/pic.jpeg)
114
+
115
+ > Blockquotes
116
+
117
+ * Bullet lists
118
+ - Another one
119
+ + Another one
120
+
121
+ 1. A numbered list
122
+ 2. Which is numbered
123
+
124
+ ### Horizontal rules
125
+
126
+ </pre>
127
+ <%- if Stiki.javascript_enabled %>
128
+ </div>
129
+ <div class="modal-footer">
130
+ <a href="#" class="btn" data-dismiss="modal">Close</a>
131
+ </div>
132
+ <% end -%>
133
+ </div>
134
+ <% if Stiki.javascript_enabled %>
135
+ <script type="text/javascript">
136
+
137
+ $('.cheatsheet').modal();
138
+ jQuery( function() {
139
+ jQuery( ".wiki-cheatsheet-trigger" ).click( function() {
140
+ //jQuery('.cheatsheet').toggle();
141
+ });
142
+ });
143
+ </script>
144
+ <% end %>
64
145
  </div>
65
- <% end -%>
146
+ <div>
66
147
  </div>
67
148
  </div>
68
149
  </div>
69
- <div class="span3">
70
- <div class="row-fluid">
71
- <div class="span12 well">
72
- <ul class="nav nav-list author">
73
- <li class="nav-header">Contributors</li>
74
- <%- @page.authors.each do |author| %>
75
- <li>
76
- <%= user_name( author ) %>
77
- <%= "<span class='badge badge-success' title='Author'>A</span>".html_safe if author.creator %>
78
- <%= "<span class='badge badge-info' title='Last Edit'>L</span>".html_safe if author.last_edit %></li>
79
- </li>
80
- <% end -%>
81
- </ul>
82
- <div>
83
- </div>
84
- </div>
85
150
  </div>
86
151
  </div>
@@ -24,7 +24,7 @@
24
24
  <%- if javascript_enabled %>
25
25
  <div class="row-fluid create-space">
26
26
  <div class="span8 well">
27
- <a href="#" class="create-space-trigger">Create New Space</a>
27
+ <a href="#" class="btn btn-success btn-large create-space-trigger">Create New Space</a>
28
28
  </div>
29
29
  </div>
30
30
  <% end -%>
@@ -51,9 +51,9 @@
51
51
  </div>
52
52
  <%- if javascript_enabled %>
53
53
  <script type="text/javascript">
54
- $(function() {
55
- $('.create-space-trigger').click( function() {
56
- $('.create-space').slideToggle();
54
+ jQuery(function() {
55
+ jQuery('.create-space-trigger').click( function() {
56
+ jQuery('.create-space').slideToggle();
57
57
  });
58
58
  });
59
59
  </script>
@@ -21,6 +21,8 @@ module Stiki
21
21
  def self.config(&blk)
22
22
  @@config_blk = blk
23
23
 
24
+ @@javascript_enabled = true
25
+
24
26
  yield self
25
27
 
26
28
  if user_class
@@ -1,3 +1,3 @@
1
1
  module Stiki
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stiki
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-07 00:00:00.000000000 Z
12
+ date: 2012-08-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -264,7 +264,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
264
264
  version: '0'
265
265
  segments:
266
266
  - 0
267
- hash: 2305586921558367832
267
+ hash: -2092737024573445962
268
268
  required_rubygems_version: !ruby/object:Gem::Requirement
269
269
  none: false
270
270
  requirements:
@@ -273,7 +273,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
273
273
  version: '0'
274
274
  segments:
275
275
  - 0
276
- hash: 2305586921558367832
276
+ hash: -2092737024573445962
277
277
  requirements: []
278
278
  rubyforge_project:
279
279
  rubygems_version: 1.8.24