Browse Source

Show message to group chat when new room is joined.

pull/16/head
Simon Eisenmann 11 years ago
parent
commit
3e48b88a6f
  1. 8
      src/i18n/messages-de.po
  2. 6
      src/i18n/messages.pot
  3. 4
      static/js/controllers/chatroomcontroller.js
  4. 16
      static/js/directives/chat.js
  5. 2
      static/translation/messages-de.json

8
src/i18n/messages-de.po

@ -8,8 +8,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Spreed Speak Freely\n" "Project-Id-Version: Spreed Speak Freely\n"
"Report-Msgid-Bugs-To: simon@struktur.de\n" "Report-Msgid-Bugs-To: simon@struktur.de\n"
"POT-Creation-Date: 2014-03-17 13:05+0100\n" "POT-Creation-Date: 2014-03-18 14:40+0100\n"
"PO-Revision-Date: 2014-03-14 18:57+0100\n" "PO-Revision-Date: 2014-03-18 14:41+0100\n"
"Last-Translator: Simon Eisenmann <simon@struktur.de>\n" "Last-Translator: Simon Eisenmann <simon@struktur.de>\n"
"Language-Team: de <LL@li.org>\n" "Language-Team: de <LL@li.org>\n"
"Plural-Forms: nplurals=1; plural=0\n" "Plural-Forms: nplurals=1; plural=0\n"
@ -388,6 +388,10 @@ msgstr "Nachricht von "
msgid "Group chat" msgid "Group chat"
msgstr "Gruppen-Chat" msgstr "Gruppen-Chat"
#, python-format
msgid "You are now in room %s ..."
msgstr "Sie sind nun im Raum %s ..."
msgid "Your browser does not support file transfer." msgid "Your browser does not support file transfer."
msgstr "Mit Ihrem Browser können keine Dateien übertragen werden." msgstr "Mit Ihrem Browser können keine Dateien übertragen werden."

6
src/i18n/messages.pot

@ -9,7 +9,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Spreed Speak Freely 1.0\n" "Project-Id-Version: Spreed Speak Freely 1.0\n"
"Report-Msgid-Bugs-To: simon@struktur.de\n" "Report-Msgid-Bugs-To: simon@struktur.de\n"
"POT-Creation-Date: 2014-03-17 13:05+0100\n" "POT-Creation-Date: 2014-03-18 14:40+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -382,6 +382,10 @@ msgstr ""
msgid "Group chat" msgid "Group chat"
msgstr "" msgstr ""
#, python-format
msgid "You are now in room %s ..."
msgstr ""
msgid "Your browser does not support file transfer." msgid "Your browser does not support file transfer."
msgstr "" msgstr ""

4
static/js/controllers/chatroomcontroller.js

@ -212,6 +212,10 @@ define(['underscore', 'moment', 'text!partials/fileinfo.html'], function(_, mome
}; };
$scope.$on("display", function(event, s, nodes) {
$scope.display(s, nodes);
});
$scope.append = function(s, nodes) { $scope.append = function(s, nodes) {
if (!lastMessageContainer) { if (!lastMessageContainer) {

16
static/js/directives/chat.js

@ -98,7 +98,10 @@ define(['underscore', 'text!partials/chat.html', 'text!partials/chatroom.html'],
// Shared data; // Shared data;
return { return {
rooms: rooms, rooms: rooms,
visibleRooms: [] visibleRooms: [],
get: function(id) {
return rooms[id];
}
} }
@ -328,10 +331,15 @@ define(['underscore', 'text!partials/chat.html', 'text!partials/chatroom.html'],
}; };
scope.$on("room", function(event, room) { scope.$on("room", function(event, room) {
if (room !== null) { if (room == null) {
scope.showRoom(group_chat_id, {title: translation._("Group chat")}, {restore: true, noenable: true});
} else {
scope.hideRoom(group_chat_id); scope.hideRoom(group_chat_id);
} else {
if (!controller.visibleRooms.length) {
scope.showRoom(group_chat_id, {title: translation._("Group chat")}, {restore: true, noenable: true});
}
var subscope = controller.get(group_chat_id);
var msg = translation._("You are now in room %s ...", room);
subscope.$broadcast("display", null, $("<i><span>"+msg+"</span></i>"));
} }
}); });

2
static/translation/messages-de.json

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save