Skip to content

Commit

Permalink
[SCEditor - bbcode] If the email or the link are not specified, do no…
Browse files Browse the repository at this point in the history
…t ask for the display text

Signed-off-by: emanuele <emanuele45@gmail.com>
  • Loading branch information
emanuele45 committed Sep 13, 2012
1 parent c1d5e39 commit 1bbcfd5
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Themes/default/scripts/jquery.sceditor.bbcode.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,19 +164,21 @@
} },
email: { txtExec: function(caller, selected) {
var display = selected && selected.indexOf('@') > -1 ? null : selected,
email = prompt(this._("Enter the e-mail address:"), (display ? '' : selected)),
email = prompt(this._("Enter the e-mail address:"), (display ? '' : selected));
if (email)
{
text = prompt(this._("Enter the displayed text:"), display || email) || email;

if(email)
this.insertText("[email=" + email + "]" + text + "[/email]");
}
} },
link: { txtExec: function(caller, selected) {
var display = selected && selected.indexOf('http://') > -1 ? null : selected,
url = prompt(this._("Enter URL:"), (display ? 'http://' : selected)),
url = prompt(this._("Enter URL:"), (display ? 'http://' : selected));
if (url)
{
text = prompt(this._("Enter the displayed text:"), display || url) || url;

if(url)
this.insertText("[url=" + url + "]" + text + "[/url]");
}
} },
quote: { txtExec: ["[quote]", "[/quote]"] },
youtube: { txtExec: function(caller) {
Expand Down

0 comments on commit 1bbcfd5

Please sign in to comment.