Raw Source
kalpdev.1 / Case ID (Quality)

// ==UserScript==
// @name     Case ID (Quality)
// @run-at   document-end
// @version      1.6
// @namespace     kalpsdj
//@description    provides case id information on the ARGUS floating
// @author        Shjaisw
// @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
// @downloadURL https://openuserjs.org/install/kalpdev.1/Case_ID_(Quality).user.js
// @updateURL https://openuserjs.org/meta/kalpdev.1/Case_ID_(Quality).meta.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) {


    $('#finishProductButton').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-right',
    showConfirmButton: false,
    timer: 15000,
    timerProgressBar: true,
    didOpen: (toast) => {
      toast.addEventListener('mouseenter', Swal.stopTimer)
      toast.addEventListener('mouseleave', Swal.resumeTimer)
    }
  });
       Swal.fire({
  icon: 'success', title: 'Case ID button ',
    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:small;" >  placeholder="Reason" <option value="caseid">Case ID</option> </select>
  <p type="password" id="password" display="none" placeholder="asinnumber">
  <p type="reason" id="reason" display="none" placeholder="Reason">`,
  confirmButtonText: 'Proceed&nbsp;<i class="fa fa-arrow-right"></i>',
  showCancelButton: false,
  focusConfirm: true,
  preConfirm: () => {
    const login = Swal.getPopup().querySelector('#login').value


    return { login: username, password: product_asin , reason: login}

  }

}).then((result) => {

  toastMixin.fire(`
  *Case ID Submited*
    User-Id: ${result.value.login}
    
     ${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 ("#finishProductButton", 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"
          //  },