Filename | /var/www/foswiki11/lib/Foswiki/Plugins/JQueryPlugin/FOSWIKI.pm |
Statements | Executed 39 statements in 710µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 1.09ms | 1.24ms | BEGIN@7 | Foswiki::Plugins::JQueryPlugin::FOSWIKI::
1 | 1 | 1 | 74µs | 916µs | init | Foswiki::Plugins::JQueryPlugin::FOSWIKI::
1 | 1 | 1 | 33µs | 62µs | new | Foswiki::Plugins::JQueryPlugin::FOSWIKI::
1 | 1 | 1 | 19µs | 37µs | BEGIN@3 | Foswiki::Plugins::JQueryPlugin::FOSWIKI::
1 | 1 | 1 | 12µs | 20µs | BEGIN@4 | Foswiki::Plugins::JQueryPlugin::FOSWIKI::
1 | 1 | 1 | 10µs | 10µs | BEGIN@6 | Foswiki::Plugins::JQueryPlugin::FOSWIKI::
1 | 1 | 1 | 9µs | 9µs | BEGIN@5 | Foswiki::Plugins::JQueryPlugin::FOSWIKI::
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::FOSWIKI; | ||||
3 | 2 | 41µs | 2 | 54µs | # spent 37µs (19+18) within Foswiki::Plugins::JQueryPlugin::FOSWIKI::BEGIN@3 which was called:
# once (19µs+18µs) by Foswiki::Plugins::JQueryPlugin::Plugins::BEGIN@1 at line 3 # spent 37µs making 1 call to Foswiki::Plugins::JQueryPlugin::FOSWIKI::BEGIN@3
# spent 18µs making 1 call to strict::import |
4 | 2 | 32µs | 2 | 28µs | # spent 20µs (12+8) within Foswiki::Plugins::JQueryPlugin::FOSWIKI::BEGIN@4 which was called:
# once (12µs+8µs) by Foswiki::Plugins::JQueryPlugin::Plugins::BEGIN@1 at line 4 # spent 20µs making 1 call to Foswiki::Plugins::JQueryPlugin::FOSWIKI::BEGIN@4
# spent 8µs making 1 call to warnings::import |
5 | 2 | 32µs | 1 | 9µs | # spent 9µs within Foswiki::Plugins::JQueryPlugin::FOSWIKI::BEGIN@5 which was called:
# once (9µs+0s) by Foswiki::Plugins::JQueryPlugin::Plugins::BEGIN@1 at line 5 # spent 9µs making 1 call to Foswiki::Plugins::JQueryPlugin::FOSWIKI::BEGIN@5 |
6 | 2 | 42µs | 1 | 10µs | # spent 10µs within Foswiki::Plugins::JQueryPlugin::FOSWIKI::BEGIN@6 which was called:
# once (10µs+0s) by Foswiki::Plugins::JQueryPlugin::Plugins::BEGIN@1 at line 6 # spent 10µs making 1 call to Foswiki::Plugins::JQueryPlugin::FOSWIKI::BEGIN@6 |
7 | 2 | 440µs | 1 | 1.24ms | # spent 1.24ms (1.09+150µs) within Foswiki::Plugins::JQueryPlugin::FOSWIKI::BEGIN@7 which was called:
# once (1.09ms+150µs) by Foswiki::Plugins::JQueryPlugin::Plugins::BEGIN@1 at line 7 # spent 1.24ms making 1 call to Foswiki::Plugins::JQueryPlugin::FOSWIKI::BEGIN@7 |
8 | 1 | 10µs | our @ISA = qw( Foswiki::Plugins::JQueryPlugin::Plugin ); | ||
9 | |||||
10 | =begin TML | ||||
11 | |||||
12 | ---+ package Foswiki::Plugins::JQueryPlugin::FOSWIKI | ||||
13 | |||||
14 | This is the perl stub for the jquery.foswiki plugin. | ||||
15 | |||||
16 | =cut | ||||
17 | |||||
18 | =begin TML | ||||
19 | |||||
20 | ---++ ClassMethod new( $class, ... ) | ||||
21 | |||||
22 | Constructor | ||||
23 | |||||
24 | =cut | ||||
25 | |||||
26 | # spent 62µs (33+29) within Foswiki::Plugins::JQueryPlugin::FOSWIKI::new which was called:
# once (33µs+29µs) by Foswiki::Plugins::JQueryPlugin::Plugins::load at line 251 of /var/www/foswiki11/lib/Foswiki/Plugins/JQueryPlugin/Plugins.pm | ||||
27 | 1 | 700ns | my $class = shift; | ||
28 | |||||
29 | 1 | 26µs | 1 | 29µs | my $this = bless( # spent 29µs making 1 call to Foswiki::Plugins::JQueryPlugin::Plugin::new |
30 | $class->SUPER::new( | ||||
31 | name => 'Foswiki', | ||||
32 | version => '2.01', | ||||
33 | author => 'Michael Daum', | ||||
34 | homepage => 'http://foswiki.org/Extensions/JQueryPlugin', | ||||
35 | javascript => ['jquery.foswiki.js'], | ||||
36 | dependencies => | ||||
37 | [ 'JQUERYPLUGIN', 'JQUERYPLUGIN::MIGRATE', 'livequery' ], | ||||
38 | tags => 'JQTHEME, JQREQUIRE, JQICON, JQICONPATH, JQPLUGINS', | ||||
39 | ), | ||||
40 | $class | ||||
41 | ); | ||||
42 | |||||
43 | 1 | 5µs | return $this; | ||
44 | } | ||||
45 | |||||
46 | =begin TML | ||||
47 | |||||
48 | ---++ ClassMethod init( $this ) | ||||
49 | |||||
50 | Initialize this plugin by adding the required static files to the html header | ||||
51 | |||||
52 | =cut | ||||
53 | |||||
54 | # spent 916µs (74+842) within Foswiki::Plugins::JQueryPlugin::FOSWIKI::init which was called:
# once (74µs+842µs) by Foswiki::Plugins::JQueryPlugin::Plugins::createPlugin at line 115 of /var/www/foswiki11/lib/Foswiki/Plugins/JQueryPlugin/Plugins.pm | ||||
55 | 1 | 300ns | my $this = shift; | ||
56 | |||||
57 | 1 | 10µs | 1 | 688µs | return unless $this->SUPER::init(); # spent 688µs making 1 call to Foswiki::Plugins::JQueryPlugin::Plugin::init |
58 | |||||
59 | # get exported prefs | ||||
60 | 1 | 2µs | 1 | 63µs | my $prefs = Foswiki::Func::getPreferencesValue('EXPORTEDPREFERENCES') || ''; # spent 63µs making 1 call to Foswiki::Func::getPreferencesValue |
61 | |||||
62 | # try a little harder for foswiki engines < 1.1 | ||||
63 | 1 | 19µs | 1 | 12µs | if ( $Foswiki::Plugins::VERSION < 2.1 ) { # spent 12µs making 1 call to version::vxs::VCMP |
64 | |||||
65 | # defaults since foswiki >= 1.1.0 | ||||
66 | $prefs = | ||||
67 | 'PUBURL, PUBURLPATH, SCRIPTSUFFIX, SCRIPTURL, SCRIPTURLPATH, SERVERTIME, SKIN, SYSTEMWEB, TOPIC, USERNAME, USERSWEB, WEB, WIKINAME, WIKIUSERNAME, NAMEFILTER'; | ||||
68 | $prefs .= ', TWISTYANIMATIONSPEED' | ||||
69 | if $Foswiki::cfg{Plugins}{TwistyPlugin} | ||||
70 | {Enabled}; # can't use context during init | ||||
71 | } | ||||
72 | |||||
73 | # init NAMEFILTER | ||||
74 | 1 | 2µs | 1 | 54µs | unless ( Foswiki::Func::getPreferencesValue('NAMEFILTER') ) { # spent 54µs making 1 call to Foswiki::Func::getPreferencesValue |
75 | Foswiki::Func::setPreferencesValue( 'NAMEFILTER', | ||||
76 | $Foswiki::cfg{NameFilter} ); | ||||
77 | } | ||||
78 | |||||
79 | # add exported preferences to head | ||||
80 | 1 | 700ns | my @prefs = (); | ||
81 | 1 | 15µs | foreach my $pref ( split( /\s*,\s*/, $prefs ) ) { | ||
82 | 15 | 14µs | push @prefs, | ||
83 | ' "' . $pref . '": "%ENCODE{"%' . $pref . '%" type="quote"}%"'; | ||||
84 | } | ||||
85 | 1 | 7µs | my $text = | ||
86 | "<script type='text/javascript'>\njQuery.extend(foswiki, {\n \"preferences\": {\n" | ||||
87 | . join( ",\n", @prefs ) | ||||
88 | . "\n}});\n</script>"; | ||||
89 | |||||
90 | 1 | 7µs | 1 | 25µs | Foswiki::Func::addToZone( "script", "JQUERYPLUGIN::FOSWIKI::PREFERENCES", # spent 25µs making 1 call to Foswiki::Func::addToZone |
91 | $text, "JQUERYPLUGIN::FOSWIKI" ); | ||||
92 | } | ||||
93 | |||||
94 | 1 | 4µs | 1; | ||
95 | __END__ |