aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/RichTextSchema.tsx
diff options
context:
space:
mode:
authormonikahedman <monika_hedman@brown.edu>2019-08-21 17:18:02 -0400
committermonikahedman <monika_hedman@brown.edu>2019-08-21 17:18:02 -0400
commit6604c40d02b4dd7c6a6c663f301bcaedfee6998f (patch)
treee8bd8bf38a9dce8e94a84cae696ee7c0816d5793 /src/client/util/RichTextSchema.tsx
parent76a693012866178a3fbe037ab06cfd4482f37917 (diff)
send help oh god
Diffstat (limited to 'src/client/util/RichTextSchema.tsx')
-rw-r--r--src/client/util/RichTextSchema.tsx81
1 files changed, 0 insertions, 81 deletions
diff --git a/src/client/util/RichTextSchema.tsx b/src/client/util/RichTextSchema.tsx
index 733c50d20..1f6c2badb 100644
--- a/src/client/util/RichTextSchema.tsx
+++ b/src/client/util/RichTextSchema.tsx
@@ -111,19 +111,6 @@ export const nodes: { [index: string]: NodeSpec } = {
// }
// }]
},
-
- checkbox: {
- inline: true,
- attrs: {
- visibility: { default: false }
- },
- group: "inline",
- toDOM(node) {
- const attrs = { style: `width: 40px` };
- return ["span", { ...node.attrs, ...attrs }];
- },
- },
-
// :: NodeSpec An inline image (`<img>`) node. Supports `src`,
// `alt`, and `href` attributes. The latter two default to the empty
// string.
@@ -203,19 +190,6 @@ export const nodes: { [index: string]: NodeSpec } = {
// toDOM() { return ulDOM }
},
- checkbox_list: {
- content: 'checklist_item+',
- marks: '_',
- group: 'block',
- // inline: true,
- parseDOM: [
- { tag: "ul" }
- ],
- toDOM() {
- return ["ul", { style: 'list-style: none' }, 0];
- },
- },
-
//bullet_list: {
// content: 'list_item+',
// group: 'block',
@@ -228,18 +202,6 @@ export const nodes: { [index: string]: NodeSpec } = {
...listItem,
content: 'paragraph block*'
},
-
- checklist_item: {
- content: 'paragraph block*',
- parseDOM: [{ tag: "li" }],
- // toDOM() {
- // return ["li", { style: 'content: checkbox' }, 0];
- // },
- toDOM() {
- return ["li", 0];
- },
- defining: true
- }
};
const emDOM: DOMOutputSpecArray = ["em", 0];
@@ -562,49 +524,6 @@ export class ImageResizeView {
}
}
-export class CheckboxView {
- _view: any;
- _collapsed: HTMLElement;
-
- constructor(node: any, view: any, getPos: any) {
- this._collapsed = document.createElement("span");
- this._collapsed.textContent = node.attrs.visibility ? "⬛" : "⬜";
- this._collapsed.style.position = "relative";
- // this._collapsed.style.width = "80px";
- this._collapsed.style.height = "20px";
- let self = this;
- this._view = view;
- const js = node.toJSON;
- node.toJSON = function () {
-
- return js.apply(this, arguments);
- };
- this._collapsed.onpointerdown = function (e: any) {
- console.log(node.attrs.visibility)
- if (node.attrs.visibility) {
- let y = getPos();
- const attrs = { ...node.attrs };
- attrs.visibility = !attrs.visibility;
- view.dispatch(view.state.tr.setNodeMarkup(y, undefined, attrs));
- self._collapsed.textContent = "⬜";
- } else {
- let y = getPos();
- const attrs = { ...node.attrs };
- attrs.visibility = !attrs.visibility;
- console.log(attrs.visibility)
- view.dispatch(view.state.tr.setNodeMarkup(y, undefined, attrs));
- self._collapsed.textContent = "⬛";
- }
- e.preventDefault();
- e.stopPropagation();
- console.log(node.attrs.visibility)
-
- };
- (this as any).dom = this._collapsed;
- }
-
-}
-
export class SummarizedView {
// TODO: highlight text that is summarized. to find end of region, walk along mark
_collapsed: HTMLElement;