[ Index ]
 

Code source de GeekLog 1.4.1

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/public_html/javascript/ -> submitcomment_fckeditor.js (source)

   1  // +---------------------------------------------------------------------------+
   2  // | Copyright (C) 2003,2004 by the following authors:                         |
   3  // | Version 1.0    Date: Jun 4, 2005                                          |
   4  // | Authors:   Blaine Lang - blaine@portalparts.com                           |
   5  // |                                                                           |
   6  // | Javascript functions for FCKEditor Integration into Geeklog                |
   7  // |                                                                           |
   8  // +---------------------------------------------------------------------------+
   9  
  10      window.onload = function() {
  11          var oFCKeditor1 = new FCKeditor( 'comment_html' ) ;
  12          oFCKeditor1.BasePath = geeklogEditorBasePath;
  13          oFCKeditor1.Config['CustomConfigurationsPath'] = geeklogEditorBaseUrl + '/fckeditor/myconfig.js';
  14          oFCKeditor1.ToolbarSet = 'editor-toolbar1' ;
  15          oFCKeditor1.Height = 200 ;
  16          oFCKeditor1.ReplaceTextarea() ;
  17      }
  18      function change_editmode(obj) {
  19          if (obj.value == 'html') {
  20              document.getElementById('text_editor').style.display='none';
  21              document.getElementById('html_editor').style.display='';
  22              swapEditorContent('html');
  23          } else {
  24              document.getElementById('text_editor').style.display='';
  25              document.getElementById('html_editor').style.display='none';
  26              swapEditorContent('text');
  27          }
  28      }
  29  
  30      function getEditorContent() {
  31          // Get the editor instance that we want to interact with.
  32          var oEditor = FCKeditorAPI.GetInstance('comment_html') ;
  33          // return the editor contents in XHTML.
  34          return oEditor.GetXHTML( true );
  35      }
  36  
  37      function swapEditorContent(curmode) {
  38          var content = '';
  39          var oEditor = FCKeditorAPI.GetInstance('comment_html') ;
  40          if (curmode == 'html') { // Switching from Text to HTML mode
  41              // Get the content from the textarea 'text' content and copy it to the editor
  42              content = document.getElementById('comment_text').value;
  43              oEditor.SetHTML(content);
  44          } else {
  45                content = getEditorContent();
  46                document.getElementById('comment_text').value = content;
  47            }
  48      }
  49  
  50      function set_postcontent() {
  51          if (document.getElementById('sel_editmode').value == 'html') {
  52              document.getElementById('comment_text').value = getEditorContent();
  53          }
  54      }


Généré le : Wed Nov 21 12:27:40 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics