[ Index ]
 

Code source de GeekLog 1.4.1

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/public_html/javascript/ -> submitstory_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  
  11      window.onload = function() {
  12          var oFCKeditor1 = new FCKeditor( 'introhtml' ) ;
  13          oFCKeditor1.BasePath = geeklogEditorBasePath;
  14          oFCKeditor1.Config['CustomConfigurationsPath'] = geeklogEditorBaseUrl + '/fckeditor/myconfig.js';
  15          oFCKeditor1.ToolbarSet = 'editor-toolbar1' ;
  16          oFCKeditor1.Height = 200 ;
  17          oFCKeditor1.ReplaceTextarea() ;
  18      }
  19  
  20      function change_editmode(obj) {
  21          if (obj.value == 'html') {
  22              document.getElementById('text_editor').style.display='none';
  23              document.getElementById('html_editor').style.display='';
  24              swapEditorContent('html');
  25          } else {
  26              document.getElementById('text_editor').style.display='';
  27              document.getElementById('html_editor').style.display='none';
  28              swapEditorContent('text');
  29          }
  30      }
  31  
  32      function getEditorContent() {
  33          // Get the editor instance that we want to interact with.
  34          var oEditor = FCKeditorAPI.GetInstance('introhtml') ;
  35          // return the editor contents in XHTML.
  36          return oEditor.GetXHTML( true );
  37      }
  38  
  39      function swapEditorContent(curmode) {
  40          var content = '';
  41          var oEditor = FCKeditorAPI.GetInstance('introhtml') ;
  42          if (curmode == 'html') { // Switching from Text to HTML mode
  43              // Get the content from the textarea 'text' content and copy it to the editor
  44              content = document.getElementById('introtext').value;
  45              oEditor.SetHTML(content);
  46          } else {
  47                content = getEditorContent();
  48                document.getElementById('introtext').value = content;
  49            }
  50      }
  51  
  52      function set_postcontent() {
  53          if (document.getElementById('sel_editmode').value == 'html') {
  54              document.getElementById('introtext').value = getEditorContent();
  55          }
  56      }


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