+ theme : "advanced",
+ plugins : "paste,fullscreen,autoresize,inlinepopups,tabfocus,linkautodetect",
+ theme_advanced_buttons1 : "bold,italic,strikethrough,|,undo,redo,|,link,unlink,image,|,fullscreen",
+ theme_advanced_buttons2 : "",
+ theme_advanced_buttons3 : "",
+ add_form_submit_trigger : false,
+ theme_advanced_resizing : true,
+ tabfocus_elements: ":prev,:next",
+ setup: function(ed) {
+ noticeForm.append('<input type="hidden" name="richedit" value="1">');
+
+ form.find('.submit:first').click(function() {
+ tinymce.triggerSave();
+ });
+
+ var origCounter = SN.U.CharacterCount;
+ SN.U.CharacterCount = function(form) {
+ var text = $(ed.getDoc()).text();
+ return text.length;
+ };
+ ed.onKeyUp.add(function (ed, e) {
+ SN.U.Counter(noticeForm);
+ });
+
+ form.find('input[type=file]').change(function() {
+ var img = '<img src="{$placeholder}" class="placeholder" width="320" height="240">';
+ var html = tinyMCE.activeEditor.getContent();
+ ed.setContent(html + img);
+ });
+ }