|
13 | 13 | "<li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h1' tabindex='-1'>" + locale.font_styles.h1 + "</a></li>" +
|
14 | 14 | "<li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h2' tabindex='-1'>" + locale.font_styles.h2 + "</a></li>" +
|
15 | 15 | "<li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h3' tabindex='-1'>" + locale.font_styles.h3 + "</a></li>" +
|
| 16 | + "<li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h4'>" + locale.font_styles.h4 + "</a></li>" + |
| 17 | + "<li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h5'>" + locale.font_styles.h5 + "</a></li>" + |
| 18 | + "<li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h6'>" + locale.font_styles.h6 + "</a></li>" + |
16 | 19 | "</ul>" +
|
17 | 20 | "</li>";
|
18 | 21 | },
|
|
50 | 53 | "</div>" +
|
51 | 54 | "<div class='modal-body'>" +
|
52 | 55 | "<input value='http://' class='bootstrap-wysihtml5-insert-link-url input-xlarge'>" +
|
| 56 | + "<label class='checkbox'> <input type='checkbox' class='bootstrap-wysihtml5-insert-link-target' checked>" + locale.link.target + "</label>" + |
53 | 57 | "</div>" +
|
54 | 58 | "<div class='modal-footer'>" +
|
55 | 59 | "<a href='#' class='btn' data-dismiss='modal'>" + locale.link.cancel + "</a>" +
|
|
282 | 286 | var self = this;
|
283 | 287 | var insertLinkModal = toolbar.find('.bootstrap-wysihtml5-insert-link-modal');
|
284 | 288 | var urlInput = insertLinkModal.find('.bootstrap-wysihtml5-insert-link-url');
|
| 289 | + var targetInput = insertLinkModal.find('.bootstrap-wysihtml5-insert-link-target'); |
285 | 290 | var insertButton = insertLinkModal.find('a.btn-primary');
|
286 | 291 | var initialValue = urlInput.val();
|
287 | 292 | var caretBookmark;
|
|
294 | 299 | self.editor.composer.selection.setBookmark(caretBookmark);
|
295 | 300 | caretBookmark = null;
|
296 | 301 | }
|
| 302 | + |
| 303 | + var newWindow = targetInput.prop("checked"); |
297 | 304 | self.editor.composer.commands.exec("createLink", {
|
298 |
| - href: url, |
299 |
| - target: "_blank", |
300 |
| - rel: "nofollow" |
| 305 | + 'href' : url, |
| 306 | + 'target' : (newWindow ? '_blank' : '_self'), |
| 307 | + 'rel' : (newWindow ? 'nofollow' : '') |
301 | 308 | });
|
302 | 309 | };
|
303 | 310 | var pressedEnter = false;
|
|
350 | 357 | });
|
351 | 358 | },
|
352 | 359 | shallowExtend: function (options) {
|
353 |
| - var settings = $.extend({}, $.fn.wysihtml5.defaultOptions, options || {}); |
| 360 | + var settings = $.extend({}, $.fn.wysihtml5.defaultOptions, options || {}, $(this).data()); |
354 | 361 | var that = this;
|
355 | 362 | return methods.bypassDefaults.apply(that, [settings]);
|
356 | 363 | },
|
|
416 | 423 | "h1": {},
|
417 | 424 | "h2": {},
|
418 | 425 | "h3": {},
|
| 426 | + "h4": {}, |
| 427 | + "h5": {}, |
| 428 | + "h6": {}, |
419 | 429 | "blockquote": {},
|
420 | 430 | "u": 1,
|
421 | 431 | "img": {
|
|
427 | 437 | }
|
428 | 438 | },
|
429 | 439 | "a": {
|
430 |
| - set_attributes: { |
431 |
| - target: "_blank", |
432 |
| - rel: "nofollow" |
433 |
| - }, |
434 | 440 | check_attributes: {
|
435 |
| - href: "url" // important to avoid XSS |
| 441 | + 'href': "url", // important to avoid XSS |
| 442 | + 'target': 'alt', |
| 443 | + 'rel': 'alt' |
436 | 444 | }
|
437 | 445 | },
|
438 | 446 | "span": 1,
|
|
456 | 464 | normal: "Normal text",
|
457 | 465 | h1: "Heading 1",
|
458 | 466 | h2: "Heading 2",
|
459 |
| - h3: "Heading 3" |
| 467 | + h3: "Heading 3", |
| 468 | + h4: "Heading 4", |
| 469 | + h5: "Heading 5", |
| 470 | + h6: "Heading 6" |
460 | 471 | },
|
461 | 472 | emphasis: {
|
462 | 473 | bold: "Bold",
|
|
471 | 482 | },
|
472 | 483 | link: {
|
473 | 484 | insert: "Insert link",
|
474 |
| - cancel: "Cancel" |
| 485 | + cancel: "Cancel", |
| 486 | + target: "Open link in new window" |
475 | 487 | },
|
476 | 488 | image: {
|
477 | 489 | insert: "Insert image",
|
|
0 commit comments