imce_file_path.js 617 B

123456789101112131415161718
  1. /* add a status bar div to the preview window, override imce setPreview to set status bar value and then call previous handler */
  2. imce.hooks.load.push(function() {
  3. jQuery('#preview-wrapper').prepend('<div id="imce-file-path"><span></span></div>');
  4. var prevHandler = imce.setPreview;
  5. imce.setPreview = function(fid) {
  6. if (fid) {
  7. jQuery("#imce-file-path span").html(Drupal.t('File URL path: ') + imce.getURL(fid));
  8. }
  9. else {
  10. jQuery("#imce-file-path span").html('');
  11. }
  12. prevHandler(fid);
  13. };
  14. });
  15. imce.hooks.navigate.push(function($) {
  16. jQuery("#imce-file-path span").html('');
  17. });