Skip to content

Commit

Permalink
Item15109: fixed setting any property other than the background
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDaum committed May 4, 2022
1 parent 7d319cc commit eb321a3
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 17 deletions.
3 changes: 2 additions & 1 deletion data/System/JQAutoColorContrib.txt
Expand Up @@ -162,6 +162,7 @@ Use HTML5 data parameters to specify parameters to the autoColor plugin. All par
---++ Change History

%TABLE{columnwidths="7em" tablewidth="100%"}%
| 04 May 2022 | fix setting properties other than the background |
| 18 Nov 2019 | implement auto-generated gradient backgrounds |
| 01 Jul 2019 | skip auto-color if text is empty |
| 28 Mar 2018 | initial release |
Expand All @@ -172,7 +173,7 @@ Use HTML5 data parameters to specify parameters to the autoColor plugin. All par
%META:FIELD{name="Release" title="Release" value="%25$RELEASE%25"}%
%META:FIELD{name="Description" title="Description" value="%25$SHORTDESCRIPTION%25"}%
%META:FIELD{name="Repository" title="Repository" value="https://github.com/foswiki/JQAutoColorContrib"}%
%META:FIELD{name="Copyright" title="Copyright" value="2018-2019, Michael Daum, All Rights Reserved"}%
%META:FIELD{name="Copyright" title="Copyright" value="2018-2022, Michael Daum, All Rights Reserved"}%
%META:FIELD{name="License" title="License" value="GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]])"}%
%META:FIELD{name="Home" title="Home" value="https://foswiki.org/Extensions/JQAutoColorContrib"}%
%META:FIELD{name="Support" title="Support" value="https://foswiki.org/Support/JQAutoColorContrib"}%
Expand Down
6 changes: 3 additions & 3 deletions lib/Foswiki/Contrib/JQAutoColorContrib.pm
@@ -1,6 +1,6 @@
# Extension for Foswiki - The Free and Open Source Wiki, http://foswiki.org/
#
# JQAutoColorContrib is Copyright (C) 2018-2019 Michael Daum http://michaeldaumconsulting.com
# JQAutoColorContrib is Copyright (C) 2018-2022 Michael Daum http://michaeldaumconsulting.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
Expand All @@ -20,8 +20,8 @@ use warnings;

use Foswiki::Func ();

our $VERSION = '2.00';
our $RELEASE = '18 Nov 2019';
our $VERSION = '2.01';
our $RELEASE = '04 May 2022';
our $SHORTDESCRIPTION = 'Assign colors automatically based on text properties';
our $NO_PREFS_IN_TOPIC = 1;

Expand Down
2 changes: 1 addition & 1 deletion lib/Foswiki/Contrib/JQAutoColorContrib/Config.spec
@@ -1,7 +1,7 @@
# ---+ Extensions
# ---++ JQueryPlugin
# ---+++ Extra plugins
# **STRING**
# **STRING EXPERT**
$Foswiki::cfg{JQueryPlugin}{Plugins}{AutoColor}{Module} = 'Foswiki::Contrib::JQAutoColorContrib::Core';

# **BOOLEAN**
Expand Down
13 changes: 3 additions & 10 deletions lib/Foswiki/Contrib/JQAutoColorContrib/Core.pm
@@ -1,6 +1,6 @@
# Extension for Foswiki - The Free and Open Source Wiki, http://foswiki.org/
#
# JQAutoColorContrib is Copyright (C) 2018-2019 Michael Daum http://michaeldaumconsulting.com
# JQAutoColorContrib is Copyright (C) 2018-2022 Michael Daum http://michaeldaumconsulting.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
Expand All @@ -18,15 +18,8 @@ package Foswiki::Contrib::JQAutoColorContrib::Core;
use strict;
use warnings;

use Foswiki::Func ();

use constant TRACE => 0; # toggle me

sub writeDebug {
Foswiki::Func::writeDebug("JQAutoColorContrib::Core - $_[0]") if TRACE;
}

use Foswiki::Plugins::JQueryPlugin::Plugin ();
use Foswiki::Contrib::JQAutoColorContrib ();
our @ISA = qw( Foswiki::Plugins::JQueryPlugin::Plugin );

sub new {
Expand All @@ -35,7 +28,7 @@ sub new {
my $this = bless(
$class->SUPER::new(
name => 'AutoColor',
version => '2.00',
version => $Foswiki::Contrib::JQAutoColorContrib::VERSION,
author => 'Michael Daum',
homepage => 'http://foswiki.org/Extensions/JQAutoColorContrib',
css => ['autocolor.css'],
Expand Down
4 changes: 2 additions & 2 deletions pub/System/JQAutoColorContrib/src/autocolor.uncompressed.js
@@ -1,7 +1,7 @@
/*
* jQuery auto-color plugin 2.00
*
* Copyright (c) 2018-2019 Michael Daum http://michaeldaumconsulting.com
* Copyright (c) 2018-2022 Michael Daum http://michaeldaumconsulting.com
*
* Licensed under the GPL license http://www.gnu.org/licenses/gpl.html
*
Expand Down Expand Up @@ -91,7 +91,7 @@

//console.log("text=",text,"hash=",self.getHash(text),"hue=",self.getHue(self.getHash(text)));

if (self.opts.property) {
if (self.opts.property && self.opts.property !== 'background') {
if (self.opts.property === 'radial-gradient') {
self.target
.css("background-image", "radial-gradient(circle farthest-side at 33%,$color1 0,$color2 100%)"
Expand Down

0 comments on commit eb321a3

Please sign in to comment.