|
@@ -669,9 +669,15 @@ smc_Editor.prototype.insertSmiley = function(oSmileyProperties)
|
|
|
|
|
|
if (!this.bRichTextEnabled)
|
|
|
{
|
|
|
- var begin = this.oTextHandle.value.substr(this.oTextHandle.selectionStart - 1, 1);
|
|
|
- var end = this.oTextHandle.value.substr(this.oTextHandle.selectionEnd, 1);
|
|
|
- this.insertText((begin != ' ' ? ' ' : '') + oSmileyProperties.sCode + (end != ' ' ? ' ' : ''));
|
|
|
+
|
|
|
+ if ('selectionStart' in this.oTextHandle)
|
|
|
+ {
|
|
|
+ var begin = this.oTextHandle.value.substr(this.oTextHandle.selectionStart - 1, 1);
|
|
|
+ var end = this.oTextHandle.value.substr(this.oTextHandle.selectionEnd, 1);
|
|
|
+ this.insertText((begin != ' ' ? ' ' : '') + oSmileyProperties.sCode + (end != ' ' ? ' ' : ''));
|
|
|
+ }
|
|
|
+ else
|
|
|
+ this.insertText(oSmileyProperties.sCode);
|
|
|
}
|
|
|
|
|
|
else
|