Merge pull request #1045 from pateljannat/issues-37

fix: using google docs viewer to render pdf
This commit is contained in:
Jannat Patel
2024-10-08 12:37:19 +05:30
committed by GitHub
4 changed files with 8 additions and 5 deletions

View File

@@ -160,7 +160,7 @@ const getRowRoute = (row) => {
} }
} else { } else {
return { return {
name: 'Quiz', name: 'QuizPage',
params: { params: {
quizID: row.assessment_name, quizID: row.assessment_name,
}, },

View File

@@ -37,7 +37,7 @@
<iframe <iframe
:src="getPDFSource(block)" :src="getPDFSource(block)"
width="100%" width="100%"
height="400" height="700px"
frameborder="0" frameborder="0"
allowfullscreen allowfullscreen
></iframe> ></iframe>

View File

@@ -56,9 +56,11 @@ export class Upload {
app.mount(this.wrapper) app.mount(this.wrapper)
return return
} else if (file.file_type == 'PDF') { } else if (file.file_type == 'PDF') {
this.wrapper.innerHTML = `<iframe src="${encodeURI( this.wrapper.innerHTML = `<iframe src="https://docs.google.com/viewer?url=${
window.location.origin
}${encodeURI(
file.file_url file.file_url
)}#toolbar=0" width='100%' height='700px' class="mb-4"></iframe>` )}&embedded=true" width='100%' height='700px' class="mb-4" type="application/pdf"></iframe>`
return return
} else { } else {
this.wrapper.innerHTML = `<img class="mb-4" src=${encodeURI( this.wrapper.innerHTML = `<img class="mb-4" src=${encodeURI(

View File

@@ -55,6 +55,7 @@
"fieldname": "title", "fieldname": "title",
"fieldtype": "Data", "fieldtype": "Data",
"in_list_view": 1, "in_list_view": 1,
"in_standard_filter": 1,
"label": "Title", "label": "Title",
"reqd": 1 "reqd": 1
}, },
@@ -161,7 +162,7 @@
], ],
"index_web_pages_for_search": 1, "index_web_pages_for_search": 1,
"links": [], "links": [],
"modified": "2024-04-03 10:48:17.525859", "modified": "2024-10-08 11:04:54.748773",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "LMS", "module": "LMS",
"name": "Course Lesson", "name": "Course Lesson",