txact-subscribe-button-2
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -1,1 +0,1 @@ | ||
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var s=e[r]={i:r,l:!1,exports:{}};return t[r].call(s.exports,s,s.exports,n),s.l=!0,s.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)n.d(r,s,function(e){return t[e]}.bind(null,s));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";n.r(e);const r=document.createElement("template");r.innerHTML='\n <style>\n .subscribe-button {\n width: 367px;\n font-family: Volvo Novum;\n font-size: 18px;\n line-height: 21px;\n text-align: center;\n letter-spacing: 0.03em;\n cursor: pointer;\n height: 70px;\n background: #007bcd;\n border: 1px solid #007bcd;\n stroke: #ffffff;\n padding: 20px 50px;\n fill: #ffffff;\n color: #ffffff;\n }\n \n .subscribe-button:hover {\n background: #008ae6;\n }\n \n .subscribe-button:focus {\n border: 1px solid #007bcd;\n }\n \n .subscribe-button[disabled] {\n opacity: 0.5;\n pointer-events: none;\n }\n \n </style>\n <div>\n <button type="subscribe-button" id=\'subscribe-button\' class="subscribe-button" >\n <slot></slot>\n </button>\n </div>\n';class s extends HTMLElement{constructor(){super(),this.root=this.attachShadow({mode:"open"}),this.root.appendChild(r.content.cloneNode(!0)),this.subscribeButton=this.root.getElementById("subscribe-button"),this.subscribeButton.addEventListener("click",()=>this.handleClick()),this.subscribeButton.disabled=!0,this._co=""}connectedCallback(){this.subscribeButton.hasAttribute("style")&&(this.subscribeButton.style=this.subscribeButton.getAttribute("style"));let t=`${this.ep}/products/vehicles?market=${this.market}`+`&m=${this.m}}&c=${this.c}&provider=${this.provider}`;fetch(t,{method:"GET",headers:{Accept:"application/vnd.volvocars.api.x.transferresponse.v1+json","Content-Type":"application/vnd.volvocars.api.x.stockcar.v1+json"}}).then(t=>{t.json().then(t=>{this.subscribeButton.disabled=!1,this._co="https://www.google.com"})}).catch(t=>{this.subscribeButton.disabled=!1,this._co="https://www.google.com"})}handleClick(){this._co&&window.location.replace(this._co)}get ep(){return this.getAttribute("ep")}set ep(t){this.setAttribute("ep",t)}get provider(){return this.getAttribute("provider")}set provider(t){this.setAttribute("provider",t)}get m(){return this.getAttribute("m")}set m(t){this.setAttribute("m",t)}get c(){return this.getAttribute("c")}set c(t){this.setAttribute("c",t)}get market(){return this.getAttribute("market")}set market(t){this.setAttribute("market",t)}}customElements.get("txact-subscribe-button")||window.customElements.define("txact-subscribe-button",s)}]); | ||
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";n.r(e);const r=document.createElement("template");r.innerHTML='\n <style>\n .subscribe-button {\n width: 367px;\n font-family: Volvo Novum;\n font-size: 18px;\n line-height: 21px;\n text-align: center;\n letter-spacing: 0.03em;\n cursor: pointer;\n height: 70px;\n background: #007bcd;\n border: 1px solid #007bcd;\n stroke: #ffffff;\n padding: 20px 50px;\n fill: #ffffff;\n color: #ffffff;\n }\n \n .subscribe-button:hover {\n background: #008ae6;\n }\n \n .subscribe-button:focus {\n border: 1px solid #007bcd;\n }\n \n .subscribe-button[disabled] {\n opacity: 0.5;\n pointer-events: none;\n }\n \n </style>\n <div>\n <button type="subscribe-button" id=\'subscribe-button\' class="subscribe-button" >\n <slot></slot>\n </button>\n </div>\n';class o extends HTMLElement{constructor(){super(),this.root=this.attachShadow({mode:"open"}),this.root.appendChild(r.content.cloneNode(!0)),this.subscribeButton=this.root.getElementById("subscribe-button"),this.subscribeButton.addEventListener("click",()=>this.handleClick()),this.subscribeButton.disabled=!0,this._co=""}connectedCallback(){this.subscribeButton.hasAttribute("style")&&(this.subscribeButton.style=this.subscribeButton.getAttribute("style"));let t=`${this.ep}/products/vehicles?market=${this.market}`+`&m=${this.m}}&c=${this.c}&provider=${this.provider}`;fetch(t,{method:"GET",headers:{Accept:"application/vnd.volvocars.api.x.transferresponse.v1+json","Content-Type":"application/vnd.volvocars.api.x.stockcar.v1+json"}}).then(t=>{t.json().then(t=>{this.subscribeButton.disabled=!1,this._co="https://www.google.com"})}).catch(t=>{this.subscribeButton.disabled=!1,this._co="https://www.google.com"})}handleClick(){this._co&&(window.location.href=this._co)}get ep(){return this.getAttribute("ep")}set ep(t){this.setAttribute("ep",t)}get provider(){return this.getAttribute("provider")}set provider(t){this.setAttribute("provider",t)}get m(){return this.getAttribute("m")}set m(t){this.setAttribute("m",t)}get c(){return this.getAttribute("c")}set c(t){this.setAttribute("c",t)}get market(){return this.getAttribute("market")}set market(t){this.setAttribute("market",t)}}customElements.get("txact-subscribe-button")||window.customElements.define("txact-subscribe-button",o);const s=document.createElement("div");s.innerHTML="<txact-subscribe-button ep='http://development-uswest2.ccdp.volvo.care/ccdp/pdp' provider='SF' m='eyJ2IjoiWVY0QTIyUEs2SjEyMDYwMTQiLCJwIjp7Im1ycCI6IjgwMC4wMCJ9LCJkaSI6IjM0MDgwIiwiZGFpIjoiS1NJTkdINkB2b2x2b2NhcnMuY29tIn0=' c='b698609de732ed0fa6599261a63e2dd51c8468df5ebe33616a0455dd2b450999' market='US'>Subscribe 22</txact-subscribe-button>",document.body.appendChild(s)}]); |
{ | ||
"name": "txact-subscribe-button-2", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/main.js", |
@@ -98,3 +98,3 @@ const subscribeButtonTemplateString = ` | ||
if(this._co) { | ||
window.location.replace(this._co); | ||
window.location.href = this._co; | ||
} | ||
@@ -101,0 +101,0 @@ } |
@@ -16,14 +16,14 @@ import './main'; | ||
// | ||
// const div = document.createElement('div'); | ||
// | ||
// const txactSubscribeButton2 = "<txact-subscribe-button " + | ||
// " ep='http://development-uswest2.ccdp.volvo.care/ccdp/pdp'"+ | ||
// " provider='SF'"+ | ||
// " m='eyJ2IjoiWVY0QTIyUEs2SjEyMDYwMTQiLCJwIjp7Im1ycCI6IjgwMC4wMCJ9LCJkaSI6IjM0MDgwIiwiZGFpIjoiS1NJTkdINkB2b2x2b2NhcnMuY29tIn0='" + | ||
// " c='b698609de732ed0fa6599261a63e2dd51c8468df5ebe33616a0455dd2b450999'"+ | ||
// " market='US'"+ | ||
// ">" + | ||
// "Subscribe 22"+ | ||
// "</txact-subscribe-button>"; | ||
// div.innerHTML = txactSubscribeButton2; | ||
// document.body.appendChild(div); | ||
const div = document.createElement('div'); | ||
const txactSubscribeButton2 = "<txact-subscribe-button " + | ||
" ep='http://development-uswest2.ccdp.volvo.care/ccdp/pdp'"+ | ||
" provider='SF'"+ | ||
" m='eyJ2IjoiWVY0QTIyUEs2SjEyMDYwMTQiLCJwIjp7Im1ycCI6IjgwMC4wMCJ9LCJkaSI6IjM0MDgwIiwiZGFpIjoiS1NJTkdINkB2b2x2b2NhcnMuY29tIn0='" + | ||
" c='b698609de732ed0fa6599261a63e2dd51c8468df5ebe33616a0455dd2b450999'"+ | ||
" market='US'"+ | ||
">" + | ||
"Subscribe 22"+ | ||
"</txact-subscribe-button>"; | ||
div.innerHTML = txactSubscribeButton2; | ||
document.body.appendChild(div); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37791
299