Filename | /var/www/foswiki11/lib/Foswiki/Plugins/JQueryPlugin.pm |
Statements | Executed 37 statements in 1.54ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 1.25ms | 1.30ms | BEGIN@15 | Foswiki::Plugins::JQueryPlugin::
1 | 1 | 1 | 101µs | 4.42ms | initPlugin | Foswiki::Plugins::JQueryPlugin::
1 | 1 | 1 | 19µs | 94µs | handleJQueryTheme | Foswiki::Plugins::JQueryPlugin::
1 | 1 | 1 | 15µs | 142µs | finishPlugin | Foswiki::Plugins::JQueryPlugin::
1 | 1 | 1 | 14µs | 27µs | BEGIN@3 | Foswiki::Plugins::JQueryPlugin::
1 | 1 | 1 | 13µs | 19µs | BEGIN@4 | Foswiki::Plugins::JQueryPlugin::
1 | 1 | 1 | 10µs | 75µs | createTheme | Foswiki::Plugins::JQueryPlugin::
1 | 1 | 1 | 6µs | 19µs | registerPlugin | Foswiki::Plugins::JQueryPlugin::
1 | 1 | 1 | 4µs | 4µs | BEGIN@14 | Foswiki::Plugins::JQueryPlugin::
0 | 0 | 0 | 0s | 0s | createPlugin | Foswiki::Plugins::JQueryPlugin::
0 | 0 | 0 | 0s | 0s | handleButton | Foswiki::Plugins::JQueryPlugin::
0 | 0 | 0 | 0s | 0s | handleEndTab | Foswiki::Plugins::JQueryPlugin::
0 | 0 | 0 | 0s | 0s | handleEndTabPane | Foswiki::Plugins::JQueryPlugin::
0 | 0 | 0 | 0s | 0s | handleJQueryIcon | Foswiki::Plugins::JQueryPlugin::
0 | 0 | 0 | 0s | 0s | handleJQueryIconPath | Foswiki::Plugins::JQueryPlugin::
0 | 0 | 0 | 0s | 0s | handleJQueryPlugins | Foswiki::Plugins::JQueryPlugin::
0 | 0 | 0 | 0s | 0s | handleJQueryRequire | Foswiki::Plugins::JQueryPlugin::
0 | 0 | 0 | 0s | 0s | handlePopUpWindow | Foswiki::Plugins::JQueryPlugin::
0 | 0 | 0 | 0s | 0s | handleTab | Foswiki::Plugins::JQueryPlugin::
0 | 0 | 0 | 0s | 0s | handleTabPane | Foswiki::Plugins::JQueryPlugin::
0 | 0 | 0 | 0s | 0s | handleToggle | Foswiki::Plugins::JQueryPlugin::
0 | 0 | 0 | 0s | 0s | registerTheme | Foswiki::Plugins::JQueryPlugin::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | # See bottom of file for license and copyright information | ||||
2 | package Foswiki::Plugins::JQueryPlugin; | ||||
3 | 2 | 29µs | 2 | 41µs | # spent 27µs (14+14) within Foswiki::Plugins::JQueryPlugin::BEGIN@3 which was called:
# once (14µs+14µs) by Foswiki::Plugin::BEGIN@2.20 at line 3 # spent 27µs making 1 call to Foswiki::Plugins::JQueryPlugin::BEGIN@3
# spent 14µs making 1 call to strict::import |
4 | 2 | 31µs | 2 | 24µs | # spent 19µs (13+6) within Foswiki::Plugins::JQueryPlugin::BEGIN@4 which was called:
# once (13µs+6µs) by Foswiki::Plugin::BEGIN@2.20 at line 4 # spent 19µs making 1 call to Foswiki::Plugins::JQueryPlugin::BEGIN@4
# spent 6µs making 1 call to warnings::import |
5 | |||||
6 | =begin TML | ||||
7 | |||||
8 | ---+ package Foswiki::Plugins::JQueryPlugin | ||||
9 | |||||
10 | Container for jQuery and plugins | ||||
11 | |||||
12 | =cut | ||||
13 | |||||
14 | 2 | 20µs | 1 | 4µs | # spent 4µs within Foswiki::Plugins::JQueryPlugin::BEGIN@14 which was called:
# once (4µs+0s) by Foswiki::Plugin::BEGIN@2.20 at line 14 # spent 4µs making 1 call to Foswiki::Plugins::JQueryPlugin::BEGIN@14 |
15 | 2 | 1.34ms | 1 | 1.30ms | # spent 1.30ms (1.25+45µs) within Foswiki::Plugins::JQueryPlugin::BEGIN@15 which was called:
# once (1.25ms+45µs) by Foswiki::Plugin::BEGIN@2.20 at line 15 # spent 1.30ms making 1 call to Foswiki::Plugins::JQueryPlugin::BEGIN@15 |
16 | |||||
17 | 1 | 600ns | our $VERSION = '4.91'; | ||
18 | 1 | 100ns | our $RELEASE = '4.91'; | ||
19 | 1 | 200ns | our $SHORTDESCRIPTION = 'jQuery <nop>JavaScript library for Foswiki'; | ||
20 | 1 | 200ns | our $NO_PREFS_IN_TOPIC = 1; | ||
21 | |||||
22 | =begin TML | ||||
23 | |||||
24 | ---++ initPlugin($topic, $web, $user) -> $boolean | ||||
25 | |||||
26 | =cut | ||||
27 | |||||
28 | # spent 4.42ms (101µs+4.31) within Foswiki::Plugins::JQueryPlugin::initPlugin which was called:
# once (101µs+4.31ms) by Foswiki::Plugin::__ANON__[/var/www/foswiki11/lib/Foswiki/Plugin.pm:241] at line 234 of /var/www/foswiki11/lib/Foswiki/Plugin.pm | ||||
29 | 1 | 2µs | my ( $topic, $web, $user ) = @_; | ||
30 | |||||
31 | # check for prerequisites | ||||
32 | 1 | 800ns | unless ( defined(&Foswiki::Func::addToZone) ) { | ||
33 | Foswiki::Func::writeWarning( | ||||
34 | "ZonePlugin not installed/enabled...disabling JQueryPlugin"); | ||||
35 | return 0; | ||||
36 | } | ||||
37 | |||||
38 | 1 | 11µs | 1 | 31µs | Foswiki::Func::registerTagHandler( 'JQTHEME', \&handleJQueryTheme ); # spent 31µs making 1 call to Foswiki::Func::registerTagHandler |
39 | 1 | 4µs | 1 | 23µs | Foswiki::Func::registerTagHandler( 'JQREQUIRE', \&handleJQueryRequire ); # spent 23µs making 1 call to Foswiki::Func::registerTagHandler |
40 | 1 | 4µs | 1 | 22µs | Foswiki::Func::registerTagHandler( 'JQICON', \&handleJQueryIcon ); # spent 22µs making 1 call to Foswiki::Func::registerTagHandler |
41 | 1 | 3µs | 1 | 21µs | Foswiki::Func::registerTagHandler( 'JQICONPATH', \&handleJQueryIconPath ); # spent 21µs making 1 call to Foswiki::Func::registerTagHandler |
42 | 1 | 4µs | 1 | 22µs | Foswiki::Func::registerTagHandler( 'JQPLUGINS', \&handleJQueryPlugins ); # spent 22µs making 1 call to Foswiki::Func::registerTagHandler |
43 | |||||
44 | # jquery.tabpane | ||||
45 | 1 | 4µs | 1 | 22µs | Foswiki::Func::registerTagHandler( 'TABPANE', \&handleTabPane ); # spent 22µs making 1 call to Foswiki::Func::registerTagHandler |
46 | 1 | 3µs | 1 | 20µs | Foswiki::Func::registerTagHandler( 'ENDTABPANE', \&handleEndTabPane ); # spent 20µs making 1 call to Foswiki::Func::registerTagHandler |
47 | 1 | 2µs | 1 | 20µs | Foswiki::Func::registerTagHandler( 'TAB', \&handleTab ); # spent 20µs making 1 call to Foswiki::Func::registerTagHandler |
48 | 1 | 2µs | 1 | 21µs | Foswiki::Func::registerTagHandler( 'ENDTAB', \&handleEndTab ); # spent 21µs making 1 call to Foswiki::Func::registerTagHandler |
49 | |||||
50 | # jquery.button | ||||
51 | 1 | 4µs | 1 | 21µs | Foswiki::Func::registerTagHandler( 'BUTTON', \&handleButton ); # spent 21µs making 1 call to Foswiki::Func::registerTagHandler |
52 | |||||
53 | # jquery.popupwindow | ||||
54 | 1 | 2µs | 1 | 23µs | Foswiki::Func::registerTagHandler( 'POPUPWINDOW', \&handlePopUpWindow ); # spent 23µs making 1 call to Foswiki::Func::registerTagHandler |
55 | |||||
56 | # init plugin handler and preload default plugins | ||||
57 | 1 | 4µs | 1 | 4.06ms | Foswiki::Plugins::JQueryPlugin::Plugins::init(); # spent 4.06ms making 1 call to Foswiki::Plugins::JQueryPlugin::Plugins::init |
58 | |||||
59 | # backwards compatibility | ||||
60 | 1 | 21µs | 1 | 13µs | if ( $Foswiki::Plugins::VERSION < 2.1 ) { # spent 13µs making 1 call to version::vxs::VCMP |
61 | Foswiki::Func::setPreferencesValue( "CLEAR", | ||||
62 | "<span class='foswikiClear'></span>" ); | ||||
63 | } | ||||
64 | |||||
65 | 1 | 6µs | return 1; | ||
66 | } | ||||
67 | |||||
68 | =begin TML | ||||
69 | |||||
70 | finish up the plugins container | ||||
71 | |||||
72 | =cut | ||||
73 | |||||
74 | # spent 142µs (15+128) within Foswiki::Plugins::JQueryPlugin::finishPlugin which was called:
# once (15µs+128µs) by Foswiki::Plugin::invoke at line 294 of /var/www/foswiki11/lib/Foswiki/Plugin.pm | ||||
75 | 1 | 9µs | 1 | 128µs | Foswiki::Plugins::JQueryPlugin::Plugins::finish(); # spent 128µs making 1 call to Foswiki::Plugins::JQueryPlugin::Plugins::finish |
76 | } | ||||
77 | |||||
78 | =begin TML | ||||
79 | |||||
80 | ---++ createPlugin($pluginName, ...) -> $plugin | ||||
81 | |||||
82 | API to create a jQuery plugin. Instantiating it adds all required javascript | ||||
83 | and css files to the html page header. | ||||
84 | |||||
85 | =cut | ||||
86 | |||||
87 | sub createPlugin { | ||||
88 | return Foswiki::Plugins::JQueryPlugin::Plugins::createPlugin(@_); | ||||
89 | } | ||||
90 | |||||
91 | =begin TML | ||||
92 | |||||
93 | ---++ createTheme($themeName) -> $boolean | ||||
94 | |||||
95 | API to load a jQuery UI theme. Returns true if the theme has | ||||
96 | been loaded successfully. | ||||
97 | |||||
98 | =cut | ||||
99 | |||||
100 | # spent 75µs (10+65) within Foswiki::Plugins::JQueryPlugin::createTheme which was called:
# once (10µs+65µs) by Foswiki::Plugins::JQueryPlugin::handleJQueryTheme at line 283 | ||||
101 | 1 | 12µs | 1 | 65µs | return Foswiki::Plugins::JQueryPlugin::Plugins::createTheme(@_); # spent 65µs making 1 call to Foswiki::Plugins::JQueryPlugin::Plugins::createTheme |
102 | } | ||||
103 | |||||
104 | =begin TML | ||||
105 | |||||
106 | ---++ registerPlugin($pluginName, $class) -> $plugin | ||||
107 | |||||
108 | API to register a jQuery plugin. this is of use for other Foswiki plugins | ||||
109 | to register their javascript modules as a jQuery plugin. Registering a plugin 'foobar' | ||||
110 | will make it available via =%<nop>JQREQUIRE{"foobar"}%=. | ||||
111 | |||||
112 | Class will default to 'Foswiki::Plugins::JQueryPlugin::FOOBAR, | ||||
113 | |||||
114 | The FOOBAR.pm stub must be derived from Foswiki::Plugins::JQueryPlugin::PLUGIN class. | ||||
115 | |||||
116 | =cut | ||||
117 | |||||
118 | # spent 19µs (6+13) within Foswiki::Plugins::JQueryPlugin::registerPlugin which was called:
# once (6µs+13µs) by Foswiki::Plugins::TwistyPlugin::initPlugin at line 47 of /var/www/foswiki11/lib/Foswiki/Plugins/TwistyPlugin.pm | ||||
119 | 1 | 6µs | 1 | 12µs | return Foswiki::Plugins::JQueryPlugin::Plugins::registerPlugin(@_); # spent 12µs making 1 call to Foswiki::Plugins::JQueryPlugin::Plugins::registerPlugin |
120 | } | ||||
121 | |||||
122 | =begin TML | ||||
123 | |||||
124 | ---++ registerTheme($themeName, $url) | ||||
125 | |||||
126 | API to register a jQuery theme. this is of use for other Foswiki plugins | ||||
127 | to register their theme. Registering a theme 'foobar' | ||||
128 | will make it available via =%<nop>JQTHEME{"foobar"}%=. | ||||
129 | |||||
130 | The =$url= parameter will default to '%PUBURLPATH%/%SYSTEMWEB%/JQueryPlugin/ui/$themeName/jquery-ui.css'. | ||||
131 | |||||
132 | =cut | ||||
133 | |||||
134 | sub registerTheme { | ||||
135 | return Foswiki::Plugins::JQueryPlugin::Plugins::registerTheme(@_); | ||||
136 | } | ||||
137 | |||||
138 | =begin TML | ||||
139 | |||||
140 | ---++ handleButton($session, $params, $topic, $web) -> $result | ||||
141 | |||||
142 | Handles the =%<nop>BUTTON% tag. | ||||
143 | |||||
144 | =cut | ||||
145 | |||||
146 | sub handleButton { | ||||
147 | my $session = shift; | ||||
148 | my $plugin = createPlugin( 'Button', $session ); | ||||
149 | return $plugin->handleButton(@_) if $plugin; | ||||
150 | return ''; | ||||
151 | } | ||||
152 | |||||
153 | =begin TML | ||||
154 | |||||
155 | ---++ handlePopUpWindow($session, $params, $topic, $web) -> $result | ||||
156 | |||||
157 | Handles the =%<nop>POPUPWINDOW% tag. | ||||
158 | |||||
159 | =cut | ||||
160 | |||||
161 | sub handlePopUpWindow { | ||||
162 | my $session = shift; | ||||
163 | my $plugin = createPlugin( 'PopUpWindow', $session ); | ||||
164 | return $plugin->handlePopUpWindow(@_) if $plugin; | ||||
165 | return ''; | ||||
166 | } | ||||
167 | |||||
168 | =begin TML | ||||
169 | |||||
170 | ---++ handleToggle($session, $params, $topic, $web) -> $result | ||||
171 | |||||
172 | Handles the =%<nop>TOGGLE% tag. | ||||
173 | |||||
174 | =cut | ||||
175 | |||||
176 | sub handleToggle { | ||||
177 | my $session = shift; | ||||
178 | my $plugin = createPlugin( 'Toggle', $session ); | ||||
179 | return $plugin->handleToggle(@_) if $plugin; | ||||
180 | return ''; | ||||
181 | } | ||||
182 | |||||
183 | =begin TML | ||||
184 | |||||
185 | ---++ handleTabPane($session, $params, $topic, $web) -> $result | ||||
186 | |||||
187 | Handles the =%<nop>TABPANE% tag. | ||||
188 | |||||
189 | =cut | ||||
190 | |||||
191 | sub handleTabPane { | ||||
192 | my $session = shift; | ||||
193 | my $plugin = createPlugin( 'Tabpane', $session ); | ||||
194 | return $plugin->handleTabPane(@_) if $plugin; | ||||
195 | return ''; | ||||
196 | } | ||||
197 | |||||
198 | =begin TML | ||||
199 | |||||
200 | ---++ handleTab($session, $params, $topic, $web) -> $result | ||||
201 | |||||
202 | Handles the =%<nop>TAB% tag. | ||||
203 | |||||
204 | =cut | ||||
205 | |||||
206 | sub handleTab { | ||||
207 | my $session = shift; | ||||
208 | my $plugin = createPlugin( 'Tabpane', $session ); | ||||
209 | return $plugin->handleTab(@_) if $plugin; | ||||
210 | return ''; | ||||
211 | } | ||||
212 | |||||
213 | =begin TML | ||||
214 | |||||
215 | ---++ handleEndTab($session, $params, $topic, $web) -> $result | ||||
216 | |||||
217 | Handles the =%<nop>ENDTAB% tag. | ||||
218 | |||||
219 | =cut | ||||
220 | |||||
221 | sub handleEndTab { | ||||
222 | my $session = shift; | ||||
223 | my $plugin = createPlugin( 'Tabpane', $session ); | ||||
224 | return $plugin->handleEndTab(@_) if $plugin; | ||||
225 | return ''; | ||||
226 | } | ||||
227 | |||||
228 | =begin TML | ||||
229 | |||||
230 | ---++ handleEndTabPane($session, $params, $topic, $web) -> $result | ||||
231 | |||||
232 | Handles the =%<nop>ENDTABPANE% tag. | ||||
233 | |||||
234 | =cut | ||||
235 | |||||
236 | sub handleEndTabPane { | ||||
237 | my $session = shift; | ||||
238 | my $plugin = createPlugin( 'Tabpane', $session ); | ||||
239 | return $plugin->handleEndTabPane(@_) if $plugin; | ||||
240 | return ''; | ||||
241 | } | ||||
242 | |||||
243 | =begin TML | ||||
244 | |||||
245 | ---++ handleJQueryRequire($session, $params, $topic, $web) -> $result | ||||
246 | |||||
247 | Handles the =%<nop>JQREQUIRE% tag. | ||||
248 | |||||
249 | =cut | ||||
250 | |||||
251 | sub handleJQueryRequire { | ||||
252 | my ( $session, $params, $theTopic, $theWeb ) = @_; | ||||
253 | |||||
254 | my $plugins = $params->{_DEFAULT} || ''; | ||||
255 | my $warn = Foswiki::Func::isTrue( $params->{warn}, 1 ); | ||||
256 | my $errorMsg = ''; | ||||
257 | foreach my $pluginName ( split( /\s*,\s*/, $plugins ) ) { | ||||
258 | my $plugin = createPlugin( $pluginName, $session ); | ||||
259 | $errorMsg .= | ||||
260 | "<div class='foswikiAlert'>Error: no such plugin $pluginName</div>" | ||||
261 | if !$plugin && $warn; | ||||
262 | } | ||||
263 | |||||
264 | return $errorMsg; | ||||
265 | } | ||||
266 | |||||
267 | =begin TML | ||||
268 | |||||
269 | ---++ handleJQueryTheme($session, $params, $topic, $web) -> $result | ||||
270 | |||||
271 | Handles the =%<nop>JQTHEME% tag. | ||||
272 | |||||
273 | =cut | ||||
274 | |||||
275 | # spent 94µs (19+75) within Foswiki::Plugins::JQueryPlugin::handleJQueryTheme which was called:
# once (19µs+75µs) by Foswiki::Func::__ANON__[/var/www/foswiki11/lib/Foswiki/Func.pm:611] at line 609 of /var/www/foswiki11/lib/Foswiki/Func.pm | ||||
276 | 1 | 2µs | my ( $session, $params, $theTopic, $theWeb ) = @_; | ||
277 | |||||
278 | 1 | 2µs | my $themeName = $params->{_DEFAULT} | ||
279 | || $Foswiki::cfg{JQueryPlugin}{JQueryTheme}; | ||||
280 | |||||
281 | 1 | 900ns | my $warn = $params->{warn} || ''; | ||
282 | |||||
283 | 1 | 4µs | 1 | 75µs | return "<div class='foswikiAlert'>Error: no such theme $themeName</div>" # spent 75µs making 1 call to Foswiki::Plugins::JQueryPlugin::createTheme |
284 | if !createTheme($themeName) && $warn ne 'off'; | ||||
285 | |||||
286 | 1 | 6µs | return ''; | ||
287 | } | ||||
288 | |||||
289 | =begin TML | ||||
290 | |||||
291 | ---++ handleJQueryIconPath($session, $params, $topic, $web) -> $result | ||||
292 | |||||
293 | Handles the =%<nop>JQICONPATH% tag. | ||||
294 | |||||
295 | =cut | ||||
296 | |||||
297 | sub handleJQueryIconPath { | ||||
298 | my ( $session, $params, $theTopic, $theWeb ) = @_; | ||||
299 | |||||
300 | my $iconName = $params->{_DEFAULT} || ''; | ||||
301 | return Foswiki::Plugins::JQueryPlugin::Plugins::getIconUrlPath($iconName); | ||||
302 | } | ||||
303 | |||||
304 | =begin TML | ||||
305 | |||||
306 | ---++ handleJQueryIcon($session, $params, $topic, $web) -> $result | ||||
307 | |||||
308 | Handles the =%<nop>JQICON% tag. | ||||
309 | |||||
310 | =cut | ||||
311 | |||||
312 | sub handleJQueryIcon { | ||||
313 | my ( $session, $params, $theTopic, $theWeb ) = @_; | ||||
314 | |||||
315 | my $iconName = $params->{_DEFAULT} || ''; | ||||
316 | my $iconAlt = $params->{alt} || $iconName; | ||||
317 | my $iconTitle = $params->{title} || ''; | ||||
318 | my $iconFormat = $params->{format} | ||||
319 | || '<img src=\'$iconPath\' class=\'$iconClass\' $iconAlt$iconTitle/>'; | ||||
320 | my $iconPath = | ||||
321 | Foswiki::Plugins::JQueryPlugin::Plugins::getIconUrlPath($iconName); | ||||
322 | |||||
323 | return '' unless $iconPath; | ||||
324 | |||||
325 | my $iconClass = "foswikiIcon jqIcon"; | ||||
326 | $iconClass .= " $params->{class}" if $params->{class}; | ||||
327 | |||||
328 | my $img = $iconFormat; | ||||
329 | $img =~ s/\$iconPath/$iconPath/g; | ||||
330 | $img =~ s/\$iconClass/$iconClass/g; | ||||
331 | $img =~ s/\$iconAlt/alt='$iconAlt' /g if $iconAlt; | ||||
332 | $img =~ s/\$iconTitle/title='$iconTitle' /g if $iconTitle; | ||||
333 | $img =~ s/\$(iconAlt|iconTitle)//go; | ||||
334 | |||||
335 | return $img; | ||||
336 | } | ||||
337 | |||||
338 | =begin TML | ||||
339 | |||||
340 | ---++ handleJQueryPlugins($session, $params, $topic, $web) -> $result | ||||
341 | |||||
342 | Handles the =%<nop>JQPLUGINS% tag. | ||||
343 | |||||
344 | =cut | ||||
345 | |||||
346 | sub handleJQueryPlugins { | ||||
347 | my ( $session, $params, $theTopic, $theWeb ) = @_; | ||||
348 | |||||
349 | my $thePlugin = $params->{_DEFAULT} || ''; | ||||
350 | my $theFormat = $params->{format}; | ||||
351 | my $theHeader = $params->{header} || ''; | ||||
352 | my $theFooter = $params->{footer} || ''; | ||||
353 | my $theSeparator = $params->{separator}; | ||||
354 | my $theTagFormat = $params->{tagformat}; | ||||
355 | |||||
356 | $theFormat = ' 1 <a href="$homepage">$name</a> $active $version $author' | ||||
357 | unless defined $theFormat; | ||||
358 | $theSeparator = '$n' | ||||
359 | unless defined $theSeparator; | ||||
360 | $theTagFormat = '[[%SYSTEMWEB%.Var$tag][$tag]]' | ||||
361 | unless defined $theTagFormat; | ||||
362 | |||||
363 | my @plugins = | ||||
364 | Foswiki::Plugins::JQueryPlugin::Plugins::getPlugins($thePlugin); | ||||
365 | |||||
366 | my @result; | ||||
367 | my $counter = 0; | ||||
368 | foreach my $plugin (@plugins) { | ||||
369 | my $summary = $plugin->getSummary(); | ||||
370 | $summary =~ s/^\s+//; | ||||
371 | $summary =~ s/\s+$//; | ||||
372 | my $tags = ''; | ||||
373 | if ( $theFormat =~ /\$tags/ ) { | ||||
374 | my @tags = (); | ||||
375 | foreach my $tag ( sort split( /\s*,\s*/, $plugin->{tags} ) ) { | ||||
376 | my $line = $theTagFormat; | ||||
377 | $line =~ s/\$tag/$tag/g; | ||||
378 | push @tags, $line if $line; | ||||
379 | } | ||||
380 | $tags = join( ', ', @tags ); | ||||
381 | } | ||||
382 | my $active = | ||||
383 | defined( $plugin->{isInit} ) | ||||
384 | ? '<span class="foswikiAlert">(active)</span>' | ||||
385 | : ''; | ||||
386 | my $line = Foswiki::Plugins::JQueryPlugin::Plugins::expandVariables( | ||||
387 | $theFormat, | ||||
388 | 'index' => ( $counter + 1 ), | ||||
389 | name => $plugin->{name}, | ||||
390 | version => $plugin->{version}, | ||||
391 | summary => $summary, | ||||
392 | documentation => $plugin->{documentation}, | ||||
393 | author => $plugin->{author}, | ||||
394 | homepage => $plugin->{homepage}, | ||||
395 | tags => $tags, | ||||
396 | active => $active, | ||||
397 | ); | ||||
398 | next unless $line; | ||||
399 | push @result, $line; | ||||
400 | $counter++; | ||||
401 | } | ||||
402 | |||||
403 | $theHeader = | ||||
404 | Foswiki::Plugins::JQueryPlugin::Plugins::expandVariables( $theHeader, | ||||
405 | counter => $counter, ); | ||||
406 | $theFooter = | ||||
407 | Foswiki::Plugins::JQueryPlugin::Plugins::expandVariables( $theFooter, | ||||
408 | counter => $counter, ); | ||||
409 | $theSeparator = | ||||
410 | Foswiki::Plugins::JQueryPlugin::Plugins::expandVariables($theSeparator); | ||||
411 | |||||
412 | return $theHeader . join( $theSeparator, @result ) . $theFooter; | ||||
413 | } | ||||
414 | |||||
415 | 1 | 4µs | 1; | ||
416 | __END__ |