/[pub]/suikawiki/script/lib/SuikaWiki/Plugin/WikiFormText.wp2
Suika

Contents of /suikawiki/script/lib/SuikaWiki/Plugin/WikiFormText.wp2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (hide annotations) (download)
Mon Mar 29 03:22:30 2004 UTC (22 years, 4 months ago) by wakaba
Branch: MAIN
CVS Tags: release-3-0-0
Branch point for: paragraph-200404
Changes since 1.6: +8 -3 lines
+2004-03-29  Wakaba  <wakaba@suika.fam.cx>
+
+       * WikiEdit.wp2 (ViewDefinition[write]): Don't update content and
+       lastmodified if new content is actually not changed.
+
+       * WikiFormCore.wp2 (ViewDefinition[wikiform]): 'bbs__sage' parameter
+       implemented for WikiFormBBS WikiPlugin module.
+
+2004-03-24  Wakaba  <wakaba@suika.fam.cx>
+
+       * WikiFormCore.wp2 (ViewDefinition[wikiform]): Action name 'view'
+       is changed to 'ok'.
+       (required): Internal data structure is changed
+       from {form}->{require}->{ id } to {form}->{require}->{id}->{ id }.
+       * WikiFormText.wp2 (FormattingRule): s/{require}/{require}->{id}/g;
+
+2004-03-20  Wakaba  <wakaba@suika.fam.cx>
+
+       * WikiFormText.wp2 (FormattingRule[textarea]): Appends <br/> after
+       label.

