Skip to content

Commit

Permalink
Big Refactor
Browse files Browse the repository at this point in the history
Add missing classes to identify elements
Translations: remove the ":", they can be added via css if needed. Adjust french translation. Add hint translation for all languages
Simplify the templates, remove not needed containers, use subtemplate to avoid repetition
Use acl-write class for approve button instead of hidden them inserting css
clean css: style it again from scratch
Fixs position of comments (take in account containers padding)
Fix comment icons : if displayCommentAsIcon is true, then we hide the comment boxes, and display only comment icons. On clicking icon the comment appear with a modal
Allow to create a comment without text, including only a suggest change
Improve coloring of commented text on editor (no more conflict with skins or font-color)
Adds message for etherpad 1.8.3 required
  • Loading branch information
seballot committed Apr 17, 2020
1 parent 7079897 commit 268ee8e
Show file tree
Hide file tree
Showing 25 changed files with 707 additions and 1,026 deletions.
17 changes: 17 additions & 0 deletions commentManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,23 @@ exports.getComments = function (padId, callback)
});
};

exports.deleteComment = function (padId, commentId, callback)
{
db.get('comments:' + padId, function(err, comments)
{
if(ERR(err, callback)) return;

// the entry doesn't exist so far, let's create it
if(comments == null) comments = {};

delete comments[commentId];
db.set("comments:" + padId, comments);

callback(padId, commentId);

});
};

exports.deleteComments = function (padId, callback)
{
db.remove('comments:' + padId, function(err)
Expand Down
9 changes: 9 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ exports.socketio = function (hook_name, args, cb){
});
});

socket.on('deleteComment', function(data, callback) {
// delete the comment on the database
commentManager.deleteComment(data.padId, data.commentId, function (){
// Broadcast to all other users that this comment was deleted
socket.broadcast.to(data.padId).emit('commentDeleted', data.commentId);
});

});

