This commit is contained in:
2020-04-19 00:43:48 +00:00
parent ecf3b25b5a
commit e713e2f405
2 changed files with 10 additions and 1455 deletions

File diff suppressed because one or more lines are too long

View File

@@ -641,7 +641,7 @@ export default {
} }
break; break;
case "image": case "image":
throw "NOT IMPLEMENTED"; throw "IMAGE LINK NOT IMPLEMENTED";
break; break;
default: default:
throw "NOT IMPLEMENTED"; throw "NOT IMPLEMENTED";
@@ -662,164 +662,6 @@ export default {
this.linkMenu = true; this.linkMenu = true;
}); });
} }
// clickBold() {
// this.getSelectedRange();
// this.replaceSelectedText("**" + this.getSelectedText() + "**");
// this.handleInput(this.localVal);
// },
// clickItalic() {
// this.getSelectedRange();
// this.replaceSelectedText("*" + this.getSelectedText() + "*");
// // },
// clickStrike() {
// this.getSelectedRange();
// this.replaceSelectedText("~~" + this.getSelectedText() + "~~");
// },
// clickHeading(h) {
// this.getSelectedRange(true);
// let prepend = "#".repeat(h) + " ";
// // if (this.selection.hasSelection) {
// let s = this.getSelectedBlock();
// s = s.replace(/\n/gi, "\n" + prepend);
// if (s.length > 0 && s[0] != "\n") {
// s = prepend + s;
// }
// this.replaceSelectedBlock(s);
// // } else {
// // this.replaceSelectedText("\n" + prepend);
// // }
// },
// clickLine() {
// this.getSelectedRange();
// this.replaceSelectedText("***");
// },
// clickCode() {
// this.getSelectedRange();
// this.replaceSelectedText("`" + this.getSelectedText() + "`");
// },
// clickCodeBlock() {
// this.getSelectedRange();
// this.replaceSelectedBlock(
// "\n```\n" + this.getSelectedBlock() + "\n```\n"
// );
// },
// clickQuote() {
// this.getSelectedRange();
// if (this.selection.hasSelection) {
// this.replaceSelectedBlock("\n>" + this.getSelectedBlock() + "\n");
// } else {
// this.replaceSelectedText("\n>");
// }
// },
// clickUl() {
// //if a selected block with several lines then prepend each line
// //if a selected block with one line only then prepend start of first line after last linefeed
// this.getSelectedRange();
// if (this.selection.hasSelection) {
// let s = this.getSelectedBlock();
// s = s.replace(/\n/gi, "\n* ");
// if (s.length > 0 && s[0] != "\n") {
// s = "* " + s;
// }
// s = s + "\n";
// this.replaceSelectedBlock(s);
// } else {
// this.replaceSelectedText("\n* ");
// }
// // },
// clickOl() {
// //if a selected block with several lines then prepend each line
// //if a selected block with one line only then prepend start of first line after last linefeed
// this.getSelectedRange();
// if (this.selection.hasSelection) {
// let s = this.getSelectedBlock();
// // console.log("Selected block:[" + s + "]");
// let ret = "\n1. ";
// let listItem = 1;
// for (let i = 0; i < s.length; i++) {
// if (s[i] == "\n") {
// ++listItem;
// ret += "\n" + listItem + ". ";
// } else {
// ret += s[i];
// }
// }
// ret += "\n\n";
// // console.log("RET:[" + ret + "]");
// this.replaceSelectedBlock(ret);
// } else {
// this.replaceSelectedText("\n1. ");
// }
// },
// clickTask() {
// this.getSelectedRange();
// if (this.selection.hasSelection) {
// let s = this.getSelectedBlock();
// s = s.replace(/\n/gi, "\n* [ ] ");
// if (s.length > 0 && s[0] != "\n") {
// s = "* [ ] " + s;
// }
// s = s + "\n";
// this.replaceSelectedBlock(s);
// } else {
// this.replaceSelectedText("\n* [ ] ");
// }
// },
// clickTable() {
// this.tableMenu = false;
// //| Column 1 | Column 2 | Column 3 |
// //| -------- | -------- | -------- |
// //| John | Doe | Male |
// //| Mary | Smith | Female |
// this.getSelectedRange();
// let t = "\n";
// //Header
// //| CCC | CCC | CCC |
// for (let c = 0; c < this.tableMenuColumns; c++) {
// t += "| CCC ";
// }
// t += "|\n";
// //Divider
// //| --- | --- | --- |
// for (let c = 0; c < this.tableMenuColumns; c++) {
// t += "| --- ";
// }
// t += "|\n";
// //Rows
// //| XXX | XXX | XXX |
// for (let r = 0; r < this.tableMenuRows; r++) {
// for (let c = 0; c < this.tableMenuColumns; c++) {
// t += "| XXX ";
// }
// t += "|\n";
// }
// this.replaceSelectedText(t);
// },
// clickLink() {
// this.linkMenu = false;
// this.getSelectedRange();
// //this.linkUrl
// //this.linkText
// let url = this.linkUrl;
// //force it to an external url
// if (!url.includes(":")) {
// url = "https://" + url;
// }
// let t = "[" + this.linkText + "](" + url + ")";
// // [MY Awesome LINK](www.ayanova.com)
// this.replaceSelectedText(t);
// }
} }
}; };
@@ -827,35 +669,37 @@ export default {
todo: all editing controls enabled todo: add url based image link and stub out local file image link
- add image - I guess I can add external images link and include a local image area with select list for any potential attached images with a button to attach / upload an image?
- maybe other types are supported, i.e. video etc?
- determine how local images will be handled (attachments) - determine how local images will be handled (attachments)
baseurl setting for local images: https://marked.js.org/#/USING_ADVANCED.md#options baseurl setting for local images: https://marked.js.org/#/USING_ADVANCED.md#options
- in v7 images are not part of attachment system but rather embedded somehow in the document (have to refresh how that works for export dbdump) - in v7 images are not part of attachment system but rather embedded somehow in the document (have to refresh how that works for export dbdump)
todo: replace all redundant clickXXX functions with a single function and a flag indicating what to do
- HANDLE INPUT must be called from that function so that th eparent form knows a change was made
because right now menu clicks changing text doesn't trigger the changedd event
todo: Undo / redo (ctrl-z / ctrl-y) ability? todo: Undo / redo (ctrl-z / ctrl-y) ability?
- may need a library for this one if it's tricky to support levels of undo - may need a library for this one if it's tricky to support levels of undo
todo: Add wikiContent field to form defintions at server so can hide or show in customization todo: Add wikiContent field to form defintions at server so can hide or show in form customization
- Also for dataLists? (for reporting not grid I mean) - Also for dataLists? (for reporting not grid I mean)
todo: event log type just for edit wiki? todo: event log type just for edit wiki?
- this is because a wiki is not a discrete object in v8 so rights follow object itself and maybe it's necessary to know when wiki was edited? - this is because a wiki is not a discrete object in v8 so rights follow object itself and maybe it's necessary to know when wiki was edited?
- or is this more important than some other events? Not sure.
Clean up the example markdown, go through and use mine and sprinkle in the marked sample stuff where it differs Clean up the example markdown, go through and use mine and sprinkle in the marked sample stuff where it differs
- Make sure images ONLY come from our own server, not any other - Make sure images ONLY come from our own server, not any other
- Maybe make a key image and put on our server for wiki example so we can if we feel like it track usage of demo data - Maybe make a key image and put on our server for wiki example so we can if we feel like it track usage of demo data
- Put a block of emojis in it with a link to the help docs regarding emojis for extra coolness - Put a block of emojis in it with a link to the help docs regarding emojis for extra coolness
todo: STYLE / OUTPUT CSS todo: STYLE / OUTPUT CSS IMPROVEMENTS
- Check with MARKED to see what css they use or require or something, maybe I'm missing something they have on their site before I roll my own - Check with MARKED to see what css they use or require or something, maybe I'm missing something they have on their site before I roll my own
- the TOAST one is pretty cool looking
- maybe whatever is used by my docs would work too
- also there are a lot on the web search for markdown style css
- CODE BLOCK: why is it indenting the start of a code block? - CODE BLOCK: why is it indenting the start of a code block?
- TASK Style the task markdown output, it looks pretty bleak right now - TASK Style the task markdown output, it looks pretty bleak right now
I stole the css from toast it's in the notes, search for task-list-item I stole the css from toast it's in the notes, search for task-list-item