ep_comments_page
Advanced tools
Comparing version 0.1.24 to 0.1.25
@@ -129,2 +129,7 @@ /* global exports, require */ | ||
exports.eejsBlock_dd_insert = function (hook_name, args, cb) { | ||
args.content = args.content + eejs.require("ep_comments_page/templates/menuButtons.ejs"); | ||
return cb(); | ||
}; | ||
exports.eejsBlock_mySettings = function (hook_name, args, cb) { | ||
@@ -131,0 +136,0 @@ args.content = args.content + eejs.require("ep_comments_page/templates/settings.ejs"); |
@@ -5,2 +5,3 @@ { | ||
"ep_comments_page.add_comment.title" : "Kommentar zur Auswahl hinzufügen", | ||
"ep_comments_page.add_comment" : "Kommentar zur Auswahl hinzufügen", | ||
"ep_comments_page.add_comment.hint" : "Bitte wählen Sie zuerst den zu kommentierenden Text aus", | ||
@@ -7,0 +8,0 @@ "ep_comments_page.delete_comment.title" : "Diesen Kommentar löschen", |
@@ -5,2 +5,3 @@ { | ||
"ep_comments_page.add_comment.title" : "Add new comment on selection", | ||
"ep_comments_page.add_comment": "Add new comment on selection", | ||
"ep_comments_page.add_comment.hint" : "Please first select the text to comment", | ||
@@ -14,4 +15,4 @@ "ep_comments_page.delete_comment.title" : "Delete this comment", | ||
"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.suggested_change_from" : "Suggested change from \"{{changeFrom}}\" to \"{{changeTo}}\"", | ||
"ep_comments_page.comments_template.suggest_change_from" : "Suggest change from \"{{changeFrom}}\" to", | ||
"ep_comments_page.comments_template.to" : "To", | ||
@@ -18,0 +19,0 @@ "ep_comments_page.comments_template.include_suggestion" : "Include suggested change", |
@@ -5,2 +5,3 @@ { | ||
"ep_comments_page.add_comment.title" : "Annoter la sélection", | ||
"ep_comments_page.add_comment" : "Annoter la sélection", | ||
"ep_comments_page.add_comment.hint" : "Vous devez d'abord sélectionner un texte à annoter", | ||
@@ -7,0 +8,0 @@ "ep_comments_page.delete_comment.title" : "Supprimer cette annotation", |
@@ -5,2 +5,3 @@ { | ||
"ep_comments_page.add_comment.title" : "Új megjegyzés hozzáadása a kijelöléshez", | ||
"ep_comments_page.add_comment" : "Új megjegyzés hozzáadása a kijelöléshez", | ||
"ep_comments_page.add_comment.hint" : "Először jelölje meg a szöveget a megjegyzéshez", | ||
@@ -7,0 +8,0 @@ "ep_comments_page.delete_comment.title" : "Megjegyzés törlése", |
@@ -5,2 +5,3 @@ { | ||
"ep_comments_page.add_comment.title" : "Voeg opmerking toe aan selectie", | ||
"ep_comments_page.add_comment" : "Voeg opmerking toe aan selectie", | ||
"ep_comments_page.add_comment.hint" : "Selecteer eerst een stuk tekst om een opmerking aan toe te voegen", | ||
@@ -7,0 +8,0 @@ "ep_comments_page.delete_comment.title" : "Verwijder deze opmerking", |
@@ -5,2 +5,3 @@ { | ||
"ep_comments_page.add_comment.title" : "Dodaj nowy komentarz do sekcji", | ||
"ep_comments_page.add_comment" : "Dodaj nowy komentarz do sekcji", | ||
"ep_comments_page.add_comment.hint" : "Najpierw wybierz tekst do skomentowania", | ||
@@ -7,0 +8,0 @@ "ep_comments_page.delete_comment.title" : "Usuń komentarz", |
@@ -5,2 +5,3 @@ { | ||
"ep_comments_page.add_comment.title" : "Adicionar novo comentário ao texto selecionado", | ||
"ep_comments_page.add_comment" : "Adicionar novo comentário ao texto selecionado", | ||
"ep_comments_page.add_comment.hint" : "Por favor, selecione primeiro o texto para comentar", | ||
@@ -7,0 +8,0 @@ "ep_comments_page.delete_comment.title" : "Apagar este comentário", |
@@ -5,2 +5,3 @@ { | ||
"ep_comments_page.add_comment.title" : "Добавьте примечание к выделенному тексту", | ||
"ep_comments_page.add_comment" : "Добавьте примечание к выделенному тексту", | ||
"ep_comments_page.add_comment.hint" : "Выделите текст чтобы создать примечание", | ||
@@ -7,0 +8,0 @@ "ep_comments_page.delete_comment.title" : "Удалить примечание", |
@@ -5,2 +5,3 @@ { | ||
"ep_comments_page.add_comment.title" : "Lägg till ny kommentar till markering", | ||
"ep_comments_page.add_comment" : "Lägg till ny kommentar till markering", | ||
"ep_comments_page.add_comment.hint" : "Markera först den text du vill kommentera", | ||
@@ -7,0 +8,0 @@ "ep_comments_page.delete_comment.title" : "Radera den här kommentaren", |
{ | ||
"description": "Adds comments on sidebar and link it to the text. For no-skin use ep_page_view.", | ||
"name": "ep_comments_page", | ||
"version": "0.1.24", | ||
"version": "0.1.25", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Nicolas Lescop", |
@@ -446,2 +446,3 @@ /* global clearTimeout, clientVars, exports, html10n, pad, require, setTimeout */ | ||
if(comment){ | ||
comment.data.changeFrom = parseMultiline(comment.data.changeFrom); | ||
if (comment !== null) { | ||
@@ -804,2 +805,8 @@ // If comment is not in sidebar insert it | ||
function parseMultiline (text) { | ||
if (!text) return text; | ||
text = JSON.stringify(text); | ||
return text.substr(1, (text.length-2)); | ||
} | ||
ep_comments.prototype.displayNewCommentForm = function() { | ||
@@ -908,2 +915,3 @@ var self = this; | ||
// If a new comment box doesn't already exist, create one | ||
data.changeFrom = parseMultiline(self.getSelectedText(rep)); | ||
newComment.insertNewCommentPopupIfDontExist(data, function(comment, index) { | ||
@@ -910,0 +918,0 @@ if(comment.changeTo){ |
@@ -39,4 +39,4 @@ describe("ep_comments_page - Comment Localization", function(){ | ||
//get the 'Suggested Change' label | ||
var $changeToLabel = outer$("#" + commentId + " .to-label").first(); | ||
expect($changeToLabel.text()).to.be("Para"); | ||
var $changeToLabel = outer$("#" + commentId + " .from-label").first(); | ||
expect($changeToLabel.text()).to.be("Sugerir alteração de"); | ||
@@ -43,0 +43,0 @@ done(); |
@@ -47,2 +47,42 @@ describe("ep_comments_page - Comment Suggestion", function(){ | ||
it("Fills suggestion Change From field, adds sugestion", async function() { | ||
var outer$ = helper.padOuter$; | ||
var inner$ = helper.padInner$; | ||
var chrome$ = helper.padChrome$; | ||
var suggestedText = 'A new suggested text'; | ||
openCommentFormWithSuggestion('This content will receive a comment'); | ||
await new Promise(function (resolve) { | ||
helper.waitFor(function () { | ||
return chrome$("#newComment.popup-show").is(':visible') | ||
}).done(function () { | ||
chrome$("#newComment").find('textarea.comment-content').val('A new comment text'); | ||
chrome$("#newComment").find('textarea.to-value').val(suggestedText); | ||
chrome$('#comment-create-btn').click(); | ||
return helper.waitFor(function () { | ||
return inner$("div").first().find('.comment').length; | ||
}).done(function () { | ||
var comment$ = inner$("div").first().find('.comment'); | ||
comment$.click(); | ||
resolve(); | ||
}) | ||
}); | ||
}); | ||
await new Promise(function (resolve) { | ||
helper.waitFor(function () { | ||
outer$('.approve-suggestion-btn:visible').click(); | ||
return true; | ||
}).done(resolve); | ||
}); | ||
await new Promise(function (resolve) { | ||
var comment$ = inner$("div").first().find('.comment'); | ||
helper.waitFor(function () { | ||
return comment$.text() === suggestedText; | ||
}).done(function () { | ||
expect(comment$.text()).to.be(suggestedText); | ||
resolve(); | ||
}); | ||
}) | ||
}); | ||
}); | ||
@@ -64,9 +104,9 @@ | ||
$firstTextElement.html(targetText).sendkeys("{selectall}"); | ||
chrome$(".addComment").first().click(); | ||
helper.waitFor(function() { | ||
return chrome$("#newComment.popup-show").find('.suggestion-checkbox').length; | ||
}).done(function () { | ||
chrome$("#newComment.popup-show").find(".suggestion-checkbox").first().click(); | ||
}); | ||
var $commentButton = chrome$(".addComment"); | ||
$commentButton.click(); | ||
// check suggestion box | ||
var $hasSuggestion = chrome$(".suggestion-checkbox"); | ||
$hasSuggestion.click(); | ||
} |
Sorry, the diff of this file is not supported yet
613588
57
6080