Advertisement
Guest User

voucher-input.js

a guest
Dec 12th, 2015
2,583
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name            Voucher Input
  3. // @namespace       http://wcypierre.net
  4. // @description     Gives user an easier way to input voucher inside lowyat forum
  5. // @version         1.0
  6. // @author          wcypierre
  7. // @include         https://forum.lowyat.net/*3803648*
  8. // @grant           GM_log
  9. // ==/UserScript==
  10.  
  11. if(!$('#main_thread').length)
  12. {
  13.     $('tbody > tr:eq(2) >td.pformright').append("<button id='main_thread' onclick='alert(\"All the values shown next are just sample values, replace it with the actual voucher value\"); var voucher = prompt(\"Voucher\"); var value = prompt(\"Value(RM30\/15%)\"); var max_discount = prompt(\"Max Discount(Press enter if none\/RM100):\"); var min_purchase = prompt(\"Min Purchase(0 if none\/RM100)\"); var platform = prompt(\"Platform(App\/Desktop\/Both):\"); var usage = prompt(\"Usage(One Time Only\/Multiple Time\/New User Only\/Limited Quantity):\"); var notes = prompt(\"Notes(Press enter if none\/Type your notes):\"); var code = \"VOUCHER:\" + voucher + \":\" + value + \":\" + max_discount + \":\" + min_purchase + \":\" + platform + \":\" + usage + \":\" + notes + \"SUBMIT\"; $(\"textarea\").append(code); return false;'>Add/Modify Voucher</button>");
  14. }
  15.  
  16. if(!$('#reply_thread').length)
  17. {
  18.     $("td.nopad").prepend("<button id='reply_thread' onclick='alert(\"All the values shown next are just sample values, replace it with the actual voucher value\"); var voucher = prompt(\"Voucher\"); var value = prompt(\"Value(RM30\/15%)\"); var max_discount = prompt(\"Max Discount(Press enter if none\/RM100):\"); var min_purchase = prompt(\"Min Purchase(0 if none\/RM100)\"); var platform = prompt(\"Platform(App\/Desktop\/Both):\"); var usage = prompt(\"Usage(One Time Only\/Multiple Time\/New User Only\/Limited Quantity):\"); var notes = prompt(\"Notes(Press enter if none\/Type your notes):\"); var code = \"VOUCHER:\" + voucher + \":\" + value + \":\" + max_discount + \":\" + min_purchase + \":\" + platform + \":\" + usage + \":\" + notes + \"SUBMIT\"; $(\"textarea\").append(code); return false;'>Add/Modify Voucher</button>");
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement