mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-05 14:25:00 +00:00
Apply prettier rules
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
// this file loads all assets from the Chill person bundle
|
||||
module.exports = function(encore, entries) {
|
||||
encore.addEntry('page_wopi_editor', __dirname + '/src/Resources/public/page/editor/index.js');
|
||||
encore.addEntry('mod_reload_page', __dirname + '/src/Resources/public/module/pending/index');
|
||||
module.exports = function (encore, entries) {
|
||||
encore.addEntry(
|
||||
"page_wopi_editor",
|
||||
__dirname + "/src/Resources/public/page/editor/index.js",
|
||||
);
|
||||
encore.addEntry(
|
||||
"mod_reload_page",
|
||||
__dirname + "/src/Resources/public/module/pending/index",
|
||||
);
|
||||
};
|
||||
|
@@ -1,40 +1,40 @@
|
||||
import {is_object_ready} from "../../../../../../ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/helpers";
|
||||
import { is_object_ready } from "../../../../../../ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/helpers";
|
||||
import {
|
||||
StoredObject,
|
||||
StoredObjectStatus,
|
||||
StoredObjectStatusChange
|
||||
StoredObject,
|
||||
StoredObjectStatus,
|
||||
StoredObjectStatusChange,
|
||||
} from "../../../../../../ChillDocStoreBundle/Resources/public/types";
|
||||
|
||||
async function reload_if_needed(stored_object: StoredObject, i: number): Promise<void> {
|
||||
const current_status = await is_object_ready(stored_object);
|
||||
async function reload_if_needed(
|
||||
stored_object: StoredObject,
|
||||
i: number,
|
||||
): Promise<void> {
|
||||
const current_status = await is_object_ready(stored_object);
|
||||
|
||||
if (stored_object.status !== current_status.status) {
|
||||
window.location.reload();
|
||||
}
|
||||
wait_before_reload(stored_object, i + 1);
|
||||
return Promise.resolve();
|
||||
if (stored_object.status !== current_status.status) {
|
||||
window.location.reload();
|
||||
}
|
||||
wait_before_reload(stored_object, i + 1);
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
function wait_before_reload(stored_object: StoredObject, i: number): void {
|
||||
/**
|
||||
* value of the timeout. Set to 5 sec during the first 10 minutes, then every 1 minute
|
||||
*/
|
||||
const timeout = i < 1200 ? 5000 : 60000;
|
||||
/**
|
||||
* value of the timeout. Set to 5 sec during the first 10 minutes, then every 1 minute
|
||||
*/
|
||||
const timeout = i < 1200 ? 5000 : 60000;
|
||||
|
||||
setTimeout(
|
||||
reload_if_needed,
|
||||
timeout,
|
||||
stored_object,
|
||||
i
|
||||
);
|
||||
setTimeout(reload_if_needed, timeout, stored_object, i);
|
||||
}
|
||||
|
||||
window.addEventListener('DOMContentLoaded', async function (e) {
|
||||
if (undefined === (window as any).stored_object) {
|
||||
console.error('window.stored_object is undefined');
|
||||
throw Error('window.stored_object is undefined');
|
||||
}
|
||||
window.addEventListener("DOMContentLoaded", async function (e) {
|
||||
if (undefined === (window as any).stored_object) {
|
||||
console.error("window.stored_object is undefined");
|
||||
throw Error("window.stored_object is undefined");
|
||||
}
|
||||
|
||||
const stored_object = JSON.parse((window as any).stored_object) as StoredObject;
|
||||
reload_if_needed(stored_object, 0);
|
||||
const stored_object = JSON.parse(
|
||||
(window as any).stored_object,
|
||||
) as StoredObject;
|
||||
reload_if_needed(stored_object, 0);
|
||||
});
|
||||
|
@@ -1,48 +1,46 @@
|
||||
require('./index.scss');
|
||||
require("./index.scss");
|
||||
|
||||
window.addEventListener('DOMContentLoaded', function() {
|
||||
let frameholder = document.getElementById('frameholder');
|
||||
let office_frame = document.createElement('iframe');
|
||||
office_frame.name = 'office_frame';
|
||||
office_frame.id = 'office_frame';
|
||||
window.addEventListener("DOMContentLoaded", function () {
|
||||
let frameholder = document.getElementById("frameholder");
|
||||
let office_frame = document.createElement("iframe");
|
||||
office_frame.name = "office_frame";
|
||||
office_frame.id = "office_frame";
|
||||
|
||||
// The title should be set for accessibility
|
||||
office_frame.title = 'Office Frame';
|
||||
// The title should be set for accessibility
|
||||
office_frame.title = "Office Frame";
|
||||
|
||||
// This attribute allows true fullscreen mode in slideshow view
|
||||
// when using PowerPoint's 'view' action.
|
||||
office_frame.setAttribute('allowfullscreen', 'true');
|
||||
// This attribute allows true fullscreen mode in slideshow view
|
||||
// when using PowerPoint's 'view' action.
|
||||
office_frame.setAttribute("allowfullscreen", "true");
|
||||
|
||||
// The sandbox attribute is needed to allow automatic redirection to the O365 sign-in page in the business user flow
|
||||
office_frame.setAttribute(
|
||||
'sandbox',
|
||||
'allow-downloads allow-scripts allow-same-origin allow-forms allow-modals allow-popups allow-top-navigation allow-popups-to-escape-sandbox'
|
||||
);
|
||||
frameholder.appendChild(office_frame);
|
||||
// The sandbox attribute is needed to allow automatic redirection to the O365 sign-in page in the business user flow
|
||||
office_frame.setAttribute(
|
||||
"sandbox",
|
||||
"allow-downloads allow-scripts allow-same-origin allow-forms allow-modals allow-popups allow-top-navigation allow-popups-to-escape-sandbox",
|
||||
);
|
||||
frameholder.appendChild(office_frame);
|
||||
|
||||
document.getElementById('office_form').submit();
|
||||
document.getElementById("office_form").submit();
|
||||
|
||||
const url = new URL(editor_url);
|
||||
const editor_domain = url.origin;
|
||||
const url = new URL(editor_url);
|
||||
const editor_domain = url.origin;
|
||||
|
||||
window.addEventListener("message", function(message) {
|
||||
if (message.origin !== editor_domain) {
|
||||
return;
|
||||
}
|
||||
window.addEventListener("message", function (message) {
|
||||
if (message.origin !== editor_domain) {
|
||||
return;
|
||||
}
|
||||
|
||||
let data = JSON.parse(message.data);
|
||||
|
||||
if ('UI_Close' === data.MessageId) {
|
||||
closeEditor();
|
||||
}
|
||||
});
|
||||
let data = JSON.parse(message.data);
|
||||
|
||||
if ("UI_Close" === data.MessageId) {
|
||||
closeEditor();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function closeEditor() {
|
||||
let
|
||||
params = new URLSearchParams(window.location.search),
|
||||
returnPath = params.get('returnPath');
|
||||
let params = new URLSearchParams(window.location.search),
|
||||
returnPath = params.get("returnPath");
|
||||
|
||||
window.location.assign(returnPath);
|
||||
window.location.assign(returnPath);
|
||||
}
|
||||
|
Reference in New Issue
Block a user