summaryrefslogtreecommitdiff
path: root/static/js
diff options
context:
space:
mode:
Diffstat (limited to 'static/js')
-rw-r--r--static/js/pichat.js1
-rwxr-xr-xstatic/js/register.js24
-rw-r--r--static/js/src/_main.js1
3 files changed, 25 insertions, 1 deletions
diff --git a/static/js/pichat.js b/static/js/pichat.js
index 1003880..0ed479a 100644
--- a/static/js/pichat.js
+++ b/static/js/pichat.js
@@ -246,6 +246,7 @@ window.Preferences = {
$.cookie(prop, null, { domain: Preferences.Domain, path: '/' });
}
};
+
window.Away = {
"UnseenMsgCounter": 0,
"OrigTitle": "",
diff --git a/static/js/register.js b/static/js/register.js
index d2d513d..4352c19 100755
--- a/static/js/register.js
+++ b/static/js/register.js
@@ -64,8 +64,30 @@ function submitRegistration() {
});
}
+function hasLocalStorage() {
+ try {
+ return 'localStorage' in window && window['localStorage'] !== null;
+ } catch (e) {
+ return false;
+ }
+}
+
function initRegister() {
- $('#submit').click(submitRegistration);
+ var date = new Date ()
+ var open_reg = false || ! ('LoggedIn' in window)
+ if (hasLocalStorage() && localStorage.is_banned == "true") {
+ $('.regopen').remove()
+ $('.log-in').remove()
+ $('#forgetpw').remove()
+ return
+ }
+ if (open_reg || ( date.getHours() >= 8 && date.getHours() <= 17 )) {
+ $('.regclosed').remove()
+ $('#submit').click(submitRegistration);
+ }
+ else {
+ $('.regopen').remove()
+ }
}
// sha1.js
diff --git a/static/js/src/_main.js b/static/js/src/_main.js
index b2fe1a9..c95b98a 100644
--- a/static/js/src/_main.js
+++ b/static/js/src/_main.js
@@ -46,3 +46,4 @@ window.Preferences = {
$.cookie(prop, null, { domain: Preferences.Domain, path: '/' });
}
};
+