Filename | /var/www/foswikidev/core/lib/Foswiki/Plugins/JQueryPlugin/FOSWIKI.pm |
Statements | Executed 55 statements in 544µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
2 | 1 | 1 | 83µs | 771µs | init | Foswiki::Plugins::JQueryPlugin::FOSWIKI::
1 | 1 | 1 | 23µs | 45µs | new | Foswiki::Plugins::JQueryPlugin::FOSWIKI::
1 | 1 | 1 | 16µs | 30µs | BEGIN@3 | Foswiki::Plugins::JQueryPlugin::FOSWIKI::
1 | 1 | 1 | 10µs | 14µs | BEGIN@4 | Foswiki::Plugins::JQueryPlugin::FOSWIKI::
1 | 1 | 1 | 8µs | 8µs | BEGIN@6 | Foswiki::Plugins::JQueryPlugin::FOSWIKI::
1 | 1 | 1 | 8µs | 8µs | BEGIN@7 | Foswiki::Plugins::JQueryPlugin::FOSWIKI::
1 | 1 | 1 | 7µs | 7µ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 | 33µs | 2 | 44µs | # spent 30µs (16+14) within Foswiki::Plugins::JQueryPlugin::FOSWIKI::BEGIN@3 which was called:
# once (16µs+14µs) by Foswiki::Plugins::JQueryPlugin::Plugins::BEGIN@1.44 at line 3 # spent 30µs making 1 call to Foswiki::Plugins::JQueryPlugin::FOSWIKI::BEGIN@3
# spent 14µs making 1 call to strict::import |
4 | 2 | 30µs | 2 | 18µs | # spent 14µs (10+4) within Foswiki::Plugins::JQueryPlugin::FOSWIKI::BEGIN@4 which was called:
# once (10µs+4µs) by Foswiki::Plugins::JQueryPlugin::Plugins::BEGIN@1.44 at line 4 # spent 14µs making 1 call to Foswiki::Plugins::JQueryPlugin::FOSWIKI::BEGIN@4
# spent 4µs making 1 call to warnings::import |
5 | 2 | 24µs | 1 | 7µs | # spent 7µs within Foswiki::Plugins::JQueryPlugin::FOSWIKI::BEGIN@5 which was called:
# once (7µs+0s) by Foswiki::Plugins::JQueryPlugin::Plugins::BEGIN@1.44 at line 5 # spent 7µs making 1 call to Foswiki::Plugins::JQueryPlugin::FOSWIKI::BEGIN@5 |
6 | 2 | 27µs | 1 | 8µs | # spent 8µs within Foswiki::Plugins::JQueryPlugin::FOSWIKI::BEGIN@6 which was called:
# once (8µs+0s) by Foswiki::Plugins::JQueryPlugin::Plugins::BEGIN@1.44 at line 6 # spent 8µs making 1 call to Foswiki::Plugins::JQueryPlugin::FOSWIKI::BEGIN@6 |
7 | 2 | 312µs | 1 | 8µs | # spent 8µs within Foswiki::Plugins::JQueryPlugin::FOSWIKI::BEGIN@7 which was called:
# once (8µs+0s) by Foswiki::Plugins::JQueryPlugin::Plugins::BEGIN@1.44 at line 7 # spent 8µs making 1 call to Foswiki::Plugins::JQueryPlugin::FOSWIKI::BEGIN@7 |
8 | 1 | 8µ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 45µs (23+22) within Foswiki::Plugins::JQueryPlugin::FOSWIKI::new which was called:
# once (23µs+22µs) by Foswiki::Plugins::JQueryPlugin::Plugins::load at line 290 of /var/www/foswikidev/core/lib/Foswiki/Plugins/JQueryPlugin/Plugins.pm | ||||
27 | 1 | 500ns | my $class = shift; | ||
28 | |||||
29 | 1 | 18µs | 1 | 22µs | my $this = bless( # spent 22µs making 1 call to Foswiki::Plugins::JQueryPlugin::Plugin::new |
30 | $class->SUPER::new( | ||||
31 | name => 'Foswiki', | ||||
32 | version => '2.02', | ||||
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 | 3µ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 771µs (83+688) within Foswiki::Plugins::JQueryPlugin::FOSWIKI::init which was called 2 times, avg 385µs/call:
# 2 times (83µs+688µs) by Foswiki::Plugins::JQueryPlugin::Plugins::createPlugin at line 151 of /var/www/foswikidev/core/lib/Foswiki/Plugins/JQueryPlugin/Plugins.pm, avg 385µs/call | ||||
55 | 2 | 700ns | my $this = shift; | ||
56 | |||||
57 | 2 | 18µs | 2 | 551µs | return unless $this->SUPER::init(); # spent 553µs making 2 calls to Foswiki::Plugins::JQueryPlugin::Plugin::init, avg 277µs/call, recursion: max depth 1, sum of overlapping time 2µs |
58 | |||||
59 | # get exported prefs | ||||
60 | 1 | 2µs | 1 | 52µs | my $prefs = Foswiki::Func::getPreferencesValue('EXPORTEDPREFERENCES') || ''; # spent 52µs making 1 call to Foswiki::Func::getPreferencesValue |
61 | |||||
62 | # try a little harder for foswiki engines < 1.1 | ||||
63 | 1 | 17µs | 1 | 10µs | if ( $Foswiki::Plugins::VERSION < 2.1 ) { # spent 10µ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 | |||||
74 | # init NAMEFILTER | ||||
75 | 1 | 2µs | 1 | 40µs | unless ( Foswiki::Func::getPreferencesValue('NAMEFILTER') ) { # spent 40µs making 1 call to Foswiki::Func::getPreferencesValue |
76 | Foswiki::Func::setPreferencesValue( 'NAMEFILTER', | ||||
77 | $Foswiki::cfg{NameFilter} ); | ||||
78 | } | ||||
79 | |||||
80 | # add exported preferences to head | ||||
81 | 1 | 500ns | my @prefs = (); | ||
82 | 1 | 15µs | foreach my $pref ( split( /\s*,\s*/, $prefs ) ) { | ||
83 | 15 | 9µs | if ( $pref eq 'NAMEFILTER' ) { | ||
84 | push @prefs, | ||||
85 | ' "' | ||||
86 | . $pref | ||||
87 | . '": /%ENCODE{"%' | ||||
88 | . $pref | ||||
89 | . '%" type="quote"}%/g'; | ||||
90 | } | ||||
91 | else { | ||||
92 | 14 | 12µs | push @prefs, | ||
93 | ' "' . $pref . '": "%ENCODE{"%' . $pref . '%" type="quote"}%"'; | ||||
94 | } | ||||
95 | } | ||||
96 | 1 | 3µs | my $text = | ||
97 | "<script type='text/javascript'>\njQuery.extend(foswiki, {\n \"preferences\": {\n" | ||||
98 | . join( ",\n", @prefs ) | ||||
99 | . "\n}});\n</script>"; | ||||
100 | |||||
101 | 1 | 8µs | 1 | 33µs | Foswiki::Func::addToZone( "script", "JQUERYPLUGIN::FOSWIKI::PREFERENCES", # spent 33µs making 1 call to Foswiki::Func::addToZone |
102 | $text, "JQUERYPLUGIN::FOSWIKI" ); | ||||
103 | } | ||||
104 | |||||
105 | 1 | 3µs | 1; | ||
106 | __END__ |