| 1 |
wakaba |
1.1 |
#?SuikaWikiConfig/2.0 |
| 2 |
|
|
|
| 3 |
|
|
Plugin: |
| 4 |
|
|
@Name: RandomJump |
| 5 |
|
|
@Description: |
| 6 |
wakaba |
1.2 |
@@@: |
| 7 |
wakaba |
1.1 |
This plugin module provides "random jump" functions |
| 8 |
|
|
to select wiki pages randomly. |
| 9 |
wakaba |
1.2 |
@@lang:en |
| 10 |
wakaba |
1.1 |
@License: %%GPL%% |
| 11 |
wakaba |
1.2 |
@Author: |
| 12 |
|
|
@@Name: |
| 13 |
|
|
@@@@:Wakaba |
| 14 |
|
|
@@@lang:ja |
| 15 |
|
|
@@@script:Latn |
| 16 |
|
|
@@Mail:[email protected] |
| 17 |
wakaba |
1.3 |
@Date.RCS: $Date: 2003/10/25 02:22:06 $ |
| 18 |
wakaba |
1.1 |
|
| 19 |
|
|
ViewDefinition: |
| 20 |
|
|
@Mode: RandomJump |
| 21 |
|
|
@Condition: |
| 22 |
|
|
@@output: http-cgi |
| 23 |
wakaba |
1.2 |
@Description: |
| 24 |
|
|
@@@:Redirection to some WikiPage selected randomly |
| 25 |
|
|
@@lang:en |
| 26 |
wakaba |
1.1 |
@method: |
| 27 |
|
|
@@@: |
| 28 |
|
|
$self->{view}->init_db; |
| 29 |
|
|
my @list = $self->{view}->{wiki}->{db}->keys ('content'); |
| 30 |
wakaba |
1.2 |
|
| 31 |
|
|
my $uri = SuikaWiki::Plugin->_uri_wiki_page |
| 32 |
|
|
(join ('//', @{$list[rand @list]}), |
| 33 |
|
|
up_to_date => 1, absolute => 1); |
| 34 |
|
|
|
| 35 |
|
|
require SuikaWiki::Output::HTTP; |
| 36 |
|
|
my $output = SuikaWiki::Output::HTTP->new (wiki => $self->{view}->{wiki}); |
| 37 |
|
|
$output->set_redirect (uri => $uri, status_code => 303); |
| 38 |
|
|
$output->output (output => 'http-cgi'); |
| 39 |
wakaba |
1.1 |
@@Name: main |
| 40 |
wakaba |
1.2 |
|
| 41 |
|
|
ViewFragment: |
| 42 |
|
|
@Name: navbar |
| 43 |
|
|
@Description: |
| 44 |
|
|
@@@: "Go somewhere" button on navigation bar |
| 45 |
|
|
@@lang:en |
| 46 |
|
|
@Order: 110 |
| 47 |
|
|
@Formatting: |
| 48 |
wakaba |
1.3 |
%link-to-wikipage ( |
| 49 |
|
|
mode => RandomJump, |
| 50 |
|
|
up-to-date, |
| 51 |
|
|
rel => jump, |
| 52 |
|
|
label => {%link-to-it ( |
| 53 |
|
|
label => {%res (name => GoSomewhere);}p, |
| 54 |
|
|
description => {%res (name => GoSomewhereLong);}p, |
| 55 |
|
|
class => randomlink, |
| 56 |
|
|
);}, |
| 57 |
|
|
); |
| 58 |
wakaba |
1.2 |
|
| 59 |
|
|
ViewFragment: |
| 60 |
|
|
@Name: links |
| 61 |
|
|
@Description: |
| 62 |
|
|
@@@: "Go somewhere" link |
| 63 |
|
|
@@lang:en |
| 64 |
|
|
@Formatting: |
| 65 |
|
|
%link-wiki(mode=>RandomJump,up-to-date,rel=>jump, |
| 66 |
wakaba |
1.3 |
class=>randomlink, |
| 67 |
wakaba |
1.2 |
title=>"%res(name=>GoSomewhereLink);"p); |
| 68 |
|
|
|
| 69 |
|
|
Resource: |
| 70 |
|
|
@GoSomewhere: |
| 71 |
|
|
@@@: Lucky |
| 72 |
|
|
@@lang:en |
| 73 |
|
|
@GoSomewhereLink: |
| 74 |
|
|
@@@: Go somewhere in this wiki |
| 75 |
|
|
@@lang:en |
| 76 |
|
|
@GoSomewhereLong: |
| 77 |
|
|
@@@: Go somewhere in this wiki |
| 78 |
|
|
@@lang:en |