// ==UserScript== // @name Tokopedia - Bulk Print // @namespace BulkPrint // @description Plugin Tokopedia (unofficial) untuk menggabungkan 2 atau lebih detail pengiriman, tujuan utamanya untuk mengurangi jumlah kertas cetak. // @include https://www.tokopedia.com/myshop_order_process.pl // @exclude // @version 1.0 // @grant none // @author dimazarno // @downloadURL none // ==/UserScript== $(".maincontent-admin").append("
"); $("#myshop-order-list").find(".mt-10:first").append(''); $('#printClick').on('click',function(){ var myHTML = $("#bulk-print").html(); var scriptNode = document.createElement('script'), targ = document.getElementsByTagName ('head')[0] || document.body || document.documentElement; scriptNode.type = "text/javascript"; scriptNode.textContent = "(function(html){var d=window.open('about:blank', '_blank').document;d.open();d.write(html);d.close();})(" + JSON.stringify(myHTML) + ");"; targ.appendChild(scriptNode); }); $('.order_checkbox').on('change',function(){ var value = $(this).attr('value'); if ($(this).is(':checked')){ var $row = $("#order-"+value); var dest_receiver_name = $row.find(".dest_receiver_name").val(); var dest_address = $row.find(".dest_address").val().replace(new RegExp("