So the image wasn't being shown in IE7 just the text. Looking at the source i noticed this on the bottom of the page:
jQuery("Only local images are allowed.").attr("src",'/sites/all/modules/hide_submit/images/squares.gif');
$(document).ready(function() {
$('input:submit').click(function() {
$(this).siblings('input:submit').hide();
$(this).hide();
$('

Only local images are allowed.  Please wait...

').insertAfter(this);
})
})
My drupal install is in the directory drupal. I was guessing that IE wasn't showing the image b/c the line starting with jQuery("Only local images are allowed. I fixed this by opening the module file, scrolling down to the bottom and changing:

function _hide_submit_get_javascript() {
    
    $message = filter_xss_admin( _hide_submit_clean_for_javascript( _hide_submit_get_message() ) );
    $image = check_plain( _hide_submit_get_image() ); 
    
  $javascript = <<<JAVASCRIPT_CODE
jQuery("<img>").attr("src",'/$image');
$(document).ready(function() {
  $('input:submit').click(function() {
      $(this).siblings('input:submit').hide();            
      $(this).hide();      
      $('$message').insertAfter(this);
  })  
})
JAVASCRIPT_CODE;

  return $javascript;
}

to

function _hide_submit_get_javascript() {
	global $base_path;
    $message = filter_xss_admin( _hide_submit_clean_for_javascript( _hide_submit_get_message() ) );
    $image = check_plain( _hide_submit_get_image() ); 
  $javascript = <<<JAVASCRIPT_CODE
jQuery("<img>").attr("src",'$base_path$image');
$(document).ready(function() {
  $('input:submit').click(function() {
      $(this).siblings('input:submit').hide();            
      $(this).hide();      
      $('$message').insertAfter(this);
  })  
})
JAVASCRIPT_CODE;

  return $javascript;
}

I tried making a patch but i'm not sure if i did it right. First time doing it.
I used the diff -up command since i'm on a Mac running osx 10.4

CommentFileSizeAuthor
ie_fix.patch16.03 KBgooddesignusa

Comments

gooddesignusa’s picture

Assigned: Unassigned » gooddesignusa

Well that didn't post right. Can't seem to edit.... lets try again:

So the image wasn't being shown in IE7 just the text. Looking at the source i noticed this on the bottom of the page:
jQuery("Only local images are allowed.").attr("src",'/sites/all/modules/hide_submit/images/squares.gif');

$(document).ready(function() {
  $('input:submit').click(function() {
      $(this).siblings('input:submit').hide();            
      $(this).hide();      
      $('<p class="hide_submit"><img src="/drupal/sites/all/modules/hide_submit/images/squares.gif" alt="" title="" />&nbsp; Please wait... </p>').insertAfter(this);
  })  
})

My drupal install is in the directory drupal. I was guessing that IE wasn't showing the image b/c the line starting with jQuery("<img") was setting the wrong source.
I fixed this by opening the module file, scrolling down to the bottom and changing:

function _hide_submit_get_javascript() {
    
    $message = filter_xss_admin( _hide_submit_clean_for_javascript( _hide_submit_get_message() ) );
    $image = check_plain( _hide_submit_get_image() ); 
    
  $javascript = <<<JAVASCRIPT_CODE
jQuery("<img>").attr("src",'/$image');
$(document).ready(function() {
  $('input:submit').click(function() {
      $(this).siblings('input:submit').hide();            
      $(this).hide();      
      $('$message').insertAfter(this);
  })  
})
JAVASCRIPT_CODE;

  return $javascript;
}

to

function _hide_submit_get_javascript() {
	global $base_path;
    $message = filter_xss_admin( _hide_submit_clean_for_javascript( _hide_submit_get_message() ) );
    $image = check_plain( _hide_submit_get_image() ); 
  $javascript = <<<JAVASCRIPT_CODE
jQuery("<img>").attr("src",'$base_path$image');
$(document).ready(function() {
  $('input:submit').click(function() {
      $(this).siblings('input:submit').hide();            
      $(this).hide();      
      $('$message').insertAfter(this);
  })  
})
JAVASCRIPT_CODE;

  return $javascript;
}

I tried making a patch but i'm not sure if i did it right. First time doing it.
I used the diff -up command since i'm on a Mac running osx 10.4

optalgin’s picture

Thanks,
I'll commit this into the dev. release and into the next official release

one question,
Is there a difference in the value of global $base_path and base_path() function ??
I see in the Drupal API that the function is also compatible with Drupal 5.0 while the variable isn't
and was thinking as unified solution to use the function instead of the global var

 ...
    $image = base_path() . check_plain( _hide_submit_get_image() );
    $javascript = <<<JAVASCRIPT_CODE
    jQuery("<img>").attr("src",'$image');
 ...
gooddesignusa’s picture

your prob right. I'm still new to this drupal thing.

optalgin’s picture

Title: IE7 Not Showing Image - Fixed Need check plz » Image is not shown when drupal base-path is different then "/"

I decided to imitate the theme_image way
Can you check if it works for you?

function _hide_submit_get_javascript() {
    
    $message = filter_xss_admin( _hide_submit_clean_for_javascript( _hide_submit_get_message() ) );
    
    // Set base path for local image, none for external
    $image = _hide_submit_get_image(); 
    $image = (url($image) == $image) ? $image : (base_path() . $image);
    $image = check_url($image);
   
$javascript = <<<JAVASCRIPT_CODE
jQuery("<img>").attr("src",'$image');
$(document).ready(function() {
  $('input:submit').click(function() {
      $(this).siblings('input:submit').hide();            
      $(this).hide();      
      $('$message').insertAfter(this);
  })  
})
JAVASCRIPT_CODE;

  return $javascript;
}
gooddesignusa’s picture

I can't test IE7 right now but IE6 seems to work even with the original module before any changes. Weird. What is this line even do jQuery("<img>").attr("src",'$image');"?

gooddesignusa’s picture

I'm currently at work using a mac. I tested firefox / safari / opera / camino with the old original code. All showed the graphic except camino. I tried out your new code and it fixed camino so i'm guessing IE7 would work. I checked the source code of the page and it is adding the directory fine. I will check IE7 later tonight. Good work and thanks

optalgin’s picture

Thanks for your efforts

When the "message" HTML is injected the image is not loaded by the browser
This line pre-load the image.

Patch commited
A dev. release should be ready in the next few hours (usually 10-12 hours till the packaging script is triggered)
It will also be included in the next release

gooddesignusa’s picture

Checked on IE7 seems to work. Thanks again

optalgin’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.