Raw Source
kalpdev.1 / Document highlight2

// ==UserScript==
// @name        Document highlight2
// @author    @shjaisw
// @namespace   kalpdev
// @description document in red if present and gives popup to check all
// @match    https://argus.aka.amazon.com/*
// @include  https://argus.aka.amazon.com/*
// @require     https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js
// @require     https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js
// @require  https://gist.github.com/raw/2625891/waitForKeyElements.js
//@require https://cdn.jsdelivr.net/npm/sweetalert2@10
// @resource    buttonCSS https://raw.githubusercontent.com/necolas/css3-github-buttons/master/gh-buttons.css
// @resource    bootstrapCSS https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css
// @resource    githubButtonIconSet https://raw.githubusercontent.com/necolas/css3-github-buttons/master/gh-icons.png
// @grant    GM_xmlhttpRequest
// @grant    GM_addStyle
// @grant       GM_getResourceText
// @grant       GM_getResourceURL
// @version     3.0

// @copyrights  kalpdev
// @license MIT

// ==/UserScript==



console.log("Start");

document.head.appendChild(cssElement(GM_getResourceURL ("githubButtonIconSet")));
document.head.appendChild(cssElement(GM_getResourceURL ("buttonCSS")));
document.head.appendChild(cssElement(GM_getResourceURL ("bootstrapCSS")));

function cssElement(url) {
  $("#category").removeClass("hidden");
  var link = document.createElement("link");
  link.href = url;
  link.rel="stylesheet";
  link.type="text/css";
  return link;
}

function highlightDoc(css) {
    var head, style;
    head = document.getElementsByTagName('head')[0];
    if (!head) { return; }
    style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = css;
    head.appendChild(style);
}


highlightDoc (
	'button.md-no-style.md-button.ng-scope.md-dg-theme { background: #ff000094; }'
+
'div.toggle_header.strong.md-subheader._md.ng-scope.md-dg-theme.layout-align-center-center.layout-row { border-radius: 4px; position: relative; display: none;  }'
   );

              waitForKeyElements ("#dtProductFinal > div.w-75.layout-align-center-center.layout-column", addCustomSearchResult);

function addCustomSearchResult (jNode) {
    $("#finishProductButton").hide ();

    jNode.append (
        '<button class="select-card dg-accent-card answer-select md-button md-dg-theme md-whiteframe-1dp" type="button" id="click_me" class="click_me" >Finish Product</button>'
    );

    $('#click_me').click(function(){
        var resources_container = $("#resources_container").text();
        resources_container = resources_container.trim();
        if(resources_container!="")
        {
            Swal.fire({
  icon: 'question', title: 'Have you checked all Attached Documents? ', footer: 'If document not visible, refresh argus!',
    backdrop: `
    rgba(5,59,37,0.19)
    left top
    no-repeat
  `,
  showCancelButton: true, focusConfirm: false, allowOutsideClick: false, allowEscapeKey: false,

  confirmButtonText: 'Checked&nbsp;<i class="fa fa-arrow-right"></i>',
  showCancelButton: false,
  focusConfirm: false,})

            $("#click_me").hide ();
            $("#finishProductButton").show ();
        }
        else
        {
            $("#finishProductButton").trigger('click');
        }
    });
}


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!");
}