summaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
Diffstat (limited to 'static')
-rw-r--r--static/js/pichat.js21
-rw-r--r--static/js/pichat2.js21
-rwxr-xr-xstatic/js/register.js8
-rw-r--r--static/js/src/chat.js2
-rw-r--r--static/js/src/drag.js18
5 files changed, 42 insertions, 28 deletions
diff --git a/static/js/pichat.js b/static/js/pichat.js
index 5f20803..ceeb397 100644
--- a/static/js/pichat.js
+++ b/static/js/pichat.js
@@ -445,7 +445,7 @@ function removeOldMessages(){
}
}
-window.TextEnabled = Preferences.getProperty("chat.textEnabled", "true") == "none";
+window.TextEnabled = Preferences.getProperty("chat.textEnabled", "true") == "true";
window.ImgsEnabled = Preferences.getProperty("chat.imgsEnabled", "true") == "true";
function muteSelector() {
@@ -547,6 +547,7 @@ function dragTarget (target, callbacks) {
}
base.enter = function(e){
base.target.classList.add('over');
+ console.log(e.target);
if ('enter' in callbacks) {
callbacks.enter(Drag.url);
}
@@ -577,17 +578,21 @@ function dragTarget (target, callbacks) {
}
base.drop = function(e){
base.target.classList.remove('over');
- if (e.stopPropagation) {
- e.stopPropagation(); // stops the browser from redirecting.
- }
- if (e.preventDefault) {
- e.preventDefault();
- }
+ e.stopPropagation(); // stops the browser from redirecting.
+ e.preventDefault();
if ('drop' in callbacks) {
- callbacks.drop(Drag.url);
+ if (e.dataTransfer) {
+ var url = e.dataTransfer.getData("url");
+ if (url) {
+ callbacks.drop(url);
+ }
+ } else {
+ callbacks.drop(Drag.url);
+ }
}
return false;
}
+
base.init();
};
diff --git a/static/js/pichat2.js b/static/js/pichat2.js
index 5f20803..ceeb397 100644
--- a/static/js/pichat2.js
+++ b/static/js/pichat2.js
@@ -445,7 +445,7 @@ function removeOldMessages(){
}
}
-window.TextEnabled = Preferences.getProperty("chat.textEnabled", "true") == "none";
+window.TextEnabled = Preferences.getProperty("chat.textEnabled", "true") == "true";
window.ImgsEnabled = Preferences.getProperty("chat.imgsEnabled", "true") == "true";
function muteSelector() {
@@ -547,6 +547,7 @@ function dragTarget (target, callbacks) {
}
base.enter = function(e){
base.target.classList.add('over');
+ console.log(e.target);
if ('enter' in callbacks) {
callbacks.enter(Drag.url);
}
@@ -577,17 +578,21 @@ function dragTarget (target, callbacks) {
}
base.drop = function(e){
base.target.classList.remove('over');
- if (e.stopPropagation) {
- e.stopPropagation(); // stops the browser from redirecting.
- }
- if (e.preventDefault) {
- e.preventDefault();
- }
+ e.stopPropagation(); // stops the browser from redirecting.
+ e.preventDefault();
if ('drop' in callbacks) {
- callbacks.drop(Drag.url);
+ if (e.dataTransfer) {
+ var url = e.dataTransfer.getData("url");
+ if (url) {
+ callbacks.drop(url);
+ }
+ } else {
+ callbacks.drop(Drag.url);
+ }
}
return false;
}
+
base.init();
};
diff --git a/static/js/register.js b/static/js/register.js
index 0f5bb1f..ff93b0b 100755
--- a/static/js/register.js
+++ b/static/js/register.js
@@ -5,11 +5,11 @@ function validateEmail(email) {
}
function submitRegistration() {
- var nick = $('#nickInput').val();
- var email = $('#emailInput').val();
+ var nick = $('#regNickInput').val();
+ var email = $('#regEmailInput').val();
var terms = $('#terms').val();
- var password = $('#passwordInput').val() || "";
- var password2 = $('#passwordInput2').val() || "";
+ var password = $('#regPasswordInput').val() || "";
+ var password2 = $('#regPasswordInput2').val() || "";
if (nick.length < 3 || nick.length > 12) {
alert("Nicks must be between 3 and 12 characters long.");
diff --git a/static/js/src/chat.js b/static/js/src/chat.js
index 09954de..f24917c 100644
--- a/static/js/src/chat.js
+++ b/static/js/src/chat.js
@@ -166,7 +166,7 @@ function removeOldMessages(){
}
}
-window.TextEnabled = Preferences.getProperty("chat.textEnabled", "true") == "none";
+window.TextEnabled = Preferences.getProperty("chat.textEnabled", "true") == "true";
window.ImgsEnabled = Preferences.getProperty("chat.imgsEnabled", "true") == "true";
function muteSelector() {
diff --git a/static/js/src/drag.js b/static/js/src/drag.js
index b48c365..48b3266 100644
--- a/static/js/src/drag.js
+++ b/static/js/src/drag.js
@@ -45,17 +45,21 @@ function dragTarget (target, callbacks) {
}
base.drop = function(e){
base.target.classList.remove('over');
- if (e.stopPropagation) {
- e.stopPropagation(); // stops the browser from redirecting.
- }
- if (e.preventDefault) {
- e.preventDefault();
- }
+ e.stopPropagation(); // stops the browser from redirecting.
+ e.preventDefault();
if ('drop' in callbacks) {
- callbacks.drop(Drag.url);
+ if (e.dataTransfer) {
+ var url = e.dataTransfer.getData("url");
+ if (url) {
+ callbacks.drop(url);
+ }
+ } else {
+ callbacks.drop(Drag.url);
+ }
}
return false;
}
+
base.init();
};