Skip to content

Commit

Permalink
Merge pull request summernote#2195 from dmitriy-strukov/add-target-blank
Browse files Browse the repository at this point in the history
Feature | Added target blank option
  • Loading branch information
hackerwins authored May 13, 2017
2 parents 91986f6 + 946c264 commit 444e989
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
32 changes: 32 additions & 0 deletions examples/link-blank.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>summernote</title>
<!-- include jquery -->
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>

<!-- include libraries BS3 -->
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.1/css/bootstrap.min.css" />
<script type="text/javascript" src="http://netdna.bootstrapcdn.com/bootstrap/3.0.1/js/bootstrap.min.js"></script>

<!-- include summernote -->
<link rel="stylesheet" href="../dist/summernote.css">
<script type="text/javascript" src="../dist/summernote.js"></script>
<script type="text/javascript" src="../lang/summernote-ko-KR.js"></script>

<script type="text/javascript">
$(document).ready(function() {
$('.summernote').summernote({
height: 200,
tabsize: 2,
linkTargetBlank: false
});
});
</script>
</head>
<body>
<textarea class="summernote"></textarea>
</body>
</html>
2 changes: 1 addition & 1 deletion src/js/bs3/module/LinkDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ define([
self.bindEnterKey($linkUrl, $linkBtn);
self.bindEnterKey($linkText, $linkBtn);

$openInNewWindow.prop('checked', linkInfo.isNewWindow);
$openInNewWindow.prop('checked', context.options.linkTargetBlank || linkInfo.isNewWindow);

$linkBtn.one('click', function (event) {
event.preventDefault();
Expand Down
3 changes: 2 additions & 1 deletion src/js/bs3/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ define([
},

buttons: {},

lang: 'en-US',

// toolbar
Expand Down Expand Up @@ -101,6 +101,7 @@ define([

width: null,
height: null,
linkTargetBlank: null,

focus: false,
tabSize: 4,
Expand Down

0 comments on commit 444e989

Please sign in to comment.