continue implementations

This commit is contained in:
Dennis Eichhorn 2024-01-12 00:30:21 +00:00
parent ca6031ee45
commit 06d5918ca3
4 changed files with 34 additions and 30 deletions

View File

@ -0,0 +1,22 @@
import { UriFactory } from '../../../Uri/UriFactory.js';
/**
* Redirect.
*
* @param {Object} action Action data
* @param {function} callback Callback
* @param {string} id Action element
*
* @since 1.0.0
*/
export function redirectMessage (action, callback, id)
{
setTimeout(function ()
{
if (data.src) {
document.getElementById(data.src).src = UriFactory.build(data.uri);
} else {
window.location = UriFactory.build(data.uri);
}
}, parseInt(data.delay));
};

View File

@ -1,3 +1,5 @@
import { UriFactory } from '../../../Uri/UriFactory.js';
/**
* Reload page.
*
@ -12,7 +14,16 @@ export function reloadButtonAction (action, callback, id)
'use strict';
setTimeout(function () {
document.location.reload(true);
if (action.src) {
console.log(document.getElementById(action.src).hasAttribute('data-src'));
console.log(UriFactory.build(document.getElementById(action.src).getAttribute('data-src')));
document.getElementById(action.src).src = document.getElementById(action.src).hasAttribute('data-src')
? UriFactory.build(document.getElementById(action.src).getAttribute('data-src'))
: document.getElementById(action.src).src;
} else {
document.location.reload();
}
}, parseInt(action.delay));
callback();

View File

@ -1,17 +0,0 @@
import { UriFactory } from '../../Uri/UriFactory.js';
/**
* Redirect.
*
* @param {{delay:number},{uri:string}} data Message data
*
* @since 1.0.0
*/
export function redirectMessage (data)
{
setTimeout(function ()
{
/** global: jsOMS */
window.location = UriFactory.build(data.uri);
}, parseInt(data.delay));
};

View File

@ -1,12 +0,0 @@
/**
* Reload page.
*
* @param {{delay:number}} data Message data
*
* @since 1.0.0
*/
export function reloadMessage (data) {
setTimeout(function () {
document.location.reload();
}, parseInt(data.delay));
};