Changeset 3364022
- Timestamp:
- 09/18/2025 01:46:00 PM (7 months ago)
- Location:
- printess-editor/trunk
- Files:
-
- 4 edited
-
includes/js/printessWoocommerce.js (modified) (4 diffs)
-
printess.css (modified) (4 diffs)
-
printess.php (modified) (3 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
printess-editor/trunk/includes/js/printessWoocommerce.js
r3363692 r3364022 1 1 function trapFocus(root) { 2 const keyboardFocusableElements = root.querySelectorAll('a[href], button, input, textarea, select, details, [tabindex]'); 3 2 const keyboardFocusableElements = root?.querySelectorAll('a[href], button, input, textarea, select, details, [tabindex]'); 4 3 if (keyboardFocusableElements && keyboardFocusableElements.length > 0) { 5 4 const lastFocusableElement = keyboardFocusableElements[keyboardFocusableElements.length - 1]; … … 293 292 cancelButton.addEventListener("click", internalCancelCallback); 294 293 } 294 cancelButton.style.backgroundColor = "red"; 295 295 trapFocus(dialog); 296 296 }; … … 451 451 return name; 452 452 }; 453 const decodeHTMLEntities = (encoded) => { 454 const textarea = document.createElement('textarea'); 455 textarea.innerHTML = encoded; 456 return textarea.value; 457 }; 458 const parseMergeTemplate = (template) => { 459 let ret = []; 460 if (template) { 461 if (Array.isArray(template)) { 462 template.forEach((x) => { 463 ret = [ 464 ...ret, 465 ...parseMergeTemplate(x) 466 ]; 467 }); 468 } 469 else { 470 if (typeof template !== "string") { 471 ret.push(template); 472 } 473 else { 474 try { 475 let deserialized = JSON.parse(template); 476 ret = [ 477 ...ret, 478 ...parseMergeTemplate(deserialized) 479 ]; 480 } 481 catch { 482 try { 483 let deserialized = JSON.parse(decodeHTMLEntities(template)); 484 ret = [ 485 ...ret, 486 ...parseMergeTemplate(deserialized) 487 ]; 488 } 489 catch { 490 ret.push({ 491 templateName: template 492 }); 493 } 494 } 495 } 496 } 497 } 498 return ret; 499 }; 453 500 const createShopContext = function (settings) { 454 501 const context = { … … 471 518 let ret = []; 472 519 if (settings.mergeTemplates) { 473 if (typeof settings.mergeTemplates === "string") { 474 try { 475 const merge = JSON.parse(settings.mergeTemplates); 476 if (Array.isArray(merge)) { 477 ret = [...ret, ...merge.map((x) => { 478 if (typeof x === "string") { 479 return { 480 templateName: x 481 }; 482 } 483 else { 484 return x; 485 } 486 })]; 487 } 488 else { 489 ret = []; 490 } 491 } 492 catch (e) { 493 ret = []; 494 } 495 } 496 else { 497 ret = [...ret, ...settings.mergeTemplates.map((x) => { 498 if (typeof x === "string") { 499 return { 500 templateName: x 501 }; 502 } 503 else { 504 return x; 505 } 506 })]; 507 } 520 ret = [ 521 ...ret, 522 ...parseMergeTemplate(settings.mergeTemplates) 523 ]; 508 524 } 509 525 if (settings.product.mergeTemplates) { 510 ret = [...ret, ...settings.product.mergeTemplates.map((x) => { 511 if (typeof x === "string") { 512 return { 513 templateName: x 514 }; 515 } 516 else { 517 return x; 518 } 519 })]; 526 ret = [ 527 ...ret, 528 ...parseMergeTemplate(settings.product.mergeTemplates) 529 ]; 520 530 } 521 531 const currentFormFieldValues = getCurrentProductOptionValues(settings.product); 522 532 const selectedVariant = getCurrentVariant(currentFormFieldValues, settings.product); 523 533 if (selectedVariant && selectedVariant.templateName && selectedVariant.templateIsMergeTemplate) { 524 ret.push({ 525 templateName: selectedVariant.templateName 526 }); 534 ret = [ 535 ...ret, 536 ...parseMergeTemplate(selectedVariant.templateName) 537 ]; 527 538 } 528 539 return ret; -
printess-editor/trunk/printess.css
r3329685 r3364022 11 11 height: 100vh; 12 12 height: -webkit-fill-available; 13 overflow: hidden; 13 14 } 14 15 … … 245 246 z-index: 999999; 246 247 overflow: hidden; 247 display: none; 248 /*display: none;*/ 249 --printess-panelBackground: white; 248 250 } 249 251 … … 269 271 width: fit-content; 270 272 grid-template-rows: 1fr auto; 271 z-index: 100;273 z-index: 9999991; 272 274 } 273 275 … … 335 337 .printess_show_if_design_name.visible { 336 338 display: grid; 337 }338 339 .printess_overlay_background {340 --printess-panelBackground: white;341 339 } 342 340 -
printess-editor/trunk/printess.php
r3363692 r3364022 5 5 * Plugin URI: https://printess.com/kb/integrations/woo-commerce/index.html 6 6 * Developer: Bastian Kröger (support@printess.com); Alexander Oser (support@printess.com) 7 * Version: 1.6.6 27 * Version: 1.6.63 8 8 * Author: Printess 9 9 * Author URI: https://printess.com … … 14 14 * Tested up to: 6.8 15 15 * 16 * Woo: 10000:92402 0dfsfhsf8429842386wdff234sfd16 * Woo: 10000:924021dfsfhsf8429842386wdff234sfd 17 17 * WC requires at least: 5.8 18 18 * WC tested up to: 9.8.2 … … 31 31 function printess_render_information_overlay() { 32 32 ?> 33 <div class="printess_overlay_background " id="printess_information_overlay_background" style="display:none;">33 <div class="printess_overlay_background printess-owned" id="printess_information_overlay_background" style="display:none;"> 34 34 <div class="printess_overlay printess_information_overlay"> 35 35 <div class="printess_overlay_content progress"> -
printess-editor/trunk/readme.txt
r3363692 r3364022 331 331 = 1.6.62 = 332 332 - Fixed broken saving functionality while trying to trap focus events on save dialog 333 334 = 1.6.63 = 335 - Fixed parsing of serialized json configuration for merge templates in case a json string was provided as merge template name 336 - Fixed css for saving overlay thats displayed during saving a design to the customer account.
Note: See TracChangeset
for help on using the changeset viewer.