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.6 |
@License: %%Perl%% |
11 |
wakaba |
1.2 |
@Author: |
12 |
|
|
@@Name: |
13 |
|
|
@@@@:Wakaba |
14 |
|
|
@@@lang:ja |
15 |
|
|
@@@script:Latn |
16 |
|
|
@@Mail:w@suika.fam.cx |
17 |
wakaba |
1.6 |
@Date.RCS: |
18 |
|
|
$Date: 2004/02/08 08:49:05 $ |
19 |
wakaba |
1.4 |
@RequiredModule[list]: |
20 |
|
|
SuikaWiki::Output::HTTP |
21 |
|
|
@RequiredPlugin[list]: |
22 |
|
|
WikiLinking |
23 |
|
|
WikiResource |
24 |
wakaba |
1.1 |
|
25 |
|
|
ViewDefinition: |
26 |
|
|
@Mode: RandomJump |
27 |
|
|
@Condition: |
28 |
|
|
@@output: http-cgi |
29 |
wakaba |
1.2 |
@Description: |
30 |
|
|
@@@:Redirection to some WikiPage selected randomly |
31 |
|
|
@@lang:en |
32 |
wakaba |
1.1 |
@method: |
33 |
|
|
@@@: |
34 |
|
|
$self->{view}->init_db; |
35 |
|
|
my @list = $self->{view}->{wiki}->{db}->keys ('content'); |
36 |
wakaba |
1.2 |
|
37 |
wakaba |
1.4 |
my $uri = $self->{view}->{wiki}->uri_reference |
38 |
wakaba |
1.5 |
(page => $self->{view}->{wiki}->name ($list[rand @list]), |
39 |
wakaba |
1.4 |
up_to_date => 1); |
40 |
wakaba |
1.2 |
|
41 |
|
|
require SuikaWiki::Output::HTTP; |
42 |
|
|
my $output = SuikaWiki::Output::HTTP->new (wiki => $self->{view}->{wiki}); |
43 |
|
|
$output->set_redirect (uri => $uri, status_code => 303); |
44 |
|
|
$output->output (output => 'http-cgi'); |
45 |
wakaba |
1.1 |
@@Name: main |
46 |
wakaba |
1.2 |
|
47 |
|
|
ViewFragment: |
48 |
|
|
@Name: navbar |
49 |
|
|
@Description: |
50 |
|
|
@@@: "Go somewhere" button on navigation bar |
51 |
|
|
@@lang:en |
52 |
|
|
@Order: 110 |
53 |
|
|
@Formatting: |
54 |
wakaba |
1.3 |
%link-to-wikipage ( |
55 |
wakaba |
1.4 |
mode => RandomJump, up-to-date, |
56 |
wakaba |
1.3 |
rel => jump, |
57 |
|
|
label => {%link-to-it ( |
58 |
|
|
label => {%res (name => GoSomewhere);}p, |
59 |
|
|
description => {%res (name => GoSomewhereLong);}p, |
60 |
|
|
class => randomlink, |
61 |
|
|
);}, |
62 |
|
|
); |
63 |
wakaba |
1.2 |
|
64 |
|
|
ViewFragment: |
65 |
|
|
@Name: links |
66 |
|
|
@Description: |
67 |
|
|
@@@: "Go somewhere" link |
68 |
|
|
@@lang:en |
69 |
|
|
@Formatting: |
70 |
wakaba |
1.4 |
%link-wiki (mode => RandomJump, up-to-date, |
71 |
|
|
rel => jump, class => randomlink, |
72 |
|
|
description => {%res(name=>GoSomewhereLink);}p); |
73 |
wakaba |
1.2 |
|
74 |
|
|
Resource: |
75 |
|
|
@GoSomewhere: |
76 |
|
|
@@@: Lucky |
77 |
|
|
@@lang:en |
78 |
|
|
@GoSomewhereLink: |
79 |
|
|
@@@: Go somewhere in this wiki |
80 |
|
|
@@lang:en |
81 |
|
|
@GoSomewhereLong: |
82 |
|
|
@@@: Go somewhere in this wiki |
83 |
|
|
@@lang:en |