Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions core/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,9 @@ label.infield {
}
#personal-show + label {
height: 14px;
margin-top: 14px;
margin-left: -36px;
margin-top: -25px;
left: 295px;
display: block;
}
#passwordbutton {
margin-left: .5em;
Expand Down
4 changes: 4 additions & 0 deletions settings/css/settings.css
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ input#identity {
padding: 3px;
}

.password-state {
display: inline-block;
}

table.nostyle label { margin-right: 2em; }
table.nostyle td { padding: 0.2em 0; }

Expand Down
20 changes: 17 additions & 3 deletions settings/js/personal.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,16 @@ $(document).ready(function () {
if($('#pass2').length) {
$('#pass2').showPassword().keyup();
}

var removeloader = function () {
setTimeout(function(){
if ($('.password-state').length > 0) {
$('.password-state').remove();
}
}, 5000)
};

$("#passwordbutton").click(function () {
OC.msg.startSaving('#password-error-msg');
var isIE8or9 = $('html').hasClass('lte9');
// FIXME - TODO - once support for IE8 and IE9 is dropped
// for IE8 and IE9 this will check additionally if the typed in password
Expand All @@ -210,12 +218,17 @@ $(document).ready(function () {
var post = $("#passwordform").serialize();
$('#passwordchanged').hide();
$('#passworderror').hide();
$("#passwordbutton").attr('disabled', 'disabled');
$("#passwordbutton").after("<span class='password-loading icon icon-loading-small-dark password-state'></span>");
$(".personal-show-label").hide();
// Ajax foo
$.post(OC.generateUrl('/settings/personal/changepassword'), post, function (data) {
if (data.status === "success") {
$("#passwordbutton").after("<span class='checkmark icon icon-checkmark password-state'></span>");
removeloader();
$(".personal-show-label").show();
$('#pass1').val('');
$('#pass2').val('').change();
OC.msg.finishedSaving('#password-error-msg', data);
} else {
if (typeof(data.data) !== "undefined") {
OC.msg.finishedSaving('#password-error-msg', data);
Expand All @@ -230,6 +243,8 @@ $(document).ready(function () {
);
}
}
$(".password-loading").remove();
$("#passwordbutton").removeAttr('disabled');
});
return false;
} else {
Expand All @@ -243,7 +258,6 @@ $(document).ready(function () {
);
return false;
}

});

$('#displayName').keyUpDelayedOrEnter(changeDisplayName);
Expand Down
2 changes: 1 addition & 1 deletion settings/templates/personal.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
placeholder="<?php echo $l->t('New password');?>"
data-typetoggle="#personal-show"
autocomplete="off" autocapitalize="off" autocorrect="off" />
<input type="checkbox" id="personal-show" name="show" /><label for="personal-show"></label>
<input type="checkbox" id="personal-show" name="show" /><label for="personal-show" class="personal-show-label"></label>
<input id="passwordbutton" type="submit" value="<?php echo $l->t('Change password');?>" />
<br/>
</form>
Expand Down