diff options
Diffstat (limited to 'static/functions/form_validate.js')
-rw-r--r-- | static/functions/form_validate.js | 70 |
1 files changed, 34 insertions, 36 deletions
diff --git a/static/functions/form_validate.js b/static/functions/form_validate.js index cdf4b15..9f7aad6 100644 --- a/static/functions/form_validate.js +++ b/static/functions/form_validate.js @@ -1,37 +1,35 @@ -(function ($) { - $(document).ready(function() { - var parts = window.location.pathname.split('/'); - var page = parts[parts.length - 1].split(".")[0]; - var splitted = window.location.search.substr(1).split("&"); - var query = {}; - for (var i = 0; i < splitted.length; i++) { - var q = splitted[i].split("="); - query[q[0]] = q[1]; - }; +$(document).ready(function() { + var parts = window.location.pathname.split('/'); + var page = parts[parts.length - 1].split(".")[0]; + var splitted = window.location.search.substr(1).split("&"); + var query = {}; + for (var i = 0; i < splitted.length; i++) { + var q = splitted[i].split("="); + query[q[0]] = q[1]; + }; - switch(page) { - case "forums": - if(query['action'] == "new") { - $("#newthreadform").validate(); - } - break; - case "reports": - if(query['action'] == "report") { - $("#report_form").validate(); - } - break; - case "inbox": - if(query['action'] == "viewconv" || query['action'] == "compose") { - $("#messageform").validate(); - } - break; - case "user": - if(query['action'] == "notify") { - $("#filter_form").validate(); - } - break; - default: - break; - } - }); -} (jQuery)); + switch (page) { + case "forums": + if (query['action'] == "new") { + $("#newthreadform").validate(); + } + break; + case "reports": + if (query['action'] == "report") { + $("#report_form").validate(); + } + break; + case "inbox": + if (query['action'] == "viewconv" || query['action'] == "compose") { + $("#messageform").validate(); + } + break; + case "user": + if (query['action'] == "notify") { + $("#filter_form").validate(); + } + break; + default: + break; + } +}); |