0
0
mirror of https://github.com/Doodle3D/doodle3d-connect.git synced 2024-12-24 17:43:48 +01:00

Show password

This commit is contained in:
peteruithoven 2014-05-01 13:11:59 +02:00
parent 5f6ff93492
commit 089dae1307
2 changed files with 20 additions and 18 deletions

View File

@ -25,30 +25,30 @@
_form = _page.find("form");
_passwordField = _form.find("input[name=password]");
_submitButton = _form.find("input[type=submit]");
_form.submit(function(){
console.log("JoinSecuredNetworkPage:submit");
// ToDo: validation
// http://www.raymondcamden.com/index.cfm/2012/7/30/Example-of-form-validation-in-a-jQuery-Mobile-Application
var linkParams = _pageData;
linkParams.password = _passwordField.val();
var submitLink = _form.data("target");
submitLink = d3d.util.replaceURLParameters(submitLink,_pageData);
$.mobile.changePage(submitLink);
return false;
});
// ToDo show password button?
// http://unwrongest.com/projects/show-password/
// http://trevordavis.net/blog/jquery-show-password-plugin
});
_passwordField.showPassword();
_form.submit(join);
});
$.mobile.document.on( "pagebeforeshow", PAGE_ID, function( event, data ) {
console.log(PAGE_ID+" pagebeforeshow");
_pageData = d3d.util.getPageParams(PAGE_ID);
console.log(" _pageData: ",_pageData);
_title.text("Join "+_pageData.ssid);
_form.attr("id","Join "+_pageData.ssid);
_passwordField.val("");
});
$.mobile.document.on( "pagehide", PAGE_ID, function( event, data ) {
console.log(PAGE_ID+" pagehide");
});
function join(){
console.log("JoinSecuredNetworkPage:submit");
// ToDo: validation
// http://www.raymondcamden.com/index.cfm/2012/7/30/Example-of-form-validation-in-a-jQuery-Mobile-Application
var linkParams = _pageData;
linkParams.password = _passwordField.val();
var submitLink = _form.data("target");
submitLink = d3d.util.replaceURLParameters(submitLink,_pageData);
$.mobile.changePage(submitLink);
return false;
}
})(window);

View File

@ -138,7 +138,9 @@
<div role="main" class="ui-content">
<h3>Join a secured network</h3>
<form data-ajax="false" data-target="#connecting_to_network">
<input type="password" name="password" placeholder="Password" data-clear-btn="true">
<input type="password" name="password" placeholder="Password" data-clear-btn="true" data-typetoggle='#showPassword' autocomplete="off">
<input id="showPassword" type="checkbox" value="showPassword">
<label for="showPassword" class="inline">show password</label>
<input type=submit value="Connect">
</form>
</div><!-- /content -->