diff --git a/package.json b/package.json index f9588447f1..424f97d689 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "rss": "~0.2.0", "prompt": "~0.2.11", "uglify-js": "~2.4.0", - "validator": "~1.5.1", + "validator": "~3.2.1", "nodebb-plugin-mentions": "~0.4", "nodebb-plugin-markdown": "~0.3", "nodebb-theme-vanilla": "~0.0.13", diff --git a/public/language/ar/pages.json b/public/language/ar/pages.json index fa44fbfe46..d60e0a0a9b 100644 --- a/public/language/ar/pages.json +++ b/public/language/ar/pages.json @@ -1,6 +1,7 @@ { "home": "Home", "unread": "Unread Topics", + "popular": "Popular Topics", "recent": "Recent Topics", "users": "Registered Users", "notifications": "Notifications", diff --git a/public/language/cs/pages.json b/public/language/cs/pages.json index fa44fbfe46..d60e0a0a9b 100644 --- a/public/language/cs/pages.json +++ b/public/language/cs/pages.json @@ -1,6 +1,7 @@ { "home": "Home", "unread": "Unread Topics", + "popular": "Popular Topics", "recent": "Recent Topics", "users": "Registered Users", "notifications": "Notifications", diff --git a/public/language/de/global.json b/public/language/de/global.json index e301e623b4..7a6910df88 100644 --- a/public/language/de/global.json +++ b/public/language/de/global.json @@ -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" } \ No newline at end of file diff --git a/public/language/de/notifications.json b/public/language/de/notifications.json index 806e837806..b38e73a7bc 100644 --- a/public/language/de/notifications.json +++ b/public/language/de/notifications.json @@ -1,7 +1,7 @@ { "title": "Benachrichtigungen", - "no_notifs": "You have no new notifications", - "see_all": "See all Notifications", + "no_notifs": "Du hast keine neuen Benachrichtigungen", + "see_all": "Alle Benachrichtigungen ansehen", "back_to_home": "Zurück zur Startseite", "outgoing_link": "Externer Link", "outgoing_link_message": "Du verlässt nun", diff --git a/public/language/de/pages.json b/public/language/de/pages.json index fa44fbfe46..d60e0a0a9b 100644 --- a/public/language/de/pages.json +++ b/public/language/de/pages.json @@ -1,6 +1,7 @@ { "home": "Home", "unread": "Unread Topics", + "popular": "Popular Topics", "recent": "Recent Topics", "users": "Registered Users", "notifications": "Notifications", diff --git a/public/language/de/recent.json b/public/language/de/recent.json index 33ec31df44..b787bae5cc 100644 --- a/public/language/de/recent.json +++ b/public/language/de/recent.json @@ -3,5 +3,5 @@ "day": "Tag", "week": "Woche", "month": "Monat", - "no_recent_topics": "There are no recent topics." + "no_recent_topics": "Es gibt keine aktuellen Themen." } \ No newline at end of file diff --git a/public/language/de/topic.json b/public/language/de/topic.json index fc52499c9c..2c073da3db 100644 --- a/public/language/de/topic.json +++ b/public/language/de/topic.json @@ -2,7 +2,7 @@ "topic": "Thema", "topics": "Themen", "no_topics_found": "Keine passende Themen gefunden.", - "no_posts_found": "No posts found!", + "no_posts_found": "Keine Beiträge gefunden!", "profile": "Profil", "posted_by": "Geposted von", "chat": "Chat", @@ -19,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" } \ No newline at end of file diff --git a/public/language/de/user.json b/public/language/de/user.json index 4acbcc6c91..ae5f8f2993 100644 --- a/public/language/de/user.json +++ b/public/language/de/user.json @@ -9,7 +9,7 @@ "age": "Alter", "joined": "Beigetreten", "lastonline": "Zuletzt online", - "profile": "Profile", + "profile": "Profil", "profile_views": "Profilaufrufe", "reputation": "Reputation", "posts": "Posts", @@ -20,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" } \ No newline at end of file diff --git a/public/language/en_GB/pages.json b/public/language/en_GB/pages.json index d01f5f8a9b..9fc75d3d2b 100644 --- a/public/language/en_GB/pages.json +++ b/public/language/en_GB/pages.json @@ -1,6 +1,7 @@ { "home": "Home", "unread": "Unread Topics", + "popular": "Popular Topics", "recent": "Recent Topics", "users": "Registered Users", "notifications": "Notifications", diff --git a/public/language/es/pages.json b/public/language/es/pages.json index fa44fbfe46..d60e0a0a9b 100644 --- a/public/language/es/pages.json +++ b/public/language/es/pages.json @@ -1,6 +1,7 @@ { "home": "Home", "unread": "Unread Topics", + "popular": "Popular Topics", "recent": "Recent Topics", "users": "Registered Users", "notifications": "Notifications", diff --git a/public/language/fi/pages.json b/public/language/fi/pages.json index fa44fbfe46..d60e0a0a9b 100644 --- a/public/language/fi/pages.json +++ b/public/language/fi/pages.json @@ -1,6 +1,7 @@ { "home": "Home", "unread": "Unread Topics", + "popular": "Popular Topics", "recent": "Recent Topics", "users": "Registered Users", "notifications": "Notifications", diff --git a/public/language/fr/pages.json b/public/language/fr/pages.json index baf9d9473e..3c61eb6cf8 100644 --- a/public/language/fr/pages.json +++ b/public/language/fr/pages.json @@ -1,6 +1,7 @@ { "home": "Accueil", "unread": "Sujets non lus", + "popular": "Popular Topics", "recent": "Sujets Récents", "users": "Utilisateurs enregistrés", "notifications": "Notifications", diff --git a/public/language/he/pages.json b/public/language/he/pages.json index a7cf97124d..0ff571585f 100644 --- a/public/language/he/pages.json +++ b/public/language/he/pages.json @@ -1,6 +1,7 @@ { "home": "דף הבית", "unread": "נושאים שלא נקראו", + "popular": "Popular Topics", "recent": "נושאים אחרונים", "users": "משתמשים רשומים", "notifications": "התראות", diff --git a/public/language/hu/pages.json b/public/language/hu/pages.json index 2cd8f7a0ce..00a3c97c1a 100644 --- a/public/language/hu/pages.json +++ b/public/language/hu/pages.json @@ -1,6 +1,7 @@ { "home": "Kezdőlap", "unread": "Olvasatlan Topikok", + "popular": "Popular Topics", "recent": "Friss Topikok", "users": "Regisztrált Felhasználók", "notifications": "Értesítések", diff --git a/public/language/it/pages.json b/public/language/it/pages.json index fa44fbfe46..d60e0a0a9b 100644 --- a/public/language/it/pages.json +++ b/public/language/it/pages.json @@ -1,6 +1,7 @@ { "home": "Home", "unread": "Unread Topics", + "popular": "Popular Topics", "recent": "Recent Topics", "users": "Registered Users", "notifications": "Notifications", diff --git a/public/language/nb/pages.json b/public/language/nb/pages.json index cf9620b18a..60940216d0 100644 --- a/public/language/nb/pages.json +++ b/public/language/nb/pages.json @@ -1,6 +1,7 @@ { "home": "Hjem", "unread": "Uleste emner", + "popular": "Popular Topics", "recent": "Seneste emner", "users": "Registrerte brukere", "notifications": "Varsler", diff --git a/public/language/pl/global.json b/public/language/pl/global.json index 0a908625df..b8f5162365 100644 --- a/public/language/pl/global.json +++ b/public/language/pl/global.json @@ -10,14 +10,14 @@ "500.message": "Coś poszło nie tak.", "register": "Zarejestruj się", "login": "Zaloguj się", - "welcome_back": "Welcome Back ", - "you_have_successfully_logged_in": "You have successfully logged in", + "welcome_back": "Witaj z powrotem!", + "you_have_successfully_logged_in": "Zostałeś pomyślnie zalogowany.", "logout": "Wyloguj się", "logout.title": "Wylogowałeś się.", "logout.message": "Pomyślnie wylogowałeś się z forum.", "save_changes": "Zapisz zmiany", "close": "Zamknij", - "pagination": "Pagination", + "pagination": "Numerowanie stron", "header.admin": "Administracja", "header.recent": "Ostatnie", "header.unread": "Nieprzeczytane", @@ -52,5 +52,5 @@ "dnd": "Nie przeszkadzać", "invisible": "Niewidoczny", "offline": "Niedostępny", - "privacy": "Privacy" + "privacy": "Prywatność" } \ No newline at end of file diff --git a/public/language/pl/pages.json b/public/language/pl/pages.json index a966a141cb..ee44ea945b 100644 --- a/public/language/pl/pages.json +++ b/public/language/pl/pages.json @@ -1,6 +1,7 @@ { "home": "Strona główna", "unread": "Nieprzeczytane wątki", + "popular": "Popular Topics", "recent": "Ostatnie wątki", "users": "Zarejestrowani użytkownicy", "notifications": "Powiadomienia", diff --git a/public/language/pl/topic.json b/public/language/pl/topic.json index 9cd30f9296..020d68d6c2 100644 --- a/public/language/pl/topic.json +++ b/public/language/pl/topic.json @@ -19,15 +19,15 @@ "tools": "Narzędzia", "flag": "Zgłoś", "flag_title": "Zgłoś post do moderacji", - "deleted_message": "This thread has been deleted. Only users with thread management privileges can see it.", - "watch": "Watch", - "share_this_post": "Share this Post", + "deleted_message": "Ten wątek został usunięty. Tylko użytkownicy z uprawnieniami do zarządzania wątkami mogą go widzieć.", + "watch": "Obserwuj", + "share_this_post": "Udostępnij", "thread_tools.title": "Narzędzia wątków", "thread_tools.markAsUnreadForAll": "Oznacz jako nieprzeczytany", "thread_tools.pin": "Przypnij wątek", - "thread_tools.unpin": "Unpin Topic", + "thread_tools.unpin": "Odepnij wątek", "thread_tools.lock": "Zamknij wątek", - "thread_tools.unlock": "Unlock Topic", + "thread_tools.unlock": "Otwórz wątek", "thread_tools.move": "Przenieś wątek", "thread_tools.fork": "Skopiuj wątek", "thread_tools.delete": "Usuń wątek", diff --git a/public/language/pl/user.json b/public/language/pl/user.json index e438b566ae..36d9b509ec 100644 --- a/public/language/pl/user.json +++ b/public/language/pl/user.json @@ -26,7 +26,7 @@ "edit": "Edytuj", "uploaded_picture": "Przesłane zdjęcie", "upload_new_picture": "Prześlij nowe zdjęcie", - "current_password": "Current Password", + "current_password": "Obecne hasło", "change_password": "Zmień hasło", "confirm_password": "Potwierdź hasło", "password": "Hasło", diff --git a/public/language/pt_BR/pages.json b/public/language/pt_BR/pages.json index 0519cf223e..8f6d6f08e8 100644 --- a/public/language/pt_BR/pages.json +++ b/public/language/pt_BR/pages.json @@ -1,6 +1,7 @@ { "home": "Home", "unread": "Tópicos Não Lidos", + "popular": "Popular Topics", "recent": "Tópicos Recentes", "users": "Usuários Registrados", "notifications": "Notificações", diff --git a/public/language/ru/notifications.json b/public/language/ru/notifications.json index 87245bd6f3..8749bb8a50 100644 --- a/public/language/ru/notifications.json +++ b/public/language/ru/notifications.json @@ -1,7 +1,7 @@ { "title": "Уведомления", - "no_notifs": "You have no new notifications", - "see_all": "See all Notifications", + "no_notifs": "Для Вас нет новых уведомлений", + "see_all": "Просмотреть все уведомления", "back_to_home": "Вернуться на NodeBB", "outgoing_link": "Внешняя ссылка", "outgoing_link_message": "Вы покидаете", diff --git a/public/language/ru/pages.json b/public/language/ru/pages.json index b4a44b79e7..0d5f5b9ca9 100644 --- a/public/language/ru/pages.json +++ b/public/language/ru/pages.json @@ -1,6 +1,7 @@ { "home": "Главная", "unread": "Непрочитанные темы", + "popular": "Popular Topics", "recent": "Последние темы", "users": "Зарегистрированные пользователи", "notifications": "Уведомления", diff --git a/public/language/ru/topic.json b/public/language/ru/topic.json index 785cacbf07..2ab3aadc57 100644 --- a/public/language/ru/topic.json +++ b/public/language/ru/topic.json @@ -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", diff --git a/public/language/sk/pages.json b/public/language/sk/pages.json index fa44fbfe46..d60e0a0a9b 100644 --- a/public/language/sk/pages.json +++ b/public/language/sk/pages.json @@ -1,6 +1,7 @@ { "home": "Home", "unread": "Unread Topics", + "popular": "Popular Topics", "recent": "Recent Topics", "users": "Registered Users", "notifications": "Notifications", diff --git a/public/language/sv/pages.json b/public/language/sv/pages.json index 585c08b83b..dd938e334f 100644 --- a/public/language/sv/pages.json +++ b/public/language/sv/pages.json @@ -1,6 +1,7 @@ { "home": "Hem", "unread": "Olästa ämnen", + "popular": "Popular Topics", "recent": "Senaste ämnena", "users": "Registrerade användare", "notifications": "Notiser", diff --git a/public/language/tr/pages.json b/public/language/tr/pages.json index 4f3ecda974..55f625162f 100644 --- a/public/language/tr/pages.json +++ b/public/language/tr/pages.json @@ -1,6 +1,7 @@ { "home": "Ana Sayfa", "unread": "Okunmayan Başlıklar", + "popular": "Popular Topics", "recent": "Güncel Konular", "users": "Kayıtlı Kullanıcılar", "notifications": "Bildirimler", diff --git a/public/language/zh_CN/global.json b/public/language/zh_CN/global.json index abc3e33663..ca76a1ea64 100644 --- a/public/language/zh_CN/global.json +++ b/public/language/zh_CN/global.json @@ -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": "你已经退出。", diff --git a/public/language/zh_CN/login.json b/public/language/zh_CN/login.json index 5c426ecbb3..25fe9a81f2 100644 --- a/public/language/zh_CN/login.json +++ b/public/language/zh_CN/login.json @@ -6,5 +6,5 @@ "forgot_password": "忘记密码?", "alternative_logins": "其他登录方式", "failed_login_attempt": "登录失败,请再尝试。", - "login_successful": "你已成功登录!" + "login_successful": "您已经成功登录!" } \ No newline at end of file diff --git a/public/language/zh_CN/pages.json b/public/language/zh_CN/pages.json index fa44fbfe46..d60e0a0a9b 100644 --- a/public/language/zh_CN/pages.json +++ b/public/language/zh_CN/pages.json @@ -1,6 +1,7 @@ { "home": "Home", "unread": "Unread Topics", + "popular": "Popular Topics", "recent": "Recent Topics", "users": "Registered Users", "notifications": "Notifications", diff --git a/public/language/zh_CN/user.json b/public/language/zh_CN/user.json index a9ed9e4495..698abc17c6 100644 --- a/public/language/zh_CN/user.json +++ b/public/language/zh_CN/user.json @@ -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": "每页帖子数量设置" } \ No newline at end of file diff --git a/public/language/zh_TW/pages.json b/public/language/zh_TW/pages.json index fa44fbfe46..d60e0a0a9b 100644 --- a/public/language/zh_TW/pages.json +++ b/public/language/zh_TW/pages.json @@ -1,6 +1,7 @@ { "home": "Home", "unread": "Unread Topics", + "popular": "Popular Topics", "recent": "Recent Topics", "users": "Registered Users", "notifications": "Notifications", diff --git a/public/src/ajaxify.js b/public/src/ajaxify.js index ffaa39a189..fcd045c5d5 100644 --- a/public/src/ajaxify.js +++ b/public/src/ajaxify.js @@ -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)); diff --git a/public/src/forum/accountedit.js b/public/src/forum/accountedit.js index 0deeda57c7..13bab6cf9d 100644 --- a/public/src/forum/accountedit.js +++ b/public/src/forum/accountedit.js @@ -190,10 +190,11 @@ define(['forum/accountheader', 'uploader'], function(header, uploader) { $('#changePasswordBtn').on('click', function() { - if (passwordvalid && passwordsmatch && currentPassword.val()) { + if (passwordvalid && passwordsmatch && (currentPassword.val() || app.isAdmin)) { socket.emit('user.changePassword', { 'currentPassword': currentPassword.val(), - 'newPassword': password.val() + 'newPassword': password.val(), + 'uid': templates.get('theirid') }, function(err) { currentPassword.val(''); @@ -203,12 +204,10 @@ define(['forum/accountheader', 'uploader'], function(header, uploader) { passwordvalid = false; if (err) { - app.alertError(err.message); - return; + return app.alertError(err.message); } app.alertSuccess('Your password is updated!'); - }); } return false; diff --git a/public/src/forum/admin/categories.js b/public/src/forum/admin/categories.js index e9840d8968..7b4f761c52 100644 --- a/public/src/forum/admin/categories.js +++ b/public/src/forum/admin/categories.js @@ -83,7 +83,7 @@ define(['uploader'], function(uploader) { var category = { name: $('#inputName').val(), description: $('#inputDescription').val(), - icon: $('#new-category-modal i').val(), + icon: $('#new-category-modal i').attr('value'), bgColor: '#0059b2', color: '#fff', order: $('.admin-categories #entry-container').children().length + 1 @@ -105,10 +105,26 @@ define(['uploader'], function(uploader) { var html = templates.prepare(templates['admin/categories'].blocks['categories']).parse({ categories: [data] }); + html = $(html); + html.find('[data-name="bgColor"], [data-name="color"]').each(enableColorPicker); $('#entry-container').append(html); $('#new-category-modal').modal('hide'); + }); + } + + function enableColorPicker(idx, inputEl) { + var jinputEl = $(inputEl), + previewEl = jinputEl.parents('[data-cid]').find('.preview-box'); + jinputEl.ColorPicker({ + color: jinputEl.val() || '#000', + onChange: function(hsb, hex) { + jinputEl.val('#' + hex); + if (inputEl.getAttribute('data-name') === 'bgColor') previewEl.css('background', '#' + hex); + else if (inputEl.getAttribute('data-name') === 'color') previewEl.css('color', '#' + hex); + modified(inputEl); + } }); } @@ -141,21 +157,12 @@ define(['uploader'], function(uploader) { modified(ev.target); }); - $('.dropdown li[data-disabled]').each(function(index, element) { - var disabled = $(element).attr('data-disabled'); - if (disabled == "0" || disabled == "") { - $(element).html(' Disable'); - } else { - $(element).html(' Enable'); - } - }); - $('.dropdown').on('click', '[data-disabled]', function(ev) { var btn = $(this); var categoryRow = btn.parents('li'); var cid = categoryRow.attr('data-cid'); - var disabled = this.getAttribute('data-disabled') === '0' ? '1' : '0'; + var disabled = this.getAttribute('data-disabled') === 'false' ? '1' : '0'; categoryRow.remove(); modified_categories[cid] = modified_categories[cid] || {}; modified_categories[cid]['disabled'] = disabled; @@ -165,20 +172,7 @@ define(['uploader'], function(uploader) { }); // Colour Picker - $('[data-name="bgColor"], [data-name="color"]').each(function(idx, inputEl) { - var jinputEl = $(this), - previewEl = jinputEl.parents('[data-cid]').find('.preview-box'); - - jinputEl.ColorPicker({ - color: this.value || '#000', - onChange: function(hsb, hex) { - jinputEl.val('#' + hex); - if (inputEl.getAttribute('data-name') === 'bgColor') previewEl.css('background', '#' + hex); - else if (inputEl.getAttribute('data-name') === 'color') previewEl.css('color', '#' + hex); - modified(inputEl); - } - }); - }); + $('[data-name="bgColor"], [data-name="color"]').each(enableColorPicker); $('.admin-categories').on('click', '.save', save); diff --git a/public/src/forum/admin/index.js b/public/src/forum/admin/index.js index c99dd43cb9..914676115d 100644 --- a/public/src/forum/admin/index.js +++ b/public/src/forum/admin/index.js @@ -14,7 +14,23 @@ define(function() { }, function() { window.location.href = RELATIVE_PATH + '/'; }); - }) + }); + + $.get('https://api.github.com/repos/designcreateplay/NodeBB/tags', function(releases) { + var version = $('#version').html(), + latestVersion = releases[0].name.slice(1), + checkEl = $('.version-check'); + checkEl.html($('.version-check').html().replace('', 'v' + latestVersion)); + + // Alter box colour accordingly + if (latestVersion === version) { + checkEl.removeClass('alert-info').addClass('alert-success'); + checkEl.append('
You are up-to-date
'); + } else if (latestVersion > version) { + checkEl.removeClass('alert-info').addClass('alert-danger'); + checkEl.append('A new version (v' + latestVersion + ') has been released. Consider upgrading your NodeBB.
'); + } + }); }; Admin.updateRoomUsage = function(err, data) { diff --git a/public/src/modules/composer.js b/public/src/modules/composer.js index d5ba7e8e73..79299e82e0 100644 --- a/public/src/modules/composer.js +++ b/public/src/modules/composer.js @@ -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)); diff --git a/public/templates/admin/categories.tpl b/public/templates/admin/categories.tpl index c89bbf2806..b25f2f8218 100644 --- a/public/templates/admin/categories.tpl +++ b/public/templates/admin/categories.tpl @@ -100,7 +100,13 @@ diff --git a/public/templates/admin/index.tpl b/public/templates/admin/index.tpl index aa4838ef35..0ff8383dc3 100644 --- a/public/templates/admin/index.tpl +++ b/public/templates/admin/index.tpl @@ -1,20 +1,36 @@ - -- NodeBB Community Forum - Get Plugins and Themes - Follow @NodeBB - NodeBB Wiki -
-You are running NodeBB v{version}. Always make sure that your NodeBB is up to date for the latest security patches and bug fixes.
-- -
-You are running NodeBB v{version}.
++ Always make sure that your NodeBB is up to date for the latest security patches and bug fixes. +
+