[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/js/plupload/ -> handlers.js (source)

   1  /* global plupload, pluploadL10n, ajaxurl, post_id, wpUploaderInit, deleteUserSetting, setUserSetting, getUserSetting, shortform */
   2  var topWin = window.dialogArguments || opener || parent || top, uploader, uploader_init;
   3  
   4  // progress and success handlers for media multi uploads
   5  function fileQueued( fileObj ) {
   6      // Get rid of unused form
   7      jQuery( '.media-blank' ).remove();
   8  
   9      var items = jQuery( '#media-items' ).children(), postid = post_id || 0;
  10  
  11      // Collapse a single item
  12      if ( items.length == 1 ) {
  13          items.removeClass( 'open' ).find( '.slidetoggle' ).slideUp( 200 );
  14      }
  15      // Create a progress bar containing the filename
  16      jQuery( '<div class="media-item">' )
  17          .attr( 'id', 'media-item-' + fileObj.id )
  18          .addClass( 'child-of-' + postid )
  19          .append( '<div class="progress"><div class="percent">0%</div><div class="bar"></div></div>',
  20              jQuery( '<div class="filename original">' ).text( ' ' + fileObj.name ) )
  21          .appendTo( jQuery( '#media-items' ) );
  22  
  23      // Disable submit
  24      jQuery( '#insert-gallery' ).prop( 'disabled', true );
  25  }
  26  
  27  function uploadStart() {
  28      try {
  29          if ( typeof topWin.tb_remove != 'undefined' )
  30              topWin.jQuery( '#TB_overlay' ).unbind( 'click', topWin.tb_remove );
  31      } catch( e ){}
  32  
  33      return true;
  34  }
  35  
  36  function uploadProgress( up, file ) {
  37      var item = jQuery( '#media-item-' + file.id );
  38  
  39      jQuery( '.bar', item ).width( ( 200 * file.loaded ) / file.size );
  40      jQuery( '.percent', item ).html( file.percent + '%' );
  41  }
  42  
  43  // check to see if a large file failed to upload
  44  function fileUploading( up, file ) {
  45      var hundredmb = 100 * 1024 * 1024,
  46          max = parseInt( up.settings.max_file_size, 10 );
  47  
  48      if ( max > hundredmb && file.size > hundredmb ) {
  49          setTimeout( function() {
  50              if ( file.status < 3 && file.loaded === 0 ) { // not uploading
  51                  wpFileError( file, pluploadL10n.big_upload_failed.replace( '%1$s', '<a class="uploader-html" href="#">' ).replace( '%2$s', '</a>' ) );
  52                  up.stop(); // stops the whole queue
  53                  up.removeFile( file );
  54                  up.start(); // restart the queue
  55              }
  56          }, 10000 ); // wait for 10 sec. for the file to start uploading
  57      }
  58  }
  59  
  60  function updateMediaForm() {
  61      var items = jQuery( '#media-items' ).children();
  62  
  63      // Just one file, no need for collapsible part
  64      if ( items.length == 1 ) {
  65          items.addClass( 'open' ).find( '.slidetoggle' ).show();
  66          jQuery( '.insert-gallery' ).hide();
  67      } else if ( items.length > 1 ) {
  68          items.removeClass( 'open' );
  69          // Only show Gallery/Playlist buttons when there are at least two files.
  70          jQuery( '.insert-gallery' ).show();
  71      }
  72  
  73      // Only show Save buttons when there is at least one file.
  74      if ( items.not( '.media-blank' ).length > 0 )
  75          jQuery( '.savebutton' ).show();
  76      else
  77          jQuery( '.savebutton' ).hide();
  78  }
  79  
  80  function uploadSuccess( fileObj, serverData ) {
  81      var item = jQuery( '#media-item-' + fileObj.id );
  82  
  83      // on success serverData should be numeric, fix bug in html4 runtime returning the serverData wrapped in a <pre> tag
  84      if ( typeof serverData === 'string' ) {
  85          serverData = serverData.replace( /^<pre>(\d+)<\/pre>$/, '$1' );
  86  
  87          // if async-upload returned an error message, place it in the media item div and return
  88          if ( /media-upload-error|error-div/.test( serverData ) ) {
  89              item.html( serverData );
  90              return;
  91          }
  92      }
  93  
  94      item.find( '.percent' ).html( pluploadL10n.crunching );
  95  
  96      prepareMediaItem( fileObj, serverData );
  97      updateMediaForm();
  98  
  99      // Increment the counter.
 100      if ( post_id && item.hasClass( 'child-of-' + post_id ) ) {
 101          jQuery( '#attachments-count' ).text( 1 * jQuery( '#attachments-count' ).text() + 1 );
 102      }
 103  }
 104  
 105  function setResize( arg ) {
 106      if ( arg ) {
 107          if ( window.resize_width && window.resize_height ) {
 108              uploader.settings.resize = {
 109                  enabled: true,
 110                  width: window.resize_width,
 111                  height: window.resize_height,
 112                  quality: 100
 113              };
 114          } else {
 115              uploader.settings.multipart_params.image_resize = true;
 116          }
 117      } else {
 118          delete( uploader.settings.multipart_params.image_resize );
 119      }
 120  }
 121  
 122  function prepareMediaItem( fileObj, serverData ) {
 123      var f = ( typeof shortform == 'undefined' ) ? 1 : 2, item = jQuery( '#media-item-' + fileObj.id );
 124      if ( f == 2 && shortform > 2 )
 125          f = shortform;
 126  
 127      try {
 128          if ( typeof topWin.tb_remove != 'undefined' )
 129              topWin.jQuery( '#TB_overlay' ).click( topWin.tb_remove );
 130      } catch( e ){}
 131  
 132      if ( isNaN( serverData ) || !serverData ) { // Old style: Append the HTML returned by the server -- thumbnail and form inputs
 133          item.append( serverData );
 134          prepareMediaItemInit( fileObj );
 135      } else { // New style: server data is just the attachment ID, fetch the thumbnail and form html from the server
 136          item.load( 'async-upload.php', {attachment_id:serverData, fetch:f}, function(){prepareMediaItemInit( fileObj );updateMediaForm();});
 137      }
 138  }
 139  
 140  function prepareMediaItemInit( fileObj ) {
 141      var item = jQuery( '#media-item-' + fileObj.id );
 142      // Clone the thumbnail as a "pinkynail" -- a tiny image to the left of the filename
 143      jQuery( '.thumbnail', item ).clone().attr( 'class', 'pinkynail toggle' ).prependTo( item );
 144  
 145      // Replace the original filename with the new (unique) one assigned during upload
 146      jQuery( '.filename.original', item ).replaceWith( jQuery( '.filename.new', item ) );
 147  
 148      // Bind AJAX to the new Delete button
 149      jQuery( 'a.delete', item ).click( function(){
 150          // Tell the server to delete it. TODO: handle exceptions
 151          jQuery.ajax({
 152              url: ajaxurl,
 153              type: 'post',
 154              success: deleteSuccess,
 155              error: deleteError,
 156              id: fileObj.id,
 157              data: {
 158                  id : this.id.replace(/[^0-9]/g, '' ),
 159                  action : 'trash-post',
 160                  _ajax_nonce : this.href.replace(/^.*wpnonce=/,'' )
 161              }
 162          });
 163          return false;
 164      });
 165  
 166      // Bind AJAX to the new Undo button
 167      jQuery( 'a.undo', item ).click( function(){
 168          // Tell the server to untrash it. TODO: handle exceptions
 169          jQuery.ajax({
 170              url: ajaxurl,
 171              type: 'post',
 172              id: fileObj.id,
 173              data: {
 174                  id : this.id.replace(/[^0-9]/g,'' ),
 175                  action: 'untrash-post',
 176                  _ajax_nonce: this.href.replace(/^.*wpnonce=/,'' )
 177              },
 178              success: function( ){
 179                  var type,
 180                      item = jQuery( '#media-item-' + fileObj.id );
 181  
 182                  if ( type = jQuery( '#type-of-' + fileObj.id ).val() )
 183                      jQuery( '#' + type + '-counter' ).text( jQuery( '#' + type + '-counter' ).text()-0+1 );
 184  
 185                  if ( post_id && item.hasClass( 'child-of-'+post_id ) )
 186                      jQuery( '#attachments-count' ).text( jQuery( '#attachments-count' ).text()-0+1 );
 187  
 188                  jQuery( '.filename .trashnotice', item ).remove();
 189                  jQuery( '.filename .title', item ).css( 'font-weight','normal' );
 190                  jQuery( 'a.undo', item ).addClass( 'hidden' );
 191                  jQuery( '.menu_order_input', item ).show();
 192                  item.css( {backgroundColor:'#ceb'} ).animate( {backgroundColor: '#fff'}, { queue: false, duration: 500, complete: function(){ jQuery( this ).css({backgroundColor:''}); } }).removeClass( 'undo' );
 193              }
 194          });
 195          return false;
 196      });
 197  
 198      // Open this item if it says to start open (e.g. to display an error)
 199      jQuery( '#media-item-' + fileObj.id + '.startopen' ).removeClass( 'startopen' ).addClass( 'open' ).find( 'slidetoggle' ).fadeIn();
 200  }
 201  
 202  // generic error message
 203  function wpQueueError( message ) {
 204      jQuery( '#media-upload-error' ).show().html( '<div class="error"><p>' + message + '</p></div>' );
 205  }
 206  
 207  // file-specific error messages
 208  function wpFileError( fileObj, message ) {
 209      itemAjaxError( fileObj.id, message );
 210  }
 211  
 212  function itemAjaxError( id, message ) {
 213      var item = jQuery( '#media-item-' + id ), filename = item.find( '.filename' ).text(), last_err = item.data( 'last-err' );
 214  
 215      if ( last_err == id ) // prevent firing an error for the same file twice
 216          return;
 217  
 218      item.html( '<div class="error-div">' +
 219                  '<a class="dismiss" href="#">' + pluploadL10n.dismiss + '</a>' +
 220                  '<strong>' + pluploadL10n.error_uploading.replace( '%s', jQuery.trim( filename )) + '</strong> ' +
 221                  message +
 222                  '</div>' ).data( 'last-err', id );
 223  }
 224  
 225  function deleteSuccess( data ) {
 226      var type, id, item;
 227      if ( data == '-1' )
 228          return itemAjaxError( this.id, 'You do not have permission. Has your session expired?' );
 229  
 230      if ( data == '0' )
 231          return itemAjaxError( this.id, 'Could not be deleted. Has it been deleted already?' );
 232  
 233      id = this.id;
 234      item = jQuery( '#media-item-' + id );
 235  
 236      // Decrement the counters.
 237      if ( type = jQuery( '#type-of-' + id ).val() )
 238          jQuery( '#' + type + '-counter' ).text( jQuery( '#' + type + '-counter' ).text() - 1 );
 239  
 240      if ( post_id && item.hasClass( 'child-of-'+post_id ) )
 241          jQuery( '#attachments-count' ).text( jQuery( '#attachments-count' ).text() - 1 );
 242  
 243      if ( jQuery( 'form.type-form #media-items' ).children().length == 1 && jQuery( '.hidden', '#media-items' ).length > 0 ) {
 244          jQuery( '.toggle' ).toggle();
 245          jQuery( '.slidetoggle' ).slideUp( 200 ).siblings().removeClass( 'hidden' );
 246      }
 247  
 248      // Vanish it.
 249      jQuery( '.toggle', item ).toggle();
 250      jQuery( '.slidetoggle', item ).slideUp( 200 ).siblings().removeClass( 'hidden' );
 251      item.css( {backgroundColor:'#faa'} ).animate( {backgroundColor:'#f4f4f4'}, {queue:false, duration:500} ).addClass( 'undo' );
 252  
 253      jQuery( '.filename:empty', item ).remove();
 254      jQuery( '.filename .title', item ).css( 'font-weight','bold' );
 255      jQuery( '.filename', item ).append( '<span class="trashnotice"> ' + pluploadL10n.deleted + ' </span>' ).siblings( 'a.toggle' ).hide();
 256      jQuery( '.filename', item ).append( jQuery( 'a.undo', item ).removeClass( 'hidden' ) );
 257      jQuery( '.menu_order_input', item ).hide();
 258  
 259      return;
 260  }
 261  
 262  function deleteError() {
 263  }
 264  
 265  function uploadComplete() {
 266      jQuery( '#insert-gallery' ).prop( 'disabled', false );
 267  }
 268  
 269  function switchUploader( s ) {
 270      if ( s ) {
 271          deleteUserSetting( 'uploader' );
 272          jQuery( '.media-upload-form' ).removeClass( 'html-uploader' );
 273  
 274          if ( typeof( uploader ) == 'object' )
 275              uploader.refresh();
 276      } else {
 277          setUserSetting( 'uploader', '1' ); // 1 == html uploader
 278          jQuery( '.media-upload-form' ).addClass( 'html-uploader' );
 279      }
 280  }
 281  
 282  function uploadError( fileObj, errorCode, message, up ) {
 283      var hundredmb = 100 * 1024 * 1024, max;
 284  
 285      switch ( errorCode ) {
 286          case plupload.FAILED:
 287              wpFileError( fileObj, pluploadL10n.upload_failed );
 288              break;
 289          case plupload.FILE_EXTENSION_ERROR:
 290              wpFileExtensionError( up, fileObj, pluploadL10n.invalid_filetype );
 291              break;
 292          case plupload.FILE_SIZE_ERROR:
 293              uploadSizeError( up, fileObj );
 294              break;
 295          case plupload.IMAGE_FORMAT_ERROR:
 296              wpFileError( fileObj, pluploadL10n.not_an_image );
 297              break;
 298          case plupload.IMAGE_MEMORY_ERROR:
 299              wpFileError( fileObj, pluploadL10n.image_memory_exceeded );
 300              break;
 301          case plupload.IMAGE_DIMENSIONS_ERROR:
 302              wpFileError( fileObj, pluploadL10n.image_dimensions_exceeded );
 303              break;
 304          case plupload.GENERIC_ERROR:
 305              wpQueueError( pluploadL10n.upload_failed );
 306              break;
 307          case plupload.IO_ERROR:
 308              max = parseInt( up.settings.filters.max_file_size, 10 );
 309  
 310              if ( max > hundredmb && fileObj.size > hundredmb ) {
 311                  wpFileError( fileObj, pluploadL10n.big_upload_failed.replace( '%1$s', '<a class="uploader-html" href="#">' ).replace( '%2$s', '</a>' ) );
 312              } else {
 313                  wpQueueError( pluploadL10n.io_error );
 314              }
 315  
 316              break;
 317          case plupload.HTTP_ERROR:
 318              wpQueueError( pluploadL10n.http_error );
 319              break;
 320          case plupload.INIT_ERROR:
 321              jQuery( '.media-upload-form' ).addClass( 'html-uploader' );
 322              break;
 323          case plupload.SECURITY_ERROR:
 324              wpQueueError( pluploadL10n.security_error );
 325              break;
 326  /*        case plupload.UPLOAD_ERROR.UPLOAD_STOPPED:
 327          case plupload.UPLOAD_ERROR.FILE_CANCELLED:
 328              jQuery( '#media-item-' + fileObj.id ).remove();
 329              break;*/
 330          default:
 331              wpFileError( fileObj, pluploadL10n.default_error );
 332      }
 333  }
 334  
 335  function uploadSizeError( up, file ) {
 336      var message, errorDiv;
 337  
 338      message = pluploadL10n.file_exceeds_size_limit.replace( '%s', file.name );
 339  
 340      // Construct the error div.
 341      errorDiv = jQuery( '<div />' )
 342          .attr( {
 343              'id':    'media-item-' + file.id,
 344              'class': 'media-item error'
 345          } )
 346          .append(
 347              jQuery( '<p />' )
 348                  .text( message )
 349          );
 350  
 351      // Append the error.
 352      jQuery( '#media-items' ).append( errorDiv );
 353      up.removeFile( file );
 354  }
 355  
 356  function wpFileExtensionError( up, file, message ) {
 357      jQuery( '#media-items' ).append( '<div id="media-item-' + file.id + '" class="media-item error"><p>' + message + '</p></div>' );
 358      up.removeFile( file );
 359  }
 360  
 361  jQuery( document ).ready( function( $ ) {
 362      var tryAgainCount = {};
 363      var tryAgain;
 364  
 365      $( '.media-upload-form' ).bind( 'click.uploader', function( e ) {
 366          var target = $( e.target ), tr, c;
 367  
 368          if ( target.is( 'input[type="radio"]' ) ) { // remember the last used image size and alignment
 369              tr = target.closest( 'tr' );
 370  
 371              if ( tr.hasClass( 'align' ) )
 372                  setUserSetting( 'align', target.val() );
 373              else if ( tr.hasClass( 'image-size' ) )
 374                  setUserSetting( 'imgsize', target.val() );
 375  
 376          } else if ( target.is( 'button.button' ) ) { // remember the last used image link url
 377              c = e.target.className || '';
 378              c = c.match( /url([^ '"]+)/ );
 379  
 380              if ( c && c[1] ) {
 381                  setUserSetting( 'urlbutton', c[1] );
 382                  target.siblings( '.urlfield' ).val( target.data( 'link-url' ) );
 383              }
 384          } else if ( target.is( 'a.dismiss' ) ) {
 385              target.parents( '.media-item' ).fadeOut( 200, function() {
 386                  $( this ).remove();
 387              } );
 388          } else if ( target.is( '.upload-flash-bypass a' ) || target.is( 'a.uploader-html' ) ) { // switch uploader to html4
 389              $( '#media-items, p.submit, span.big-file-warning' ).css( 'display', 'none' );
 390              switchUploader( 0 );
 391              e.preventDefault();
 392          } else if ( target.is( '.upload-html-bypass a' ) ) { // switch uploader to multi-file
 393              $( '#media-items, p.submit, span.big-file-warning' ).css( 'display', '' );
 394              switchUploader( 1 );
 395              e.preventDefault();
 396          } else if ( target.is( 'a.describe-toggle-on' ) ) { // Show
 397              target.parent().addClass( 'open' );
 398              target.siblings( '.slidetoggle' ).fadeIn( 250, function() {
 399                  var S = $( window ).scrollTop(),
 400                      H = $( window ).height(),
 401                      top = $( this ).offset().top,
 402                      h = $( this ).height(),
 403                      b,
 404                      B;
 405  
 406                  if ( H && top && h ) {
 407                      b = top + h;
 408                      B = S + H;
 409  
 410                      if ( b > B ) {
 411                          if ( b - B < top - S )
 412                              window.scrollBy( 0, ( b - B ) + 10 );
 413                          else
 414                              window.scrollBy( 0, top - S - 40 );
 415                      }
 416                  }
 417              } );
 418  
 419              e.preventDefault();
 420          } else if ( target.is( 'a.describe-toggle-off' ) ) { // Hide
 421              target.siblings( '.slidetoggle' ).fadeOut( 250, function() {
 422                  target.parent().removeClass( 'open' );
 423              } );
 424  
 425              e.preventDefault();
 426          }
 427      });
 428  
 429      // Attempt to create image sub-sizes when an image was uploaded successfully
 430      // but the server responded with HTTP 500 error.
 431      tryAgain = function( up, error ) {
 432          var file = error.file;
 433          var times;
 434  
 435          if ( ! file || ! file.id ) {
 436              wpQueueError( error.message || pluploadL10n.default_error );
 437              return;
 438          }
 439  
 440          times = tryAgainCount[ file.id ];
 441  
 442          if ( times && times > 4 ) {
 443              // The file may have been uploaded and attachment post created,
 444              // but post-processing and resizing failed...
 445              // Do a cleanup then tell the user to scale down the image and upload it again.
 446              $.ajax({
 447                  type: 'post',
 448                  url: ajaxurl,
 449                  dataType: 'json',
 450                  data: {
 451                      action: 'media-create-image-subsizes',
 452                      _wpnonce: _wpPluploadSettings.defaults.multipart_params._wpnonce,
 453                      _wp_temp_image_ref: file.id,
 454                      _wp_upload_failed_cleanup: true,
 455                  }
 456              });
 457  
 458              if ( error.message && error.status !== 500 ) {
 459                  wpQueueError( error.message );
 460              } else {
 461                  wpQueueError( pluploadL10n.http_error_image );
 462              }
 463  
 464              return;
 465          }
 466  
 467          if ( ! times ) {
 468              tryAgainCount[ file.id ] = 1;
 469          } else {
 470              tryAgainCount[ file.id ] = ++times;
 471          }
 472  
 473          // Try to create the missing image sizes.
 474          $.ajax({
 475              type: 'post',
 476              url: ajaxurl,
 477              dataType: 'json',
 478              data: {
 479                  action: 'media-create-image-subsizes',
 480                  _wpnonce: wpUploaderInit.multipart_params._wpnonce,
 481                  _wp_temp_image_ref: file.id,
 482                  _legasy_support: 'true',
 483              }
 484          }).done( function( response ) {
 485              var message;
 486  
 487              if ( response.success ) {
 488                  uploadSuccess( file, response.data.id );
 489              } else {
 490                  if ( response.data && response.data.message ) {
 491                      message = response.data.message;
 492                  }
 493  
 494                  wpQueueError( message || pluploadL10n.http_error_image );
 495              }
 496          }).fail( function( jqXHR ) {
 497              // If another HTTP 500 error, try try again...
 498              if ( jqXHR.status === 500 ) {
 499                  tryAgain( up, error );
 500                  return;
 501              }
 502  
 503              wpQueueError( pluploadL10n.http_error_image );
 504          });
 505      }
 506  
 507      // init and set the uploader
 508      uploader_init = function() {
 509          uploader = new plupload.Uploader( wpUploaderInit );
 510  
 511          $( '#image_resize' ).bind( 'change', function() {
 512              var arg = $( this ).prop( 'checked' );
 513  
 514              setResize( arg );
 515  
 516              if ( arg )
 517                  setUserSetting( 'upload_resize', '1' );
 518              else
 519                  deleteUserSetting( 'upload_resize' );
 520          });
 521  
 522          uploader.bind( 'Init', function( up ) {
 523              var uploaddiv = $( '#plupload-upload-ui' );
 524  
 525              setResize( getUserSetting( 'upload_resize', false ) );
 526  
 527              if ( up.features.dragdrop && ! $( document.body ).hasClass( 'mobile' ) ) {
 528                  uploaddiv.addClass( 'drag-drop' );
 529  
 530                  $( '#drag-drop-area' ).on( 'dragover.wp-uploader', function() { // dragenter doesn't fire right :(
 531                      uploaddiv.addClass( 'drag-over' );
 532                  }).on( 'dragleave.wp-uploader, drop.wp-uploader', function() {
 533                      uploaddiv.removeClass( 'drag-over' );
 534                  });
 535              } else {
 536                  uploaddiv.removeClass( 'drag-drop' );
 537                  $( '#drag-drop-area' ).off( '.wp-uploader' );
 538              }
 539  
 540              if ( up.runtime === 'html4' ) {
 541                  $( '.upload-flash-bypass' ).hide();
 542              }
 543          });
 544  
 545          uploader.bind( 'postinit', function( up ) {
 546              up.refresh();
 547          });
 548  
 549          uploader.init();
 550  
 551          uploader.bind( 'FilesAdded', function( up, files ) {
 552              $( '#media-upload-error' ).empty();
 553              uploadStart();
 554  
 555              plupload.each( files, function( file ) {
 556                  fileQueued( file );
 557              });
 558  
 559              up.refresh();
 560              up.start();
 561          });
 562  
 563          uploader.bind( 'UploadFile', function( up, file ) {
 564              fileUploading( up, file );
 565          });
 566  
 567          uploader.bind( 'UploadProgress', function( up, file ) {
 568              uploadProgress( up, file );
 569          });
 570  
 571          uploader.bind( 'Error', function( up, error ) {
 572              var isImage = error.file && error.file.type && error.file.type.indexOf( 'image/' ) === 0;
 573              var status  = error && error.status;
 574  
 575              // If the file is an image and the error is HTTP 500 try to create sub-sizes again.
 576              if ( status === 500 && isImage ) {
 577                  tryAgain( up, error );
 578                  return;
 579              }
 580  
 581              uploadError( error.file, error.code, error.message, up );
 582              up.refresh();
 583          });
 584  
 585          uploader.bind( 'FileUploaded', function( up, file, response ) {
 586              uploadSuccess( file, response.response );
 587          });
 588  
 589          uploader.bind( 'UploadComplete', function() {
 590              uploadComplete();
 591          });
 592  
 593          /**
 594           * When uploading images add a file reference used to retrieve the attachment_id
 595           * if the uploading fails due to a server timeout of out of memoty (HTTP 500) error.
 596           *
 597           * @param {plupload.Uploader} up   Uploader instance.
 598           * @param {plupload.File}     file File for uploading.
 599           */
 600          uploader.bind( 'BeforeUpload', function( up, file ) {
 601              if ( file.type && file.type.indexOf( 'image/' ) === 0 ) {
 602                  up.settings.multipart_params._wp_temp_image_ref = file.id;
 603              } else {
 604                  up.settings.multipart_params._wp_temp_image_ref = '';
 605              }
 606          } );
 607      };
 608  
 609      if ( typeof( wpUploaderInit ) == 'object' ) {
 610          uploader_init();
 611      }
 612  
 613  });


Generated: Wed Sep 18 01:00:03 2019 Cross-referenced by PHPXref 0.7.1