Skip to content

Commit

Permalink
node= module support extended
Browse files Browse the repository at this point in the history
  • Loading branch information
rlankhorst committed May 12, 2023
1 parent 80fbf31 commit 1ccd3d5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion cookiebanner/js/complianz.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ function cmplz_run_script( script, category, service, type, sourceObj ) {
targetObj.innerHTML = [script, 'cmplzScriptLoaded();'].join('\n');
}

if (script.includes("import") ) {
if ( script.includes("import") ) {
targetObj.setAttribute("type", "module");
}

Expand Down Expand Up @@ -2229,6 +2229,11 @@ function cmplzCopyAttributes(source, target) {
return Array.from(source.attributes).forEach(attribute => {
//don't copy the type attribute
let excludes = ['type', 'data-service', 'data-category', 'async'];
if ( attribute.nodeName === 'data-script-type' && attribute.nodeValue === 'module' ) {
target.setAttribute('type', 'module',);
target.removeAttribute('data-script-type');
}

if ( !excludes.includes(attribute.nodeName) ) {
target.setAttribute(
attribute.nodeName,
Expand Down
2 changes: 1 addition & 1 deletion cookiebanner/js/complianz.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions languages/complianz-gdpr.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# This file is distributed under the same license as the Complianz Privacy Suite (GDPR/CCPA) premium plugin.
msgid ""
msgstr ""
"Project-Id-Version: Complianz Privacy Suite (GDPR/CCPA) premium 6.4.6.1\n"
"Project-Id-Version: Complianz Privacy Suite (GDPR/CCPA) premium 6.4.7\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/complianz-gdpr-premium\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2023-05-11T09:37:40+00:00\n"
"POT-Creation-Date: 2023-05-12T13:46:31+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.7.1\n"
"X-Domain: complianz-gdpr\n"
Expand Down

0 comments on commit 1ccd3d5

Please sign in to comment.