Guest User

voucher-input-1.1.js

a guest
Dec 20th, 2015
217
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.1
  6. // @author          wcypierre
  7. // @match           https://forum.lowyat.net/*3803648*
  8. // @include         https://forum.lowyat.net/*3803648*
  9. // @grant           GM_log
  10. // ==/UserScript==
  11.  
  12. if(!$('#main_thread').length)
  13. {
  14.     $('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(enter if none\/RM100)\"); var optimum_purchase = prompt(\"Optimum Purchase(enter 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 + \":\" + optimum_purchase + \":\" + platform + \":\" + usage + \":\" + notes + \"SUBMIT\"; $(\"textarea\").append(code); return false;'>Add/Modify Voucher</button>");
  15. }
  16.  
  17. if(!$('#reply_thread').length)
  18. {
  19.     $("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(enter if none\/RM100)\"); var optimum_purchase = prompt(\"Optimum Purchase(enter 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 + \":\" + optimum_purchase + \":\" + platform + \":\" + usage + \":\" + notes + \"SUBMIT\"; $(\"textarea\").append(code); return false;'>Add/Modify Voucher</button>");
  20. }
Advertisement
Add Comment
Please, Sign In to add comment