|
4 | 4 | * See COPYING.txt for license details. |
5 | 5 | */ |
6 | 6 |
|
7 | | -// @codingStandardsIgnoreFile |
8 | | - |
9 | 7 | /** |
10 | 8 | * Product media data template |
11 | 9 | * |
|
15 | 13 | <div class="gallery-placeholder _block-content-loading" data-gallery-role="gallery-placeholder"> |
16 | 14 | <div data-role="loader" class="loading-mask"> |
17 | 15 | <div class="loader"> |
18 | | - <img src="<?= /* @escapeNotVerified */ $block->getViewFileUrl('images/loader-1.gif') ?>" |
19 | | - alt="<?= /* @escapeNotVerified */ __('Loading...') ?>"> |
| 16 | + <img src="<?= $block->escapeUrl($block->getViewFileUrl('images/loader-1.gif')) ?>" |
| 17 | + alt="<?= $block->escapeHtml(__('Loading...')) ?>"> |
20 | 18 | </div> |
21 | 19 | </div> |
22 | 20 | </div> |
23 | 21 | <!--Fix for jumping content. Loader must be the same size as gallery.--> |
24 | 22 | <script> |
25 | 23 | var config = { |
26 | | - "width": <?= /* @escapeNotVerified */ $block->getImageAttribute('product_page_image_medium', 'width') ?>, |
27 | | - "thumbheight": <?php /* @escapeNotVerified */ echo $block->getImageAttribute('product_page_image_small', 'height') |
28 | | - ?: $block->getImageAttribute('product_page_image_small', 'width'); ?>, |
29 | | - "navtype": "<?= /* @escapeNotVerified */ $block->getVar("gallery/navtype") ?>", |
30 | | - "height": <?= /* @escapeNotVerified */ $block->getImageAttribute('product_page_image_medium', 'height') ?> |
| 24 | + "width": <?= $block->escapeHtml($block->getImageAttribute('product_page_image_medium', 'width')) ?>, |
| 25 | + "thumbheight": <?= $block->escapeHtml($block->getImageAttribute('product_page_image_small', 'height') |
| 26 | + ?: $block->getImageAttribute('product_page_image_small', 'width')); ?>, |
| 27 | + "navtype": "<?= $block->escapeHtml($block->getVar("gallery/navtype")) ?>", |
| 28 | + "height": <?= $block->escapeHtml($block->getImageAttribute('product_page_image_medium', 'height')) ?> |
31 | 29 | }, |
32 | 30 | thumbBarHeight = 0, |
33 | 31 | loader = document.querySelectorAll('[data-gallery-role="gallery-placeholder"] [data-role="loader"]')[0]; |
|
43 | 41 | "[data-gallery-role=gallery-placeholder]": { |
44 | 42 | "mage/gallery/gallery": { |
45 | 43 | "mixins":["magnifier/magnify"], |
46 | | - "magnifierOpts": <?= /* @escapeNotVerified */ $block->getMagnifier() ?>, |
47 | | - "data": <?= /* @escapeNotVerified */ $block->getGalleryImagesJson() ?>, |
| 44 | + "magnifierOpts": <?= /* @noEscape */ $block->getMagnifier() ?>, |
| 45 | + "data": <?= /* @noEscape */ $block->getGalleryImagesJson() ?>, |
48 | 46 | "options": { |
49 | | - "nav": "<?= /* @escapeNotVerified */ $block->getVar("gallery/nav") ?>", |
50 | | - "loop": <?= /* @escapeNotVerified */ $block->getVar("gallery/loop") ? 'true' : 'false' ?>, |
51 | | - "keyboard": <?= /* @escapeNotVerified */ $block->getVar("gallery/keyboard") ? 'true' : 'false' ?>, |
52 | | - "arrows": <?= /* @escapeNotVerified */ $block->getVar("gallery/arrows") ? 'true' : 'false' ?>, |
53 | | - "allowfullscreen": <?= /* @escapeNotVerified */ $block->getVar("gallery/allowfullscreen") ? 'true' : 'false' ?>, |
54 | | - "showCaption": <?= /* @escapeNotVerified */ $block->getVar("gallery/caption") ? 'true' : 'false' ?>, |
55 | | - "width": "<?= /* @escapeNotVerified */ $block->getImageAttribute('product_page_image_medium', 'width') ?>", |
56 | | - "thumbwidth": "<?= /* @escapeNotVerified */ $block->getImageAttribute('product_page_image_small', 'width') ?>", |
57 | | - <?php if ($block->getImageAttribute('product_page_image_small', 'height') || $block->getImageAttribute('product_page_image_small', 'width')): ?> |
58 | | - "thumbheight": <?php /* @escapeNotVerified */ echo $block->getImageAttribute('product_page_image_small', 'height') |
59 | | - ?: $block->getImageAttribute('product_page_image_small', 'width'); ?>, |
| 47 | + "nav": "<?= $block->escapeHtml($block->getVar("gallery/nav")) ?>", |
| 48 | + <?php if (($block->getVar("gallery/loop"))) : ?> |
| 49 | + "loop": <?= $block->escapeHtml($block->getVar("gallery/loop")) ?>, |
| 50 | + <?php endif; ?> |
| 51 | + <?php if (($block->getVar("gallery/keyboard"))) : ?> |
| 52 | + "keyboard": <?= $block->escapeHtml($block->getVar("gallery/keyboard")) ?>, |
| 53 | + <?php endif; ?> |
| 54 | + <?php if (($block->getVar("gallery/arrows"))) : ?> |
| 55 | + "arrows": <?= $block->escapeHtml($block->getVar("gallery/arrows")) ?>, |
| 56 | + <?php endif; ?> |
| 57 | + <?php if (($block->getVar("gallery/allowfullscreen"))) : ?> |
| 58 | + "allowfullscreen": <?= $block->escapeHtml($block->getVar("gallery/allowfullscreen")) ?>, |
| 59 | + <?php endif; ?> |
| 60 | + <?php if (is_bool($block->getVar("gallery/caption"))) : ?> |
| 61 | + "showCaption": <?= /* @noEscape */ $block->getVar("gallery/caption") ? 'true' : 'false'; ?>, |
| 62 | + <?php endif; ?> |
| 63 | + <?php |
| 64 | + $imgWidth = $block->getImageAttribute('product_page_image_medium', 'width'); |
| 65 | + $thumbWidth = $block->getImageAttribute('product_page_image_small', 'width'); |
| 66 | + ?> |
| 67 | + "width": "<?= $block->escapeHtml($imgWidth) ?>", |
| 68 | + "thumbwidth": "<?= $block->escapeHtml($thumbWidth) ?>", |
| 69 | + <?php |
| 70 | + $thumbHeight = $block->getImageAttribute('product_page_image_small', 'height') |
| 71 | + ?: $block->getImageAttribute('product_page_image_small', 'width'); |
| 72 | + ?> |
| 73 | + <?php if ($thumbHeight) : ?> |
| 74 | + "thumbheight": <?= $block->escapeHtml($thumbHeight); ?>, |
60 | 75 | <?php endif; ?> |
61 | | - <?php if (($block->getVar("gallery/thumbmargin"))): ?> |
62 | | - "thumbmargin": <?= /* @noEscape */ (int)$block->getVar("gallery/thumbmargin"); ?>, |
| 76 | + <?php if (($block->getVar("gallery/thumbmargin"))) : ?> |
| 77 | + "thumbmargin": <?= (int)$block->getVar("gallery/thumbmargin"); ?>, |
63 | 78 | <?php endif; ?> |
64 | | - <?php if ($block->getImageAttribute('product_page_image_medium', 'height') || $block->getImageAttribute('product_page_image_medium', 'width')): ?> |
65 | | - "height": <?php /* @escapeNotVerified */ echo $block->getImageAttribute('product_page_image_medium', 'height') |
66 | | - ?: $block->getImageAttribute('product_page_image_medium', 'width'); ?>, |
| 79 | + <?php |
| 80 | + $imgHeight = $block->getImageAttribute('product_page_image_medium', 'height') |
| 81 | + ?: $block->getImageAttribute('product_page_image_medium', 'width') |
| 82 | + ?> |
| 83 | + <?php if ($imgHeight) : ?> |
| 84 | + "height": <?= $block->escapeHtml($imgHeight); ?>, |
67 | 85 | <?php endif; ?> |
68 | | - <?php if ($block->getVar("gallery/transition/duration")): ?> |
69 | | - "transitionduration": <?= /* @escapeNotVerified */ $block->getVar("gallery/transition/duration") ?>, |
| 86 | + <?php if ($block->getVar("gallery/transition/duration")) : ?> |
| 87 | + "transitionduration": <?= $block->escapeHtml($block->getVar("gallery/transition/duration")) ?>, |
70 | 88 | <?php endif; ?> |
71 | | - "transition": "<?= /* @escapeNotVerified */ $block->getVar("gallery/transition/effect") ?>", |
72 | | - "navarrows": <?= /* @escapeNotVerified */ $block->getVar("gallery/navarrows") ? 'true' : 'false' ?>, |
73 | | - "navtype": "<?= /* @escapeNotVerified */ $block->getVar("gallery/navtype") ?>", |
74 | | - "navdir": "<?= /* @escapeNotVerified */ $block->getVar("gallery/navdir") ?>" |
| 89 | + "transition": "<?= $block->escapeHtml($block->getVar("gallery/transition/effect")) ?>", |
| 90 | + <?php if (($block->getVar("gallery/navarrows"))) : ?> |
| 91 | + "navarrows": <?= $block->escapeHtml($block->getVar("gallery/navarrows")) ?>, |
| 92 | + <?php endif; ?> |
| 93 | + "navtype": "<?= $block->escapeHtml($block->getVar("gallery/navtype")) ?>", |
| 94 | + "navdir": "<?= $block->escapeHtml($block->getVar("gallery/navdir")) ?>" |
75 | 95 | }, |
76 | 96 | "fullscreen": { |
77 | | - "nav": "<?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/nav") ?>", |
78 | | - "loop": <?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/loop") ? 'true' : 'false' ?>, |
79 | | - "navdir": "<?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/navdir") ?>", |
80 | | - "navarrows": <?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/navarrows") ? 'true' : 'false' ?>, |
81 | | - "navtype": "<?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/navtype") ?>", |
82 | | - "arrows": <?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/arrows") ? 'true' : 'false' ?>, |
83 | | - "showCaption": <?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/caption") ? 'true' : 'false' ?>, |
84 | | - <?php if ($block->getVar("gallery/fullscreen/transition/duration")): ?> |
85 | | - "transitionduration": <?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/transition/duration") ?>, |
| 97 | + "nav": "<?= $block->escapeHtml($block->getVar("gallery/fullscreen/nav")) ?>", |
| 98 | + <?php if ($block->getVar("gallery/fullscreen/loop")) : ?> |
| 99 | + "loop": <?= $block->escapeHtml($block->getVar("gallery/fullscreen/loop")) ?>, |
| 100 | + <?php endif; ?> |
| 101 | + "navdir": "<?= $block->escapeHtml($block->getVar("gallery/fullscreen/navdir")) ?>", |
| 102 | + <?php if ($block->getVar("gallery/transition/navarrows")) : ?> |
| 103 | + "navarrows": <?= $block->escapeHtml($block->getVar("gallery/fullscreen/navarrows")) ?>, |
| 104 | + <?php endif; ?> |
| 105 | + "navtype": "<?= $block->escapeHtml($block->getVar("gallery/fullscreen/navtype")) ?>", |
| 106 | + <?php if ($block->getVar("gallery/fullscreen/arrows")) : ?> |
| 107 | + "arrows": <?= $block->escapeHtml($block->getVar("gallery/fullscreen/arrows")) ?>, |
| 108 | + <?php endif; ?> |
| 109 | + <?php if (is_bool($block->getVar("gallery/fullscreen/caption"))) : ?> |
| 110 | + <?php $showCaption = $block->getVar("gallery/fullscreen/caption") ? 'true' : 'false'; ?> |
| 111 | + "showCaption": <?= /* @noEscape */ $showCaption ?>, |
| 112 | + <?php endif; ?> |
| 113 | + <?php if ($block->getVar("gallery/fullscreen/transition/duration")) : ?> |
| 114 | + "transitionduration": <?= |
| 115 | + $block->escapeHtml($block->getVar("gallery/fullscreen/transition/duration")) ?>, |
86 | 116 | <?php endif; ?> |
87 | | - "transition": "<?= /* @escapeNotVerified */ $block->getVar("gallery/fullscreen/transition/effect") ?>" |
| 117 | + "transition": "<?= $block->escapeHtml($block->getVar("gallery/fullscreen/transition/effect")) ?>" |
88 | 118 | }, |
89 | | - "breakpoints": <?= /* @escapeNotVerified */ $block->getBreakpoints() ?> |
| 119 | + "breakpoints": <?= /* @noEscape */ $block->getBreakpoints() ?> |
90 | 120 | } |
91 | 121 | } |
92 | 122 | } |
|
0 commit comments