NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name Sideline reduction // @run-at document-end // @version 1.3 // @match https://argus.aka.amazon.com/* // @include https://argus.aka.amazon.com/* // @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js // @require https://gist.github.com/raw/2625891/waitForKeyElements.js // @grant GM_addStyle // @updateURL https://openuserjs.org/meta/kalpdev.1/Sideline_reduction.meta.js // @downloadURL https://openuserjs.org/install/kalpdev.1/Sideline_reduction.user.js //@require https://cdn.jsdelivr.net/npm/sweetalert2@10 // @grant GM_xmlhttpRequest // @grant GM_registerMenuCommand // @grant GM_setValue // @grant GM_getValue // @license MIT // ==/UserScript== /*- The @grant directive is needed to work around a design change introduced in GM 1.0. It restores the sandbox. */ function addCustomSearchResult (jNode) { $('.sideline-asin-container').click(function(){ setTimeout(function(){ add_description(); }, 100); function add_description(){ var username = jQuery(".spoof-user-badge-pic").attr('alt'); var product_asin = $("#workItemContainer").text(); var toastMixin = Swal.mixin({ toast: true, icon: 'success', title: 'General Title', animation: false, position: 'top-left', showConfirmButton: false, timer: 4000, timerProgressBar: true, didOpen: (toast) => { toast.addEventListener('mouseenter', Swal.stopTimer) toast.addEventListener('mouseleave', Swal.resumeTimer) } }); Swal.fire({ icon: 'question', title: 'Select the Valid reason of this Sideline ', backdrop: ` rgba(5,59,37,0.19) left top no-repeat `, showCancelButton: true, focusConfirm: false, allowOutsideClick: false, allowEscapeKey: false, html: `<select name="Reason" id="login" style="font-size:large;" > placeholder="Reason" <option value="Qbuz">Qbuz</option> <option value="EAR">EAR</option> <option value="Already Qbuz">Already Qbuz</option> <option value="Tool Issue">Tool Issue</option> <option value="Others">Others</option> <option value="Cancelled">Cancelled</option></select> <p type="password" id="password" display="none" placeholder="asinnumber"> <p type="reason" id="reason" display="none" placeholder="Reason">`, confirmButtonText: 'Submit Reason <i class="fa fa-arrow-right"></i>', showCancelButton: false, focusConfirm: false, footer: `<a type="button" target="_blank" rel="noopener noreferrer" href="http://pnq-412gv7q.ant.amazon.com:8087/EARTool/index"><i class="fa fa-arrow-right"></i> EAR Tool <i class="fa fa-arrow-left"></i></a> `, preConfirm: () => { const login = Swal.getPopup().querySelector('#login').value return { login: username, password: product_asin , reason: login} } }).then((result) => { toastMixin.fire(` *Reason Submited* User-Id: ${result.value.login} Reason: ${result.value.reason} ${result.value.password} `.trim()) }) } }); } var url= window.location.href; var isArgusDG = /^https:\/\/argus.aka.amazon.com\/#!\/dg(.*)/i.test(url); if (isArgusDG){ console.log("This is an Argus DG Page!"); waitForKeyElements (".submit-product-card-classification", addCustomSearchResult); }else{ console.log("This is not an Argus DG Page!"); } // GM_xmlhttpRequest({ // method: "POST", // url: "http://pnq-412gv7q.ant.amazon.com:8083/sideline/", // data: "username="+username+"&asin="+product_asin+"&alert_msg="+alert_msg, // headers: { // "Content-Type": "application/x-www-form-urlencoded" // },