add powerpaste stuff
This commit is contained in:
parent
d5c493cd1a
commit
1f493f30da
3797
plugins/powerpaste/js/wordimport.js
Normal file
3797
plugins/powerpaste/js/wordimport.js
Normal file
File diff suppressed because one or more lines are too long
@ -1,11 +1,11 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import {writeFileSync, mkdirSync} from "fs";
|
import {writeFileSync, mkdirSync, existsSync} from "fs";
|
||||||
import {resolve} from "path";
|
import {resolve, dirname} from "path";
|
||||||
|
|
||||||
const freeKey = "qagffr3pkuv17a8on1afax661irst1hbr4e6tbv888sz91jc";
|
const freeKey = "qagffr3pkuv17a8on1afax661irst1hbr4e6tbv888sz91jc";
|
||||||
const skins = ["dark", "default", "document", "tinymce-5", "tinymce-5-dark", "writer"];
|
const skins = ["dark", "default", "document", "tinymce-5", "tinymce-5-dark", "writer"];
|
||||||
const uis = ["oxide", "oxide-dark", "tinymce-5", "tinymce-5-dark"];
|
const uis = ["oxide", "oxide-dark", "tinymce-5", "tinymce-5-dark"];
|
||||||
const pluginList = "a11ychecker advcode advtable advanced-templates advanced-typography ai casechange checklist introduction-to-tiny-comments editimage introduction-to-mediaembed export footnotes formatpainter inline-css linkchecker mentions mergetags moxiemanager pageembed permanentpen introduction-to-powerpaste rtc-introduction introduction-to-tiny-spellchecker autocorrect tableofcontents tinydrive-introduction accordion advlist anchor autolink autoresize autosave charmap code codesample directionality emoticons fullscreen help image importcss insertdatetime link lists media nonbreaking pagebreak preview quickbars save searchreplace table template visualblocks visualchars wordcount";
|
const pluginList = "a11ychecker advcode advtable advtemplates typography ai casechange checklist comments editimage mediaembed export footnotes formatpainter inlinecss linkchecker mentions mergetags moxiemanager pageembed permanentpen powerpaste rtc spellchecker autocorrect tableofcontents tinydrive accordion advlist anchor autolink autoresize autosave charmap code codesample directionality emoticons fullscreen help image importcss insertdatetime link lists media nonbreaking pagebreak preview quickbars save searchreplace table template visualblocks visualchars wordcount";
|
||||||
const base = `https://cdn.tiny.cloud/1/${freeKey}/tinymce/6`
|
const base = `https://cdn.tiny.cloud/1/${freeKey}/tinymce/6`
|
||||||
|
|
||||||
let headers = {
|
let headers = {
|
||||||
@ -14,7 +14,8 @@ let headers = {
|
|||||||
|
|
||||||
async function fetchAux(path) {
|
async function fetchAux(path) {
|
||||||
const wpath = resolve(`..${path}`)
|
const wpath = resolve(`..${path}`)
|
||||||
let {data: d} = await axios.get(`${base}${path}`, {headers})
|
if(!existsSync(wpath)) mkdirSync(dirname(wpath), {recursive: true})
|
||||||
|
let {data: d} = await axios.get(`${base}${path}`, {headers});
|
||||||
writeFileSync(wpath, d);
|
writeFileSync(wpath, d);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -26,6 +27,7 @@ async function main() {
|
|||||||
await fetchAux("/tinymce.d.ts");
|
await fetchAux("/tinymce.d.ts");
|
||||||
await fetchAux("/models/dom/model.min.js");
|
await fetchAux("/models/dom/model.min.js");
|
||||||
await fetchAux("/icons/default/icons.min.js");
|
await fetchAux("/icons/default/icons.min.js");
|
||||||
|
await fetchAux("/plugins/powerpaste/js/wordimport.js")
|
||||||
for(let t of skins) {
|
for(let t of skins) {
|
||||||
await fetchAux(`/skins/content/${t}/content.min.css`)
|
await fetchAux(`/skins/content/${t}/content.min.css`)
|
||||||
}
|
}
|
||||||
@ -41,7 +43,7 @@ async function main() {
|
|||||||
}
|
}
|
||||||
for(let p of pluginList.split(" ")) {
|
for(let p of pluginList.split(" ")) {
|
||||||
let {data} = await axios.get(`${base}/plugins/${p}/plugin.min.js`, {headers});
|
let {data} = await axios.get(`${base}/plugins/${p}/plugin.min.js`, {headers});
|
||||||
mkdirSync(resolve(`../plugins/${p}`), {recursive: true})
|
if(!existsSync(resolve(`../plugins/${p}`))) mkdirSync(resolve(`../plugins/${p}`), {recursive: true})
|
||||||
writeFileSync(resolve(`../plugins/${p}/plugin.min.js`), data)
|
writeFileSync(resolve(`../plugins/${p}/plugin.min.js`), data)
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
|
Loading…
Reference in New Issue
Block a user