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
@@ -131,3 +131,128 @@ They can be used with or without selected text.
131
131
132
132
### Options
133
133
134
+
The following options can be passed as an object at the initialization of the plugin:
135
+
136
+
```javascript
137
+
$('#myEditor').markdownEditor({
138
+
// Options
139
+
});
140
+
```
141
+
142
+
Also, you can override the plugin default options. Example:
143
+
144
+
```javascript
145
+
$.fn.markdownEditor.defaults.width='250px';
146
+
```
147
+
148
+
#### width
149
+
150
+
**Type**: string
151
+
**Default**: '100%'
152
+
153
+
The width of the editor
154
+
155
+
#### height
156
+
157
+
**Type**: string
158
+
**Default**: '400px'
159
+
160
+
The height of the editor
161
+
162
+
#### fontSize
163
+
164
+
**Type**: string
165
+
**Default**: '14px'
166
+
167
+
The font size of the editor
168
+
169
+
#### theme
170
+
171
+
**Type**: string
172
+
**Default**: 'tomorrow'
173
+
174
+
The theme of the editor. See the available themes at the homepage of Ace (http://ace.c9.io)
175
+
176
+
#### fullscreen
177
+
178
+
**Type**: boolean
179
+
**Default**: true
180
+
181
+
Enable / disable fullscreen
182
+
183
+
#### imageUpload
184
+
185
+
**Type**: boolean
186
+
**Default**: false
187
+
188
+
Enable / disable the upload of images. If enabled, you have to specify the option `uploadPath`
189
+
190
+
#### uploadPath
191
+
192
+
**Type**: uploadPath
193
+
**Default**: ''
194
+
195
+
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.
196
+
197
+
#### preview
198
+
199
+
**Type**: boolean
200
+
**Default**: false
201
+
202
+
Enable / disable the preview. If enabled, you have to specify the option `onPreview`
203
+
204
+
#### onPreview
205
+
206
+
**Type**: function
207
+
**Default**:
208
+
209
+
```javascript
210
+
function (content, callback) {
211
+
callback(content);
212
+
}
213
+
```
214
+
215
+
This callback is called when the user clicks on the preview button and has two parameters:
216
+
**content** that contains the text in markdown.
217
+
**callback** is function that you have to call with the parsed html as a parameter
218
+
219
+
#### label
220
+
221
+
**Type**: object
222
+
**Default**:
223
+
224
+
```javascript
225
+
{
226
+
btnHeader1:'Header 1',
227
+
btnHeader2:'Header 2',
228
+
btnHeader3:'Header 3',
229
+
btnBold:'Bold',
230
+
btnItalic:'Italic',
231
+
btnLink:'Link',
232
+
btnImage:'Insert image',
233
+
btnUpload:'Uplaod image',
234
+
btnEdit:'Edit',
235
+
btnPreview:'Preview',
236
+
btnFullscreen:'Fullscreen',
237
+
loading:'Loading'
238
+
}
239
+
```
240
+
241
+
This object contains the strings that can be translated
242
+
243
+
### Methods
244
+
245
+
The methods are invoked passing the name of the method as string.
246
+
Only one method is available:
247
+
248
+
```javascript
249
+
var content =$('#myEditor').markdownEditor('content'); // Returns the content of the editor
250
+
```
251
+
252
+
## License
253
+
254
+
Licensed under MIT (https://github.com/inacho/bootstrap-markdown-editor/blob/master/LICENSE).
0 commit comments