Skip to content

Commit

Permalink
Item9740:
Browse files Browse the repository at this point in the history
   * fixing how TWISTYANIMATIONSPEED is added to the head 
   * fixing dependency of jquery.twisty on non-jquery foswikiPrefs



git-svn-id: http://svn.foswiki.org/branches/Release01x01@9310 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
MichaelDaum authored and MichaelDaum committed Sep 22, 2010
1 parent 8b045a1 commit 8e83189
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
15 changes: 5 additions & 10 deletions TwistyPlugin/lib/Foswiki/Plugins/TwistyPlugin.pm
Expand Up @@ -58,23 +58,18 @@ sub initPlugin {
}

sub _exportAnimationSpeed {
my $exported = Foswiki::Func::getPreferencesValue('EXPORTEDPREFERENCES')
|| '';

my $pref =
Foswiki::Func::getPreferencesValue('TWISTYANIMATIONSPEED')
|| Foswiki::Func::getPluginPreferencesValue('TWISTYANIMATIONSPEED')
|| '0';

# As per Item8924; "push" TWISTYANIMATIONSPEED onto EXPORTEDPREFERENCES so
# add TWISTYANIMATIONSPEED to the html head so
# that it may be used in the client JS with
# foswiki.getPreference('TWISTYANIMATIONSPEED')
my @list = split( /[,\s]+/, $exported );
unless ( grep { /^TWISTYANIMATIONSPEED$/ } @list ) {
push( @list, 'TWISTYANIMATIONSPEED' );
Foswiki::Func::setPreferencesValue( 'EXPORTEDPREFERENCES',
join( ',', @list ) );
}
Foswiki::Func::setPreferencesValue( 'TWISTYANIMATIONSPEED', $pref );
Foswiki::Func::addToZone("head", "TWISTYPLUGIN::META", <<"HERE");
<meta name="foswiki.TWISTYANIMATIONSPEED" content="$pref" />
HERE

return;
}
Expand Down
3 changes: 2 additions & 1 deletion TwistyPlugin/lib/Foswiki/Plugins/TwistyPlugin/TWISTY.pm
Expand Up @@ -33,7 +33,7 @@ sub new {
author => 'Rafael Alvarez, Michael Daum, Arthur Clemens',
homepage => 'http://foswiki.org/Extensions/TwistyPlugin',
puburl => '%PUBURLPATH%/%SYSTEMWEB%/TwistyPlugin',
dependencies => ['livequery'],
dependencies => ['livequery', 'JavascriptFiles/foswikiPref'],
javascript => ['jquery.twisty.js'],
css => ['jquery.twisty.css']
),
Expand All @@ -44,6 +44,7 @@ sub new {
# cookie.
my $foswikiPrefs =
Foswiki::Func::expandTemplate('JavascriptFiles/foswikiPref');

Foswiki::Func::expandCommonVariables($foswikiPrefs);

return $this;
Expand Down

0 comments on commit 8e83189

Please sign in to comment.