1 wakaba 1.1 #?SuikaWikiConfig/2.0
2    
3     Plugin:
4     @Name: WikiFormText
5     @FullName:
6     WikiForm: Text input module
7     @Description:
8     This module provides text input fields of WikiForm implementation.
9 wakaba 1.6 @License: %%Perl%%
10 wakaba 1.1 @Author[list]:
11     Wakaba <[email protected]>
12 wakaba 1.6 @Date.RCS:
13 wakaba 1.7 $Date: 2004/02/14 10:56:11 $
14 wakaba 1.1 @RequiredModule[list]:
15     WikiFormCore
16    
17     PluginConst:
18     @NS_XHTML1:
19     http://www.w3.org/1999/xhtml
20    
21     FormattingRule:
22     @Category[list]:
23     form-input
24     @Name: text
25     @Description:
26     @@@@: Short text input (input[@type='text'])
27     @@@lang:en
28     @Formatting:
29 wakaba 1.3 __ATTRTEXT:%id__;__ATTRNODE:%label__;
30     my $id = SuikaWiki::Plugin->module_package ('WikiFormCore')
31     ->control_id ($o,
32     local_id => $p->{id},
33     require_local_id => 1);
34 wakaba 1.6 my $has_label = 0;
35 wakaba 1.3 if ($p->{label}->count) {
36 wakaba 1.6 $has_label = 1;
37 wakaba 1.1 for ($p->{-parent}->append_new_node
38     (type => '#element',
39     namespace_uri => $NS_XHTML1,
40     local_name => 'label')) {
41 wakaba 1.3 $_->set_attribute (for => $id->{global_id});
42     $_->append_node ($p->{label});
43 wakaba 1.1 }
44     }
45     for ($p->{-parent}->append_new_node
46     (type => '#element',
47     namespace_uri => $NS_XHTML1,
48     local_name => 'input')) {
49     $_->set_attribute (type => 'text');
50 wakaba 1.3 $_->set_attribute (name => $id->{local_id});
51 wakaba 1.6 $_->set_attribute (id => $id->{global_id}) if $has_label;
52 wakaba 1.3 __ATTRTEXT:%size__;__ATTRTEXT:%description__;
53 wakaba 1.1 $_->set_attribute (size => ($p->{size}||5)*2); ## Length
54     $_->set_attribute (title => $p->{description}) if $p->{description};
55 wakaba 1.5 $_->set_attribute (disabled => 'disabled') if $o->{form}->{disabled};
56 wakaba 1.1 __ATTRTEXT:%class__;
57     my @class = split /\s+/, $p->{class};
58 wakaba 1.7 push @class, 'require' if $o->{form}->{require}->{id}->{$p->{id}};
59 wakaba 1.1 $_->set_attribute (class => join ' ', @class) if @class;
60     $_->option (use_EmptyElemTag => 1);
61 wakaba 1.4 if ($p->{source}) {
62     $_->append_text ($o->{var}->{$p->{source}});
63 wakaba 1.3 } else {
64     __ATTRTEXT:%default__;
65     $_->set_attribute (value => $p->{default}); ## Default value
66     }
67 wakaba 1.1 }
68    
69     FormattingRule:
70 wakaba 1.4 @Category[list]: form-template
71     @Name: text
72     @Description:
73     @@@: Inputed text
74     @@lang:en
75     @Parameter:
76     @@Name: source
77     @@Type: ID
78     @@Default:(require)
79     @@Description:
80     @@@@: WikiForm control ID of the source field
81     @@@lang:en
82     @After:
83     $p->{-result} .= $o->{wiki}->{input}->parameter ('wikiform__'.$p->{source});
84    
85     FormattingRule:
86 wakaba 1.1 @Category[list]:
87     form-input
88     @Name: textarea
89     @Description:
90     @@@@: Multiline text input
91     @@@lang:en
92     @Formatting:
93 wakaba 1.3 __ATTRTEXT:%id__;__ATTRNODE:%label__;
94     my $id = SuikaWiki::Plugin->module_package ('WikiFormCore')
95     ->control_id ($o,
96     local_id => $p->{id},
97     require_local_id => 1);
98 wakaba 1.6 my $has_label = 0;
99 wakaba 1.3 if ($p->{label}->count) {
100 wakaba 1.6 $has_label = 1;
101 wakaba 1.3 for ($p->{-parent}->append_new_node
102     (type => '#element',
103     namespace_uri => $NS_XHTML1,
104     local_name => 'label')) {
105     $_->set_attribute (for => $id->{global_id});
106     $_->append_node ($p->{label});
107 wakaba 1.1 }
108 wakaba 1.7 $p->{-parent}->append_new_node
109     (type => '#element',
110     namespace_uri => $NS_XHTML1,
111     local_name => 'br')
112     ->option (use_EmptyElemTag => 1);
113 wakaba 1.1 }
114    
115 wakaba 1.2 for ($p->{-parent}->append_new_node (type => '#element',
116     namespace_uri => $NS_XHTML1,
117     local_name => 'textarea')) {
118 wakaba 1.3 $_->set_attribute (name => $id->{local_id});
119 wakaba 1.6 $_->set_attribute (id => $id->{global_id}) if $has_label;
120 wakaba 1.1 __ATTRTEXT:%size__;__ATTRTEXT:%lines__;__ATTRTEXT:%description__;
121     $_->set_attribute (cols => ($p->{size}||5)*2); ## Length
122     $_->set_attribute (rows => ($p->{lines}||5)); ## Lines
123     $_->set_attribute (title => $p->{description}) if $p->{description};
124 wakaba 1.3 $_->set_attribute (disabled => 'disabled') if $o->{form}->{disabled};
125 wakaba 1.1 __ATTRTEXT:%class__;
126     my @class = split /\s+/, $p->{class};
127 wakaba 1.7 push @class, 'require' if $o->{form}->{require}->{id}->{$p->{id}};
128 wakaba 1.1 $_->set_attribute (class => join ' ', @class) if @class;
129 wakaba 1.3 ## ISSUE: Can't we separate this into stylesheet?
130     if ($o->{wiki}->{var}->{client}->{user_agent_name}
131     =~ m#^Mozilla/[0-4]\.#) {
132 wakaba 1.1 $_->set_attribute (wrap => 'virtual');
133     }
134 wakaba 1.4 __ATTRTEXT:%source__;
135     if ($p->{source}) {
136     $_->append_text ($o->{var}->{$p->{source}});
137 wakaba 1.1 } else {
138     __ATTRTEXT:%default__;
139     $_->append_text ($p->{default}); ## Default value
140     }
141     }
142    

[email protected]
ViewVC Help
Powered by ViewVC 1.1.24