You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following options can be passed as an object at the initialization of the plugin:
144
-
145
-
```javascript
146
-
$('#myEditor').markdownEditor({
147
-
// Options
148
-
});
149
-
```
150
-
151
-
Also, you can override the plugin default options. Example:
152
-
153
-
```javascript
154
-
$.fn.markdownEditor.defaults.width='250px';
155
-
```
156
-
157
-
#### width
158
-
159
-
**Type**: string
160
-
**Default**: '100%'
161
-
162
-
The width of the editor
163
-
164
-
#### height
165
-
166
-
**Type**: string
167
-
**Default**: '400px'
168
-
169
-
The height of the editor
170
-
171
-
#### fontSize
172
-
173
-
**Type**: string
174
-
**Default**: '14px'
175
-
176
-
The font size of the editor
177
-
178
-
#### theme
179
-
180
-
**Type**: string
181
-
**Default**: 'tomorrow'
182
-
183
-
The theme of the editor. See the available themes at the homepage of Ace (http://ace.c9.io)
184
-
185
-
#### softTabs
186
-
187
-
**Type**: boolean
188
-
**Default**: true
189
-
190
-
Pass false to disable the use of soft tabs. Soft tabs means you're using spaces instead of the tab character ('\t')
191
-
192
-
#### fullscreen
193
-
194
-
**Type**: boolean
195
-
**Default**: true
196
-
197
-
Enable / disable fullscreen
198
-
199
-
#### imageUpload
200
-
201
-
**Type**: boolean
202
-
**Default**: false
203
-
204
-
Enable / disable the upload of images. If enabled, you have to specify the option `uploadPath`
205
-
206
-
#### uploadPath
207
-
208
-
**Type**: uploadPath
209
-
**Default**: ''
210
-
211
-
The path of the server side script that receives the images. The script has to return an array of the **public path** of the successfully uploaded images in json format.
212
-
213
-
#### preview
214
-
215
-
**Type**: boolean
216
-
**Default**: false
217
-
218
-
Enable / disable the preview. If enabled, you have to specify the option `onPreview`
219
-
220
-
#### onPreview
221
-
222
-
**Type**: function
223
-
**Default**:
224
-
225
-
```javascript
226
-
function (content, callback) {
227
-
callback(content);
228
-
}
229
-
```
230
-
231
-
This callback is called when the user clicks on the preview button and has two parameters:
232
-
**content** that contains the text in markdown.
233
-
**callback** is function that you have to call with the parsed html as a parameter
234
-
235
-
#### label
236
-
237
-
**Type**: object
238
-
**Default**:
239
-
240
-
```javascript
241
-
{
242
-
btnHeader1:'Header 1',
243
-
btnHeader2:'Header 2',
244
-
btnHeader3:'Header 3',
245
-
btnBold:'Bold',
246
-
btnItalic:'Italic',
247
-
btnList:'Unordered list',
248
-
btnOrderedList:'Ordered list',
249
-
btnLink:'Link',
250
-
btnImage:'Insert image',
251
-
btnUpload:'Uplaod image',
252
-
btnEdit:'Edit',
253
-
btnPreview:'Preview',
254
-
btnFullscreen:'Fullscreen',
255
-
loading:'Loading'
256
-
}
257
-
```
258
-
259
-
This object contains the strings that can be translated
260
-
261
-
### Methods
262
-
263
-
The methods are invoked passing the name of the method as string.
264
-
265
-
```javascript
266
-
var content =$('#myEditor').markdownEditor('content'); // Returns the content of the editor
267
-
$('#myEditor').markdownEditor('setContent', content); // Sets the content of the editor
268
-
```
269
-
270
-
## License
271
-
272
-
Licensed under MIT (https://github.com/inacho/bootstrap-markdown-editor/blob/master/LICENSE).
0 commit comments