From 30eac72e2a7124714f2e77bf9fb92a66c3c0857e Mon Sep 17 00:00:00 2001
From: Rushi Shah <2016rshah@gmail.com>
Date: Sat, 8 Oct 2016 03:27:01 -0500
Subject: [PATCH 1/3] Fixes #48
---
lib/JS.hs | 9 ++++++---
lib/View.hs | 6 ++++--
static/markdown.svg | 1 +
templates/css.widget | 4 ++++
templates/trait.widget | 2 +-
5 files changed, 16 insertions(+), 6 deletions(-)
create mode 100644 static/markdown.svg
diff --git a/lib/JS.hs b/lib/JS.hs
index 3959443..ab423f3 100644
--- a/lib/JS.hs
+++ b/lib/JS.hs
@@ -422,12 +422,15 @@ makeItemNotesEditor =
enter = $("", {
"class": "edit-field-instruction",
"text" : "or press Ctrl+Enter to save" })[0];
+ markdownSupported = $("", {
+ "src": "/markdown.svg",
+ "class": " markdown-supported "
+ })[0];
markdown = $("", {
"href" : "/markdown",
- "target" : "_blank",
- "text" : "Markdown" })[0];
+ "target" : "_blank"})[0];
$(sectionNode).append(
- area, saveBtn, $(space), cancelBtn, $(space), enter, markdown);
+ area, saveBtn, $(space), cancelBtn, $(space), enter, $(markdown).append(markdownSupported));
|]
-- | Create a new category and redirect to it (or redirect to an old category
diff --git a/lib/View.hs b/lib/View.hs
index da864a9..6f2b979 100644
--- a/lib/View.hs
+++ b/lib/View.hs
@@ -1173,7 +1173,8 @@ markdownEditor attr (view mdText -> s) submit cancel instr = do
cancel
emptySpan "6px"
span_ [class_ "edit-field-instruction"] (toHtml instr)
- a_ [href_ "/markdown", target_ "_blank"] "Markdown"
+ a_ [href_ "/markdown", target_ "_blank"] $
+ img_ [src_ "/markdown.svg", alt_ "markdown supported", class_ " markdown-supported "]
smallMarkdownEditor
:: MonadIO m
@@ -1198,7 +1199,8 @@ smallMarkdownEditor attr (view mdText -> s) submit mbCancel instr = do
cancel
span_ [style_ "float:right"] $ do
span_ [class_ "edit-field-instruction"] (toHtml instr)
- a_ [href_ "/markdown", target_ "_blank"] "Markdown"
+ a_ [href_ "/markdown", target_ "_blank"] $
+ img_ [src_ "/markdown.svg", alt_ "markdown supported", class_ " markdown-supported "]
thisNode :: MonadIO m => HtmlT m JQuerySelector
thisNode = do
diff --git a/static/markdown.svg b/static/markdown.svg
new file mode 100644
index 0000000..063c97e
--- /dev/null
+++ b/static/markdown.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/templates/css.widget b/templates/css.widget
index 0647248..75698f2 100644
--- a/templates/css.widget
+++ b/templates/css.widget
@@ -267,3 +267,7 @@ textarea.fullwidth {
margin: 5px 0px;
width: 100%;
}
+
+.markdown-supported {
+ height: 1.5em;
+}
\ No newline at end of file
diff --git a/templates/trait.widget b/templates/trait.widget
index 2c92a7e..3686033 100644
--- a/templates/trait.widget
+++ b/templates/trait.widget
@@ -150,7 +150,7 @@ function makeTraitEditor(itemUid, traitUid, content) {
\
press Ctrl+Enter or Enter to save \
\
- Markdown \
+ \
';
$(sectionNode).html(template);
From 6730e16034cd9f7dde45e4cd2a7e1ae60e8f9384 Mon Sep 17 00:00:00 2001
From: Rushi Shah <2016rshah@gmail.com>
Date: Sat, 8 Oct 2016 03:29:07 -0500
Subject: [PATCH 2/3] Forgot to add class
---
templates/trait.widget | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/templates/trait.widget b/templates/trait.widget
index 3686033..3881963 100644
--- a/templates/trait.widget
+++ b/templates/trait.widget
@@ -150,7 +150,7 @@ function makeTraitEditor(itemUid, traitUid, content) {
\
press Ctrl+Enter or Enter to save \
\
- \
+ \
';
$(sectionNode).html(template);
From f026a91003f8e092b16a2228a7bff7d7dc8bdac7 Mon Sep 17 00:00:00 2001
From: Rushi Shah <2016rshah@gmail.com>
Date: Sun, 9 Oct 2016 17:55:23 -0500
Subject: [PATCH 3/3] Made icon smaller
---
templates/css.widget | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/templates/css.widget b/templates/css.widget
index 75698f2..c4800f7 100644
--- a/templates/css.widget
+++ b/templates/css.widget
@@ -269,5 +269,5 @@ textarea.fullwidth {
}
.markdown-supported {
- height: 1.5em;
+ height: 1em;
}
\ No newline at end of file