mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 14:35:47 +01:00
fixed conflicts
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -16,3 +16,6 @@ provision.sh
|
|||||||
*.komodoproject
|
*.komodoproject
|
||||||
|
|
||||||
feeds/recent.rss
|
feeds/recent.rss
|
||||||
|
|
||||||
|
# winston?
|
||||||
|
error.log
|
||||||
|
|||||||
11
app.js
11
app.js
@@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
var fs = require('fs'),
|
var fs = require('fs'),
|
||||||
async = require('async'),
|
async = require('async'),
|
||||||
|
semver = require('semver'),
|
||||||
winston = require('winston'),
|
winston = require('winston'),
|
||||||
pkg = require('./package.json'),
|
pkg = require('./package.json'),
|
||||||
path = require('path'),
|
path = require('path'),
|
||||||
@@ -48,6 +49,12 @@
|
|||||||
winston.error(err.stack);
|
winston.error(err.stack);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
require('child_process').exec('/usr/bin/which convert', function(err, stdout, stderr) {
|
||||||
|
if(err || !stdout) {
|
||||||
|
winston.warn('Couldn\'t find convert. Did you install imagemagick?');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Log GNU copyright info along with server info
|
// Log GNU copyright info along with server info
|
||||||
winston.info('NodeBB v' + pkg.version + ' Copyright (C) 2013 DesignCreatePlay Inc.');
|
winston.info('NodeBB v' + pkg.version + ' Copyright (C) 2013 DesignCreatePlay Inc.');
|
||||||
winston.info('This program comes with ABSOLUTELY NO WARRANTY.');
|
winston.info('This program comes with ABSOLUTELY NO WARRANTY.');
|
||||||
@@ -73,6 +80,10 @@
|
|||||||
winston.info('Base Configuration OK.');
|
winston.info('Base Configuration OK.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (semver.gt(pkg.dependencies['nodebb-theme-cerulean'], require('./node_modules/nodebb-theme-cerulean/package.json').version)) {
|
||||||
|
winston.error('nodebb-theme-cerulean is out of date - please run npm install.')
|
||||||
|
}
|
||||||
|
|
||||||
require('./src/database').init(function(err) {
|
require('./src/database').init(function(err) {
|
||||||
meta.configs.init(function () {
|
meta.configs.init(function () {
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"socket.io": "~0.9.16",
|
"socket.io": "~0.9.16",
|
||||||
"redis": "0.8.3",
|
"redis": "0.8.3",
|
||||||
"mongodb": "1.3.20",
|
"mongodb": "~1.3.19",
|
||||||
"express": "3.2.0",
|
"express": "3.2.0",
|
||||||
"express-namespace": "~0.1.1",
|
"express-namespace": "~0.1.1",
|
||||||
"emailjs": "0.3.4",
|
"emailjs": "0.3.4",
|
||||||
@@ -43,10 +43,11 @@
|
|||||||
"uglify-js": "~2.4.0",
|
"uglify-js": "~2.4.0",
|
||||||
"validator": "~1.5.1",
|
"validator": "~1.5.1",
|
||||||
"nodebb-plugin-mentions": "~0.1.15",
|
"nodebb-plugin-mentions": "~0.1.15",
|
||||||
"nodebb-plugin-markdown": "~0.2.0",
|
"nodebb-plugin-markdown": "~0.2.1",
|
||||||
"nodebb-theme-vanilla": "~0.0.9",
|
"nodebb-theme-vanilla": "~0.0.9",
|
||||||
"nodebb-theme-cerulean": "0.0.10",
|
"nodebb-theme-cerulean": "0.0.10",
|
||||||
"cron": "~1.0.1"
|
"cron": "~1.0.1",
|
||||||
|
"semver": "~2.2.1"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"hiredis": "~0.1.15"
|
"hiredis": "~0.1.15"
|
||||||
|
|||||||
@@ -36,5 +36,8 @@
|
|||||||
"loading": "Lade",
|
"loading": "Lade",
|
||||||
"more_posts": "Mehr Posts",
|
"more_posts": "Mehr Posts",
|
||||||
"move_topic": "Thema verschieben",
|
"move_topic": "Thema verschieben",
|
||||||
"topic_will_be_moved_to": "Dieses Thema wird verschoben nach"
|
"topic_will_be_moved_to": "Dieses Thema wird verschoben nach",
|
||||||
|
|
||||||
|
"reputation": "Reputation",
|
||||||
|
"posts": "Posts"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
"location": "Wohnort",
|
"location": "Wohnort",
|
||||||
"age": "Alter",
|
"age": "Alter",
|
||||||
"joined": "Beigetreten",
|
"joined": "Beigetreten",
|
||||||
"profil_views": "Profilaufrufe",
|
"profile_views": "Profilaufrufe",
|
||||||
"reputation": "Reputation",
|
"reputation": "Reputation",
|
||||||
"posts": "Posts",
|
"posts": "Posts",
|
||||||
"followers": "Follower",
|
"followers": "Follower",
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
"change_picture": "Ändere Profilbild",
|
"change_picture": "Ändere Profilbild",
|
||||||
"edit": "Ändern",
|
"edit": "Ändern",
|
||||||
"uploaded_pictures": "Hochgeladene Bilder",
|
"uploaded_picture": "Hochgeladene Bilder",
|
||||||
"upload_new_picture": "Neues Bild hochladen",
|
"upload_new_picture": "Neues Bild hochladen",
|
||||||
"change_password": "Ändere Passwort",
|
"change_password": "Ändere Passwort",
|
||||||
"confirm_password": "Passwort wiederholen",
|
"confirm_password": "Passwort wiederholen",
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
"image_spec": "Du solltest nur Dateien die PNG, JPG, oder GIF kleiner als 256kb hochladen.",
|
"image_spec": "Du solltest nur Dateien die PNG, JPG, oder GIF kleiner als 256kb hochladen.",
|
||||||
|
|
||||||
"settings": "Einstellungen",
|
"settings": "Einstellungen",
|
||||||
"show_my_email": "Zeige meine E-Mail Adresse an.",
|
"show_email": "Zeige meine E-Mail Adresse an.",
|
||||||
|
|
||||||
"has_no_follower": "Dieser User hat noch keine Follower.",
|
"has_no_follower": "Dieser User hat noch keine Follower.",
|
||||||
"follows_no_one": "Dieser User folgt noch niemanden."
|
"follows_no_one": "Dieser User folgt noch niemanden."
|
||||||
|
|||||||
@@ -32,8 +32,11 @@
|
|||||||
"favourites.has_no_favourites": "You don't have any favourites, favourite some posts to see them here!",
|
"favourites.has_no_favourites": "You don't have any favourites, favourite some posts to see them here!",
|
||||||
|
|
||||||
"posted_by": "posted by",
|
"posted_by": "posted by",
|
||||||
"loading": "Lade",
|
"loading": "Loading",
|
||||||
"more_posts": "More Posts",
|
"more_posts": "More Posts",
|
||||||
"move_topic": "Move Topic",
|
"move_topic": "Move Topic",
|
||||||
"topic_will_be_moved_to": "This topic will be moved to the category"
|
"topic_will_be_moved_to": "This topic will be moved to the category",
|
||||||
|
|
||||||
|
"reputation": "Reputation",
|
||||||
|
"posts": "Posts"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,35 +1,35 @@
|
|||||||
{
|
{
|
||||||
"banned": "Banned",
|
"banned": "Banned",
|
||||||
"offline": "offline",
|
"offline": "Offline",
|
||||||
"email": "email",
|
"email": "Email",
|
||||||
"fullname": "full name",
|
"fullname": "Full Name",
|
||||||
"website": "website",
|
"website": "Website",
|
||||||
"location": "location",
|
"location": "Location",
|
||||||
"age": "age",
|
"age": "Age",
|
||||||
"joined": "joined",
|
"joined": "Joined",
|
||||||
"profil_views": "profil views",
|
"profile_views": "Profile views",
|
||||||
"reputation": "reputation",
|
"reputation": "Reputation",
|
||||||
"posts": "posts",
|
"posts": "Posts",
|
||||||
"followers": "followers",
|
"followers": "Followers",
|
||||||
"following": "following",
|
"following": "Following",
|
||||||
"signature": "signature",
|
"signature": "Signature",
|
||||||
"gravatar": "gravatar",
|
"gravatar": "Gravatar",
|
||||||
"birthday": "birthday",
|
"birthday": "Birthday",
|
||||||
|
|
||||||
"change_picture": "change picture",
|
"change_picture": "Change Picture",
|
||||||
"edit": "edit",
|
"edit": "Edit",
|
||||||
"uploaded_pictures": "uploaded pictures",
|
"uploaded_picture": "Uploaded Picture",
|
||||||
"upload_new_picture": "upload new picture",
|
"upload_new_picture": "Upload New Picture",
|
||||||
"change_password": "change password",
|
"change_password": "Change Password",
|
||||||
"confirm_password": "confirm password",
|
"confirm_password": "Confirm Password",
|
||||||
"password": "password",
|
"password": "Password",
|
||||||
|
|
||||||
"upload_picture": "Upload picture",
|
"upload_picture": "Upload picture",
|
||||||
"upload_a_picture": "Upload a picture",
|
"upload_a_picture": "Upload a picture",
|
||||||
"image_spec": "You may only upload PNG, JPG, or GIF files under 256kb.",
|
"image_spec": "You may only upload PNG, JPG, or GIF files under 256kb.",
|
||||||
|
|
||||||
"settings": "settings",
|
"settings": "settings",
|
||||||
"show_my_email": "show my email",
|
"show_email": "Show My Email",
|
||||||
|
|
||||||
"has_no_follower": "This user doesn't have any followers :(",
|
"has_no_follower": "This user doesn't have any followers :(",
|
||||||
"follows_no_one": "This user isn't following anyone :("
|
"follows_no_one": "This user isn't following anyone :("
|
||||||
|
|||||||
@@ -35,5 +35,8 @@
|
|||||||
"loading": "Cargando",
|
"loading": "Cargando",
|
||||||
"more_posts": "Más posts",
|
"more_posts": "Más posts",
|
||||||
"move_topic": "Mover Tema",
|
"move_topic": "Mover Tema",
|
||||||
"topic_will_be_moved_to": "Este tema sera movido a la categoría"
|
"topic_will_be_moved_to": "Este tema sera movido a la categoría",
|
||||||
|
|
||||||
|
"reputation": "Reputación",
|
||||||
|
"posts": "Posts"
|
||||||
}
|
}
|
||||||
@@ -1,35 +1,35 @@
|
|||||||
{
|
{
|
||||||
"banned": "Banneado",
|
"banned": "Banneado",
|
||||||
"offline": "desconectado",
|
"offline": "Desconectado",
|
||||||
"email": "email",
|
"email": "Email",
|
||||||
"fullname": "nombre completo",
|
"fullname": "Nombre Completo",
|
||||||
"website": "website",
|
"website": "Website",
|
||||||
"location": "ubicación",
|
"location": "Ubicación",
|
||||||
"age": "edad",
|
"age": "Edad",
|
||||||
"joined": "registro",
|
"joined": "Registro",
|
||||||
"profil_views": "visitas en su perfil",
|
"profile_views": "Visitas en su perfil",
|
||||||
"reputation": "reputación",
|
"reputation": "Reputación",
|
||||||
"posts": "posts",
|
"posts": "Posts",
|
||||||
"followers": "seguidores",
|
"followers": "Seguidores",
|
||||||
"following": "siguiendo",
|
"following": "Siguiendo",
|
||||||
"signature": "firma",
|
"signature": "Firma",
|
||||||
"gravatar": "gravatar",
|
"gravatar": "Gravatar",
|
||||||
"birthday": "cumpleaños",
|
"birthday": "Cumpleaños",
|
||||||
|
|
||||||
"change_picture": "cambiar foto",
|
"change_picture": "Cambiar Foto",
|
||||||
"edit": "editar",
|
"edit": "Editar",
|
||||||
"uploaded_pictures": "fotos cargadas",
|
"uploaded_picture": "Fotos Cargadas",
|
||||||
"upload_new_picture": "cargar nueva foto",
|
"upload_new_picture": "Cargar Nueva Foto",
|
||||||
"change_password": "cambiar contraseña",
|
"change_password": "Cambiar Contraseña",
|
||||||
"confirm_password": "confirmar contraseña",
|
"confirm_password": "Confirmar Contraseña",
|
||||||
"password": "contraseña",
|
"password": "Contraseña",
|
||||||
|
|
||||||
"upload_picture": "Cargar foto",
|
"upload_picture": "Cargar foto",
|
||||||
"upload_a_picture": "Cargar una foto",
|
"upload_a_picture": "Cargar una foto",
|
||||||
"image_spec": "Solo puedes usar PNG, JPG, o GIF hasta 256kb.",
|
"image_spec": "Solo puedes usar PNG, JPG, o GIF hasta 256kb.",
|
||||||
|
|
||||||
"settings": "opciones",
|
"settings": "Opciones",
|
||||||
"show_my_email": "mostrar mi email",
|
"show_email": "Mostrar mi Email",
|
||||||
|
|
||||||
"has_no_follower": "Este miembro no tiene seguidores :(",
|
"has_no_follower": "Este miembro no tiene seguidores :(",
|
||||||
"follows_no_one": "Este miembro no sigue a nadie, que pena :("
|
"follows_no_one": "Este miembro no sigue a nadie, que pena :("
|
||||||
|
|||||||
14
public/language/fr/category.json
Normal file
14
public/language/fr/category.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"new_topic_button": "Nouveau Sujet",
|
||||||
|
"no_topics": "<strong>Il n'y a aucun topic dans cette catégorie.</strong><br />Pourquoi ne pas en créer un?",
|
||||||
|
"sidebar.recent_replies": "Réponses Récentes",
|
||||||
|
"sidebar.active_participants": "Participants Actifs",
|
||||||
|
"sidebar.moderators": "Modérateurs",
|
||||||
|
"posts": "messages",
|
||||||
|
"views": "vues",
|
||||||
|
"posted": "posté",
|
||||||
|
"browsing": "naviguer",
|
||||||
|
"no_replies": "Personne n'a répondu",
|
||||||
|
"replied": "répondu",
|
||||||
|
"last_edited_by": "dernière édition par"
|
||||||
|
}
|
||||||
10
public/language/fr/footer.json
Normal file
10
public/language/fr/footer.json
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"chat.chatting_with": "Chat avec <span id=\"chat-with-name\"></span>",
|
||||||
|
"chat.placeholder": "taper le message ici, presser entrer pour envoyer",
|
||||||
|
"chat.send": "Envoyer",
|
||||||
|
"stats.online": "Online",
|
||||||
|
"stats.users": "Utilisateurs",
|
||||||
|
"stats.topics": "Sujets",
|
||||||
|
"stats.posts": "Message",
|
||||||
|
"success": "succès"
|
||||||
|
}
|
||||||
31
public/language/fr/global.json
Normal file
31
public/language/fr/global.json
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
{
|
||||||
|
"home": "Accueil",
|
||||||
|
"search": "Recherche",
|
||||||
|
"buttons.close": "Fermer",
|
||||||
|
"403.title": "Accès Refusé",
|
||||||
|
"403.message": "Il semble que vous vous soyez retrouvé sur une page dont vous n'avez pas accès. Peut-être devriez vous <a href='/login'>essayez de vous connecter</a>?",
|
||||||
|
"404.title": "Introuvable",
|
||||||
|
"404.message": "Il semble que vous vous soyez retrouvé sur une page qui n'existe pas. Retourner à <a href='/'>l'accueil</a>.",
|
||||||
|
"500.title": "Erreur Interne.",
|
||||||
|
"500.message": "Oops! Il semblerait que quelque chose se soit mal passé!",
|
||||||
|
|
||||||
|
"register": "S'inscrire",
|
||||||
|
"login": "Connecter",
|
||||||
|
|
||||||
|
"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",
|
||||||
|
|
||||||
|
"header.admin": "Admin",
|
||||||
|
"header.recent": "Récent",
|
||||||
|
"header.unread": "Non Lu",
|
||||||
|
"header.users": "Utilisateurs",
|
||||||
|
"header.search": "Recherche",
|
||||||
|
"header.profile": "Profile",
|
||||||
|
|
||||||
|
"notifications.loading": "Chargement des Notifications",
|
||||||
|
"chats.loading": "Chargement des Chats"
|
||||||
|
}
|
||||||
10
public/language/fr/login.json
Normal file
10
public/language/fr/login.json
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"login": "Connexion",
|
||||||
|
"username": "Identifiant",
|
||||||
|
"password": "Mot de passe",
|
||||||
|
"remember_me": "Se souvenir de moi?",
|
||||||
|
"forgot_password": "Mot de passe oublié?",
|
||||||
|
"alternative_logins": "Connexion Alternative",
|
||||||
|
"failed_login_attempt": "Echèc d'authentification, veuillez réessayer.",
|
||||||
|
"login_successful": "Vous êtes maintenant connecté!"
|
||||||
|
}
|
||||||
9
public/language/fr/notifications.json
Normal file
9
public/language/fr/notifications.json
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"title": "Notifications",
|
||||||
|
"back_to_home": "retour à NodeBB",
|
||||||
|
"mark_all_as_read": "Tout marquer comme lu",
|
||||||
|
"outgoing_link": "Lien Sortant",
|
||||||
|
"outgoing_link_message": "Vous quitter NodeBB",
|
||||||
|
"continue_to": "Continuer vers",
|
||||||
|
"return_to": "Retour vers"
|
||||||
|
}
|
||||||
5
public/language/fr/recent.json
Normal file
5
public/language/fr/recent.json
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"day": "Jour",
|
||||||
|
"week": "Semaine",
|
||||||
|
"month": "Mois"
|
||||||
|
}
|
||||||
16
public/language/fr/register.json
Normal file
16
public/language/fr/register.json
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"register": "S'inscrire",
|
||||||
|
"help.email": "Par défault, votre email est masqué du public.",
|
||||||
|
"help.username_restrictions": "Un identifiant unique entre %1 et %2 charactères. Les autres utilisateurs peuvent vous citer avec @<span id='yourUsername'>username</span>.",
|
||||||
|
"help.minimum_password_length": "Votre mot de passe doit avoir au moins %1 charactères.",
|
||||||
|
"email_address": "Adresse Email",
|
||||||
|
"email_address_placeholder": "Entrer l'addresse Email",
|
||||||
|
"username": "Nom d'utilisateur",
|
||||||
|
"username_placeholder": "Entré le Nom d'utilisateur",
|
||||||
|
"password": "Mot de passe",
|
||||||
|
"password_placeholder": "Entrer le Mot de passe",
|
||||||
|
"confirm_password": "Confirmer le Mot de passe",
|
||||||
|
"confirm_password_placeholder": "Confirmer le Mot de passe",
|
||||||
|
"register_now_button": "S'enregistrer maintenant",
|
||||||
|
"alternative_registration": "Enregistrement Alternatif"
|
||||||
|
}
|
||||||
13
public/language/fr/reset_password.json
Normal file
13
public/language/fr/reset_password.json
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"reset_password": "Réinitialiser le Mot de passe",
|
||||||
|
"update_password": "Mettre à jour le Mot de passe",
|
||||||
|
"password_changed.title": "Mot de passe modifié",
|
||||||
|
"password_changed.message": "<p>Mot de passe réinitialisé avec succès, veuillez vous <a href=\"/login\">reconnecter</a>.",
|
||||||
|
"wrong_reset_code.title": "Code de Réinisialisation Incorrect",
|
||||||
|
"wrong_reset_code.message": "Le Code de Réinisialisation est Incorrect. Veillez réessayer, ou <a href=\"/reset\">demander un nouveau Code de Réinisialisation</a>.",
|
||||||
|
"new_password": "Nouveau Mot de passe",
|
||||||
|
"repeat_password": "Confirmer le Mot de passe",
|
||||||
|
"enter_email": "Veuillez entrer votre <strong>adresse email</strong> et vous recevrez un email avec les instruction pour réinitialiser votre compte.",
|
||||||
|
"password_reset_sent": "Réinitialisation de Mot de Passe Envoyée",
|
||||||
|
"invalid_email": "Email Invalide / L'Email n'existe pas!"
|
||||||
|
}
|
||||||
42
public/language/fr/topic.json
Normal file
42
public/language/fr/topic.json
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
{
|
||||||
|
"topic": "Sujet",
|
||||||
|
"topics": "Sujets",
|
||||||
|
|
||||||
|
"no_topics_found": "Aucun sujet trouvé!",
|
||||||
|
|
||||||
|
"profile": "Profile",
|
||||||
|
"posted_by": "Envoyé by",
|
||||||
|
"chat": "Chat",
|
||||||
|
"notify_me": "Être notifié des réponses dans ce sujet",
|
||||||
|
"quote": "Citer",
|
||||||
|
"reply": "Répondre",
|
||||||
|
"edit": "Editer",
|
||||||
|
"delete": "Supprimer",
|
||||||
|
"banned": "bannir",
|
||||||
|
"link": "Lien",
|
||||||
|
|
||||||
|
"thread_tools.title": "Outils du Fil",
|
||||||
|
"thread_tools.pin": "Epingler le fil",
|
||||||
|
"thread_tools.lock": "Verrouiller le fil",
|
||||||
|
"thread_tools.move": "Déplacer le fil",
|
||||||
|
"thread_tools.delete": "Supprimer le fil",
|
||||||
|
|
||||||
|
"load_categories": "Chargement des Categories",
|
||||||
|
"disabled_categories_note": "Les Catégories Désactivées sont grisées",
|
||||||
|
"confirm_move": "Déplacer",
|
||||||
|
|
||||||
|
"favourite": "Favoris",
|
||||||
|
"favourites": "Favoris",
|
||||||
|
"favourites.not_logged_in.title": "Non Connecté",
|
||||||
|
"favourites.not_logged_in.message": "Veuillez vous connecter avant de mettre ce message en Favoris",
|
||||||
|
"favourites.has_no_favourites": "Vous n'avez aucun Favoris, mettre en favoris des messages pour les voir apparaître ici!",
|
||||||
|
|
||||||
|
"posted_by": "posté par",
|
||||||
|
"loading": "Chargement",
|
||||||
|
"more_posts": "d'autres Messages",
|
||||||
|
"move_topic": "Déplacer le Sujet",
|
||||||
|
"topic_will_be_moved_to": "Ce sujet sera déplacé vers la catégorie",
|
||||||
|
|
||||||
|
"reputation": "réputation",
|
||||||
|
"posts": "messages"
|
||||||
|
}
|
||||||
5
public/language/fr/unread.json
Normal file
5
public/language/fr/unread.json
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"no_unread_topics": "Aucun sujet non lu.",
|
||||||
|
"mark_all_read": "Marquer tout comme lu",
|
||||||
|
"load_more": "Charger la suite"
|
||||||
|
}
|
||||||
36
public/language/fr/user.json
Normal file
36
public/language/fr/user.json
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
"banned": "Banni",
|
||||||
|
"offline": "Hors-ligne",
|
||||||
|
"email": "email",
|
||||||
|
"fullname": "Nom",
|
||||||
|
"website": "Site Web",
|
||||||
|
"location": "Emplacement",
|
||||||
|
"age": "age",
|
||||||
|
"joined": "adhésion",
|
||||||
|
"profil_views": "vues du profil",
|
||||||
|
"reputation": "réputation",
|
||||||
|
"posts": "messages",
|
||||||
|
"followers": "suiveurs",
|
||||||
|
"following": "suivis",
|
||||||
|
"signature": "signature",
|
||||||
|
"gravatar": "gravatar",
|
||||||
|
"birthday": "anniversaire",
|
||||||
|
|
||||||
|
"change_picture": "changer d'image",
|
||||||
|
"edit": "editer",
|
||||||
|
"uploaded_picture": "images uploadées",
|
||||||
|
"upload_new_picture": "uploader une nouvelle image",
|
||||||
|
"change_password": "chnger le mot de passe",
|
||||||
|
"confirm_password": "confirmer le mot de passe",
|
||||||
|
"password": "mot de passe",
|
||||||
|
|
||||||
|
"upload_picture": "Uploader un image",
|
||||||
|
"upload_a_picture": "Uploader un image",
|
||||||
|
"image_spec": "Vous pouvez uploader seulement des fichiers de types PNG, JPG, ou GIF en dessous de 256kb.",
|
||||||
|
|
||||||
|
"settings": "paramètres",
|
||||||
|
"show_my_email": "montrer mon email",
|
||||||
|
|
||||||
|
"has_no_follower": "Cet utilisateur n'a aucun suiver :(",
|
||||||
|
"follows_no_one": "Cet utilisateur ne suit personne :("
|
||||||
|
}
|
||||||
9
public/language/fr/users.json
Normal file
9
public/language/fr/users.json
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"latest_users": "Derniers Utilisateurs",
|
||||||
|
"top_posters": "Meilleurs Publieur",
|
||||||
|
"most_reputation": "Meilleur Réputation",
|
||||||
|
"online": "En Ligne",
|
||||||
|
"search": "Rechercher",
|
||||||
|
"enter_username": "Entrer un nom d'utilisateur pour rechercher",
|
||||||
|
"load_more": "Charger la suite"
|
||||||
|
}
|
||||||
@@ -31,6 +31,8 @@ var ajaxify = {};
|
|||||||
|
|
||||||
var pagination, paginator_bar;
|
var pagination, paginator_bar;
|
||||||
|
|
||||||
|
ajaxify.currentPage = null;
|
||||||
|
|
||||||
ajaxify.go = function (url, callback, template, quiet) {
|
ajaxify.go = function (url, callback, template, quiet) {
|
||||||
// start: the following should be set like so: ajaxify.onchange(function(){}); where the code actually belongs
|
// start: the following should be set like so: ajaxify.onchange(function(){}); where the code actually belongs
|
||||||
$(window).off('scroll');
|
$(window).off('scroll');
|
||||||
@@ -69,6 +71,8 @@ var ajaxify = {};
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (templates.is_available(tpl_url) && !templates.force_refresh(tpl_url)) {
|
if (templates.is_available(tpl_url) && !templates.force_refresh(tpl_url)) {
|
||||||
|
ajaxify.currentPage = tpl_url;
|
||||||
|
|
||||||
if (window.history && window.history.pushState) {
|
if (window.history && window.history.pushState) {
|
||||||
window.history[!quiet ? 'pushState' : 'replaceState']({
|
window.history[!quiet ? 'pushState' : 'replaceState']({
|
||||||
url: url
|
url: url
|
||||||
@@ -90,7 +94,7 @@ var ajaxify = {};
|
|||||||
|
|
||||||
translator.load(tpl_url);
|
translator.load(tpl_url);
|
||||||
|
|
||||||
jQuery('#footer, #content').addClass('ajaxifying');
|
jQuery('#footer, #content').removeClass('hide').addClass('ajaxifying');
|
||||||
|
|
||||||
templates.flush();
|
templates.flush();
|
||||||
templates.load_template(function () {
|
templates.load_template(function () {
|
||||||
@@ -129,6 +133,10 @@ var ajaxify = {};
|
|||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ajaxify.refresh = function() {
|
||||||
|
ajaxify.go(ajaxify.currentPage);
|
||||||
|
};
|
||||||
|
|
||||||
$('document').ready(function () {
|
$('document').ready(function () {
|
||||||
if (!window.history || !window.history.pushState) {
|
if (!window.history || !window.history.pushState) {
|
||||||
return; // no ajaxification for old browsers
|
return; // no ajaxification for old browsers
|
||||||
@@ -154,7 +162,7 @@ var ajaxify = {};
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!e.ctrlKey && e.which === 1) {
|
if ((!e.ctrlKey && !e.shiftKey) && e.which === 1) {
|
||||||
if (this.host === window.location.host) {
|
if (this.host === window.location.host) {
|
||||||
// Internal link
|
// Internal link
|
||||||
var url = this.href.replace(rootUrl + '/', '');
|
var url = this.href.replace(rootUrl + '/', '');
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
var socket,
|
var socket,
|
||||||
config,
|
config,
|
||||||
app = {
|
app = {
|
||||||
'username': null,
|
"username": null,
|
||||||
'uid': null
|
"uid": null,
|
||||||
|
"isFocused": true,
|
||||||
|
"currentRoom": null
|
||||||
};
|
};
|
||||||
|
|
||||||
(function () {
|
(function () {
|
||||||
var showWelcomeMessage = false;
|
var showWelcomeMessage = false;
|
||||||
|
|
||||||
|
|
||||||
app.loadConfig = function() {
|
app.loadConfig = function() {
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: RELATIVE_PATH + '/api/config',
|
url: RELATIVE_PATH + '/api/config',
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
@@ -135,7 +135,7 @@ var socket,
|
|||||||
},
|
},
|
||||||
async: false
|
async: false
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
app.logout = function() {
|
app.logout = function() {
|
||||||
$.post(RELATIVE_PATH + '/logout', {
|
$.post(RELATIVE_PATH + '/logout', {
|
||||||
@@ -143,12 +143,12 @@ var socket,
|
|||||||
}, function() {
|
}, function() {
|
||||||
window.location.href = RELATIVE_PATH + '/';
|
window.location.href = RELATIVE_PATH + '/';
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
// takes a string like 1000 and returns 1,000
|
// takes a string like 1000 and returns 1,000
|
||||||
app.addCommas = function (text) {
|
app.addCommas = function (text) {
|
||||||
return text.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,");
|
return text.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,");
|
||||||
}
|
};
|
||||||
|
|
||||||
// Willingly stolen from: http://phpjs.org/functions/strip_tags/
|
// Willingly stolen from: http://phpjs.org/functions/strip_tags/
|
||||||
app.strip_tags = function (input, allowed) {
|
app.strip_tags = function (input, allowed) {
|
||||||
@@ -159,7 +159,7 @@ var socket,
|
|||||||
return input.replace(commentsAndPhpTags, '').replace(tags, function ($0, $1) {
|
return input.replace(commentsAndPhpTags, '').replace(tags, function ($0, $1) {
|
||||||
return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : '';
|
return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : '';
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
// use unique alert_id to have multiple alerts visible at a time, use the same alert_id to fade out the current instance
|
// use unique alert_id to have multiple alerts visible at a time, use the same alert_id to fade out the current instance
|
||||||
// type : error, success, info, warning/notify
|
// type : error, success, info, warning/notify
|
||||||
@@ -222,7 +222,7 @@ var socket,
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
app.alertSuccess = function (message, timeout) {
|
app.alertSuccess = function (message, timeout) {
|
||||||
if (!timeout)
|
if (!timeout)
|
||||||
@@ -234,7 +234,7 @@ var socket,
|
|||||||
type: 'success',
|
type: 'success',
|
||||||
timeout: timeout
|
timeout: timeout
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
app.alertError = function (message, timeout) {
|
app.alertError = function (message, timeout) {
|
||||||
if (!timeout)
|
if (!timeout)
|
||||||
@@ -246,9 +246,8 @@ var socket,
|
|||||||
type: 'danger',
|
type: 'danger',
|
||||||
timeout: timeout
|
timeout: timeout
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
app.currentRoom = null;
|
|
||||||
app.enterRoom = function (room) {
|
app.enterRoom = function (room) {
|
||||||
if (socket) {
|
if (socket) {
|
||||||
if (app.currentRoom === room) {
|
if (app.currentRoom === room) {
|
||||||
@@ -272,7 +271,7 @@ var socket,
|
|||||||
});
|
});
|
||||||
|
|
||||||
socket.emit('api:user.get_online_users', uids);
|
socket.emit('api:user.get_online_users', uids);
|
||||||
}
|
};
|
||||||
|
|
||||||
function highlightNavigationLink() {
|
function highlightNavigationLink() {
|
||||||
var path = window.location.pathname,
|
var path = window.location.pathname,
|
||||||
@@ -291,7 +290,7 @@ var socket,
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
app.createUserTooltips = function() {
|
app.createUserTooltips = function() {
|
||||||
$('img[title].teaser-pic,img[title].user-img').each(function() {
|
$('img[title].teaser-pic,img[title].user-img').each(function() {
|
||||||
@@ -300,13 +299,13 @@ var socket,
|
|||||||
title: $(this).attr('title')
|
title: $(this).attr('title')
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
app.makeNumbersHumanReadable = function(elements) {
|
app.makeNumbersHumanReadable = function(elements) {
|
||||||
elements.each(function() {
|
elements.each(function() {
|
||||||
$(this).html(utils.makeNumberHumanReadable($(this).attr('title')));
|
$(this).html(utils.makeNumberHumanReadable($(this).attr('title')));
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
app.processPage = function () {
|
app.processPage = function () {
|
||||||
app.populateOnlineUsers();
|
app.populateOnlineUsers();
|
||||||
@@ -323,7 +322,7 @@ var socket,
|
|||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
window.scrollTo(0, 1); // rehide address bar on mobile after page load completes.
|
window.scrollTo(0, 1); // rehide address bar on mobile after page load completes.
|
||||||
}, 100);
|
}, 100);
|
||||||
}
|
};
|
||||||
|
|
||||||
app.showLoginMessage = function () {
|
app.showLoginMessage = function () {
|
||||||
function showAlert() {
|
function showAlert() {
|
||||||
@@ -343,13 +342,13 @@ var socket,
|
|||||||
showAlert();
|
showAlert();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
app.addCommasToNumbers = function () {
|
app.addCommasToNumbers = function () {
|
||||||
$('.formatted-number').each(function (index, element) {
|
$('.formatted-number').each(function (index, element) {
|
||||||
$(element).html(app.addCommas($(element).html()));
|
$(element).html(app.addCommas($(element).html()));
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
app.openChat = function (username, touid) {
|
app.openChat = function (username, touid) {
|
||||||
if (username === app.username) {
|
if (username === app.username) {
|
||||||
@@ -384,7 +383,7 @@ var socket,
|
|||||||
chat.load(chatModal.attr('UUID'));
|
chat.load(chatModal.attr('UUID'));
|
||||||
chat.center(chatModal);
|
chat.center(chatModal);
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
app.scrollToTop = function () {
|
app.scrollToTop = function () {
|
||||||
$('body,html').animate({
|
$('body,html').animate({
|
||||||
@@ -442,6 +441,14 @@ var socket,
|
|||||||
input.val('');
|
input.val('');
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$(window).blur(function(){
|
||||||
|
app.isFocused = false;
|
||||||
|
});
|
||||||
|
|
||||||
|
$(window).focus(function(){
|
||||||
|
app.isFocused = true;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
showWelcomeMessage = location.href.indexOf('loggedin') !== -1;
|
showWelcomeMessage = location.href.indexOf('loggedin') !== -1;
|
||||||
|
|||||||
@@ -84,7 +84,9 @@ define(['forum/accountheader', 'uploader'], function(header, uploader) {
|
|||||||
$('#uploadPictureBtn').on('click', function() {
|
$('#uploadPictureBtn').on('click', function() {
|
||||||
|
|
||||||
$('#change-picture-modal').modal('hide');
|
$('#change-picture-modal').modal('hide');
|
||||||
uploader.open(config.relative_path + '/user/uploadpicture', function(imageUrlOnServer) {
|
uploader.open(RELATIVE_PATH + '/user/uploadpicture', function(imageUrlOnServer) {
|
||||||
|
imageUrlOnServer = imageUrlOnServer + '?' + new Date().getTime();
|
||||||
|
|
||||||
$('#user-current-picture').attr('src', imageUrlOnServer);
|
$('#user-current-picture').attr('src', imageUrlOnServer);
|
||||||
$('#user-uploaded-picture').attr('src', imageUrlOnServer);
|
$('#user-uploaded-picture').attr('src', imageUrlOnServer);
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
define(function() {
|
define(['uploader'], function(uploader) {
|
||||||
var Categories = {};
|
var Categories = {};
|
||||||
|
|
||||||
Categories.init = function() {
|
Categories.init = function() {
|
||||||
@@ -82,7 +82,8 @@ define(function() {
|
|||||||
description: $('#inputDescription').val(),
|
description: $('#inputDescription').val(),
|
||||||
icon: $('#new-category-modal i').val(),
|
icon: $('#new-category-modal i').val(),
|
||||||
bgColor: '#0059b2',
|
bgColor: '#0059b2',
|
||||||
color: '#fff'
|
color: '#fff',
|
||||||
|
order: $('.admin-categories #entry-container').children().length + 1
|
||||||
};
|
};
|
||||||
|
|
||||||
socket.emit('api:admin.categories.create', category, function(err, data) {
|
socket.emit('api:admin.categories.create', category, function(err, data) {
|
||||||
@@ -147,7 +148,6 @@ define(function() {
|
|||||||
var btn = $(this);
|
var btn = $(this);
|
||||||
var categoryRow = btn.parents('li');
|
var categoryRow = btn.parents('li');
|
||||||
var cid = categoryRow.attr('data-cid');
|
var cid = categoryRow.attr('data-cid');
|
||||||
console.log(this.getAttribute('data-disabled'));
|
|
||||||
|
|
||||||
var disabled = this.getAttribute('data-disabled') === '0' ? '1' : '0';
|
var disabled = this.getAttribute('data-disabled') === '0' ? '1' : '0';
|
||||||
categoryRow.remove();
|
categoryRow.remove();
|
||||||
@@ -179,6 +179,31 @@ define(function() {
|
|||||||
var cid = $(this).parents('li[data-cid]').attr('data-cid');
|
var cid = $(this).parents('li[data-cid]').attr('data-cid');
|
||||||
Categories.launchPermissionsModal(cid);
|
Categories.launchPermissionsModal(cid);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$('.upload-button').on('click', function() {
|
||||||
|
var inputEl = this;
|
||||||
|
|
||||||
|
uploader.open(RELATIVE_PATH + '/admin/category/uploadpicture', function(imageUrlOnServer) {
|
||||||
|
inputEl.value = imageUrlOnServer;
|
||||||
|
$(inputEl).parents('li[data-cid]').find('.preview-box').css('background', 'url(' + imageUrlOnServer + '?' + new Date().getTime() + ')');
|
||||||
|
modified(inputEl);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.admin-categories').delegate('.delete-image', 'click', function() {
|
||||||
|
var parent = $(this).parents('li[data-cid]'),
|
||||||
|
inputEl = parent.find('.upload-button'),
|
||||||
|
preview = parent.find('.preview-box'),
|
||||||
|
bgColor = parent.find('.category_bgColor').val();
|
||||||
|
|
||||||
|
inputEl.value = '';
|
||||||
|
modified(inputEl);
|
||||||
|
|
||||||
|
preview.css('background', bgColor);
|
||||||
|
|
||||||
|
$(this).hide();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ define(['uploader'], function(uploader) {
|
|||||||
|
|
||||||
$('#uploadLogoBtn').on('click', function() {
|
$('#uploadLogoBtn').on('click', function() {
|
||||||
|
|
||||||
uploader.open(config.relative_path + '/admin/uploadlogo', function(image) {
|
uploader.open(RELATIVE_PATH + '/admin/uploadlogo', function(image) {
|
||||||
$('#logoUrl').val(image);
|
$('#logoUrl').val(image);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -83,8 +83,10 @@ define(function () {
|
|||||||
Category.onNewTopic = function(data) {
|
Category.onNewTopic = function(data) {
|
||||||
var html = templates.prepare(templates['category'].blocks['topics']).parse({
|
var html = templates.prepare(templates['category'].blocks['topics']).parse({
|
||||||
topics: [data]
|
topics: [data]
|
||||||
}),
|
});
|
||||||
topic = $(html),
|
|
||||||
|
translator.translate(html, function(translatedHTML) {
|
||||||
|
var topic = $(translatedHTML),
|
||||||
container = $('#topics-container'),
|
container = $('#topics-container'),
|
||||||
topics = $('#topics-container').children('.category-item'),
|
topics = $('#topics-container').children('.category-item'),
|
||||||
numTopics = topics.length;
|
numTopics = topics.length;
|
||||||
@@ -113,6 +115,7 @@ define(function () {
|
|||||||
addActiveUser(data);
|
addActiveUser(data);
|
||||||
|
|
||||||
$('#topics-container span.timeago').timeago();
|
$('#topics-container span.timeago').timeago();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function addActiveUser(data) {
|
function addActiveUser(data) {
|
||||||
@@ -131,20 +134,22 @@ define(function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Category.onTopicsLoaded = function(topics) {
|
Category.onTopicsLoaded = function(topics) {
|
||||||
|
|
||||||
var html = templates.prepare(templates['category'].blocks['topics']).parse({
|
var html = templates.prepare(templates['category'].blocks['topics']).parse({
|
||||||
topics: topics
|
topics: topics
|
||||||
}),
|
});
|
||||||
container = $('#topics-container');
|
|
||||||
|
translator.translate(html, function(translatedHTML) {
|
||||||
|
var container = $('#topics-container');
|
||||||
|
|
||||||
jQuery('#topics-container, .category-sidebar').removeClass('hidden');
|
jQuery('#topics-container, .category-sidebar').removeClass('hidden');
|
||||||
jQuery('#category-no-topics').remove();
|
jQuery('#category-no-topics').remove();
|
||||||
|
|
||||||
html = $(html);
|
html = $(translatedHTML);
|
||||||
container.append(html);
|
container.append(html);
|
||||||
|
|
||||||
$('#topics-container span.timeago').timeago();
|
$('#topics-container span.timeago').timeago();
|
||||||
app.makeNumbersHumanReadable(html.find('.human-readable-number'));
|
app.makeNumbersHumanReadable(html.find('.human-readable-number'));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Category.loadMoreTopics = function(cid) {
|
Category.loadMoreTopics = function(cid) {
|
||||||
|
|||||||
@@ -67,6 +67,7 @@
|
|||||||
notifTrigger = notifContainer.querySelector('a'),
|
notifTrigger = notifContainer.querySelector('a'),
|
||||||
notifList = document.getElementById('notif-list'),
|
notifList = document.getElementById('notif-list'),
|
||||||
notifIcon = $('.notifications a');
|
notifIcon = $('.notifications a');
|
||||||
|
|
||||||
notifTrigger.addEventListener('click', function(e) {
|
notifTrigger.addEventListener('click', function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (notifContainer.className.indexOf('open') === -1) {
|
if (notifContainer.className.indexOf('open') === -1) {
|
||||||
@@ -169,6 +170,10 @@
|
|||||||
});
|
});
|
||||||
app.refreshTitle();
|
app.refreshTitle();
|
||||||
|
|
||||||
|
if (ajaxify.currentPage === 'notifications') {
|
||||||
|
ajaxify.refresh();
|
||||||
|
}
|
||||||
|
|
||||||
// Update the favicon + local storage
|
// Update the favicon + local storage
|
||||||
var savedCount = parseInt(localStorage.getItem('notifications:count'),10) || 0;
|
var savedCount = parseInt(localStorage.getItem('notifications:count'),10) || 0;
|
||||||
localStorage.setItem('notifications:count', savedCount+1);
|
localStorage.setItem('notifications:count', savedCount+1);
|
||||||
@@ -208,7 +213,7 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on('chatMessage', function(data) {
|
socket.on('event:chats.receive', function(data) {
|
||||||
require(['chat'], function(chat) {
|
require(['chat'], function(chat) {
|
||||||
var modal = null;
|
var modal = null;
|
||||||
if (chat.modalExists(data.fromuid)) {
|
if (chat.modalExists(data.fromuid)) {
|
||||||
@@ -219,6 +224,9 @@
|
|||||||
chat.load(modal.attr('UUID'));
|
chat.load(modal.attr('UUID'));
|
||||||
} else {
|
} else {
|
||||||
chat.toggleNew(modal.attr('UUID'), true);
|
chat.toggleNew(modal.attr('UUID'), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!modal.is(":visible") || !app.isFocused) {
|
||||||
app.alternatingTitle(data.username + ' has messaged you');
|
app.alternatingTitle(data.username + ' has messaged you');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -81,11 +81,12 @@ define(function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Recent.onTopicsLoaded = function(topics) {
|
Recent.onTopicsLoaded = function(topics) {
|
||||||
|
|
||||||
var html = templates.prepare(templates['recent'].blocks['topics']).parse({
|
var html = templates.prepare(templates['recent'].blocks['topics']).parse({
|
||||||
topics: topics
|
topics: topics
|
||||||
}),
|
});
|
||||||
container = $('#topics-container');
|
|
||||||
|
translator.translate(html, function(translatedHTML) {
|
||||||
|
var container = $('#topics-container');
|
||||||
|
|
||||||
$('#category-no-topics').remove();
|
$('#category-no-topics').remove();
|
||||||
|
|
||||||
@@ -93,6 +94,7 @@ define(function() {
|
|||||||
container.append(html);
|
container.append(html);
|
||||||
$('span.timeago').timeago();
|
$('span.timeago').timeago();
|
||||||
app.makeNumbersHumanReadable(html.find('.human-readable-number'));
|
app.makeNumbersHumanReadable(html.find('.human-readable-number'));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Recent.loadMoreTopics = function() {
|
Recent.loadMoreTopics = function() {
|
||||||
|
|||||||
@@ -803,7 +803,7 @@ define(function() {
|
|||||||
pagination.parentNode.style.display = 'block';
|
pagination.parentNode.style.display = 'block';
|
||||||
progressBarContainer.css('display', '');
|
progressBarContainer.css('display', '');
|
||||||
|
|
||||||
if (scrollTop < 50 && Topic.postCount > 1) {
|
if (scrollTop < jQuery('.posts > .post-row:first-child').height() && Topic.postCount > 1) {
|
||||||
localStorage.removeItem("topic:" + tid + ":bookmark");
|
localStorage.removeItem("topic:" + tid + ":bookmark");
|
||||||
pagination.innerHTML = '1 out of ' + Topic.postCount;
|
pagination.innerHTML = '1 out of ' + Topic.postCount;
|
||||||
progressBar.width(0);
|
progressBar.width(0);
|
||||||
|
|||||||
@@ -71,18 +71,20 @@ define(function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function onTopicsLoaded(topics) {
|
function onTopicsLoaded(topics) {
|
||||||
|
|
||||||
var html = templates.prepare(templates['unread'].blocks['topics']).parse({
|
var html = templates.prepare(templates['unread'].blocks['topics']).parse({
|
||||||
topics: topics
|
topics: topics
|
||||||
}),
|
});
|
||||||
container = $('#topics-container');
|
|
||||||
|
translator.translate(html, function(translatedHTML) {
|
||||||
|
var container = $('#topics-container');
|
||||||
|
|
||||||
$('#category-no-topics').remove();
|
$('#category-no-topics').remove();
|
||||||
|
|
||||||
html = $(html);
|
html = $(translatedHTML);
|
||||||
container.append(html);
|
container.append(html);
|
||||||
$('span.timeago').timeago();
|
$('span.timeago').timeago();
|
||||||
app.makeNumbersHumanReadable(html.find('.human-readable-number'));
|
app.makeNumbersHumanReadable(html.find('.human-readable-number'));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadMoreTopics() {
|
function loadMoreTopics() {
|
||||||
|
|||||||
@@ -103,6 +103,7 @@ define(['taskbar'], function(taskbar) {
|
|||||||
module.bringModalToTop(chatModal);
|
module.bringModalToTop(chatModal);
|
||||||
checkOnlineStatus(chatModal);
|
checkOnlineStatus(chatModal);
|
||||||
taskbar.updateActive(uuid);
|
taskbar.updateActive(uuid);
|
||||||
|
chatModal.find('#chat-message-input').focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
module.minimize = function(uuid) {
|
module.minimize = function(uuid) {
|
||||||
@@ -114,7 +115,7 @@ define(['taskbar'], function(taskbar) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getChatMessages(chatModal, callback) {
|
function getChatMessages(chatModal, callback) {
|
||||||
socket.emit('getChatMessages', {touid:chatModal.touid}, function(messages) {
|
socket.emit('api:chats.get', {touid:chatModal.touid}, function(messages) {
|
||||||
for(var i = 0; i<messages.length; ++i) {
|
for(var i = 0; i<messages.length; ++i) {
|
||||||
module.appendChatMessage(chatModal, messages[i].content, messages[i].timestamp);
|
module.appendChatMessage(chatModal, messages[i].content, messages[i].timestamp);
|
||||||
}
|
}
|
||||||
@@ -141,7 +142,7 @@ define(['taskbar'], function(taskbar) {
|
|||||||
var msg = app.strip_tags(chatModal.find('#chat-message-input').val());
|
var msg = app.strip_tags(chatModal.find('#chat-message-input').val());
|
||||||
if(msg.length) {
|
if(msg.length) {
|
||||||
msg = msg +'\n';
|
msg = msg +'\n';
|
||||||
socket.emit('sendChatMessage', { touid:chatModal.touid, message:msg});
|
socket.emit('api:chats.send', { touid:chatModal.touid, message:msg});
|
||||||
chatModal.find('#chat-message-input').val('');
|
chatModal.find('#chat-message-input').val('');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -300,14 +300,7 @@
|
|||||||
namespace = namespace.replace(d + '.', '');
|
namespace = namespace.replace(d + '.', '');
|
||||||
template = setBlock(regex, result, template);
|
template = setBlock(regex, result, template);
|
||||||
} else if (data[d] instanceof Object) {
|
} else if (data[d] instanceof Object) {
|
||||||
namespace += d + '.';
|
template = parse(data[d], d + '.', template);
|
||||||
|
|
||||||
regex = makeRegex(d),
|
|
||||||
block = getBlock(regex, namespace, template)
|
|
||||||
if (block == null) continue;
|
|
||||||
|
|
||||||
block = parse(data[d], namespace, block);
|
|
||||||
template = setBlock(regex, block, template);
|
|
||||||
} else {
|
} else {
|
||||||
function checkConditional(key, value) {
|
function checkConditional(key, value) {
|
||||||
var conditional = makeConditionalRegex(key),
|
var conditional = makeConditionalRegex(key),
|
||||||
@@ -320,14 +313,16 @@
|
|||||||
if (conditionalBlock[1]) {
|
if (conditionalBlock[1]) {
|
||||||
// there is an else statement
|
// there is an else statement
|
||||||
if (!value) {
|
if (!value) {
|
||||||
template = template.replace(matches[i], conditionalBlock[1]);
|
template = template.replace(matches[i], conditionalBlock[1].replace(/<!-- ((\IF\b)|(\bENDIF\b))([^@]*?)-->/gi, ''));
|
||||||
} else {
|
} else {
|
||||||
template = template.replace(matches[i], conditionalBlock[0]);
|
template = template.replace(matches[i], conditionalBlock[0].replace(/<!-- ((\IF\b)|(\bENDIF\b))([^@]*?)-->/gi, ''));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// regular if statement
|
// regular if statement
|
||||||
if (!value) {
|
if (!value) {
|
||||||
template = template.replace(matches[i], '');
|
template = template.replace(matches[i], '');
|
||||||
|
} else {
|
||||||
|
template = template.replace(matches[i], matches[i].replace(/<!-- ((\IF\b)|(\bENDIF\b))([^@]*?)-->/gi, ''));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -350,8 +345,12 @@
|
|||||||
if (namespace) {
|
if (namespace) {
|
||||||
var regex = new RegExp("{" + namespace + "[\\s\\S]*?}", 'g');
|
var regex = new RegExp("{" + namespace + "[\\s\\S]*?}", 'g');
|
||||||
template = template.replace(regex, '');
|
template = template.replace(regex, '');
|
||||||
|
namespace = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// clean up all undefined conditionals
|
||||||
|
template = template.replace(/<!-- IF([^@]*?)ENDIF([^@]*?)-->/gi, '');
|
||||||
|
|
||||||
return template;
|
return template;
|
||||||
|
|
||||||
})(data, "", template);
|
})(data, "", template);
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
<span class="timeago" title="{joindate}"></span>
|
<span class="timeago" title="{joindate}"></span>
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
<span class="account-bio-label">[[user:profil_views]]</span>
|
<span class="account-bio-label">[[user:profile_views]]</span>
|
||||||
<span class="formatted-number">{profileviews}</span>
|
<span class="formatted-number">{profileviews}</span>
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
|
|||||||
@@ -10,17 +10,17 @@
|
|||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div id="gravatar-box">
|
<div id="gravatar-box">
|
||||||
<img id="user-gravatar-picture" src="" class="img-thumbnail user-profile-picture">
|
<img id="user-gravatar-picture" src="" class="img-thumbnail user-profile-picture">
|
||||||
<span class="user-picture-label">[[user: gravatar]]</span>
|
<span class="user-picture-label">[[user:gravatar]]</span>
|
||||||
<i class='fa fa-check fa-2x'></i>
|
<i class='fa fa-check fa-2x'></i>
|
||||||
</div>
|
</div>
|
||||||
<br/>
|
<br/>
|
||||||
<div id="uploaded-box">
|
<div id="uploaded-box">
|
||||||
<img id="user-uploaded-picture" src="" class="img-thumbnail user-profile-picture">
|
<img id="user-uploaded-picture" src="" class="img-thumbnail user-profile-picture">
|
||||||
<span class="user-picture-label">[[user: uploaded_picture]]</span>
|
<span class="user-picture-label">[[user:uploaded_picture]]</span>
|
||||||
<i class='fa fa-check fa-2x'></i>
|
<i class='fa fa-check fa-2x'></i>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<a id="uploadPictureBtn" href="#">[[user: upload_new_picture]]</a>
|
<a id="uploadPictureBtn" href="#">[[user:upload_new_picture]]</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
|
<button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
<h4>privacy</h4>
|
<h4>privacy</h4>
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
<label>
|
<label>
|
||||||
<input id="showemailCheckBox" type="checkbox" {showemail}> [[user:show_my_email]]
|
<input id="showemailCheckBox" type="checkbox" {showemail}> [[user:show_email]]
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -14,12 +14,15 @@
|
|||||||
<!-- BEGIN categories -->
|
<!-- BEGIN categories -->
|
||||||
<li data-cid="{categories.cid}" class="entry-row">
|
<li data-cid="{categories.cid}" class="entry-row">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-2 hidden-xs">
|
<div class="col-sm-2 hidden-xs text-center">
|
||||||
<div class="preview-box" style="background: {categories.bgColor}; color: {categories.color};">
|
<div class="preview-box" style="background: {categories.background}; color: {categories.color};">
|
||||||
<div class="icon">
|
<div class="icon">
|
||||||
<i data-name="icon" value="{categories.icon}" class="fa {categories.icon} fa-2x"></i>
|
<i data-name="icon" value="{categories.icon}" class="fa {categories.icon} fa-2x"></i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div><br />
|
||||||
|
<!-- IF categories.image -->
|
||||||
|
<small class="pointer delete-image"><i data-name="icon" value="fa-times" class="fa fa-times"></i> Delete Image</small>
|
||||||
|
<!-- ENDIF categories.image -->
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<form class="form">
|
<form class="form">
|
||||||
@@ -67,11 +70,8 @@
|
|||||||
<hr />
|
<hr />
|
||||||
<li data-disabled="{categories.disabled}"><a href="#"></a></li>
|
<li data-disabled="{categories.disabled}"><a href="#"></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<button type="button" data-name="image" data-value="{categories.image}" class="btn btn-default upload-button"><i class="fa fa-upload"></i> Image</button>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="btn-group">
|
|
||||||
<button type="submit" class="btn btn-default disable-btn" data-disabled="{categories.disabled}">Disable</button>
|
|
||||||
<button type="button" class="btn btn-default permissions">Permissions</button>
|
|
||||||
</div> -->
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -80,17 +80,7 @@
|
|||||||
<input type="hidden" data-name="order" data-value="{categories.order}"></input>
|
<input type="hidden" data-name="order" data-value="{categories.order}"></input>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<!-- <form class="form-inline">
|
|
||||||
<div class="icon">
|
|
||||||
<i data-name="icon" value="{categories.icon}" class="fa {categories.icon} fa-2x"></i>
|
|
||||||
</div>
|
</div>
|
||||||
<input placeholder="Category Name" data-name="name" value="{categories.name}" class="form-control category_name"></input>
|
|
||||||
<input placeholder="#0059b2" data-name="bgColor" value="{categories.bgColor}" class="form-control category_bgColor" />
|
|
||||||
<input placeholder="#fff" data-name="color" value="{categories.color}" class="form-control category_color" />
|
|
||||||
<input data-name="description" placeholder="Category Description" value="{categories.description}" class="form-control category_description description"></input>
|
|
||||||
<input type="hidden" data-name="order" data-value="{categories.order}"></input>
|
|
||||||
<button type="submit" class="btn btn-default disable-btn" data-disabled="{categories.disabled}">Disable</button>
|
|
||||||
</form> -->
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<!-- END categories -->
|
<!-- END categories -->
|
||||||
|
|||||||
@@ -26,6 +26,11 @@
|
|||||||
<p>Use <strong>privilege thresholds</strong> to manage how much reputation a user must gain to receive moderator access.</p><br />
|
<p>Use <strong>privilege thresholds</strong> to manage how much reputation a user must gain to receive moderator access.</p><br />
|
||||||
<strong>Manage Thread</strong><br /> <input type="text" class="form-control" value="1000" data-field="privileges:manage_topic"><br />
|
<strong>Manage Thread</strong><br /> <input type="text" class="form-control" value="1000" data-field="privileges:manage_topic"><br />
|
||||||
<strong>Manage Content</strong><br /> <input type="text" class="form-control" value="1000" data-field="privileges:manage_content"><br />
|
<strong>Manage Content</strong><br /> <input type="text" class="form-control" value="1000" data-field="privileges:manage_content"><br />
|
||||||
|
<div class="checkbox">
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" data-field="privileges:disabled"> <strong>Disable Privilege Threshold System</strong>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
@@ -55,6 +60,17 @@
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
<form>
|
||||||
|
<h3>Profile Settings</h3>
|
||||||
|
<div class="alert alert-warning">
|
||||||
|
<div class="checkbox">
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" data-field="profile:convertProfileImageToPNG"> <strong>Convert profile image uploads to PNG</strong>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
<form>
|
<form>
|
||||||
<h3>User Settings</h3>
|
<h3>User Settings</h3>
|
||||||
<div class="alert alert-warning">
|
<div class="alert alert-warning">
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
<div id="alert_window"></div>
|
<div id="alert_window"></div>
|
||||||
|
|
||||||
|
|
||||||
<footer id="footer" class="container footer">
|
<footer id="footer" class="container footer hide">
|
||||||
{footerHTML}
|
{footerHTML}
|
||||||
<div class="copyright">
|
<div class="copyright">
|
||||||
Copyright © 2013 <a target="_blank" href="http://www.nodebb.com">NodeBB Forums</a> | <a target="_blank" href="//github.com/designcreateplay/NodeBB/graphs/contributors">Contributors</a>
|
Copyright © 2013 <a target="_blank" href="http://www.nodebb.com">NodeBB Forums</a> | <a target="_blank" href="//github.com/designcreateplay/NodeBB/graphs/contributors">Contributors</a>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<a href="category/{categories.slug}" itemprop="url">
|
<a href="category/{categories.slug}" itemprop="url">
|
||||||
<meta itemprop="name" content="{categories.name}">
|
<meta itemprop="name" content="{categories.name}">
|
||||||
<h4><span class="badge {categories.badgeclass}">{categories.topic_count} </span> {categories.name}</h4>
|
<h4><span class="badge {categories.badgeclass}">{categories.topic_count} </span> {categories.name}</h4>
|
||||||
<div class="icon" style="background: {categories.bgColor}; color: {categories.color};">
|
<div class="icon" style="background: {categories.background}; color: {categories.color};">
|
||||||
<div id="category-{categories.cid}" class="category-slider-{categories.post_count}">
|
<div id="category-{categories.cid}" class="category-slider-{categories.post_count}">
|
||||||
<div class="category-box"><i class="fa {categories.icon} fa-4x"></i></div>
|
<div class="category-box"><i class="fa {categories.icon} fa-4x"></i></div>
|
||||||
<div class="category-box" itemprop="description">{categories.description}</div>
|
<div class="category-box" itemprop="description">{categories.description}</div>
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
<input type="hidden" template-variable="facebook-share-url" value="{facebook-share-url}" />
|
<input type="hidden" template-variable="facebook-share-url" value="{facebook-share-url}" />
|
||||||
<input type="hidden" template-variable="google-share-url" value="{google-share-url}" />
|
<input type="hidden" template-variable="google-share-url" value="{google-share-url}" />
|
||||||
|
|
||||||
<div class="container">
|
|
||||||
<div class="topic row">
|
<div class="topic">
|
||||||
<ol class="breadcrumb">
|
<ol class="breadcrumb">
|
||||||
<li itemscope="itemscope" itemtype="http://data-vocabulary.org/Breadcrumb">
|
<li itemscope="itemscope" itemtype="http://data-vocabulary.org/Breadcrumb">
|
||||||
<a href="/" itemprop="url"><span itemprop="title">[[global:home]]</span></a>
|
<a href="/" itemprop="url"><span itemprop="title">[[global:home]]</span></a>
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
<ul id="post-container" class="container posts" data-tid="{topic_id}">
|
<ul id="post-container" class="posts" data-tid="{topic_id}">
|
||||||
<!-- BEGIN posts -->
|
<!-- BEGIN posts -->
|
||||||
<li class="row post-row infiniteloaded" data-pid="{posts.pid}" data-uid="{posts.uid}" data-username="{posts.username}" data-index="{posts.index}" data-deleted="{posts.deleted}" itemscope itemtype="http://schema.org/Comment">
|
<li class="row post-row infiniteloaded" data-pid="{posts.pid}" data-uid="{posts.uid}" data-username="{posts.username}" data-index="{posts.index}" data-deleted="{posts.deleted}" itemscope itemtype="http://schema.org/Comment">
|
||||||
<a id="post_anchor_{posts.pid}" name="{posts.pid}"></a>
|
<a id="post_anchor_{posts.pid}" name="{posts.pid}"></a>
|
||||||
@@ -39,6 +39,7 @@
|
|||||||
<span class="label label-danger">[[topic:banned]]</span>
|
<span class="label label-danger">[[topic:banned]]</span>
|
||||||
<!-- ENDIF posts.user_banned -->
|
<!-- ENDIF posts.user_banned -->
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-11">
|
<div class="col-md-11">
|
||||||
@@ -108,6 +109,7 @@
|
|||||||
|
|
||||||
<div class="post-info">
|
<div class="post-info">
|
||||||
<span class="pull-left">
|
<span class="pull-left">
|
||||||
|
[[topic:reputation]]: <i class='fa fa-star'></i> <span class='formatted-number'>{posts.user_rep}</span> | [[topic:posts]]: <i class='fa fa-pencil'></i> <span class='formatted-number'>{posts.user_postcount}</span>
|
||||||
{posts.additional_profile_info}
|
{posts.additional_profile_info}
|
||||||
</span>
|
</span>
|
||||||
<span class="pull-right">
|
<span class="pull-right">
|
||||||
@@ -158,7 +160,7 @@
|
|||||||
<div class="well col-md-11 col-xs-12 pull-right hide">
|
<div class="well col-md-11 col-xs-12 pull-right hide">
|
||||||
<div class="topic-main-buttons pull-right inline-block hide">
|
<div class="topic-main-buttons pull-right inline-block hide">
|
||||||
<div class="loading-indicator" done="0" style="display:none;">
|
<div class="loading-indicator" done="0" style="display:none;">
|
||||||
[[topic:loading]] <span class="hidden-xs" style="display:inline!important;">[[topic:more_posts]]</span> <i class="fa fa-refresh fa-spin"></i>
|
[[topic:loading]] <span class="hidden-xs hidden-sm" style="display:inline!important;">[[topic:more_posts]]</span> <i class="fa fa-refresh fa-spin"></i>
|
||||||
</div>
|
</div>
|
||||||
<button class="btn btn-primary post_reply" type="button">[[topic:reply]]</button>
|
<button class="btn btn-primary post_reply" type="button">[[topic:reply]]</button>
|
||||||
<div class="btn-group thread-tools hide">
|
<div class="btn-group thread-tools hide">
|
||||||
@@ -202,5 +204,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
@@ -229,7 +229,7 @@ var db = require('./database.js'),
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
posts.getPostSummaryByPids(pids, function(err, postData) {
|
posts.getPostSummaryByPids(pids, true, function(err, postData) {
|
||||||
if (postData.length > count) {
|
if (postData.length > count) {
|
||||||
postData = postData.slice(0, count);
|
postData = postData.slice(0, count);
|
||||||
}
|
}
|
||||||
@@ -288,7 +288,10 @@ var db = require('./database.js'),
|
|||||||
Categories.getCategoryData = function(cid, callback) {
|
Categories.getCategoryData = function(cid, callback) {
|
||||||
db.exists('category:' + cid, function(err, exists) {
|
db.exists('category:' + cid, function(err, exists) {
|
||||||
if (exists) {
|
if (exists) {
|
||||||
db.getObject('category:' + cid, callback);
|
db.getObject('category:' + cid, function(err, data) {
|
||||||
|
data.background = data.image ? 'url(' + data.image + ')' : data.bgColor;
|
||||||
|
callback(err, data);
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
callback(new Error('No category found!'));
|
callback(new Error('No category found!'));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(collection) {
|
if(collection) {
|
||||||
collection.ensureIndex({_key :1, setName:1}, {background:true}, function(err, name){
|
collection.ensureIndex({_key :1}, {background:true}, function(err, name){
|
||||||
if(err) {
|
if(err) {
|
||||||
winston.error("Error creating index " + err.message);
|
winston.error("Error creating index " + err.message);
|
||||||
}
|
}
|
||||||
@@ -73,6 +73,39 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// helper functions
|
||||||
|
//
|
||||||
|
function removeHiddenFields(item) {
|
||||||
|
if(item) {
|
||||||
|
if(item._id) {
|
||||||
|
delete item._id;
|
||||||
|
}
|
||||||
|
if(item._key) {
|
||||||
|
delete item._key;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
|
||||||
|
function findItem(data, key) {
|
||||||
|
if(!data) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
for(var i=0; i<data.length; ++i) {
|
||||||
|
if(data[i]._key === key) {
|
||||||
|
var item = data.splice(i, 1);
|
||||||
|
if(item && item.length) {
|
||||||
|
return item[0];
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Exported functions
|
// Exported functions
|
||||||
@@ -155,8 +188,7 @@
|
|||||||
stats.raw = JSON.stringify(stats, null, 4);
|
stats.raw = JSON.stringify(stats, null, 4);
|
||||||
|
|
||||||
stats.mongo = true;
|
stats.mongo = true;
|
||||||
//remove this when andrew adds in undefined checking to templates
|
|
||||||
stats.redis = false;
|
|
||||||
callback(err, stats);
|
callback(err, stats);
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -165,7 +197,7 @@
|
|||||||
// key
|
// key
|
||||||
|
|
||||||
module.exists = function(key, callback) {
|
module.exists = function(key, callback) {
|
||||||
db.collection('objects').findOne({$or:[{_key:key}, {setName:key}]}, function(err, item) {
|
db.collection('objects').findOne({_key:key}, function(err, item) {
|
||||||
callback(err, item !== undefined && item !== null);
|
callback(err, item !== undefined && item !== null);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -180,17 +212,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(result === 0) {
|
|
||||||
db.collection('objects').remove({setName:key}, function(err, result) {
|
|
||||||
if(callback) {
|
|
||||||
callback(err, result);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
if(callback) {
|
if(callback) {
|
||||||
callback(null, result);
|
callback(null, result);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -210,21 +234,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
//hashes
|
//hashes
|
||||||
function removeHiddenFields(item) {
|
|
||||||
if(item) {
|
|
||||||
if(item._id) {
|
|
||||||
delete item._id;
|
|
||||||
}
|
|
||||||
if(item._key) {
|
|
||||||
delete item._key;
|
|
||||||
}
|
|
||||||
if(item.setName) {
|
|
||||||
delete item.setName;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return item;
|
|
||||||
}
|
|
||||||
|
|
||||||
module.setObject = function(key, data, callback) {
|
module.setObject = function(key, data, callback) {
|
||||||
data['_key'] = key;
|
data['_key'] = key;
|
||||||
db.collection('objects').update({_key:key}, {$set:data}, {upsert:true, w: 1}, function(err, result) {
|
db.collection('objects').update({_key:key}, {$set:data}, {upsert:true, w: 1}, function(err, result) {
|
||||||
@@ -262,30 +271,10 @@
|
|||||||
return callback(err);
|
return callback(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
var returnData = [],
|
var returnData = [];
|
||||||
resultIndex = 0;
|
|
||||||
|
|
||||||
|
|
||||||
function findData(key) {
|
|
||||||
if(!data) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
for(var i=0; i<data.length; ++i) {
|
|
||||||
if(data[i]._key === key) {
|
|
||||||
var item = data.splice(i, 1);
|
|
||||||
if(item && item.length) {
|
|
||||||
return item[0];
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
for(var i=0; i<keys.length; ++i) {
|
for(var i=0; i<keys.length; ++i) {
|
||||||
returnData.push(findData(keys[i]));
|
returnData.push(findItem(data, keys[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
callback(err, returnData);
|
callback(err, returnData);
|
||||||
@@ -505,15 +494,18 @@
|
|||||||
value:value
|
value:value
|
||||||
};
|
};
|
||||||
|
|
||||||
data.setName = key;
|
db.collection('objects').update({_key:key, value:value}, {$set:data}, {upsert:true, w: 1}, function(err, result) {
|
||||||
module.setObject(key + ':' + value, data, callback);
|
if(callback) {
|
||||||
|
callback(err, result);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
module.sortedSetRemove = function(key, value, callback) {
|
module.sortedSetRemove = function(key, value, callback) {
|
||||||
if(value !== null && value !== undefined) {
|
if(value !== null && value !== undefined) {
|
||||||
value = value.toString();
|
value = value.toString();
|
||||||
}
|
}
|
||||||
db.collection('objects').remove({setName:key, value:value}, function(err, result) {
|
db.collection('objects').remove({_key:key, value:value}, function(err, result) {
|
||||||
if(callback) {
|
if(callback) {
|
||||||
callback(err, result);
|
callback(err, result);
|
||||||
}
|
}
|
||||||
@@ -521,7 +513,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getSortedSetRange(key, start, stop, sort, callback) {
|
function getSortedSetRange(key, start, stop, sort, callback) {
|
||||||
db.collection('objects').find({setName:key}, {fields:{value:1}})
|
db.collection('objects').find({_key:key}, {fields:{value:1}})
|
||||||
.limit(stop - start + 1)
|
.limit(stop - start + 1)
|
||||||
.skip(start)
|
.skip(start)
|
||||||
.sort({score: sort})
|
.sort({score: sort})
|
||||||
@@ -557,7 +549,7 @@
|
|||||||
stop = args[5];
|
stop = args[5];
|
||||||
|
|
||||||
|
|
||||||
db.collection('objects').find({setName:key, score: {$gt:min, $lt:max}}, {fields:{value:1}})
|
db.collection('objects').find({_key:key, score: {$gte:min, $lte:max}}, {fields:{value:1}})
|
||||||
.limit(stop - start + 1)
|
.limit(stop - start + 1)
|
||||||
.skip(start)
|
.skip(start)
|
||||||
.sort({score: -1})
|
.sort({score: -1})
|
||||||
@@ -576,7 +568,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
module.sortedSetCount = function(key, min, max, callback) {
|
module.sortedSetCount = function(key, min, max, callback) {
|
||||||
db.collection('objects').count({setName:key, score: {$gt:min, $lt:max}}, function(err, count) {
|
db.collection('objects').count({_key:key, score: {$gte:min, $lte:max}}, function(err, count) {
|
||||||
if(err) {
|
if(err) {
|
||||||
return callback(err);
|
return callback(err);
|
||||||
}
|
}
|
||||||
@@ -609,7 +601,7 @@
|
|||||||
if(value !== null && value !== undefined) {
|
if(value !== null && value !== undefined) {
|
||||||
value = value.toString();
|
value = value.toString();
|
||||||
}
|
}
|
||||||
db.collection('objects').findOne({setName:key, value: value}, {fields:{score:1}}, function(err, result) {
|
db.collection('objects').findOne({_key:key, value: value}, {fields:{score:1}}, function(err, result) {
|
||||||
if(err) {
|
if(err) {
|
||||||
return callback(err);
|
return callback(err);
|
||||||
}
|
}
|
||||||
@@ -625,22 +617,17 @@
|
|||||||
if(value !== null && value !== undefined) {
|
if(value !== null && value !== undefined) {
|
||||||
value = value.toString();
|
value = value.toString();
|
||||||
}
|
}
|
||||||
db.collection('objects').find({setName:{$in:keys}, value: value}).toArray(function(err, result) {
|
db.collection('objects').find({_key:{$in:keys}, value: value}).toArray(function(err, result) {
|
||||||
if(err) {
|
if(err) {
|
||||||
return callback(err);
|
return callback(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
var returnData = [],
|
var returnData = [],
|
||||||
resultIndex = 0;
|
item;
|
||||||
|
|
||||||
for(var i=0; i<keys.length; ++i) {
|
for(var i=0; i<keys.length; ++i) {
|
||||||
|
item = findItem(result, keys[i]);
|
||||||
if(result && resultIndex < result.length && keys[i] === result[resultIndex].setName) {
|
returnData.push(item ? item.score : null);
|
||||||
returnData.push(result[resultIndex].score);
|
|
||||||
++resultIndex;
|
|
||||||
} else {
|
|
||||||
returnData.push(null);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
callback(null, returnData);
|
callback(null, returnData);
|
||||||
|
|||||||
@@ -168,8 +168,6 @@
|
|||||||
}
|
}
|
||||||
redisData.raw = JSON.stringify(redisData, null, 4);
|
redisData.raw = JSON.stringify(redisData, null, 4);
|
||||||
redisData.redis = true;
|
redisData.redis = true;
|
||||||
//remove this when andrew adds in undefined checking to templates
|
|
||||||
redisData.mongo = false;
|
|
||||||
|
|
||||||
callback(null, redisData);
|
callback(null, redisData);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -104,12 +104,12 @@ var async = require('async'),
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
function (next) {
|
function (next) {
|
||||||
var success = function(err, config) {
|
var success = function (err, config) {
|
||||||
if (!config) {
|
if (!config) {
|
||||||
return next(new Error('aborted'));
|
return next(new Error('aborted'));
|
||||||
}
|
}
|
||||||
|
|
||||||
function dbQuestionsSuccess(err, databaseConfig) {
|
var dbQuestionsSuccess = function (err, databaseConfig) {
|
||||||
if (!databaseConfig) {
|
if (!databaseConfig) {
|
||||||
return next(new Error('aborted'));
|
return next(new Error('aborted'));
|
||||||
}
|
}
|
||||||
@@ -135,7 +135,7 @@ var async = require('async'),
|
|||||||
|
|
||||||
config.bcrypt_rounds = 12;
|
config.bcrypt_rounds = 12;
|
||||||
config.upload_path = '/public/uploads';
|
config.upload_path = '/public/uploads';
|
||||||
config.use_port = (config.use_port.slice(0, 1) === 'y') ? true : false;
|
config.use_port = config.use_port.slice(0, 1) === 'y';
|
||||||
|
|
||||||
var urlObject = url.parse(config.base_url),
|
var urlObject = url.parse(config.base_url),
|
||||||
relative_path = (urlObject.pathname && urlObject.pathname.length > 1) ? urlObject.pathname : '',
|
relative_path = (urlObject.pathname && urlObject.pathname.length > 1) ? urlObject.pathname : '',
|
||||||
@@ -152,12 +152,20 @@ var async = require('async'),
|
|||||||
install.save(server_conf, client_conf, function(err) {
|
install.save(server_conf, client_conf, function(err) {
|
||||||
require('./database').init(next);
|
require('./database').init(next);
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
if(config.database === 'redis') {
|
if(config.database === 'redis') {
|
||||||
|
if (config['redis:host'] && config['redis:port']) {
|
||||||
|
dbQuestionsSuccess(null, config);
|
||||||
|
} else {
|
||||||
prompt.get(install.redisQuestions, dbQuestionsSuccess);
|
prompt.get(install.redisQuestions, dbQuestionsSuccess);
|
||||||
|
}
|
||||||
} else if(config.database === 'mongo') {
|
} else if(config.database === 'mongo') {
|
||||||
|
if (config['mongo:host'] && config['mongo:port']) {
|
||||||
|
dbQuestionsSuccess(null, config);
|
||||||
|
} else {
|
||||||
prompt.get(install.mongoQuestions, dbQuestionsSuccess);
|
prompt.get(install.mongoQuestions, dbQuestionsSuccess);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return next(new Error('unknown database : ' + config.database));
|
return next(new Error('unknown database : ' + config.database));
|
||||||
}
|
}
|
||||||
@@ -173,9 +181,9 @@ var async = require('async'),
|
|||||||
} else {
|
} else {
|
||||||
// Use provided values, fall back to defaults
|
// Use provided values, fall back to defaults
|
||||||
var config = {},
|
var config = {},
|
||||||
question, x, numQ;
|
question, x, numQ, allQuestions = install.questions.concat(install.redisQuestions).concat(install.mongoQuestions);
|
||||||
for(x=0,numQ=install.questions.length;x<numQ;x++) {
|
for(x=0,numQ=allQuestions.length;x<numQ;x++) {
|
||||||
question = install.questions[x];
|
question = allQuestions[x];
|
||||||
config[question.name] = install.values[question.name] || question['default'] || '';
|
config[question.name] = install.values[question.name] || question['default'] || '';
|
||||||
}
|
}
|
||||||
success(null, config);
|
success(null, config);
|
||||||
|
|||||||
18
src/meta.js
18
src/meta.js
@@ -144,27 +144,19 @@ var fs = require('fs'),
|
|||||||
};
|
};
|
||||||
|
|
||||||
Meta.title = {
|
Meta.title = {
|
||||||
build: function (urlFragment, current_user, callback) {
|
build: function (urlFragment, callback) {
|
||||||
var self = this,
|
var user = require('./user');
|
||||||
user = require('./user');
|
|
||||||
|
|
||||||
async.parallel({
|
Meta.title.parseFragment(urlFragment, function(err, title) {
|
||||||
title: function (next) {
|
|
||||||
self.parseFragment(urlFragment, next);
|
|
||||||
},
|
|
||||||
notifCount: function (next) {
|
|
||||||
user.notifications.getUnreadCount(current_user, next);
|
|
||||||
}
|
|
||||||
}, function (err, values) {
|
|
||||||
var title;
|
var title;
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
title = Meta.config.title || 'NodeBB';
|
title = Meta.config.title || 'NodeBB';
|
||||||
} else {
|
} else {
|
||||||
title = (values.title ? values.title + ' | ' : '') + (Meta.config.title || 'NodeBB');
|
title = (title ? title + ' | ' : '') + (Meta.config.title || 'NodeBB');
|
||||||
}
|
}
|
||||||
|
|
||||||
callback(null, title, values.notifCount);
|
callback(null, title);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
parseFragment: function (urlFragment, callback) {
|
parseFragment: function (urlFragment, callback) {
|
||||||
|
|||||||
@@ -48,11 +48,15 @@ var db = require('./database'),
|
|||||||
}
|
}
|
||||||
|
|
||||||
function hasEnoughRep(next) {
|
function hasEnoughRep(next) {
|
||||||
|
if (parseInt(meta.config['privileges:disabled'], 10)) {
|
||||||
|
return next(null, false);
|
||||||
|
} else {
|
||||||
user.getUserField(uid, 'reputation', function(err, reputation) {
|
user.getUserField(uid, 'reputation', function(err, reputation) {
|
||||||
if (err) return next(null, false);
|
if (err) return next(null, false);
|
||||||
next(null, parseInt(reputation, 10) >= parseInt(meta.config['privileges:manage_content'], 10));
|
next(null, parseInt(reputation, 10) >= parseInt(meta.config['privileges:manage_content'], 10));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async.parallel([getThreadPrivileges, isOwnPost, hasEnoughRep], function(err, results) {
|
async.parallel([getThreadPrivileges, isOwnPost, hasEnoughRep], function(err, results) {
|
||||||
callback({
|
callback({
|
||||||
|
|||||||
74
src/posts.js
74
src/posts.js
@@ -134,45 +134,30 @@ var db = require('./database'),
|
|||||||
callback(new Error('reply-error'), null);
|
callback(new Error('reply-error'), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
async.parallel([
|
|
||||||
function(next) {
|
|
||||||
topics.markUnRead(tid, function(err) {
|
|
||||||
if(err) {
|
|
||||||
return next(err);
|
|
||||||
}
|
|
||||||
topics.markAsRead(tid, uid);
|
|
||||||
next();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
function(next) {
|
|
||||||
topics.pushUnreadCount(null, next);
|
|
||||||
},
|
|
||||||
function(next) {
|
|
||||||
Posts.getCidByPid(postData.pid, function(err, cid) {
|
Posts.getCidByPid(postData.pid, function(err, cid) {
|
||||||
if(err) {
|
|
||||||
return next(err);
|
|
||||||
}
|
|
||||||
|
|
||||||
db.delete('cid:' + cid + ':read_by_uid');
|
|
||||||
next();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
function(next) {
|
|
||||||
threadTools.notifyFollowers(tid, uid);
|
|
||||||
next();
|
|
||||||
},
|
|
||||||
function(next) {
|
|
||||||
Posts.addUserInfoToPost(postData, function(err) {
|
|
||||||
if(err) {
|
|
||||||
return next(err);
|
|
||||||
}
|
|
||||||
next();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
], function(err, results) {
|
|
||||||
if(err) {
|
if(err) {
|
||||||
return callback(err, null);
|
return callback(err, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
db.delete('cid:' + cid + ':read_by_uid');
|
||||||
|
});
|
||||||
|
|
||||||
|
topics.markAsUnreadForAll(tid, function(err) {
|
||||||
|
if(err) {
|
||||||
|
return callback(err, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
topics.markAsRead(tid, uid);
|
||||||
|
topics.pushUnreadCount();
|
||||||
|
});
|
||||||
|
|
||||||
|
threadTools.notifyFollowers(tid, uid);
|
||||||
|
|
||||||
|
Posts.addUserInfoToPost(postData, function(err) {
|
||||||
|
if(err) {
|
||||||
|
return callback(err, null);
|
||||||
|
}
|
||||||
|
|
||||||
callback(null, postData);
|
callback(null, postData);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -205,7 +190,7 @@ var db = require('./database'),
|
|||||||
Posts.addUserInfoToPost = function(post, callback) {
|
Posts.addUserInfoToPost = function(post, callback) {
|
||||||
user.getUserFields(post.uid, ['username', 'userslug', 'reputation', 'postcount', 'picture', 'signature', 'banned'], function(err, userData) {
|
user.getUserFields(post.uid, ['username', 'userslug', 'reputation', 'postcount', 'picture', 'signature', 'banned'], function(err, userData) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return callback();
|
return callback(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
postTools.parseSignature(userData.signature, function(err, signature) {
|
postTools.parseSignature(userData.signature, function(err, signature) {
|
||||||
@@ -242,7 +227,7 @@ var db = require('./database'),
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
Posts.getPostSummaryByPids = function(pids, callback) {
|
Posts.getPostSummaryByPids = function(pids, stripTags, callback) {
|
||||||
|
|
||||||
var posts = [];
|
var posts = [];
|
||||||
|
|
||||||
@@ -283,10 +268,17 @@ var db = require('./database'),
|
|||||||
function(postData, next) {
|
function(postData, next) {
|
||||||
if (postData.content) {
|
if (postData.content) {
|
||||||
postTools.parse(postData.content, function(err, content) {
|
postTools.parse(postData.content, function(err, content) {
|
||||||
if (!err) {
|
if(err) {
|
||||||
postData.content = utils.strip_tags(content);
|
return next(err);
|
||||||
}
|
}
|
||||||
next(err, postData);
|
|
||||||
|
if(stripTags) {
|
||||||
|
postData.content = utils.strip_tags(content);
|
||||||
|
} else {
|
||||||
|
postData.content = content;
|
||||||
|
}
|
||||||
|
|
||||||
|
next(null, postData);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
next(null, postData);
|
next(null, postData);
|
||||||
@@ -504,7 +496,7 @@ var db = require('./database'),
|
|||||||
if (err)
|
if (err)
|
||||||
return callback(err, null);
|
return callback(err, null);
|
||||||
|
|
||||||
Posts.getPostSummaryByPids(pids, function(err, posts) {
|
Posts.getPostSummaryByPids(pids, false, function(err, posts) {
|
||||||
if (err)
|
if (err)
|
||||||
return callback(err, null);
|
return callback(err, null);
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,8 @@ var nconf = require('nconf'),
|
|||||||
pkg = require('./../../package.json'),
|
pkg = require('./../../package.json'),
|
||||||
categories = require('./../categories'),
|
categories = require('./../categories'),
|
||||||
meta = require('../meta'),
|
meta = require('../meta'),
|
||||||
plugins = require('../plugins');
|
plugins = require('../plugins'),
|
||||||
|
utils = require('./../../public/src/utils.js');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -97,6 +98,53 @@ var nconf = require('nconf'),
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
app.post('/category/uploadpicture', function(req, res) {
|
||||||
|
if (!req.user)
|
||||||
|
return res.redirect('/403');
|
||||||
|
|
||||||
|
var allowedTypes = ['image/png', 'image/jpeg', 'image/jpg', 'image/gif'];
|
||||||
|
|
||||||
|
if (allowedTypes.indexOf(req.files.userPhoto.type) === -1) {
|
||||||
|
res.send({
|
||||||
|
error: 'Allowed image types are png, jpg and gif!'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var tempPath = req.files.userPhoto.path;
|
||||||
|
var extension = path.extname(req.files.userPhoto.name);
|
||||||
|
|
||||||
|
if (!extension) {
|
||||||
|
res.send({
|
||||||
|
error: 'Error uploading file! Error : Invalid extension!'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var filename = 'category' + utils.generateUUID() + extension;
|
||||||
|
var uploadPath = path.join(nconf.get('base_dir'), nconf.get('upload_path'), filename);
|
||||||
|
|
||||||
|
winston.info('Attempting upload to: ' + uploadPath);
|
||||||
|
|
||||||
|
var is = fs.createReadStream(tempPath);
|
||||||
|
var os = fs.createWriteStream(uploadPath);
|
||||||
|
|
||||||
|
is.on('end', function () {
|
||||||
|
fs.unlinkSync(tempPath);
|
||||||
|
console.log(nconf.get('upload_url') + filename);
|
||||||
|
res.json({
|
||||||
|
path: nconf.get('upload_url') + filename
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
os.on('error', function (err) {
|
||||||
|
fs.unlinkSync(tempPath);
|
||||||
|
winston.err(err);
|
||||||
|
});
|
||||||
|
|
||||||
|
is.pipe(os);
|
||||||
|
});
|
||||||
|
|
||||||
app.post('/uploadlogo', function(req, res) {
|
app.post('/uploadlogo', function(req, res) {
|
||||||
|
|
||||||
if (!req.user)
|
if (!req.user)
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ var path = require('path'),
|
|||||||
nconf = require('nconf'),
|
nconf = require('nconf'),
|
||||||
async = require('async'),
|
async = require('async'),
|
||||||
|
|
||||||
|
db = require('../database'),
|
||||||
user = require('../user'),
|
user = require('../user'),
|
||||||
auth = require('./authentication'),
|
auth = require('./authentication'),
|
||||||
topics = require('../topics'),
|
topics = require('../topics'),
|
||||||
@@ -214,6 +215,7 @@ var path = require('path'),
|
|||||||
});
|
});
|
||||||
|
|
||||||
app.get('/search', function (req, res) {
|
app.get('/search', function (req, res) {
|
||||||
|
if (req.user && req.user.uid) {
|
||||||
return res.json({
|
return res.json({
|
||||||
show_no_topics: 'hide',
|
show_no_topics: 'hide',
|
||||||
show_no_posts: 'hide',
|
show_no_posts: 'hide',
|
||||||
@@ -222,6 +224,9 @@ var path = require('path'),
|
|||||||
posts: [],
|
posts: [],
|
||||||
topics: []
|
topics: []
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
res.send(403);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
app.get('/search/:term', function (req, res, next) {
|
app.get('/search/:term', function (req, res, next) {
|
||||||
@@ -232,7 +237,7 @@ var path = require('path'),
|
|||||||
return callback(err, null);
|
return callback(err, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
posts.getPostSummaryByPids(pids, function (err, posts) {
|
posts.getPostSummaryByPids(pids, false, function (err, posts) {
|
||||||
if (err){
|
if (err){
|
||||||
return callback(err, null);
|
return callback(err, null);
|
||||||
}
|
}
|
||||||
@@ -253,6 +258,7 @@ var path = require('path'),
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (req.user && req.user.uid) {
|
||||||
async.parallel([searchPosts, searchTopics], function (err, results) {
|
async.parallel([searchPosts, searchTopics], function (err, results) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return next();
|
return next();
|
||||||
@@ -267,6 +273,9 @@ var path = require('path'),
|
|||||||
topics: results[1]
|
topics: results[1]
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
res.send(403);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
app.get('/reset', function (req, res) {
|
app.get('/reset', function (req, res) {
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ var DebugRoute = function(app) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ var fs = require('fs'),
|
|||||||
if (!req.user)
|
if (!req.user)
|
||||||
return res.redirect('/403');
|
return res.redirect('/403');
|
||||||
|
|
||||||
var uploadSize = meta.config.maximumProfileImageSize || 256;
|
var uploadSize = parseInt(meta.config.maximumProfileImageSize, 10) || 256;
|
||||||
|
|
||||||
if (req.files.userPhoto.size > uploadSize * 1024) {
|
if (req.files.userPhoto.size > uploadSize * 1024) {
|
||||||
res.send({
|
res.send({
|
||||||
@@ -147,18 +147,21 @@ var fs = require('fs'),
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var filename = uid + '-profileimg' + extension;
|
var convertToPNG = parseInt(meta.config['profile:convertProfileImageToPNG'], 10);
|
||||||
|
|
||||||
|
var filename = uid + '-profileimg' + (convertToPNG ? '.png' : extension);
|
||||||
var uploadPath = path.join(nconf.get('base_dir'), nconf.get('upload_path'), filename);
|
var uploadPath = path.join(nconf.get('base_dir'), nconf.get('upload_path'), filename);
|
||||||
|
|
||||||
winston.info('Attempting upload to: ' + uploadPath);
|
winston.info('Attempting upload to: ' + uploadPath);
|
||||||
|
|
||||||
var is = fs.createReadStream(tempPath);
|
var is = fs.createReadStream(tempPath);
|
||||||
var os = fs.createWriteStream(uploadPath);
|
var os = fs.createWriteStream(uploadPath);
|
||||||
|
var im = require('node-imagemagick');
|
||||||
|
|
||||||
is.on('end', function () {
|
is.on('end', function () {
|
||||||
fs.unlinkSync(tempPath);
|
fs.unlinkSync(tempPath);
|
||||||
|
|
||||||
require('node-imagemagick').crop({
|
im.crop({
|
||||||
srcPath: uploadPath,
|
srcPath: uploadPath,
|
||||||
dstPath: uploadPath,
|
dstPath: uploadPath,
|
||||||
width: 128,
|
width: 128,
|
||||||
@@ -177,6 +180,22 @@ var fs = require('fs'),
|
|||||||
user.setUserField(uid, 'uploadedpicture', imageUrl);
|
user.setUserField(uid, 'uploadedpicture', imageUrl);
|
||||||
user.setUserField(uid, 'picture', imageUrl);
|
user.setUserField(uid, 'picture', imageUrl);
|
||||||
|
|
||||||
|
if (convertToPNG) {
|
||||||
|
im.convert([uploadPath, 'png:-'],
|
||||||
|
function(err, stdout){
|
||||||
|
if (err) {
|
||||||
|
winston.err(err);
|
||||||
|
res.send({
|
||||||
|
error: 'Unable to convert image to PNG.'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
fs.writeFileSync(uploadPath, stdout, 'binary');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
path: imageUrl
|
path: imageUrl
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -33,11 +33,15 @@ var db = require('./database'),
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
hasEnoughRep: function(next) {
|
hasEnoughRep: function(next) {
|
||||||
|
if (parseInt(meta.config['privileges:disabled'], 10)) {
|
||||||
|
return next(null, false);
|
||||||
|
} else {
|
||||||
user.getUserField(uid, 'reputation', function(err, reputation) {
|
user.getUserField(uid, 'reputation', function(err, reputation) {
|
||||||
if (err) return next(null, false);
|
if (err) return next(null, false);
|
||||||
next(null, parseInt(reputation, 10) >= parseInt(meta.config['privileges:manage_topic'], 10));
|
next(null, parseInt(reputation, 10) >= parseInt(meta.config['privileges:manage_topic'], 10));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}, function(err, results) {
|
}, function(err, results) {
|
||||||
callback(err, !results ? undefined : {
|
callback(err, !results ? undefined : {
|
||||||
read: results.categoryPrivs.read,
|
read: results.categoryPrivs.read,
|
||||||
|
|||||||
@@ -701,7 +701,7 @@ var async = require('async'),
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Topics.markUnRead = function(tid, callback) {
|
Topics.markAsUnreadForAll = function(tid, callback) {
|
||||||
db.delete('tid:' + tid + ':read_by_uid', callback);
|
db.delete('tid:' + tid + ':read_by_uid', callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -237,7 +237,15 @@ Upgrade.upgradeRedis = function(callback) {
|
|||||||
|
|
||||||
function updateKeyToHash(key, next) {
|
function updateKeyToHash(key, next) {
|
||||||
RDB.get(key, function(err, value) {
|
RDB.get(key, function(err, value) {
|
||||||
|
if(err) {
|
||||||
|
return next(err);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(value === null) {
|
||||||
|
RDB.hset('global', newKeys[key], initialValues[key], next);
|
||||||
|
} else {
|
||||||
RDB.hset('global', newKeys[key], value, next);
|
RDB.hset('global', newKeys[key], value, next);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -270,6 +278,19 @@ Upgrade.upgradeRedis = function(callback) {
|
|||||||
'totalpostcount':'postCount'
|
'totalpostcount':'postCount'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var initialValues = {
|
||||||
|
'global:next_user_id': 1,
|
||||||
|
'next_topic_id': 0,
|
||||||
|
'next_gid': 1,
|
||||||
|
'notifications:next_nid': 0,
|
||||||
|
'global:next_category_id': 12,
|
||||||
|
'global:next_message_id': 0,
|
||||||
|
'global:next_post_id': 0,
|
||||||
|
'usercount': 1,
|
||||||
|
'totaltopiccount': 0,
|
||||||
|
'totalpostcount': 0
|
||||||
|
};
|
||||||
|
|
||||||
async.each(keys, updateKeyToHash, function(err) {
|
async.each(keys, updateKeyToHash, function(err) {
|
||||||
if(err) {
|
if(err) {
|
||||||
return next(err);
|
return next(err);
|
||||||
|
|||||||
@@ -677,7 +677,7 @@ websockets.init = function(io) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on('getChatMessages', function(data, callback) {
|
socket.on('api:chats.get', function(data, callback) {
|
||||||
var touid = data.touid;
|
var touid = data.touid;
|
||||||
Messaging.getMessages(uid, touid, function(err, messages) {
|
Messaging.getMessages(uid, touid, function(err, messages) {
|
||||||
if (err)
|
if (err)
|
||||||
@@ -687,7 +687,7 @@ websockets.init = function(io) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on('sendChatMessage', function(data) {
|
socket.on('api:chats.send', function(data) {
|
||||||
|
|
||||||
var touid = data.touid;
|
var touid = data.touid;
|
||||||
if (touid === uid || uid === 0) {
|
if (touid === uid || uid === 0) {
|
||||||
@@ -696,9 +696,15 @@ websockets.init = function(io) {
|
|||||||
|
|
||||||
var msg = utils.strip_tags(data.message);
|
var msg = utils.strip_tags(data.message);
|
||||||
|
|
||||||
user.getUserField(uid, 'username', function(err, username) {
|
user.getMultipleUserFields([uid, touid], ['username'], function(err, usersData) {
|
||||||
|
if(err) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var finalMessage = username + ' : ' + msg,
|
var finalMessage = username + ' : ' + msg,
|
||||||
notifText = 'New message from <strong>' + username + '</strong>';
|
notifText = 'New message from <strong>' + username + '</strong>',
|
||||||
|
username = usersData[0].username,
|
||||||
|
toUsername = usersData[1].username;
|
||||||
|
|
||||||
if (!isUserOnline(touid)) {
|
if (!isUserOnline(touid)) {
|
||||||
notifications.create(notifText, 'javascript:app.openChat('' + username + '', ' + uid + ');', 'notification_' + uid + '_' + touid, function(nid) {
|
notifications.create(notifText, 'javascript:app.openChat('' + username + '', ' + uid + ');', 'notification_' + uid + '_' + touid, function(nid) {
|
||||||
@@ -715,7 +721,7 @@ websockets.init = function(io) {
|
|||||||
numSockets = userSockets[touid].length;
|
numSockets = userSockets[touid].length;
|
||||||
|
|
||||||
for (var x = 0; x < numSockets; ++x) {
|
for (var x = 0; x < numSockets; ++x) {
|
||||||
userSockets[touid][x].emit('chatMessage', {
|
userSockets[touid][x].emit('event:chats.receive', {
|
||||||
fromuid: uid,
|
fromuid: uid,
|
||||||
username: username,
|
username: username,
|
||||||
message: finalMessage,
|
message: finalMessage,
|
||||||
@@ -729,9 +735,9 @@ websockets.init = function(io) {
|
|||||||
numSockets = userSockets[uid].length;
|
numSockets = userSockets[uid].length;
|
||||||
|
|
||||||
for (var x = 0; x < numSockets; ++x) {
|
for (var x = 0; x < numSockets; ++x) {
|
||||||
userSockets[uid][x].emit('chatMessage', {
|
userSockets[uid][x].emit('event:chats.receive', {
|
||||||
fromuid: touid,
|
fromuid: touid,
|
||||||
username: username,
|
username: toUsername,
|
||||||
message: 'You : ' + msg,
|
message: 'You : ' + msg,
|
||||||
timestamp: Date.now()
|
timestamp: Date.now()
|
||||||
});
|
});
|
||||||
@@ -1078,8 +1084,8 @@ websockets.init = function(io) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
socket.on('api:meta.buildTitle', function(text, callback) {
|
socket.on('api:meta.buildTitle', function(text, callback) {
|
||||||
meta.title.build(text, uid, function(err, title, numNotifications) {
|
meta.title.build(text, function(err, title) {
|
||||||
callback(title, numNotifications);
|
callback(title);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user