PluginProbe
Extendify / 3.2.0
Extendify v3.2.0
3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 0.7.0 All 126 releases
extendify / src / Library / library.js

library.js in Extendify 3.2.0, at src/Library/library.js

29 lines 1000 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { MainButton } from '@library/components/MainButton';
2 import { Modal } from '@library/components/Modal';
3 import { render } from '@shared/lib/dom';
4 import '@library/library.css';
5 import { whenEditorIsReady } from '@shared/lib/wp';
6
7 whenEditorIsReady().then(() => {
8 const id = 'extendify-library-btn';
9 const className = 'extendify-library';
10 const page = '.editor-document-tools';
11 // const fse = '.edit-site-header-edit-mode__start';
12
13 if (document.getElementById(id)) return;
14 const btnWrap = document.createElement('div');
15 const btn = Object.assign(btnWrap, { id, className });
16 render(<MainButton />, btn);
17 setTimeout(() => {
18 document.querySelector(page)?.after(btn);
19 // document.querySelector(fse)?.append(btn);
20 }, 300);
21
22 const mdl = 'extendify-library-modal';
23 if (document.getElementById(mdl)) return;
24 const modalWrap = document.createElement('div');
25 const modal = Object.assign(modalWrap, { id: mdl, className });
26 document.body.append(modal);
27 render(<Modal />, modal);
28 });
29