mirror of
https://github.com/aelve/guide.git
synced 2024-11-23 12:15:06 +03:00
Get rid of non-monospace editing
It was actually pretty annoying
This commit is contained in:
parent
d5b6a72a35
commit
e7b0c3ddb2
24
src/JS.hs
24
src/JS.hs
@ -41,7 +41,6 @@ allJSFunctions = JS . T.unlines . map fromJS $ [
|
||||
moveNodeUp, moveNodeDown,
|
||||
switchSection, switchSectionsEverywhere,
|
||||
fadeIn, fadeOutAndRemove,
|
||||
setMonospace,
|
||||
-- Misc
|
||||
createAjaxIndicator,
|
||||
autosizeTextarea,
|
||||
@ -239,19 +238,6 @@ fadeOutAndRemove =
|
||||
$(node).fadeTo(400,0.2,function(){$(node).remove()});
|
||||
|]
|
||||
|
||||
setMonospace :: JSFunction a => a
|
||||
setMonospace =
|
||||
makeJSFunction "setMonospace" ["node", "p"]
|
||||
[text|
|
||||
if (p)
|
||||
$(node).css("font-family", "monospace")
|
||||
else
|
||||
$(node).css("font-family", "");
|
||||
// See Note [autosize]; the size of the textarea will definitely change
|
||||
// after the font has been changed
|
||||
autosize.update($(node));
|
||||
|]
|
||||
|
||||
createAjaxIndicator :: JSFunction a => a
|
||||
createAjaxIndicator =
|
||||
makeJSFunction "createAjaxIndicator" []
|
||||
@ -382,20 +368,12 @@ makeItemNotesEditor =
|
||||
cancelBtn.onclick = function () {
|
||||
$(sectionNode).html("");
|
||||
switchSection(notesNode, "expanded"); };
|
||||
monospace = $("<input>", {
|
||||
"name" : "monospace",
|
||||
"type" : "checkbox" })[0];
|
||||
monospace.onchange = function () {
|
||||
setMonospace(area, monospace.checked); };
|
||||
monospaceLabel = $("<label>")[0];
|
||||
markdown = $("<a>", {
|
||||
"href" : "/markdown",
|
||||
"target" : "_blank",
|
||||
"text" : "Markdown" })[0];
|
||||
$(monospaceLabel).append(monospace, "monospace editor");
|
||||
$(sectionNode).append(
|
||||
area, saveBtn, $(space), cancelBtn, $(space),
|
||||
markdown, $(space), monospaceLabel);
|
||||
area, saveBtn, $(space), cancelBtn, $(space), markdown);
|
||||
|]
|
||||
|
||||
-- | Create a new category and redirect to it (or redirect to an old category
|
||||
|
@ -1184,14 +1184,6 @@ markdownEditor attr (view mdText -> s) submit cancel = do
|
||||
cancel
|
||||
emptySpan "6px"
|
||||
a_ [href_ "/markdown", target_ "_blank"] "Markdown"
|
||||
emptySpan "6px"
|
||||
-- TODO: this jumps around when there's a lot of text, need to somehow
|
||||
-- prevent jumping (and in JS.makeItemNotesEditor too)
|
||||
let checkHandler = fromJS $
|
||||
JS.setMonospace (JS.selectUid textareaUid, JS "this.checked")
|
||||
label_ $ do
|
||||
input_ [type_ "checkbox", name_ "monospace", onchange_ checkHandler]
|
||||
"monospace editor"
|
||||
|
||||
smallMarkdownEditor
|
||||
:: MonadRandom m
|
||||
|
@ -16,7 +16,6 @@ body {
|
||||
.text-button::after {content: "]";}
|
||||
|
||||
textarea {
|
||||
font-family: sans-serif;
|
||||
font-size: 100%; }
|
||||
|
||||
input {
|
||||
|
@ -142,7 +142,6 @@ body {
|
||||
.text-button::after {content: "]";}
|
||||
|
||||
textarea {
|
||||
font-family: sans-serif;
|
||||
font-size: 100%; }
|
||||
|
||||
input {
|
||||
|
Loading…
Reference in New Issue
Block a user