NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name Docker // @author @shjaisw // @namespace kalpdev // @description Give live environment Argus view for OJT // @match https://argus.aka.amazon.com/* // @include https://argus.aka.amazon.com/* // @updateURL https://openuserjs.org/meta/kalpdev.1/Docker.meta.js // @downloadURL https://openuserjs.org/install/kalpdev.1/Docker.user.js // @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 1.0 // @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; }' + 'md-icon-button.md-button.md-dg-theme{display:none;}' + 'md-content.transparent.catalog-tab-content.layout-padding.ng-scope._md.md-dg-theme.layout-align-center-start.layout-row { display: none;}' + 'md-list.dt-utils-list.md-primary.md-dg-theme.layout-column{ 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(){ Swal.fire({ icon: 'success', title: 'You Have classified the ASIN! ', footer: 'Please reach out to @shjaisw if bug found', backdrop: ` rgba(5,59,37,0.19) left top no-repeat `, showCancelButton: true, focusConfirm: false, allowOutsideClick: false, allowEscapeKey: false, confirmButtonText: 'Save the classification in Excel <i class="fa fa-arrow-right"></i>', showCancelButton: false, focusConfirm: false,}) if(resources_container!="") { Swal.fire({ icon: 'success', title: 'You Have classified the ASIN! ', footer: 'Please reach out to @shjaisw if bug found', backdrop: ` rgba(5,59,37,0.19) left top no-repeat `, showCancelButton: true, focusConfirm: false, allowOutsideClick: false, allowEscapeKey: false, confirmButtonText: 'Save the classification in Excel <i class="fa fa-arrow-right"></i>', showCancelButton: false, focusConfirm: false,}) $("#click_me").hide (); window.location = "https://argus.aka.amazon.com/#!/dg/dashboard"; } else { $("#finishProductButton").trigger('hide'); } }); } 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!"); }