mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-07-06 01:18:35 +02:00
Merge remote-tracking branch 'origin/master' into Widgets
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
"rss": "~0.2.0",
|
||||
"prompt": "~0.2.11",
|
||||
"uglify-js": "~2.4.0",
|
||||
"validator": "~1.5.1",
|
||||
"validator": "~3.2.1",
|
||||
"nodebb-plugin-mentions": "~0.4",
|
||||
"nodebb-plugin-markdown": "~0.3",
|
||||
"nodebb-theme-vanilla": "~0.0.13",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"home": "Home",
|
||||
"unread": "Unread Topics",
|
||||
"popular": "Popular Topics",
|
||||
"recent": "Recent Topics",
|
||||
"users": "Registered Users",
|
||||
"notifications": "Notifications",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"home": "Home",
|
||||
"unread": "Unread Topics",
|
||||
"popular": "Popular Topics",
|
||||
"recent": "Recent Topics",
|
||||
"users": "Registered Users",
|
||||
"notifications": "Notifications",
|
||||
|
||||
@@ -10,14 +10,14 @@
|
||||
"500.message": "Ooops! Looks like something went wrong!",
|
||||
"register": "Registrierung",
|
||||
"login": "Login",
|
||||
"welcome_back": "Welcome Back ",
|
||||
"you_have_successfully_logged_in": "You have successfully logged in",
|
||||
"welcome_back": "Willkommen zurück",
|
||||
"you_have_successfully_logged_in": "Du hast dich erfolgreich eingeloggt",
|
||||
"logout": "Logout",
|
||||
"logout.title": "Du bist ausgeloggt.",
|
||||
"logout.message": "Du hast dich soeben erfolgreich aus dem Forum ausgeloggt.",
|
||||
"save_changes": "Speichere Änderungen",
|
||||
"close": "Schließen",
|
||||
"pagination": "Pagination",
|
||||
"pagination": "Seitennummerierung",
|
||||
"header.admin": "Admin",
|
||||
"header.recent": "Aktuell",
|
||||
"header.unread": "Ungelesen",
|
||||
@@ -52,5 +52,5 @@
|
||||
"dnd": "Nicht stören",
|
||||
"invisible": "Unsichtbar",
|
||||
"offline": "Offline",
|
||||
"privacy": "Privacy"
|
||||
"privacy": "Privatsphäre"
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"title": "Benachrichtigungen",
|
||||
"no_notifs": "You have no new notifications",
|
||||
"see_all": "See all Notifications",
|
||||
"no_notifs": "Du hast keine neuen Benachrichtigungen",
|
||||
"see_all": "Alle Benachrichtigungen ansehen",
|
||||
"back_to_home": "Zurück zur Startseite",
|
||||
"outgoing_link": "Externer Link",
|
||||
"outgoing_link_message": "Du verlässt nun",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"home": "Home",
|
||||
"unread": "Unread Topics",
|
||||
"popular": "Popular Topics",
|
||||
"recent": "Recent Topics",
|
||||
"users": "Registered Users",
|
||||
"notifications": "Notifications",
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
"day": "Tag",
|
||||
"week": "Woche",
|
||||
"month": "Monat",
|
||||
"no_recent_topics": "There are no recent topics."
|
||||
"no_recent_topics": "Es gibt keine aktuellen Themen."
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
"topic": "Thema",
|
||||
"topics": "Themen",
|
||||
"no_topics_found": "Keine passende Themen gefunden.",
|
||||
"no_posts_found": "No posts found!",
|
||||
"no_posts_found": "Keine Beiträge gefunden!",
|
||||
"profile": "Profil",
|
||||
"posted_by": "Geposted von",
|
||||
"chat": "Chat",
|
||||
@@ -19,19 +19,19 @@
|
||||
"tools": "Tools",
|
||||
"flag": "Markieren",
|
||||
"flag_title": "Diesen Beitrag zur Moderation markieren",
|
||||
"deleted_message": "This thread has been deleted. Only users with thread management privileges can see it.",
|
||||
"watch": "Watch",
|
||||
"share_this_post": "Share this Post",
|
||||
"deleted_message": "Dieser Thread wurde gelöscht. Nur Nutzer mit Thread-Management Rechten können ihn sehen.",
|
||||
"watch": "Beobachten",
|
||||
"share_this_post": "Diesen Beitrag teilen",
|
||||
"thread_tools.title": "Thread Tools",
|
||||
"thread_tools.markAsUnreadForAll": "Als ungelesen markieren",
|
||||
"thread_tools.pin": "Pin Topic",
|
||||
"thread_tools.unpin": "Unpin Topic",
|
||||
"thread_tools.lock": "Lock Topic",
|
||||
"thread_tools.unlock": "Unlock Topic",
|
||||
"thread_tools.move": "Move Topic",
|
||||
"thread_tools.fork": "Fork Topic",
|
||||
"thread_tools.delete": "Delete Topic",
|
||||
"thread_tools.restore": "Restore Topic",
|
||||
"thread_tools.pin": "Thema anpinnen",
|
||||
"thread_tools.unpin": "Thema nicht mehr anpinnen",
|
||||
"thread_tools.lock": "Thema schließen",
|
||||
"thread_tools.unlock": "Thema öffnen",
|
||||
"thread_tools.move": "Thema verschieben",
|
||||
"thread_tools.fork": "Thema aufspalten",
|
||||
"thread_tools.delete": "Thema löschen",
|
||||
"thread_tools.restore": "Thema wiederherstellen",
|
||||
"load_categories": "Kategorien laden",
|
||||
"disabled_categories_note": "Deaktivierte Kategorien sind ausgegraut.",
|
||||
"confirm_move": "verschieben",
|
||||
@@ -41,10 +41,10 @@
|
||||
"favourites.not_logged_in.title": "Nicht eingeloggt!",
|
||||
"favourites.not_logged_in.message": "Bitte logge dich ein, um diesen Beitrag favorisieren zu können.",
|
||||
"favourites.has_no_favourites": "Du hast noch keine Favoriten.",
|
||||
"vote.not_logged_in.title": "Not Logged In",
|
||||
"vote.not_logged_in.message": "Please log in in order to vote",
|
||||
"vote.cant_vote_self.title": "Invalid Vote",
|
||||
"vote.cant_vote_self.message": "You cannot vote for your own post",
|
||||
"vote.not_logged_in.title": "Nicht eingeloggt",
|
||||
"vote.not_logged_in.message": "Zum Bewerten bitte einloggen",
|
||||
"vote.cant_vote_self.title": "Ungültige Bewertung",
|
||||
"vote.cant_vote_self.message": "Du kannst deinen eigenen Beitrag nicht bewerten",
|
||||
"loading_more_posts": "Lade Mehr Posts",
|
||||
"move_topic": "Thema verschieben",
|
||||
"move_post": "Beitrag verschieben",
|
||||
@@ -55,11 +55,11 @@
|
||||
"fork_success": "Thema erfolgreich aufgespalten!",
|
||||
"reputation": "Reputation",
|
||||
"posts": "Beiträge",
|
||||
"composer.title_placeholder": "Enter your topic title here...",
|
||||
"composer.write": "Write",
|
||||
"composer.preview": "Preview",
|
||||
"composer.discard": "Discard",
|
||||
"composer.submit": "Submit",
|
||||
"composer.replying_to": "Replying to",
|
||||
"composer.new_topic": "New Topic"
|
||||
"composer.title_placeholder": "Hier den Titel des Themas eingeben...",
|
||||
"composer.write": "Schreiben",
|
||||
"composer.preview": "Vorschau",
|
||||
"composer.discard": "Verwerfen",
|
||||
"composer.submit": "Absenden",
|
||||
"composer.replying_to": "Als Antwort auf",
|
||||
"composer.new_topic": "Neues Thema"
|
||||
}
|
||||
@@ -9,7 +9,7 @@
|
||||
"age": "Alter",
|
||||
"joined": "Beigetreten",
|
||||
"lastonline": "Zuletzt online",
|
||||
"profile": "Profile",
|
||||
"profile": "Profil",
|
||||
"profile_views": "Profilaufrufe",
|
||||
"reputation": "Reputation",
|
||||
"posts": "Posts",
|
||||
@@ -20,28 +20,28 @@
|
||||
"gravatar": "Gravatar",
|
||||
"birthday": "Geburtstag",
|
||||
"chat": "Chat",
|
||||
"follow": "Follow",
|
||||
"unfollow": "Unfollow",
|
||||
"follow": "Folgen",
|
||||
"unfollow": "Nicht mehr folgen",
|
||||
"change_picture": "Ändere Profilbild",
|
||||
"edit": "Ändern",
|
||||
"uploaded_picture": "Hochgeladene Bilder",
|
||||
"upload_new_picture": "Neues Bild hochladen",
|
||||
"current_password": "Current Password",
|
||||
"current_password": "Aktuelles Passwort",
|
||||
"change_password": "Ändere Passwort",
|
||||
"confirm_password": "Passwort wiederholen",
|
||||
"password": "Passwort",
|
||||
"upload_picture": "Bild hochladen",
|
||||
"upload_a_picture": "Ein Bild hochladen",
|
||||
"image_spec": "You may only upload PNG, JPG, or GIF files",
|
||||
"image_spec": "Du darfst nur Dateien vom Typ PNG, JPG oder GIF hochladen",
|
||||
"max": "max.",
|
||||
"settings": "Einstellungen",
|
||||
"show_email": "Zeige meine E-Mail Adresse an.",
|
||||
"has_no_follower": "Dieser User hat noch keine Follower.",
|
||||
"follows_no_one": "Dieser User folgt noch niemanden.",
|
||||
"has_no_posts": "This user didn't post anything yet.",
|
||||
"has_no_posts": "Dieser Nutzer hat noch nichts gepostet.",
|
||||
"email_hidden": "E-Mail Adresse versteckt",
|
||||
"hidden": "versteckt",
|
||||
"paginate_description": "Paginate topics and posts instead of using infinite scroll.",
|
||||
"topics_per_page": "Topics per Page",
|
||||
"posts_per_page": "Posts per Page"
|
||||
"paginate_description": "Themen und Beiträge auf Seiten aufteilen statt unendliches Scrollen verweden",
|
||||
"topics_per_page": "Themen pro Seite",
|
||||
"posts_per_page": "Beiträge pro Seite"
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"home": "Home",
|
||||
"unread": "Unread Topics",
|
||||
"popular": "Popular Topics",
|
||||
"recent": "Recent Topics",
|
||||
"users": "Registered Users",
|
||||
"notifications": "Notifications",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"home": "Home",
|
||||
"unread": "Unread Topics",
|
||||
"popular": "Popular Topics",
|
||||
"recent": "Recent Topics",
|
||||
"users": "Registered Users",
|
||||
"notifications": "Notifications",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"home": "Home",
|
||||
"unread": "Unread Topics",
|
||||
"popular": "Popular Topics",
|
||||
"recent": "Recent Topics",
|
||||
"users": "Registered Users",
|
||||
"notifications": "Notifications",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"home": "Accueil",
|
||||
"unread": "Sujets non lus",
|
||||
"popular": "Popular Topics",
|
||||
"recent": "Sujets Récents",
|
||||
"users": "Utilisateurs enregistrés",
|
||||
"notifications": "Notifications",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"home": "דף הבית",
|
||||
"unread": "נושאים שלא נקראו",
|
||||
"popular": "Popular Topics",
|
||||
"recent": "נושאים אחרונים",
|
||||
"users": "משתמשים רשומים",
|
||||
"notifications": "התראות",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"home": "Kezdőlap",
|
||||
"unread": "Olvasatlan Topikok",
|
||||
"popular": "Popular Topics",
|
||||
"recent": "Friss Topikok",
|
||||
"users": "Regisztrált Felhasználók",
|
||||
"notifications": "Értesítések",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"home": "Home",
|
||||
"unread": "Unread Topics",
|
||||
"popular": "Popular Topics",
|
||||
"recent": "Recent Topics",
|
||||
"users": "Registered Users",
|
||||
"notifications": "Notifications",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"home": "Hjem",
|
||||
"unread": "Uleste emner",
|
||||
"popular": "Popular Topics",
|
||||
"recent": "Seneste emner",
|
||||
"users": "Registrerte brukere",
|
||||
"notifications": "Varsler",
|
||||
|
||||
@@ -10,14 +10,14 @@
|
||||
"500.message": "Coś poszło nie tak.",
|
||||
"register": "Zarejestruj się",
|
||||
"login": "Zaloguj się",
|
||||
"welcome_back": "Welcome Back ",
|
||||
"you_have_successfully_logged_in": "You have successfully logged in",
|
||||
"welcome_back": "Witaj z powrotem!",
|
||||
"you_have_successfully_logged_in": "Zostałeś pomyślnie zalogowany.",
|
||||
"logout": "Wyloguj się",
|
||||
"logout.title": "Wylogowałeś się.",
|
||||
"logout.message": "Pomyślnie wylogowałeś się z forum.",
|
||||
"save_changes": "Zapisz zmiany",
|
||||
"close": "Zamknij",
|
||||
"pagination": "Pagination",
|
||||
"pagination": "Numerowanie stron",
|
||||
"header.admin": "Administracja",
|
||||
"header.recent": "Ostatnie",
|
||||
"header.unread": "Nieprzeczytane",
|
||||
@@ -52,5 +52,5 @@
|
||||
"dnd": "Nie przeszkadzać",
|
||||
"invisible": "Niewidoczny",
|
||||
"offline": "Niedostępny",
|
||||
"privacy": "Privacy"
|
||||
"privacy": "Prywatność"
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"home": "Strona główna",
|
||||
"unread": "Nieprzeczytane wątki",
|
||||
"popular": "Popular Topics",
|
||||
"recent": "Ostatnie wątki",
|
||||
"users": "Zarejestrowani użytkownicy",
|
||||
"notifications": "Powiadomienia",
|
||||
|
||||
@@ -19,15 +19,15 @@
|
||||
"tools": "Narzędzia",
|
||||
"flag": "Zgłoś",
|
||||
"flag_title": "Zgłoś post do moderacji",
|
||||
"deleted_message": "This thread has been deleted. Only users with thread management privileges can see it.",
|
||||
"watch": "Watch",
|
||||
"share_this_post": "Share this Post",
|
||||
"deleted_message": "Ten wątek został usunięty. Tylko użytkownicy z uprawnieniami do zarządzania wątkami mogą go widzieć.",
|
||||
"watch": "Obserwuj",
|
||||
"share_this_post": "Udostępnij",
|
||||
"thread_tools.title": "Narzędzia wątków",
|
||||
"thread_tools.markAsUnreadForAll": "Oznacz jako nieprzeczytany",
|
||||
"thread_tools.pin": "Przypnij wątek",
|
||||
"thread_tools.unpin": "Unpin Topic",
|
||||
"thread_tools.unpin": "Odepnij wątek",
|
||||
"thread_tools.lock": "Zamknij wątek",
|
||||
"thread_tools.unlock": "Unlock Topic",
|
||||
"thread_tools.unlock": "Otwórz wątek",
|
||||
"thread_tools.move": "Przenieś wątek",
|
||||
"thread_tools.fork": "Skopiuj wątek",
|
||||
"thread_tools.delete": "Usuń wątek",
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
"edit": "Edytuj",
|
||||
"uploaded_picture": "Przesłane zdjęcie",
|
||||
"upload_new_picture": "Prześlij nowe zdjęcie",
|
||||
"current_password": "Current Password",
|
||||
"current_password": "Obecne hasło",
|
||||
"change_password": "Zmień hasło",
|
||||
"confirm_password": "Potwierdź hasło",
|
||||
"password": "Hasło",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"home": "Home",
|
||||
"unread": "Tópicos Não Lidos",
|
||||
"popular": "Popular Topics",
|
||||
"recent": "Tópicos Recentes",
|
||||
"users": "Usuários Registrados",
|
||||
"notifications": "Notificações",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"title": "Уведомления",
|
||||
"no_notifs": "You have no new notifications",
|
||||
"see_all": "See all Notifications",
|
||||
"no_notifs": "Для Вас нет новых уведомлений",
|
||||
"see_all": "Просмотреть все уведомления",
|
||||
"back_to_home": "Вернуться на NodeBB",
|
||||
"outgoing_link": "Внешняя ссылка",
|
||||
"outgoing_link_message": "Вы покидаете",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"home": "Главная",
|
||||
"unread": "Непрочитанные темы",
|
||||
"popular": "Popular Topics",
|
||||
"recent": "Последние темы",
|
||||
"users": "Зарегистрированные пользователи",
|
||||
"notifications": "Уведомления",
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
"thread_tools.markAsUnreadForAll": "Отметить как непрочитанные",
|
||||
"thread_tools.pin": "Pin Topic",
|
||||
"thread_tools.unpin": "Unpin Topic",
|
||||
"thread_tools.lock": "Lock Topic",
|
||||
"thread_tools.unlock": "Unlock Topic",
|
||||
"thread_tools.lock": "Закрыть Тему",
|
||||
"thread_tools.unlock": "Открыть Тему",
|
||||
"thread_tools.move": "Move Topic",
|
||||
"thread_tools.fork": "Fork Topic",
|
||||
"thread_tools.delete": "Delete Topic",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"home": "Home",
|
||||
"unread": "Unread Topics",
|
||||
"popular": "Popular Topics",
|
||||
"recent": "Recent Topics",
|
||||
"users": "Registered Users",
|
||||
"notifications": "Notifications",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"home": "Hem",
|
||||
"unread": "Olästa ämnen",
|
||||
"popular": "Popular Topics",
|
||||
"recent": "Senaste ämnena",
|
||||
"users": "Registrerade användare",
|
||||
"notifications": "Notiser",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"home": "Ana Sayfa",
|
||||
"unread": "Okunmayan Başlıklar",
|
||||
"popular": "Popular Topics",
|
||||
"recent": "Güncel Konular",
|
||||
"users": "Kayıtlı Kullanıcılar",
|
||||
"notifications": "Bildirimler",
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"500.message": "不好!看来是哪里出错了!",
|
||||
"register": "注册",
|
||||
"login": "登录",
|
||||
"welcome_back": "Welcome Back ",
|
||||
"welcome_back": "欢迎回来",
|
||||
"you_have_successfully_logged_in": "You have successfully logged in",
|
||||
"logout": "退出",
|
||||
"logout.title": "你已经退出。",
|
||||
|
||||
@@ -6,5 +6,5 @@
|
||||
"forgot_password": "忘记密码?",
|
||||
"alternative_logins": "其他登录方式",
|
||||
"failed_login_attempt": "登录失败,请再尝试。",
|
||||
"login_successful": "你已成功登录!"
|
||||
"login_successful": "您已经成功登录!"
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"home": "Home",
|
||||
"unread": "Unread Topics",
|
||||
"popular": "Popular Topics",
|
||||
"recent": "Recent Topics",
|
||||
"users": "Registered Users",
|
||||
"notifications": "Notifications",
|
||||
|
||||
@@ -1,47 +1,47 @@
|
||||
{
|
||||
"banned": "封禁",
|
||||
"offline": "下线",
|
||||
"offline": "离线",
|
||||
"username": "用户名",
|
||||
"email": "Email",
|
||||
"email": "邮件",
|
||||
"fullname": "姓名",
|
||||
"website": "网站",
|
||||
"location": "地址",
|
||||
"age": "年龄",
|
||||
"joined": "加入时间",
|
||||
"lastonline": "最后在线",
|
||||
"profile": "Profile",
|
||||
"profile": "资料",
|
||||
"profile_views": "资料被查看",
|
||||
"reputation": "声望",
|
||||
"posts": "发帖数",
|
||||
"favourites": "Favourites",
|
||||
"favourites": "收藏的帖子",
|
||||
"followers": "被关注",
|
||||
"following": "关注",
|
||||
"signature": "签名",
|
||||
"gravatar": "Gravatar头像",
|
||||
"birthday": "生日",
|
||||
"chat": "Chat",
|
||||
"follow": "Follow",
|
||||
"unfollow": "Unfollow",
|
||||
"chat": "聊天",
|
||||
"follow": "关注",
|
||||
"unfollow": "取消关注",
|
||||
"change_picture": "改变头像",
|
||||
"edit": "编辑",
|
||||
"uploaded_picture": "已有头像",
|
||||
"upload_new_picture": "上传新头像",
|
||||
"current_password": "Current Password",
|
||||
"current_password": "当前密码",
|
||||
"change_password": "更改密码",
|
||||
"confirm_password": "确认密码",
|
||||
"password": "密码",
|
||||
"upload_picture": "上传头像",
|
||||
"upload_a_picture": "上传一张照片",
|
||||
"image_spec": "You may only upload PNG, JPG, or GIF files",
|
||||
"max": "max.",
|
||||
"settings": "Settings",
|
||||
"image_spec": "您只能上传PNG,JPG或者是GIF图片文件",
|
||||
"max": "最大.",
|
||||
"settings": "设置",
|
||||
"show_email": "显示我的邮箱",
|
||||
"has_no_follower": "该用户还没有被任何人关注。",
|
||||
"follows_no_one": "该用户还没有关注过任何人。",
|
||||
"has_no_posts": "This user didn't post anything yet.",
|
||||
"has_no_posts": "此用户还未发表过任何帖子.",
|
||||
"email_hidden": "邮箱被隐藏",
|
||||
"hidden": "隐藏",
|
||||
"paginate_description": "Paginate topics and posts instead of using infinite scroll.",
|
||||
"topics_per_page": "Topics per Page",
|
||||
"posts_per_page": "Posts per Page"
|
||||
"paginate_description": "使用分页方式显示话题和帖子,代替滚动显示",
|
||||
"topics_per_page": "每页话题数量设置",
|
||||
"posts_per_page": "每页帖子数量设置"
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"home": "Home",
|
||||
"unread": "Unread Topics",
|
||||
"popular": "Popular Topics",
|
||||
"recent": "Recent Topics",
|
||||
"users": "Registered Users",
|
||||
"notifications": "Notifications",
|
||||
|
||||
@@ -97,7 +97,7 @@ var ajaxify = {};
|
||||
|
||||
templates.flush();
|
||||
templates.load_template(function () {
|
||||
exec_body_scripts(content);
|
||||
|
||||
require(['forum/' + tpl_url], function(script) {
|
||||
if (script && script.init) {
|
||||
script.init();
|
||||
@@ -188,56 +188,4 @@ var ajaxify = {};
|
||||
});
|
||||
});
|
||||
|
||||
function exec_body_scripts(body_el) {
|
||||
// modified from http://stackoverflow.com/questions/2592092/executing-script-elements-inserted-with-innerhtml
|
||||
|
||||
function nodeName(elem, name) {
|
||||
return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
|
||||
}
|
||||
|
||||
function evalScript(elem) {
|
||||
var data = (elem.text || elem.textContent || elem.innerHTML || ""),
|
||||
head = document.getElementsByTagName("head")[0] ||
|
||||
document.documentElement,
|
||||
script = document.createElement("script");
|
||||
|
||||
script.type = "text/javascript";
|
||||
try {
|
||||
script.appendChild(document.createTextNode(data));
|
||||
} catch (e) {
|
||||
script.text = data;
|
||||
}
|
||||
|
||||
if (elem.src) {
|
||||
script.src = elem.src;
|
||||
}
|
||||
|
||||
head.insertBefore(script, head.firstChild);
|
||||
//TODO: remove from head before inserting?, doing this breaks scripts in safari so commented out for now
|
||||
//head.removeChild(script);
|
||||
}
|
||||
|
||||
var scripts = [],
|
||||
script,
|
||||
children_nodes = $(body_el).find('script'),
|
||||
child,
|
||||
i;
|
||||
|
||||
for (i = 0; children_nodes[i]; i++) {
|
||||
child = children_nodes[i];
|
||||
if (nodeName(child, "script") &&
|
||||
(!child.type || child.type.toLowerCase() === "text/javascript")) {
|
||||
scripts.push(child);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; scripts[i]; i++) {
|
||||
script = scripts[i];
|
||||
if (script.parentNode) {
|
||||
script.parentNode.removeChild(script);
|
||||
}
|
||||
evalScript(scripts[i]);
|
||||
}
|
||||
}
|
||||
|
||||
}(jQuery));
|
||||
|
||||
@@ -190,10 +190,11 @@ define(['forum/accountheader', 'uploader'], function(header, uploader) {
|
||||
|
||||
$('#changePasswordBtn').on('click', function() {
|
||||
|
||||
if (passwordvalid && passwordsmatch && currentPassword.val()) {
|
||||
if (passwordvalid && passwordsmatch && (currentPassword.val() || app.isAdmin)) {
|
||||
socket.emit('user.changePassword', {
|
||||
'currentPassword': currentPassword.val(),
|
||||
'newPassword': password.val()
|
||||
'newPassword': password.val(),
|
||||
'uid': templates.get('theirid')
|
||||
}, function(err) {
|
||||
|
||||
currentPassword.val('');
|
||||
@@ -203,12 +204,10 @@ define(['forum/accountheader', 'uploader'], function(header, uploader) {
|
||||
passwordvalid = false;
|
||||
|
||||
if (err) {
|
||||
app.alertError(err.message);
|
||||
return;
|
||||
return app.alertError(err.message);
|
||||
}
|
||||
|
||||
app.alertSuccess('Your password is updated!');
|
||||
|
||||
});
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -83,7 +83,7 @@ define(['uploader'], function(uploader) {
|
||||
var category = {
|
||||
name: $('#inputName').val(),
|
||||
description: $('#inputDescription').val(),
|
||||
icon: $('#new-category-modal i').val(),
|
||||
icon: $('#new-category-modal i').attr('value'),
|
||||
bgColor: '#0059b2',
|
||||
color: '#fff',
|
||||
order: $('.admin-categories #entry-container').children().length + 1
|
||||
@@ -105,10 +105,26 @@ define(['uploader'], function(uploader) {
|
||||
var html = templates.prepare(templates['admin/categories'].blocks['categories']).parse({
|
||||
categories: [data]
|
||||
});
|
||||
html = $(html);
|
||||
html.find('[data-name="bgColor"], [data-name="color"]').each(enableColorPicker);
|
||||
|
||||
$('#entry-container').append(html);
|
||||
$('#new-category-modal').modal('hide');
|
||||
});
|
||||
}
|
||||
|
||||
function enableColorPicker(idx, inputEl) {
|
||||
var jinputEl = $(inputEl),
|
||||
previewEl = jinputEl.parents('[data-cid]').find('.preview-box');
|
||||
|
||||
jinputEl.ColorPicker({
|
||||
color: jinputEl.val() || '#000',
|
||||
onChange: function(hsb, hex) {
|
||||
jinputEl.val('#' + hex);
|
||||
if (inputEl.getAttribute('data-name') === 'bgColor') previewEl.css('background', '#' + hex);
|
||||
else if (inputEl.getAttribute('data-name') === 'color') previewEl.css('color', '#' + hex);
|
||||
modified(inputEl);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -141,21 +157,12 @@ define(['uploader'], function(uploader) {
|
||||
modified(ev.target);
|
||||
});
|
||||
|
||||
$('.dropdown li[data-disabled]').each(function(index, element) {
|
||||
var disabled = $(element).attr('data-disabled');
|
||||
if (disabled == "0" || disabled == "") {
|
||||
$(element).html('<a href="#"><i class="fa fa-power-off"></i> Disable</a>');
|
||||
} else {
|
||||
$(element).html('<a href="#"><i class="fa fa-power-off"></i> Enable</a>');
|
||||
}
|
||||
});
|
||||
|
||||
$('.dropdown').on('click', '[data-disabled]', function(ev) {
|
||||
var btn = $(this);
|
||||
var categoryRow = btn.parents('li');
|
||||
var cid = categoryRow.attr('data-cid');
|
||||
|
||||
var disabled = this.getAttribute('data-disabled') === '0' ? '1' : '0';
|
||||
var disabled = this.getAttribute('data-disabled') === 'false' ? '1' : '0';
|
||||
categoryRow.remove();
|
||||
modified_categories[cid] = modified_categories[cid] || {};
|
||||
modified_categories[cid]['disabled'] = disabled;
|
||||
@@ -165,20 +172,7 @@ define(['uploader'], function(uploader) {
|
||||
});
|
||||
|
||||
// Colour Picker
|
||||
$('[data-name="bgColor"], [data-name="color"]').each(function(idx, inputEl) {
|
||||
var jinputEl = $(this),
|
||||
previewEl = jinputEl.parents('[data-cid]').find('.preview-box');
|
||||
|
||||
jinputEl.ColorPicker({
|
||||
color: this.value || '#000',
|
||||
onChange: function(hsb, hex) {
|
||||
jinputEl.val('#' + hex);
|
||||
if (inputEl.getAttribute('data-name') === 'bgColor') previewEl.css('background', '#' + hex);
|
||||
else if (inputEl.getAttribute('data-name') === 'color') previewEl.css('color', '#' + hex);
|
||||
modified(inputEl);
|
||||
}
|
||||
});
|
||||
});
|
||||
$('[data-name="bgColor"], [data-name="color"]').each(enableColorPicker);
|
||||
|
||||
$('.admin-categories').on('click', '.save', save);
|
||||
|
||||
|
||||
@@ -14,7 +14,23 @@ define(function() {
|
||||
}, function() {
|
||||
window.location.href = RELATIVE_PATH + '/';
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
$.get('https://api.github.com/repos/designcreateplay/NodeBB/tags', function(releases) {
|
||||
var version = $('#version').html(),
|
||||
latestVersion = releases[0].name.slice(1),
|
||||
checkEl = $('.version-check');
|
||||
checkEl.html($('.version-check').html().replace('<i class="fa fa-spinner fa-spin"></i>', 'v' + latestVersion));
|
||||
|
||||
// Alter box colour accordingly
|
||||
if (latestVersion === version) {
|
||||
checkEl.removeClass('alert-info').addClass('alert-success');
|
||||
checkEl.append('<p>You are <strong>up-to-date</strong> <i class="fa fa-check"></i></p>');
|
||||
} else if (latestVersion > version) {
|
||||
checkEl.removeClass('alert-info').addClass('alert-danger');
|
||||
checkEl.append('<p>A new version (v' + latestVersion + ') has been released. Consider upgrading your NodeBB.</p>');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Admin.updateRoomUsage = function(err, data) {
|
||||
|
||||
@@ -218,7 +218,12 @@ define(['taskbar'], function(taskbar) {
|
||||
case 'fa fa-link':
|
||||
if (selectionStart === selectionEnd) {
|
||||
// Nothing selected
|
||||
var cursorPos = postContentEl[0].selectionStart;
|
||||
insertIntoInput(postContentEl, "[link text](link url)");
|
||||
|
||||
// Highlight "link url"
|
||||
postContentEl[0].selectionStart = cursorPos + 12;
|
||||
postContentEl[0].selectionEnd = cursorPos + 20;
|
||||
} else {
|
||||
// Text selected
|
||||
postContentEl.val(postContentEl.val().slice(0, selectionStart) + '[' + postContentEl.val().slice(selectionStart, selectionEnd) + '](link url)' + postContentEl.val().slice(selectionEnd));
|
||||
|
||||
@@ -100,7 +100,13 @@
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li class="permissions"><a href="#"><i class="fa fa-ban"></i> Access Control</a></li>
|
||||
<hr />
|
||||
<li data-disabled="{categories.disabled}"><a href="#"></a></li>
|
||||
<li data-disabled="{categories.disabled}">
|
||||
<!-- IF categories.disabled -->
|
||||
<a href="#"><i class="fa fa-power-off"></i> Enable</a>
|
||||
<!-- ELSE -->
|
||||
<a href="#"><i class="fa fa-power-off"></i> Disable</a>
|
||||
<!-- ENDIF categories.disabled -->
|
||||
</li>
|
||||
</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>
|
||||
|
||||
|
||||
@@ -1,20 +1,36 @@
|
||||
|
||||
<div class="jumbotron">
|
||||
<h1>Welcome to NodeBB</h1>
|
||||
<br />
|
||||
<p>
|
||||
<a target="_blank" href="http://community.nodebb.org" class="btn btn-default btn-lg"><i class="fa fa-comment"></i> NodeBB Community Forum</a>
|
||||
<a target="_blank" href="http://community.nodebb.org/" class="btn btn-default btn-lg"><i class="fa fa-github-alt"></i> Get Plugins and Themes</a>
|
||||
<a target="_blank" href="http://www.twitter.com/NodeBB" class="btn btn-default btn-lg"><i class="fa fa-twitter"></i> Follow @NodeBB</a>
|
||||
<a target="_blank" href="https://github.com/designcreateplay/NodeBB/wiki" class="btn btn-default btn-lg"><i class="fa fa-question-circle"></i> NodeBB Wiki</a>
|
||||
</p>
|
||||
<p><small>You are running <strong>NodeBB v{version}</strong>. Always make sure that your <strong>NodeBB</strong> is up to date for the latest security patches and bug fixes.</small></p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="">
|
||||
<h2>Active Users <small><span class="badge" id="connections"></span> socket connections</small></h2>
|
||||
<p id="active_users">
|
||||
|
||||
</p>
|
||||
</div>
|
||||
<div class="home">
|
||||
<div class="col-sm-6">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">Welcome to NodeBB</div>
|
||||
<div class="panel-body">
|
||||
<p>
|
||||
<a target="_blank" href="http://community.nodebb.org" class="btn btn-default btn-sm"><i class="fa fa-comment"></i> NodeBB Community Forum</a>
|
||||
<a target="_blank" href="http://community.nodebb.org/" class="btn btn-default btn-sm"><i class="fa fa-github-alt"></i> Get Plugins and Themes</a>
|
||||
<a target="_blank" href="http://www.twitter.com/NodeBB" class="btn btn-default btn-sm"><i class="fa fa-twitter"></i> Follow @NodeBB</a>
|
||||
<a target="_blank" href="https://github.com/designcreateplay/NodeBB/wiki" class="btn btn-default btn-sm"><i class="fa fa-question-circle"></i> NodeBB Wiki</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">Active Users <small><span class="badge" id="connections"></span> socket connections</small></div>
|
||||
<div class="panel-body">
|
||||
<div id="active_users"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">Updates</div>
|
||||
<div class="panel-body">
|
||||
<div class="alert alert-info version-check">
|
||||
<p>You are running <strong>NodeBB v<span id="version">{version}</span></strong>.</p>
|
||||
</div>
|
||||
<p>
|
||||
Always make sure that your <strong>NodeBB</strong> is up to date for the latest security patches and bug fixes.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -296,4 +296,4 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -30,6 +30,7 @@ var db = require('./database'),
|
||||
description: data.description,
|
||||
icon: data.icon,
|
||||
bgColor: data.bgColor,
|
||||
background: data.bgColor,
|
||||
color: data.color,
|
||||
slug: slug,
|
||||
topic_count: 0,
|
||||
@@ -96,7 +97,7 @@ var db = require('./database'),
|
||||
'category_name': results.category.name,
|
||||
'category_description': results.category.description,
|
||||
'link': results.category.link,
|
||||
'disabled': results.category.disabled || '0',
|
||||
'disabled': results.category.disabled,
|
||||
'topic_row_size': 'col-md-9',
|
||||
'category_id': category_id,
|
||||
'active_users': results.active_users,
|
||||
@@ -167,6 +168,7 @@ var db = require('./database'),
|
||||
if(err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
if(cids && cids.length === 0) {
|
||||
return callback(null, {categories : []});
|
||||
}
|
||||
@@ -301,6 +303,7 @@ var db = require('./database'),
|
||||
if (exists) {
|
||||
db.getObject('category:' + cid, function(err, data) {
|
||||
data.background = data.image ? 'url(' + data.image + ')' : data.bgColor;
|
||||
data.disabled = data.disabled ? parseInt(data.disabled, 10) !== 0 : false;
|
||||
callback(err, data);
|
||||
});
|
||||
} else {
|
||||
|
||||
@@ -13,6 +13,17 @@ var fs = require('fs'),
|
||||
logWithUser(uid, 'changed password');
|
||||
}
|
||||
|
||||
events.logAdminChangeUserPassword = function(adminUid, theirUid) {
|
||||
user.getMultipleUserFields([adminUid, theirUid], ['username'], function(err, userData) {
|
||||
if(err) {
|
||||
return winston.error('Error logging event. ' + err.message);
|
||||
}
|
||||
|
||||
var msg = userData[0].username + '(uid ' + adminUid + ') changed password of ' + userData[1].username + '(uid ' + theirUid + ')';
|
||||
events.log(msg);
|
||||
});
|
||||
}
|
||||
|
||||
events.logPasswordReset = function(uid) {
|
||||
logWithUser(uid, 'reset password');
|
||||
}
|
||||
@@ -53,11 +64,10 @@ var fs = require('fs'),
|
||||
|
||||
user.getUserField(uid, 'username', function(err, username) {
|
||||
if(err) {
|
||||
winston.error('Error logging event. ' + err.message);
|
||||
return;
|
||||
return winston.error('Error logging event. ' + err.message);
|
||||
}
|
||||
|
||||
var msg = '[' + new Date().toUTCString() + '] - ' + username + '(uid ' + uid + ') ' + string;
|
||||
var msg = username + '(uid ' + uid + ') ' + string;
|
||||
events.log(msg);
|
||||
});
|
||||
}
|
||||
@@ -65,6 +75,8 @@ var fs = require('fs'),
|
||||
events.log = function(msg) {
|
||||
var logFile = path.join(nconf.get('base_dir'), logFileName);
|
||||
|
||||
msg = '[' + new Date().toUTCString() + '] - ' + msg;
|
||||
|
||||
fs.appendFile(logFile, msg + '\n', function(err) {
|
||||
if(err) {
|
||||
winston.error('Error logging event. ' + err.message);
|
||||
|
||||
@@ -127,7 +127,7 @@ var async = require('async'),
|
||||
if (nids && nids.length > 0) {
|
||||
async.each(nids, function(nid, next) {
|
||||
Notifications.get(nid, uid, function(nid_info) {
|
||||
if (nid_info.uniqueId === uniqueId) {
|
||||
if (nid_info && nid_info.uniqueId === uniqueId) {
|
||||
db.sortedSetRemove('uid:' + uid + ':notifications:unread', nid);
|
||||
}
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ var winston = require('winston'),
|
||||
], function(err, results) {
|
||||
websockets.in('topic_' + results[0].tid).emit('event:post_edited', {
|
||||
pid: pid,
|
||||
title: validator.sanitize(title).escape(),
|
||||
title: validator.escape(title),
|
||||
isMainPost: results[0].isMainPost,
|
||||
content: results[1]
|
||||
});
|
||||
|
||||
@@ -291,7 +291,7 @@ var db = require('./database'),
|
||||
postData.categoryName = categoryData.name;
|
||||
postData.categoryIcon = categoryData.icon;
|
||||
postData.categorySlug = categoryData.slug;
|
||||
postData.title = validator.sanitize(topicData.title).escape();
|
||||
postData.title = validator.escape(topicData.title);
|
||||
postData.topicSlug = topicData.slug;
|
||||
next(null, postData);
|
||||
})
|
||||
|
||||
@@ -318,7 +318,7 @@ var nconf = require('nconf'),
|
||||
app.get('/categories/active', function (req, res) {
|
||||
categories.getAllCategories(0, function (err, data) {
|
||||
data.categories = data.categories.filter(function (category) {
|
||||
return (!category.disabled || parseInt(category.disabled, 10) === 0);
|
||||
return !category.disabled;
|
||||
});
|
||||
res.json(data);
|
||||
});
|
||||
@@ -327,7 +327,7 @@ var nconf = require('nconf'),
|
||||
app.get('/categories/disabled', function (req, res) {
|
||||
categories.getAllCategories(0, function (err, data) {
|
||||
data.categories = data.categories.filter(function (category) {
|
||||
return parseInt(category.disabled, 10) === 1;
|
||||
return category.disabled;
|
||||
});
|
||||
res.json(data);
|
||||
});
|
||||
@@ -377,7 +377,10 @@ var nconf = require('nconf'),
|
||||
if(err) {
|
||||
return next(err);
|
||||
}
|
||||
res.json(200, {eventdata: data.toString()});
|
||||
if(data) {
|
||||
data = data.toString().split('\n').reverse().join('\n');
|
||||
}
|
||||
res.json(200, {eventdata: data});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ var path = require('path'),
|
||||
categories.getAllCategories(uid, function (err, data) {
|
||||
|
||||
data.categories = data.categories.filter(function (category) {
|
||||
return (!category.disabled || parseInt(category.disabled, 10) === 0);
|
||||
return !category.disabled;
|
||||
});
|
||||
|
||||
function canSee(category, next) {
|
||||
@@ -241,7 +241,7 @@ var path = require('path'),
|
||||
data.currentPage = page;
|
||||
data.privileges = privileges;
|
||||
|
||||
if (data && parseInt(data.disabled, 10) === 0) {
|
||||
if (data && !data.disabled) {
|
||||
res.json(data);
|
||||
} else {
|
||||
next();
|
||||
|
||||
@@ -13,7 +13,7 @@ var nconf = require('nconf'),
|
||||
if (typeof returnData === 'object') {
|
||||
res.json(200, returnData);
|
||||
} else {
|
||||
res.send(200, validator.sanitize(returnData).escape());
|
||||
res.send(200, validator.escape(returnData));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -279,7 +279,7 @@ var async = require('async'),
|
||||
}
|
||||
|
||||
if(data) {
|
||||
data.title = validator.sanitize(data.title).escape();
|
||||
data.title = validator.escape(data.title);
|
||||
data.relativeTime = utils.toISOString(data.timestamp);
|
||||
}
|
||||
|
||||
|
||||
61
src/user.js
61
src/user.js
@@ -4,7 +4,6 @@ var bcrypt = require('bcryptjs'),
|
||||
winston = require('winston'),
|
||||
gravatar = require('gravatar'),
|
||||
check = require('validator').check,
|
||||
sanitize = require('validator').sanitize,
|
||||
S = require('string'),
|
||||
|
||||
utils = require('./../public/src/utils'),
|
||||
@@ -335,7 +334,7 @@ var bcrypt = require('bcryptjs'),
|
||||
}
|
||||
|
||||
data[field] = data[field].trim();
|
||||
data[field] = sanitize(data[field]).escape();
|
||||
data[field] = validator.escape(data[field]);
|
||||
|
||||
if (field === 'email') {
|
||||
User.getUserFields(uid, ['email', 'picture', 'uploadedpicture'], function(err, userData) {
|
||||
@@ -424,27 +423,59 @@ var bcrypt = require('bcryptjs'),
|
||||
};
|
||||
|
||||
User.changePassword = function(uid, data, callback) {
|
||||
if(!data || !data.uid) {
|
||||
return callback(new Error('invalid-uid'));
|
||||
}
|
||||
|
||||
function hashAndSetPassword(callback) {
|
||||
User.hashPassword(data.newPassword, function(err, hash) {
|
||||
if(err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
User.setUserField(data.uid, 'password', hash, function(err) {
|
||||
if(err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
if(parseInt(uid, 10) === parseInt(data.uid, 10)) {
|
||||
events.logPasswordChange(data.uid);
|
||||
} else {
|
||||
events.logAdminChangeUserPassword(uid, data.uid);
|
||||
}
|
||||
|
||||
callback();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if (!utils.isPasswordValid(data.newPassword)) {
|
||||
return callback(new Error('Invalid password!'));
|
||||
}
|
||||
|
||||
User.getUserField(uid, 'password', function(err, currentPassword) {
|
||||
bcrypt.compare(data.currentPassword, currentPassword, function(err, res) {
|
||||
if (err) {
|
||||
if(parseInt(uid, 10) !== parseInt(data.uid, 10)) {
|
||||
User.isAdministrator(uid, function(err, isAdmin) {
|
||||
if(err || !isAdmin) {
|
||||
return callback(err || new Error('not-allowed'));
|
||||
}
|
||||
|
||||
hashAndSetPassword(callback);
|
||||
});
|
||||
} else {
|
||||
User.getUserField(uid, 'password', function(err, currentPassword) {
|
||||
if(err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
if (res) {
|
||||
User.hashPassword(data.newPassword, function(err, hash) {
|
||||
User.setUserField(uid, 'password', hash);
|
||||
events.logPasswordChange(uid);
|
||||
callback(null);
|
||||
});
|
||||
} else {
|
||||
callback(new Error('Your current password is not correct!'));
|
||||
}
|
||||
bcrypt.compare(data.currentPassword, currentPassword, function(err, res) {
|
||||
if (err || !res) {
|
||||
return callback(err || new Error('Your current password is not correct!'));
|
||||
}
|
||||
|
||||
hashAndSetPassword(callback);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
User.setUserField = function(uid, field, value, callback) {
|
||||
|
||||
@@ -132,16 +132,6 @@ module.exports.server = server;
|
||||
href: nconf.get('relative_path') + '/favicon.ico'
|
||||
});
|
||||
|
||||
// Browser Title
|
||||
var metaTitle = templateValues.metaTags.filter(function(tag) {
|
||||
return tag.property === 'og:title';
|
||||
});
|
||||
if (metaTitle.length > 0 && metaTitle[0].content) {
|
||||
templateValues.browserTitle = metaTitle[0].content;
|
||||
} else {
|
||||
templateValues.browserTitle = meta.config.browserTitle || 'NodeBB';
|
||||
}
|
||||
|
||||
if(options.req.user && options.req.user.uid) {
|
||||
uid = options.req.user.uid;
|
||||
}
|
||||
@@ -153,15 +143,34 @@ module.exports.server = server;
|
||||
templateValues.customCSS = meta.config.customCSS;
|
||||
}
|
||||
|
||||
user.isAdministrator(uid, function(err, isAdmin) {
|
||||
templateValues.isAdmin = isAdmin;
|
||||
async.parallel([
|
||||
function(next) {
|
||||
translator.get('pages:' + path.basename(options.req.url), function(translated) {
|
||||
var metaTitle = templateValues.metaTags.filter(function(tag) {
|
||||
return tag.name === 'title';
|
||||
});
|
||||
if (translated) {
|
||||
templateValues.browserTitle = translated;
|
||||
} else if (metaTitle.length > 0 && metaTitle[0].content) {
|
||||
templateValues.browserTitle = metaTitle[0].content;
|
||||
} else {
|
||||
templateValues.browserTitle = meta.config.browserTitle || 'NodeBB';
|
||||
}
|
||||
|
||||
next();
|
||||
});
|
||||
},
|
||||
function(next) {
|
||||
user.isAdministrator(uid, function(err, isAdmin) {
|
||||
templateValues.isAdmin = isAdmin || false;
|
||||
next();
|
||||
});
|
||||
}
|
||||
], function() {
|
||||
translator.translate(templates.header.parse(templateValues), function(template) {
|
||||
callback(null, template);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
@@ -504,7 +513,7 @@ module.exports.server = server;
|
||||
|
||||
categories.getAllCategories(0, function (err, returnData) {
|
||||
returnData.categories = returnData.categories.filter(function (category) {
|
||||
return parseInt(category.disabled, 10) !== 1;
|
||||
return !category.disabled;
|
||||
});
|
||||
|
||||
async.filter(returnData.categories, canSee, function(visibleCategories) {
|
||||
@@ -565,7 +574,6 @@ module.exports.server = server;
|
||||
function (topicData, next) {
|
||||
|
||||
var lastMod = topicData.timestamp,
|
||||
sanitize = validator.sanitize,
|
||||
description = (function() {
|
||||
var content = '';
|
||||
if(topicData.posts.length) {
|
||||
@@ -576,7 +584,7 @@ module.exports.server = server;
|
||||
content = content.substr(0, 255) + '...';
|
||||
}
|
||||
|
||||
return sanitize(content).escape();
|
||||
return validator.escape(content);
|
||||
})(),
|
||||
timestamp;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user