diff --git a/.gitignore b/.gitignore index e83f2413b2..8f0138635b 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ public/config.json public/css/*.css public/themes/* !/public/themes/vanilla +!/public/themes/cerulean *.sublime-project *.sublime-workspace plugins/* diff --git a/public/css/nodebb.less b/public/css/nodebb.less index 2b29bad852..cb51c9496a 100644 --- a/public/css/nodebb.less +++ b/public/css/nodebb.less @@ -1 +1 @@ -@import "../themes/vanilla/vanilla.less"; \ No newline at end of file +@import "../themes/cerulean/cerulean.less"; \ No newline at end of file diff --git a/public/src/forum/accountedit.js b/public/src/forum/accountedit.js index a08ad5a945..ab2c6cf16b 100644 --- a/public/src/forum/accountedit.js +++ b/public/src/forum/accountedit.js @@ -119,7 +119,7 @@ $(document).ready(function() { gravatarPicture = data.gravatarpicture; } } else { - app.alertError('There was an error updating your profile!'); + app.alertError('There was an error updating your profile! ' + err.error); } }); return false; @@ -222,50 +222,59 @@ $(document).ready(function() { function onPasswordChanged() { passwordvalid = utils.isPasswordValid(password.val()); - if (password.val().length < 6) { + if (password.val().length < config.minimumPasswordLength) { password_notify.html('Password too short'); - password_notify.attr('class', 'label label-danger'); + password_notify.attr('class', 'alert alert-danger'); + password_notify.removeClass('hide'); } else if(!passwordvalid) { password_notify.html('Invalid password'); - password_notify.attr('class', 'label label-danger'); + password_notify.attr('class', 'alert alert-danger'); + password_notify.removeClass('hide'); } else { password_notify.html('OK!'); - password_notify.attr('class', 'label label-success'); + password_notify.attr('class', 'alert alert-success'); + password_notify.removeClass('hide'); } onPasswordConfirmChanged(); } function onPasswordConfirmChanged() { + if(password_notify.hasClass('alert-danger') || !password_confirm.val()) { + password_confirm_notify.addClass('hide'); + return; + } if(password.val() !== password_confirm.val()) { password_confirm_notify.html('Passwords must match!'); - password_confirm_notify.attr('class', 'label label-danger'); + password_confirm_notify.attr('class', 'alert alert-danger'); + password_confirm_notify.removeClass('hide'); passwordsmatch = false; } else { password_confirm_notify.html('OK!'); - password_confirm_notify.attr('class', 'label label-success'); + password_confirm_notify.attr('class', 'alert alert-success'); + password_confirm_notify.removeClass('hide'); passwordsmatch = true; } } - password.on('keyup', onPasswordChanged); - password_confirm.on('keyup', onPasswordConfirmChanged); + password.on('blur', onPasswordChanged); + password_confirm.on('blur', onPasswordConfirmChanged); $('#changePasswordBtn').on('click', function() { if(passwordvalid && passwordsmatch && currentPassword.val()) { - socket.emit('api:user.changePassword', {'currentPassword': currentPassword.val(),'newPassword': password.val() }, function(data) { + socket.emit('api:user.changePassword', {'currentPassword': currentPassword.val(),'newPassword': password.val() }, function(err) { currentPassword.val(''); password.val(''); password_confirm.val(''); - password_notify.html(''); - password_confirm_notify.html(''); + password_notify.addClass('hide'); + password_confirm_notify.addClass('hide'); passwordsmatch = false; passwordvalid = false; - if(data.err) { - app.alertError(data.err); + if(err) { + app.alertError(err.error); return; } diff --git a/public/src/forum/topic.js b/public/src/forum/topic.js index 399a03cc25..7203bf41d6 100644 --- a/public/src/forum/topic.js +++ b/public/src/forum/topic.js @@ -611,7 +611,7 @@ - var postAuthorImage, postAuthorInfo, pagination; + var postAuthorImage, mobileAuthorOverlay, pagination; var postcount = templates.get('postcount'); function updateHeader() { @@ -624,9 +624,9 @@ }); } - jQuery('.post-author-info').css('bottom', '0px'); - postAuthorImage = postAuthorImage || document.getElementById('post-author-image'); - postAuthorInfo = postAuthorInfo || document.getElementById('post-author-info'); + jQuery('.mobile-author-overlay').css('bottom', '0px'); + postAuthorImage = postAuthorImage || document.getElementById('mobile-author-image'); + mobileAuthorOverlay = mobileAuthorOverlay || document.getElementById('mobile-author-overlay'); pagination = pagination || document.getElementById('pagination'); pagination.parentNode.style.display = 'block'; @@ -637,7 +637,7 @@ if (scrollTop < 50 && postcount > 1) { postAuthorImage.src = (jQuery('.main-avatar img').attr('src')); - postAuthorInfo.innerHTML = 'Posted by ' + jQuery('.main-post').attr('data-username') + ', ' + jQuery('.main-post').find('.relativeTimeAgo').html(); + mobileAuthorOverlay.innerHTML = 'Posted by ' + jQuery('.main-post').attr('data-username') + ', ' + jQuery('.main-post').find('.relativeTimeAgo').html(); pagination.innerHTML = '0 out of ' + postcount; return; } @@ -662,7 +662,7 @@ if (inView) { pagination.innerHTML = this.postnumber + ' out of ' + postcount; postAuthorImage.src = (jQuery(this).find('.profile-image-block img').attr('src')); - postAuthorInfo.innerHTML = 'Posted by ' + jQuery(this).attr('data-username') + ', ' + jQuery(this).find('.relativeTimeAgo').html(); + mobileAuthorOverlay.innerHTML = 'Posted by ' + jQuery(this).attr('data-username') + ', ' + jQuery(this).find('.relativeTimeAgo').html(); } }); diff --git a/public/templates/accountedit.tpl b/public/templates/accountedit.tpl index 7b727c2368..c551109092 100644 --- a/public/templates/accountedit.tpl +++ b/public/templates/accountedit.tpl @@ -149,17 +149,19 @@