@@ -1,52 +1,50 | |||||
1 | # Redmine - project management software |
|
1 | # Redmine - project management software | |
2 |
# Copyright (C) 2006-20 |
|
2 | # Copyright (C) 2006-2011 Jean-Philippe Lang | |
3 | # |
|
3 | # | |
4 | # This program is free software; you can redistribute it and/or |
|
4 | # This program is free software; you can redistribute it and/or | |
5 | # modify it under the terms of the GNU General Public License |
|
5 | # modify it under the terms of the GNU General Public License | |
6 | # as published by the Free Software Foundation; either version 2 |
|
6 | # as published by the Free Software Foundation; either version 2 | |
7 | # of the License, or (at your option) any later version. |
|
7 | # of the License, or (at your option) any later version. | |
8 | # |
|
8 | # | |
9 | # This program is distributed in the hope that it will be useful, |
|
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. |
|
12 | # GNU General Public License for more details. | |
13 | # |
|
13 | # | |
14 | # You should have received a copy of the GNU General Public License |
|
14 | # You should have received a copy of the GNU General Public License | |
15 | # along with this program; if not, write to the Free Software |
|
15 | # along with this program; if not, write to the Free Software | |
16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
17 |
|
17 | |||
18 | module Redmine |
|
18 | module Redmine | |
19 | module WikiFormatting |
|
19 | module WikiFormatting | |
20 | module Textile |
|
20 | module Textile | |
21 | module Helper |
|
21 | module Helper | |
22 | def wikitoolbar_for(field_id) |
|
22 | def wikitoolbar_for(field_id) | |
23 | heads_for_wiki_formatter |
|
23 | heads_for_wiki_formatter | |
24 | # Is there a simple way to link to a public resource? |
|
24 | # Is there a simple way to link to a public resource? | |
25 | url = "#{Redmine::Utils.relative_url_root}/help/wiki_syntax.html" |
|
25 | url = "#{Redmine::Utils.relative_url_root}/help/wiki_syntax.html" | |
26 |
|
26 | help_link = link_to(l(:setting_text_formatting), url, | ||
27 | help_link = l(:setting_text_formatting) + ': ' + |
|
27 | :onclick => "window.open(\"#{ url }\", \"\", \"resizable=yes, location=no, width=300, height=640, menubar=no, status=no, scrollbars=yes\"); return false;") | |
28 | link_to(l(:label_help), url, |
|
|||
29 | :onclick => "window.open(\"#{ url }\", \"\", \"resizable=yes, location=no, width=300, height=640, menubar=no, status=no, scrollbars=yes\"); return false;") |
|
|||
30 |
|
28 | |||
31 | javascript_tag("var wikiToolbar = new jsToolBar($('#{field_id}')); wikiToolbar.setHelpLink('#{help_link}'); wikiToolbar.draw();") |
|
29 | javascript_tag("var wikiToolbar = new jsToolBar($('#{field_id}')); wikiToolbar.setHelpLink('#{help_link}'); wikiToolbar.draw();") | |
32 | end |
|
30 | end | |
33 |
|
31 | |||
34 | def initial_page_content(page) |
|
32 | def initial_page_content(page) | |
35 | "h1. #{@page.pretty_title}" |
|
33 | "h1. #{@page.pretty_title}" | |
36 | end |
|
34 | end | |
37 |
|
35 | |||
38 | def heads_for_wiki_formatter |
|
36 | def heads_for_wiki_formatter | |
39 | unless @heads_for_wiki_formatter_included |
|
37 | unless @heads_for_wiki_formatter_included | |
40 | content_for :header_tags do |
|
38 | content_for :header_tags do | |
41 | javascript_include_tag('jstoolbar/jstoolbar') + |
|
39 | javascript_include_tag('jstoolbar/jstoolbar') + | |
42 | javascript_include_tag('jstoolbar/textile') + |
|
40 | javascript_include_tag('jstoolbar/textile') + | |
43 | javascript_include_tag("jstoolbar/lang/jstoolbar-#{current_language.to_s.downcase}") + |
|
41 | javascript_include_tag("jstoolbar/lang/jstoolbar-#{current_language.to_s.downcase}") + | |
44 | stylesheet_link_tag('jstoolbar') |
|
42 | stylesheet_link_tag('jstoolbar') | |
45 | end |
|
43 | end | |
46 | @heads_for_wiki_formatter_included = true |
|
44 | @heads_for_wiki_formatter_included = true | |
47 | end |
|
45 | end | |
48 | end |
|
46 | end | |
49 | end |
|
47 | end | |
50 | end |
|
48 | end | |
51 | end |
|
49 | end | |
52 | end |
|
50 | end |
@@ -1,95 +1,96 | |||||
1 | .jstEditor { |
|
1 | .jstEditor { | |
2 | padding-left: 0px; |
|
2 | padding-left: 0px; | |
3 | } |
|
3 | } | |
4 | .jstEditor textarea, .jstEditor iframe { |
|
4 | .jstEditor textarea, .jstEditor iframe { | |
5 | margin: 0; |
|
5 | margin: 0; | |
6 | } |
|
6 | } | |
7 |
|
7 | |||
8 | .jstHandle { |
|
8 | .jstHandle { | |
9 | height: 10px; |
|
9 | height: 10px; | |
10 | font-size: 0.1em; |
|
10 | font-size: 0.1em; | |
11 | cursor: s-resize; |
|
11 | cursor: s-resize; | |
12 | /*background: transparent url(img/resizer.png) no-repeat 45% 50%;*/ |
|
12 | /*background: transparent url(img/resizer.png) no-repeat 45% 50%;*/ | |
13 | } |
|
13 | } | |
14 |
|
14 | |||
15 | .jstElements { |
|
15 | .jstElements { | |
16 | padding: 3px 3px; |
|
16 | padding: 3px 3px; | |
17 | } |
|
17 | } | |
18 |
|
18 | |||
19 | .jstElements button { |
|
19 | .jstElements button { | |
20 | margin-right : 6px; |
|
20 | margin-right : 6px; | |
21 | width : 24px; |
|
21 | width : 24px; | |
22 | height: 24px; |
|
22 | height: 24px; | |
23 | padding: 4px; |
|
23 | padding: 4px; | |
24 | border-style: solid; |
|
24 | border-style: solid; | |
25 | border-width: 1px; |
|
25 | border-width: 1px; | |
26 | border-color: #ddd; |
|
26 | border-color: #ddd; | |
27 | background-color : #f7f7f7; |
|
27 | background-color : #f7f7f7; | |
28 | background-position : 50% 50%; |
|
28 | background-position : 50% 50%; | |
29 | background-repeat: no-repeat; |
|
29 | background-repeat: no-repeat; | |
30 | } |
|
30 | } | |
31 | .jstElements button:hover { |
|
31 | .jstElements button:hover { | |
32 | border-color : #000; |
|
32 | border-color : #000; | |
33 | } |
|
33 | } | |
34 | .jstElements button span { |
|
34 | .jstElements button span { | |
35 | display : none; |
|
35 | display : none; | |
36 | } |
|
36 | } | |
37 | .jstElements span { |
|
37 | .jstElements span { | |
38 | display : inline; |
|
38 | display : inline; | |
39 | } |
|
39 | } | |
40 |
|
40 | |||
41 | .jstSpacer { |
|
41 | .jstSpacer { | |
42 | width : 0px; |
|
42 | width : 0px; | |
43 | font-size: 1px; |
|
43 | font-size: 1px; | |
44 | margin-right: 4px; |
|
44 | margin-right: 4px; | |
45 | } |
|
45 | } | |
46 |
|
46 | |||
47 |
.jstElements .help { float: right; margin-right: |
|
47 | .jstElements .help { float: right; margin-right: 0.5em; padding-top: 8px; font-size: 0.9em; } | |
|
48 | .jstElements .help a {padding: 2px 0 2px 20px; background: url(../images/help.png) no-repeat 0 50%;} | |||
48 |
|
49 | |||
49 | /* Buttons |
|
50 | /* Buttons | |
50 | -------------------------------------------------------- */ |
|
51 | -------------------------------------------------------- */ | |
51 | .jstb_strong { |
|
52 | .jstb_strong { | |
52 | background-image: url(../images/jstoolbar/bt_strong.png); |
|
53 | background-image: url(../images/jstoolbar/bt_strong.png); | |
53 | } |
|
54 | } | |
54 | .jstb_em { |
|
55 | .jstb_em { | |
55 | background-image: url(../images/jstoolbar/bt_em.png); |
|
56 | background-image: url(../images/jstoolbar/bt_em.png); | |
56 | } |
|
57 | } | |
57 | .jstb_ins { |
|
58 | .jstb_ins { | |
58 | background-image: url(../images/jstoolbar/bt_ins.png); |
|
59 | background-image: url(../images/jstoolbar/bt_ins.png); | |
59 | } |
|
60 | } | |
60 | .jstb_del { |
|
61 | .jstb_del { | |
61 | background-image: url(../images/jstoolbar/bt_del.png); |
|
62 | background-image: url(../images/jstoolbar/bt_del.png); | |
62 | } |
|
63 | } | |
63 | .jstb_code { |
|
64 | .jstb_code { | |
64 | background-image: url(../images/jstoolbar/bt_code.png); |
|
65 | background-image: url(../images/jstoolbar/bt_code.png); | |
65 | } |
|
66 | } | |
66 | .jstb_h1 { |
|
67 | .jstb_h1 { | |
67 | background-image: url(../images/jstoolbar/bt_h1.png); |
|
68 | background-image: url(../images/jstoolbar/bt_h1.png); | |
68 | } |
|
69 | } | |
69 | .jstb_h2 { |
|
70 | .jstb_h2 { | |
70 | background-image: url(../images/jstoolbar/bt_h2.png); |
|
71 | background-image: url(../images/jstoolbar/bt_h2.png); | |
71 | } |
|
72 | } | |
72 | .jstb_h3 { |
|
73 | .jstb_h3 { | |
73 | background-image: url(../images/jstoolbar/bt_h3.png); |
|
74 | background-image: url(../images/jstoolbar/bt_h3.png); | |
74 | } |
|
75 | } | |
75 | .jstb_ul { |
|
76 | .jstb_ul { | |
76 | background-image: url(../images/jstoolbar/bt_ul.png); |
|
77 | background-image: url(../images/jstoolbar/bt_ul.png); | |
77 | } |
|
78 | } | |
78 | .jstb_ol { |
|
79 | .jstb_ol { | |
79 | background-image: url(../images/jstoolbar/bt_ol.png); |
|
80 | background-image: url(../images/jstoolbar/bt_ol.png); | |
80 | } |
|
81 | } | |
81 | .jstb_bq { |
|
82 | .jstb_bq { | |
82 | background-image: url(../images/jstoolbar/bt_bq.png); |
|
83 | background-image: url(../images/jstoolbar/bt_bq.png); | |
83 | } |
|
84 | } | |
84 | .jstb_unbq { |
|
85 | .jstb_unbq { | |
85 | background-image: url(../images/jstoolbar/bt_bq_remove.png); |
|
86 | background-image: url(../images/jstoolbar/bt_bq_remove.png); | |
86 | } |
|
87 | } | |
87 | .jstb_pre { |
|
88 | .jstb_pre { | |
88 | background-image: url(../images/jstoolbar/bt_pre.png); |
|
89 | background-image: url(../images/jstoolbar/bt_pre.png); | |
89 | } |
|
90 | } | |
90 | .jstb_link { |
|
91 | .jstb_link { | |
91 | background-image: url(../images/jstoolbar/bt_link.png); |
|
92 | background-image: url(../images/jstoolbar/bt_link.png); | |
92 | } |
|
93 | } | |
93 | .jstb_img { |
|
94 | .jstb_img { | |
94 | background-image: url(../images/jstoolbar/bt_img.png); |
|
95 | background-image: url(../images/jstoolbar/bt_img.png); | |
95 | } |
|
96 | } |
General Comments 0
You need to be logged in to leave comments.
Login now