diff --git a/README.md b/README.md index 7f9acaf4e2..b0f317fc47 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ # NodeBB +![Dependency Management powered by David.](https://david-dm.org/designcreateplay/NodeBB.png) + **NodeBB Forum Software** is powered by Node.js and built on a Redis database. It utilizes web sockets for instant interactions and real-time notifications. NodeBB is compatible down to IE8 and has many modern features out of the box such as social network integration and streaming discussions. * [Get NodeBB](http://www.nodebb.org/ "NodeBB") @@ -11,7 +13,7 @@ * [Get Plugins](http://community.nodebb.org/category/7/nodebb-plugins "NodeBB Plugins") * [Get Themes](http://community.nodebb.org/category/10/nodebb-themes "NodeBB Themes") -## Screenshots +## Screenshots [](http://i.imgur.com/FLOUuIq.png) [](http://i.imgur.com/Ud1LrfI.png) [](http://i.imgur.com/ZC8W39a.png) [](http://i.imgur.com/o90kVPi.png) [](http://i.imgur.com/AaRRrU2.png) [](http://i.imgur.com/LmHtPho.png) [](http://i.imgur.com/paiJPJk.jpg) [](http://i.imgur.com/ZfavPHD.png) diff --git a/app.js b/app.js index 57cb4dcc02..8ad89c8ade 100644 --- a/app.js +++ b/app.js @@ -232,7 +232,7 @@ function reset() { winston.info("Successfully reset theme to Vanilla and disabled all plugins."); } - process.exit(); + process.exit(); }); }); }); diff --git a/package.json b/package.json index 2dd6ff5718..f35c875dc3 100644 --- a/package.json +++ b/package.json @@ -16,13 +16,8 @@ "socket.io": "~0.9.16", "express": "3.2.0", "express-namespace": "~0.1.1", - "emailjs": "0.3.4", - "cookie": "0.0.6", - "passport": "0.1.17", + "passport": "~0.2.0", "passport-local": "0.1.6", - "passport-twitter": "0.1.5", - "passport-google-oauth": "0.1.5", - "passport-facebook": "0.1.5", "less-middleware": "0.1.12", "marked": "0.2.8", "async": "~0.2.8", @@ -30,35 +25,31 @@ "gravatar": "1.0.6", "nconf": "~0.6.7", "sitemap": "~0.7.1", - "request": "~2.25.0", "reds": "~0.2.4", "winston": "~0.7.2", "rss": "~0.2.0", "prompt": "~0.2.11", "uglify-js": "~2.4.0", "validator": "~3.2.1", - "nodebb-plugin-mentions": "~0.4", - "nodebb-plugin-markdown": "~0.3", - "nodebb-widget-essentials": "~0.0", - "nodebb-theme-vanilla": "~0.0.14", - "nodebb-theme-cerulean": "~0.0.13", - "nodebb-theme-lavender": "~0.0.21", "cron": "~1.0.1", "semver": "~2.2.1", "string": "~1.7.0", "xregexp": "~2.0.0", "socket.io-wildcard": "~0.1.1", - "bcryptjs": "~0.7.10" + "bcryptjs": "~0.7.10", + "nodebb-plugin-mentions": "~0.4", + "nodebb-plugin-markdown": "~0.3", + "nodebb-widget-essentials": "~0.0", + "nodebb-theme-vanilla": "~0.0.14", + "nodebb-theme-cerulean": "~0.0.13", + "nodebb-theme-lavender": "~0.0.21" }, "optionalDependencies": { "redis": "0.8.3", - "mongodb": "~1.3.19", - "connect-redis": "1.4.5", - "connect-mongo": "0.4.0", "hiredis": "~0.1.15", - "nodebb-plugin-sso-facebook": "~0.1.0", - "nodebb-plugin-sso-twitter": "~0.1.0", - "nodebb-plugin-sso-google": "~0.1.0" + "connect-redis": "1.4.5", + "mongodb": "~1.3.19", + "connect-mongo": "0.4.0" }, "devDependencies": { "mocha": "~1.13.0" @@ -69,7 +60,7 @@ "engines": { "node": ">=0.8" }, - "contributors": [ + "maintainers": [ { "name": "Andrew Rodrigues", "email": "andrew@designcreateplay.com", @@ -84,22 +75,6 @@ "name": "Barış Soner Uşaklı", "email": "baris@designcreateplay.com", "url": "https://github.com/barisusakli" - }, - { - "name": "Andrew Darqui", - "url": "https://github.com/adarqui" - }, - { - "name": "Damian Bushong", - "url": "https://github.com/damianb" - }, - { - "name": "Matt Smith", - "url": "https://github.com/soimafreak" - }, - { - "name": "Quinton Marchi", - "url": "https://github.com/iamcardinal" } ] } diff --git a/public/language/en_GB/topic.json b/public/language/en_GB/topic.json index f51b3f4d33..e03bada393 100644 --- a/public/language/en_GB/topic.json +++ b/public/language/en_GB/topic.json @@ -13,6 +13,7 @@ "reply": "Reply", "edit": "Edit", "delete": "Delete", + "restore": "Restore", "move": "Move", "fork": "Fork", "banned": "banned", diff --git a/public/language/es/category.json b/public/language/es/category.json index 4829fb6f60..d75bf5e916 100644 --- a/public/language/es/category.json +++ b/public/language/es/category.json @@ -9,6 +9,6 @@ "posted": "posted", "browsing": "viendo ahora", "no_replies": "Nadie ha respondido aún", - "replied": "respondio", + "replied": "respondió", "last_edited_by": "ultima edición por" } \ No newline at end of file diff --git a/public/language/es/footer.json b/public/language/es/footer.json index 10d3638430..48f2274776 100644 --- a/public/language/es/footer.json +++ b/public/language/es/footer.json @@ -2,6 +2,6 @@ "stats.online": "Online", "stats.users": "Gente", "stats.topics": "Temas", - "stats.posts": "Posts", - "success": "exito!" + "stats.posts": "Publicaciones", + "success": "éxito!" } \ No newline at end of file diff --git a/public/language/es/global.json b/public/language/es/global.json index c8c4addfd6..8fa7474ad2 100644 --- a/public/language/es/global.json +++ b/public/language/es/global.json @@ -4,23 +4,23 @@ "buttons.close": "Cerrar", "403.title": "Acceso denegado", "403.message": "Al parecer no tienes premisos necesarios para estar en este lugar. Tal vez puedes intentar conectarte?", - "404.title": "Ups... 404, no se encontra che!", + "404.title": "Ups... 404, no se encontró lo que buscabas!", "404.message": "Al parecer lo que estas buscando no existe. Te recomendamos que vuelvas al inicio.", "500.title": "Error Interno.", "500.message": "Ooops! Algo salio mal!, No te alarmes. Nuestros simios hiperinteligentes lo solucionarán", "register": "Registrarse", "login": "Conectarse", - "welcome_back": "Bienvenido de nuevo !", + "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", + "logout.message": "Has sido desconectado correctamente", "save_changes": "Guardar Cambios", "close": "Cerrar", "pagination": "Paginación", - "header.admin": "Admin", + "header.admin": "Administración", "header.recent": "Recientes", - "header.unread": "No Leeidos", + "header.unread": "No Leídos", "header.popular": "Popular", "header.users": "Miembros", "header.chats": "Chats", @@ -29,28 +29,28 @@ "header.profile": "Perfil", "notifications.loading": "Cargando Notificaciones", "chats.loading": "Cargando Chats", - "motd.welcome": "Bienvenido a NodeBB, la plataforma de debate sobre el futuro.", + "motd.welcome": "Bienvenido a NodeBB, la plataforma de debate del el futuro.", "motd.get": "Obtener NodeBB", - "motd.fork": "Fork", + "motd.fork": "Bifurcación", "motd.like": "Me gusta", "motd.follow": "Seguir", - "previouspage": "Pagina Anterior", - "nextpage": "Siguente Pagina", - "alert.success": "Exito!", + "previouspage": "Página Anterior", + "nextpage": "Siguente Página", + "alert.success": "Éxito!", "alert.error": "Error", - "alert.banned": "Banneado", - "alert.banned.message": "Estas banneado, seras desconectado!", - "alert.unfollow": "Ya no estas siguiendo a %1!", - "alert.follow": "Estas siguiendo a %1!", - "posts": "Posts", + "alert.banned": "Baneado", + "alert.banned.message": "Estás baneado, serás desconectado!", + "alert.unfollow": "Ya no estás siguiendo a %1!", + "alert.follow": "Estás siguiendo a %1!", + "posts": "Publicaciones", "views": "Visitas", "posted": "publicado", "in": "en", - "recentposts": "Posteos Recientes", + "recentposts": "Publicaciones Recientes", "online": "Conectado", "away": "No disponible", "dnd": "No molestar", "invisible": "Invisible", "offline": "Desconectado", "privacy": "Privacidad" -} \ No newline at end of file +} diff --git a/public/language/es/login.json b/public/language/es/login.json index 9093fb3c8a..2a94c0b96c 100644 --- a/public/language/es/login.json +++ b/public/language/es/login.json @@ -5,6 +5,6 @@ "remember_me": "Recordarme?", "forgot_password": "Olvidaste tu contraseña?", "alternative_logins": "Conexiones Alternativas", - "failed_login_attempt": "Error al loguearte, intenta de nuevo.", - "login_successful": "Te has conectado con exito!" + "failed_login_attempt": "Error al iniciar sesión, intenta otra vez.", + "login_successful": "Te has conectado con éxito!" } \ No newline at end of file diff --git a/public/language/es/modules.json b/public/language/es/modules.json index dd945e8ed4..e3f2652032 100644 --- a/public/language/es/modules.json +++ b/public/language/es/modules.json @@ -1,6 +1,6 @@ { "chat.chatting_with": "Chatear con ", - "chat.placeholder": "ingresa tu mensaje aqui, y presiona enter para enviar", + "chat.placeholder": "ingresa tu mensaje aquí, y presiona Intro para enviar", "chat.send": "Enviar", "chat.no_active": "No tiene conversaciones activas." } \ No newline at end of file diff --git a/public/language/es/notifications.json b/public/language/es/notifications.json index 9fb44b2aef..e7b072975d 100644 --- a/public/language/es/notifications.json +++ b/public/language/es/notifications.json @@ -3,7 +3,7 @@ "no_notifs": "No tiene nuevas notificaciones", "see_all": "Ver todas las notificaciones", "back_to_home": "Volver al Inicio", - "outgoing_link": "Link Externo", + "outgoing_link": "Enlace Externo", "outgoing_link_message": "Estas saliendo del sitio", "continue_to": "Continuar", "return_to": "Volver a " diff --git a/public/language/es/pages.json b/public/language/es/pages.json index d60e0a0a9b..6d91d53482 100644 --- a/public/language/es/pages.json +++ b/public/language/es/pages.json @@ -1,13 +1,13 @@ { - "home": "Home", - "unread": "Unread Topics", - "popular": "Popular Topics", - "recent": "Recent Topics", - "users": "Registered Users", - "notifications": "Notifications", - "user.edit": "Editing \"%1\"", - "user.following": "People %1 Follows", - "user.followers": "People who Follow %1", - "user.favourites": "%1's Favourite Posts", - "user.settings": "User Settings" + "home": "Inicio", + "unread": "Temas No Leídos", + "popular": "Temas Populares", + "recent": "Temas Recientes", + "users": "Usuarios Registrado", + "notifications": "Notificaciones", + "user.edit": "Editando \"%1\"", + "user.following": "Gente que sigue %1 ", + "user.followers": "Seguidores de %1", + "user.favourites": "Publicaciones favoritas de %1 ", + "user.settings": "Preferencias del Usuario" } \ No newline at end of file diff --git a/public/language/es/recent.json b/public/language/es/recent.json index 63a9d990f6..99fb134ad2 100644 --- a/public/language/es/recent.json +++ b/public/language/es/recent.json @@ -3,5 +3,5 @@ "day": "Día", "week": "Semana", "month": "Mes", - "no_recent_topics": "No hay posts recientes" + "no_recent_topics": "No hay publicaciones recientes" } \ No newline at end of file diff --git a/public/language/es/register.json b/public/language/es/register.json index 0e276d70c7..542d04310f 100644 --- a/public/language/es/register.json +++ b/public/language/es/register.json @@ -1,10 +1,10 @@ { "register": "Registrase", - "help.email": "Por defecto, tu email será oculto al publico.", - "help.username_restrictions": "El nombre de usuario debe tener entre %1 y %2 caracteres. Los miembros pueden responderte escribiendo @usuario.", - "help.minimum_password_length": "Tu contraseña debe tener al menos %1 caracteres.", - "email_address": "Email", - "email_address_placeholder": "Escribe tu email", + "help.email": "Por defecto, tu cuenta de correo electrónico será oculto al publico.", + "help.username_restrictions": "El nombre de usuario debe tener entre %1 y %2 carácteres. Los miembros pueden responderte escribiendo @usuario.", + "help.minimum_password_length": "Tu contraseña debe tener al menos %1 carácteres.", + "email_address": "Correo electrónico", + "email_address_placeholder": "Escribe tu correo electrónico", "username": "Usuario", "username_placeholder": "Escribe tu usuario", "password": "Contraseña", @@ -12,7 +12,7 @@ "confirm_password": "Confirmar Contraseña", "confirm_password_placeholder": "Confirmar Contraseña", "register_now_button": "Registrarme ahora", - "alternative_registration": "Otros metodos interesantes para registrarse", + "alternative_registration": "Otros métodos interesantes para registrarse", "terms_of_use": "Términos y Condiciones de uso", - "agree_to_terms_of_use": "Acepto los Terminos y condiciones de uso" + "agree_to_terms_of_use": "Acepto los Términos y Condiciones de uso" } \ No newline at end of file diff --git a/public/language/es/reset_password.json b/public/language/es/reset_password.json index 967680359e..99ca4a0f0c 100644 --- a/public/language/es/reset_password.json +++ b/public/language/es/reset_password.json @@ -1,13 +1,13 @@ { - "reset_password": "Resetear Contraseña", + "reset_password": "Reiniciar Contraseña", "update_password": "Actualizar contraseña", "password_changed.title": "Contraseña editada", - "password_changed.message": "

