Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Voucher Input
- // @namespace http://wcypierre.net
- // @description Gives user an easier way to input voucher inside lowyat forum
- // @version 1.0
- // @author wcypierre
- // @include https://forum.lowyat.net/*3803648*
- // @grant GM_log
- // ==/UserScript==
- if(!$('#main_thread').length)
- {
- $('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>");
- }
- if(!$('#reply_thread').length)
- {
- $("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>");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement