[ Index ]

PHP Cross Reference of zeList

title

Body

[close]

/js/ -> link-media-upload.js (source)

   1  // send html to the link image input

   2  function send_to_editor(h) {
   3      var position = h.indexOf('src=');
   4      var src = h.substr(position + 5);
   5      var position = src.indexOf('"');
   6      var src = src.substr(0,position);
   7      
   8      if(h.indexOf('caption')) { // remove captions
   9          h = h.substr(h.indexOf('<img'));
  10          h = h.substr(0,h.indexOf('>')+1);
  11      }
  12      jQuery('#link_image_display').html(h);
  13      jQuery('#link_image').val(src);
  14      jQuery('#link_image_iframe').hide();
  15      
  16      /*

  17      if ( typeof tinyMCE != 'undefined' && ( ed = tinyMCE.activeEditor ) && !ed.isHidden() ) {

  18          ed.focus();

  19          if (tinymce.isIE)

  20              ed.selection.moveToBookmark(tinymce.EditorManager.activeEditor.windowManager.bookmark);

  21  

  22          if ( h.indexOf('[caption') === 0 ) {

  23              if ( ed.plugins.wpeditimage )

  24                  h = ed.plugins.wpeditimage._do_shcode(h);

  25          } else if ( h.indexOf('[gallery') === 0 ) {

  26              if ( ed.plugins.wpgallery )

  27                  h = ed.plugins.wpgallery._do_gallery(h);

  28          }

  29  

  30          ed.execCommand('mceInsertContent', false, h);

  31  

  32      } else if ( typeof edInsertContent == 'function' ) {

  33          edInsertContent(edCanvas, h);

  34      } else {

  35          jQuery( edCanvas ).val( jQuery( edCanvas ).val() + h );

  36      }

  37  

  38      tb_remove();

  39      */
  40  }
  41  
  42  // thickbox settings

  43  jQuery(function($) {
  44      tb_position = function() {
  45          var tbWindow = $('#TB_window');
  46          var width = $(window).width();
  47          var H = $(window).height();
  48          var W = ( 720 < width ) ? 720 : width;
  49  
  50          if ( tbWindow.size() ) {
  51              tbWindow.width( W - 50 ).height( H - 45 );
  52              $('#TB_iframeContent').width( W - 50 ).height( H - 75 );
  53              tbWindow.css({'margin-left': '-' + parseInt((( W - 50 ) / 2),10) + 'px'});
  54              if ( typeof document.body.style.maxWidth != 'undefined' )
  55                  tbWindow.css({'top':'20px','margin-top':'0'});
  56              $('#TB_title').css({'background-color':'#222','color':'#cfcfcf'});
  57          };
  58  
  59          return $('a.thickbox').each( function() {
  60              var href = $(this).attr('href');
  61              if ( ! href ) return;
  62              href = href.replace(/&width=[0-9]+/g, '');
  63              href = href.replace(/&height=[0-9]+/g, '');
  64              $(this).attr( 'href', href + '&width=' + ( W - 80 ) + '&height=' + ( H - 85 ) );
  65          });
  66      };
  67  
  68      jQuery('a.thickbox').click(function(){
  69          if ( typeof tinyMCE != 'undefined' &&  tinyMCE.activeEditor ) {
  70              tinyMCE.get('content').focus();
  71              tinyMCE.activeEditor.windowManager.bookmark = tinyMCE.activeEditor.selection.getBookmark('simple');
  72          }
  73      });
  74  
  75      $(window).resize( function() { tb_position() } );
  76  });
  77  


Generated: Sat May 30 23:51:06 2009 Cross-referenced by PHPXref 0.7