La contraseña fue modificada con exito, por favor conectate de nuevo.", - "wrong_reset_code.title": "Código de Reseteo Incorrecto", - "wrong_reset_code.message": "El código de reseteo ingresado no es correcto. Por favor intentalo de nuevo o pide un nuevo código.", + "password_changed.message": "

La contraseña fue modificada con éxito, por favor inicia sesión de nuevo.", + "wrong_reset_code.title": "Código de reinicio Incorrecto", + "wrong_reset_code.message": "El código de reinicio ingresado no es correcto. Por favor inténtalo de nuevo o pide un nuevo código.", "new_password": "Nueva Contraseña", "repeat_password": "Confirmar Contraseña", - "enter_email": "Por favor ingresa tu email y te enviaremos un email de como resetear tu cuenta.", - "password_reset_sent": "Resteo de contraseña enviado", - "invalid_email": "Email Invalido o no existe!" + "enter_email": "Por favor ingresa tu correo electrónico y te enviaremos un correo con indicaciones para inicializar tu cuenta.", + "password_reset_sent": "Reinicio de contraseña enviado", + "invalid_email": "Correo Electrónico no válido o inexistente!" } \ No newline at end of file diff --git a/public/language/es/topic.json b/public/language/es/topic.json index f631139043..d826369a84 100644 --- a/public/language/es/topic.json +++ b/public/language/es/topic.json @@ -2,62 +2,62 @@ "topic": "Tema", "topics": "Temas", "no_topics_found": "No se encontraron temas!", - "no_posts_found": "No se encontraron posts!", + "no_posts_found": "No se encontraron publicaciones!", "profile": "Perfil", "posted_by": "Publicado por", "chat": "Chat", - "notify_me": "Seras notificado cuando haya nuevas respuestas en este tema", + "notify_me": "Serás notificado cuando haya nuevas respuestas en este tema", "quote": "Citar", "reply": "Responder", "edit": "Editar", "delete": "Borrar", "move": "Mover", - "fork": "Forkear", - "banned": "banneado", + "fork": "Bifurcar", + "banned": "baneado", "link": "Link", "share": "Compartir", "tools": "Herramientas", "flag": "Reportar", - "flag_title": "Reportar este post a los moderadores", + "flag_title": "Reportar esta publicación 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.markAsUnreadForAll": "Marcar como no leído", "thread_tools.pin": "Tema Importante", "thread_tools.unpin": "Quitar Importante", "thread_tools.lock": "Cerrar Tema", "thread_tools.unlock": "Abrir Tema", "thread_tools.move": "Mover Tema", - "thread_tools.fork": "Fork Topic", + "thread_tools.fork": "Bifurcar Tema", "thread_tools.delete": "Borrar Tema", "thread_tools.restore": "Restaurar Tema", - "load_categories": "Cargando Categorias", - "disabled_categories_note": "Las categorías deshabilidas estan en gris", + "load_categories": "Cargando Categorías", + "disabled_categories_note": "Las categorías deshabilitadas estan en gris", "confirm_move": "Mover", - "confirm_fork": "Forkear", + "confirm_fork": "Bifurcar", "favourite": "Favorito", "favourites": "Favoritos", - "favourites.not_logged_in.title": "No estas conectado :(", - "favourites.not_logged_in.message": "Por favor, conectate para agregar a favorito este post.", - "favourites.has_no_favourites": "No tienes favoritos, puedes agregar alguno y volver a verlos aqui!", - "vote.not_logged_in.title": "No estas conectado", - "vote.not_logged_in.message": "Por favor conectate para votar...", - "vote.cant_vote_self.title": "Voto Invalido", - "vote.cant_vote_self.message": "No puedes votar tus propios posts, palurdo!", - "loading_more_posts": "Cargando más posts", + "favourites.not_logged_in.title": "No estás conectado :(", + "favourites.not_logged_in.message": "Por favor, conáctate para agregar a favoritos esta publicación.", + "favourites.has_no_favourites": "No tienes favoritos, puedes agregar alguno y volver a verlos aquí!", + "vote.not_logged_in.title": "No estás conectado", + "vote.not_logged_in.message": "Por favor conéctate para votar...", + "vote.cant_vote_self.title": "Voto Inválido", + "vote.cant_vote_self.message": "No puedes votar tus propias publicaciones!", + "loading_more_posts": "Cargando más publicaciones", "move_topic": "Mover Tema", - "move_post": "Mover post", - "fork_topic": "Forkear Tema", - "topic_will_be_moved_to": "Este tema sera movido a la categoría", - "fork_topic_instruction": "Click en los posts que quieres forkear", - "fork_no_pids": "No seleccionaste posts!", - "fork_success": "Forkeado con exito!", + "move_post": "Mover Publicación", + "fork_topic": "Bifurcar Tema", + "topic_will_be_moved_to": "Este tema será movido a la categoría", + "fork_topic_instruction": "Click en las publicaciones que quieres bifurcar", + "fork_no_pids": "No seleccionaste publicaciones!", + "fork_success": "Bifurcado con exito!", "reputation": "Reputación", - "posts": "Posts", + "posts": "Publicaciones", "composer.title_placeholder": "Ingresa el titulo de tu tema", "composer.write": "Escribe", - "composer.preview": "Preview", + "composer.preview": "Previsualización", "composer.discard": "Descartar", "composer.submit": "Enviar", "composer.replying_to": "Respondiendo a", diff --git a/public/language/es/unread.json b/public/language/es/unread.json index c7fb8c5aa8..b06f14f687 100644 --- a/public/language/es/unread.json +++ b/public/language/es/unread.json @@ -1,6 +1,6 @@ { - "title": "No leeido", + "title": "No leído", "no_unread_topics": "No hay temas nuevos para leer.", - "mark_all_read": "Marcar todo como leeido", + "mark_all_read": "Marcar todo como leído", "load_more": "Cargar más" } \ No newline at end of file diff --git a/public/language/es/user.json b/public/language/es/user.json index 2aaa6da119..c7ef7ae029 100644 --- a/public/language/es/user.json +++ b/public/language/es/user.json @@ -1,18 +1,18 @@ { - "banned": "Banneado", + "banned": "Baneado", "offline": "Desconectado", "username": "Usuario", - "email": "Email", + "email": "Correo Electrónico", "fullname": "Nombre", - "website": "Website", + "website": "Sitio Web", "location": "Ubicación", "age": "Edad", "joined": "Registro", - "lastonline": "Última vez online", + "lastonline": "Última vez conectado", "profile": "Perfil", "profile_views": "Visitas", "reputation": "Reputación", - "posts": "Posts", + "posts": "Publicaciones", "favourites": "Favoritos", "followers": "Seguidores", "following": "Sigue", @@ -26,22 +26,22 @@ "edit": "Editar", "uploaded_picture": "Fotos Cargadas", "upload_new_picture": "Cargar Nueva Foto", - "current_password": "Password actual", + "current_password": "Contraseña 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": "Solo puedes subir, PNG, JPG o Archivos GIF.", - "max": "max.", + "image_spec": "Sólo puedes subir imágenes en formato PNG, JPG o GIF.", + "max": "máx.", "settings": "Opciones", - "show_email": "Mostrar mi Email", - "has_no_follower": "Este miembro no tiene seguidores :(", - "follows_no_one": "Este miembro no sigue a nadie, que pena :(", - "has_no_posts": "Este usuario aun no ha publicado nada.", - "email_hidden": "Email Oculto", + "show_email": "Mostrar mi Correo electrónico", + "has_no_follower": "Este miembro no tiene seguidores.", + "follows_no_one": "Este miembro no sigue a nadie.", + "has_no_posts": "Este usuario aún no ha publicado nada.", + "email_hidden": "Correo electrónico Oculto", "hidden": "oculto", - "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" + "paginate_description": "La paginación de los temas no es por página, ya que tiene scroll infinito.", + "topics_per_page": "Temas por página", + "posts_per_page": "Post por página" } \ No newline at end of file diff --git a/public/language/es/users.json b/public/language/es/users.json index f1c3007347..5e39c9cb55 100644 --- a/public/language/es/users.json +++ b/public/language/es/users.json @@ -1,9 +1,9 @@ { - "latest_users": "Ultimos Miembros", - "top_posters": "Top Posteadores", + "latest_users": "Últimos Miembros", + "top_posters": "Top Publicadores", "most_reputation": "Mayor Reputación", "online": "Conectados", "search": "Buscar", - "enter_username": "Ingresa el nombre de usuario para buscar", + "enter_username": "Ingresa el nombre de usuario que quieres buscar", "load_more": "Cargar más" } \ No newline at end of file diff --git a/public/src/app.js b/public/src/app.js index f7734ab588..9006a23df8 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -290,9 +290,14 @@ var socket, var el = jQuery(this), uid = el.parents('li').attr('data-uid'); - if (uid && users[uid]) { - el.siblings('i').attr('class', 'fa fa-circle status ' + users[uid].status) - } + translator.translate('[[global:' + users[uid].status + ']]', function(translated) { + if (uid && users[uid]) { + el.siblings('i') + .attr('class', 'fa fa-circle status ' + users[uid].status) + .attr('title', translated) + .attr('data-original-title', translated); + } + }); }); }); }; @@ -325,6 +330,13 @@ var socket, }); }; + app.createStatusTooltips = function() { + $('body').tooltip({ + selector:'.fa-circle.status', + placement: 'top' + }); + } + app.makeNumbersHumanReadable = function(elements) { elements.each(function() { $(this).html(utils.makeNumberHumanReadable($(this).attr('title'))); @@ -343,6 +355,8 @@ var socket, app.createUserTooltips(); + app.createStatusTooltips(); + setTimeout(function () { window.scrollTo(0, 1); // rehide address bar on mobile after page load completes. }, 100); diff --git a/public/src/forum/account.js b/public/src/forum/account.js index 145e21bf3e..41f1310b62 100644 --- a/public/src/forum/account.js +++ b/public/src/forum/account.js @@ -89,7 +89,12 @@ define(['forum/accountheader'], function(header) { return; } - onlineStatus.attr('class', 'account-online-status fa fa-circle status ' + data.status); + translator.translate('[[global:' + data.status + ']]', function(translated) { + onlineStatus.attr('class', 'account-online-status fa fa-circle status ' + data.status) + .attr('title', translated) + .attr('data-original-title', translated); + }); + }; return Account; diff --git a/public/src/forum/admin/plugins.js b/public/src/forum/admin/plugins.js index 6f197e8bb0..9386f8390f 100644 --- a/public/src/forum/admin/plugins.js +++ b/public/src/forum/admin/plugins.js @@ -12,8 +12,9 @@ define(function() { }); socket.on('admin.plugins.toggle', function(status) { - pluginTgl = document.querySelector('.plugins li[data-plugin-id="' + status.id + '"] button'); - pluginTgl.innerHTML = ' ' + (status.active ? 'Dea' : 'A') + 'ctivate'; + pluginTgl = $('.plugins li[data-plugin-id="' + status.id + '"] button'); + pluginTgl.html(' ' + (status.active ? 'Dea' : 'A') + 'ctivate'); + pluginTgl.toggleClass('btn-warning', status.active).toggleClass('btn-success', !status.active); app.alert({ alert_id: 'plugin_toggled_' + status.id, diff --git a/public/src/forum/category.js b/public/src/forum/category.js index e9777904ab..09eacd8c55 100644 --- a/public/src/forum/category.js +++ b/public/src/forum/category.js @@ -12,7 +12,7 @@ define(['composer', 'forum/pagination'], function(composer, pagination) { app.enterRoom('category_' + cid); - $('#twitter-intent').on('click', function () { + $('#twitter-share').on('click', function () { window.open(twitterUrl, '_blank', 'width=550,height=420,scrollbars=no,status=no'); return false; }); diff --git a/public/src/forum/topic.js b/public/src/forum/topic.js index dbb1aa3431..33b6fbc4a2 100644 --- a/public/src/forum/topic.js +++ b/public/src/forum/topic.js @@ -280,41 +280,11 @@ define(['composer', 'forum/pagination'], function(composer, pagination) { fixDeleteStateForPosts(); - // Follow Thread State - var followEl = $('.posts .follow'), - set_follow_state = function(state, quiet) { - if (state && !followEl.hasClass('btn-success')) { - followEl.addClass('btn-success'); - followEl.attr('title', 'You are currently receiving updates to this topic'); - if (!quiet) { - app.alert({ - alert_id: 'topic_follow', - timeout: 2500, - title: '[[topic:following_topic.title]]', - message: '[[topic:following_topic.message]]', - type: 'success' - }); - } - } else if (!state && followEl.hasClass('btn-success')) { - followEl.removeClass('btn-success'); - followEl.attr('title', 'Be notified of new replies in this topic'); - if (!quiet) { - app.alert({ - alert_id: 'topic_follow', - timeout: 2500, - title: '[[topic:not_following_topic.title]]', - message: '[[topic:not_following_topic.message]]', - type: 'success' - }); - } - } - }; - socket.emit('topics.followCheck', tid, function(err, state) { - set_follow_state(state, true); + set_follow_state(state, false); }); - followEl.on('click', function() { + $('.posts .follow').on('click', function() { socket.emit('topics.follow', tid, function(err, state) { if(err) { return app.alert({ @@ -326,7 +296,7 @@ define(['composer', 'forum/pagination'], function(composer, pagination) { }); } - set_follow_state(state); + set_follow_state(state, true); }); return false; @@ -405,13 +375,14 @@ define(['composer', 'forum/pagination'], function(composer, pagination) { } var username = '', - post = $(this).parents('li[data-pid]'); + post = $(this).parents('li[data-pid]'), + pid = $(this).parents('.post-row').attr('data-pid'); if (post.length) { username = '@' + post.attr('data-username').replace(/\s/g, '-') + ' '; } if (thread_state.locked !== '1') { - composer.newReply(tid, topic_name, selectionText.length > 0 ? selectionText + '\n\n' + username : '' + username); + composer.newReply(tid, pid, topic_name, selectionText.length > 0 ? selectionText + '\n\n' + username : '' + username); } }); @@ -436,7 +407,7 @@ define(['composer', 'forum/pagination'], function(composer, pagination) { if($('.composer').length) { composer.addQuote(tid, pid, topic_name, username, quoted); }else { - composer.newReply(tid, topic_name, username + ' said:\n' + quoted); + composer.newReply(tid, pid, topic_name, username + ' said:\n' + quoted); } }); } @@ -913,129 +884,75 @@ define(['composer', 'forum/pagination'], function(composer, pagination) { favourites.html(currentFavourites).attr('data-favourites', currentFavourites); } - function set_locked_state(locked, alert) { - var threadReplyBtn = $('.topic-main-buttons .post_reply'), - postReplyBtns = document.querySelectorAll('#post-container .post_reply'), - quoteBtns = document.querySelectorAll('#post-container .quote'), - editBtns = document.querySelectorAll('#post-container .edit'), - deleteBtns = document.querySelectorAll('#post-container .delete'), - numPosts = document.querySelectorAll('#post_container li[data-pid]').length, - lockThreadEl = $('.lock_thread'), - x; - - if (locked === true) { - translator.translate(' [[topic:thread_tools.unlock]]', function(translated) { - lockThreadEl.html(translated); - }); - threadReplyBtn.attr('disabled', true); - threadReplyBtn.html('Locked '); - for (x = 0; x < numPosts; x++) { - postReplyBtns[x].innerHTML = 'Locked '; - quoteBtns[x].style.display = 'none'; - editBtns[x].style.display = 'none'; - deleteBtns[x].style.display = 'none'; - } + function set_follow_state(state, alert) { - if (alert) { - app.alert({ - 'alert_id': 'thread_lock', - type: 'success', - title: 'Thread Locked', - message: 'Thread has been successfully locked', - timeout: 5000 - }); - } + $('.posts .follow').toggleClass('btn-success', state).attr('title', state ? 'You are currently receiving updates to this topic' : 'Be notified of new replies in this topic'); - thread_state.locked = '1'; - } else { - translator.translate(' [[topic:thread_tools.lock]]', function(translated) { - lockThreadEl.html(translated); + if(alert) { + app.alert({ + alert_id: 'topic_follow', + timeout: 2500, + title: state ? '[[topic:following_topic.title]]' : '[[topic:not_following_topic.title]]', + message: state ? '[[topic:following_topic.message]]' : '[[topic:not_following_topic.message]]', + type: 'success' }); - threadReplyBtn.attr('disabled', false); - threadReplyBtn.html('Reply'); - for (x = 0; x < numPosts; x++) { - postReplyBtns[x].innerHTML = 'Reply '; - quoteBtns[x].style.display = 'inline-block'; - editBtns[x].style.display = 'inline-block'; - deleteBtns[x].style.display = 'inline-block'; - } + } + } - if (alert) { - app.alert({ - 'alert_id': 'thread_lock', - type: 'success', - title: 'Thread Unlocked', - message: 'Thread has been successfully unlocked', - timeout: 5000 - }); - } + function set_locked_state(locked, alert) { + translator.translate(' [[topic:thread_tools.' + (locked ? 'un': '') + 'lock]]', function(translated) { + $('.lock_thread').html(translated); + }); + + $('.topic-main-buttons .post_reply').attr('disabled', locked).html(locked ? 'Locked ' : 'Reply'); + + $('#post-container .post_reply').html(locked ? 'Locked ' : 'Reply '); + $('#post-container').find('.quote, .edit, .delete').toggleClass('none', locked); - thread_state.locked = '0'; + if (alert) { + app.alert({ + 'alert_id': 'thread_lock', + type: 'success', + title: 'Thread ' + (locked ? 'Locked' : 'Unlocked'), + message: 'Thread has been successfully ' + (locked ? 'locked' : 'unlocked'), + timeout: 5000 + }); } + + thread_state.locked = locked ? '1' : '0'; } function set_delete_state(deleted) { - var deleteThreadEl = $('.delete_thread'), - deleteTextEl = $('.delete_thread span'), - //deleteThreadEl.getElementsByTagName('span')[0], - threadEl = $('#post-container'), - deleteNotice = document.getElementById('thread-deleted') || document.createElement('div'); - - if (deleted) { - translator.translate(' [[topic:thread_tools.restore]]', function(translated) { - deleteTextEl.html(translated); - }); - threadEl.addClass('deleted'); + var threadEl = $('#post-container'); + + translator.translate(' [[topic:thread_tools.' + (deleted ? 'restore' : 'delete') + ']]', function(translated) { + $('.delete_thread span').html(translated); + }); - // Spawn a 'deleted' notice at the top of the page - deleteNotice.setAttribute('id', 'thread-deleted'); - deleteNotice.className = 'alert alert-warning'; - deleteNotice.innerHTML = 'This thread has been deleted. Only users with thread management privileges can see it.'; - threadEl.before(deleteNotice); + threadEl.toggleClass('deleted', deleted); + thread_state.deleted = deleted ? '1' : '0'; - thread_state.deleted = '1'; + if(deleted) { + $('

This thread has been deleted. Only users with thread management privileges can see it.
').insertBefore(threadEl); } else { - translator.translate(' [[topic:thread_tools.delete]]', function(translated) { - deleteTextEl.html(translated); - }); - threadEl.removeClass('deleted'); - deleteNotice.parentNode.removeChild(deleteNotice); - - thread_state.deleted = '0'; + $('#thread-deleted').remove(); } } function set_pinned_state(pinned, alert) { - var pinEl = $('.pin_thread'); - translator.translate(' [[topic:thread_tools.' + (pinned ? 'unpin' : 'pin') + ']]', function(translated) { - if (pinned) { - pinEl.html(translated); - if (alert) { - app.alert({ - 'alert_id': 'thread_pin', - type: 'success', - title: 'Thread Pinned', - message: 'Thread has been successfully pinned', - timeout: 5000 - }); - } - - thread_state.pinned = '1'; - } else { - pinEl.html(translated); - if (alert) { - app.alert({ - 'alert_id': 'thread_pin', - type: 'success', - title: 'Thread Unpinned', - message: 'Thread has been successfully unpinned', - timeout: 5000 - }); - } + $('.pin_thread').html(translated); - thread_state.pinned = '0'; + if (alert) { + app.alert({ + 'alert_id': 'thread_pin', + type: 'success', + title: 'Thread ' + (pinned ? 'Pinned' : 'Unpinned'), + message: 'Thread has been successfully ' + (pinned ? 'pinned' : 'unpinned'), + timeout: 5000 + }); } + thread_state.pinned = pinned ? '1' : '0'; }); } @@ -1052,23 +969,13 @@ define(['composer', 'forum/pagination'], function(composer, pagination) { } function toggle_post_tools(pid, isDeleted) { - var postEl = $('#post-container li[data-pid="' + pid + '"]'), - quoteEl = $(postEl[0].querySelector('.quote')), - favEl = $(postEl[0].querySelector('.favourite')), - replyEl = $(postEl[0].querySelector('.post_reply')), - chatEl = $(postEl[0].querySelector('.chat')); - - if (isDeleted) { - quoteEl.addClass('none'); - favEl.addClass('none'); - replyEl.addClass('none'); - chatEl.addClass('none'); - } else { - quoteEl.removeClass('none'); - favEl.removeClass('none'); - replyEl.removeClass('none'); - chatEl.removeClass('none'); - } + var postEl = $('#post-container li[data-pid="' + pid + '"]'); + + postEl.find('.quote, .favourite, .post_reply, .chat').toggleClass('none', isDeleted); + + translator.translate(isDeleted ? ' [[topic:restore]]' : ' [[topic:delete]]', function(translated) { + postEl.find('.delete').find('span').html(translated); + }); } $(window).on('scroll', updateHeader); @@ -1135,8 +1042,7 @@ define(['composer', 'forum/pagination'], function(composer, pagination) { var scrollBottom = scrollTop + $(window).height(); var elTop = el.offset().top; - var height = Math.floor(el.height()); - var elBottom = elTop + height; + var elBottom = elTop + Math.floor(el.height()); return !(elTop > scrollBottom || elBottom < scrollTop); } @@ -1315,18 +1221,8 @@ define(['composer', 'forum/pagination'], function(composer, pagination) { } - function toggle_mod_tools(pid, state) { - var postEl = $(document.querySelector('#post-container li[data-pid="' + pid + '"]')), - editEl = postEl.find('.edit'), - deleteEl = postEl.find('.delete'); - - if (state) { - editEl.removeClass('none'); - deleteEl.removeClass('none'); - } else { - editEl.addClass('none'); - deleteEl.addClass('none'); - } + function toggle_mod_tools(pid, editable) { + $('#post-container li[data-pid="' + pid + '"]').find('.edit, .delete').toggleClass('none', !editable); } function updatePostCount() { diff --git a/public/src/forum/unread.js b/public/src/forum/unread.js index 3ed2baf5cc..9829ca7a25 100644 --- a/public/src/forum/unread.js +++ b/public/src/forum/unread.js @@ -47,6 +47,7 @@ define(['forum/recent'], function(recent) { if(!$('#topics-container').length) { return; } + loadingMoreTopics = true; socket.emit('topics.loadMoreUnreadTopics', { after: $('#topics-container').attr('data-nextstart') diff --git a/public/src/forum/users.js b/public/src/forum/users.js index 5e780b4670..e0af14faf7 100644 --- a/public/src/forum/users.js +++ b/public/src/forum/users.js @@ -111,12 +111,14 @@ define(function() { users: users }); - if(emptyContainer) { - $('#users-container .registered-user').remove(); - } + translator.translate(html, function(translated) { + if(emptyContainer) { + $('#users-container .registered-user').remove(); + } - $('#users-container').append(html); - $('#users-container .anon-user').appendTo($('#users-container')); + $('#users-container').append(translated); + $('#users-container .anon-user').appendTo($('#users-container')); + }); } function loadMoreUsers() { diff --git a/public/src/modules/chat.js b/public/src/modules/chat.js index c874b330b1..cf99aa1d5c 100644 --- a/public/src/modules/chat.js +++ b/public/src/modules/chat.js @@ -91,7 +91,11 @@ define(['taskbar', 'string'], function(taskbar, S) { function checkStatus(chatModal) { socket.emit('user.isOnline', chatModal.touid, function(err, data) { - $('#chat-user-status').attr('class', 'fa fa-circle status ' + data.status); + translator.translate('[[global:' + data.status + ']]', function(translated) { + $('#chat-user-status').attr('class', 'fa fa-circle status ' + data.status) + .attr('title', translated) + .attr('data-original-title', translated); + }); }); } diff --git a/public/src/modules/composer.js b/public/src/modules/composer.js index 1ae70fee16..45b8c2b974 100644 --- a/public/src/modules/composer.js +++ b/public/src/modules/composer.js @@ -294,22 +294,22 @@ define(['taskbar'], function(taskbar) { var prevText = bodyEl.val(); if(tid !== composer.posts[uuid].tid) { text = username + ' said in ['+title+'](/topic/'+tid+'#'+pid+'):\n'+text; - }else { + } else { text = username + ' said:\n' + text; } composer.posts[uuid].body = (prevText.length ? prevText + '\n\n' : '') + text; bodyEl.val(composer.posts[uuid].body); - }else{ - composer.newReply(tid,title,username + ' said:\n' + text); + } else { + composer.newReply(tid, pid, title, username + ' said:\n' + text); } - } }; - composer.newReply = function(tid, title, text) { + composer.newReply = function(tid, pid, title, text) { if(allowed()) { push({ tid: tid, + toPid: pid, title: title, body: text, modified: false, @@ -711,7 +711,9 @@ define(['taskbar'], function(taskbar) { titleEl.val(titleEl.val().trim()); bodyEl.val(bodyEl.val().trim()); - thumbEl.val(thumbEl.val().trim()); + if(thumbEl.length) { + thumbEl.val(thumbEl.val().trim()); + } var checkTitle = parseInt(postData.cid, 10) || parseInt(postData.pid, 10); @@ -729,20 +731,21 @@ define(['taskbar'], function(taskbar) { socket.emit('topics.post', { title: titleEl.val(), content: bodyEl.val(), - topic_thumb: thumbEl.val(), + topic_thumb: thumbEl.val() || '', category_id: postData.cid }, done); } else if (parseInt(postData.tid, 10) > 0) { socket.emit('posts.reply', { - topic_id: postData.tid, - content: bodyEl.val() + tid: postData.tid, + content: bodyEl.val(), + toPid: postData.toPid }, done); } else if (parseInt(postData.pid, 10) > 0) { socket.emit('posts.edit', { pid: postData.pid, content: bodyEl.val(), title: titleEl.val(), - topic_thumb: thumbEl.val() + topic_thumb: thumbEl.val() || '' }, done); } diff --git a/public/templates/account.tpl b/public/templates/account.tpl index 683b1c42f6..dac12502d9 100644 --- a/public/templates/account.tpl +++ b/public/templates/account.tpl @@ -17,7 +17,7 @@
- +
diff --git a/public/templates/admin/plugins.tpl b/public/templates/admin/plugins.tpl index 5a9d62d0fa..3aa7e5f5e1 100644 --- a/public/templates/admin/plugins.tpl +++ b/public/templates/admin/plugins.tpl @@ -1,11 +1,20 @@

Plugins

+
+

+ Interested in writing plugins for NodeBB? +

+

+ Full documentation regarding plugin authoring can be found in the NodeBB Wiki. +

+
+ -
-

- Interested in writing plugins for NodeBB? -

-

- Full documentation regarding plugin authoring can be found in the NodeBB Wiki. -

-
+ diff --git a/public/templates/category.tpl b/public/templates/category.tpl index 418c8ca40b..0f4f97748a 100644 --- a/public/templates/category.tpl +++ b/public/templates/category.tpl @@ -14,7 +14,7 @@
  -   +    
@@ -43,7 +43,11 @@ todo: add a check for config.allowTopicsThumbnail if issue#1066 is a win --> - + + + + +

diff --git a/public/templates/chat.tpl b/public/templates/chat.tpl index 8cc01343d8..8a7653651c 100644 --- a/public/templates/chat.tpl +++ b/public/templates/chat.tpl @@ -4,7 +4,7 @@