diff options
author | Andrew Manning <tamanning@zoho.com> | 2018-02-22 15:10:20 -0500 |
---|---|---|
committer | Andrew Manning <tamanning@zoho.com> | 2018-02-22 15:10:20 -0500 |
commit | 70719c67d30810c8127707b0dd1fd7ed66aa4a9a (patch) | |
tree | 3dd9d547d2e15007689106cc26d60ba067b3a7b8 /view | |
parent | 43fca182e3915734587abf389d819546ebade3a4 (diff) | |
parent | 80ce2def461705ebd0853e99ddfc0d1bc1de2915 (diff) | |
download | volse-hubzilla-70719c67d30810c8127707b0dd1fd7ed66aa4a9a.tar.gz volse-hubzilla-70719c67d30810c8127707b0dd1fd7ed66aa4a9a.tar.bz2 volse-hubzilla-70719c67d30810c8127707b0dd1fd7ed66aa4a9a.zip |
Merge branch 'dev' into oauth2
Diffstat (limited to 'view')
-rw-r--r-- | view/js/mod_new_channel.js | 35 | ||||
-rwxr-xr-x | view/tpl/new_channel.tpl | 4 |
2 files changed, 26 insertions, 13 deletions
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(); + }); + + } diff --git a/view/tpl/new_channel.tpl b/view/tpl/new_channel.tpl index c4837064f..f415e4e2c 100755 --- a/view/tpl/new_channel.tpl +++ b/view/tpl/new_channel.tpl @@ -24,7 +24,9 @@ {{include file="field_input.tpl" field=$nickname}} <div id="nick-spinner" class="spinner-wrapper"><div class="spinner m"></div></div> - <button class="btn btn-primary" type="submit" name="submit" id="newchannel-submit-button" value="{{$submit}}">{{$submit}}</button> + <button class="btn btn-secondary" name="validate" id="newchannel-validate-button" value="{{$validate}}" onclick="validate_channel(); return false;">{{$validate}}</button> + + <button class="btn btn-primary" type="submit" name="submit" id="newchannel-submit-button" value="{{$submit}}" >{{$submit}}</button> <div id="newchannel-submit-end" class="clear"></div> <div id="newchannel-import-link" class="descriptive-paragraph" >{{$label_import}}</div> |