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("
").attr("src",'/sites/all/modules/hide_submit/images/squares.gif');
$(document).ready(function() {
$('input:submit').click(function() {
$(this).siblings('input:submit').hide();
$(this).hide();
$('
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("
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
| Comment | File | Size | Author |
|---|---|---|---|
| ie_fix.patch | 16.03 KB | gooddesignusa |
Comments
Comment #1
gooddesignusa commentedWell 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:
").attr("src",'/sites/all/modules/hide_submit/images/squares.gif');
jQuery("
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:
to
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
Comment #2
optalgin commentedThanks,
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
Comment #3
gooddesignusa commentedyour prob right. I'm still new to this drupal thing.
Comment #4
optalgin commentedI decided to imitate the theme_image way
Can you check if it works for you?
Comment #5
gooddesignusa commentedI 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');"?Comment #6
gooddesignusa commentedI'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
Comment #7
optalgin commentedThanks 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
Comment #8
gooddesignusa commentedChecked on IE7 seems to work. Thanks again
Comment #9
optalgin commented