From c2c4c003abaa9f6b0a4b1126362fdc6f4464392a Mon Sep 17 00:00:00 2001 From: Baris Usakli Date: Fri, 17 May 2013 10:57:26 -0400 Subject: [PATCH 1/3] if the user updates their email change the email uid mapping, added 500ms delay to the disconnect modal --- public/src/app.js | 12 +++++++----- src/user.js | 3 ++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/public/src/app.js b/public/src/app.js index 911ba94f9b..9068042fa4 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -33,11 +33,13 @@ var socket, }); socket.on('disconnect', function(data){ - $('#disconnect-modal').modal('show'); - $('#reload-button').on('click',function(){ - $('#disconnect-modal').modal('hide'); - window.location.reload(); - }); + setTimeout(function() { + $('#disconnect-modal').modal('show'); + $('#reload-button').on('click',function(){ + $('#disconnect-modal').modal('hide'); + window.location.reload(); + }); + }, 500); }); }, async: false diff --git a/src/user.js b/src/user.js index 693a4f3b20..0d3dde7a72 100644 --- a/src/user.js +++ b/src/user.js @@ -90,6 +90,7 @@ var config = require('../config.js'), if(key === 'email') { User.setUserField(uid, 'gravatarpicture', User.createGravatarURLFromEmail(data[key])); + RDB.set('email:' + email +':uid', uid); } } } @@ -276,7 +277,7 @@ var config = require('../config.js'), }); RDB.set('username:' + username + ':uid', uid); - RDB.set('email:' + email +':uid', uid); + RDB.set('email:' + email +':uid', uid); if(email) User.sendConfirmationEmail(email); From c8b8899219a514c98c1a0a0cffb9810afd03ef30 Mon Sep 17 00:00:00 2001 From: Baris Usakli Date: Fri, 17 May 2013 11:07:37 -0400 Subject: [PATCH 2/3] while you are editing a post you still need to write something dude --- public/src/app.js | 18 +++++++++++++++--- public/templates/topic.tpl | 12 ++++++++---- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/public/src/app.js b/public/src/app.js index 9068042fa4..bcdb98540d 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -245,12 +245,24 @@ var socket, }; app.edit_post = function(pid) { - var content = document.getElementById('post_content'); - socket.emit('api:posts.edit', { pid: pid, content: content.value }); + var content = $('#post_content'); + + if (content.val().length < 5) { + app.alert({ + title: 'Topic Post Failure', + message: 'You need to write more dude.', + type: 'error', + timeout: 2000 + }); + + return; + } + + socket.emit('api:posts.edit', { pid: pid, content: content.val() }); jQuery(post_window).slideUp(250); $(document.body).removeClass('composing'); - content.value = ''; + content.val(''); } diff --git a/public/templates/topic.tpl b/public/templates/topic.tpl index 4ac89dcfdc..091fac6c54 100644 --- a/public/templates/topic.tpl +++ b/public/templates/topic.tpl @@ -57,7 +57,7 @@ - {posts.user_rep} + {posts.user_rep}
@@ -124,12 +124,16 @@ pinned: '{pinned}' }; - jQuery('document').ready(function() { - - $('.user_reputation_text').each(function(index, element) { + function addCommasToNumbers() { + $('.formatted-number').each(function(index, element) { $(element).html(app.addCommas($(element).html())); }); + } + + jQuery('document').ready(function() { + addCommasToNumbers(); + var room = 'topic_' + '{topic_id}', adminTools = document.getElementById('thread-tools'); From 545dc9d851993e9c7861cf935e7efcb473fb4536 Mon Sep 17 00:00:00 2001 From: Baris Usakli Date: Fri, 17 May 2013 11:54:59 -0400 Subject: [PATCH 3/3] top bar user settings are pulled right --- public/css/style.less | 8 ++++++++ public/templates/header.tpl | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/public/css/style.less b/public/css/style.less index 1d5ce86999..cef80c0496 100644 --- a/public/css/style.less +++ b/public/css/style.less @@ -691,4 +691,12 @@ a:hover { text-overflow:ellipsis; overflow: hidden; } +} + +body .navbar .nodebb-inline-block { + display:inline-block; +} + +#right-menu{ + float:right; } \ No newline at end of file diff --git a/public/templates/header.tpl b/public/templates/header.tpl index cf4984bdbf..93096a053a 100644 --- a/public/templates/header.tpl +++ b/public/templates/header.tpl @@ -28,7 +28,7 @@
- +