Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moodle-mod_pdfannotator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elc
moodle-mod_pdfannotator
Commits
0f46ca31
Commit
0f46ca31
authored
2 years ago
by
anisa kusumadewi
Browse files
Options
Downloads
Patches
Plain Diff
Fix Problems:
Deprecated API comments size and margin
parent
ff6141a8
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
shared/index.js
+7
-6
7 additions, 6 deletions
shared/index.js
with
7 additions
and
6 deletions
shared/index.js
+
7
−
6
View file @
0f46ca31
...
...
@@ -628,7 +628,7 @@ function startIndex(Y,_cm,_documentObject,_contextId, _userid,_capabilities, _to
/* ************** END Store Adapter!! **********************************/
_2.default.setStoreAdapter(MyStoreAdapter);
pdfjsLib.workerSrc = 'shared/pdf.worker.js?ver=00002';
pdfjsLib.
GlobalWorkerOptions.
workerSrc = 'shared/pdf.worker.js?ver=00002';
// Render stuff
var NUM_PAGES = 0;
var oldPageNumber;
...
...
@@ -756,7 +756,7 @@ function startIndex(Y,_cm,_documentObject,_contextId, _userid,_capabilities, _to
doc.text(35, count, title);
doc.setTextColor(0,0,51);
doc.setFontSize(1
2
);
doc.setFontSize(1
0
);
if (data === null) {
doc.text(35, 27, M.util.get_string('emptypdf', 'pdfannotator') + " " + page);
...
...
@@ -811,9 +811,9 @@ function startIndex(Y,_cm,_documentObject,_contextId, _userid,_capabilities, _to
* Take a user's post (i.e. an individual question or answer), determine whether
* it contains latex formulae images or not and place its text and/or images on the pdf
*/
function breakLines(author=null, timemodified=null, post, characters = 1
5
0) {
function breakLines(author=null, timemodified=null, post, characters = 1
3
0) {
if (typeof post === "string") { // Answer contains text only.
printTextblock(author, timemodified, post);
printTextblock(author, timemodified, post
, characters
);
}
if (typeof post === "object") { // Answer is an array of text (optional) and a png image of a latex formula.
...
...
@@ -824,10 +824,10 @@ function startIndex(Y,_cm,_documentObject,_contextId, _userid,_capabilities, _to
}
}
/**
* Take a text block, split it into pieces no larger than 1
5
0 characters
* Take a text block, split it into pieces no larger than 1
3
0 characters
* and print one piece per line
*/
function printTextblock(author=null, timemodified=null, text, characters
= 150
) {
function printTextblock(author=null, timemodified=null, text, characters) {
// In the comments linebreaks are represented by <br \>-Tags. Sometimes there is an additional \n
// jsPDF needs \n-linebreaks so we replace <br \> with \n. But first we remove all \n that already exist.
text = text.replace(/\n/g, "");
...
...
@@ -841,6 +841,7 @@ function startIndex(Y,_cm,_documentObject,_contextId, _userid,_capabilities, _to
var textbit;
for (var j = 0; j < stringarray.length; j++) {
doc.setFont('NotoSans');
doc.setFontType("normal");
textbit = stringarray[j];
if (count >= 280) {
doc.addPage();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment