- var editorData = {
- mode : "specific_textareas",
- editor_selector : "profile-jot-text",
- auto_focus : "profile-jot-text",
- //plugins : "bbcode,paste,autoresize,inlinepopups",
- //paste_text_sticky : true,
- convert_urls : false,
- setup : function(ed) {
- cPopup = null;
- ed.onKeyDown.add(function(ed,e) {
- if (cPopup !== null)
- cPopup.onkey(e);
- });
-
- ed.onKeyUp.add(function(ed, e) {
- var txt = tinyMCE.activeEditor.getContent();
- match = txt.match(/@([^ \n]+)$/);
- if (match!==null) {
- if (cPopup === null) {
- cPopup = new ACPopup(this,baseurl+"/acl");
- }
- if (cPopup.ready && match[1]!==cPopup.searchText) cPopup.search(match[1]);
- if (! cPopup.ready) cPopup = null;
- } else {
- if (cPopup !== null) { cPopup.close(); cPopup = null; }
- }
-
- textlen = txt.length;
- if (textlen != 0 && $('#jot-perms-icon').is('.unlock')) {
- $('#profile-jot-desc').html(window.isPublic);
- } else {
- $('#profile-jot-desc').html(' ');
- }
-
- //Character count
-
- if (textlen <= 140) {
- $('#character-counter').removeClass('red');
- $('#character-counter').removeClass('orange');
- $('#character-counter').addClass('grey');
- }
- if ((textlen > 140) && (textlen <= 420)) {
- $('#character-counter').removeClass('grey');
- $('#character-counter').removeClass('red');
- $('#character-counter').addClass('orange');
- }
- if (textlen > 420) {
- $('#character-counter').removeClass('grey');
- $('#character-counter').removeClass('orange');
- $('#character-counter').addClass('red');
- }
- $('#character-counter').text(textlen);
- });
-
- ed.onInit.add(function(ed) {
- ed.pasteAsPlainText = true;
- $("#profile-jot-text-loading").hide();
- $(".jothidden").show();
- if (typeof cb!="undefined") cb();
- });
-
- },
- plaintextFn : function() {
- $("#profile-jot-text-loading").hide();
- $("#profile-jot-text").css({ 'height': 200, 'color': '#000' });
- $("#profile-jot-text").editor_autocomplete(baseurl+"/acl");
- $(".jothidden").show();
- if (typeof cb!="undefined") cb();
- }
- };
- InitMCEEditor(editorData);
-