#?SuikaWikiConfig/2.0 Plugin: @Name: config @Description: @@@: Per-Wiki Configuration Pseudo-Plugin @@lang:en @License: %%GPL%% @Date.RCS: $Date: 2004/02/01 12:34:18 $ ViewFragment: @Name: navbar @Order: 20 @Formatting: %link-to-wikipage ( page => {Wiki//Page//Create}, label => {%link-to-it ( label => "%res(name=>GoToCreatePage);"p, description => "%res(name=>GoToCreatePageLong);"p, );}, ); %link-to-wikipage ( page => {Wiki//Page//Search}, label => {%link-to-it ( label=>"%res(name=>GoToSearchPage);"p, description=>"%res(name=>GoToSearchPageLong);"p, );}, rel => search, ); %link-to-wikipage ( page => {IndexPage}, label => {%link-to-it ( label=>"%res(name=>GoToIndexPage);"p, description=>"%res(name=>GoToIndexPageLong);"p, );}, rel => index, ); ViewFragment: @Name: links @Formatting: %link-wiki(page=>"Wiki//News",rel=>news, description=>"%res(name=>GoToWikiNewsLink);"p); %link-wiki(page=>"Wiki//Help",rel=>help, description=>"%res(name=>GoToWikiHelpLink);"p); %link-wiki(page=>"Wiki//Page//License",rel=>copyright, description=>"%res(name=>GoToWikiPageLicenseLink);"p); %link-wiki(page=>"Wiki//Page//Search",rel=>search, description=>"%res(name=>GoToSearchPageLink);"p); ## TODO: Resource, URI %link-to-resource ( uri => {javascript:var%20WikiName=prompt('Please%20input%20the%20WikiName:','','Jump%20to%20SuikaWiki');if(WikiName)%7B_content.location.href='wiki%3F'+encodeURIComponent(WikiName)%7D}, rel => jump, class => wiki-cmd, label => {%html-link ( description => {%res(name=>JumpToLink);}p, );}, ); %link-to-resource ( 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}, rel => jump, class => wiki-cmd, label => {%html-link ( description => {%res(name=>JumpToEditLink);}p, );}, ); ViewFragment: @Name: ws--footer @Formatting: %link-to-wikipage ( page => {Wiki//Page//License}, label => {%link-to-it ( label => {%res (name => {Footer:License:SeeLicensePage});}p, description => {%res (name => {Footer:License:SeeLicensePageLong});}p, );}, ); # %wpr--remove-button; ViewFragment: @Template[list]:wr--read-body @Order: -10 @Description: @@@: "Read" mode body -- Calender @@lang:en @Formatting: %if-calender(month,true=>{ %format(context=>form_input,template=>{%calender;}); },false=>{ %if-calender(true=>{ %format(context=>form_input,template=>{%calender-months;}); }); }); ViewFragment: @Template[list]: we--edit-body we--conflict-body @Order: 1000 @Description: @@@: WikiPage editing guide @@lang:en @Formatting: %block ( id => edit-help, content => {%read(page=>{Wiki//EditHelp});}p, ); Resource: @GoToWikiNewsLink: @@@: News @@lang:en @GoToWikiHelpLink: @@@: Help @@lang:en @GoToWikiPageLicenseLink: @@@: License @@lang:en ViewFragment: @Name: we--edit @Order: -100 @Formatting: %line(content=>{ %submit(accesskey=>S,label=>{%res(name=>{Edit:Save});}p); [%wpp--next-anchor-index;] }p); ViewFragment: @Name: we--edit @Order: -10 @Formatting: %line(content=>{ ViewFragment: @Name: we--edit @Order: 10 @Formatting: }p); ViewFragment: @Name: we--edit @Order: 150 @Formatting: %line(content=>{ ViewFragment: @Name: we--edit @Order: 250 @Formatting: %mode-after-edit-selection; %we--update-lastmodified-datetime; }p); Resource: @Footer:License:SeeLicensePage: @@@: %char (ucs => {U+00A9}); @Footer:License:SeeLicensePageLong: @@@: See license document @@lang:en ## --- Should be moved to proper plugin module --- ## WikiPageRename ViewFragment: @Template[list]: we--adminedit-body @Order:100 @Description: @@@: Renaming WikiName section @@lang:en @Formatting: %section ( title => {%res(name=>{Edit:Rename:Title});}p, heading, content => { %wp-rename-form ( content => { %text ( id => to, label => {%res(name=>{Edit:Rename:To=});}p, size => 10, default => {%page-name;}p, ); %submit; }p, ); }p, ); PluginConst: @NS_XHTML1: http://www.w3.org/1999/xhtml FormattingRule: @Name: debug-sw09-text-xml-text-diff @Formatting: my $page = $p->{page} ? [split m#//#, $p->{page}] : $o->{wiki}->{var}->{page}; my $sw09 = SuikaWiki::Plugin->module_package ('SuikaWiki09'); ## Original Text Format my $text1 = $o->{wiki}->{db}->get (content => $page); ## Text format -> XML format my $xml = new Message::Markup::XML::Node type => '#fragment'; $sw09->text_to_xml ($text1, {-parent => $xml}); ## XML format -> Text format my $text2 = $sw09->xml_to_text ($xml, {}); $p->{-parent}->append_new_node (type => '#element', namespace_uri => $NS_XHTML1, local_name => 'pre') ->append_text ($xml->outer_xml); SuikaWiki::Plugin->module_package ('WikiEdit') ->diff_in_html (\$text1, \$text2 => $p->{-parent}->append_new_node (type => '#element', namespace_uri => $NS_XHTML1, local_name => 'pre') ); FormattingRule: @Category[list]:view @Name: debug-sw09-text-xml-text-diff @Formatting: my $page = $p->{page} ? [split m#//#, $p->{page}] : $o->{wiki}->{var}->{page}; my $sw09 = SuikaWiki::Plugin->module_package ('SuikaWiki09'); ## Original Text Format my $text1 = $o->{wiki}->{db}->get (content => $page); ## Text format -> XML format my $xml = new Message::Markup::XML::Node type => '#fragment'; $sw09->text_to_xml ($text1, {-parent => $xml}); ## XML format -> Text format my $text2 = $sw09->xml_to_text ($xml, {}); $p->{-parent}->append_new_node (type => '#element', namespace_uri => $NS_XHTML1, local_name => 'pre') ->append_text ($xml->outer_xml); $p->{-parent}->append_new_node (type => '#element', namespace_uri => $NS_XHTML1, local_name => 'pre') ->append_text ($text2); SuikaWiki::Plugin->module_package ('WikiEdit') ->diff_in_html (\$text1, \$text2 => $p->{-parent}); Was ViewFragment: @Template[list]:wr--read-body @Order: 120 @Formatting: %section ( heading, title => "Diff", content => { %debug-sw09-text-xml-text-diff; }p, );