Răsfoiți Sursa

[SCEditor - bbcode] If the email or the link are not specified, do not ask for the display text

Signed-off-by: emanuele <[email protected]>
emanuele 12 ani în urmă
părinte
comite
1bbcfd528a
1 a modificat fișierele cu 8 adăugiri și 6 ștergeri
  1. 8 6
      Themes/default/scripts/jquery.sceditor.bbcode.js

+ 8 - 6
Themes/default/scripts/jquery.sceditor.bbcode.js

@@ -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) {