Bläddra i källkod

210922 單品家具 caption off / ignore logo2.png

yukyo0821 3 år sedan
förälder
incheckning
acef7d2ca6
2 ändrade filer med 29 tillägg och 29 borttagningar
  1. 23 28
      backstage/static/js/yo.js
  2. 6 1
      backstage/templates/solid_wood_furniture.html

+ 23 - 28
backstage/static/js/yo.js

@@ -401,9 +401,6 @@ function ParseProductSection(inContent) {
                             height: parseInt(tmph),
                         },
                         caption: "小寶優居 | " + $('#ctitle').val(),
-                        stretched: false,
-                        withBorder: true,
-                        withBackground: false,
                     }
                 });
             }
@@ -417,10 +414,7 @@ function ParseProductSection(inContent) {
                     width: 300,
                     height: 300,
                 },
-                caption: "小寶優居 | ",
-                stretched: false,
-                withBorder: true,
-                withBackground: false,
+                caption: "小寶優居 | " + $('#ctitle').val(),
             }
         });
     }
@@ -512,9 +506,6 @@ function ParseProductSection(inContent) {
                             height: parseInt(tmph),
                         },
                         caption: "小寶優居 | " + $('#ctitle').val(),
-                        stretched: false,
-                        withBorder: true,
-                        withBackground: false,
                     }
                 });
             }
@@ -528,10 +519,7 @@ function ParseProductSection(inContent) {
                     width: 300,
                     height: 300,
                 },
-                caption: "小寶優居 | ",
-                stretched: false,
-                withBorder: true,
-                withBackground: false,
+                caption: "小寶優居 | " + $('#ctitle').val(),
             }
         });
     }
@@ -560,6 +548,7 @@ function ParseProductSection(inContent) {
             //console.log('something changed', block);
         }
     });
+    //$('.image-tool__caption').css('display', 'none');
 }
 
 function GenProductSection(mimg, specimg) {
@@ -659,15 +648,17 @@ function GenProductSection(mimg, specimg) {
         block = mimg.blocks[i];
         if (block.type == "image") {
             iurl = block.data.file.url.split('/');
-            if (firstimg) {
-                $("#cimage").val($("#curl").val() + '/' + iurl[iurl.length - 1]);
-                firstimg = false;
+            if (iurl[iurl.length - 1] != "logo2.png") {
+                if (firstimg) {
+                    $("#cimage").val($("#curl").val() + '/' + iurl[iurl.length - 1]);
+                    firstimg = false;
+                }
+                mimgstr += '<amp-img\n  alt="小寶優居 | ' + $("#ctitle").val()
+                    + '"\n  src="' + iurl[iurl.length - 1]
+                    + '"\n  height="' + block.data.file.height
+                    + '"\n  width="' + block.data.file.width
+                    + '"\n  layout="responsive">\n</amp-img>';
             }
-            mimgstr += '<amp-img\n  alt="' + block.data.caption
-                + '"\n  src="' + iurl[iurl.length - 1]
-                + '"\n  height="' + block.data.file.height
-                + '"\n  width="' + block.data.file.width
-                + '"\n  layout="responsive">\n</amp-img>';
         }
     }
     tmpstr = tmpstr.replaceAll('##AMP-IMG##', mimgstr == "" ? "&nbsp;" : mimgstr);
@@ -678,7 +669,8 @@ function GenProductSection(mimg, specimg) {
         block = mimg.blocks[i];
         if (block.type == "image") {
             iurl = block.data.file.url.split('/');
-            previmgstr += (previmgstr == "" ? "" : '\n') + `<button on="tap:carousel-with-preview.goToSlide(index=` + i + `)">
+            if (iurl[iurl.length - 1] != "logo2.png") {
+                previmgstr += (previmgstr == "" ? "" : '\n') + `<button on="tap:carousel-with-preview.goToSlide(index=` + i + `)">
             <amp-img
               src="`+ iurl[iurl.length - 1] + `"
               width="40"
@@ -686,6 +678,7 @@ function GenProductSection(mimg, specimg) {
               alt="`+ block.data.caption + `"
             ></amp-img>
           </button>`;
+            }
         }
     }
     tmpstr = tmpstr.replaceAll('##PREV-IMG##', previmgstr == "" ? "&nbsp;" : previmgstr);
@@ -696,11 +689,13 @@ function GenProductSection(mimg, specimg) {
         block = specimg.blocks[i];
         if (block.type == "image") {
             iurl = block.data.file.url.split('/');
-            specimgstr += '<amp-img\n  alt="' + block.data.caption
-                + '"\n  src="' + iurl[iurl.length - 1]
-                + '"\n  height="' + block.data.file.height
-                + '"\n  width="' + block.data.file.width
-                + '"\n  layout="responsive">\n</amp-img>';
+            if (iurl[iurl.length - 1] != "logo2.png") {
+                specimgstr += '<amp-img\n  alt="小寶優居 | ' + $("#ctitle").val()
+                    + '"\n  src="' + iurl[iurl.length - 1]
+                    + '"\n  height="' + block.data.file.height
+                    + '"\n  width="' + block.data.file.width
+                    + '"\n  layout="responsive">\n</amp-img>';
+            }
         }
     }
     tmpstr = tmpstr.replaceAll('##SPEC-IMG##', specimgstr == "" ? "&nbsp;" : specimgstr);

+ 6 - 1
backstage/templates/solid_wood_furniture.html

@@ -63,6 +63,11 @@
 {% endblock modal_body %}
 
 {% block main_info_modal_body %}
+<style>
+    .image-tool__caption {
+        display: none;
+    }
+</style>
 <div class="modal fade" id="myModal">
     <div class="modal-dialog">
         <div class="modal-content">
@@ -98,7 +103,7 @@
                         <tr>
                             <td>
                                 類別</td>
-                            <td><select id="swfDropdown" onchange="$('#ctype')[0].val(this.value);"></select></td>
+                            <td><select id="swfDropdown" onchange="$('#ctype').val(this.value);"></select></td>
                         </tr>
                         <tr>
                             <td colspan="2"> </td>