文件操作 - overlay.js
返回文件管理
返回主菜单
删除本文件
文件: /home/www/public/wp-content/plugins/ionos-journey/js/journey/parts/overlay.js
编辑文件内容
export default class Overlay { constructor() { this.parent = document.body; this.id = 'ionos-journey-overlay'; this.add(); this.registerClickEvent(); this.onClick = []; } getHtmlElement() { return document.body.querySelector( '#' + this.id ); } registerClickEvent() { this.getHtmlElement().addEventListener( 'click', ( e ) => { if ( e.target === this.getHtmlElement() ) { this.onClick.forEach( ( fn ) => { fn(); } ); } } ); } add() { const el = document.createElement( 'DIV' ); el.id = this.id; this.parent.prepend( el ); } setBackground( color ) { this.getHtmlElement().style.backgroundColor = color; } hide() { this.getHtmlElement().style.display = 'none'; } }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件