Skip to content
Snippets Groups Projects
Commit eeaf0202 authored by Friederike Schwager's avatar Friederike Schwager Committed by Friederike Schwager
Browse files

bugfixes download: download PDF-Files with special char in name, don't print html-tags in comments

parent 13046e9b
No related branches found
No related tags found
No related merge requests found
...@@ -317,8 +317,8 @@ $string['pdfannotator:forwardquestions'] = 'Forward questions'; ...@@ -317,8 +317,8 @@ $string['pdfannotator:forwardquestions'] = 'Forward questions';
$string['pdfannotator:getforwardedquestions'] = 'Receive forwarded questions'; $string['pdfannotator:getforwardedquestions'] = 'Receive forwarded questions';
$string['pdfannotator:hidecomments'] = 'Hide comments for participants'; $string['pdfannotator:hidecomments'] = 'Hide comments for participants';
$string['pdfannotator:markcorrectanswer'] = 'Mark answers as correct'; $string['pdfannotator:markcorrectanswer'] = 'Mark answers as correct';
$string['pdfannotator:printcomments'] = 'Download the comments'; $string['pdfannotator:printcomments'] = 'Download the comments (even if the option is disabled for a PDF-Annotator)';
$string['pdfannotator:printdocument'] = 'Download the document'; $string['pdfannotator:printdocument'] = 'Download the document (even if the option is disabled for a PDF-Annotator)';
$string['pdfannotator:recievenewquestionnotifications'] = 'Recieve notifications about new questions'; $string['pdfannotator:recievenewquestionnotifications'] = 'Recieve notifications about new questions';
$string['pdfannotator:report'] = 'Report inappropriate comments to the course manager'; $string['pdfannotator:report'] = 'Report inappropriate comments to the course manager';
$string['pdfannotator:seehiddencomments'] = 'See hidden comments'; $string['pdfannotator:seehiddencomments'] = 'See hidden comments';
......
...@@ -702,6 +702,8 @@ function startIndex(Y,_cm,_documentObject,_userid,_capabilities, _toolbarSetting ...@@ -702,6 +702,8 @@ function startIndex(Y,_cm,_documentObject,_userid,_capabilities, _toolbarSetting
function openDocumentCallback() { function openDocumentCallback() {
var url = document.getElementById('myprinturl').innerHTML; var url = document.getElementById('myprinturl').innerHTML;
url = url.replace(/%/g, "%25");
url = url.replace(/#/g, "%23");
location.href = url; location.href = url;
} }
} }
...@@ -827,6 +829,8 @@ function startIndex(Y,_cm,_documentObject,_userid,_capabilities, _toolbarSetting ...@@ -827,6 +829,8 @@ function startIndex(Y,_cm,_documentObject,_userid,_capabilities, _toolbarSetting
// jsPDF needs \n-linebreaks so we replace <br \> with \n. But first we remove all \n that already exist. // jsPDF needs \n-linebreaks so we replace <br \> with \n. But first we remove all \n that already exist.
text = text.replace(/\n/g, ""); text = text.replace(/\n/g, "");
text = text.replace(/<br \/>/g, "\n"); text = text.replace(/<br \/>/g, "\n");
// Remove all other HTML-Tags.
text = $("<div>").html(text).text();
if (author !== null) { if (author !== null) {
printAuthor(author, timemodified); printAuthor(author, timemodified);
} }
...@@ -6966,7 +6970,7 @@ function startIndex(Y,_cm,_documentObject,_userid,_capabilities, _toolbarSetting ...@@ -6966,7 +6970,7 @@ function startIndex(Y,_cm,_documentObject,_userid,_capabilities, _toolbarSetting
exists = false; exists = false;
} }
//call this function to repeat in 5 secs //call this function to repeat in 5 secs
setTimeout(loadNewAnnotations, 5000); // setTimeout(loadNewAnnotations, 5000);
}, function (err){ }, function (err){
notification.addNotification({ notification.addNotification({
message: M.util.get_string('error:getAnnotations', 'pdfannotator'), message: M.util.get_string('error:getAnnotations', 'pdfannotator'),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment