[ Index ]
 

Code source de PHP NUKE 7.9

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/includes/tiny_mce/plugins/preview/ -> editor_plugin_src.js (source)

   1  /* Import plugin specific language pack */

   2  tinyMCE.importPluginLanguagePack('preview', 'albanian,arabic,brazilian,catala,chinese,czech,danish,dutch,english,euskara,finnish,french,galego,german,greek,hungarian,icelandic,indonesian,italian,macedonian,norwegian,polish,portuguese,romanian,russian,slovak,slovenian,spanish,swedish,thai,turkish,ukrainian,vietnamese');
   3  
   4  /**

   5   * Returns the HTML contents of the preview control.

   6   */
   7  function TinyMCE_preview_getControlHTML(control_name) {
   8      switch (control_name) {
   9          case "preview":
  10              return '<img id="{$editor_id}_preview" src="{$pluginurl}/images/preview.gif" title="{$lang_preview_desc}" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcePreview\');" />';
  11      }
  12  
  13      return "";
  14  }
  15  
  16  /**

  17   * Executes the mcePreview command.

  18   */
  19  function TinyMCE_preview_execCommand(editor_id, element, command, user_interface, value) {
  20      // Handle commands

  21      switch (command) {
  22          case "mcePreview":
  23              var previewPage = tinyMCE.getParam("plugin_preview_pageurl", null);
  24              var previewWidth = tinyMCE.getParam("plugin_preview_width", "550");
  25              var previewHeight = tinyMCE.getParam("plugin_preview_height", "600");
  26  
  27              // Use a custom preview page

  28              if (previewPage) {
  29                  var template = new Array();
  30  
  31                  template['file'] = previewPage;
  32                  template['width'] = previewWidth;
  33                  template['height'] = previewHeight;
  34  
  35                  tinyMCE.openWindow(template, {editor_id : editor_id, resizable : "yes", scrollbars : "yes", content : tinyMCE.getContent(), content_css : tinyMCE.getParam("content_css")});
  36              } else {
  37                  var win = window.open("", "mcePreview", "menubar=no,toolbar=no,scrollbars=yes,resizable=yes,left=20,top=20,width=" + previewWidth + ",height="  + previewHeight);
  38                  var html = "";
  39  
  40                  html += '<!doctype html public "-//w3c//dtd html 4.0 transitional//en">';
  41                  html += '<html>';
  42                  html += '<head>';
  43                  html += '<title>' + tinyMCE.getLang('lang_preview_desc') + '</title>';
  44                  html += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">';
  45                  html += '<link href="' + tinyMCE.getParam("content_css") + '" rel="stylesheet" type="text/css">';
  46                  html += '</head>';
  47                  html += '<body>';
  48                  html += tinyMCE.getContent();
  49                  html += '</body>';
  50                  html += '</html>';
  51  
  52                  win.document.write(html);
  53                  win.document.close();
  54              }
  55  
  56              return true;
  57      }
  58  
  59      // Pass to next handler in chain

  60      return false;
  61  }


Généré le : Sun Apr 1 11:11:59 2007 par Balluche grâce à PHPXref 0.7