1 |
wakaba |
1.1 |
#?SuikaWikiConfig/2.0 |
2 |
|
|
|
3 |
|
|
Plugin: |
4 |
|
|
@Name: config |
5 |
|
|
@Description: |
6 |
|
|
@@@: Per-Wiki Configuration Pseudo-Plugin |
7 |
|
|
@@lang:en |
8 |
|
|
@License: %%GPL%% |
9 |
wakaba |
1.5 |
@Date.RCS: $Date: 2004/01/16 08:06:42 $ |
10 |
wakaba |
1.1 |
|
11 |
|
|
ViewFragment: |
12 |
|
|
@Name: navbar |
13 |
|
|
@Order: 20 |
14 |
|
|
@Formatting: |
15 |
wakaba |
1.3 |
%link-to-wikipage ( |
16 |
|
|
page => {Wiki//Page//Create}, |
17 |
|
|
label => {%link-to-it ( |
18 |
|
|
label => "%res(name=>GoToCreatePage);"p, |
19 |
|
|
description => "%res(name=>GoToCreatePageLong);"p, |
20 |
|
|
);}, |
21 |
|
|
); |
22 |
|
|
%link-to-wikipage ( |
23 |
|
|
page => {Wiki//Page//Search}, |
24 |
|
|
label => {%link-to-it ( |
25 |
wakaba |
1.1 |
label=>"%res(name=>GoToSearchPage);"p, |
26 |
wakaba |
1.3 |
description=>"%res(name=>GoToSearchPageLong);"p, |
27 |
|
|
);}, |
28 |
|
|
rel => search, |
29 |
|
|
); |
30 |
|
|
%link-to-wikipage ( |
31 |
wakaba |
1.5 |
page => {IndexPage}, |
32 |
wakaba |
1.3 |
label => {%link-to-it ( |
33 |
wakaba |
1.5 |
label=>"%res(name=>GoToIndexPage);"p, |
34 |
|
|
description=>"%res(name=>GoToIndexPageLong);"p, |
35 |
wakaba |
1.3 |
);}, |
36 |
wakaba |
1.5 |
rel => index, |
37 |
wakaba |
1.3 |
); |
38 |
wakaba |
1.1 |
|
39 |
wakaba |
1.5 |
|
40 |
wakaba |
1.1 |
ViewFragment: |
41 |
|
|
@Name: links |
42 |
|
|
@Formatting: |
43 |
wakaba |
1.3 |
%link-wiki(page=>"Wiki//News",rel=>news, |
44 |
|
|
description=>"%res(name=>GoToWikiNewsLink);"p); |
45 |
|
|
%link-wiki(page=>"Wiki//Help",rel=>help, |
46 |
|
|
description=>"%res(name=>GoToWikiHelpLink);"p); |
47 |
|
|
%link-wiki(page=>"Wiki//Page//License",rel=>copyright, |
48 |
|
|
description=>"%res(name=>GoToWikiPageLicenseLink);"p); |
49 |
wakaba |
1.1 |
|
50 |
wakaba |
1.3 |
%link-wiki(page=>"Wiki//Page//Search",rel=>search, |
51 |
wakaba |
1.5 |
description=>"%res(name=>GoToSearchPageLink);"p); |
52 |
wakaba |
1.2 |
|
53 |
wakaba |
1.5 |
## TODO: Resource, URI |
54 |
|
|
%link-to-resource ( |
55 |
|
|
uri => {javascript:var%20WikiName=prompt('Please%20input%20the%20WikiName:','','Jump%20to%20SuikaWiki');if(WikiName)%7B_content.location.href='wiki%3F'+encodeURIComponent(WikiName)%7D}, |
56 |
|
|
rel => jump, |
57 |
|
|
class => wiki-cmd, |
58 |
|
|
label => {%html-link ( |
59 |
|
|
description => {%res(name=>JumpToLink);}p, |
60 |
|
|
);}, |
61 |
|
|
); |
62 |
|
|
%link-to-resource ( |
63 |
|
|
uri => {javascript:var%20WikiName=prompt('Please%20input%20the%20WikiName:','','Jump%20to%20SuikaWiki');if(WikiName)%7B_content.location.href='wiki%3Fmycmd=edit;mypage='+encodeURIComponent(WikiName)%7D}, |
64 |
|
|
rel => jump, |
65 |
|
|
class => wiki-cmd, |
66 |
|
|
label => {%html-link ( |
67 |
|
|
description => {%res(name=>JumpToEditLink);}p, |
68 |
|
|
);}, |
69 |
wakaba |
1.2 |
); |
70 |
|
|
|
71 |
wakaba |
1.1 |
ViewFragment: |
72 |
|
|
@Name: ws--footer |
73 |
|
|
@Formatting: |
74 |
|
|
%link-to-wikipage ( |
75 |
|
|
page => {Wiki//Page//License}, |
76 |
wakaba |
1.3 |
label => {%link-to-it ( |
77 |
|
|
label => {%res (name => {Footer:License:SeeLicensePage});}p, |
78 |
|
|
description => {%res (name => {Footer:License:SeeLicensePageLong});}p, |
79 |
|
|
);}, |
80 |
wakaba |
1.1 |
); |
81 |
wakaba |
1.5 |
# %wpr--remove-button; |
82 |
wakaba |
1.1 |
|
83 |
wakaba |
1.2 |
ViewFragment: |
84 |
|
|
@Template[list]:wr--read-body |
85 |
|
|
@Order: -10 |
86 |
|
|
@Description: |
87 |
|
|
@@@: "Read" mode body -- Calender |
88 |
|
|
@@lang:en |
89 |
|
|
@Formatting: |
90 |
|
|
%if-calender(month,true=>{ |
91 |
|
|
%format(context=>form_input,template=>{%calender;}); |
92 |
|
|
},false=>{ |
93 |
|
|
%if-calender(true=>{ |
94 |
|
|
%format(context=>form_input,template=>{%calender-months;}); |
95 |
|
|
}); |
96 |
|
|
}); |
97 |
|
|
|
98 |
|
|
|
99 |
|
|
ViewFragment: |
100 |
|
|
@Template[list]: |
101 |
|
|
we--edit-body |
102 |
|
|
we--conflict-body |
103 |
|
|
@Order: 1000 |
104 |
|
|
@Description: |
105 |
|
|
@@@: WikiPage editing guide |
106 |
|
|
@@lang:en |
107 |
|
|
@Formatting: |
108 |
|
|
%block ( |
109 |
|
|
id => edit-help, |
110 |
|
|
content => {%read(page=>{Wiki//EditHelp});}p, |
111 |
|
|
); |
112 |
|
|
|
113 |
|
|
|
114 |
|
|
|
115 |
|
|
|
116 |
wakaba |
1.1 |
Resource: |
117 |
|
|
@GoToWikiNewsLink: |
118 |
|
|
@@@: News |
119 |
|
|
@@lang:en |
120 |
|
|
@GoToWikiHelpLink: |
121 |
|
|
@@@: Help |
122 |
|
|
@@lang:en |
123 |
|
|
@GoToWikiPageLicenseLink: |
124 |
|
|
@@@: License |
125 |
|
|
@@lang:en |
126 |
|
|
|
127 |
|
|
ViewFragment: |
128 |
|
|
@Name: we--edit |
129 |
|
|
@Order: -100 |
130 |
|
|
@Formatting: |
131 |
wakaba |
1.3 |
%line(content=>{ |
132 |
wakaba |
1.1 |
%submit(accesskey=>S,label=>{%res(name=>{Edit:Save});}p); |
133 |
wakaba |
1.4 |
[%wpp--next-anchor-index;] |
134 |
|
|
}p); |
135 |
wakaba |
1.1 |
|
136 |
|
|
ViewFragment: |
137 |
|
|
@Name: we--edit |
138 |
|
|
@Order: -10 |
139 |
wakaba |
1.3 |
@Formatting: %line(content=>{ |
140 |
wakaba |
1.1 |
ViewFragment: |
141 |
|
|
@Name: we--edit |
142 |
|
|
@Order: 10 |
143 |
|
|
@Formatting: }p); |
144 |
|
|
|
145 |
|
|
ViewFragment: |
146 |
|
|
@Name: we--edit |
147 |
|
|
@Order: 150 |
148 |
|
|
@Formatting: |
149 |
wakaba |
1.3 |
%line(content=>{ |
150 |
wakaba |
1.1 |
|
151 |
|
|
ViewFragment: |
152 |
|
|
@Name: we--edit |
153 |
|
|
@Order: 250 |
154 |
|
|
@Formatting: |
155 |
|
|
%mode-after-edit-selection; |
156 |
|
|
|
157 |
wakaba |
1.4 |
%we--update-lastmodified-datetime; |
158 |
|
|
|
159 |
wakaba |
1.1 |
}p); |
160 |
|
|
|
161 |
wakaba |
1.3 |
Resource: |
162 |
|
|
@Footer:License:SeeLicensePage: |
163 |
|
|
@@@: %char (ucs => {U+00A9}); |
164 |
|
|
@Footer:License:SeeLicensePageLong: |
165 |
|
|
@@@: See license document |
166 |
|
|
@@lang:en |
167 |
wakaba |
1.2 |
|
168 |
|
|
## --- Should be moved to proper plugin module --- |
169 |
|
|
|
170 |
|
|
## WikiPageRename |
171 |
|
|
ViewFragment: |
172 |
|
|
@Template[list]: we--adminedit-body |
173 |
wakaba |
1.4 |
@Order:100 |
174 |
wakaba |
1.2 |
@Description: |
175 |
|
|
@@@: Renaming WikiName section |
176 |
|
|
@@lang:en |
177 |
|
|
@Formatting: |
178 |
wakaba |
1.4 |
%section ( |
179 |
wakaba |
1.2 |
title => {%res(name=>{Edit:Rename:Title});}p, heading, |
180 |
|
|
content => { |
181 |
|
|
%wp-rename-form ( |
182 |
|
|
content => { |
183 |
|
|
%text ( |
184 |
|
|
id => to, |
185 |
|
|
label => {%res(name=>{Edit:Rename:To=});}p, |
186 |
|
|
size => 10, |
187 |
|
|
default => {%page-name;}p, |
188 |
|
|
); |
189 |
|
|
%submit; |
190 |
|
|
}p, |
191 |
|
|
); |
192 |
|
|
}p, |
193 |
|
|
); |
194 |
wakaba |
1.1 |
|
195 |
wakaba |
1.4 |
PluginConst: |
196 |
|
|
@NS_XHTML1: |
197 |
|
|
http://www.w3.org/1999/xhtml |
198 |
|
|
|
199 |
|
|
FormattingRule: |
200 |
|
|
@Name: debug-sw09-text-xml-text-diff |
201 |
|
|
@Formatting: |
202 |
|
|
my $page = $p->{page} ? [split m#//#, $p->{page}] |
203 |
|
|
: $o->{wiki}->{var}->{page}; |
204 |
|
|
my $sw09 = SuikaWiki::Plugin->module_package ('SuikaWiki09'); |
205 |
|
|
|
206 |
|
|
## Original Text Format |
207 |
|
|
my $text1 = $o->{wiki}->{db}->get (content => $page); |
208 |
|
|
|
209 |
|
|
## Text format -> XML format |
210 |
|
|
my $xml = new Message::Markup::XML::Node type => '#fragment'; |
211 |
|
|
$sw09->text_to_xml ($text1, {-parent => $xml}); |
212 |
|
|
|
213 |
|
|
## XML format -> Text format |
214 |
|
|
my $text2 = $sw09->xml_to_text ($xml, {}); |
215 |
|
|
|
216 |
|
|
$p->{-parent}->append_new_node (type => '#element', |
217 |
|
|
namespace_uri => $NS_XHTML1, |
218 |
|
|
local_name => 'pre') |
219 |
|
|
->append_text ($xml->outer_xml); |
220 |
|
|
SuikaWiki::Plugin->module_package ('WikiEdit') |
221 |
|
|
->diff_in_html (\$text1, \$text2 => |
222 |
|
|
$p->{-parent}->append_new_node (type => '#element', |
223 |
|
|
namespace_uri => $NS_XHTML1, |
224 |
|
|
local_name => 'pre') |
225 |
|
|
); |
226 |
|
|
|
227 |
|
|
FormattingRule: |
228 |
|
|
@Category[list]:view |
229 |
|
|
@Name: debug-sw09-text-xml-text-diff |
230 |
|
|
@Formatting: |
231 |
|
|
my $page = $p->{page} ? [split m#//#, $p->{page}] |
232 |
|
|
: $o->{wiki}->{var}->{page}; |
233 |
|
|
my $sw09 = SuikaWiki::Plugin->module_package ('SuikaWiki09'); |
234 |
|
|
|
235 |
|
|
## Original Text Format |
236 |
|
|
my $text1 = $o->{wiki}->{db}->get (content => $page); |
237 |
|
|
|
238 |
|
|
## Text format -> XML format |
239 |
|
|
my $xml = new Message::Markup::XML::Node type => '#fragment'; |
240 |
|
|
$sw09->text_to_xml ($text1, {-parent => $xml}); |
241 |
|
|
|
242 |
|
|
## XML format -> Text format |
243 |
|
|
my $text2 = $sw09->xml_to_text ($xml, {}); |
244 |
|
|
|
245 |
|
|
$p->{-parent}->append_new_node (type => '#element', |
246 |
|
|
namespace_uri => $NS_XHTML1, |
247 |
|
|
local_name => 'pre') |
248 |
|
|
->append_text ($xml->outer_xml); |
249 |
|
|
$p->{-parent}->append_new_node (type => '#element', |
250 |
|
|
namespace_uri => $NS_XHTML1, |
251 |
|
|
local_name => 'pre') |
252 |
|
|
->append_text ($text2); |
253 |
|
|
SuikaWiki::Plugin->module_package ('WikiEdit') |
254 |
|
|
->diff_in_html (\$text1, \$text2 => $p->{-parent}); |
255 |
|
|
|
256 |
|
|
|
257 |
|
|
Was ViewFragment: |
258 |
|
|
@Template[list]:wr--read-body |
259 |
|
|
@Order: 120 |
260 |
|
|
@Formatting: |
261 |
|
|
%section ( |
262 |
|
|
heading, |
263 |
|
|
title => "Diff", |
264 |
|
|
content => { |
265 |
|
|
%debug-sw09-text-xml-text-diff; |
266 |
|
|
}p, |
267 |
|
|
); |