File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change 50
50
"</div>" +
51
51
"<div class='modal-body'>" +
52
52
"<input value='http://' class='bootstrap-wysihtml5-insert-link-url input-xlarge'>" +
53
+ "<label class='checkbox'> <input type='checkbox' class='bootstrap-wysihtml5-insert-link-target' checked>" + locale . link . target + "</label>" +
53
54
"</div>" +
54
55
"<div class='modal-footer'>" +
55
56
"<a href='#' class='btn' data-dismiss='modal'>" + locale . link . cancel + "</a>" +
282
283
var self = this ;
283
284
var insertLinkModal = toolbar . find ( '.bootstrap-wysihtml5-insert-link-modal' ) ;
284
285
var urlInput = insertLinkModal . find ( '.bootstrap-wysihtml5-insert-link-url' ) ;
286
+ var targetInput = insertLinkModal . find ( '.bootstrap-wysihtml5-insert-link-target' ) ;
285
287
var insertButton = insertLinkModal . find ( 'a.btn-primary' ) ;
286
288
var initialValue = urlInput . val ( ) ;
287
289
var caretBookmark ;
294
296
self . editor . composer . selection . setBookmark ( caretBookmark ) ;
295
297
caretBookmark = null ;
296
298
}
299
+
300
+ var newWindow = targetInput . prop ( "checked" ) ;
297
301
self . editor . composer . commands . exec ( "createLink" , {
298
- href : url ,
299
- target : " _blank" ,
300
- rel : " nofollow"
302
+ ' href' : url ,
303
+ ' target' : ( newWindow ? ' _blank' : '_self' ) ,
304
+ ' rel' : ( newWindow ? ' nofollow' : '' )
301
305
} ) ;
302
306
} ;
303
307
var pressedEnter = false ;
427
431
}
428
432
} ,
429
433
"a" : {
430
- set_attributes : {
431
- target : "_blank" ,
432
- rel : "nofollow"
433
- } ,
434
434
check_attributes : {
435
- href : "url" // important to avoid XSS
435
+ 'href' : "url" , // important to avoid XSS
436
+ 'target' : 'alt' ,
437
+ 'rel' : 'alt'
436
438
}
437
439
} ,
438
440
"span" : 1 ,
471
473
} ,
472
474
link : {
473
475
insert : "Insert link" ,
474
- cancel : "Cancel"
476
+ cancel : "Cancel" ,
477
+ target : "Open link in new window"
475
478
} ,
476
479
image : {
477
480
insert : "Insert image" ,
You can’t perform that action at this time.
0 commit comments