From 7ab712b669e5542a4aee3380d45dd28cd77c08da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20C=C3=A1nepa?= Date: Tue, 2 Jan 2024 22:41:28 -0300 Subject: [PATCH 1/7] IE filter property --- lib/themeroller.js | 4 ++-- test/fixtures/jquery-ui-1.12/base/theme.css | 10 +++++----- test/fixtures/jquery-ui-1.12/themes/base.css | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/themeroller.js b/lib/themeroller.js index 4204da6..7f08340 100644 --- a/lib/themeroller.js +++ b/lib/themeroller.js @@ -105,7 +105,7 @@ function ThemeRoller( baseThemeCss, vars, options ) { // For version < 1.10.0, opacity (w3c) and filter (IE) are combined into the same line. opacityFix = function( opacity ) { - return /* w3c */ ( opacity / 100 ).toString().replace( /^0\./, "." ) + /* IE */ ";filter:Alpha(Opacity=" + opacity + ")"; + return /* w3c */ ( opacity / 100 ).toString().replace( /^0\./, "." ) + /* IE */ ';filter: "alpha(opacity=' + opacity + ')"'; }; vars.opacityOverlay = opacityFix( vars.opacityOverlay ); vars.opacityShadow = opacityFix( vars.opacityShadow ); @@ -117,7 +117,7 @@ function ThemeRoller( baseThemeCss, vars, options ) { return ( opacity / 100 ).toString().replace( /^0\./, "." ); }; opacityFilter = function( opacity ) { - return "Alpha(Opacity=" + opacity + ")"; + return "alpha(opacity=" + opacity + ")"; }; vars.opacityFilterOverlay = opacityFilter( vars.opacityOverlay ); vars.opacityFilterShadow = opacityFilter( vars.opacityShadow ); diff --git a/test/fixtures/jquery-ui-1.12/base/theme.css b/test/fixtures/jquery-ui-1.12/base/theme.css index c7ad484..da03b7e 100644 --- a/test/fixtures/jquery-ui-1.12/base/theme.css +++ b/test/fixtures/jquery-ui-1.12/base/theme.css @@ -139,18 +139,18 @@ .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; - filter:Alpha(Opacity=70); /* support: IE8 */ + filter: "alpha(opacity=70)"; /* support: IE8 */ font-weight: normal; } .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; - filter:Alpha(Opacity=35); /* support: IE8 */ + filter: "alpha(opacity=35)"; /* support: IE8 */ background-image: none; } .ui-state-disabled .ui-icon { - filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */ + filter: "alpha(opacity=35)"; /* support: IE8 - See #6059 */ } /* Icons @@ -398,13 +398,13 @@ .ui-widget-overlay { background: #aaaaaa/*{bgColorOverlay}*/ url("images/ui-bg_flat_0_aaaaaa_40x100.png")/*{bgImgUrlOverlay}*/ 50%/*{bgOverlayXPos}*/ 50%/*{bgOverlayYPos}*/ repeat-x/*{bgOverlayRepeat}*/; opacity: .3/*{opacityOverlay}*/; - filter: Alpha(Opacity=30)/*{opacityFilterOverlay}*/; /* support: IE8 */ + filter: "alpha(opacity=30)"/*{opacityFilterOverlay}*/; /* support: IE8 */ } .ui-widget-shadow { margin: -8px/*{offsetTopShadow}*/ 0 0 -8px/*{offsetLeftShadow}*/; padding: 8px/*{thicknessShadow}*/; background: #aaaaaa/*{bgColorShadow}*/ url("images/ui-bg_flat_0_aaaaaa_40x100.png")/*{bgImgUrlShadow}*/ 50%/*{bgShadowXPos}*/ 50%/*{bgShadowYPos}*/ repeat-x/*{bgShadowRepeat}*/; opacity: .3/*{opacityShadow}*/; - filter: Alpha(Opacity=30)/*{opacityFilterShadow}*/; /* support: IE8 */ + filter: "alpha(opacity=30)"/*{opacityFilterShadow}*/; /* support: IE8 */ border-radius: 8px/*{cornerRadiusShadow}*/; } diff --git a/test/fixtures/jquery-ui-1.12/themes/base.css b/test/fixtures/jquery-ui-1.12/themes/base.css index e041db2..37f8ba0 100644 --- a/test/fixtures/jquery-ui-1.12/themes/base.css +++ b/test/fixtures/jquery-ui-1.12/themes/base.css @@ -139,18 +139,18 @@ .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; - filter:Alpha(Opacity=70); /* support: IE8 */ + filter: "alpha(opacity=70)"; /* support: IE8 */ font-weight: normal; } .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; - filter:Alpha(Opacity=35); /* support: IE8 */ + filter: "alpha(opacity=35)"; /* support: IE8 */ background-image: none; } .ui-state-disabled .ui-icon { - filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */ + filter: "alpha(opacity=35)"; /* support: IE8 - See #6059 */ } /* Icons @@ -398,13 +398,13 @@ .ui-widget-overlay { background: #aaaaaa; opacity: .3; - filter: Alpha(Opacity=30); /* support: IE8 */ + filter: "alpha(opacity=30)"; /* support: IE8 */ } .ui-widget-shadow { margin: 0px 0 0 0px; padding: 5px; background: #666666; opacity: .3; - filter: Alpha(Opacity=30); /* support: IE8 */ + filter: "alpha(opacity=30)"; /* support: IE8 */ border-radius: 8px; } From cec60f7327ec0ee6acc2f3fd3d2252e4f4b49cfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20C=C3=A1nepa?= Date: Wed, 3 Jan 2024 21:52:46 -0300 Subject: [PATCH 2/7] fix opacityFilter() return string --- lib/themeroller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/themeroller.js b/lib/themeroller.js index 7f08340..615fcc3 100644 --- a/lib/themeroller.js +++ b/lib/themeroller.js @@ -117,7 +117,7 @@ function ThemeRoller( baseThemeCss, vars, options ) { return ( opacity / 100 ).toString().replace( /^0\./, "." ); }; opacityFilter = function( opacity ) { - return "alpha(opacity=" + opacity + ")"; + return '"alpha(opacity=' + opacity + ')"'; }; vars.opacityFilterOverlay = opacityFilter( vars.opacityOverlay ); vars.opacityFilterShadow = opacityFilter( vars.opacityShadow ); From 778c9d0f14edd42f9bedf5812c583d7862c5a2e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20C=C3=A1nepa?= Date: Sat, 23 Mar 2024 21:07:05 -0300 Subject: [PATCH 3/7] compat for older IE --- lib/themeroller.js | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/lib/themeroller.js b/lib/themeroller.js index 615fcc3..849c45b 100644 --- a/lib/themeroller.js +++ b/lib/themeroller.js @@ -105,24 +105,40 @@ function ThemeRoller( baseThemeCss, vars, options ) { // For version < 1.10.0, opacity (w3c) and filter (IE) are combined into the same line. opacityFix = function( opacity ) { - return /* w3c */ ( opacity / 100 ).toString().replace( /^0\./, "." ) + /* IE */ ';filter: "alpha(opacity=' + opacity + ')"'; + return /* w3c */ ( opacity / 100 ).toString().replace( /^0\./, "." ) + /* IE */ ";filter:Alpha(Opacity=" + opacity + ")"; }; vars.opacityOverlay = opacityFix( vars.opacityOverlay ); vars.opacityShadow = opacityFix( vars.opacityShadow ); } else { - // For version >= 1.10.0, filter has its own separate line and variable name. - opacityFix = function( opacity ) { - return ( opacity / 100 ).toString().replace( /^0\./, "." ); - }; - opacityFilter = function( opacity ) { - return '"alpha(opacity=' + opacity + ')"'; - }; - vars.opacityFilterOverlay = opacityFilter( vars.opacityOverlay ); - vars.opacityFilterShadow = opacityFilter( vars.opacityShadow ); - vars.opacityOverlay = opacityFix( vars.opacityOverlay ); - vars.opacityShadow = opacityFix( vars.opacityShadow ); + if ( options.version && semver.lt( options.version, "1.13.0" ) ) { + + // For version >= 1.10.0 and < 1.13.0, filter has its own separate line and variable name. + opacityFix = function( opacity ) { + return ( opacity / 100 ).toString().replace( /^0\./, "." ); + }; + opacityFilter = function( opacity ) { + return "Alpha(Opacity=" + opacity + ")"; + }; + vars.opacityFilterOverlay = opacityFilter( vars.opacityOverlay ); + vars.opacityFilterShadow = opacityFilter( vars.opacityShadow ); + vars.opacityOverlay = opacityFix( vars.opacityOverlay ); + vars.opacityShadow = opacityFix( vars.opacityShadow ); + } + else { + // For version >= 1.13.0, -ms-filter has its own separate line and variable name. + opacityFix = function( opacity ) { + return ( opacity / 100 ).toString().replace( /^0\./, "." ) + ';-ms-filter: "alpha(opacity=' + opacity + ')"'; + }; + opacityFilter = function( opacity ) { + return '"alpha(opacity=' + opacity + ')"'; + }; + vars.opacityFilterOverlay = opacityFilter( vars.opacityOverlay ); + vars.opacityFilterShadow = opacityFilter( vars.opacityShadow ); + vars.opacityOverlay = opacityFix( vars.opacityOverlay ); + vars.opacityShadow = opacityFix( vars.opacityShadow ); + } } // Add '#' in the beginning of the colors if needed From ce46d65127fb96a61a9765b72a7d048cda7e1714 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20C=C3=A1nepa?= Date: Mon, 25 Mar 2024 20:28:58 -0300 Subject: [PATCH 4/7] Update lib/themeroller.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Michał Gołębiowski-Owczarek --- lib/themeroller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/themeroller.js b/lib/themeroller.js index 849c45b..1dc0a66 100644 --- a/lib/themeroller.js +++ b/lib/themeroller.js @@ -114,7 +114,7 @@ function ThemeRoller( baseThemeCss, vars, options ) { if ( options.version && semver.lt( options.version, "1.13.0" ) ) { - // For version >= 1.10.0 and < 1.13.0, filter has its own separate line and variable name. + // For version >= 1.10.0 < 1.13.0, filter has its own separate line and variable name. opacityFix = function( opacity ) { return ( opacity / 100 ).toString().replace( /^0\./, "." ); }; From 0ac075dde0a11a322014e3967ff879192699ec76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20C=C3=A1nepa?= Date: Mon, 25 Mar 2024 21:12:06 -0300 Subject: [PATCH 5/7] compat for older IE --- lib/themeroller.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/themeroller.js b/lib/themeroller.js index 1dc0a66..fb50408 100644 --- a/lib/themeroller.js +++ b/lib/themeroller.js @@ -127,12 +127,12 @@ function ThemeRoller( baseThemeCss, vars, options ) { vars.opacityShadow = opacityFix( vars.opacityShadow ); } else { - // For version >= 1.13.0, -ms-filter has its own separate line and variable name. + // For version >= 1.13.0, filter has its own separate line and variable name. opacityFix = function( opacity ) { - return ( opacity / 100 ).toString().replace( /^0\./, "." ) + ';-ms-filter: "alpha(opacity=' + opacity + ')"'; + return ( opacity / 100 ).toString().replace( /^0\./, "." ) + ';filter: "alpha(opacity=' + opacity + ')"'; }; opacityFilter = function( opacity ) { - return '"alpha(opacity=' + opacity + ')"'; + return "alpha(opacity=\" + opacity + \")"; }; vars.opacityFilterOverlay = opacityFilter( vars.opacityOverlay ); vars.opacityFilterShadow = opacityFilter( vars.opacityShadow ); From 0ee0a371318ee2e4f4693ff24a7918b277bdba71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20C=C3=A1nepa?= Date: Mon, 25 Mar 2024 21:45:43 -0300 Subject: [PATCH 6/7] compat for older IE --- lib/themeroller.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/themeroller.js b/lib/themeroller.js index fb50408..9bbeed4 100644 --- a/lib/themeroller.js +++ b/lib/themeroller.js @@ -129,10 +129,10 @@ function ThemeRoller( baseThemeCss, vars, options ) { else { // For version >= 1.13.0, filter has its own separate line and variable name. opacityFix = function( opacity ) { - return ( opacity / 100 ).toString().replace( /^0\./, "." ) + ';filter: "alpha(opacity=' + opacity + ')"'; + return ( opacity / 100 ).toString().replace( /^0\./, "." ); }; opacityFilter = function( opacity ) { - return "alpha(opacity=\" + opacity + \")"; + return "alpha(opacity=\"" + opacity + "\")"; }; vars.opacityFilterOverlay = opacityFilter( vars.opacityOverlay ); vars.opacityFilterShadow = opacityFilter( vars.opacityShadow ); From 33ac4d56feae6696657e0125763cd310ab92358f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20C=C3=A1nepa?= Date: Mon, 25 Mar 2024 22:40:37 -0300 Subject: [PATCH 7/7] compat for older IE --- lib/themeroller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/themeroller.js b/lib/themeroller.js index 9bbeed4..d67a8d8 100644 --- a/lib/themeroller.js +++ b/lib/themeroller.js @@ -132,7 +132,7 @@ function ThemeRoller( baseThemeCss, vars, options ) { return ( opacity / 100 ).toString().replace( /^0\./, "." ); }; opacityFilter = function( opacity ) { - return "alpha(opacity=\"" + opacity + "\")"; + return "alpha(opacity=" + opacity + ")"; }; vars.opacityFilterOverlay = opacityFilter( vars.opacityOverlay ); vars.opacityFilterShadow = opacityFilter( vars.opacityShadow );