aboutsummaryrefslogtreecommitdiff
path: root/web/scripts3.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/scripts3.js')
-rw-r--r--web/scripts3.js37
1 files changed, 23 insertions, 14 deletions
diff --git a/web/scripts3.js b/web/scripts3.js
index 8be4d551..f4a21da3 100644
--- a/web/scripts3.js
+++ b/web/scripts3.js
@@ -96,23 +96,32 @@ function openSocialWindow(url) {
if(window.focus) w.focus();
}
+function checkUsername() {
+ var uname=$('#username').val();
+ $.ajax('http://api.juick.com/users?uname='+uname).done(function() {
+ $('#username').css('background','#FFCCCC');
+ }).fail(function() {
+ $('#username').css('background','#CCFFCC');
+ });
+}
+
/******************************************************************************/
jQuery.fn.selectText = function(){
- var doc = document;
- var element = this[0];
- console.log(this, element);
- if (doc.body.createTextRange) {
- var range = document.body.createTextRange();
- range.moveToElementText(element);
- range.select();
- } else if (window.getSelection) {
- var selection = window.getSelection();
- var range = document.createRange();
- range.selectNodeContents(element);
- selection.removeAllRanges();
- selection.addRange(range);
- }
+ var doc = document;
+ var element = this[0];
+ console.log(this, element);
+ if (doc.body.createTextRange) {
+ var range = document.body.createTextRange();
+ range.moveToElementText(element);
+ range.select();
+ } else if (window.getSelection) {
+ var selection = window.getSelection();
+ var range = document.createRange();
+ range.selectNodeContents(element);
+ selection.removeAllRanges();
+ selection.addRange(range);
+ }
};
/*