Item8659: breaks if JQueryPlugin is enabled
Priority: Normal
Current State: Closed
Released In:
Target Release: n/a
First of all, thank you very much for the very nice piece of work that
FlotChartPlugin is.
When
JQueryPlugin is enabled,
FlotChartPlugin does not reference its own copy of JQuery in favour of using
JQueryPlugin's jquery.js. But since
FlotChartPlugin does not inform a dependency on
FlotChartPlugin headers,
jquery.flot.js gets loaded
after jquery.js, and therefore
FlotChartPlugin does not work.
The following patch fixes the problem:
Index: lib/Foswiki/Plugins/FlotChartPlugin.pm
===================================================================
--- lib/Foswiki/Plugins/FlotChartPlugin.pm (revisão 6639)
+++ lib/Foswiki/Plugins/FlotChartPlugin.pm (cópia de trabalho)
@@ -64,7 +64,7 @@
# add the initialisation javascript
my $jscript = Foswiki::Func::readTemplate( lc($pluginName), 'javascript' );
- Foswiki::Func::addToHEAD( $pluginName . '-javascript', $jscript );
+ Foswiki::Func::addToHEAD( $pluginName . '-javascript', $jscript, 'JQUERYPLUGIN' );
}
I've tested with and without
JQueryPlugin enabled, and it works both ways.
--
AntonioTerceiro - 03 Mar 2010
It also does not work with the most recent
JQueryPlugin ... because
JQueryPlugin adds it's javascript tags to the 'body' zone and
FlotChartPlugin is adding to the 'head' zone ... and since the dependencies between items are handled per zone, the Flot javascript ends up being loaded before the
JQueryPlugin ones
--
AntonioTerceiro - 07 Jun 2010
Please do not use addToHead anymore. It is deprecated in favour of addToZone. Then add all javascript code to the body zone.
--
MichaelDaum - 08 Jun 2010
My suggestion to fix this is:
- Depend on JQueryPlugin; drop local copy of jquery
- Change the Javascript additions to use addToZone
Sven, what do you think? Can I go on with this?
--
AntonioTerceiro - 09 Jun 2010
go, go, go
--
SvenDowideit - 10 Jun 2010
ok, done and
released in 1.2
--
AntonioTerceiro - 14 Jun 2010