From c3bfb8635649213535059ea0deacbc0bfb1c0d40 Mon Sep 17 00:00:00 2001 From: Milosz Kwiatkowski Date: Sat, 20 Aug 2016 14:31:49 +0100 Subject: add rules agreement page --- js/rules-popup.js | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 js/rules-popup.js (limited to 'js') diff --git a/js/rules-popup.js b/js/rules-popup.js new file mode 100644 index 00000000..a94db90e --- /dev/null +++ b/js/rules-popup.js @@ -0,0 +1,51 @@ +/* + * rules-popup.js + * https://github.com/mkwia/lainchan/js/rules-popup.js + * + * Forces user to accept rules from /rules.txt on first welcome + * + * 2016 mkwia + * + * Usage: + * $config['additional_javascript'][] = 'js/jquery.min.js'; + * $config['additional_javascript'][] = 'js/rules-popup.js'; + * + */ + +$(function() { + if (typeof localStorage.rulesAccepted === "undefined") + function(c) { + var d = $("
").prependTo("body").width("80%").height("80%") + .css("z-index", 9999).css("position", "fixed") + .css("top", "50%").css("bottom", 0).css("left", "50%").css("right", 0) + .css("margin-top", "-40vh").css("margin-left", "-40%") + .css("background", "black") + .css("text-align", "center").css("font-family", "sans-serif") + .css("font-size", "14px").css("color", "white") + + d.html("" + + + "
lainchan rule agreement
" + + + "
" + + "
" + + "
" + + "
" + + + "
" + + "
If you accept the rules, retype the captcha and press ACCEPT.
" + + "
" + c + "
" + + "
" + + "" + + "" + + "
" + + "
" + + "
" + + + ""); + + $("#rules-actual").load("/templates/rules.html"); + + }("faggotry1234"); +}); -- cgit v1.3