From fa6d6816e4cf68c2d8a92bd39f84807d8de14b2e Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 2 Apr 2014 10:15:35 -0400 Subject: [PATCH 01/89] removing two keys from source language --- public/language/en_GB/user.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/public/language/en_GB/user.json b/public/language/en_GB/user.json index 2363b1d09e..f89081ba14 100644 --- a/public/language/en_GB/user.json +++ b/public/language/en_GB/user.json @@ -5,7 +5,6 @@ "email": "Email", "fullname": "Full Name", "website": "Website", - "user:website_placeholder": "http://...", "location": "Location", "age": "Age", "joined": "Joined", @@ -20,7 +19,6 @@ "signature": "Signature", "gravatar": "Gravatar", "birthday": "Birthday", - "birthday_placeholder": "mm/dd/yyyy", "chat": "Chat", "follow": "Follow", "unfollow": "Unfollow", From ef47fc78eb92de8ebf64aaf0752bb6747847a028 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 2 Apr 2014 10:29:42 -0400 Subject: [PATCH 02/89] fixed up translation strings, closed #1278 --- public/language/en_GB/topic.json | 7 +++++++ public/src/forum/topic/postTools.js | 24 +++++++++++++----------- public/src/forum/topic/threadTools.js | 11 +++++++---- 3 files changed, 27 insertions(+), 15 deletions(-) diff --git a/public/language/en_GB/topic.json b/public/language/en_GB/topic.json index d9ed9e0bd9..1a38c9f776 100644 --- a/public/language/en_GB/topic.json +++ b/public/language/en_GB/topic.json @@ -53,7 +53,14 @@ "thread_tools.move": "Move Topic", "thread_tools.fork": "Fork Topic", "thread_tools.delete": "Delete Topic", + "thread_tools.delete_confirm": "Are you sure you want to delete this thread?", "thread_tools.restore": "Restore Topic", + "thread_tools.restore_confirm": "Are you sure you want to restore this thread?", + + "post_delete_confirm": "Are you sure you want to delete this post?", + "post_restore_confirm": "Are you sure you want to restore this post?", + "post_delete_error": "Could not delete this post!", + "post_restore_error": "Could not restore this post!", "load_categories": "Loading Categories", "disabled_categories_note": "Disabled Categories are greyed out", diff --git a/public/src/forum/topic/postTools.js b/public/src/forum/topic/postTools.js index 58e6406d29..399095b9c0 100644 --- a/public/src/forum/topic/postTools.js +++ b/public/src/forum/topic/postTools.js @@ -143,17 +143,19 @@ define(['composer', 'share'], function(composer, share) { postEl = $(document.querySelector('#post-container li[data-pid="' + pid + '"]')), action = !postEl.hasClass('deleted') ? 'delete' : 'restore'; - bootbox.confirm('Are you sure you want to ' + action + ' this post?', function(confirm) { - if (confirm) { - socket.emit('posts.' + action, { - pid: pid, - tid: tid - }, function(err) { - if(err) { - return app.alertError('Can\'t ' + action + ' post!'); - } - }); - } + translator.translate('[[topic:post_' + action + '_confirm]]', function(msg) { + bootbox.confirm(msg, function(confirm) { + if (confirm) { + socket.emit('posts.' + action, { + pid: pid, + tid: tid + }, function(err) { + if(err) { + return translator.translate('[[topic:post_' + action + '_error]]', app.alertError); + } + }); + } + }); }); } diff --git a/public/src/forum/topic/threadTools.js b/public/src/forum/topic/threadTools.js index 46ca06e45d..0836b8d3b5 100644 --- a/public/src/forum/topic/threadTools.js +++ b/public/src/forum/topic/threadTools.js @@ -15,11 +15,14 @@ define(['forum/topic/fork', 'forum/topic/move'], function(fork, move) { $('.delete_thread').on('click', function(e) { var command = threadState.deleted !== '1' ? 'delete' : 'restore'; - bootbox.confirm('Are you sure you want to ' + command + ' this thread?', function(confirm) { - if (confirm) { - socket.emit('topics.' + command, tid); - } + translator.translate('[[topic:thread_tools.' + command + '_confirm]]', function(msg) { + bootbox.confirm(msg, function(confirm) { + if (confirm) { + socket.emit('topics.' + command, tid); + } + }); }); + return false; }); From 77a4c871f65fbab89aba9abf97555c35263d010a Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 2 Apr 2014 10:32:17 -0400 Subject: [PATCH 03/89] latest translations and fallbacks --- public/language/ar/topic.json | 6 ++++++ public/language/ar/user.json | 2 -- public/language/cs/topic.json | 6 ++++++ public/language/cs/user.json | 2 -- public/language/de/topic.json | 6 ++++++ public/language/de/user.json | 2 -- public/language/en@pirate/topic.json | 6 ++++++ public/language/en@pirate/user.json | 2 -- public/language/es/topic.json | 14 ++++++++++---- public/language/es/user.json | 14 ++++++-------- public/language/fa_IR/topic.json | 6 ++++++ public/language/fa_IR/user.json | 2 -- public/language/fi/topic.json | 6 ++++++ public/language/fi/user.json | 2 -- public/language/fr/topic.json | 6 ++++++ public/language/fr/user.json | 2 -- public/language/he/topic.json | 6 ++++++ public/language/he/user.json | 2 -- public/language/hu/topic.json | 6 ++++++ public/language/hu/user.json | 2 -- public/language/it/topic.json | 6 ++++++ public/language/it/user.json | 2 -- public/language/nb/topic.json | 6 ++++++ public/language/nb/user.json | 2 -- public/language/nl/topic.json | 6 ++++++ public/language/nl/user.json | 2 -- public/language/pl/topic.json | 6 ++++++ public/language/pl/user.json | 2 -- public/language/pt_BR/topic.json | 6 ++++++ public/language/pt_BR/user.json | 2 -- public/language/ru/topic.json | 6 ++++++ public/language/ru/user.json | 2 -- public/language/sc/topic.json | 6 ++++++ public/language/sc/user.json | 2 -- public/language/sk/topic.json | 6 ++++++ public/language/sk/user.json | 2 -- public/language/sv/topic.json | 6 ++++++ public/language/sv/user.json | 2 -- public/language/th/topic.json | 6 ++++++ public/language/th/user.json | 2 -- public/language/tr/topic.json | 6 ++++++ public/language/tr/user.json | 2 -- public/language/zh_CN/topic.json | 6 ++++++ public/language/zh_CN/user.json | 2 -- public/language/zh_TW/topic.json | 6 ++++++ public/language/zh_TW/user.json | 2 -- 46 files changed, 148 insertions(+), 56 deletions(-) diff --git a/public/language/ar/topic.json b/public/language/ar/topic.json index 883407f80e..c6f94a4d52 100644 --- a/public/language/ar/topic.json +++ b/public/language/ar/topic.json @@ -44,7 +44,13 @@ "thread_tools.move": "نقل الموضوع", "thread_tools.fork": "تفرع الموضوع", "thread_tools.delete": "حذف الموضوع", + "thread_tools.delete_confirm": "Are you sure you want to delete this thread?", "thread_tools.restore": "Restore Topic", + "thread_tools.restore_confirm": "Are you sure you want to restore this thread?", + "post_delete_confirm": "Are you sure you want to delete this post?", + "post_restore_confirm": "Are you sure you want to restore this post?", + "post_delete_error": "Could not delete this post!", + "post_restore_error": "Could not restore this post!", "load_categories": "تحميل الفئات", "disabled_categories_note": "الفئات المجلدة رمادية", "confirm_move": "انقل", diff --git a/public/language/ar/user.json b/public/language/ar/user.json index 06267826c5..ed9f0871f2 100644 --- a/public/language/ar/user.json +++ b/public/language/ar/user.json @@ -5,7 +5,6 @@ "email": "البريد الإلكتروني", "fullname": "الاسم الكامل", "website": "الموقع الإلكتروني", - "user:website_placeholder": "http://...", "location": "موقع", "age": "عمر", "joined": "تاريخ التسجيل", @@ -20,7 +19,6 @@ "signature": "توقيع", "gravatar": "Gravatar", "birthday": "عيد ميلاد", - "birthday_placeholder": "mm/dd/yyyy", "chat": "Chat", "follow": "Follow", "unfollow": "Unfollow", diff --git a/public/language/cs/topic.json b/public/language/cs/topic.json index d9c18201e4..7949c6c3b0 100644 --- a/public/language/cs/topic.json +++ b/public/language/cs/topic.json @@ -44,7 +44,13 @@ "thread_tools.move": "Move Topic", "thread_tools.fork": "Fork Topic", "thread_tools.delete": "Delete Topic", + "thread_tools.delete_confirm": "Are you sure you want to delete this thread?", "thread_tools.restore": "Restore Topic", + "thread_tools.restore_confirm": "Are you sure you want to restore this thread?", + "post_delete_confirm": "Are you sure you want to delete this post?", + "post_restore_confirm": "Are you sure you want to restore this post?", + "post_delete_error": "Could not delete this post!", + "post_restore_error": "Could not restore this post!", "load_categories": "Načítání kategorií", "disabled_categories_note": "Vypnuté (disabled) kategorie jsou šedé.", "confirm_move": "Přesunout", diff --git a/public/language/cs/user.json b/public/language/cs/user.json index 068d31d3ee..b515f9029c 100644 --- a/public/language/cs/user.json +++ b/public/language/cs/user.json @@ -5,7 +5,6 @@ "email": "Email", "fullname": "Jméno a příjmení", "website": "Webové stránky", - "user:website_placeholder": "http://...", "location": "Poloha", "age": "Věk", "joined": "Registrován", @@ -20,7 +19,6 @@ "signature": "Podpis", "gravatar": "Gravatar", "birthday": "Datum narození", - "birthday_placeholder": "mm/dd/yyyy", "chat": "Chat", "follow": "Follow", "unfollow": "Unfollow", diff --git a/public/language/de/topic.json b/public/language/de/topic.json index 8d396a8362..b3f245e605 100644 --- a/public/language/de/topic.json +++ b/public/language/de/topic.json @@ -44,7 +44,13 @@ "thread_tools.move": "Thema verschieben", "thread_tools.fork": "Thema aufspalten", "thread_tools.delete": "Thema löschen", + "thread_tools.delete_confirm": "Are you sure you want to delete this thread?", "thread_tools.restore": "Thema wiederherstellen", + "thread_tools.restore_confirm": "Are you sure you want to restore this thread?", + "post_delete_confirm": "Are you sure you want to delete this post?", + "post_restore_confirm": "Are you sure you want to restore this post?", + "post_delete_error": "Could not delete this post!", + "post_restore_error": "Could not restore this post!", "load_categories": "Kategorien laden", "disabled_categories_note": "Deaktivierte Kategorien sind ausgegraut.", "confirm_move": "verschieben", diff --git a/public/language/de/user.json b/public/language/de/user.json index 2d451fef45..c3076ad1fa 100644 --- a/public/language/de/user.json +++ b/public/language/de/user.json @@ -5,7 +5,6 @@ "email": "E-Mail", "fullname": "Kompletter Name", "website": "Homepage", - "user:website_placeholder": "http://...", "location": "Wohnort", "age": "Alter", "joined": "Beigetreten", @@ -20,7 +19,6 @@ "signature": "Signatur", "gravatar": "Gravatar", "birthday": "Geburtstag", - "birthday_placeholder": "mm/dd/yyyy", "chat": "Chat", "follow": "Folgen", "unfollow": "Nicht mehr folgen", diff --git a/public/language/en@pirate/topic.json b/public/language/en@pirate/topic.json index 354d8a84cd..41e73389ae 100644 --- a/public/language/en@pirate/topic.json +++ b/public/language/en@pirate/topic.json @@ -44,7 +44,13 @@ "thread_tools.move": "Move Topic", "thread_tools.fork": "Fork Topic", "thread_tools.delete": "Delete Topic", + "thread_tools.delete_confirm": "Are you sure you want to delete this thread?", "thread_tools.restore": "Restore Topic", + "thread_tools.restore_confirm": "Are you sure you want to restore this thread?", + "post_delete_confirm": "Are you sure you want to delete this post?", + "post_restore_confirm": "Are you sure you want to restore this post?", + "post_delete_error": "Could not delete this post!", + "post_restore_error": "Could not restore this post!", "load_categories": "Loading Categories", "disabled_categories_note": "Disabled Categories are greyed out", "confirm_move": "Move", diff --git a/public/language/en@pirate/user.json b/public/language/en@pirate/user.json index 09adf3da95..7a8444ab4c 100644 --- a/public/language/en@pirate/user.json +++ b/public/language/en@pirate/user.json @@ -5,7 +5,6 @@ "email": "Email", "fullname": "Full Name", "website": "Website", - "user:website_placeholder": "http://...", "location": "Location", "age": "Age", "joined": "Joined", @@ -20,7 +19,6 @@ "signature": "Signature", "gravatar": "Gravatar", "birthday": "Birthday", - "birthday_placeholder": "mm/dd/yyyy", "chat": "Chat", "follow": "Follow", "unfollow": "Unfollow", diff --git a/public/language/es/topic.json b/public/language/es/topic.json index 50055db176..1770e05512 100644 --- a/public/language/es/topic.json +++ b/public/language/es/topic.json @@ -1,8 +1,8 @@ { "topic": "Tema", "topics": "Temas", - "topic_id": "Topic ID", - "topic_id_placeholder": "Enter topic ID", + "topic_id": "ID Tema", + "topic_id_placeholder": "Introducir ID tema", "no_topics_found": "No se encontraron temas!", "no_posts_found": "No se encontraron publicaciones!", "profile": "Perfil", @@ -23,8 +23,8 @@ "flag": "Reportar", "bookmark_instructions": "Click aqui para restablecer la ultima posicion del post o cierralo para descartar cambios.", "flag_title": "Reportar esta publicación a los moderadores", - "flag_confirm": "Are you sure you want to flag this post?", - "flag_success": "This post has been flagged for moderation.", + "flag_confirm": "Estás seguro de que quieres marcar como indebido este mensaje?", + "flag_success": "Este mensaje ha sido marcado para la moderación.", "deleted_message": "Este tema ha sido borrado. Solo los miembros con privilegios pueden verlo.", "following_topic.title": "Siguendo tema", "following_topic.message": "Ahora recibiras notificaciones cuando alguien publique en este tema.", @@ -44,7 +44,13 @@ "thread_tools.move": "Mover Tema", "thread_tools.fork": "Bifurcar Tema", "thread_tools.delete": "Borrar Tema", + "thread_tools.delete_confirm": "Are you sure you want to delete this thread?", "thread_tools.restore": "Restaurar Tema", + "thread_tools.restore_confirm": "Are you sure you want to restore this thread?", + "post_delete_confirm": "Are you sure you want to delete this post?", + "post_restore_confirm": "Are you sure you want to restore this post?", + "post_delete_error": "Could not delete this post!", + "post_restore_error": "Could not restore this post!", "load_categories": "Cargando Categorías", "disabled_categories_note": "Las categorías deshabilitadas estan en gris", "confirm_move": "Mover", diff --git a/public/language/es/user.json b/public/language/es/user.json index 5b2839b05b..5253282602 100644 --- a/public/language/es/user.json +++ b/public/language/es/user.json @@ -5,7 +5,6 @@ "email": "Correo Electrónico", "fullname": "Nombre", "website": "Sitio Web", - "user:website_placeholder": "http://...", "location": "Ubicación", "age": "Edad", "joined": "Registro", @@ -20,7 +19,6 @@ "signature": "Firma", "gravatar": "Gravatar", "birthday": "Cumpleaños", - "birthday_placeholder": "mm/dd/yyyy", "chat": "Chat!", "follow": "Seguir", "unfollow": "Dejar de Seguir", @@ -30,12 +28,12 @@ "upload_new_picture": "Cargar Nueva Foto", "current_password": "Contraseña actual", "change_password": "Cambiar Contraseña", - "change_password_error": "Invalid Password!", - "change_password_error_wrong_current": "Your current password is not correct!", - "change_password_error_length": "Password too short!", - "change_password_error_match": "Passwords must match!", - "change_password_error_privileges": "You are not have the rights to change this password.", - "change_password_success": "Your password is updated!", + "change_password_error": "Contraseña no válida!", + "change_password_error_wrong_current": "Su contraseña actual no es correcta!", + "change_password_error_length": "La contraseña es demasiado corta!", + "change_password_error_match": "Las contraseñas deben coincidir!", + "change_password_error_privileges": "No tienes los derechos suficientes para cambiar esta contraseña.", + "change_password_success": "La contraseña ha sido actualizada correctamente!", "confirm_password": "Confirmar Contraseña", "password": "Contraseña", "upload_picture": "Cargar foto", diff --git a/public/language/fa_IR/topic.json b/public/language/fa_IR/topic.json index 7940969fff..e958799164 100644 --- a/public/language/fa_IR/topic.json +++ b/public/language/fa_IR/topic.json @@ -44,7 +44,13 @@ "thread_tools.move": "جابجا کردن جستار", "thread_tools.fork": "شاخه ساختن از جستار", "thread_tools.delete": "پاک کردن جستار", + "thread_tools.delete_confirm": "Are you sure you want to delete this thread?", "thread_tools.restore": "برگرداندن جستار", + "thread_tools.restore_confirm": "Are you sure you want to restore this thread?", + "post_delete_confirm": "Are you sure you want to delete this post?", + "post_restore_confirm": "Are you sure you want to restore this post?", + "post_delete_error": "Could not delete this post!", + "post_restore_error": "Could not restore this post!", "load_categories": "بارگذاری دسته‌ها", "disabled_categories_note": "دسته‌های از کار افتاده به رنگ خاکستری در می‌آیند", "confirm_move": "جابه‌جا کردن", diff --git a/public/language/fa_IR/user.json b/public/language/fa_IR/user.json index b55c893ae0..10f1540513 100644 --- a/public/language/fa_IR/user.json +++ b/public/language/fa_IR/user.json @@ -5,7 +5,6 @@ "email": "رایانامه", "fullname": "نام کامل", "website": "تارنما", - "user:website_placeholder": "http://...", "location": "محل سکونت", "age": "سن", "joined": "عضو شده", @@ -20,7 +19,6 @@ "signature": "امضا", "gravatar": "گراواتار", "birthday": "روز تولد", - "birthday_placeholder": "mm/dd/yyyy", "chat": "گفتگو", "follow": "دنبال کن", "unfollow": "دنبال نکن", diff --git a/public/language/fi/topic.json b/public/language/fi/topic.json index bf45e30b8b..2e5a7eb3eb 100644 --- a/public/language/fi/topic.json +++ b/public/language/fi/topic.json @@ -44,7 +44,13 @@ "thread_tools.move": "Siirrä aihe", "thread_tools.fork": "Haaroita aihe", "thread_tools.delete": "Poista aihe", + "thread_tools.delete_confirm": "Are you sure you want to delete this thread?", "thread_tools.restore": "Palauta aihe", + "thread_tools.restore_confirm": "Are you sure you want to restore this thread?", + "post_delete_confirm": "Are you sure you want to delete this post?", + "post_restore_confirm": "Are you sure you want to restore this post?", + "post_delete_error": "Could not delete this post!", + "post_restore_error": "Could not restore this post!", "load_categories": "Ladataan aihealueita", "disabled_categories_note": "Käytöstä poistetut aihealueet ovat harmaina", "confirm_move": "Siirrä", diff --git a/public/language/fi/user.json b/public/language/fi/user.json index 5e837df36c..0b014436f9 100644 --- a/public/language/fi/user.json +++ b/public/language/fi/user.json @@ -5,7 +5,6 @@ "email": "Sähköposti", "fullname": "Koko nimi", "website": "Kotisivu", - "user:website_placeholder": "http://...", "location": "Sijainti", "age": "Ikä", "joined": "Liittynyt", @@ -20,7 +19,6 @@ "signature": "Allekirjoitus", "gravatar": "Gravatar", "birthday": "Syntymäpäivä", - "birthday_placeholder": "mm/dd/yyyy", "chat": "Keskustele", "follow": "Seuraa", "unfollow": "Älä seuraa", diff --git a/public/language/fr/topic.json b/public/language/fr/topic.json index e9866ecb65..cce5359d19 100644 --- a/public/language/fr/topic.json +++ b/public/language/fr/topic.json @@ -44,7 +44,13 @@ "thread_tools.move": "Déplacer le sujet", "thread_tools.fork": "Scinder le sujet", "thread_tools.delete": "Supprimer le sujet", + "thread_tools.delete_confirm": "Are you sure you want to delete this thread?", "thread_tools.restore": "Restaurer le sujet", + "thread_tools.restore_confirm": "Are you sure you want to restore this thread?", + "post_delete_confirm": "Are you sure you want to delete this post?", + "post_restore_confirm": "Are you sure you want to restore this post?", + "post_delete_error": "Could not delete this post!", + "post_restore_error": "Could not restore this post!", "load_categories": "Chargement des Categories", "disabled_categories_note": "Les catégories désactivées sont grisées", "confirm_move": "Déplacer", diff --git a/public/language/fr/user.json b/public/language/fr/user.json index 3c2327824d..30029f1eeb 100644 --- a/public/language/fr/user.json +++ b/public/language/fr/user.json @@ -5,7 +5,6 @@ "email": "Email", "fullname": "Nom", "website": "Site Web", - "user:website_placeholder": "http://...", "location": "Emplacement", "age": "Age", "joined": "Inscrit", @@ -20,7 +19,6 @@ "signature": "Signature", "gravatar": "Gravatar", "birthday": "Anniversaire", - "birthday_placeholder": "mm/dd/yyyy", "chat": "Chat", "follow": "S'abonner", "unfollow": "Se désabonner", diff --git a/public/language/he/topic.json b/public/language/he/topic.json index ff18a56ca4..65ba5151ea 100644 --- a/public/language/he/topic.json +++ b/public/language/he/topic.json @@ -44,7 +44,13 @@ "thread_tools.move": "הזז נושא", "thread_tools.fork": "שכפל נושא", "thread_tools.delete": "מחק נושא", + "thread_tools.delete_confirm": "Are you sure you want to delete this thread?", "thread_tools.restore": "שחזר נושא", + "thread_tools.restore_confirm": "Are you sure you want to restore this thread?", + "post_delete_confirm": "Are you sure you want to delete this post?", + "post_restore_confirm": "Are you sure you want to restore this post?", + "post_delete_error": "Could not delete this post!", + "post_restore_error": "Could not restore this post!", "load_categories": "טוען קטגוריות", "disabled_categories_note": "קטגוריות מבוטלות צבועות באפור", "confirm_move": "הזז", diff --git a/public/language/he/user.json b/public/language/he/user.json index 3f5a5e5ef7..250e5f381a 100644 --- a/public/language/he/user.json +++ b/public/language/he/user.json @@ -5,7 +5,6 @@ "email": "כתובת אימייל", "fullname": "שם מלא", "website": "אתר", - "user:website_placeholder": "http://...", "location": "מיקום", "age": "גיל", "joined": "הצטרף", @@ -20,7 +19,6 @@ "signature": "חתימה", "gravatar": "אווטר", "birthday": "יום הולדת", - "birthday_placeholder": "mm/dd/yyyy", "chat": "צ'אט", "follow": "עקוב", "unfollow": "הפסק לעקוב", diff --git a/public/language/hu/topic.json b/public/language/hu/topic.json index d09c983559..b1897d1f8d 100644 --- a/public/language/hu/topic.json +++ b/public/language/hu/topic.json @@ -44,7 +44,13 @@ "thread_tools.move": "Topik mozgatása", "thread_tools.fork": "Topik szétszedése", "thread_tools.delete": "Topik törlése", + "thread_tools.delete_confirm": "Are you sure you want to delete this thread?", "thread_tools.restore": "Topik visszaállítása", + "thread_tools.restore_confirm": "Are you sure you want to restore this thread?", + "post_delete_confirm": "Are you sure you want to delete this post?", + "post_restore_confirm": "Are you sure you want to restore this post?", + "post_delete_error": "Could not delete this post!", + "post_restore_error": "Could not restore this post!", "load_categories": "Kategóriák betöltése", "disabled_categories_note": "Kikapcsolt kategóriák kiszürkülve", "confirm_move": "Áthelyezés", diff --git a/public/language/hu/user.json b/public/language/hu/user.json index 25e1f91cf2..6aacad7c1b 100644 --- a/public/language/hu/user.json +++ b/public/language/hu/user.json @@ -5,7 +5,6 @@ "email": "E-mail", "fullname": "Teljes Név", "website": "Weboldal", - "user:website_placeholder": "http://...", "location": "Lakhely", "age": "Kor", "joined": "Csatlakozott", @@ -20,7 +19,6 @@ "signature": "Aláírás", "gravatar": "Gravatar", "birthday": "Szülinap", - "birthday_placeholder": "mm/dd/yyyy", "chat": "Chat", "follow": "Követés", "unfollow": "Nem követem", diff --git a/public/language/it/topic.json b/public/language/it/topic.json index 48f91f31e9..cb1ce7ae07 100644 --- a/public/language/it/topic.json +++ b/public/language/it/topic.json @@ -44,7 +44,13 @@ "thread_tools.move": "Sposta Discussione", "thread_tools.fork": "Dividi Discussione", "thread_tools.delete": "Elimina Discussione", + "thread_tools.delete_confirm": "Are you sure you want to delete this thread?", "thread_tools.restore": "Ripristina Discussione", + "thread_tools.restore_confirm": "Are you sure you want to restore this thread?", + "post_delete_confirm": "Are you sure you want to delete this post?", + "post_restore_confirm": "Are you sure you want to restore this post?", + "post_delete_error": "Could not delete this post!", + "post_restore_error": "Could not restore this post!", "load_categories": "Caricamento Categorie", "disabled_categories_note": "Le Categorie disabilitate sono in grigio", "confirm_move": "Sposta", diff --git a/public/language/it/user.json b/public/language/it/user.json index dd6f7a3c7d..229f937239 100644 --- a/public/language/it/user.json +++ b/public/language/it/user.json @@ -5,7 +5,6 @@ "email": "Email", "fullname": "Nome e Cognome", "website": "Sito Internet", - "user:website_placeholder": "http://...", "location": "Località", "age": "Età", "joined": "Iscrizione", @@ -20,7 +19,6 @@ "signature": "Firma", "gravatar": "Gravatar", "birthday": "Data di nascita", - "birthday_placeholder": "mm/dd/yyyy", "chat": "Chat", "follow": "Segui", "unfollow": "Smetti di seguire", diff --git a/public/language/nb/topic.json b/public/language/nb/topic.json index 9ad1192b82..b6bcd76e39 100644 --- a/public/language/nb/topic.json +++ b/public/language/nb/topic.json @@ -44,7 +44,13 @@ "thread_tools.move": "Flytt tråd", "thread_tools.fork": "Forgren tråd", "thread_tools.delete": "Slett tråd", + "thread_tools.delete_confirm": "Are you sure you want to delete this thread?", "thread_tools.restore": "Gjenopprett tråd", + "thread_tools.restore_confirm": "Are you sure you want to restore this thread?", + "post_delete_confirm": "Are you sure you want to delete this post?", + "post_restore_confirm": "Are you sure you want to restore this post?", + "post_delete_error": "Could not delete this post!", + "post_restore_error": "Could not restore this post!", "load_categories": "Laster kategorier", "disabled_categories_note": "Deaktiverte kategorier er grået ut", "confirm_move": "Flytt", diff --git a/public/language/nb/user.json b/public/language/nb/user.json index 64609f2d5a..8ff4200fea 100644 --- a/public/language/nb/user.json +++ b/public/language/nb/user.json @@ -5,7 +5,6 @@ "email": "E-post", "fullname": "Fullt navn", "website": "Nettsted", - "user:website_placeholder": "http://...", "location": "Plassering", "age": "Alder", "joined": "Ble med", @@ -20,7 +19,6 @@ "signature": "Signatur", "gravatar": "Gravatar", "birthday": "Bursdag", - "birthday_placeholder": "mm/dd/yyyy", "chat": "Chatt", "follow": "Følg", "unfollow": "Avfølg", diff --git a/public/language/nl/topic.json b/public/language/nl/topic.json index 491e4d11a3..0354b30e28 100644 --- a/public/language/nl/topic.json +++ b/public/language/nl/topic.json @@ -44,7 +44,13 @@ "thread_tools.move": "Onderwerp Verplaatsen", "thread_tools.fork": "Onderwerp Forken", "thread_tools.delete": "Onderwerp Verwijderen", + "thread_tools.delete_confirm": "Are you sure you want to delete this thread?", "thread_tools.restore": "Onderwerp Herstellen", + "thread_tools.restore_confirm": "Are you sure you want to restore this thread?", + "post_delete_confirm": "Are you sure you want to delete this post?", + "post_restore_confirm": "Are you sure you want to restore this post?", + "post_delete_error": "Could not delete this post!", + "post_restore_error": "Could not restore this post!", "load_categories": "Categorieën Laden", "disabled_categories_note": "Uitgeschakelde Categorieën zijn grijs", "confirm_move": "Verplaatsen", diff --git a/public/language/nl/user.json b/public/language/nl/user.json index fe1c6e1c22..17445da6e2 100644 --- a/public/language/nl/user.json +++ b/public/language/nl/user.json @@ -5,7 +5,6 @@ "email": "Email", "fullname": "Volledige Naam", "website": "Website", - "user:website_placeholder": "http://...", "location": "Locatie", "age": "Leeftijd", "joined": "Geregistreerd", @@ -20,7 +19,6 @@ "signature": "Handtekening", "gravatar": "Gravatar", "birthday": "Verjaardag", - "birthday_placeholder": "mm/dd/yyyy", "chat": "Chat", "follow": "Volgen", "unfollow": "Ontvolgen", diff --git a/public/language/pl/topic.json b/public/language/pl/topic.json index bc3f46fb39..7bf49001b4 100644 --- a/public/language/pl/topic.json +++ b/public/language/pl/topic.json @@ -44,7 +44,13 @@ "thread_tools.move": "Przenieś wątek", "thread_tools.fork": "Skopiuj wątek", "thread_tools.delete": "Usuń wątek", + "thread_tools.delete_confirm": "Are you sure you want to delete this thread?", "thread_tools.restore": "Przywróć wątek", + "thread_tools.restore_confirm": "Are you sure you want to restore this thread?", + "post_delete_confirm": "Are you sure you want to delete this post?", + "post_restore_confirm": "Are you sure you want to restore this post?", + "post_delete_error": "Could not delete this post!", + "post_restore_error": "Could not restore this post!", "load_categories": "Ładowanie kategorii", "disabled_categories_note": "Zablokowane kategorie zostały wyszarzone.", "confirm_move": "Przenieś", diff --git a/public/language/pl/user.json b/public/language/pl/user.json index 408246fdcb..e8d6b576b8 100644 --- a/public/language/pl/user.json +++ b/public/language/pl/user.json @@ -5,7 +5,6 @@ "email": "Adres e-mail", "fullname": "Pełna nazwa", "website": "Strona WWW", - "user:website_placeholder": "http://...", "location": "Położenie", "age": "Wiek", "joined": "Dołączono", @@ -20,7 +19,6 @@ "signature": "Sygnatura", "gravatar": "Gravatar", "birthday": "Urodziny", - "birthday_placeholder": "mm/dd/yyyy", "chat": "Rozmawiaj", "follow": "Śledź", "unfollow": "Przestań śledzić", diff --git a/public/language/pt_BR/topic.json b/public/language/pt_BR/topic.json index 58c3c082dc..5da0af9fa2 100644 --- a/public/language/pt_BR/topic.json +++ b/public/language/pt_BR/topic.json @@ -44,7 +44,13 @@ "thread_tools.move": "Mover Tópico", "thread_tools.fork": "Fork Tópico", "thread_tools.delete": "Deletar Tópico", + "thread_tools.delete_confirm": "Are you sure you want to delete this thread?", "thread_tools.restore": "Restaurar Tópico", + "thread_tools.restore_confirm": "Are you sure you want to restore this thread?", + "post_delete_confirm": "Are you sure you want to delete this post?", + "post_restore_confirm": "Are you sure you want to restore this post?", + "post_delete_error": "Could not delete this post!", + "post_restore_error": "Could not restore this post!", "load_categories": "Carregando Categorias", "disabled_categories_note": "Categorias desabilitadas estão em cinza", "confirm_move": "Mover", diff --git a/public/language/pt_BR/user.json b/public/language/pt_BR/user.json index 70bc6b34c7..8c147730b5 100644 --- a/public/language/pt_BR/user.json +++ b/public/language/pt_BR/user.json @@ -5,7 +5,6 @@ "email": "Email", "fullname": "Nome Completo", "website": "Website", - "user:website_placeholder": "http://...", "location": "Localização", "age": "Idade", "joined": "Cadastrou", @@ -20,7 +19,6 @@ "signature": "Assinatura", "gravatar": "Gravatar", "birthday": "Aniversário", - "birthday_placeholder": "mm/dd/yyyy", "chat": "Bate Papo", "follow": "Seguir", "unfollow": "Deixar de Seguir", diff --git a/public/language/ru/topic.json b/public/language/ru/topic.json index dcf40c9c5c..537690e410 100644 --- a/public/language/ru/topic.json +++ b/public/language/ru/topic.json @@ -44,7 +44,13 @@ "thread_tools.move": "Move Topic", "thread_tools.fork": "Fork Topic", "thread_tools.delete": "Delete Topic", + "thread_tools.delete_confirm": "Are you sure you want to delete this thread?", "thread_tools.restore": "Restore Topic", + "thread_tools.restore_confirm": "Are you sure you want to restore this thread?", + "post_delete_confirm": "Are you sure you want to delete this post?", + "post_restore_confirm": "Are you sure you want to restore this post?", + "post_delete_error": "Could not delete this post!", + "post_restore_error": "Could not restore this post!", "load_categories": "Загружаем Категории", "disabled_categories_note": "Отключенные категории затемненны", "confirm_move": "Перенести", diff --git a/public/language/ru/user.json b/public/language/ru/user.json index 621497a4af..c56e67c9d0 100644 --- a/public/language/ru/user.json +++ b/public/language/ru/user.json @@ -5,7 +5,6 @@ "email": "Email", "fullname": "Полное имя", "website": "Сайт", - "user:website_placeholder": "http://...", "location": "Откуда", "age": "Возраст", "joined": "Зарегистрирован", @@ -20,7 +19,6 @@ "signature": "Подпись", "gravatar": "Gravatar", "birthday": "День рождения", - "birthday_placeholder": "mm/dd/yyyy", "chat": "Chat", "follow": "Follow", "unfollow": "Unfollow", diff --git a/public/language/sc/topic.json b/public/language/sc/topic.json index db30a7780b..bd1e186096 100644 --- a/public/language/sc/topic.json +++ b/public/language/sc/topic.json @@ -44,7 +44,13 @@ "thread_tools.move": "Move Arresonada", "thread_tools.fork": "Partzi Arresonada", "thread_tools.delete": "Cantzella Arresonada", + "thread_tools.delete_confirm": "Are you sure you want to delete this thread?", "thread_tools.restore": "Torra a s'Arresonada Allogada", + "thread_tools.restore_confirm": "Are you sure you want to restore this thread?", + "post_delete_confirm": "Are you sure you want to delete this post?", + "post_restore_confirm": "Are you sure you want to restore this post?", + "post_delete_error": "Could not delete this post!", + "post_restore_error": "Could not restore this post!", "load_categories": "Carrighende Crezes", "disabled_categories_note": "Is Crezes Disativadas sunt postas in colore de chìghine", "confirm_move": "Move", diff --git a/public/language/sc/user.json b/public/language/sc/user.json index 46d180e414..b9d8f50b26 100644 --- a/public/language/sc/user.json +++ b/public/language/sc/user.json @@ -5,7 +5,6 @@ "email": "Email", "fullname": "Nùmene e Sambenadu", "website": "Giassu web", - "user:website_placeholder": "http://...", "location": "Logu", "age": "Edade", "joined": "intradu", @@ -20,7 +19,6 @@ "signature": "Firma", "gravatar": "Gravatas", "birthday": "Cumpleannu", - "birthday_placeholder": "mm/dd/yyyy", "chat": "Tzarra", "follow": "Sighi", "unfollow": "Non sighes prus", diff --git a/public/language/sk/topic.json b/public/language/sk/topic.json index 0a12b11875..184d6c06d4 100644 --- a/public/language/sk/topic.json +++ b/public/language/sk/topic.json @@ -44,7 +44,13 @@ "thread_tools.move": "Presunúť tému", "thread_tools.fork": "Rozvetviť tému", "thread_tools.delete": "Vymazať tému", + "thread_tools.delete_confirm": "Are you sure you want to delete this thread?", "thread_tools.restore": "Vrátiť tému", + "thread_tools.restore_confirm": "Are you sure you want to restore this thread?", + "post_delete_confirm": "Are you sure you want to delete this post?", + "post_restore_confirm": "Are you sure you want to restore this post?", + "post_delete_error": "Could not delete this post!", + "post_restore_error": "Could not restore this post!", "load_categories": "Načítanie kategórií", "disabled_categories_note": "Vypnuté (disabled) kategorie sú šedé.", "confirm_move": "Presunúť", diff --git a/public/language/sk/user.json b/public/language/sk/user.json index e2113fbe3d..ff9911c799 100644 --- a/public/language/sk/user.json +++ b/public/language/sk/user.json @@ -5,7 +5,6 @@ "email": "Email", "fullname": "Meno a priezvisko", "website": "Webová stránka", - "user:website_placeholder": "http://...", "location": "Poloha", "age": "Vek", "joined": "Registrovaný", @@ -20,7 +19,6 @@ "signature": "Podpis", "gravatar": "Gravatar", "birthday": "Dátum narodenia", - "birthday_placeholder": "mm/dd/yyyy", "chat": "Chat", "follow": "Nasleduj", "unfollow": "Nenasledovať", diff --git a/public/language/sv/topic.json b/public/language/sv/topic.json index e93ff486f2..96eabbd25f 100644 --- a/public/language/sv/topic.json +++ b/public/language/sv/topic.json @@ -44,7 +44,13 @@ "thread_tools.move": "Flytta ämne", "thread_tools.fork": "Grena ämne", "thread_tools.delete": "Ta bort ämne", + "thread_tools.delete_confirm": "Are you sure you want to delete this thread?", "thread_tools.restore": "Återställ ämne", + "thread_tools.restore_confirm": "Are you sure you want to restore this thread?", + "post_delete_confirm": "Are you sure you want to delete this post?", + "post_restore_confirm": "Are you sure you want to restore this post?", + "post_delete_error": "Could not delete this post!", + "post_restore_error": "Could not restore this post!", "load_categories": "Laddar kategorier", "disabled_categories_note": "Inaktiverade kategorier är utgråade", "confirm_move": "Flytta", diff --git a/public/language/sv/user.json b/public/language/sv/user.json index ad69e3e0d1..55feb943c2 100644 --- a/public/language/sv/user.json +++ b/public/language/sv/user.json @@ -5,7 +5,6 @@ "email": "Epost", "fullname": "Hela namnet", "website": "Webbsida", - "user:website_placeholder": "http://...", "location": "Plats", "age": "Ålder", "joined": "Gick med", @@ -20,7 +19,6 @@ "signature": "Signatur", "gravatar": "Gravatar", "birthday": "Födelsedag", - "birthday_placeholder": "mm/dd/yyyy", "chat": "Chatta", "follow": "Följ", "unfollow": "Sluta följ", diff --git a/public/language/th/topic.json b/public/language/th/topic.json index acd99b91df..4e095eba35 100644 --- a/public/language/th/topic.json +++ b/public/language/th/topic.json @@ -44,7 +44,13 @@ "thread_tools.move": "ย้ายกระทู้", "thread_tools.fork": "แยกกระทู้", "thread_tools.delete": "ลบกระทู้", + "thread_tools.delete_confirm": "Are you sure you want to delete this thread?", "thread_tools.restore": "กู้กระทู้", + "thread_tools.restore_confirm": "Are you sure you want to restore this thread?", + "post_delete_confirm": "Are you sure you want to delete this post?", + "post_restore_confirm": "Are you sure you want to restore this post?", + "post_delete_error": "Could not delete this post!", + "post_restore_error": "Could not restore this post!", "load_categories": "กำลังโหลดหมวดหมู่", "disabled_categories_note": "หมวดหมู่ที่ปิดใช้งานจะเป็นสีเทา", "confirm_move": "ย้าย", diff --git a/public/language/th/user.json b/public/language/th/user.json index cfbf607bc8..a8ffd05c18 100644 --- a/public/language/th/user.json +++ b/public/language/th/user.json @@ -5,7 +5,6 @@ "email": "อีเมล์", "fullname": "ชื่อเต็ม", "website": "เว็บไซต์", - "user:website_placeholder": "http://...", "location": "สถานที่", "age": "อายุ", "joined": "เข้าร่วม", @@ -20,7 +19,6 @@ "signature": "ลายเซ็น", "gravatar": "Gravatar", "birthday": "วันเกิด", - "birthday_placeholder": "mm/dd/yyyy", "chat": "แชท", "follow": "ติดตาม", "unfollow": "เลิกติดตาม", diff --git a/public/language/tr/topic.json b/public/language/tr/topic.json index a4eae03b29..cbbf514eb0 100644 --- a/public/language/tr/topic.json +++ b/public/language/tr/topic.json @@ -44,7 +44,13 @@ "thread_tools.move": "Move Topic", "thread_tools.fork": "Fork Topic", "thread_tools.delete": "Delete Topic", + "thread_tools.delete_confirm": "Are you sure you want to delete this thread?", "thread_tools.restore": "Restore Topic", + "thread_tools.restore_confirm": "Are you sure you want to restore this thread?", + "post_delete_confirm": "Are you sure you want to delete this post?", + "post_restore_confirm": "Are you sure you want to restore this post?", + "post_delete_error": "Could not delete this post!", + "post_restore_error": "Could not restore this post!", "load_categories": "Kategoriler Yükleniyor", "disabled_categories_note": "Etkin Olmayan Kategoriler soluklaştırılır", "confirm_move": "Taşı", diff --git a/public/language/tr/user.json b/public/language/tr/user.json index 8dd925c25b..e49e5f0661 100644 --- a/public/language/tr/user.json +++ b/public/language/tr/user.json @@ -5,7 +5,6 @@ "email": "E-posta", "fullname": "Tam Ad", "website": "Websitesi", - "user:website_placeholder": "http://...", "location": "Konum", "age": "Yaş", "joined": "Katıldı", @@ -20,7 +19,6 @@ "signature": "İmza", "gravatar": "Avatar", "birthday": "Doğum Tarihi", - "birthday_placeholder": "mm/dd/yyyy", "chat": "Chat", "follow": "Follow", "unfollow": "Unfollow", diff --git a/public/language/zh_CN/topic.json b/public/language/zh_CN/topic.json index 7236386ef1..f4b067ef1d 100644 --- a/public/language/zh_CN/topic.json +++ b/public/language/zh_CN/topic.json @@ -44,7 +44,13 @@ "thread_tools.move": "移动主题", "thread_tools.fork": "分叉主题", "thread_tools.delete": "删除主题", + "thread_tools.delete_confirm": "Are you sure you want to delete this thread?", "thread_tools.restore": "恢复主题", + "thread_tools.restore_confirm": "Are you sure you want to restore this thread?", + "post_delete_confirm": "Are you sure you want to delete this post?", + "post_restore_confirm": "Are you sure you want to restore this post?", + "post_delete_error": "Could not delete this post!", + "post_restore_error": "Could not restore this post!", "load_categories": "版面载入中", "disabled_categories_note": "停用的版面为灰色", "confirm_move": "移动", diff --git a/public/language/zh_CN/user.json b/public/language/zh_CN/user.json index 464ae8f23b..eab1ec7e6c 100644 --- a/public/language/zh_CN/user.json +++ b/public/language/zh_CN/user.json @@ -5,7 +5,6 @@ "email": "邮件", "fullname": "姓名", "website": "网站", - "user:website_placeholder": "http://...", "location": "地址", "age": "年龄", "joined": "加入时间", @@ -20,7 +19,6 @@ "signature": "签名", "gravatar": "Gravatar头像", "birthday": "生日", - "birthday_placeholder": "mm/dd/yyyy", "chat": "聊天", "follow": "关注", "unfollow": "取消关注", diff --git a/public/language/zh_TW/topic.json b/public/language/zh_TW/topic.json index 58ffbf2d58..676172ac91 100644 --- a/public/language/zh_TW/topic.json +++ b/public/language/zh_TW/topic.json @@ -44,7 +44,13 @@ "thread_tools.move": "Move Topic", "thread_tools.fork": "Fork Topic", "thread_tools.delete": "Delete Topic", + "thread_tools.delete_confirm": "Are you sure you want to delete this thread?", "thread_tools.restore": "Restore Topic", + "thread_tools.restore_confirm": "Are you sure you want to restore this thread?", + "post_delete_confirm": "Are you sure you want to delete this post?", + "post_restore_confirm": "Are you sure you want to restore this post?", + "post_delete_error": "Could not delete this post!", + "post_restore_error": "Could not restore this post!", "load_categories": "版面載入中", "disabled_categories_note": "停用的版面為灰色", "confirm_move": "移動", diff --git a/public/language/zh_TW/user.json b/public/language/zh_TW/user.json index 949d69e4c3..a4948dda42 100644 --- a/public/language/zh_TW/user.json +++ b/public/language/zh_TW/user.json @@ -5,7 +5,6 @@ "email": "Email", "fullname": "姓名", "website": "網站", - "user:website_placeholder": "http://...", "location": "地址", "age": "年齡", "joined": "加入時間", @@ -20,7 +19,6 @@ "signature": "簽名", "gravatar": "Gravatar頭像", "birthday": "生日", - "birthday_placeholder": "mm/dd/yyyy", "chat": "Chat", "follow": "關注", "unfollow": "取消關注", From 90616c6e7b483832596f5a7d6bfa7a3e66951d43 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 2 Apr 2014 11:11:01 -0400 Subject: [PATCH 04/89] closed #1322 --- src/socket.io/posts.js | 2 +- src/topics/create.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/socket.io/posts.js b/src/socket.io/posts.js index ad38842402..93b7a90416 100644 --- a/src/socket.io/posts.js +++ b/src/socket.io/posts.js @@ -71,7 +71,7 @@ SocketPosts.reply = function(socket, data, callback) { posts: [postData] }; - index.server.sockets.emit('event:new_post', socketData); + index.server.sockets.in('topic_' + postData.tid).emit('event:new_post', socketData); callback(); } diff --git a/src/topics/create.js b/src/topics/create.js index 71b941ae50..a2ff056d69 100644 --- a/src/topics/create.js +++ b/src/topics/create.js @@ -124,7 +124,7 @@ module.exports = function(Topics) { next(null, postData); }, function(postData, next) { - Topics.getTopicsByTids([postData.tid], uid, function(err, topicData) { + Topics.getTopicsByTids([postData.tid], 0, function(err, topicData) { if(err) { return next(err); } @@ -222,8 +222,8 @@ module.exports = function(Topics) { postData.index = index; postData.favourited = false; postData.votes = 0; - postData.display_moderator_tools = true; - postData.display_move_tools = privileges.admin || privileges.moderator; + postData.display_moderator_tools = false; + postData.display_move_tools = false; postData.relativeTime = utils.toISOString(postData.timestamp); next(null, postData); From 682fa1f8748344b3827be60ba6e196e3672e481d Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 2 Apr 2014 11:13:49 -0400 Subject: [PATCH 05/89] fixed incorrect scoping for new post event introduced accidentally last commit --- src/socket.io/posts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/socket.io/posts.js b/src/socket.io/posts.js index 93b7a90416..ad38842402 100644 --- a/src/socket.io/posts.js +++ b/src/socket.io/posts.js @@ -71,7 +71,7 @@ SocketPosts.reply = function(socket, data, callback) { posts: [postData] }; - index.server.sockets.in('topic_' + postData.tid).emit('event:new_post', socketData); + index.server.sockets.emit('event:new_post', socketData); callback(); } From bdefebeea086dc841e519d7241ff722222ad76f4 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Wed, 2 Apr 2014 13:58:10 -0400 Subject: [PATCH 06/89] reverting some of my code and fixed #1322 properly --- public/src/forum/topic.js | 21 +++++++++++++++------ src/socket.io/posts.js | 10 ++++++++++ src/topics/create.js | 4 ++-- 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/public/src/forum/topic.js b/public/src/forum/topic.js index 3b27079dd7..8188654401 100644 --- a/public/src/forum/topic.js +++ b/public/src/forum/topic.js @@ -755,9 +755,18 @@ define(['forum/pagination', 'forum/topic/threadTools', 'forum/topic/postTools'], } function onNewPostsLoaded(html, posts) { - for (var x = 0, numPosts = posts.length; x < numPosts; x++) { - toggle_mod_tools(posts[x].pid, posts[x].display_moderator_tools); - } + function getPostPrivileges(pid) { + socket.emit('posts.getPrivileges', pid, function(err, privileges) { + if(err) { + return app.alertError(err.message); + } + toggle_mod_tools(html, privileges); + }); + } + + for (var x = 0, numPosts = posts.length; x < numPosts; x++) { + getPostPrivileges(posts[x].pid); + } infiniteLoaderActive = false; @@ -771,9 +780,9 @@ define(['forum/pagination', 'forum/topic/threadTools', 'forum/topic/postTools'], showBottomPostBar(); } - - function toggle_mod_tools(pid, editable) { - $('#post-container li[data-pid="' + pid + '"]').find('.edit, .delete').toggleClass('none', !editable); + function toggle_mod_tools(postHtml, privileges) { + postHtml.find('.edit, .delete').toggleClass('none', !privileges.editable); + postHtml.find('.move').toggleClass('none', !privileges.move); } function updatePostCount() { diff --git a/src/socket.io/posts.js b/src/socket.io/posts.js index ad38842402..1f1d84c136 100644 --- a/src/socket.io/posts.js +++ b/src/socket.io/posts.js @@ -219,6 +219,16 @@ function deleteOrRestore(command, socket, data, callback) { }); } +SocketPosts.getPrivileges = function(socket, pid, callback) { + postTools.privileges(pid, socket.uid, function(err, privileges) { + if(err) { + return callback(err); + } + privileges.pid = parseInt(pid, 10); + callback(null, privileges); + }); +}; + SocketPosts.getFavouritedUsers = function(socket, pid, callback) { favourites.getFavouritedUidsByPids([pid], function(err, data) { diff --git a/src/topics/create.js b/src/topics/create.js index a2ff056d69..23f3496251 100644 --- a/src/topics/create.js +++ b/src/topics/create.js @@ -222,8 +222,8 @@ module.exports = function(Topics) { postData.index = index; postData.favourited = false; postData.votes = 0; - postData.display_moderator_tools = false; - postData.display_move_tools = false; + postData.display_moderator_tools = true; + postData.display_move_tools = privileges.admin || privileges.moderator; postData.relativeTime = utils.toISOString(postData.timestamp); next(null, postData); From 82fabad364665e7e8ddcc579912ea94f78fa9863 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Wed, 2 Apr 2014 14:31:26 -0400 Subject: [PATCH 07/89] closes #1321 --- app.js | 2 +- src/events.js | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/app.js b/app.js index d66e81f137..00675e0a30 100644 --- a/app.js +++ b/app.js @@ -39,7 +39,7 @@ winston.add(winston.transports.Console, { }); winston.add(winston.transports.File, { - filename: 'error.log', + filename: 'logs/error.log', level: 'error' }); diff --git a/src/events.js b/src/events.js index 3890b707e7..05d6e2cee5 100644 --- a/src/events.js +++ b/src/events.js @@ -9,7 +9,7 @@ var fs = require('fs'), (function(events) { - var logFileName = 'events.log'; + var logFileName = 'logs/events.log'; events.logPasswordChange = function(uid) { logWithUser(uid, 'changed password'); @@ -105,12 +105,11 @@ var fs = require('fs'), events.getLog = function(callback) { var logFile = path.join(nconf.get('base_dir'), logFileName); - fs.exists(logFile, function(exists) { - if (exists) { - fs.readFile(logFile, callback); - } else { - callback(null, 'No logs found'); + fs.readFile(logFile, function(err, res) { + if(err) { + return callback(null, 'No logs found!'); } + callback(null, res); }); }; From 27fddb0b484c82745d41f7955da5cfd2594b104d Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 2 Apr 2014 14:36:42 -0400 Subject: [PATCH 08/89] removing less-middleware --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 2c4e6e29c1..df0ddda99c 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,6 @@ "express-namespace": "~0.1.1", "passport": "~0.2.0", "passport-local": "0.1.6", - "less-middleware": "0.1.12", "marked": "0.2.8", "async": "~0.2.8", "gm": "1.14.2", From 4498f6e4106125d6d241f361518a163f5bb0a80e Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 2 Apr 2014 14:41:52 -0400 Subject: [PATCH 09/89] removing less-middleware calls --- src/middleware/index.js | 41 ++++++++++------------------------------- 1 file changed, 10 insertions(+), 31 deletions(-) diff --git a/src/middleware/index.js b/src/middleware/index.js index cb20763fb7..693f17b1c1 100644 --- a/src/middleware/index.js +++ b/src/middleware/index.js @@ -45,33 +45,18 @@ function routeCurrentTheme(app, themeData) { var themeId = (themeData['theme:id'] || 'nodebb-theme-vanilla'); // Detect if a theme has been selected, and handle appropriately - if (!themeData['theme:type'] || themeData['theme:type'] === 'local') { - // Local theme - if (process.env.NODE_ENV === 'development') { - winston.info('[themes] Using theme ' + themeId); - } + if (process.env.NODE_ENV === 'development') { + winston.info('[themes] Using theme ' + themeId); + } - // Theme's static directory - if (themeData['theme:staticDir']) { - app.use(nconf.get('relative_path') + '/css/assets', express.static(path.join(nconf.get('themes_path'), themeData['theme:id'], themeData['theme:staticDir']), { - maxAge: app.enabled('cache') ? 5184000000 : 0 - })); - if (process.env.NODE_ENV === 'development') { - winston.info('Static directory routed for theme: ' + themeData['theme:id']); - } - } - } else { - // If not using a local theme (bootswatch, etc), drop back to vanilla - if (process.env.NODE_ENV === 'development') { - winston.info('[themes] Using theme ' + themeId); - } - - app.use(require('less-middleware')({ - src: path.join(nconf.get('themes_path'), '/nodebb-theme-vanilla'), - dest: path.join(__dirname, '../../public/css'), - prefix: nconf.get('relative_path') + '/css', - yuicompress: app.enabled('minification') ? true : false + // Theme's static directory + if (themeData['theme:staticDir']) { + app.use(nconf.get('relative_path') + '/css/assets', express.static(path.join(nconf.get('themes_path'), themeData['theme:id'], themeData['theme:staticDir']), { + maxAge: app.enabled('cache') ? 5184000000 : 0 })); + if (process.env.NODE_ENV === 'development') { + winston.info('Static directory routed for theme: ' + themeData['theme:id']); + } } } @@ -190,12 +175,6 @@ module.exports = function(app, data) { app.use(express.favicon(path.join(__dirname, '../../', 'public', meta.config['brand:favicon'] ? meta.config['brand:favicon'] : 'favicon.ico'))); app.use(nconf.get('relative_path') + '/apple-touch-icon', middleware.routeTouchIcon); - app.use(require('less-middleware')({ - src: path.join(__dirname, '../../', 'public'), - prefix: nconf.get('relative_path'), - yuicompress: app.enabled('minification') ? true : false - })); - app.use(express.bodyParser()); app.use(express.cookieParser()); From 3f44f4bb3aae337e454e89f9b8ceb3ff21565a52 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Wed, 2 Apr 2014 16:54:57 -0400 Subject: [PATCH 10/89] closes #1319 --- src/postTools.js | 201 ++++++++++++++++++++--------------------- src/socket.io/index.js | 2 +- src/topics.js | 6 +- src/user.js | 16 +++- 4 files changed, 114 insertions(+), 111 deletions(-) diff --git a/src/postTools.js b/src/postTools.js index 814ea277a2..c9479e2763 100644 --- a/src/postTools.js +++ b/src/postTools.js @@ -141,117 +141,114 @@ var winston = require('winston'), }; PostTools.delete = function(uid, pid, callback) { - var success = function() { - posts.setPostField(pid, 'deleted', 1); - db.decrObjectField('global', 'postCount'); - - plugins.fireHook('action:post.delete', pid); - - events.logPostDelete(uid, pid); - - posts.getPostFields(pid, ['tid', 'uid'], function(err, postData) { - topics.decreasePostCount(postData.tid); - - user.decrementUserFieldBy(postData.uid, 'postcount', 1, function(err, postcount) { - db.sortedSetAdd('users:postcount', postcount, postData.uid); - }); - - topics.getTopicField(postData.tid, 'cid', function(err, cid) { - if(!err) { - db.sortedSetRemove('categories:recent_posts:cid:' + cid, pid); - } - }); - - // Delete the thread if it is the last undeleted post - threadTools.getLatestUndeletedPid(postData.tid, function(err, pid) { - if(err) { - return winston.error(err.message); - } - - if (!pid) { - threadTools.delete(postData.tid, uid, function(err) { - if (err) { - winston.error('Could not delete topic (tid: ' + postData.tid + ')', err.stack); - } - }); - } else { - posts.getPostField(pid, 'timestamp', function(err, timestamp) { - topics.updateTimestamp(postData.tid, timestamp); - }); - } - }); - - callback(null); - }); - }; - - posts.getPostField(pid, 'deleted', function(err, deleted) { - if(parseInt(deleted, 10) === 1) { - return callback(new Error('Post already deleted!')); - } - - PostTools.privileges(pid, uid, function(err, privileges) { - if (privileges.editable) { - success(); - } - }); - }); + togglePostDelete(uid, pid, true, callback); }; PostTools.restore = function(uid, pid, callback) { - var success = function() { - posts.setPostField(pid, 'deleted', 0); - db.incrObjectField('global', 'postCount'); + togglePostDelete(uid, pid, false, callback); + }; - events.logPostRestore(uid, pid); - - posts.getPostFields(pid, ['tid', 'uid', 'content'], function(err, postData) { - topics.increasePostCount(postData.tid); - - user.incrementUserFieldBy(postData.uid, 'postcount', 1); - - threadTools.getLatestUndeletedPid(postData.tid, function(err, pid) { - posts.getPostField(pid, 'timestamp', function(err, timestamp) { - topics.updateTimestamp(postData.tid, timestamp); - - topics.getTopicField(postData.tid, 'cid', function(err, cid) { - if(!err) { - db.sortedSetAdd('categories:recent_posts:cid:' + cid, timestamp, pid); - } - }); - }); - }); - - - plugins.fireHook('action:post.restore', postData); - - // Restore topic if it is the only post - topics.getTopicField(postData.tid, 'postcount', function(err, count) { - if (parseInt(count, 10) === 1) { - threadTools.restore(postData.tid, uid, function(err) { - if(err) { - winston.err(err); - } - }); - } - }); - - callback(); - }); - }; - - posts.getPostField(pid, 'deleted', function(err, deleted) { - if(parseInt(deleted, 10) === 0) { - return callback(new Error('Post already restored')); + function togglePostDelete(uid, pid, isDelete, callback) { + async.waterfall([ + function(next) { + posts.getPostField(pid, 'deleted', next); + }, + function(deleted, next) { + if(parseInt(deleted, 10) === 1 && isDelete) { + return next(new Error('Post already deleted')); + } else if(parseInt(deleted, 10) !== 1 && !isDelete) { + return next(new Error('Post already restored')); + } + PostTools.privileges(pid, uid, next); + }, + function(privileges, next) { + if (!privileges || !privileges.editable) { + return next(new Error('no privileges')); + } + next(); + } + ], function(err) { + if(err) { + return callback(err); } - PostTools.privileges(pid, uid, function(err, privileges) { - if (privileges.editable) { - success(); + posts.setPostField(pid, 'deleted', isDelete ? 1 : 0, function(err) { + if (err) { + return callback(err); + } + + events[isDelete ? 'logPostDelete' : 'logPostRestore'](uid, pid); + + db.incrObjectFieldBy('global', 'postCount', isDelete ? -1 : 1); + + posts.getPostFields(pid, ['tid', 'uid', 'content'], function(err, postData) { + if (err) { + return callback(err); + } + + if (isDelete) { + plugins.fireHook('action:post.delete', pid); + } else { + plugins.fireHook('action:post.restore', postData); + } + + async.parallel([ + function(next) { + topics[isDelete ? 'decreasePostCount' : 'increasePostCount'](postData.tid, next); + }, + function(next) { + user.incrementUserPostCountBy(postData.uid, isDelete ? -1 : 1, next); + }, + function(next) { + updateTopicTimestamp(postData.tid, next); + }, + function(next) { + addOrRemoveFromCategoryRecentPosts(pid, postData.tid, isDelete, next); + } + ], callback); + }); + }); + }); + } + + function updateTopicTimestamp(tid, callback) { + threadTools.getLatestUndeletedPid(tid, function(err, pid) { + if(err || !pid) { + return callback(err); + } + + posts.getPostField(pid, 'timestamp', function(err, timestamp) { + if (err) { + return callback(err); + } + + if (timestamp) { + topics.updateTimestamp(tid, timestamp); + } + callback(); + }); + }); + } + + function addOrRemoveFromCategoryRecentPosts(pid, tid, isDelete, callback) { + topics.getTopicField(tid, 'cid', function(err, cid) { + if (err) { + return callback(err); + } + + posts.getPostField(pid, 'timestamp', function(err, timestamp) { + if (err) { + return callback(err); + } + + if (isDelete) { + db.sortedSetRemove('categories:recent_posts:cid:' + cid, pid, callback); + } else { + db.sortedSetAdd('categories:recent_posts:cid:' + cid, timestamp, pid, callback); } }); }); - }; + } PostTools.parse = function(raw, callback) { raw = raw || ''; diff --git a/src/socket.io/index.js b/src/socket.io/index.js index bdd017a4c3..92f8eb1158 100644 --- a/src/socket.io/index.js +++ b/src/socket.io/index.js @@ -286,7 +286,7 @@ function emitTopicPostStats(callback) { }; if (!callback) { - io.sockets.emit('post.stats', null, stats); + io.sockets.emit('meta.getUsageStats', null, stats); } else { callback(null, stats); } diff --git a/src/topics.js b/src/topics.js index 9635b83582..2da58b7245 100644 --- a/src/topics.js +++ b/src/topics.js @@ -230,10 +230,6 @@ var async = require('async'), categoryCache[topicData.cid] = topicInfo.categoryData; userCache[topicData.uid] = topicInfo.user; - if (!topicInfo.teaser) { - return next(null, null); - } - if (!isTopicVisible(topicData, topicInfo)) { return next(null, null); } @@ -242,7 +238,7 @@ var async = require('async'), topicData.locked = parseInt(topicData.locked, 10) === 1; topicData.deleted = parseInt(topicData.deleted, 10) === 1; topicData.unread = !(topicInfo.hasread && parseInt(uid, 10) !== 0); - topicData.unreplied = parseInt(topicData.postcount, 10) === 1; + topicData.unreplied = parseInt(topicData.postcount, 10) <= 1; topicData.category = topicInfo.categoryData; topicData.teaser = topicInfo.teaser; diff --git a/src/user.js b/src/user.js index 30305bb8e8..c5f84bd2e2 100644 --- a/src/user.js +++ b/src/user.js @@ -235,15 +235,25 @@ var bcrypt = require('bcryptjs'), User.onNewPostMade = function(postData) { User.addPostIdToUser(postData.uid, postData.pid, postData.timestamp); - User.incrementUserFieldBy(postData.uid, 'postcount', 1, function(err, newpostcount) { - db.sortedSetAdd('users:postcount', newpostcount, postData.uid); - }); + User.incrementUserPostCountBy(postData.uid, 1); User.setUserField(postData.uid, 'lastposttime', postData.timestamp); }; emitter.on('event:newpost', User.onNewPostMade); + User.incrementUserPostCountBy = function(uid, value, callback) { + User.incrementUserFieldBy(uid, 'postcount', value, function(err, newpostcount) { + if (err) { + if(typeof callback === 'function') { + callback(err); + } + return; + } + db.sortedSetAdd('users:postcount', newpostcount, uid, callback); + }); + }; + User.addPostIdToUser = function(uid, pid, timestamp) { db.sortedSetAdd('uid:' + uid + ':posts', timestamp, pid); }; From 4bc3f54468640123a53624a1520a88de42e9cdd8 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Thu, 3 Apr 2014 12:42:40 -0400 Subject: [PATCH 11/89] closes #1318 --- public/language/en_GB/user.json | 1 + public/src/forum/accountheader.js | 2 +- public/src/forum/accountposts.js | 9 ++-- public/src/forum/accounttopics.js | 55 ++++++++++++++++++++++++ src/controllers/accounts.js | 69 +++++++++++++++++++++++-------- src/routes/index.js | 3 ++ 6 files changed, 115 insertions(+), 24 deletions(-) create mode 100644 public/src/forum/accounttopics.js diff --git a/public/language/en_GB/user.json b/public/language/en_GB/user.json index f89081ba14..d7f2d83b2d 100644 --- a/public/language/en_GB/user.json +++ b/public/language/en_GB/user.json @@ -49,6 +49,7 @@ "has_no_follower": "This user doesn't have any followers :(", "follows_no_one": "This user isn't following anyone :(", "has_no_posts": "This user didn't post anything yet.", + "has_no_topics": "This user didn't post any topics yet.", "email_hidden": "Email Hidden", "hidden": "hidden", diff --git a/public/src/forum/accountheader.js b/public/src/forum/accountheader.js index 96f73c9fe0..5ef0233fbb 100644 --- a/public/src/forum/accountheader.js +++ b/public/src/forum/accountheader.js @@ -3,7 +3,6 @@ define(function() { AccountHeader.init = function() { - AccountHeader.createMenu(); hideLinks(); @@ -18,6 +17,7 @@ define(function() { \ \
  • [[global:posts]]
  • \ +
  • [[topic:topics]]
  • \
  • [[user:followers]]
  • \
  • [[user:following]]
  • \ \ diff --git a/public/src/forum/accountposts.js b/public/src/forum/accountposts.js index 1403b606fe..c1e304c3b7 100644 --- a/public/src/forum/accountposts.js +++ b/public/src/forum/accountposts.js @@ -1,6 +1,6 @@ 'use strict'; -/* globals define, app, socket, ajaxify, templates, translator */ +/* globals define, app, socket, ajaxify, templates, translator, utils */ define(['forum/accountheader'], function(header) { var AccountPosts = {}, @@ -29,7 +29,7 @@ define(['forum/accountheader'], function(header) { } if (data.posts && data.posts.length) { - onTopicsLoaded(data.posts); + onPostsLoaded(data.posts); $('.user-favourite-posts').attr('data-nextstart', data.nextStart); } @@ -37,17 +37,16 @@ define(['forum/accountheader'], function(header) { }); } - function onTopicsLoaded(posts) { + function onPostsLoaded(posts) { ajaxify.loadTemplate('accountposts', function(accountposts) { var html = templates.parse(templates.getBlock(accountposts, 'posts'), {posts: posts}); translator.translate(html, function(translatedHTML) { - $('#category-no-topics').remove(); html = $(translatedHTML); html.find('img').addClass('img-responsive'); $('.user-favourite-posts').append(html); - $('span.timeago').timeago(); + html.find('span.timeago').timeago(); app.createUserTooltips(); utils.makeNumbersHumanReadable(html.find('.human-readable-number')); }); diff --git a/public/src/forum/accounttopics.js b/public/src/forum/accounttopics.js new file mode 100644 index 0000000000..3b4aa99b01 --- /dev/null +++ b/public/src/forum/accounttopics.js @@ -0,0 +1,55 @@ +'use strict'; + +/* globals define, app, socket, ajaxify, templates, translator, utils */ + +define(['forum/accountheader'], function(header) { + var AccountTopics = {}, + loadingMore = false; + + AccountTopics.init = function() { + header.init(); + + app.enableInfiniteLoading(function() { + if(!loadingMore) { + loadMore(); + } + }); + }; + + function loadMore() { + loadingMore = true; + socket.emit('topics.loadMoreFromSet', { + set: 'uid:' + $('.account-username-box').attr('data-uid') + ':topics', + after: $('.user-topics').attr('data-nextstart') + }, function(err, data) { + if(err) { + return app.alertError(err.message); + } + + if (data.topics && data.topics.length) { + onTopicsLoaded(data.topics); + $('.user-topics').attr('data-nextstart', data.nextStart); + } + + loadingMore = false; + }); + } + + function onTopicsLoaded(topics) { + ajaxify.loadTemplate('accounttopics', function(accounttopics) { + var html = templates.parse(templates.getBlock(accounttopics, 'topics'), {topics: topics}); + + translator.translate(html, function(translatedHTML) { + $('#category-no-topics').remove(); + + html = $(translatedHTML); + $('#topics-container').append(html); + html.find('span.timeago').timeago(); + app.createUserTooltips(); + utils.makeNumbersHumanReadable(html.find('.human-readable-number')); + }); + }); + } + + return AccountTopics; +}); \ No newline at end of file diff --git a/src/controllers/accounts.js b/src/controllers/accounts.js index 396d4ee86d..369449e9aa 100644 --- a/src/controllers/accounts.js +++ b/src/controllers/accounts.js @@ -10,6 +10,7 @@ var fs = require('fs'), user = require('./../user'), posts = require('./../posts'), + topics = require('./../topics'), postTools = require('../postTools'), utils = require('./../../public/src/utils'), meta = require('./../meta'), @@ -235,36 +236,68 @@ accountsController.getFavourites = function(req, res, next) { accountsController.getPosts = function(req, res, next) { var callerUID = req.user ? parseInt(req.user.uid, 10) : 0; - user.getUidByUserslug(req.params.userslug, function (err, uid) { - if (!uid) { + getBaseUser(req.params.userslug, function(err, userData) { + if (err) { + return next(err); + } + + if (!userData) { return userNotFound(); } - user.getUserFields(uid, ['username', 'userslug'], function (err, userData) { + posts.getPostsByUid(callerUID, userData.uid, 0, 19, function (err, userPosts) { if (err) { return next(err); } - if (!userData) { - return userNotFound(); - } + userData.theirid = userData.uid; + userData.yourid = callerUID; + userData.posts = userPosts.posts; + userData.nextStart = userPosts.nextStart; - posts.getPostsByUid(callerUID, uid, 0, 19, function (err, userPosts) { - if (err) { - return next(err); - } - userData.uid = uid; - userData.theirid = uid; - userData.yourid = callerUID; - userData.posts = userPosts.posts; - userData.nextStart = userPosts.nextStart; - - res.render('accountposts', userData); - }); + res.render('accountposts', userData); }); }); }; +accountsController.getTopics = function(req, res, next) { + var callerUID = req.user ? parseInt(req.user.uid, 10) : 0; + + getBaseUser(req.params.userslug, function(err, userData) { + if (err) { + return next(err); + } + + if (!userData) { + return userNotFound(); + } + + var set = 'uid:' + userData.uid + ':topics'; + topics.getTopicsFromSet(callerUID, set, 0, 19, function(err, userTopics) { + if(err) { + return next(err); + } + + userData.theirid = userData.uid; + userData.yourid = callerUID; + userData.topics = userTopics.topics; + userData.nextStart = userTopics.nextStart; + + res.render('accounttopics', userData); + }); + }); +}; + +function getBaseUser(userslug, callback) { + user.getUidByUserslug(userslug, function (err, uid) { + if (err || !uid) { + return callback(err); + } + + user.getUserFields(uid, ['uid', 'username', 'userslug'], callback); + }); +} + accountsController.accountEdit = function(req, res, next) { var callerUID = req.user ? parseInt(req.user.uid, 10) : 0; diff --git a/src/routes/index.js b/src/routes/index.js index bdb3c2323d..1f89c6d4a9 100644 --- a/src/routes/index.js +++ b/src/routes/index.js @@ -86,6 +86,9 @@ function accountRoutes(app, middleware, controllers) { app.get('/user/:userslug/posts', middleware.buildHeader, middleware.checkGlobalPrivacySettings, controllers.accounts.getPosts); app.get('/api/user/:userslug/posts', middleware.checkGlobalPrivacySettings, controllers.accounts.getPosts); + app.get('/user/:userslug/topics', middleware.buildHeader, middleware.checkGlobalPrivacySettings, controllers.accounts.getTopics); + app.get('/api/user/:userslug/topics', middleware.checkGlobalPrivacySettings, controllers.accounts.getTopics); + app.get('/user/:userslug/edit', middleware.buildHeader, middleware.checkGlobalPrivacySettings, middleware.checkAccountPermissions, controllers.accounts.accountEdit); app.get('/api/user/:userslug/edit', middleware.checkGlobalPrivacySettings, middleware.checkAccountPermissions, controllers.accounts.accountEdit); From 1edd2649fc55ea8a3d404cb8e3f41786c049fa67 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Thu, 3 Apr 2014 12:43:51 -0400 Subject: [PATCH 12/89] this doesnt exist on topics page --- public/src/forum/accounttopics.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/public/src/forum/accounttopics.js b/public/src/forum/accounttopics.js index 3b4aa99b01..ed94057c4d 100644 --- a/public/src/forum/accounttopics.js +++ b/public/src/forum/accounttopics.js @@ -40,8 +40,6 @@ define(['forum/accountheader'], function(header) { var html = templates.parse(templates.getBlock(accounttopics, 'topics'), {topics: topics}); translator.translate(html, function(translatedHTML) { - $('#category-no-topics').remove(); - html = $(translatedHTML); $('#topics-container').append(html); html.find('span.timeago').timeago(); From 41d5d16bac32d27756ed9cccbf61f4685f087b85 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Thu, 3 Apr 2014 13:03:40 -0400 Subject: [PATCH 13/89] show widget title next to type, closes #1313 --- public/src/forum/admin/themes.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/public/src/forum/admin/themes.js b/public/src/forum/admin/themes.js index 4dc81d6660..95ed41e2bc 100644 --- a/public/src/forum/admin/themes.js +++ b/public/src/forum/admin/themes.js @@ -26,7 +26,7 @@ define(['forum/admin/settings'], function(Settings) { themeType = parentEl.attr('data-type'), cssSrc = parentEl.attr('data-css'), themeId = parentEl.attr('data-theme'); - + socket.emit('admin.themes.set', { type: themeType, id: themeId, @@ -228,7 +228,7 @@ define(['forum/admin/settings'], function(Settings) { data: widgetData }); }); - + socket.emit('admin.widgets.set', { template: template, location: location, @@ -246,6 +246,11 @@ define(['forum/admin/settings'], function(Settings) { } function populateWidget(widget, data) { + if (data.title) { + var title = widget.find('.panel-heading strong'); + title.text(title.text() + ' - ' + data.title); + } + widget.find('input, textarea').each(function() { var input = $(this), value = data[input.attr('name')]; @@ -277,8 +282,6 @@ define(['forum/admin/settings'], function(Settings) { appendToggle(widgetEl); } } - - } } }); From 3a5048a6cdbb58e88440432e25db6de75533d275 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Thu, 3 Apr 2014 13:24:15 -0400 Subject: [PATCH 14/89] moved account menu to partial --- public/src/forum/accountheader.js | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/public/src/forum/accountheader.js b/public/src/forum/accountheader.js index 5ef0233fbb..4ff2f1be63 100644 --- a/public/src/forum/accountheader.js +++ b/public/src/forum/accountheader.js @@ -3,35 +3,11 @@ define(function() { AccountHeader.init = function() { - AccountHeader.createMenu(); - hideLinks(); selectActivePill(); }; - AccountHeader.createMenu = function() { - var userslug = $('.account-username-box').attr('data-userslug'); - - var html =''; - - - translator.translate(html, function(translatedHtml) { - $('.account-username-box').append(translatedHtml); - selectActivePill(); - hideLinks(); - }); - }; - function hideLinks() { var yourid = ajaxify.variables.get('yourid'), theirid = ajaxify.variables.get('theirid'); From a316927b2e98bf1714711ede41c595bfe4eca291 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Thu, 3 Apr 2014 13:43:51 -0400 Subject: [PATCH 15/89] added user topics page title --- public/language/en_GB/pages.json | 1 + 1 file changed, 1 insertion(+) diff --git a/public/language/en_GB/pages.json b/public/language/en_GB/pages.json index 10a7ef070b..a91aec5e8e 100644 --- a/public/language/en_GB/pages.json +++ b/public/language/en_GB/pages.json @@ -9,6 +9,7 @@ "user.following": "People %1 Follows", "user.followers": "People who Follow %1", "user.posts": "Posts made by %1", + "user.topics": "Topics created by %1", "user.favourites": "%1's Favourite Posts", "user.settings": "User Settings" } \ No newline at end of file From 3840a9e67ed2221f1ba3b7cebc788ba667b08e2c Mon Sep 17 00:00:00 2001 From: psychobunny Date: Thu, 3 Apr 2014 14:04:02 -0400 Subject: [PATCH 16/89] translating the footer... and sending the original 'doh --- src/middleware/middleware.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/middleware/middleware.js b/src/middleware/middleware.js index 1cb8de3b0b..3fba90dd3a 100644 --- a/src/middleware/middleware.js +++ b/src/middleware/middleware.js @@ -158,7 +158,7 @@ middleware.buildHeader = function(req, res, next) { // consider caching this, since no user specific information is loaded here app.render('footer', {}, function(err, template) { translator.translate(template, function(parsedTemplate) { - res.locals.footer = template; + res.locals.footer = parsedTemplate; next(err); }); }); From f16d98fcabea806a14aa8474b4b045c18b6a5511 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Thu, 3 Apr 2014 14:33:03 -0400 Subject: [PATCH 17/89] linting --- src/middleware/middleware.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/middleware/middleware.js b/src/middleware/middleware.js index 3fba90dd3a..35b52b32fe 100644 --- a/src/middleware/middleware.js +++ b/src/middleware/middleware.js @@ -50,7 +50,7 @@ middleware.redirectToAccountIfLoggedIn = function(req, res, next) { } else { next(); } -} +}; middleware.addSlug = function(req, res, next) { function redirect(method, id, name) { @@ -288,7 +288,6 @@ middleware.processRender = function(req, res, next) { var render = res.render; res.render = function(template, options, fn) { var self = this, - options = options || {}, req = this.req, app = req.app, defaultFn = function(err, str){ @@ -299,8 +298,11 @@ middleware.processRender = function(req, res, next) { self.send(str); }; + options = options || {}; + if ('function' === typeof options) { - fn = options, options = {}; + fn = options; + options = {}; } if ('function' !== typeof fn) { From 212768ee860395121292784d6fb79b8adf374ab9 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Thu, 3 Apr 2014 14:35:09 -0400 Subject: [PATCH 18/89] closes #1325 --- public/src/forum/admin/themes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/src/forum/admin/themes.js b/public/src/forum/admin/themes.js index 95ed41e2bc..ea55b97571 100644 --- a/public/src/forum/admin/themes.js +++ b/public/src/forum/admin/themes.js @@ -11,7 +11,7 @@ define(['forum/admin/settings'], function(Settings) { Themes.init = function() { var scriptEl = $('