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