diff --git a/app.js b/app.js index 58f028294d..57cb4dcc02 100644 --- a/app.js +++ b/app.js @@ -70,13 +70,15 @@ if (nconf.get('config')) { } configExists = fs.existsSync(configFile); -if (!nconf.get('help') && !nconf.get('setup') && !nconf.get('install') && !nconf.get('upgrade') && configExists) { +if (!nconf.get('help') && !nconf.get('setup') && !nconf.get('install') && !nconf.get('upgrade') && !nconf.get('reset') && configExists) { start(); } else if (nconf.get('setup') || nconf.get('install') || !configExists) { setup(); } else if (nconf.get('upgrade')) { upgrade(); -} else/* if (nconf.get('help') */{ +} else if (nconf.get('reset')) { + reset(); +} else { displayHelp(); }; @@ -196,6 +198,46 @@ function upgrade() { }); } +function reset() { + nconf.file({ + file: __dirname + '/config.json' + }); + + var meta = require('./src/meta'), + db = require('./src/database'), + async = require('async'); + + db.init(function(err) { + meta.configs.init(function () { + async.parallel([ + function(next) { + db.delete('plugins:active', next); + }, + function(next) { + meta.configs.set('theme:type', 'local', next); + }, + function(next) { + meta.configs.set('theme:id', 'nodebb-theme-vanilla', next); + }, + function(next) { + meta.configs.set('theme:staticDir', '', next); + }, + function(next) { + meta.configs.set('theme:templates', '', next); + } + ], function(err) { + if (err) { + winston.error(err); + } else { + winston.info("Successfully reset theme to Vanilla and disabled all plugins."); + } + + process.exit(); + }); + }); + }); +} + function displayHelp() { winston.info('Usage: node app [options] [arguments]'); winston.info(' [NODE_ENV=development | NODE_ENV=production] node app [--start] [arguments]'); @@ -204,5 +246,6 @@ function displayHelp() { winston.info(' --help displays this usage information'); winston.info(' --setup configure your environment and setup NodeBB'); winston.info(' --upgrade upgrade NodeBB, first read: github.com/designcreateplay/NodeBB/wiki/Upgrading-NodeBB'); + winston.info(' --reset soft resets NodeBB; disables all plugins and restores selected theme to Vanilla'); winston.info(' --start manually start NodeBB (default when no options are given)'); } diff --git a/nodebb b/nodebb index 9e313a7f4f..e514db0051 100755 --- a/nodebb +++ b/nodebb @@ -22,6 +22,10 @@ case "$1" in node app --setup ;; + reset) + node app --reset + ;; + dev) echo "Launching NodeBB in \"development\" mode." echo "To run the production build of NodeBB, please use \"forever\"." @@ -55,7 +59,7 @@ case "$1" in *) echo "Welcome to NodeBB" - echo $"Usage: $0 {start|dev|watch|language}" + echo $"Usage: $0 {start|dev|watch|upgrade}" echo '' column -s ' ' -t <<< ' start Start NodeBB in production mode diff --git a/package.json b/package.json index f9588447f1..424f97d689 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "rss": "~0.2.0", "prompt": "~0.2.11", "uglify-js": "~2.4.0", - "validator": "~1.5.1", + "validator": "~3.2.1", "nodebb-plugin-mentions": "~0.4", "nodebb-plugin-markdown": "~0.3", "nodebb-theme-vanilla": "~0.0.13", diff --git a/public/language/ar/global.json b/public/language/ar/global.json index 32bc77874a..6a8eb3ed8c 100644 --- a/public/language/ar/global.json +++ b/public/language/ar/global.json @@ -10,11 +10,14 @@ "500.message": "عفوا! يبدو وكأنه شيء ذهب على نحو خاطئ!", "register": "تسجيل", "login": "دخول", + "welcome_back": "Welcome Back ", + "you_have_successfully_logged_in": "You have successfully logged in", "logout": "تسجيل الخروج", "logout.title": "تم تسجيل الخروج", "logout.message": "قمت بتسجيل الخروج بنجاح من NodeBB", "save_changes": "حفظ التغييرات", "close": "أغلق", + "pagination": "Pagination", "header.admin": "مشرف", "header.recent": "حديث", "header.unread": "غير مقروء", @@ -48,5 +51,6 @@ "away": "Away", "dnd": "Do not Disturb", "invisible": "Invisible", - "offline": "Offline" + "offline": "Offline", + "privacy": "Privacy" } \ No newline at end of file diff --git a/public/language/ar/pages.json b/public/language/ar/pages.json index fa44fbfe46..d60e0a0a9b 100644 --- a/public/language/ar/pages.json +++ b/public/language/ar/pages.json @@ -1,6 +1,7 @@ { "home": "Home", "unread": "Unread Topics", + "popular": "Popular Topics", "recent": "Recent Topics", "users": "Registered Users", "notifications": "Notifications", diff --git a/public/language/ar/topic.json b/public/language/ar/topic.json index 58217661cd..81f8163fdf 100644 --- a/public/language/ar/topic.json +++ b/public/language/ar/topic.json @@ -20,6 +20,8 @@ "flag": "Flag", "flag_title": "Flag this post for moderation", "deleted_message": "This thread has been deleted. Only users with thread management privileges can see it.", + "watch": "Watch", + "share_this_post": "Share this Post", "thread_tools.title": "أدوات الموضوع", "thread_tools.markAsUnreadForAll": "علم غير مقروء", "thread_tools.pin": "علق الموضوع", diff --git a/public/language/ar/user.json b/public/language/ar/user.json index 160e409463..297bf37f80 100644 --- a/public/language/ar/user.json +++ b/public/language/ar/user.json @@ -26,6 +26,7 @@ "edit": "صحح", "uploaded_picture": "صورة تم تحميلها", "upload_new_picture": "تحميل صورة جديدة", + "current_password": "Current Password", "change_password": "تغيير كلمة السر", "confirm_password": "تأكيد كلمة السر", "password": "كلمة السر", diff --git a/public/language/cs/global.json b/public/language/cs/global.json index 88feb8c359..db2aaee987 100644 --- a/public/language/cs/global.json +++ b/public/language/cs/global.json @@ -10,11 +10,14 @@ "500.message": "Jejda, vypadá to, že se něco pokazilo.", "register": "Registrovat", "login": "Přihlásit se", + "welcome_back": "Welcome Back ", + "you_have_successfully_logged_in": "You have successfully logged in", "logout": "Odhlásit se", "logout.title": "Odhlásili jsme Vás.", "logout.message": "Úspěšně jsme Vás odhlásili z fóra.", "save_changes": "Uložit změny", "close": "Zrušit", + "pagination": "Pagination", "header.admin": "Administrace", "header.recent": "Aktuality", "header.unread": "Nepřečtené", @@ -48,5 +51,6 @@ "away": "Pryč", "dnd": "Nerušit", "invisible": "Neviditelný", - "offline": "Offline" + "offline": "Offline", + "privacy": "Privacy" } \ No newline at end of file diff --git a/public/language/cs/pages.json b/public/language/cs/pages.json index fa44fbfe46..d60e0a0a9b 100644 --- a/public/language/cs/pages.json +++ b/public/language/cs/pages.json @@ -1,6 +1,7 @@ { "home": "Home", "unread": "Unread Topics", + "popular": "Popular Topics", "recent": "Recent Topics", "users": "Registered Users", "notifications": "Notifications", diff --git a/public/language/cs/topic.json b/public/language/cs/topic.json index a0cd0bd05f..f24a403223 100644 --- a/public/language/cs/topic.json +++ b/public/language/cs/topic.json @@ -20,6 +20,8 @@ "flag": "Flag", "flag_title": "Flag this post for moderation", "deleted_message": "This thread has been deleted. Only users with thread management privileges can see it.", + "watch": "Watch", + "share_this_post": "Share this Post", "thread_tools.title": "Nástroje", "thread_tools.markAsUnreadForAll": "Označit jako nepřečtené", "thread_tools.pin": "Pin Topic", diff --git a/public/language/cs/user.json b/public/language/cs/user.json index 0b203f586f..f67e2c805a 100644 --- a/public/language/cs/user.json +++ b/public/language/cs/user.json @@ -26,6 +26,7 @@ "edit": "Upravit", "uploaded_picture": "Nahraný obrázek", "upload_new_picture": "Nahrát nový obrázek", + "current_password": "Current Password", "change_password": "Změnit heslo", "confirm_password": "Potvrzení hesla", "password": "Heslo", diff --git a/public/language/de/global.json b/public/language/de/global.json index 035faa4a68..7a6910df88 100644 --- a/public/language/de/global.json +++ b/public/language/de/global.json @@ -10,11 +10,14 @@ "500.message": "Ooops! Looks like something went wrong!", "register": "Registrierung", "login": "Login", + "welcome_back": "Willkommen zurück", + "you_have_successfully_logged_in": "Du hast dich erfolgreich eingeloggt", "logout": "Logout", "logout.title": "Du bist ausgeloggt.", "logout.message": "Du hast dich soeben erfolgreich aus dem Forum ausgeloggt.", "save_changes": "Speichere Änderungen", "close": "Schließen", + "pagination": "Seitennummerierung", "header.admin": "Admin", "header.recent": "Aktuell", "header.unread": "Ungelesen", @@ -48,5 +51,6 @@ "away": "Abwesend", "dnd": "Nicht stören", "invisible": "Unsichtbar", - "offline": "Offline" + "offline": "Offline", + "privacy": "Privatsphäre" } \ No newline at end of file diff --git a/public/language/de/notifications.json b/public/language/de/notifications.json index 806e837806..b38e73a7bc 100644 --- a/public/language/de/notifications.json +++ b/public/language/de/notifications.json @@ -1,7 +1,7 @@ { "title": "Benachrichtigungen", - "no_notifs": "You have no new notifications", - "see_all": "See all Notifications", + "no_notifs": "Du hast keine neuen Benachrichtigungen", + "see_all": "Alle Benachrichtigungen ansehen", "back_to_home": "Zurück zur Startseite", "outgoing_link": "Externer Link", "outgoing_link_message": "Du verlässt nun", diff --git a/public/language/de/pages.json b/public/language/de/pages.json index fa44fbfe46..d60e0a0a9b 100644 --- a/public/language/de/pages.json +++ b/public/language/de/pages.json @@ -1,6 +1,7 @@ { "home": "Home", "unread": "Unread Topics", + "popular": "Popular Topics", "recent": "Recent Topics", "users": "Registered Users", "notifications": "Notifications", diff --git a/public/language/de/recent.json b/public/language/de/recent.json index 33ec31df44..b787bae5cc 100644 --- a/public/language/de/recent.json +++ b/public/language/de/recent.json @@ -3,5 +3,5 @@ "day": "Tag", "week": "Woche", "month": "Monat", - "no_recent_topics": "There are no recent topics." + "no_recent_topics": "Es gibt keine aktuellen Themen." } \ No newline at end of file diff --git a/public/language/de/topic.json b/public/language/de/topic.json index 53d446aa48..2c073da3db 100644 --- a/public/language/de/topic.json +++ b/public/language/de/topic.json @@ -2,7 +2,7 @@ "topic": "Thema", "topics": "Themen", "no_topics_found": "Keine passende Themen gefunden.", - "no_posts_found": "No posts found!", + "no_posts_found": "Keine Beiträge gefunden!", "profile": "Profil", "posted_by": "Geposted von", "chat": "Chat", @@ -19,17 +19,19 @@ "tools": "Tools", "flag": "Markieren", "flag_title": "Diesen Beitrag zur Moderation markieren", - "deleted_message": "This thread has been deleted. Only users with thread management privileges can see it.", + "deleted_message": "Dieser Thread wurde gelöscht. Nur Nutzer mit Thread-Management Rechten können ihn sehen.", + "watch": "Beobachten", + "share_this_post": "Diesen Beitrag teilen", "thread_tools.title": "Thread Tools", "thread_tools.markAsUnreadForAll": "Als ungelesen markieren", - "thread_tools.pin": "Pin Topic", - "thread_tools.unpin": "Unpin Topic", - "thread_tools.lock": "Lock Topic", - "thread_tools.unlock": "Unlock Topic", - "thread_tools.move": "Move Topic", - "thread_tools.fork": "Fork Topic", - "thread_tools.delete": "Delete Topic", - "thread_tools.restore": "Restore Topic", + "thread_tools.pin": "Thema anpinnen", + "thread_tools.unpin": "Thema nicht mehr anpinnen", + "thread_tools.lock": "Thema schließen", + "thread_tools.unlock": "Thema öffnen", + "thread_tools.move": "Thema verschieben", + "thread_tools.fork": "Thema aufspalten", + "thread_tools.delete": "Thema löschen", + "thread_tools.restore": "Thema wiederherstellen", "load_categories": "Kategorien laden", "disabled_categories_note": "Deaktivierte Kategorien sind ausgegraut.", "confirm_move": "verschieben", @@ -39,10 +41,10 @@ "favourites.not_logged_in.title": "Nicht eingeloggt!", "favourites.not_logged_in.message": "Bitte logge dich ein, um diesen Beitrag favorisieren zu können.", "favourites.has_no_favourites": "Du hast noch keine Favoriten.", - "vote.not_logged_in.title": "Not Logged In", - "vote.not_logged_in.message": "Please log in in order to vote", - "vote.cant_vote_self.title": "Invalid Vote", - "vote.cant_vote_self.message": "You cannot vote for your own post", + "vote.not_logged_in.title": "Nicht eingeloggt", + "vote.not_logged_in.message": "Zum Bewerten bitte einloggen", + "vote.cant_vote_self.title": "Ungültige Bewertung", + "vote.cant_vote_self.message": "Du kannst deinen eigenen Beitrag nicht bewerten", "loading_more_posts": "Lade Mehr Posts", "move_topic": "Thema verschieben", "move_post": "Beitrag verschieben", @@ -53,11 +55,11 @@ "fork_success": "Thema erfolgreich aufgespalten!", "reputation": "Reputation", "posts": "Beiträge", - "composer.title_placeholder": "Enter your topic title here...", - "composer.write": "Write", - "composer.preview": "Preview", - "composer.discard": "Discard", - "composer.submit": "Submit", - "composer.replying_to": "Replying to", - "composer.new_topic": "New Topic" + "composer.title_placeholder": "Hier den Titel des Themas eingeben...", + "composer.write": "Schreiben", + "composer.preview": "Vorschau", + "composer.discard": "Verwerfen", + "composer.submit": "Absenden", + "composer.replying_to": "Als Antwort auf", + "composer.new_topic": "Neues Thema" } \ No newline at end of file diff --git a/public/language/de/user.json b/public/language/de/user.json index 9df84151f3..ae5f8f2993 100644 --- a/public/language/de/user.json +++ b/public/language/de/user.json @@ -9,7 +9,7 @@ "age": "Alter", "joined": "Beigetreten", "lastonline": "Zuletzt online", - "profile": "Profile", + "profile": "Profil", "profile_views": "Profilaufrufe", "reputation": "Reputation", "posts": "Posts", @@ -20,27 +20,28 @@ "gravatar": "Gravatar", "birthday": "Geburtstag", "chat": "Chat", - "follow": "Follow", - "unfollow": "Unfollow", + "follow": "Folgen", + "unfollow": "Nicht mehr folgen", "change_picture": "Ändere Profilbild", "edit": "Ändern", "uploaded_picture": "Hochgeladene Bilder", "upload_new_picture": "Neues Bild hochladen", + "current_password": "Aktuelles Passwort", "change_password": "Ändere Passwort", "confirm_password": "Passwort wiederholen", "password": "Passwort", "upload_picture": "Bild hochladen", "upload_a_picture": "Ein Bild hochladen", - "image_spec": "You may only upload PNG, JPG, or GIF files", + "image_spec": "Du darfst nur Dateien vom Typ PNG, JPG oder GIF hochladen", "max": "max.", "settings": "Einstellungen", "show_email": "Zeige meine E-Mail Adresse an.", "has_no_follower": "Dieser User hat noch keine Follower.", "follows_no_one": "Dieser User folgt noch niemanden.", - "has_no_posts": "This user didn't post anything yet.", + "has_no_posts": "Dieser Nutzer hat noch nichts gepostet.", "email_hidden": "E-Mail Adresse versteckt", "hidden": "versteckt", - "paginate_description": "Paginate topics and posts instead of using infinite scroll.", - "topics_per_page": "Topics per Page", - "posts_per_page": "Posts per Page" + "paginate_description": "Themen und Beiträge auf Seiten aufteilen statt unendliches Scrollen verweden", + "topics_per_page": "Themen pro Seite", + "posts_per_page": "Beiträge pro Seite" } \ No newline at end of file diff --git a/public/language/en_GB/global.json b/public/language/en_GB/global.json index 3d36d5fc90..b1dff9ec46 100644 --- a/public/language/en_GB/global.json +++ b/public/language/en_GB/global.json @@ -11,6 +11,9 @@ "register": "Register", "login": "Login", + "please_log_in": "Please Log In", + + "posting_restriction_info": "Posting is currently restricted to registered members only, click here to log in.", "welcome_back": "Welcome Back ", "you_have_successfully_logged_in": "You have successfully logged in", diff --git a/public/language/en_GB/pages.json b/public/language/en_GB/pages.json index d01f5f8a9b..9fc75d3d2b 100644 --- a/public/language/en_GB/pages.json +++ b/public/language/en_GB/pages.json @@ -1,6 +1,7 @@ { "home": "Home", "unread": "Unread Topics", + "popular": "Popular Topics", "recent": "Recent Topics", "users": "Registered Users", "notifications": "Notifications", diff --git a/public/language/en_GB/topic.json b/public/language/en_GB/topic.json index fedb625fd3..f51b3f4d33 100644 --- a/public/language/en_GB/topic.json +++ b/public/language/en_GB/topic.json @@ -24,6 +24,13 @@ "flag_title": "Flag this post for moderation", "deleted_message": "This thread has been deleted. Only users with thread management privileges can see it.", + "following_topic.title": "Following Topic", + "following_topic.message": "You will now be receiving notifications when somebody posts to this topic.", + "not_following_topic.title": "Not Following Topic", + "not_following_topic.message": "You will no longer receive notifications from this topic.", + + "login_to_subscribe": "Please register or log in in order to subscribe to this topic", + "watch": "Watch", "share_this_post": "Share this Post", @@ -79,5 +86,8 @@ "composer.thumb_title": "Add a thumbnail to this topic", "composer.thumb_url_placeholder": "http://example.com/thumb.png", "composer.thumb_file_label": "Or upload a file", - "composer.thumb_remove": "Clear fields" + "composer.thumb_remove": "Clear fields", + "composer.drag_and_drop_images": "Drag and Drop Images Here", + "composer.content_is_parsed_with": "Content is parsed with", + "composer.upload_instructions": "Upload images by dragging & dropping them." } diff --git a/public/language/es/global.json b/public/language/es/global.json index 972475dd09..c8c4addfd6 100644 --- a/public/language/es/global.json +++ b/public/language/es/global.json @@ -10,11 +10,14 @@ "500.message": "Ooops! Algo salio mal!, No te alarmes. Nuestros simios hiperinteligentes lo solucionarán", "register": "Registrarse", "login": "Conectarse", + "welcome_back": "Bienvenido de nuevo !", + "you_have_successfully_logged_in": "Te has conectado!", "logout": "Salir", "logout.title": "Te has desconectado.", "logout.message": "Haz sido desconectado correctamente", "save_changes": "Guardar Cambios", "close": "Cerrar", + "pagination": "Paginación", "header.admin": "Admin", "header.recent": "Recientes", "header.unread": "No Leeidos", @@ -48,5 +51,6 @@ "away": "No disponible", "dnd": "No molestar", "invisible": "Invisible", - "offline": "Desconectado" + "offline": "Desconectado", + "privacy": "Privacidad" } \ No newline at end of file diff --git a/public/language/es/notifications.json b/public/language/es/notifications.json index 536e98bdd3..9fb44b2aef 100644 --- a/public/language/es/notifications.json +++ b/public/language/es/notifications.json @@ -1,6 +1,6 @@ { "title": "Notificaciones", - "no_notifs": "You have no new notifications", + "no_notifs": "No tiene nuevas notificaciones", "see_all": "Ver todas las notificaciones", "back_to_home": "Volver al Inicio", "outgoing_link": "Link Externo", diff --git a/public/language/es/pages.json b/public/language/es/pages.json index fa44fbfe46..d60e0a0a9b 100644 --- a/public/language/es/pages.json +++ b/public/language/es/pages.json @@ -1,6 +1,7 @@ { "home": "Home", "unread": "Unread Topics", + "popular": "Popular Topics", "recent": "Recent Topics", "users": "Registered Users", "notifications": "Notifications", diff --git a/public/language/es/topic.json b/public/language/es/topic.json index 99d5eec80f..f631139043 100644 --- a/public/language/es/topic.json +++ b/public/language/es/topic.json @@ -20,6 +20,8 @@ "flag": "Reportar", "flag_title": "Reportar este post a los moderadores", "deleted_message": "Este tema ha sido borrado. Solo los miembros con privilegios pueden verlo.", + "watch": "Seguir", + "share_this_post": "Compartir este post", "thread_tools.title": "Herramientas del Tema", "thread_tools.markAsUnreadForAll": "Marcar como no leido", "thread_tools.pin": "Tema Importante", diff --git a/public/language/es/user.json b/public/language/es/user.json index 832603cf2f..2aaa6da119 100644 --- a/public/language/es/user.json +++ b/public/language/es/user.json @@ -19,19 +19,20 @@ "signature": "Firma", "gravatar": "Gravatar", "birthday": "Cumpleaños", - "chat": "Chat", - "follow": "Follow", - "unfollow": "Unfollow", + "chat": "Chat!", + "follow": "Seguir", + "unfollow": "Dejar de Seguir", "change_picture": "Cambiar Foto", "edit": "Editar", "uploaded_picture": "Fotos Cargadas", "upload_new_picture": "Cargar Nueva Foto", + "current_password": "Password actual", "change_password": "Cambiar Contraseña", "confirm_password": "Confirmar Contraseña", "password": "Contraseña", "upload_picture": "Cargar foto", "upload_a_picture": "Cargar una foto", - "image_spec": "You may only upload PNG, JPG, or GIF files", + "image_spec": "Solo puedes subir, PNG, JPG o Archivos GIF.", "max": "max.", "settings": "Opciones", "show_email": "Mostrar mi Email", @@ -40,7 +41,7 @@ "has_no_posts": "Este usuario aun no ha publicado nada.", "email_hidden": "Email Oculto", "hidden": "oculto", - "paginate_description": "Paginate topics and posts instead of using infinite scroll.", - "topics_per_page": "Topics per Page", - "posts_per_page": "Posts per Page" + "paginate_description": "La paginación de los temas no es por pagina, ya que tiene scroll infinito.", + "topics_per_page": "Temas por pagina", + "posts_per_page": "Post por pagina" } \ No newline at end of file diff --git a/public/language/fi/global.json b/public/language/fi/global.json index 8b020359d0..b276cf767e 100644 --- a/public/language/fi/global.json +++ b/public/language/fi/global.json @@ -10,11 +10,14 @@ "500.message": "Oho! Jotain meni pieleen!", "register": "Rekisteröidy", "login": "Kirjaudu", + "welcome_back": "Welcome Back ", + "you_have_successfully_logged_in": "You have successfully logged in", "logout": "Kirjaudu ulos", "logout.title": "Olet nyt kirjaunut ulos.", "logout.message": "Olet onnistuneesti kirjautunut ulos NodeBB:stä", "save_changes": "Tallenna muutokset", "close": "Sulje", + "pagination": "Pagination", "header.admin": "Admin", "header.recent": "Viimeisimmät", "header.unread": "Lukemattomat", @@ -48,5 +51,6 @@ "away": "Away", "dnd": "Do not Disturb", "invisible": "Invisible", - "offline": "Offline" + "offline": "Offline", + "privacy": "Privacy" } \ No newline at end of file diff --git a/public/language/fi/pages.json b/public/language/fi/pages.json index fa44fbfe46..d60e0a0a9b 100644 --- a/public/language/fi/pages.json +++ b/public/language/fi/pages.json @@ -1,6 +1,7 @@ { "home": "Home", "unread": "Unread Topics", + "popular": "Popular Topics", "recent": "Recent Topics", "users": "Registered Users", "notifications": "Notifications", diff --git a/public/language/fi/topic.json b/public/language/fi/topic.json index 17c23a3753..2cacaba33d 100644 --- a/public/language/fi/topic.json +++ b/public/language/fi/topic.json @@ -20,6 +20,8 @@ "flag": "Flag", "flag_title": "Flag this post for moderation", "deleted_message": "This thread has been deleted. Only users with thread management privileges can see it.", + "watch": "Watch", + "share_this_post": "Share this Post", "thread_tools.title": "Ketjun työkalut", "thread_tools.markAsUnreadForAll": "Merkitse luetuiksi", "thread_tools.pin": "Pin Topic", diff --git a/public/language/fi/user.json b/public/language/fi/user.json index b568904e51..82c0228b33 100644 --- a/public/language/fi/user.json +++ b/public/language/fi/user.json @@ -26,6 +26,7 @@ "edit": "Muokkaa", "uploaded_picture": "Siirretty kuva", "upload_new_picture": "Siirrä uusi kuva", + "current_password": "Current Password", "change_password": "Vaihda salasanaa", "confirm_password": "Vahvista salasanaa", "password": "Salasana", diff --git a/public/language/fr/category.json b/public/language/fr/category.json index b9ac50390c..4543da7ba3 100644 --- a/public/language/fr/category.json +++ b/public/language/fr/category.json @@ -7,7 +7,7 @@ "posts": "messages", "views": "vues", "posted": "posté", - "browsing": "parcourt", + "browsing": "parcouru par", "no_replies": "Personne n'a répondu", "replied": "répondu", "last_edited_by": "dernière édition par" diff --git a/public/language/fr/global.json b/public/language/fr/global.json index b19f1c5e94..bfe824c9e2 100644 --- a/public/language/fr/global.json +++ b/public/language/fr/global.json @@ -10,11 +10,14 @@ "500.message": "Oops! Il semblerait que quelque chose se soit mal passé!", "register": "S'inscrire", "login": "Connecter", + "welcome_back": "Bon retour parmis nous", + "you_have_successfully_logged_in": "Vous vous êtes connecté avec succès.", "logout": "Déconnection", "logout.title": "Vous êtes maintenant déconnecté.", "logout.message": "Vous vous êtes déconnecté de NodeBB avec succès", "save_changes": "Enregistrer les changements", "close": "Fermer", + "pagination": "Pagination", "header.admin": "Admin", "header.recent": "Récent", "header.unread": "Non Lu", @@ -48,5 +51,6 @@ "away": "Absent", "dnd": "Occupé", "invisible": "Invisible", - "offline": "Hors ligne" + "offline": "Hors ligne", + "privacy": "Vie privée" } \ No newline at end of file diff --git a/public/language/fr/pages.json b/public/language/fr/pages.json index baf9d9473e..3c61eb6cf8 100644 --- a/public/language/fr/pages.json +++ b/public/language/fr/pages.json @@ -1,6 +1,7 @@ { "home": "Accueil", "unread": "Sujets non lus", + "popular": "Popular Topics", "recent": "Sujets Récents", "users": "Utilisateurs enregistrés", "notifications": "Notifications", diff --git a/public/language/fr/recent.json b/public/language/fr/recent.json index 6972c3227e..0e09d6f5f9 100644 --- a/public/language/fr/recent.json +++ b/public/language/fr/recent.json @@ -3,5 +3,5 @@ "day": "Jour", "week": "Semaine", "month": "Mois", - "no_recent_topics": "There are no recent topics." + "no_recent_topics": "Il n'y a aucun sujet récent." } \ No newline at end of file diff --git a/public/language/fr/topic.json b/public/language/fr/topic.json index 8d487451a3..dd878a751f 100644 --- a/public/language/fr/topic.json +++ b/public/language/fr/topic.json @@ -20,16 +20,18 @@ "flag": "Signaler", "flag_title": "Signaler ce post pour modération", "deleted_message": "Ce sujet a été supprimé. Seuls les utilsateurs avec les droits d'administration peuvent le voir.", + "watch": "Suivre", + "share_this_post": "Partager ce message", "thread_tools.title": "Outils du Fil", "thread_tools.markAsUnreadForAll": "Marquer comme non lu", "thread_tools.pin": "Epingler le Sujet", - "thread_tools.unpin": "Unpin Topic", - "thread_tools.lock": "Lock Topic", - "thread_tools.unlock": "Unlock Topic", - "thread_tools.move": "Move Topic", - "thread_tools.fork": "Fork Topic", - "thread_tools.delete": "Delete Topic", - "thread_tools.restore": "Restore Topic", + "thread_tools.unpin": "Désépingler le sujet", + "thread_tools.lock": "Verrouiller le sujet", + "thread_tools.unlock": "Déverouiller le sujet", + "thread_tools.move": "Déplacer le sujet", + "thread_tools.fork": "Scinder le sujet", + "thread_tools.delete": "Supprimer le sujet", + "thread_tools.restore": "Restaurer le sujet", "load_categories": "Chargement des Categories", "disabled_categories_note": "Les catégories désactivées sont grisées", "confirm_move": "Déplacer", @@ -53,11 +55,11 @@ "fork_success": "Topic scindé !", "reputation": "Réputation", "posts": "Messages", - "composer.title_placeholder": "Enter your topic title here...", - "composer.write": "Write", - "composer.preview": "Preview", - "composer.discard": "Discard", - "composer.submit": "Submit", - "composer.replying_to": "Replying to", - "composer.new_topic": "New Topic" + "composer.title_placeholder": "Entrer le titre du sujet ici...", + "composer.write": "Ecriture", + "composer.preview": "Aperçu", + "composer.discard": "Abandon", + "composer.submit": "Envoi", + "composer.replying_to": "Répondre à", + "composer.new_topic": "Nouveau Sujet" } \ No newline at end of file diff --git a/public/language/fr/user.json b/public/language/fr/user.json index 1b3e382655..1cd9b5be98 100644 --- a/public/language/fr/user.json +++ b/public/language/fr/user.json @@ -26,6 +26,7 @@ "edit": "Editer", "uploaded_picture": "Image uploadée", "upload_new_picture": "Uploader une nouvelle image", + "current_password": "Mot de passe actuel", "change_password": "Changer le mot de passe", "confirm_password": "Confirmer le mot de passe", "password": "Mot de passe", diff --git a/public/language/he/global.json b/public/language/he/global.json index 3af7dc6230..dabcda50c6 100644 --- a/public/language/he/global.json +++ b/public/language/he/global.json @@ -10,11 +10,14 @@ "500.message": "אופס! נראה שמשהו השתבש!", "register": "הרשמה", "login": "התחברות", + "welcome_back": "ברוכים השבים", + "you_have_successfully_logged_in": "התחברת בהצלחה", "logout": "יציאה", "logout.title": "אתה מנותק כעת.", "logout.message": "התנתקת בהצלחה מ NodeBB.", "save_changes": "שמור שינויים", "close": "סגור", + "pagination": "עימוד", "header.admin": "ניהול", "header.recent": "פוסטים אחרונים", "header.unread": "לא נקרא", @@ -48,5 +51,6 @@ "away": "לא נמצא", "dnd": "לא להפריע", "invisible": "מוסתר", - "offline": "מנותק" + "offline": "מנותק", + "privacy": "פרטיות" } \ No newline at end of file diff --git a/public/language/he/notifications.json b/public/language/he/notifications.json index a316b79359..98527a734e 100644 --- a/public/language/he/notifications.json +++ b/public/language/he/notifications.json @@ -1,6 +1,6 @@ { "title": "התראות", - "no_notifs": "You have no new notifications", + "no_notifs": "אין התראות", "see_all": "צפה בכל ההתראות", "back_to_home": "חזרה ל NodeBB", "outgoing_link": "לינק", diff --git a/public/language/he/pages.json b/public/language/he/pages.json index a7cf97124d..0ff571585f 100644 --- a/public/language/he/pages.json +++ b/public/language/he/pages.json @@ -1,6 +1,7 @@ { "home": "דף הבית", "unread": "נושאים שלא נקראו", + "popular": "Popular Topics", "recent": "נושאים אחרונים", "users": "משתמשים רשומים", "notifications": "התראות", diff --git a/public/language/he/register.json b/public/language/he/register.json index 92828cff66..833a93f81b 100644 --- a/public/language/he/register.json +++ b/public/language/he/register.json @@ -12,7 +12,7 @@ "confirm_password": "אמת סיסמה", "confirm_password_placeholder": "אמת סיסמה", "register_now_button": "הרשם עכשיו", - "alternative_registration": "הרשמה אלטרנטיבית", + "alternative_registration": "הרשם באמצעות...", "terms_of_use": "תנאי שימוש", "agree_to_terms_of_use": "אני מסכים לתנאי השימוש" } \ No newline at end of file diff --git a/public/language/he/topic.json b/public/language/he/topic.json index 040adbd6e7..4e10c34c29 100644 --- a/public/language/he/topic.json +++ b/public/language/he/topic.json @@ -20,6 +20,8 @@ "flag": "דווח", "flag_title": "דווח על פוסט זה למנהל", "deleted_message": "הנושא הזה נמחק. רק מנהלים מורשים לראות אותו", + "watch": "עקוב", + "share_this_post": "שתף פוסט זה", "thread_tools.title": "כלים", "thread_tools.markAsUnreadForAll": "סמן כלא נקרא", "thread_tools.pin": "נעץ נושא", diff --git a/public/language/he/user.json b/public/language/he/user.json index 342c63ba2d..b2b0257e48 100644 --- a/public/language/he/user.json +++ b/public/language/he/user.json @@ -19,20 +19,21 @@ "signature": "חתימה", "gravatar": "אווטר", "birthday": "יום הולדת", - "chat": "Chat", - "follow": "Follow", - "unfollow": "Unfollow", + "chat": "צ'אט", + "follow": "עקוב", + "unfollow": "הפסק לעקוב", "change_picture": "שנה תמונה", "edit": "ערוך", "uploaded_picture": "התמונה הועלתה", "upload_new_picture": "העלה תמונה חדשה", + "current_password": "סיסמה נוכחית", "change_password": "שנה סיסמה", "confirm_password": "אמת סיסמה", "password": "סיסמה", "upload_picture": "העלה תמונה", "upload_a_picture": "העלה תמונה", - "image_spec": "You may only upload PNG, JPG, or GIF files", - "max": "max.", + "image_spec": "ניתן להעלות תמונות בפורמט PNG, JPG או GIF בלבד", + "max": "מקסימום", "settings": "הגדרות", "show_email": "פרסם את כתובת האימייל שלי", "has_no_follower": "למשתמש זה אין עוקבים :(", @@ -40,7 +41,7 @@ "has_no_posts": "המשתמש הזה עוד לא פרסם כלום.", "email_hidden": "כתובת אימייל מוסתרת", "hidden": "מוסתר", - "paginate_description": "Paginate topics and posts instead of using infinite scroll.", - "topics_per_page": "Topics per Page", - "posts_per_page": "Posts per Page" + "paginate_description": "צור עימוד לנושאים במקום לטעון את כל התוכן בעמוד אחד.", + "topics_per_page": "כמות נושאים בעמוד", + "posts_per_page": "כמות פוסטים בעמוד" } \ No newline at end of file diff --git a/public/language/hu/pages.json b/public/language/hu/pages.json index 2cd8f7a0ce..00a3c97c1a 100644 --- a/public/language/hu/pages.json +++ b/public/language/hu/pages.json @@ -1,6 +1,7 @@ { "home": "Kezdőlap", "unread": "Olvasatlan Topikok", + "popular": "Popular Topics", "recent": "Friss Topikok", "users": "Regisztrált Felhasználók", "notifications": "Értesítések", diff --git a/public/language/it/global.json b/public/language/it/global.json index a00103aeaf..7487945551 100644 --- a/public/language/it/global.json +++ b/public/language/it/global.json @@ -10,11 +10,14 @@ "500.message": "Oops! Qualcosa non funziona come si deve!", "register": "Registrazione", "login": "Login", + "welcome_back": "Welcome Back ", + "you_have_successfully_logged_in": "You have successfully logged in", "logout": "Logout", "logout.title": "Disconnessione avvenuta.", "logout.message": "Logout effettuato con successo", "save_changes": "Salva", "close": "Chiudi", + "pagination": "Pagination", "header.admin": "Amministratore", "header.recent": "Recenti", "header.unread": "Non letti", @@ -48,5 +51,6 @@ "away": "Away", "dnd": "Do not Disturb", "invisible": "Invisible", - "offline": "Offline" + "offline": "Offline", + "privacy": "Privacy" } \ No newline at end of file diff --git a/public/language/it/pages.json b/public/language/it/pages.json index fa44fbfe46..d60e0a0a9b 100644 --- a/public/language/it/pages.json +++ b/public/language/it/pages.json @@ -1,6 +1,7 @@ { "home": "Home", "unread": "Unread Topics", + "popular": "Popular Topics", "recent": "Recent Topics", "users": "Registered Users", "notifications": "Notifications", diff --git a/public/language/it/topic.json b/public/language/it/topic.json index 8ecde426db..0ae8b4b21b 100644 --- a/public/language/it/topic.json +++ b/public/language/it/topic.json @@ -20,6 +20,8 @@ "flag": "Flag", "flag_title": "Flag this post for moderation", "deleted_message": "This thread has been deleted. Only users with thread management privileges can see it.", + "watch": "Watch", + "share_this_post": "Share this Post", "thread_tools.title": "Strumenti per il Thread", "thread_tools.markAsUnreadForAll": "Mark Unread", "thread_tools.pin": "Pin Topic", diff --git a/public/language/it/user.json b/public/language/it/user.json index 0196e6d82b..5caa73bd27 100644 --- a/public/language/it/user.json +++ b/public/language/it/user.json @@ -26,6 +26,7 @@ "edit": "Modifica", "uploaded_picture": "Foto caricata", "upload_new_picture": "Carica una nuova foto", + "current_password": "Current Password", "change_password": "Cambia la Password", "confirm_password": "Conferma la Password", "password": "Password", diff --git a/public/language/nb/global.json b/public/language/nb/global.json index 8bfe250ad6..0c07cd9c51 100644 --- a/public/language/nb/global.json +++ b/public/language/nb/global.json @@ -10,14 +10,14 @@ "500.message": "Oops! Ser ut som noe gikk galt!", "register": "Registrer", "login": "Logg inn", - "welcome_back": "Welcome Back ", - "you_have_successfully_logged_in": "You have successfully logged in", + "welcome_back": "Velkommen tilbake", + "you_have_successfully_logged_in": "Du har blitt logget inn", "logout": "Logg ut", "logout.title": "Du er nå logget ut.", "logout.message": "Du er nå logget ut av NodeBB", "save_changes": "Lagre endringer", "close": "Steng", - "pagination": "Pagination", + "pagination": "Paginering", "header.admin": "Admin", "header.recent": "Seneste", "header.unread": "Uleste", @@ -52,5 +52,5 @@ "dnd": "Ikke forsturr", "invisible": "Usynlig", "offline": "Offline", - "privacy": "Privacy" + "privacy": "Personvern" } \ No newline at end of file diff --git a/public/language/nb/pages.json b/public/language/nb/pages.json index cf9620b18a..60940216d0 100644 --- a/public/language/nb/pages.json +++ b/public/language/nb/pages.json @@ -1,6 +1,7 @@ { "home": "Hjem", "unread": "Uleste emner", + "popular": "Popular Topics", "recent": "Seneste emner", "users": "Registrerte brukere", "notifications": "Varsler", diff --git a/public/language/nb/topic.json b/public/language/nb/topic.json index 17f5ece859..aab44d8835 100644 --- a/public/language/nb/topic.json +++ b/public/language/nb/topic.json @@ -20,8 +20,8 @@ "flag": "Rapporter", "flag_title": "Rapporter dette innlegget for granskning", "deleted_message": "Denne tråden har blitt slettet. Bare brukere med trådhåndterings-privilegier kan se den.", - "watch": "Watch", - "share_this_post": "Share this Post", + "watch": "Overvåk", + "share_this_post": "Del ditt innlegg", "thread_tools.title": "Trådverktøy", "thread_tools.markAsUnreadForAll": "Marker som ulest", "thread_tools.pin": "Fest tråd", diff --git a/public/language/nb/user.json b/public/language/nb/user.json index a47a984efe..c8b9f6b97b 100644 --- a/public/language/nb/user.json +++ b/public/language/nb/user.json @@ -26,7 +26,7 @@ "edit": "Endre", "uploaded_picture": "Opplastet bilde", "upload_new_picture": "Last opp nytt bidle", - "current_password": "Current Password", + "current_password": "Gjeldende passord", "change_password": "Endre passord", "confirm_password": "Bekreft passord", "password": "Passord", diff --git a/public/language/pl/global.json b/public/language/pl/global.json index 0a908625df..b8f5162365 100644 --- a/public/language/pl/global.json +++ b/public/language/pl/global.json @@ -10,14 +10,14 @@ "500.message": "Coś poszło nie tak.", "register": "Zarejestruj się", "login": "Zaloguj się", - "welcome_back": "Welcome Back ", - "you_have_successfully_logged_in": "You have successfully logged in", + "welcome_back": "Witaj z powrotem!", + "you_have_successfully_logged_in": "Zostałeś pomyślnie zalogowany.", "logout": "Wyloguj się", "logout.title": "Wylogowałeś się.", "logout.message": "Pomyślnie wylogowałeś się z forum.", "save_changes": "Zapisz zmiany", "close": "Zamknij", - "pagination": "Pagination", + "pagination": "Numerowanie stron", "header.admin": "Administracja", "header.recent": "Ostatnie", "header.unread": "Nieprzeczytane", @@ -52,5 +52,5 @@ "dnd": "Nie przeszkadzać", "invisible": "Niewidoczny", "offline": "Niedostępny", - "privacy": "Privacy" + "privacy": "Prywatność" } \ No newline at end of file diff --git a/public/language/pl/pages.json b/public/language/pl/pages.json index a966a141cb..ee44ea945b 100644 --- a/public/language/pl/pages.json +++ b/public/language/pl/pages.json @@ -1,6 +1,7 @@ { "home": "Strona główna", "unread": "Nieprzeczytane wątki", + "popular": "Popular Topics", "recent": "Ostatnie wątki", "users": "Zarejestrowani użytkownicy", "notifications": "Powiadomienia", diff --git a/public/language/pl/topic.json b/public/language/pl/topic.json index 9cd30f9296..020d68d6c2 100644 --- a/public/language/pl/topic.json +++ b/public/language/pl/topic.json @@ -19,15 +19,15 @@ "tools": "Narzędzia", "flag": "Zgłoś", "flag_title": "Zgłoś post do moderacji", - "deleted_message": "This thread has been deleted. Only users with thread management privileges can see it.", - "watch": "Watch", - "share_this_post": "Share this Post", + "deleted_message": "Ten wątek został usunięty. Tylko użytkownicy z uprawnieniami do zarządzania wątkami mogą go widzieć.", + "watch": "Obserwuj", + "share_this_post": "Udostępnij", "thread_tools.title": "Narzędzia wątków", "thread_tools.markAsUnreadForAll": "Oznacz jako nieprzeczytany", "thread_tools.pin": "Przypnij wątek", - "thread_tools.unpin": "Unpin Topic", + "thread_tools.unpin": "Odepnij wątek", "thread_tools.lock": "Zamknij wątek", - "thread_tools.unlock": "Unlock Topic", + "thread_tools.unlock": "Otwórz wątek", "thread_tools.move": "Przenieś wątek", "thread_tools.fork": "Skopiuj wątek", "thread_tools.delete": "Usuń wątek", diff --git a/public/language/pl/user.json b/public/language/pl/user.json index e438b566ae..36d9b509ec 100644 --- a/public/language/pl/user.json +++ b/public/language/pl/user.json @@ -26,7 +26,7 @@ "edit": "Edytuj", "uploaded_picture": "Przesłane zdjęcie", "upload_new_picture": "Prześlij nowe zdjęcie", - "current_password": "Current Password", + "current_password": "Obecne hasło", "change_password": "Zmień hasło", "confirm_password": "Potwierdź hasło", "password": "Hasło", diff --git a/public/language/pt_BR/global.json b/public/language/pt_BR/global.json index 843c4d3860..26d5525a81 100644 --- a/public/language/pt_BR/global.json +++ b/public/language/pt_BR/global.json @@ -10,11 +10,14 @@ "500.message": "Oops! deu algo errado!", "register": "Cadastrar", "login": "Logar", + "welcome_back": "Welcome Back ", + "you_have_successfully_logged_in": "You have successfully logged in", "logout": "Logout", "logout.title": "Logout com sucesso.", "logout.message": "Logado com Sucesso!", "save_changes": "Salvar Alterações", "close": "Fechar", + "pagination": "Pagination", "header.admin": "Admin", "header.recent": "Recente", "header.unread": "Não Lido", @@ -48,5 +51,6 @@ "away": "Ausente", "dnd": "Não Perturbe", "invisible": "Invisível", - "offline": "Offline" + "offline": "Offline", + "privacy": "Privacy" } \ No newline at end of file diff --git a/public/language/pt_BR/pages.json b/public/language/pt_BR/pages.json index 0519cf223e..8f6d6f08e8 100644 --- a/public/language/pt_BR/pages.json +++ b/public/language/pt_BR/pages.json @@ -1,6 +1,7 @@ { "home": "Home", "unread": "Tópicos Não Lidos", + "popular": "Popular Topics", "recent": "Tópicos Recentes", "users": "Usuários Registrados", "notifications": "Notificações", diff --git a/public/language/pt_BR/topic.json b/public/language/pt_BR/topic.json index e0a285200e..a20ea66672 100644 --- a/public/language/pt_BR/topic.json +++ b/public/language/pt_BR/topic.json @@ -20,6 +20,8 @@ "flag": "Marcar", "flag_title": "Marcar este post para moderação", "deleted_message": "This thread has been deleted. Only users with thread management privileges can see it.", + "watch": "Watch", + "share_this_post": "Share this Post", "thread_tools.title": "Ferramentas da Thread", "thread_tools.markAsUnreadForAll": "Marcar como não lido", "thread_tools.pin": "Pin Topic", diff --git a/public/language/pt_BR/user.json b/public/language/pt_BR/user.json index add3c59797..09270bb6d8 100644 --- a/public/language/pt_BR/user.json +++ b/public/language/pt_BR/user.json @@ -26,6 +26,7 @@ "edit": "Editar", "uploaded_picture": "Foto Carregada", "upload_new_picture": "Carregar novo Foto", + "current_password": "Current Password", "change_password": "Alterar Senha", "confirm_password": "Confirmar Senha", "password": "Senha", diff --git a/public/language/ru/global.json b/public/language/ru/global.json index c7f48f8b8a..518d4ba74b 100644 --- a/public/language/ru/global.json +++ b/public/language/ru/global.json @@ -10,11 +10,14 @@ "500.message": "Упс! Похоже, что-то пошло не так!", "register": "Зарегистрироваться", "login": "Войти", + "welcome_back": "Welcome Back ", + "you_have_successfully_logged_in": "You have successfully logged in", "logout": "Выйти", "logout.title": "Вы успешно вышли.", "logout.message": "Вы успешно вышли из NodeBB", "save_changes": "Сохранить изменения", "close": "Закрыть", + "pagination": "Pagination", "header.admin": "Админка", "header.recent": "Последние", "header.unread": "Непрочитанное", @@ -48,5 +51,6 @@ "away": "Отсутствует", "dnd": "Не беспокоить", "invisible": "Невидимый", - "offline": "Не в сети" + "offline": "Не в сети", + "privacy": "Privacy" } \ No newline at end of file diff --git a/public/language/ru/notifications.json b/public/language/ru/notifications.json index 87245bd6f3..8749bb8a50 100644 --- a/public/language/ru/notifications.json +++ b/public/language/ru/notifications.json @@ -1,7 +1,7 @@ { "title": "Уведомления", - "no_notifs": "You have no new notifications", - "see_all": "See all Notifications", + "no_notifs": "Для Вас нет новых уведомлений", + "see_all": "Просмотреть все уведомления", "back_to_home": "Вернуться на NodeBB", "outgoing_link": "Внешняя ссылка", "outgoing_link_message": "Вы покидаете", diff --git a/public/language/ru/pages.json b/public/language/ru/pages.json index b4a44b79e7..0d5f5b9ca9 100644 --- a/public/language/ru/pages.json +++ b/public/language/ru/pages.json @@ -1,6 +1,7 @@ { "home": "Главная", "unread": "Непрочитанные темы", + "popular": "Popular Topics", "recent": "Последние темы", "users": "Зарегистрированные пользователи", "notifications": "Уведомления", diff --git a/public/language/ru/topic.json b/public/language/ru/topic.json index bcc2c10538..2ab3aadc57 100644 --- a/public/language/ru/topic.json +++ b/public/language/ru/topic.json @@ -20,12 +20,14 @@ "flag": "Отметить", "flag_title": "Отметить сообщение для модерирования", "deleted_message": "This thread has been deleted. Only users with thread management privileges can see it.", + "watch": "Watch", + "share_this_post": "Share this Post", "thread_tools.title": "Опции Темы", "thread_tools.markAsUnreadForAll": "Отметить как непрочитанные", "thread_tools.pin": "Pin Topic", "thread_tools.unpin": "Unpin Topic", - "thread_tools.lock": "Lock Topic", - "thread_tools.unlock": "Unlock Topic", + "thread_tools.lock": "Закрыть Тему", + "thread_tools.unlock": "Открыть Тему", "thread_tools.move": "Move Topic", "thread_tools.fork": "Fork Topic", "thread_tools.delete": "Delete Topic", diff --git a/public/language/ru/user.json b/public/language/ru/user.json index 1ac49e0841..73abdd05d0 100644 --- a/public/language/ru/user.json +++ b/public/language/ru/user.json @@ -26,6 +26,7 @@ "edit": "Редактировать", "uploaded_picture": "Загруженные Фотографии", "upload_new_picture": "Загрузить новую фотографию", + "current_password": "Current Password", "change_password": "Изменить Пароль", "confirm_password": "Подтвердите Пароль", "password": "Пароль", diff --git a/public/language/sk/global.json b/public/language/sk/global.json index db000948c1..6fa7361dca 100644 --- a/public/language/sk/global.json +++ b/public/language/sk/global.json @@ -10,11 +10,14 @@ "500.message": "Jejda, vyzerá, že sa niečo pokazilo.", "register": "Registrovať", "login": "Prihlásiť sa", + "welcome_back": "Vitaj naspäť", + "you_have_successfully_logged_in": "Úspešne si sa prihlásil", "logout": "Odhlásiť sa", "logout.title": "Odhlásili sme Vás.", "logout.message": "Úspešne sme Vás odhlásili z fóra.", "save_changes": "Uložiť zmeny", "close": "Zrušiť", + "pagination": "Stránkovanie", "header.admin": "Administrácia", "header.recent": "Aktuality", "header.unread": "Neprečítané", @@ -48,5 +51,6 @@ "away": "Preč", "dnd": "Nevyrušovať", "invisible": "Neviditeľný", - "offline": "Offline" + "offline": "Offline", + "privacy": "Súkromie" } \ No newline at end of file diff --git a/public/language/sk/pages.json b/public/language/sk/pages.json index fa44fbfe46..d60e0a0a9b 100644 --- a/public/language/sk/pages.json +++ b/public/language/sk/pages.json @@ -1,6 +1,7 @@ { "home": "Home", "unread": "Unread Topics", + "popular": "Popular Topics", "recent": "Recent Topics", "users": "Registered Users", "notifications": "Notifications", diff --git a/public/language/sk/topic.json b/public/language/sk/topic.json index a5bca83040..4bf7ffe6cd 100644 --- a/public/language/sk/topic.json +++ b/public/language/sk/topic.json @@ -20,6 +20,8 @@ "flag": "Označiť", "flag_title": "Označiť príspevok pre moderáciu", "deleted_message": "Toto vlákno bolo vymazané. Iba užívatelia s privilégiami ho môžu vidieť.", + "watch": "Sledovať", + "share_this_post": "Zdielaj tento príspevok", "thread_tools.title": "Nástroje", "thread_tools.markAsUnreadForAll": "Označ ako neprečítané", "thread_tools.pin": "Zviditeľniť tému", diff --git a/public/language/sk/user.json b/public/language/sk/user.json index df452555de..5571f8142c 100644 --- a/public/language/sk/user.json +++ b/public/language/sk/user.json @@ -20,18 +20,19 @@ "gravatar": "Gravatar", "birthday": "Dátum narodenia", "chat": "Chat", - "follow": "Follow", - "unfollow": "Unfollow", + "follow": "Nasleduj", + "unfollow": "Nenasledovať", "change_picture": "Zmeniť obrázok", "edit": "Upraviť", "uploaded_picture": "Nahraný obrázok", "upload_new_picture": "Nahrať nový obrázok", + "current_password": "Aktuálne heslo", "change_password": "Zmeniť heslo", "confirm_password": "Potvrdenie hesla", "password": "Heslo", "upload_picture": "Nahrať obrázok", "upload_a_picture": "Nahrať obrázok", - "image_spec": "You may only upload PNG, JPG, or GIF files", + "image_spec": "Môžeš pridať len obrázky typu PNG, JPG alebo GIF", "max": "max.", "settings": "Nastavenia", "show_email": "Zobrazovať môj email v profile", @@ -40,7 +41,7 @@ "has_no_posts": "Tento používateľ ešte nespravil príspevok", "email_hidden": "Skrytý email", "hidden": "skrytý", - "paginate_description": "Paginate topics and posts instead of using infinite scroll.", - "topics_per_page": "Topics per Page", - "posts_per_page": "Posts per Page" + "paginate_description": "Stránkuj témy a príspevky miesto používania nekonečného posúvania.", + "topics_per_page": "Témy na stranu", + "posts_per_page": "Príspevkov na stranu" } \ No newline at end of file diff --git a/public/language/sv/global.json b/public/language/sv/global.json index 68d3ce1427..83515c5b57 100644 --- a/public/language/sv/global.json +++ b/public/language/sv/global.json @@ -10,11 +10,14 @@ "500.message": "Hoppsan! Verkar som att något gått snett!", "register": "Registrera", "login": "Logga in", + "welcome_back": "Welcome Back ", + "you_have_successfully_logged_in": "You have successfully logged in", "logout": "Logga ut", "logout.title": "Du är nu utloggad.", "logout.message": "Du är nu utloggad från NodeBB.", "save_changes": "Spara ändringar", "close": "Stäng", + "pagination": "Pagination", "header.admin": "Admin", "header.recent": "Senaste", "header.unread": "Olästa", @@ -48,5 +51,6 @@ "away": "Borta", "dnd": "Stör ej", "invisible": "Osynlig", - "offline": "Offline" + "offline": "Offline", + "privacy": "Privacy" } \ No newline at end of file diff --git a/public/language/sv/pages.json b/public/language/sv/pages.json index 585c08b83b..dd938e334f 100644 --- a/public/language/sv/pages.json +++ b/public/language/sv/pages.json @@ -1,6 +1,7 @@ { "home": "Hem", "unread": "Olästa ämnen", + "popular": "Popular Topics", "recent": "Senaste ämnena", "users": "Registrerade användare", "notifications": "Notiser", diff --git a/public/language/sv/topic.json b/public/language/sv/topic.json index f449cbfd4e..771ed23e96 100644 --- a/public/language/sv/topic.json +++ b/public/language/sv/topic.json @@ -20,6 +20,8 @@ "flag": "Rapportera", "flag_title": "Rapportera detta inlägg för granskning", "deleted_message": "Denna tråd har tagits bort. Endast användare med administrations-rättigheter kan se den.", + "watch": "Watch", + "share_this_post": "Share this Post", "thread_tools.title": "Trådverktyg", "thread_tools.markAsUnreadForAll": "Markera som oläst", "thread_tools.pin": "Fäst ämne", diff --git a/public/language/sv/user.json b/public/language/sv/user.json index dbb3f03519..13e77e3d00 100644 --- a/public/language/sv/user.json +++ b/public/language/sv/user.json @@ -26,6 +26,7 @@ "edit": "Ändra", "uploaded_picture": "Uppladdad bild", "upload_new_picture": "Ladda upp ny bild", + "current_password": "Current Password", "change_password": "Ändra lösenord", "confirm_password": "Bekräfta lösenord", "password": "Lösenord", diff --git a/public/language/tr/global.json b/public/language/tr/global.json index d404a19fb8..b04553aaa4 100644 --- a/public/language/tr/global.json +++ b/public/language/tr/global.json @@ -10,11 +10,14 @@ "500.message": "Ups! Bir şeyler ters gitti sanki!", "register": "Kayıt Ol", "login": "Giriş", + "welcome_back": "Welcome Back ", + "you_have_successfully_logged_in": "You have successfully logged in", "logout": "Çıkış", "logout.title": "Şimdi çıkış yaptınız.", "logout.message": "NodeBB 'ye başarıyla giriş yaptınız", "save_changes": "Değişiklikleri kaydet", "close": "Yakın", + "pagination": "Pagination", "header.admin": "Yönetim", "header.recent": "Yeni", "header.unread": "Okunmamış", @@ -48,5 +51,6 @@ "away": "Dışarıda", "dnd": "Rahatsız Etmeyin", "invisible": "Görünmez", - "offline": "Çevrimdışı" + "offline": "Çevrimdışı", + "privacy": "Privacy" } \ No newline at end of file diff --git a/public/language/tr/pages.json b/public/language/tr/pages.json index 4f3ecda974..55f625162f 100644 --- a/public/language/tr/pages.json +++ b/public/language/tr/pages.json @@ -1,6 +1,7 @@ { "home": "Ana Sayfa", "unread": "Okunmayan Başlıklar", + "popular": "Popular Topics", "recent": "Güncel Konular", "users": "Kayıtlı Kullanıcılar", "notifications": "Bildirimler", diff --git a/public/language/tr/topic.json b/public/language/tr/topic.json index 5156b0b271..b587f45646 100644 --- a/public/language/tr/topic.json +++ b/public/language/tr/topic.json @@ -20,6 +20,8 @@ "flag": "Bayrak", "flag_title": "Bu iletiyi moderatöre haber et", "deleted_message": "This thread has been deleted. Only users with thread management privileges can see it.", + "watch": "Watch", + "share_this_post": "Share this Post", "thread_tools.title": "Seçenekler", "thread_tools.markAsUnreadForAll": "Okunmadı Olarak İşaretle", "thread_tools.pin": "Pin Topic", diff --git a/public/language/tr/user.json b/public/language/tr/user.json index 00d7c73173..3b5f50793a 100644 --- a/public/language/tr/user.json +++ b/public/language/tr/user.json @@ -26,6 +26,7 @@ "edit": "Düzenle", "uploaded_picture": "Yüklenmiş Fotoğraflar", "upload_new_picture": "Yeni bir resim Yükle", + "current_password": "Current Password", "change_password": "Şifre Değiştir", "confirm_password": "Şifreyi Onayla", "password": "Şifre", diff --git a/public/language/zh_CN/global.json b/public/language/zh_CN/global.json index 3faf839790..ca76a1ea64 100644 --- a/public/language/zh_CN/global.json +++ b/public/language/zh_CN/global.json @@ -10,11 +10,14 @@ "500.message": "不好!看来是哪里出错了!", "register": "注册", "login": "登录", + "welcome_back": "欢迎回来", + "you_have_successfully_logged_in": "You have successfully logged in", "logout": "退出", "logout.title": "你已经退出。", "logout.message": "你已经成功退出登录。", "save_changes": "保存修改", "close": "关闭", + "pagination": "Pagination", "header.admin": "管理", "header.recent": "最近", "header.unread": "未读", @@ -48,5 +51,6 @@ "away": "Away", "dnd": "Do not Disturb", "invisible": "Invisible", - "offline": "Offline" + "offline": "Offline", + "privacy": "Privacy" } \ No newline at end of file diff --git a/public/language/zh_CN/login.json b/public/language/zh_CN/login.json index 5c426ecbb3..25fe9a81f2 100644 --- a/public/language/zh_CN/login.json +++ b/public/language/zh_CN/login.json @@ -6,5 +6,5 @@ "forgot_password": "忘记密码?", "alternative_logins": "其他登录方式", "failed_login_attempt": "登录失败,请再尝试。", - "login_successful": "你已成功登录!" + "login_successful": "您已经成功登录!" } \ No newline at end of file diff --git a/public/language/zh_CN/pages.json b/public/language/zh_CN/pages.json index fa44fbfe46..d60e0a0a9b 100644 --- a/public/language/zh_CN/pages.json +++ b/public/language/zh_CN/pages.json @@ -1,6 +1,7 @@ { "home": "Home", "unread": "Unread Topics", + "popular": "Popular Topics", "recent": "Recent Topics", "users": "Registered Users", "notifications": "Notifications", diff --git a/public/language/zh_CN/topic.json b/public/language/zh_CN/topic.json index d2b99ed8c5..30ae7c73fe 100644 --- a/public/language/zh_CN/topic.json +++ b/public/language/zh_CN/topic.json @@ -20,6 +20,8 @@ "flag": "Flag", "flag_title": "Flag this post for moderation", "deleted_message": "This thread has been deleted. Only users with thread management privileges can see it.", + "watch": "Watch", + "share_this_post": "Share this Post", "thread_tools.title": "管理工具", "thread_tools.markAsUnreadForAll": "Mark Unread", "thread_tools.pin": "Pin Topic", diff --git a/public/language/zh_CN/user.json b/public/language/zh_CN/user.json index cadeaefd48..698abc17c6 100644 --- a/public/language/zh_CN/user.json +++ b/public/language/zh_CN/user.json @@ -1,46 +1,47 @@ { "banned": "封禁", - "offline": "下线", + "offline": "离线", "username": "用户名", - "email": "Email", + "email": "邮件", "fullname": "姓名", "website": "网站", "location": "地址", "age": "年龄", "joined": "加入时间", "lastonline": "最后在线", - "profile": "Profile", + "profile": "资料", "profile_views": "资料被查看", "reputation": "声望", "posts": "发帖数", - "favourites": "Favourites", + "favourites": "收藏的帖子", "followers": "被关注", "following": "关注", "signature": "签名", "gravatar": "Gravatar头像", "birthday": "生日", - "chat": "Chat", - "follow": "Follow", - "unfollow": "Unfollow", + "chat": "聊天", + "follow": "关注", + "unfollow": "取消关注", "change_picture": "改变头像", "edit": "编辑", "uploaded_picture": "已有头像", "upload_new_picture": "上传新头像", + "current_password": "当前密码", "change_password": "更改密码", "confirm_password": "确认密码", "password": "密码", "upload_picture": "上传头像", "upload_a_picture": "上传一张照片", - "image_spec": "You may only upload PNG, JPG, or GIF files", - "max": "max.", - "settings": "Settings", + "image_spec": "您只能上传PNG,JPG或者是GIF图片文件", + "max": "最大.", + "settings": "设置", "show_email": "显示我的邮箱", "has_no_follower": "该用户还没有被任何人关注。", "follows_no_one": "该用户还没有关注过任何人。", - "has_no_posts": "This user didn't post anything yet.", + "has_no_posts": "此用户还未发表过任何帖子.", "email_hidden": "邮箱被隐藏", "hidden": "隐藏", - "paginate_description": "Paginate topics and posts instead of using infinite scroll.", - "topics_per_page": "Topics per Page", - "posts_per_page": "Posts per Page" + "paginate_description": "使用分页方式显示话题和帖子,代替滚动显示", + "topics_per_page": "每页话题数量设置", + "posts_per_page": "每页帖子数量设置" } \ No newline at end of file diff --git a/public/language/zh_TW/global.json b/public/language/zh_TW/global.json index 8820cf5083..d00e8f8baf 100644 --- a/public/language/zh_TW/global.json +++ b/public/language/zh_TW/global.json @@ -10,11 +10,14 @@ "500.message": "不好!看來是哪裡出錯了!", "register": "注冊", "login": "登錄", + "welcome_back": "Welcome Back ", + "you_have_successfully_logged_in": "You have successfully logged in", "logout": "退出", "logout.title": "你已經退出。", "logout.message": "你已經成功退出登錄。", "save_changes": "保存修改", "close": "關閉", + "pagination": "Pagination", "header.admin": "管理", "header.recent": "最近", "header.unread": "未讀", @@ -48,5 +51,6 @@ "away": "Away", "dnd": "Do not Disturb", "invisible": "Invisible", - "offline": "Offline" + "offline": "Offline", + "privacy": "Privacy" } \ No newline at end of file diff --git a/public/language/zh_TW/pages.json b/public/language/zh_TW/pages.json index fa44fbfe46..d60e0a0a9b 100644 --- a/public/language/zh_TW/pages.json +++ b/public/language/zh_TW/pages.json @@ -1,6 +1,7 @@ { "home": "Home", "unread": "Unread Topics", + "popular": "Popular Topics", "recent": "Recent Topics", "users": "Registered Users", "notifications": "Notifications", diff --git a/public/language/zh_TW/topic.json b/public/language/zh_TW/topic.json index 7d353e102f..e1b54c68e5 100644 --- a/public/language/zh_TW/topic.json +++ b/public/language/zh_TW/topic.json @@ -20,6 +20,8 @@ "flag": "Flag", "flag_title": "Flag this post for moderation", "deleted_message": "This thread has been deleted. Only users with thread management privileges can see it.", + "watch": "Watch", + "share_this_post": "Share this Post", "thread_tools.title": "管理工具", "thread_tools.markAsUnreadForAll": "Mark Unread", "thread_tools.pin": "Pin Topic", diff --git a/public/language/zh_TW/user.json b/public/language/zh_TW/user.json index 950f075a0d..ce0e52173f 100644 --- a/public/language/zh_TW/user.json +++ b/public/language/zh_TW/user.json @@ -26,6 +26,7 @@ "edit": "編輯", "uploaded_picture": "已有頭像", "upload_new_picture": "上傳新頭像", + "current_password": "Current Password", "change_password": "更改密碼", "confirm_password": "確認密碼", "password": "密碼", diff --git a/public/src/ajaxify.js b/public/src/ajaxify.js index 977e9a8246..58e6eceb76 100644 --- a/public/src/ajaxify.js +++ b/public/src/ajaxify.js @@ -65,7 +65,7 @@ var ajaxify = {}; } var hash = ''; - if(ajaxify.initialLoad && window.location.href.search(/#[0-9]+$/) !== -1) { + if(ajaxify.initialLoad) { hash = window.location.hash ? window.location.hash : ''; } @@ -97,7 +97,7 @@ var ajaxify = {}; templates.flush(); templates.load_template(function () { - exec_body_scripts(content); + require(['forum/' + tpl_url], function(script) { if (script && script.init) { script.init(); @@ -172,56 +172,4 @@ var ajaxify = {}; }); }); - function exec_body_scripts(body_el) { - // modified from http://stackoverflow.com/questions/2592092/executing-script-elements-inserted-with-innerhtml - - function nodeName(elem, name) { - return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); - } - - function evalScript(elem) { - var data = (elem.text || elem.textContent || elem.innerHTML || ""), - head = document.getElementsByTagName("head")[0] || - document.documentElement, - script = document.createElement("script"); - - script.type = "text/javascript"; - try { - script.appendChild(document.createTextNode(data)); - } catch (e) { - script.text = data; - } - - if (elem.src) { - script.src = elem.src; - } - - head.insertBefore(script, head.firstChild); - //TODO: remove from head before inserting?, doing this breaks scripts in safari so commented out for now - //head.removeChild(script); - } - - var scripts = [], - script, - children_nodes = $(body_el).find('script'), - child, - i; - - for (i = 0; children_nodes[i]; i++) { - child = children_nodes[i]; - if (nodeName(child, "script") && - (!child.type || child.type.toLowerCase() === "text/javascript")) { - scripts.push(child); - } - } - - for (i = 0; scripts[i]; i++) { - script = scripts[i]; - if (script.parentNode) { - script.parentNode.removeChild(script); - } - evalScript(scripts[i]); - } - } - }(jQuery)); diff --git a/public/src/forum/accountedit.js b/public/src/forum/accountedit.js index 0deeda57c7..13bab6cf9d 100644 --- a/public/src/forum/accountedit.js +++ b/public/src/forum/accountedit.js @@ -190,10 +190,11 @@ define(['forum/accountheader', 'uploader'], function(header, uploader) { $('#changePasswordBtn').on('click', function() { - if (passwordvalid && passwordsmatch && currentPassword.val()) { + if (passwordvalid && passwordsmatch && (currentPassword.val() || app.isAdmin)) { socket.emit('user.changePassword', { 'currentPassword': currentPassword.val(), - 'newPassword': password.val() + 'newPassword': password.val(), + 'uid': templates.get('theirid') }, function(err) { currentPassword.val(''); @@ -203,12 +204,10 @@ define(['forum/accountheader', 'uploader'], function(header, uploader) { passwordvalid = false; if (err) { - app.alertError(err.message); - return; + return app.alertError(err.message); } app.alertSuccess('Your password is updated!'); - }); } return false; diff --git a/public/src/forum/admin/categories.js b/public/src/forum/admin/categories.js index e9840d8968..7b4f761c52 100644 --- a/public/src/forum/admin/categories.js +++ b/public/src/forum/admin/categories.js @@ -83,7 +83,7 @@ define(['uploader'], function(uploader) { var category = { name: $('#inputName').val(), description: $('#inputDescription').val(), - icon: $('#new-category-modal i').val(), + icon: $('#new-category-modal i').attr('value'), bgColor: '#0059b2', color: '#fff', order: $('.admin-categories #entry-container').children().length + 1 @@ -105,10 +105,26 @@ define(['uploader'], function(uploader) { var html = templates.prepare(templates['admin/categories'].blocks['categories']).parse({ categories: [data] }); + html = $(html); + html.find('[data-name="bgColor"], [data-name="color"]').each(enableColorPicker); $('#entry-container').append(html); $('#new-category-modal').modal('hide'); + }); + } + + function enableColorPicker(idx, inputEl) { + var jinputEl = $(inputEl), + previewEl = jinputEl.parents('[data-cid]').find('.preview-box'); + jinputEl.ColorPicker({ + color: jinputEl.val() || '#000', + onChange: function(hsb, hex) { + jinputEl.val('#' + hex); + if (inputEl.getAttribute('data-name') === 'bgColor') previewEl.css('background', '#' + hex); + else if (inputEl.getAttribute('data-name') === 'color') previewEl.css('color', '#' + hex); + modified(inputEl); + } }); } @@ -141,21 +157,12 @@ define(['uploader'], function(uploader) { modified(ev.target); }); - $('.dropdown li[data-disabled]').each(function(index, element) { - var disabled = $(element).attr('data-disabled'); - if (disabled == "0" || disabled == "") { - $(element).html(' Disable'); - } else { - $(element).html(' Enable'); - } - }); - $('.dropdown').on('click', '[data-disabled]', function(ev) { var btn = $(this); var categoryRow = btn.parents('li'); var cid = categoryRow.attr('data-cid'); - var disabled = this.getAttribute('data-disabled') === '0' ? '1' : '0'; + var disabled = this.getAttribute('data-disabled') === 'false' ? '1' : '0'; categoryRow.remove(); modified_categories[cid] = modified_categories[cid] || {}; modified_categories[cid]['disabled'] = disabled; @@ -165,20 +172,7 @@ define(['uploader'], function(uploader) { }); // Colour Picker - $('[data-name="bgColor"], [data-name="color"]').each(function(idx, inputEl) { - var jinputEl = $(this), - previewEl = jinputEl.parents('[data-cid]').find('.preview-box'); - - jinputEl.ColorPicker({ - color: this.value || '#000', - onChange: function(hsb, hex) { - jinputEl.val('#' + hex); - if (inputEl.getAttribute('data-name') === 'bgColor') previewEl.css('background', '#' + hex); - else if (inputEl.getAttribute('data-name') === 'color') previewEl.css('color', '#' + hex); - modified(inputEl); - } - }); - }); + $('[data-name="bgColor"], [data-name="color"]').each(enableColorPicker); $('.admin-categories').on('click', '.save', save); diff --git a/public/src/forum/admin/groups.js b/public/src/forum/admin/groups.js index 7d21ee8742..ad530c12a9 100644 --- a/public/src/forum/admin/groups.js +++ b/public/src/forum/admin/groups.js @@ -58,15 +58,14 @@ define(function() { listEl.on('click', 'button[data-action]', function() { var action = this.getAttribute('data-action'), - parent = $(this).parents('li[data-gid]'), - gid = parent.attr('data-gid'), - system = parseInt(parent.attr('data-system'), 10) === 1; + gid = $(this).parents('li[data-gid]').attr('data-gid'); switch (action) { case 'delete': bootbox.confirm('Are you sure you wish to delete this group?', function(confirm) { if (confirm) { socket.emit('admin.groups.delete', gid, function(err, data) { + console.log(err, data); if(err) { return app.alertError(err.message); } @@ -107,8 +106,6 @@ define(function() { detailsModal.attr('data-gid', groupObj.gid); detailsModal.modal('show'); - - $('.hide-if-system')[system ? 'hide' : 'show'](); }); break; } diff --git a/public/src/forum/admin/index.js b/public/src/forum/admin/index.js index c99dd43cb9..914676115d 100644 --- a/public/src/forum/admin/index.js +++ b/public/src/forum/admin/index.js @@ -14,7 +14,23 @@ define(function() { }, function() { window.location.href = RELATIVE_PATH + '/'; }); - }) + }); + + $.get('https://api.github.com/repos/designcreateplay/NodeBB/tags', function(releases) { + var version = $('#version').html(), + latestVersion = releases[0].name.slice(1), + checkEl = $('.version-check'); + checkEl.html($('.version-check').html().replace('', 'v' + latestVersion)); + + // Alter box colour accordingly + if (latestVersion === version) { + checkEl.removeClass('alert-info').addClass('alert-success'); + checkEl.append('