socket.on('revertChange', function(data, callback) {
// Broadcast to all other users that this change was accepted.
// Note that commentId here can either be the commentId or replyId..
Expand Down
14 changes: 8 additions & 6 deletions locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@
"ep_comments_page.comment" : "Kommentar",
"ep_comments_page.comments" : "Kommentare",
"ep_comments_page.add_comment.title" : "Kommentar zur Auswahl hinzufügen",
"ep_comments_page.add_comment.hint" : "Bitte wählen Sie zuerst den zu kommentierenden Text aus",
"ep_comments_page.delete_comment.title" : "Diesen Kommentar löschen",
"ep_comments_page.show_comments" : "Kommentare anzeigen",
"ep_comments_page.comments_template.suggested_change" : "Vorgeschlagene Änderung:",
"ep_comments_page.comments_template.from" : "von:",
"ep_comments_page.comments_template.suggested_change" : "Vorgeschlagene Änderung",
"ep_comments_page.comments_template.from" : "von",
"ep_comments_page.comments_template.accept_change.value" : "Änderung akzeptieren",
"ep_comments_page.comments_template.revert_change.value" : "Änderung zurücknehmen",
"ep_comments_page.comments_template.suggested_change_from" : "Vorgeschlagene Änderung von:",
"ep_comments_page.comments_template.suggest_change_from" : "von:",
"ep_comments_page.comments_template.to" : "zu:",
"ep_comments_page.comments_template.suggested_change_from" : "Vorgeschlagene Änderung von",
"ep_comments_page.comments_template.suggest_change_from" : "von",
"ep_comments_page.comments_template.to" : "zu",
"ep_comments_page.comments_template.include_suggestion" : "Änderung vorschlagen",
"ep_comments_page.comments_template.comment.value" : "Kommentar",
"ep_comments_page.comments_template.cancel.value" : "Abbrechen",
"ep_comments_page.comments_template.reply_input_label.placeholder":"antworten: (mit ENTER)",
"ep_comments_page.comments_template.reply.value": "Antworten",
"ep_comments_page.comments_template.reply.placeholder": "Antworten",
"ep_comments_page.time.seconds.past" : "vor {{count}} Sekunden",
"ep_comments_page.time.seconds.future" : "{{count}} Sekunden von jetzt an",
"ep_comments_page.time.one_minute.past" : "vor 1 Minute",
Expand Down
14 changes: 8 additions & 6 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@
"ep_comments_page.comment" : "Comment",
"ep_comments_page.comments" : "Comments",
"ep_comments_page.add_comment.title" : "Add new comment on selection",
"ep_comments_page.add_comment.hint" : "Please first select the text to comment",
"ep_comments_page.delete_comment.title" : "Delete this comment",
"ep_comments_page.edit_comment.title" : "Edit this comment",
"ep_comments_page.show_comments" : "Show Comments",
"ep_comments_page.comments_template.suggested_change" : "Suggested Change:",
"ep_comments_page.comments_template.from" : "From:",
"ep_comments_page.comments_template.suggested_change" : "Suggested Change",
"ep_comments_page.comments_template.from" : "From",
"ep_comments_page.comments_template.accept_change.value" : "Accept Change",
"ep_comments_page.comments_template.revert_change.value" : "Revert Change",
"ep_comments_page.comments_template.suggested_change_from" : "Suggested change From:",
"ep_comments_page.comments_template.suggest_change_from" : "Suggest change From:",
"ep_comments_page.comments_template.to" : "To:",
"ep_comments_page.comments_template.suggested_change_from" : "Suggested change From",
"ep_comments_page.comments_template.suggest_change_from" : "Suggest change From",
"ep_comments_page.comments_template.to" : "To",
"ep_comments_page.comments_template.include_suggestion" : "Include suggested change",
"ep_comments_page.comments_template.comment.value" : "Comment",
"ep_comments_page.comments_template.cancel.value" : "Cancel",
"ep_comments_page.comments_template.reply_input_label.placeholder":"Your Reply (hit ENTER to send)",
"ep_comments_page.comments_template.reply.value" : "Reply",
"ep_comments_page.comments_template.reply.placeholder" : "Reply",
"ep_comments_page.time.seconds.past" : "{{count}} seconds ago",
"ep_comments_page.time.seconds.future" : "{{count}} seconds from now",
"ep_comments_page.time.one_minute.past" : "1 minute ago",
Expand Down
18 changes: 10 additions & 8 deletions locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@
"ep_comments_page.comment" : "Annotation",
"ep_comments_page.comments" : "Annotations",
"ep_comments_page.add_comment.title" : "Annoter la sélection",
"ep_comments_page.add_comment.hint" : "Vous devez d'abord sélectionner un texte à annoter",
"ep_comments_page.delete_comment.title" : "Supprimer cette annotation",
"ep_comments_page.show_comments" : "Afficher les annotations",
"ep_comments_page.comments_template.suggested_change" : "Modification proposée :",
"ep_comments_page.comments_template.from" : "Remplacer :",
"ep_comments_page.comments_template.accept_change.value" : "Appliquer la modification",
"ep_comments_page.comments_template.revert_change.value" : "Annuler la modification",
"ep_comments_page.comments_template.suggested_change_from" : "Modification proposée par :",
"ep_comments_page.comments_template.suggest_change_from" : "Proposer une modification de :",
"ep_comments_page.comments_template.to" : "Par :",
"ep_comments_page.comments_template.suggested_change" : "Modification proposée",
"ep_comments_page.comments_template.from" : "Remplacer",
"ep_comments_page.comments_template.accept_change.value" : "Appliquer la proposition",
"ep_comments_page.comments_template.revert_change.value" : "Annuler la proposition",
"ep_comments_page.comments_template.suggested_change_from" : "Propose de remplacer",
"ep_comments_page.comments_template.suggest_change_from" : "Remplacer",
"ep_comments_page.comments_template.to" : "Par",
"ep_comments_page.comments_template.include_suggestion" : "Proposer une modification",
"ep_comments_page.comments_template.comment.value" : "Annotation",
"ep_comments_page.comments_template.cancel.value" : "Annuler",
"ep_comments_page.comments_template.reply_input_label.placeholder":"Votre réponse (pressez ENTRÉE pour valider)",
"ep_comments_page.comments_template.reply.value":"Répondre",
"ep_comments_page.comments_template.reply.placeholder":"Répondre",
"ep_comments_page.time.seconds.past" : "il y a {{count}} secondes",
"ep_comments_page.time.seconds.future" : "dans {{count}} secondes",
"ep_comments_page.time.one_minute.past" : "il y a 1 minute",
Expand Down
14 changes: 8 additions & 6 deletions locales/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@
"ep_comments_page.comment" : "Komentarz",
"ep_comments_page.comments" : "Komentarze",
"ep_comments_page.add_comment.title" : "Dodaj nowy komentarz do sekcji",
"ep_comments_page.add_comment.hint" : "Najpierw wybierz tekst do skomentowania",
"ep_comments_page.delete_comment.title" : "Usuń komentarz",
"ep_comments_page.show_comments" : "Pokaż komentarze",
"ep_comments_page.comments_template.suggested_change" : "Sugerowane zmiany:",
"ep_comments_page.comments_template.from" : "Od:",
"ep_comments_page.comments_template.suggested_change" : "Sugerowane zmiany",
"ep_comments_page.comments_template.from" : "Od",
"ep_comments_page.comments_template.accept_change.value" : "Zaakceptuj zmiany",
"ep_comments_page.comments_template.revert_change.value" : "Przywróc zmiany",
"ep_comments_page.comments_template.suggested_change_from" : "Sugerowana zmiana z:",
"ep_comments_page.comments_template.suggest_change_from" : "Zaproponuj zmiane z:",
"ep_comments_page.comments_template.to" : "Do:",
"ep_comments_page.comments_template.suggested_change_from" : "Sugerowana zmiana z",
"ep_comments_page.comments_template.suggest_change_from" : "Zaproponuj zmiane z",
"ep_comments_page.comments_template.to" : "Do",
"ep_comments_page.comments_template.include_suggestion" : "Dołącz sugestie",
"ep_comments_page.comments_template.comment.value" : "Komentarz",
"ep_comments_page.comments_template.cancel.value" : "Anuluj",
"ep_comments_page.comments_template.reply_input_label.placeholder":"Odpowiedź (wciśnij ENTER aby wysłać)",
"ep_comments_page.comments_template.reply.value": "Odpowiedź",
"ep_comments_page.comments_template.reply.placeholder": "Odpowiedź",
"ep_comments_page.time.seconds.past" : "{{count}} sekund temu",
"ep_comments_page.time.seconds.future" : "{{count}} sekund od teraz",
"ep_comments_page.time.one_minute.past" : "Minutę temu",
Expand Down
12 changes: 6 additions & 6 deletions locales/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
"ep_comments_page.comment" : "Comentário",
"ep_comments_page.comments" : "Comentários",
"ep_comments_page.add_comment.title" : "Adicionar novo comentário ao texto selecionado",
"ep_comments_page.add_comment.hint" : "Por favor, selecione primeiro o texto para comentar",
"ep_comments_page.delete_comment.title" : "Apagar este comentário",
"ep_comments_page.edit_comment.title" : "Editar este comentário",
"ep_comments_page.show_comments" : "Mostrar Comentários",
"ep_comments_page.comments_template.suggested_change" : "Alteração Sugerida:",
"ep_comments_page.comments_template.from" : "De:",
"ep_comments_page.comments_template.accept_change.value" : "Aceitar Sugestão",
"ep_comments_page.comments_template.revert_change.value" : "Reverter Sugestão",
"ep_comments_page.comments_template.suggested_change_from" : "Alteração sugerida de:",
"ep_comments_page.comments_template.suggest_change_from" : "Sugerir alteração de:",
"ep_comments_page.comments_template.to" : "Para:",
"ep_comments_page.comments_template.suggested_change_from" : "Alteração sugerida de",
"ep_comments_page.comments_template.suggest_change_from" : "Sugerir alteração de",
"ep_comments_page.comments_template.to" : "Para",
"ep_comments_page.comments_template.include_suggestion" : "Incluir alteração sugerida",
"ep_comments_page.comments_template.comment.value" : "Comentário",
"ep_comments_page.comments_template.cancel.value" : "Cancelar",
"ep_comments_page.comments_template.reply_input_label.placeholder":"Sua Resposta (clique ENTER para enviar)",
"ep_comments_page.comments_template.reply.value":"Responder",
"ep_comments_page.comments_template.reply.placeholder":"Responder",
"ep_comments_page.time.seconds.past" : "{{count}} segundos atrás",
"ep_comments_page.time.seconds.future" : "daqui a {{count}} segundos",
"ep_comments_page.time.one_minute.past" : "1 minuto atrás",
Expand Down
Loading

0 comments on commit 268ee8e

Please sign in to comment.