Skip to content

Commit

Permalink
add default link prefix in LinkDialog
Browse files Browse the repository at this point in the history
  • Loading branch information
easylogic committed May 19, 2015
1 parent c3c5d02 commit 6aca747
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/js/Renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ define([
'</div>' +
'<div class="form-group row-fluid">' +
'<label>' + lang.link.url + '</label>' +
'<input class="note-link-url form-control span12" type="text" />' +
'<input class="note-link-url form-control span12" type="text" value="http://" />' +
'</div>' +
(!options.disableLinkTarget ?
'<div class="checkbox">' +
Expand Down
2 changes: 0 additions & 2 deletions src/js/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,6 @@ define('summernote/defaults', function () {
onCreateLink: function (sLinkUrl) {
if (sLinkUrl.indexOf('@') !== -1 && sLinkUrl.indexOf(':') === -1) {
sLinkUrl = 'mailto:' + sLinkUrl;
} else if (sLinkUrl.indexOf('://') === -1) {
sLinkUrl = 'http://' + sLinkUrl;
}

return sLinkUrl;
Expand Down
2 changes: 1 addition & 1 deletion src/js/module/LinkDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ define([

// if no url was given, copy text to url
if (!linkInfo.url) {
linkInfo.url = linkInfo.text;
linkInfo.url = linkInfo.text || 'http://';
toggleBtn($linkBtn, linkInfo.text);
}

Expand Down

0 comments on commit 6aca747

Please sign in to comment.