文件操作 - progress-popup.js
返回文件管理
返回主菜单
删除本文件
文件: /home/www/public/wp-content/plugins/ionos-journey/js/journey/parts/progress-popup.js
编辑文件内容
export default class ProgressPopup { constructor( parent, translations ) { this.parent = parent; this.translations = translations; this.id = 'ionos-journey-popup'; this.onAccept = []; this.onDeny = []; this.onCancel = []; this.init(); } init() { this.popupContainer = document.createElement( 'div' ); this.popupContainer.style.opacity = '0'; this.popupContainer.style.visibility = 'hidden'; this.popupContainer.id = this.id; const header = document.createElement( 'div' ); header.className = 'header'; this.cancelButton = document.createElement( 'A' ); this.cancelButton.className = 'stop'; header.append( this.cancelButton ); const content = document.createElement( 'div' ); content.className = 'content'; const title = document.createElement( 'h2' ); title.innerHTML = this.translations.popup_title; content.append( title ); const information = document.createElement( 'p' ); information.innerHTML = this.translations.popup_content + '<br><small>' + this.translations.popup_warning + '</small>'; content.append( information ); const actions = document.createElement( 'div' ); actions.className = 'actions'; this.acceptButton = document.createElement( 'A' ); this.acceptButton.className = 'button primary-button accept-button'; this.acceptButton.innerHTML = this.translations.continue; this.denyButton = document.createElement( 'A' ); this.denyButton.className = 'button primary-button deny-button'; this.denyButton.innerHTML = this.translations.restart; actions.append( this.acceptButton ); actions.append( this.denyButton ); this.popupContainer.append( header, content, actions ); this.parent.getHtmlElement().prepend( this.popupContainer ); this.acceptButton.addEventListener( 'click', () => { this.onAccept.forEach( ( fn ) => { fn(); } ); } ); this.denyButton.addEventListener( 'click', () => { this.onDeny.forEach( ( fn ) => { fn(); } ); } ); this.cancelButton.addEventListener( 'click', () => { this.onCancel.forEach( ( fn ) => { fn(); } ); } ); } show() { this.popupContainer.style.opacity = '1'; this.popupContainer.style.visibility = 'visible'; } hide() { this.popupContainer.remove(); } }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件