[ Index ]
 

Code source de LifeType 1.2.4

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/js/tinymce/ -> tiny_mce-plog-resourcelist.js (source)

   1  /*

   2   * Insert resource related javascript functions

   3   */
   4  
   5  function _generateResourceLink( resourceId, resourceLink, targetLink, resourceName, resourceDesc, resourceType, resourceMimeType )
   6  {
   7      var htmlCode = '';
   8  
   9      if( resourceType == 1 ) {
  10          if( targetLink != '' ) {
  11              htmlCode = '<a id="res_'+resourceId+ '" href="'+targetLink+'" type="'+resourceMimeType+'">';
  12              htmlCode += '<img style="margin: 5px;" border="0" alt="'+resourceDesc+'" src="'+resourceLink+'" />';
  13              htmlCode += '</a>';
  14          } 
  15          else {
  16              htmlCode = '<img style="margin: 5px;" alt="'+resourceDesc+'" src="'+resourceLink+'" />';
  17          }
  18      }
  19      else {
  20          // if not an image, there is not much we can do

  21          htmlCode = '<a id="res_'+resourceId+'" title="'+resourceDesc+'" href="'+resourceLink+'" type="'+resourceMimeType+'">'+resourceName+'</a>';
  22      }
  23    
  24      return htmlCode;
  25  
  26  }
  27  
  28  function addHtmlareaLink( resourceId, resourceLink, targetLink, resourceName, resourceDesc, resourceType, resourceMimeType ) {
  29      var htmlCode = _generateResourceLink( resourceId, resourceLink, targetLink, resourceName, resourceDesc, resourceType, resourceMimeType );
  30      
  31      tinyMCE.execCommand("mceInsertContent",true,htmlCode);
  32      tinyMCE.selectedInstance.repaint();
  33  
  34      // Close the dialog

  35      tinyMCE.closeWindow(window);
  36  };
  37  
  38  function addResourceLink( resourceId, resourceLink, targetLink, resourceName, resourceDesc, resourceType, resourceMimeType ) 
  39  {
  40      // generate the link

  41      var htmlCode = _generateResourceLink( resourceId, resourceLink, targetLink, resourceName, resourceDesc, resourceType, resourceMimeType );
  42  
  43      addText( parent.opener.document.newPost.postText, htmlCode );
  44  }
  45  
  46  /*

  47   * Insert album related javascript functions

  48   */
  49   
  50  function _generateAlbumLink( albumLink, albumName, albumDesc ) 
  51  {
  52      var htmlCode = '';
  53      htmlCode = '<a title="'+albumDesc+'" href="'+albumLink+'">'+albumName+'</a>';
  54      
  55      return htmlCode;      
  56  }
  57  
  58  function addHtmlareaAlbumLink( albumLink, albumName, albumDesc ) 
  59  {
  60      var htmlCode = _generateAlbumLink( albumLink, albumName, albumDesc );
  61  
  62      tinyMCE.execCommand("mceInsertContent",true,htmlCode);
  63      tinyMCE.selectedInstance.repaint();
  64  
  65      // Close the dialog

  66      tinyMCE.closeWindow(window);
  67  }
  68  
  69  function addAlbumLink( albumLink, albumName, albumDesc ) 
  70  {
  71      var htmlCode = _generateAlbumLink( albumLink, albumName, albumDesc );
  72  
  73      addText( parent.opener.document.newPost.postText, htmlCode );
  74  }
  75  
  76  function onCancel() {
  77      tinyMCE.closeWindow(window);
  78  };
  79  
  80  /**

  81   * Generates the correct markup code for the Flash MP3 and video player

  82   * depending on whether TinyMCE is enabled or not

  83   *

  84   * @param url

  85   * @param tinyMCE

  86   */
  87  function insertMediaPlayer( url, tinyMCEEnabled, height, width )
  88  {
  89      if( tinyMCEEnabled ) {
  90          var htmlCode = '<img src="' + (tinyMCE.getParam("theme_href") + "/images/spacer.gif") + '" mce_src="' + (tinyMCE.getParam("theme_href") + "/images/spacer.gif") + '" ' + 'width="' + width + '" height="' + height + '" ' + 'border="0" alt="' + url + '" title="' + url + '" class="ltFlashPlayer" />';
  91  
  92             tinyMCE.execCommand( "mceInsertContent", true, htmlCode );
  93          tinyMCE.selectedInstance.repaint();    
  94  
  95          // Close the dialog

  96          tinyMCE.closeWindow(window);
  97      }
  98      else {
  99          addText( parent.opener.document.newPost.postText, getFlashPlayerHTML( url, height, width ));
 100      }
 101  }


Généré le : Mon Nov 26 21:04:15 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics