Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tinyMCE.init({
- setup: function(ed)
- {
- //console.log('entradilla deberia de estar desactivada');
- ed.onKeyUp.add(function(ed, evt)
- {
- if($('.entradilla_check').is(':checked')) {
- // get html content of first paragraph in the editor
- var first_node_html = $(ed.getBody()).find('p:first').html();
- // copythe html content into the textarea '.entradilla'
- $('.entradilla').text(first_node_html);
- // if intro is a tinymce editor too you will need some other code
- // here it is
- tinymce.get('entradilla').setContent(first_node_html);
- }
- });
- },
- language : 'es',
- mode: 'textareas',
- editor_selector : "tiny_editor",
- //valid_elements : "a[href|target=_blank],strong/b, u, i, p",
- cleanup: true,
- theme: 'advanced',
- theme_advanced_toolbar_align: 'left',
- theme_advanced_toolbar_location: 'top',
- theme_advanced_statusbar_location: 'bottom',
- plugins: 'table,advhr,advlink,preview,advimage,media,searchreplace,print,fullscreen,paste',
- theme_advanced_buttons1: 'bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,outdent,indent,|,fontselect,fontsizeselect,forecolor,backcolor',
- theme_advanced_buttons2: 'cut,copy,paste,pastetext,pasteword,|,search,replace,|,undo,redo,|,link,unlink,anchor,advhr,|,sub,sup,|,charmap,image,media,|,cleanup,removeformat,code,fullscreen',
- theme_advanced_buttons3: 'tablecontrols,|,preview,print,|,help',
- extended_valid_elements: 'iframe[align<bottom?left?middle?right?top|class|frameborder|height|id|longdesc|marginheight|marginwidth|name|scrolling<auto?no?yes|src|style|title|width]'
- });
- if($('.entradilla_check').is(':checked')) {
- tinyMCE.execCommand('mceRemoveControl', false, 'entradilla');
- // |
- // |->//This returns no error, but does nothing
- tinymce.get('entradilla').settings.readonly = false;
- // |
- // |->//tinymce.get("entradilla") is undefined
- window.tinyMCE.get('entradilla').setAttribute('contenteditable', false);
- // |
- // |->//window.tinyMCE.get("entradilla") is undefined
- window.tinyMCE.activeEditor.getBody().setAttribute('contenteditable', false);
- // |
- // |->//window.tinyMCE.activeEditor is null
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement