PageSourceSearch

https://www.dreametech.com/cdn/shop/t/361/assets/common-blog.js?v=97237147029821604911782787794

js dreametech.com collected 2026-09-27 20:55:44 UTC 8,499 bytes, 2 lines download raw bytes

1document.addEventListener("DOMContentLoaded",()=>{if((function(){let a_list=document.querySelectorAll("a");document.getElementsByClassName("main-content")[0].classList.add("new-blog-container");for(let a_item of a_list){if((a_item.getAttribute("href")||"").startsWith("#")||a_item.closest("article-nav, .article-nav")){a_item.removeAttribute("target");continue}a_item.setAttribute("target","_blank")}let tableOfContentsFixedList=document.querySelectorAll(".table-of-contents-fixed a");for(let a_item of tableOfContentsFixedList)a_item.setAttribute("target","_self")})(),!customElements.get("blog-copy-price")){class BlogCopyPrice extends HTMLElement{constructor(){super(),this.copybtn=this.querySelector(".copy-btn"),this.copycode=this.querySelector(".code").innerText,this.init()}init(){let that_parent=this;this.copybtn.addEventListener("click",function(){this.classList.add("active");let that=this;var aux=document.createElement("input");aux.setAttribute("value",that_parent.copycode),document.body.appendChild(aux),aux.select(),document.execCommand("copy"),document.body.removeChild(aux),setTimeout(function(){that.classList.remove("active")},1e3),that_parent.ajaxCopyCode()})}ajaxCopyCode(){const xhttp=new XMLHttpRequest;xhttp.open("GET","/discount/"+this.copycode,!0),xhttp.onreadystatechange=function(){this.readyState==4&&this.status==200&&console.log("success")},xhttp.send()}}customElements.define("blog-copy-price",BlogCopyPrice)}if(!customElements.get("blog-tabbar")){class BlogTabbar extends HTMLElement{constructor(){super(),this.tabbarlist=this.querySelectorAll("li"),this.initTabbar()}initTabbar(){for(let tab_item of this.tabbarlist)tab_item.addEventListener("click",()=>{let jump_to=tab_item.dataset.jumpto;for(const child of tab_item.parentElement.children)child.classList.remove("active");tab_item.classList.add("active"),window.scrollTo({top:document.getElementById(`${jump_to}`).offsetTop,behavior:"smooth"})})}}customElements.define("blog-tabbar",BlogTabbar)}if(!customElements.get("blog-swiper")){class BlogSwiper extends HTMLElement{constructor(){super(),this.blogSwiperContainer=this.querySelector(".swiper"),this.slider_pc_num=this.getAttribute("data-swiper_pc_num")?this.getAttribute("data-swiper_pc_num"):1,this.slider_ipad_num=this.getAttribute("data-swiper_ipad_num")?this.getAttribute("data-swiper_ipad_num"):this.slider_pc_num,this.slider_m_num=this.getAttribute("data-swiper_m_num")?this.getAttribute("data-swiper_m_num"):this.slider_ipad_num,this.slide_pc_gap=this.getAttribute("data-pc_gap")>0?this.getAttribute("data-pc_gap"):0,this.slide_m_arrow_img=this.getAttribute("data-arrow_mtop")=="true",this.init(),this.changeSwiper()}init(){this.blog_swiper=new Swiper(this.blogSwiperContainer,{slidesPerView:this.slider_pc_num,spaceBetween:this.slide_pc_gap,navigation:{nextEl:this.querySelector(".swiper-button-next"),prevEl:this.querySelector(".swiper-button-prev")},scrollbar:{el:this.querySelector(".swiper-scrollbar"),draggable:!0},breakpoints:{589:{spaceBetween:this.slide_pc_gap/2,slidesPerView:this.slider_m_num},1024:{slidesPerView:this.slider_ipad_num}}})}changeSwiper(){if(this.slide_m_arrow_img&&window.innerWidth<=850){let obj=this.blogSwiperContainer.querySelector(".swiper-slide .image"),h=obj&&obj.offsetHeight/2;this.blogSwiperContainer.parentElement.querySelector(".button-content").style.top=h+"px"}}}customElements.define("blog-swiper",BlogSwiper)}if(!customElements.get("blog-table")){class BlogTable extends HTMLElement{constructor(){super(),this.slide_list=this.querySelector(".swiper-slide"),this.slide_span_list=this.slide_list.querySelectorAll("span"),this.init(),this.resizeFn()}init(){const all_children=this.slide_list.parentElement.children;for(let i=0;i<this.slide_span_list.length;i++)for(let k=0;k<all_children.length;k++)all_children[k].children[0].children[i].style.minHeight="auto";setTimeout(()=>{for(let i=0;i<this.slide_span_list.length;i++){var tallest=0;for(let j=0;j<all_children.length;j++){var ele=all_children[j].children[0].children[i],eleHeight=ele.offsetHeight;tallest=eleHeight>tallest?eleHeight:tallest}for(let k=0;k<all_children.length;k++)all_children[k].children[0].children[i].style.minHeight=tallest+"px"}},0)}resizeFn(){window.addEventListener("resize",()=>{this.init()})}}customElements.define("blog-table",BlogTable)}if(!customElements.get("blog-product-list")){class BlogProductList extends HTMLElement{constructor(){super(),this.productlist=this.querySelectorAll(".list-header li"),this.product_showlist=this.querySelectorAll(".list-content"),this.init()}init(){for(let list_item of this.productlist)list_item.addEventListener("click",()=>{let tags=list_item.dataset.tags;for(const child of list_item.parentElement.children)child.classList.remove("active");list_item.classList.add("active");for(let show_list_item of this.product_showlist){let tag_showlist=show_list_item.dataset.tags;tags==tag_showlist?show_list_item.classList.add("active"):show_list_item.classList.remove("active")}})}}customElements.define("blog-product-list",BlogProductList)}if(!customElements.get("blog-faq")){class BlogFaq extends HTMLElement{constructor(){super(),this.faq_list=this.querySelectorAll(".faq-container>div"),this.faq_ques_list=this.querySelectorAll(".faq-question"),this.init()}init(){this.initFirst();for(let faq_ques_item of this.faq_ques_list)faq_ques_item.addEventListener("click",()=>{let flag=!1;faq_ques_item.classList.contains("active")||(flag=!0);for(const child of this.faq_list)child.querySelector(".faq-question").classList.remove("active");flag&&faq_ques_item.classList.add("active")})}initFirst(){this.querySelector(".faq-container>div:first-child .faq-question").classList.add("active")}}customElements.define("blog-faq",BlogFaq)}if(!customElements.get("blog-video")){class BlogVideo extends HTMLElement{constructor(){super(),this.detect_video_list=this.querySelectorAll("video"),this.initVideoBtn(),this.initVideoAttr()}initVideoBtn(){for(let video_item of this.detect_video_list){video_item.parentElement.classList.add("video-content");var span=document.createElement("span");span.setAttribute("class","video-btn"),span.addEventListener("click",()=>{this.handlePlayButton(video_item)}),video_item.parentElement.appendChild(span)}}initVideoAttr(){let attrs={muted:!0,"x5-playsinline":"true",playsinline:"true","webkit-playsinline":"true"};for(var key in attrs)for(let video_item of this.detect_video_list)video_item.setAttribute(key,attrs[key]);for(let video_item of this.detect_video_list){var source=document.createElement("source"),src=video_item.dataset.src;src.indexOf(".webm")>-1?source.setAttribute("type","video/webm"):source.setAttribute("type","video/mp4"),video_item.appendChild(source)}this.init()}init(){if(this.detect_video_list)for(const video_list of this.detect_video_list){const resizeObserver=new IntersectionObserver(([entry])=>{if(entry.isIntersecting){let src=video_list.dataset.src+"#0.01";video_list.querySelector("source").setAttribute("src",src),video_list.load(),resizeObserver.disconnect()}},{threshold:0,rootMargin:"0px 0px 0px 0px"});resizeObserver.observe(video_list),video_list.addEventListener("click",()=>{this.handlePlayButton(video_list)})}}playVideo(videoElem){videoElem.play().then(function(){videoElem.parentElement.classList.add("playing"),videoElem.parentElement.classList.remove("paused")})}handlePlayButton(videoElem){videoElem.paused?this.playVideo(videoElem):(videoElem.pause(),videoElem.parentElement.classList.remove("playing"),videoElem.parentElement.classList.add("paused"))}}customElements.define("blog-video",BlogVideo)}const tabbar_list=document.getElementsByClassName("blog-tabbar");
1if(tabbar_list)for(let par of tabbar_list){let tabbar_item_list=par.querySelectorAll("li");if(tabbar_item_list)for(let tab_item of tabbar_item_list)tab_item.addEventListener("click",()=>{let jump_to=tab_item.dataset.jumpto;for(const child of tab_item.parentElement.children)child.classList.remove("active");tab_item.classList.add("active"),window.scrollTo({top:document.getElementById(`${jump_to}`).offsetTop,behavior:"smooth"})})}const table_list=document.getElementsByTagName("table");if(table_list)for(let table_item of table_list){if(table_item.parentElement.classList.contains("blog-table"))continue;let div_ele=document.createElement("div");div_ele.className="blog-table",table_item.parentNode.insertBefore(div_ele,table_item),div_ele.appendChild(table_item)}});
2//# sourceMappingURL=/cdn/shop/t/361/assets/common-blog.js.map?v=97237147029821604911782787794

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.