- $b .= " v = $(\"#profile-jot-text\").val()\n";
- $b .= " v = v + text\n";
- $b .= " $(\"#profile-jot-text\").val(v)\n";
+ $b .= " if(plaintext == 'none') {\n";
+ $b .= " var v = $(\"#profile-jot-text\").val();\n";
+ $b .= " v = v + text;\n";
+ $b .= " $(\"#profile-jot-text\").val(v);\n";
+ $b .= " $(\"#profile-jot-text\").focus();\n";
+ $b .= " } else {\n";
+ $b .= " var v = tinymce.activeEditor.getContent();\n";
+ $b .= " v = v + text;\n";
+ $b .= " tinymce.activeEditor.setContent(v);\n";
+ $b .= " tinymce.activeEditor.focus();\n";
+ $b .= " }\n";