From 2428849b79f99fe58b7a4efdf52dad102b73a4e4 Mon Sep 17 00:00:00 2001 From: Taly Date: Wed, 11 Jul 2018 13:20:31 +0300 Subject: [PATCH] add comments --- example/tools-inline/term/term.css | 11 ++++++----- example/tools-inline/term/term.js | 10 +++++++++- example/tools-inline/term/term.svg | 1 + 3 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 example/tools-inline/term/term.svg diff --git a/example/tools-inline/term/term.css b/example/tools-inline/term/term.css index be7a3212..0e1a86d8 100644 --- a/example/tools-inline/term/term.css +++ b/example/tools-inline/term/term.css @@ -3,9 +3,10 @@ /*}*/ .marked { - font-family: 'monospace', 'monaco', 'consolas', 'courier'; - background-color: rgba(255, 97, 106, 0.2); - border: 1px solid rgba(255, 98, 86, 0.49); - padding: 0px 3px; - border-radius: 3px; + /*font-family: 'monospace', 'monaco', 'consolas', 'courier';*/ + background-color: #f4f4f4; + border: 1px solid #eaeaea; + color: #3c3434; + padding: 1px 3px; + border-radius: 2px; } diff --git a/example/tools-inline/term/term.js b/example/tools-inline/term/term.js index e5522057..e9a63ca7 100644 --- a/example/tools-inline/term/term.js +++ b/example/tools-inline/term/term.js @@ -51,13 +51,21 @@ class Term { return this.button; } - // @todo add description + /** + * Process selected fragment + * + * @param {Range} range + */ surround(range) { if (!range) { return; } + console.log(range); + + let state = this.api.selection.findParentTag(this.TAG, this.CSS); + console.log(state); /** * If start or end of selection is in the highlighted block diff --git a/example/tools-inline/term/term.svg b/example/tools-inline/term/term.svg new file mode 100644 index 00000000..0a8534ee --- /dev/null +++ b/example/tools-inline/term/term.svg @@ -0,0 +1 @@ +