From 82eb94868bea6760e5d12cd16e377760d4044717 Mon Sep 17 00:00:00 2001 From: Fil <fil@rezo.net> Date: Mon, 3 Sep 2007 21:20:14 +0000 Subject: [PATCH] et voila le travail, ca marche sur jquery.info --- dist/javascript/jquery.iepnghack.1.5.js | 9 ++++++--- ecrire/inc/presentation.php | 6 +++--- ecrire/public/assembler.php | 4 ++-- htaccess.txt | 3 --- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/dist/javascript/jquery.iepnghack.1.5.js b/dist/javascript/jquery.iepnghack.1.5.js index 0b937d4406..c70c66b7c5 100644 --- a/dist/javascript/jquery.iepnghack.1.5.js +++ b/dist/javascript/jquery.iepnghack.1.5.js @@ -49,11 +49,14 @@ * @cat Plugins/pngfix */ $.fn.pngfix = hack.ltie7 ? function() { + + if (pixelspip) hack.pixel = pixelspip; // indiquer la valeur de l'exterieur du script + return this.each(function() { var $$ = $(this); var base = $('base').attr('href'); // need to use this in case you are using rewriting urls if ($$.is('img') || $$.is('input')) { // hack image tags present in dom - if ($$.attr('src').match(/.*\.png$/i)) { // make sure it is png image + if ($$.attr('src').match(/.*\.png([?].*)?$/i)) { // make sure it is png image // use source tag value if set var source = (base && $$.attr('src').substring(0,1)!='/') ? base + $$.attr('src') : $$.attr('src'); // apply filter @@ -63,7 +66,7 @@ } } else { // hack png css properties present inside css var image = $$.css('backgroundImage'); - if (image.match(/^url\(["']?(.*\.png)["']?\)$/i)) { + if (image.match(/^url\(["']?(.*\.png([?].*)?)["']?\)$/i)) { image = RegExp.$1; $$.css({backgroundImage:'none', filter:hack.filter(image)}) .positionFix(); @@ -88,7 +91,7 @@ return this.each(function() { var $$ = $(this); var src = $$.css('filter'); - if (src.match(/src=["']?(.*\.png)["']?/i)) { // get img source from filter + if (src.match(/src=["']?(.*\.png([?].*)?)["']?/i)) { // get img source from filter src = RegExp.$1; if ($$.is('img') || $$.is('input')) { $$.attr({src:src}).css({filter:''}); diff --git a/ecrire/inc/presentation.php b/ecrire/inc/presentation.php index 5da2acf406..cae9dc6b46 100644 --- a/ecrire/inc/presentation.php +++ b/ecrire/inc/presentation.php @@ -1259,14 +1259,14 @@ function fin_page() // cf. public/assembler, fonction f_msie() // test si MSIE et sinon quitte - $msie = strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'MSIE') + $msie = strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'msie') AND preg_match('/MSIE /i', $_SERVER['HTTP_USER_AGENT']); $fix_png = $msie ? "<script type='text/javascript'><!-- try { document.execCommand('BackgroundImageCache', false, true); } catch(err) {}; if (window.jQuery && jQuery.browser.msie) jQuery.getScript( '" - .find_in_path('jquery.iepnghack.1.5.js') - ."' , function() { jQuery('img').pngfix(); } ); + .find_in_path('javascript/jquery.iepnghack.1.5.js') + ."' , function() { pixelspip = '".(_DIR_RACINE.'rien.gif')."'; jQuery('img').pngfix(); } ); // --></script>" : ''; diff --git a/ecrire/public/assembler.php b/ecrire/public/assembler.php index e561907a5c..48a54e6beb 100644 --- a/ecrire/public/assembler.php +++ b/ecrire/public/assembler.php @@ -399,7 +399,7 @@ function f_msie ($texte) { if (!$GLOBALS['html']) return $texte; // test si MSIE et sinon quitte - $msie = strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'MSIE') + $msie = strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'msie') AND preg_match('/MSIE /i', $_SERVER['HTTP_USER_AGENT']); if (!$msie) return $texte; @@ -417,7 +417,7 @@ function f_msie ($texte) { AND true /* ... autres tests si on veut affiner ... */) { $texte .= "<script type='text/javascript'><!-- -if (window.jQuery && jQuery.browser.msie) jQuery.getScript( '".find_in_path('jquery.iepnghack.1.5.js')."' , function() { jQuery('img').pngfix(); } ); +if (window.jQuery && jQuery.browser.msie) jQuery.getScript( '".find_in_path('javascript/jquery.iepnghack.1.5.js')."' , function() { pixelspip = '".(_DIR_RACINE.'rien.gif')."'; jQuery('img').pngfix(); } ); // --></script>\n"; } diff --git a/htaccess.txt b/htaccess.txt index e557d63a45..48078ff927 100644 --- a/htaccess.txt +++ b/htaccess.txt @@ -87,9 +87,6 @@ RewriteRule ^[^/\.]+(\.html)?$ spip.php?page=type_urls [QSA,E=url_propre:$0,L] ### # Divers -# Permettre a IE de reconnaitre le win_png.htc de retraitement des png transparents -AddType text/x-component .htc - # bloquer les acces aux repertoires .svn/ (SPIP, plugins, squelettes...) RewriteRule ^(.*/)?\.svn/ - [F] -- GitLab