Guest User

Untitled

a guest
Jul 20th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. // Make sure you wrap the script in a script tag
  2. // Insert this after the <h1 class="receiptTypeTitle"> in the Sales template
  3.  
  4. document.addEventListener("DOMContentLoaded", function(event) {
  5. let regx1 = /([\s\S]+?\b[ap]m\b)[\s\S]+/ig;
  6. let regx2 = /([\s\S]+#\d{0,})[\s\S]+/ig;
  7. var div = document.querySelectorAll('.line_note');
  8. div.forEach(function(div) {
  9. var content = div.innerHTML;
  10. var search = content.includes("Work order");
  11. if (search === true) {
  12. if (regx1.test(content)) {
  13. new_str = content.replace(regx1, "$1");
  14. } else {
  15. new_str = content.replace(regx2, "$1");
  16. }
  17. div.innerHTML = new_str;
  18. let targetBreak = document.querySelector('.line_note br');
  19. targetBreak.style.cssText="display: none";
  20. }
  21. });
  22.  
  23. });
Add Comment
Please, Sign In to add comment