Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add promptTexts customization #542

Open
wants to merge 7 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ simplemde.value("This text will appear in the editor");
- **underscoresBreakWords**: If set to `true`, let underscores be a delimiter for separating words. Defaults to `false`.
- **placeholder**: If set, displays a custom placeholder message.
- **previewRender**: Custom function for parsing the plaintext Markdown and returning HTML. Used when user previews.
- **promptTexts**: Customize title of the prompt box when the `promptURLs` option is set to `true` and the `image` or `url` button is clicked.
- image
- link
- **promptURLs**: If set to `true`, a JS alert window appears asking for the link or image URL. Defaults to `false`.
- **renderingConfig**: Adjust settings for parsing the Markdown during previewing (not editing).
- **codeSyntaxHighlighting**: If set to `true`, will highlight using [highlight.js](https://github.com/isagalaev/highlight.js). Defaults to `false`. To use this feature you must include highlight.js on your page or pass in using the `hljs` option. For example, include the script and the CSS files like:<br>`<script src="https://cdn.jsdelivr.net/highlight.js/latest/highlight.min.js"></script>`<br>`<link rel="stylesheet" href="https://cdn.jsdelivr.net/highlight.js/latest/styles/github.min.css">`
Expand Down Expand Up @@ -154,6 +157,10 @@ var simplemde = new SimpleMDE({
return "Loading...";
},
promptURLs: true,
promptTexts: {
link: "URL for the link:",
image: "URL of the image:"
},
renderingConfig: {
singleLineBreaks: false,
codeSyntaxHighlighting: true,
Expand Down
34 changes: 18 additions & 16 deletions debug/simplemde.css
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,6 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
display: inline-block;
vertical-align: top;
margin-bottom: -30px;
/* Hack to make IE7 behave */
*zoom:1;
*display:inline;
}
.CodeMirror-gutter-wrapper {
position: absolute;
Expand All @@ -232,11 +229,8 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
cursor: default;
z-index: 4;
}
.CodeMirror-gutter-wrapper {
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
.CodeMirror-gutter-wrapper ::selection { background-color: transparent }
.CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent }

.CodeMirror-lines {
cursor: text;
Expand All @@ -258,8 +252,8 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
position: relative;
overflow: visible;
-webkit-tap-highlight-color: transparent;
-webkit-font-variant-ligatures: none;
font-variant-ligatures: none;
-webkit-font-variant-ligatures: contextual;
font-variant-ligatures: contextual;
}
.CodeMirror-wrap pre {
word-wrap: break-word;
Expand All @@ -281,6 +275,8 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}

.CodeMirror-widget {}

.CodeMirror-rtl pre { direction: rtl; }

.CodeMirror-code {
outline: none;
}
Expand Down Expand Up @@ -333,9 +329,6 @@ div.CodeMirror-dragcursors {
background: rgba(255, 255, 0, .4);
}

/* IE7 hack to prevent it from returning funny offsetTops on the spans */
.CodeMirror span { *vertical-align: text-bottom; }

/* Used to force a border model for a node */
.cm-force-border { padding-right: .1px; }

Expand All @@ -353,13 +346,15 @@ div.CodeMirror-dragcursors {
span.CodeMirror-selectedtext { background: none; }

.CodeMirror {
box-sizing: border-box;
height: auto;
border: 1px solid #ddd;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
padding: 10px;
font: inherit;
z-index: 1;
word-wrap: break-word;
}

.CodeMirror-fullscreen {
Expand Down Expand Up @@ -466,26 +461,32 @@ span.CodeMirror-selectedtext { background: none; }
padding: 0;
}

.editor-toolbar a {
.editor-toolbar a,
.editor-toolbar button {
background: transparent;
display: inline-block;
text-align: center;
text-decoration: none!important;
color: #2c3e50!important;
width: 30px;
height: 30px;
margin: 0;
padding: 0;
border: 1px solid transparent;
border-radius: 3px;
cursor: pointer;
}

.editor-toolbar a.active,
.editor-toolbar a:hover {
.editor-toolbar a:hover,
.editor-toolbar button.active,
.editor-toolbar button:hover {
background: #fcfcfc;
border-color: #95a5a6;
}

.editor-toolbar a:before {
.editor-toolbar a:before,
.editor-toolbar button:before {
line-height: 30px
}

Expand Down Expand Up @@ -592,6 +593,7 @@ span.CodeMirror-selectedtext { background: none; }
display: none;
box-sizing: border-box;
border: 1px solid #ddd;
word-wrap: break-word;
}

.editor-preview-active-side {
Expand Down
Loading