diff options
Diffstat (limited to 'view/js')
-rw-r--r-- | view/js/main.js | 4 | ||||
-rw-r--r-- | view/js/mod_new_channel.js | 35 |
2 files changed, 27 insertions, 12 deletions
diff --git a/view/js/main.js b/view/js/main.js index 02b0f125c..f6fe475d8 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -357,6 +357,9 @@ function closeMenu(theID) { function markRead(notifType) { $.get('ping?f=&markRead='+notifType); $('.' + notifType + '-button').hide(); + $('#nav-' + notifType + '-sub').removeClass('show'); + sessionStorage.removeItem(notifType + '_notifications_cache'); + sessionStorage.removeItem('notification_open'); if(timer) clearTimeout(timer); timer = setTimeout(updateInit,2000); } @@ -436,6 +439,7 @@ function handleNotifications(data) { if(item == 0) { $('.' + index + '-button').fadeOut(); + sessionStorage.removeItem(index + '_notifications_cache'); } else { $('.' + index + '-button').fadeIn(); $('.' + index + '-update').html(item); diff --git a/view/js/mod_new_channel.js b/view/js/mod_new_channel.js index e670e1a35..7ae59032a 100644 --- a/view/js/mod_new_channel.js +++ b/view/js/mod_new_channel.js @@ -1,5 +1,7 @@ $(document).ready(function() { -// $("#id_permissions_role").sSelect(); + + $("#newchannel-submit-button").attr('disabled','disabled'); + $("#id_name").blur(function() { $("#name-spinner").show(); var zreg_name = $("#id_name").val(); @@ -13,17 +15,26 @@ }); }); - $("#id_nickname").blur(function() { - $("#nick-spinner").show(); - var zreg_nick = $("#id_nickname").val(); - $.get("new_channel/checkaddr.json?f=&nick=" + encodeURIComponent(zreg_nick),function(data) { - $("#id_nickname").val(data); - if(data.error) { - $("#help_nickname").html(""); - zFormError("#help_nickname",data.error); - } - $("#nick-spinner").hide(); - }); + $("#id_nickname").click(function() { + $("#newchannel-submit-button").attr('disabled','disabled'); }); }); + + + function validate_channel() { + $("#nick-spinner").show(); + var zreg_nick = $("#id_nickname").val(); + $.get("new_channel/checkaddr.json?f=&nick=" + encodeURIComponent(zreg_nick),function(data) { + $("#id_nickname").val(data); + if(data.error) { + $("#help_nickname").html(""); + zFormError("#help_nickname",data.error); + } + else { + $("#newchannel-submit-button").removeAttr('disabled'); + } + $("#nick-spinner").hide(); + }); + + } |