Use /loleaflet/dist/loleaflet.html - standard Collabora Online WOPI endpoint
This commit is contained in:
@@ -666,7 +666,7 @@ func collaboraProxyHandler(w http.ResponseWriter, r *http.Request, db *database.
|
|||||||
wopiSrc := fmt.Sprintf("https://go.b0esche.cloud/wopi/files/%s?access_token=%s", fileID, accessToken)
|
wopiSrc := fmt.Sprintf("https://go.b0esche.cloud/wopi/files/%s?access_token=%s", fileID, accessToken)
|
||||||
|
|
||||||
// Return HTML page with auto-submitting form
|
// Return HTML page with auto-submitting form
|
||||||
// Collabora Online requires: POST to /cool/dist/cool.html with WOPISrc in request body
|
// Collabora Online: POST WOPISrc as form data
|
||||||
htmlContent := fmt.Sprintf(`<!DOCTYPE html>
|
htmlContent := fmt.Sprintf(`<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
@@ -683,7 +683,7 @@ func collaboraProxyHandler(w http.ResponseWriter, r *http.Request, db *database.
|
|||||||
<div class="loading">
|
<div class="loading">
|
||||||
<p>Loading Collabora Online...</p>
|
<p>Loading Collabora Online...</p>
|
||||||
</div>
|
</div>
|
||||||
<form method="POST" action="%s/cool/dist/cool.html" target="collabora-frame" id="collaboraForm" style="display: none;">
|
<form method="POST" action="%s/loleaflet/dist/loleaflet.html" target="collabora-frame" id="collaboraForm" style="display: none;">
|
||||||
<input type="hidden" name="WOPISrc" value="%s">
|
<input type="hidden" name="WOPISrc" value="%s">
|
||||||
</form>
|
</form>
|
||||||
<iframe name="collabora-frame" id="collabora-frame" style="position:fixed; top:0; left:0; width:100%%; height:100%%; border:none;"></iframe>
|
<iframe name="collabora-frame" id="collabora-frame" style="position:fixed; top:0; left:0; width:100%%; height:100%%; border:none;"></iframe>
|
||||||
@@ -692,7 +692,7 @@ func collaboraProxyHandler(w http.ResponseWriter, r *http.Request, db *database.
|
|||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
var form = document.getElementById('collaboraForm');
|
var form = document.getElementById('collaboraForm');
|
||||||
if (form) {
|
if (form) {
|
||||||
console.log('[COLLABORA] Submitting form to /cool/dist/cool.html');
|
console.log('[COLLABORA] Submitting form to /loleaflet/dist/loleaflet.html');
|
||||||
form.submit();
|
form.submit();
|
||||||
} else {
|
} else {
|
||||||
console.error('[COLLABORA] Form not found');
|
console.error('[COLLABORA] Form not found');
|
||||||
|
|||||||
Reference in New Issue
Block a user