You are up-to-date

'); + } else if (latestVersion > version) { + checkEl.removeClass('alert-info').addClass('alert-danger'); + checkEl.append('

A new version (v' + latestVersion + ') has been released. Consider upgrading your NodeBB.

'); + } + }); }; Admin.updateRoomUsage = function(err, data) { diff --git a/public/src/forum/popular.js b/public/src/forum/popular.js index f85e38ccb2..c4817bbd71 100644 --- a/public/src/forum/popular.js +++ b/public/src/forum/popular.js @@ -21,6 +21,10 @@ define(['forum/recent'], function(recent) { }); function loadMoreTopics() { + if(!$('#topics-container').length) { + return; + } + loadingMoreTopics = true; socket.emit('topics.loadMoreFromSet', { set: 'topics:' + $('.nav-pills .active a').html().toLowerCase(), diff --git a/public/src/forum/recent.js b/public/src/forum/recent.js index 15e1d63ceb..8837c41367 100644 --- a/public/src/forum/recent.js +++ b/public/src/forum/recent.js @@ -92,6 +92,10 @@ define(function() { } Recent.loadMoreTopics = function() { + if(!$('#topics-container').length) { + return; + } + loadingMoreTopics = true; socket.emit('topics.loadMoreRecentTopics', { after: $('#topics-container').attr('data-nextstart'), diff --git a/public/src/forum/topic.js b/public/src/forum/topic.js index cc2474c72e..dbb1aa3431 100644 --- a/public/src/forum/topic.js +++ b/public/src/forum/topic.js @@ -290,8 +290,8 @@ define(['composer', 'forum/pagination'], function(composer, pagination) { app.alert({ alert_id: 'topic_follow', timeout: 2500, - title: 'Following Topic', - message: 'You will now be receiving notifications when somebody posts to this topic.', + title: '[[topic:following_topic.title]]', + message: '[[topic:following_topic.message]]', type: 'success' }); } @@ -302,8 +302,8 @@ define(['composer', 'forum/pagination'], function(composer, pagination) { app.alert({ alert_id: 'topic_follow', timeout: 2500, - title: 'Not Following Topic', - message: 'You will no longer receive notifications from this topic.', + title: '[[topic:not_following_topic.title]]', + message: '[[topic:not_following_topic.message]]', type: 'success' }); } @@ -320,8 +320,8 @@ define(['composer', 'forum/pagination'], function(composer, pagination) { return app.alert({ type: 'danger', alert_id: 'topic_follow', - title: 'Please Log In', - message: 'Please register or log in in order to subscribe to this topic', + title: '[[global:please_log_in]]', + message: '[[topic:login_to_subscribe]]', timeout: 5000 }); } @@ -754,7 +754,6 @@ define(['composer', 'forum/pagination'], function(composer, pagination) { } socket.emit('topics.markAsRead', {tid: tid, uid: app.uid}); - createNewPosts(data); }); @@ -1138,21 +1137,19 @@ define(['composer', 'forum/pagination'], function(composer, pagination) { var elTop = el.offset().top; var height = Math.floor(el.height()); var elBottom = elTop + height; - - return ((elBottom >= scrollTop) && - (elTop <= scrollBottom) && - (elBottom <= scrollBottom) && - (elTop >= scrollTop)); + return !(elTop > scrollBottom || elBottom < scrollTop); } Topic.scrollToPost = function(pid, duration, offset) { if (!pid) { return; } + if(!offset) { offset = 0; } + if($('#post_anchor_' + pid).length) { return scrollToPid(pid); } @@ -1198,7 +1195,11 @@ define(['composer', 'forum/pagination'], function(composer, pagination) { } if (tid && scrollTo.length) { - animateScroll(); + if($('#post-container li.post-row[data-pid="' + pid + '"]').attr('data-index') !== '0') { + animateScroll(); + } else { + updateHeader(); + } } } } diff --git a/public/src/forum/unread.js b/public/src/forum/unread.js index 4f3024fbab..3ed2baf5cc 100644 --- a/public/src/forum/unread.js +++ b/public/src/forum/unread.js @@ -44,6 +44,9 @@ define(['forum/recent'], function(recent) { }); function loadMoreTopics() { + if(!$('#topics-container').length) { + return; + } loadingMoreTopics = true; socket.emit('topics.loadMoreUnreadTopics', { after: $('#topics-container').attr('data-nextstart') diff --git a/public/src/modules/composer.js b/public/src/modules/composer.js index 7d5c98548e..1ae70fee16 100644 --- a/public/src/modules/composer.js +++ b/public/src/modules/composer.js @@ -15,8 +15,8 @@ define(['taskbar'], function(taskbar) { type: 'danger', timeout: 5000, alert_id: 'post_error', - title: 'Please Log In to Post', - message: 'Posting is currently restricted to registered members only, click here to log in', + title: '[[global:please_log_in]]', + message: '[[global:posting_restriction_info]]', clickfn: function() { ajaxify.go('login'); } @@ -192,8 +192,7 @@ define(['taskbar'], function(taskbar) { clearForm: true, formData: formData, error: function(xhr) { - app.alertError('Error uploading file! ' + xhr.status); - composer.posts[post_uuid].uploadsInProgress.pop(); + app.alertError('Error uploading file!\nStatus : ' + xhr.status + '\nMessage : ' + xhr.responseText); if (typeof callback == 'function') callback(xhr); }, @@ -214,10 +213,14 @@ define(['taskbar'], function(taskbar) { } } - composer.posts[post_uuid].uploadsInProgress.pop(); textarea.focus(); if (typeof callback == 'function') callback(null, uploads); + }, + + complete: function(xhr, status) { + uploadForm[0].reset(); + composer.posts[post_uuid].uploadsInProgress.pop(); } }); @@ -252,18 +255,17 @@ define(['taskbar'], function(taskbar) { $(this).ajaxSubmit({ formData: formData, error: function(xhr) { - app.alertError('Error uploading file! ' + xhr.status); - composer.posts[post_uuid].uploadsInProgress.pop(); + app.alertError('Error uploading file!\nStatus : ' + xhr.status + '\nMessage : ' + xhr.responseText); if (typeof callback == 'function') callback(xhr); }, success: function(uploads) { - composer.posts[post_uuid].uploadsInProgress.pop(); postContainer.find('#topic-thumb-url').val((uploads[0] || {}).url || '').trigger('change'); if (typeof callback == 'function') callback(null, uploads); }, - complete: function(){ + complete: function() { + composer.posts[post_uuid].uploadsInProgress.pop(); spinner.addClass('hide'); } }); @@ -477,7 +479,12 @@ define(['taskbar'], function(taskbar) { case 'fa fa-bold': if (selectionStart === selectionEnd) { // Nothing selected + var cursorPos = postContentEl[0].selectionStart; insertIntoInput(postContentEl, "**bolded text**"); + + // Highlight "link url" + postContentEl[0].selectionStart = cursorPos + 12; + postContentEl[0].selectionEnd = cursorPos + 20; } else { // Text selected postContentEl.val(postContentEl.val().slice(0, selectionStart) + '**' + postContentEl.val().slice(selectionStart, selectionEnd) + '**' + postContentEl.val().slice(selectionEnd)); @@ -503,7 +510,12 @@ define(['taskbar'], function(taskbar) { case 'fa fa-link': if (selectionStart === selectionEnd) { // Nothing selected + var cursorPos = postContentEl[0].selectionStart; insertIntoInput(postContentEl, "[link text](link url)"); + + // Highlight "link url" + postContentEl[0].selectionStart = cursorPos + 12; + postContentEl[0].selectionEnd = cursorPos + 20; } else { // Text selected postContentEl.val(postContentEl.val().slice(0, selectionStart) + '[' + postContentEl.val().slice(selectionStart, selectionEnd) + '](link url)' + postContentEl.val().slice(selectionEnd)); @@ -760,6 +772,155 @@ define(['taskbar'], function(taskbar) { taskbar.minimize('composer', post_uuid); }; + function initializeDragAndDrop(post_uuid) { + + if(jQuery.event.props.indexOf('dataTransfer') === -1) { + jQuery.event.props.push('dataTransfer'); + } + + var draggingDocument = false; + + var postContainer = $('#cmp-uuid-' + post_uuid), + fileForm = postContainer.find('#fileForm'); + drop = postContainer.find('.imagedrop'), + tabContent = postContainer.find('.tab-content'), + textarea = postContainer.find('textarea'); + + $(document).off('dragstart').on('dragstart', function(e) { + draggingDocument = true; + }).off('dragend').on('dragend', function(e) { + draggingDocument = false; + }); + + textarea.on('dragenter', function(e) { + if(draggingDocument) { + return; + } + drop.css('top', tabContent.position().top + 'px'); + drop.css('height', textarea.height()); + drop.css('line-height', textarea.height() + 'px'); + drop.show(); + + drop.on('dragleave', function(ev) { + drop.hide(); + drop.off('dragleave'); + }); + }); + + function cancel(e) { + e.preventDefault(); + return false; + } + + drop.on('dragover', cancel); + drop.on('dragenter', cancel); + + drop.on('drop', function(e) { + e.preventDefault(); + var dt = e.dataTransfer, + files = dt.files; + + if(files.length) { + var fd = new FormData(); + for (var i = 0, file; file = dt.files[i]; i++) { + fd.append('files[]', file, file.name); + } + + fileForm[0].reset(); + uploadSubmit(files, post_uuid, '/api/post/upload', fd); + } + + drop.hide(); + return false; + }); + + $(window).off('paste').on('paste', function(event) { + + var items = (event.clipboardData || event.originalEvent.clipboardData).items; + + if(items && items.length) { + + var blob = items[0].getAsFile(); + if(blob) { + blob.name = 'upload-'+ utils.generateUUID(); + + var fd = new FormData(); + fd.append('files[]', blob, blob.name); + + fileForm[0].reset(); + uploadSubmit([blob], post_uuid, '/api/post/upload', fd); + } + } + }); + } + + function uploadSubmit(files, post_uuid, route, formData, callback) { + var postContainer = $('#cmp-uuid-' + post_uuid), + textarea = postContainer.find('textarea'), + text = textarea.val(), + uploadForm = postContainer.find('#fileForm'); + + uploadForm.attr('action', route); + + for(var i=0; i parseInt(config.maximumFileSize, 10) * 1024) { + uploadForm[0].reset(); + return composerAlert('File too big', 'Maximum allowed file size is ' + config.maximumFileSize + 'kbs'); + } + } + + textarea.val(text); + + uploadForm.off('submit').submit(function() { + + $(this).find('#postUploadCsrf').val($('#csrf_token').val()); + if(formData) { + formData.append('_csrf', $('#csrf_token').val()); + } + + composer.posts[post_uuid].uploadsInProgress.push(1); + + $(this).ajaxSubmit({ + resetForm: true, + clearForm: true, + formData: formData, + error: function(xhr) { + app.alertError('Error uploading file!\nStatus : ' + xhr.status + '\nMessage : ' + xhr.responseText); + }, + uploadProgress: function(event, position, total, percent) { + var current = textarea.val(); + for(var i=0; i 0) { var image = ''; for (x = 0; x < numUnread; x++) { if (data.unread[x].image) { - image = ''; + image = ''; } else { image = ''; } - notifList.append($('
  • ' + image + '' + utils.relativeTime(data.unread[x].datetime, true) + '' + data.unread[x].text + '
  • ')); + html += '
  • ' + image + '' + utils.relativeTime(data.unread[x].datetime, true) + '' + data.unread[x].text + '
  • '; } for (x = 0; x < numRead; x++) { @@ -36,18 +36,27 @@ define(function() { } else { image = ''; } - notifList.append($('
  • ' + image + '' + utils.relativeTime(data.read[x].datetime, true) + '' + data.read[x].text + '
  • ')); + html += '
  • ' + image + '' + utils.relativeTime(data.read[x].datetime, true) + '' + data.read[x].text + '
  • '; } + addSeeAllLink(replaceHtml); } else { translator.translate('
  • [[notifications:no_notifs]]
  • ', function(translated) { - notifList.append($(translated)); + html += translated; + addSeeAllLink(replaceHtml); }); } - translator.translate('', function(translated) { - notifList.append($(translated)); - }); + function addSeeAllLink(callback) { + translator.translate('', function(translated) { + html += translated; + callback(); + }); + } + + function replaceHtml() { + notifList.html(html); + } updateNotifCount(data.unread.length); diff --git a/public/templates/admin/categories.tpl b/public/templates/admin/categories.tpl index c89bbf2806..b25f2f8218 100644 --- a/public/templates/admin/categories.tpl +++ b/public/templates/admin/categories.tpl @@ -100,7 +100,13 @@ diff --git a/public/templates/admin/groups.tpl b/public/templates/admin/groups.tpl index 6c87898da0..39967ad648 100644 --- a/public/templates/admin/groups.tpl +++ b/public/templates/admin/groups.tpl @@ -5,17 +5,17 @@
      -
    • +
    • {groups.name}

      {groups.description}

      +
      - -
      +
        @@ -69,7 +69,7 @@ -
        Drag and Drop Images Here
        +
        [[topic:composer.drag_and_drop_images]]
        - Content is parsed with Markdown. - Upload content images by dragging & dropping them. + [[topic:composer.content_is_parsed_with]] Markdown. + [[topic:composer.upload_instructions]]
        diff --git a/public/templates/header.tpl b/public/templates/header.tpl index 650097c4c8..c84294f8e5 100644 --- a/public/templates/header.tpl +++ b/public/templates/header.tpl @@ -14,6 +14,10 @@ + + + + @@ -31,12 +35,6 @@ } }); - - - - - - @@ -79,7 +77,7 @@
      • - [[global:header.search]] + [[global:header.search]]
      • @@ -111,7 +109,7 @@
    • - [[notifications:title]] + [[notifications:title]]
    - \ No newline at end of file + +
    + +
    \ No newline at end of file diff --git a/public/templates/noscript/topic.tpl b/public/templates/noscript/topic.tpl index 787712400f..f3d5180fe2 100644 --- a/public/templates/noscript/topic.tpl +++ b/public/templates/noscript/topic.tpl @@ -27,4 +27,11 @@ - \ No newline at end of file + +
    + +
    \ No newline at end of file diff --git a/public/templates/topic.tpl b/public/templates/topic.tpl index 76e937b93c..c6eeaeb2df 100644 --- a/public/templates/topic.tpl +++ b/public/templates/topic.tpl @@ -296,4 +296,4 @@ - \ No newline at end of file + diff --git a/src/categories.js b/src/categories.js index 82a190c345..640122598d 100644 --- a/src/categories.js +++ b/src/categories.js @@ -30,6 +30,7 @@ var db = require('./database'), description: data.description, icon: data.icon, bgColor: data.bgColor, + background: data.bgColor, color: data.color, slug: slug, topic_count: 0, @@ -96,7 +97,7 @@ var db = require('./database'), 'category_name': results.category.name, 'category_description': results.category.description, 'link': results.category.link, - 'disabled': results.category.disabled || '0', + 'disabled': results.category.disabled, 'topic_row_size': 'col-md-9', 'category_id': category_id, 'active_users': results.active_users, @@ -167,6 +168,7 @@ var db = require('./database'), if(err) { return callback(err); } + if(cids && cids.length === 0) { return callback(null, {categories : []}); } @@ -214,7 +216,11 @@ var db = require('./database'), }; Categories.markAsUnreadForAll = function(cid, callback) { - db.delete('cid:' + cid + ':read_by_uid', callback); + db.delete('cid:' + cid + ':read_by_uid', function(err) { + if(typeof callback === 'function') { + callback(err); + } + }); }; Categories.hasReadCategories = function(cids, uid, callback) { @@ -297,6 +303,7 @@ var db = require('./database'), if (exists) { db.getObject('category:' + cid, function(err, data) { data.background = data.image ? 'url(' + data.image + ')' : data.bgColor; + data.disabled = data.disabled ? parseInt(data.disabled, 10) !== 0 : false; callback(err, data); }); } else { diff --git a/src/events.js b/src/events.js index e7ac7356e2..825db1c832 100644 --- a/src/events.js +++ b/src/events.js @@ -13,6 +13,17 @@ var fs = require('fs'), logWithUser(uid, 'changed password'); } + events.logAdminChangeUserPassword = function(adminUid, theirUid) { + user.getMultipleUserFields([adminUid, theirUid], ['username'], function(err, userData) { + if(err) { + return winston.error('Error logging event. ' + err.message); + } + + var msg = userData[0].username + '(uid ' + adminUid + ') changed password of ' + userData[1].username + '(uid ' + theirUid + ')'; + events.log(msg); + }); + } + events.logPasswordReset = function(uid) { logWithUser(uid, 'reset password'); } @@ -53,11 +64,10 @@ var fs = require('fs'), user.getUserField(uid, 'username', function(err, username) { if(err) { - winston.error('Error logging event. ' + err.message); - return; + return winston.error('Error logging event. ' + err.message); } - var msg = '[' + new Date().toUTCString() + '] - ' + username + '(uid ' + uid + ') ' + string; + var msg = username + '(uid ' + uid + ') ' + string; events.log(msg); }); } @@ -65,6 +75,8 @@ var fs = require('fs'), events.log = function(msg) { var logFile = path.join(nconf.get('base_dir'), logFileName); + msg = '[' + new Date().toUTCString() + '] - ' + msg; + fs.appendFile(logFile, msg + '\n', function(err) { if(err) { winston.error('Error logging event. ' + err.message); diff --git a/src/groups.js b/src/groups.js index a9148084e6..9b32cc7839 100644 --- a/src/groups.js +++ b/src/groups.js @@ -13,16 +13,14 @@ expand: options.expand }, next); }, function (err, groups) { - groups.forEach(function(group, g, arr) { - if (parseInt(group.deleted, 10) === 1) { - delete arr[g]; - } - if (parseInt(group.hidden, 10) === 1) { - group.deletable = 0; + // Remove deleted and hidden groups from this list + callback(err, groups.filter(function (group) { + if (parseInt(group.deleted, 10) === 1 || parseInt(group.hidden, 10) === 1) { + return false; + } else { + return true; } - }); - - callback(err, groups); + })); }); } else { callback(null, []); @@ -72,7 +70,7 @@ results.base.count = results.users.length; results.base.members = results.users; - results.base.deletable = parseInt(results.base.gid, 10) !== 1; + results.base.deletable = results.base.hidden !== '1'; callback(err, results.base); }); diff --git a/src/notifications.js b/src/notifications.js index 06d20223dd..66eed78704 100644 --- a/src/notifications.js +++ b/src/notifications.js @@ -127,7 +127,7 @@ var async = require('async'), if (nids && nids.length > 0) { async.each(nids, function(nid, next) { Notifications.get(nid, uid, function(nid_info) { - if (nid_info.uniqueId === uniqueId) { + if (nid_info && nid_info.uniqueId === uniqueId) { db.sortedSetRemove('uid:' + uid + ':notifications:unread', nid); } diff --git a/src/postTools.js b/src/postTools.js index 99c869e09c..06ae4ef84e 100644 --- a/src/postTools.js +++ b/src/postTools.js @@ -111,7 +111,7 @@ var winston = require('winston'), ], function(err, results) { websockets.in('topic_' + results[0].tid).emit('event:post_edited', { pid: pid, - title: validator.sanitize(title).escape(), + title: validator.escape(title), isMainPost: results[0].isMainPost, content: results[1] }); diff --git a/src/posts.js b/src/posts.js index 55808165d9..55c5785523 100644 --- a/src/posts.js +++ b/src/posts.js @@ -289,7 +289,7 @@ var db = require('./database'), postData.categoryName = categoryData.name; postData.categoryIcon = categoryData.icon; postData.categorySlug = categoryData.slug; - postData.title = validator.sanitize(topicData.title).escape(); + postData.title = validator.escape(topicData.title); postData.topicSlug = topicData.slug; next(null, postData); }) diff --git a/src/routes/admin.js b/src/routes/admin.js index c0afc39b4b..af1f534f13 100644 --- a/src/routes/admin.js +++ b/src/routes/admin.js @@ -2,6 +2,7 @@ var nconf = require('nconf'), fs = require('fs'), path = require('path'), winston = require('winston'), + async = require('async'), db = require('./../database'), user = require('./../user'), @@ -316,7 +317,7 @@ var nconf = require('nconf'), app.get('/categories/active', function (req, res) { categories.getAllCategories(0, function (err, data) { data.categories = data.categories.filter(function (category) { - return (!category.disabled || parseInt(category.disabled, 10) === 0); + return !category.disabled; }); res.json(data); }); @@ -325,7 +326,7 @@ var nconf = require('nconf'), app.get('/categories/disabled', function (req, res) { categories.getAllCategories(0, function (err, data) { data.categories = data.categories.filter(function (category) { - return parseInt(category.disabled, 10) === 1; + return category.disabled; }); res.json(data); }); @@ -375,7 +376,10 @@ var nconf = require('nconf'), if(err) { return next(err); } - res.json(200, {eventdata: data.toString()}); + if(data) { + data = data.toString().split('\n').reverse().join('\n'); + } + res.json(200, {eventdata: data}); }); }); @@ -418,9 +422,20 @@ var nconf = require('nconf'), }); app.get('/groups', function (req, res) { - groups.list({ - expand: true - }, function (err, groups) { + async.parallel([ + function(next) { + groups.list({ + expand: true + }, next); + }, + function(next) { + groups.listSystemGroups({ + expand: true + }, next); + } + ], function(err, data) { + var groups = data[0].concat(data[1]); + res.json(200, { groups: groups, yourid: req.user.uid diff --git a/src/routes/api.js b/src/routes/api.js index 6827caa368..f92321227e 100644 --- a/src/routes/api.js +++ b/src/routes/api.js @@ -11,7 +11,7 @@ var path = require('path'), ThreadTools = require('../threadTools'), posts = require('../posts'), categories = require('../categories'), - categoryTools = require('../categoryTools') + categoryTools = require('../categoryTools'), meta = require('../meta'), Plugins = require('../plugins'), utils = require('../../public/src/utils'), @@ -88,7 +88,7 @@ var path = require('path'), categories.getAllCategories(uid, function (err, data) { data.categories = data.categories.filter(function (category) { - return (!category.disabled || parseInt(category.disabled, 10) === 0); + return !category.disabled; }); function canSee(category, next) { @@ -267,8 +267,8 @@ var path = require('path'), return next(err); } - var start = (page - 1) * settings.topicsPerPage; - var end = start + settings.topicsPerPage - 1; + var start = (page - 1) * settings.topicsPerPage, + end = start + settings.topicsPerPage - 1; categoryTools.privileges(req.params.id, uid, function(err, privileges) { if (!err && privileges.read) { @@ -280,7 +280,7 @@ var path = require('path'), data.currentPage = page; data.privileges = privileges; - if (data && parseInt(data.disabled, 10) === 0) { + if (data && !data.disabled) { res.json(data); } else { next(); @@ -473,7 +473,7 @@ var path = require('path'), async.map(files, filesIterator, function(err, images) { deleteTempFiles(); if(err) { - return res.json(500, {message: err.message}); + return res.json(500, err.message); } res.json(200, images); }); @@ -496,7 +496,7 @@ var path = require('path'), } else { res.json(500, {message: 'Invalid File'}); } - }, next) + }, next); }); app.get('/reset', function (req, res) { diff --git a/src/routes/plugins.js b/src/routes/plugins.js index 2af868700c..96638a86dd 100644 --- a/src/routes/plugins.js +++ b/src/routes/plugins.js @@ -13,7 +13,7 @@ var nconf = require('nconf'), if (typeof returnData === 'object') { res.json(200, returnData); } else { - res.send(200, validator.sanitize(returnData).escape()); + res.send(200, validator.escape(returnData)); } }); }); diff --git a/src/routes/user.js b/src/routes/user.js index ae34d29472..be3b474374 100644 --- a/src/routes/user.js +++ b/src/routes/user.js @@ -24,6 +24,11 @@ var fs = require('fs'), function createRoute(routeName) { app.get(routeName, function (req, res) { + + if(!req.user && !!parseInt(meta.config.privateUserInfo, 10)) { + return res.redirect('/403'); + } + app.build_header({ req: req, res: res @@ -46,7 +51,7 @@ var fs = require('fs'), return next(); } - if (!req.user && path === '/favourites') { + if (!req.user && (path === '/favourites' || !!parseInt(meta.config.privateUserInfo, 10))) { return res.redirect('/403'); } @@ -118,8 +123,9 @@ var fs = require('fs'), app.get('/:userslug/settings', function (req, res) { - if (!req.user) + if (!req.user) { return res.redirect('/403'); + } user.getUserField(req.user.uid, 'userslug', function (err, userslug) { if (req.params.userslug && userslug === req.params.userslug) { @@ -244,7 +250,14 @@ var fs = require('fs'), }); }); - app.get('/api/user/:userslug/following', function (req, res, next) { + function isAllowed(req, res, next) { + if(!req.user && !!parseInt(meta.config.privateUserInfo, 10)) { + return res.json(403, 'not-allowed'); + } + next(); + } + + app.get('/api/user/:userslug/following', isAllowed, function (req, res, next) { var callerUID = req.user ? req.user.uid : '0'; getUserDataByUserSlug(req.params.userslug, callerUID, function (err, userData) { @@ -270,7 +283,7 @@ var fs = require('fs'), }); }); - app.get('/api/user/:userslug/followers', function (req, res, next) { + app.get('/api/user/:userslug/followers', isAllowed, function (req, res, next) { var callerUID = req.user ? req.user.uid : '0'; getUserDataByUserSlug(req.params.userslug, callerUID, function (err, userData) { @@ -357,7 +370,7 @@ var fs = require('fs'), }); }); - app.get('/api/user/:userslug/favourites', function (req, res, next) { + app.get('/api/user/:userslug/favourites', isAllowed, function (req, res, next) { var callerUID = req.user ? req.user.uid : '0'; user.getUidByUserslug(req.params.userslug, function (err, uid) { @@ -400,7 +413,7 @@ var fs = require('fs'), }); }); - app.get('/api/user/:userslug/posts', function (req, res, next) { + app.get('/api/user/:userslug/posts', isAllowed, function (req, res, next) { var callerUID = req.user ? req.user.uid : '0'; user.getUidByUserslug(req.params.userslug, function (err, uid) { @@ -438,7 +451,7 @@ var fs = require('fs'), }); - app.get('/api/user/uid/:uid', function(req, res, next) { + app.get('/api/user/uid/:uid', isAllowed, function(req, res, next) { var uid = req.params.uid ? req.params.uid : 0; user.getUserData(uid, function(err, userData) { @@ -446,7 +459,7 @@ var fs = require('fs'), }); }); - app.get('/api/user/:userslug', function (req, res, next) { + app.get('/api/user/:userslug', isAllowed, function (req, res, next) { var callerUID = req.user ? req.user.uid : '0'; getUserDataByUserSlug(req.params.userslug, callerUID, function (err, userData) { @@ -492,12 +505,12 @@ var fs = require('fs'), }); }); - app.get('/api/users', getOnlineUsers); - app.get('/api/users/sort-posts', getUsersSortedByPosts); - app.get('/api/users/sort-reputation', getUsersSortedByReputation); - app.get('/api/users/latest', getUsersSortedByJoinDate); - app.get('/api/users/online', getOnlineUsers); - app.get('/api/users/search', getUsersForSearch); + app.get('/api/users', isAllowed, getOnlineUsers); + app.get('/api/users/sort-posts', isAllowed, getUsersSortedByPosts); + app.get('/api/users/sort-reputation', isAllowed, getUsersSortedByReputation); + app.get('/api/users/latest', isAllowed, getUsersSortedByJoinDate); + app.get('/api/users/online', isAllowed, getOnlineUsers); + app.get('/api/users/search', isAllowed, getUsersForSearch); function getUsersSortedByJoinDate(req, res) { diff --git a/src/topics.js b/src/topics.js index 7c289e452f..d13681b3d5 100644 --- a/src/topics.js +++ b/src/topics.js @@ -139,6 +139,7 @@ var async = require('async'), Topics.reply = function(tid, uid, content, callback) { var privileges; + var postData; async.waterfall([ function(next) { @@ -165,30 +166,29 @@ var async = require('async'), posts.create(uid, tid, content, next); }, - function(postData, next) { - + function(data, next) { + postData = data; threadTools.notifyFollowers(tid, postData.pid, uid); user.sendPostNotificationToFollowers(uid, tid, postData.pid); - next(null, postData); + next(); }, - function(postData, next) { - Topics.markAsUnreadForAll(tid, function(err) { - if(err) { - return next(err); - } - - Topics.markAsRead(tid, uid, function(err) { - Topics.pushUnreadCount(null); - next(err, postData); - }); - }); + function(next) { + Topics.markAsUnreadForAll(tid, next); }, - function(postData, next) { + function(next) { + Topics.markAsRead(tid, uid, next); + }, + function(next) { + Topics.pushUnreadCount(); posts.addUserInfoToPost(postData, next); }, - function(postData, next) { + function(postData,next) { + posts.getPidIndex(postData.pid, next); + }, + function(index, next) { + postData.index = index; postData.favourited = false; postData.votes = 0; postData.display_moderator_tools = true; @@ -293,7 +293,7 @@ var async = require('async'), } if(data) { - data.title = validator.sanitize(data.title).escape(); + data.title = validator.escape(data.title); data.relativeTime = utils.toISOString(data.timestamp); } diff --git a/src/user.js b/src/user.js index 13d3669f2c..56d60f3c83 100644 --- a/src/user.js +++ b/src/user.js @@ -4,7 +4,6 @@ var bcrypt = require('bcryptjs'), winston = require('winston'), gravatar = require('gravatar'), check = require('validator').check, - sanitize = require('validator').sanitize, S = require('string'), utils = require('./../public/src/utils'), @@ -335,7 +334,7 @@ var bcrypt = require('bcryptjs'), } data[field] = data[field].trim(); - data[field] = sanitize(data[field]).escape(); + data[field] = validator.escape(data[field]); if (field === 'email') { User.getUserFields(uid, ['email', 'picture', 'uploadedpicture'], function(err, userData) { @@ -424,27 +423,59 @@ var bcrypt = require('bcryptjs'), }; User.changePassword = function(uid, data, callback) { + if(!data || !data.uid) { + return callback(new Error('invalid-uid')); + } + + function hashAndSetPassword(callback) { + User.hashPassword(data.newPassword, function(err, hash) { + if(err) { + return callback(err); + } + + User.setUserField(data.uid, 'password', hash, function(err) { + if(err) { + return callback(err); + } + + if(parseInt(uid, 10) === parseInt(data.uid, 10)) { + events.logPasswordChange(data.uid); + } else { + events.logAdminChangeUserPassword(uid, data.uid); + } + + callback(); + }); + }); + } + if (!utils.isPasswordValid(data.newPassword)) { return callback(new Error('Invalid password!')); } - User.getUserField(uid, 'password', function(err, currentPassword) { - bcrypt.compare(data.currentPassword, currentPassword, function(err, res) { - if (err) { - return callback(err); + if(parseInt(uid, 10) !== parseInt(data.uid, 10)) { + User.isAdministrator(uid, function(err, isAdmin) { + if(err || !isAdmin) { + return callback(err || new Error('not-allowed')); } - if (res) { - User.hashPassword(data.newPassword, function(err, hash) { - User.setUserField(uid, 'password', hash); - events.logPasswordChange(uid); - callback(null); - }); - } else { - callback(new Error('Your current password is not correct!')); + hashAndSetPassword(callback); + }); + } else { + User.getUserField(uid, 'password', function(err, currentPassword) { + if(err) { + return callback(err); } + + bcrypt.compare(data.currentPassword, currentPassword, function(err, res) { + if (err || !res) { + return callback(err || new Error('Your current password is not correct!')); + } + + hashAndSetPassword(callback); + }); }); - }); + } }; User.setUserField = function(uid, field, value, callback) { diff --git a/src/webserver.js b/src/webserver.js index 0a7508bfef..92f21cb82d 100644 --- a/src/webserver.js +++ b/src/webserver.js @@ -88,10 +88,10 @@ module.exports.server = server; property: 'keywords', content: meta.config.keywords || '' }], - defaultLinkTags = [/*{ + defaultLinkTags = [{ rel: 'apple-touch-icon', - href: meta.config['brand:logo'] || nconf.get('relative_path') + '/logo.png' - }*/], + href: '/apple-touch-icon' + }], templateValues = { bootswatchCSS: meta.config['theme:src'], pluginCSS: plugins.cssFiles.map(function(file) { return { path: nconf.get('relative_path') + file.replace(/\\/g, '/') }; }), @@ -132,16 +132,6 @@ module.exports.server = server; href: nconf.get('relative_path') + '/favicon.ico' }); - // Browser Title - var metaTitle = templateValues.metaTags.filter(function(tag) { - return tag.property === 'og:title'; - }); - if (metaTitle.length > 0 && metaTitle[0].content) { - templateValues.browserTitle = metaTitle[0].content; - } else { - templateValues.browserTitle = meta.config.browserTitle || 'NodeBB'; - } - if(options.req.user && options.req.user.uid) { uid = options.req.user.uid; } @@ -153,15 +143,34 @@ module.exports.server = server; templateValues.customCSS = meta.config.customCSS; } - user.isAdministrator(uid, function(err, isAdmin) { - templateValues.isAdmin = isAdmin; + async.parallel([ + function(next) { + translator.get('pages:' + path.basename(options.req.url), function(translated) { + var metaTitle = templateValues.metaTags.filter(function(tag) { + return tag.name === 'title'; + }); + if (translated) { + templateValues.browserTitle = translated; + } else if (metaTitle.length > 0 && metaTitle[0].content) { + templateValues.browserTitle = metaTitle[0].content; + } else { + templateValues.browserTitle = meta.config.browserTitle || 'NodeBB'; + } + next(); + }); + }, + function(next) { + user.isAdministrator(uid, function(err, isAdmin) { + templateValues.isAdmin = isAdmin || false; + next(); + }); + } + ], function() { translator.translate(templates.header.parse(templateValues), function(template) { callback(null, template); }); }); - - }); }; @@ -194,7 +203,13 @@ module.exports.server = server; logger.init(app); + // favicon & apple-touch-icon middleware app.use(express.favicon(path.join(__dirname, '../', 'public', meta.config['brand:favicon'] ? meta.config['brand:favicon'] : 'favicon.ico'))); + app.use('/apple-touch-icon', function(req, res) { + return res.sendfile(path.join(__dirname, '../public', meta.config['brand:logo'] || nconf.get('relative_path') + '/logo.png'), { + maxAge: app.enabled('cache') ? 5184000000 : 0 + }); + }); app.use(require('less-middleware')({ src: path.join(__dirname, '../', 'public'), @@ -215,7 +230,7 @@ module.exports.server = server; app.use(express.csrf()); - if (nconf.get('port') != 80 && nconf.get('port') != 443 && nconf.get('use_port') === true) { + if (nconf.get('port') != 80 && nconf.get('port') != 443 && nconf.get('use_port') === false) { winston.info('Enabling \'trust proxy\''); app.enable('trust proxy'); } @@ -504,7 +519,7 @@ module.exports.server = server; categories.getAllCategories(0, function (err, returnData) { returnData.categories = returnData.categories.filter(function (category) { - return parseInt(category.disabled, 10) !== 1; + return !category.disabled; }); async.filter(returnData.categories, canSee, function(visibleCategories) { @@ -524,7 +539,9 @@ module.exports.server = server; }); app.get('/topic/:topic_id/:slug?', function (req, res, next) { - var tid = req.params.topic_id; + var tid = req.params.topic_id, + page = req.query.page || 1, + uid = req.user ? req.user.uid : 0; async.waterfall([ function(next) { @@ -541,20 +558,28 @@ module.exports.server = server; }); }, function (next) { - topics.getTopicWithPosts(tid, ((req.user) ? req.user.uid : 0), 0, -1, true, function (err, topicData) { - if (topicData) { - if (parseInt(topicData.deleted, 10) === 1 && parseInt(topicData.expose_tools, 10) === 0) { - return next(new Error('Topic deleted'), null); - } + user.getSettings(uid, function(err, settings) { + if (err) { + return next(err); } - next(err, topicData); + var start = (page - 1) * settings.topicsPerPage, + end = start + settings.topicsPerPage - 1; + + topics.getTopicWithPosts(tid, uid, start, end, true, function (err, topicData) { + if (topicData) { + if (parseInt(topicData.deleted, 10) === 1 && parseInt(topicData.expose_tools, 10) === 0) { + return next(new Error('Topic deleted'), null); + } + } + + next(err, topicData); + }); }); }, function (topicData, next) { var lastMod = topicData.timestamp, - sanitize = validator.sanitize, description = (function() { var content = ''; if(topicData.posts.length) { @@ -565,7 +590,7 @@ module.exports.server = server; content = content.substr(0, 255) + '...'; } - return sanitize(content).escape(); + return validator.escape(content); })(), timestamp; @@ -644,7 +669,7 @@ module.exports.server = server; }, function (err, header) { next(err, { header: header, - topics: topicData + posts: topicData }); }); } @@ -663,20 +688,33 @@ module.exports.server = server; topic_url += '?' + queryString; } - res.send( - data.header + - '\n\t' + - '\n\t' + app.create_route('topic/' + topic_url) + templates.footer - ); + // Paginator for noscript + data.posts.pages = []; + for(var x=1;x<=data.posts.pageCount;x++) { + data.posts.pages.push({ + page: x, + active: x === parseInt(page, 10) + }); + } + + translator.translate(templates['noscript/topic'].parse(data.posts), function(translatedHTML) { + res.send( + data.header + + '\n\t' + + '\n\t' + app.create_route('topic/' + topic_url) + templates.footer + ); + }); }); }); app.get('/category/:category_id/:slug?', function (req, res, next) { - var cid = req.params.category_id; + var cid = req.params.category_id, + page = req.query.page || 1, + uid = req.user ? req.user.uid : 0; async.waterfall([ function(next) { - CategoryTools.privileges(cid, ((req.user) ? req.user.uid || 0 : 0), function(err, privileges) { + CategoryTools.privileges(cid, uid, function(err, privileges) { if (!err) { if (!privileges.read) { next(new Error('not-enough-privileges')); @@ -689,15 +727,24 @@ module.exports.server = server; }); }, function (next) { - categories.getCategoryById(cid, 0, -1, 0, function (err, categoryData) { + user.getSettings(uid, function(err, settings) { + if (err) { + return next(err); + } + + var start = (page - 1) * settings.topicsPerPage, + end = start + settings.topicsPerPage - 1; - if (categoryData) { - if (parseInt(categoryData.disabled, 10) === 1) { - return next(new Error('Category disabled'), null); + categories.getCategoryById(cid, start, end, 0, function (err, categoryData) { + + if (categoryData) { + if (parseInt(categoryData.disabled, 10) === 1) { + return next(new Error('Category disabled'), null); + } } - } - next(err, categoryData); + next(err, categoryData); + }); }); }, function (categoryData, next) { @@ -736,7 +783,7 @@ module.exports.server = server; }, function (err, header) { next(err, { header: header, - categories: categoryData + topics: categoryData }); }); } @@ -749,8 +796,8 @@ module.exports.server = server; } } - if(data.categories.link) { - return res.redirect(data.categories.link); + if(data.topics.link) { + return res.redirect(data.topics.link); } var category_url = cid + (req.params.slug ? '/' + req.params.slug : ''); @@ -759,11 +806,22 @@ module.exports.server = server; category_url += '?' + queryString; } - res.send( - data.header + - '\n\t' + - '\n\t' + app.create_route('category/' + category_url) + templates.footer - ); + // Paginator for noscript + data.topics.pages = []; + for(var x=1;x<=data.topics.pageCount;x++) { + data.topics.pages.push({ + page: x, + active: x === parseInt(page, 10) + }); + } + + translator.translate(templates['noscript/category'].parse(data.topics), function(translatedHTML) { + res.send( + data.header + + '\n\t' + + '\n\t' + app.create_route('category/' + category_url) + templates.footer + ); + }); }); });