Skip to content
Extraits de code Groupes Projets
Valider 82eb9486 rédigé par Fil's avatar Fil
Parcourir les fichiers

et voila le travail, ca marche sur jquery.info

parent afe84d48
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -49,11 +49,14 @@ ...@@ -49,11 +49,14 @@
* @cat Plugins/pngfix * @cat Plugins/pngfix
*/ */
$.fn.pngfix = hack.ltie7 ? function() { $.fn.pngfix = hack.ltie7 ? function() {
if (pixelspip) hack.pixel = pixelspip; // indiquer la valeur de l'exterieur du script
return this.each(function() { return this.each(function() {
var $$ = $(this); var $$ = $(this);
var base = $('base').attr('href'); // need to use this in case you are using rewriting urls 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 ($$.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 // use source tag value if set
var source = (base && $$.attr('src').substring(0,1)!='/') ? base + $$.attr('src') : $$.attr('src'); var source = (base && $$.attr('src').substring(0,1)!='/') ? base + $$.attr('src') : $$.attr('src');
// apply filter // apply filter
...@@ -63,7 +66,7 @@ ...@@ -63,7 +66,7 @@
} }
} else { // hack png css properties present inside css } else { // hack png css properties present inside css
var image = $$.css('backgroundImage'); var image = $$.css('backgroundImage');
if (image.match(/^url\(["']?(.*\.png)["']?\)$/i)) { if (image.match(/^url\(["']?(.*\.png([?].*)?)["']?\)$/i)) {
image = RegExp.$1; image = RegExp.$1;
$$.css({backgroundImage:'none', filter:hack.filter(image)}) $$.css({backgroundImage:'none', filter:hack.filter(image)})
.positionFix(); .positionFix();
...@@ -88,7 +91,7 @@ ...@@ -88,7 +91,7 @@
return this.each(function() { return this.each(function() {
var $$ = $(this); var $$ = $(this);
var src = $$.css('filter'); 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; src = RegExp.$1;
if ($$.is('img') || $$.is('input')) { if ($$.is('img') || $$.is('input')) {
$$.attr({src:src}).css({filter:''}); $$.attr({src:src}).css({filter:''});
......
...@@ -1259,14 +1259,14 @@ function fin_page() ...@@ -1259,14 +1259,14 @@ function fin_page()
// cf. public/assembler, fonction f_msie() // cf. public/assembler, fonction f_msie()
// test si MSIE et sinon quitte // 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']); AND preg_match('/MSIE /i', $_SERVER['HTTP_USER_AGENT']);
$fix_png = $msie $fix_png = $msie
? "<script type='text/javascript'><!-- ? "<script type='text/javascript'><!--
try { document.execCommand('BackgroundImageCache', false, true); } catch(err) {}; try { document.execCommand('BackgroundImageCache', false, true); } catch(err) {};
if (window.jQuery && jQuery.browser.msie) jQuery.getScript( '" if (window.jQuery && jQuery.browser.msie) jQuery.getScript( '"
.find_in_path('jquery.iepnghack.1.5.js') .find_in_path('javascript/jquery.iepnghack.1.5.js')
."' , function() { jQuery('img').pngfix(); } ); ."' , function() { pixelspip = '".(_DIR_RACINE.'rien.gif')."'; jQuery('img').pngfix(); } );
// --></script>" // --></script>"
: ''; : '';
......
...@@ -399,7 +399,7 @@ function f_msie ($texte) { ...@@ -399,7 +399,7 @@ function f_msie ($texte) {
if (!$GLOBALS['html']) return $texte; if (!$GLOBALS['html']) return $texte;
// test si MSIE et sinon quitte // 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']); AND preg_match('/MSIE /i', $_SERVER['HTTP_USER_AGENT']);
if (!$msie) return $texte; if (!$msie) return $texte;
...@@ -417,7 +417,7 @@ function f_msie ($texte) { ...@@ -417,7 +417,7 @@ function f_msie ($texte) {
AND true /* ... autres tests si on veut affiner ... */) { AND true /* ... autres tests si on veut affiner ... */) {
$texte .= $texte .=
"<script type='text/javascript'><!-- "<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"; // --></script>\n";
} }
......
...@@ -87,9 +87,6 @@ RewriteRule ^[^/\.]+(\.html)?$ spip.php?page=type_urls [QSA,E=url_propre:$0,L] ...@@ -87,9 +87,6 @@ RewriteRule ^[^/\.]+(\.html)?$ spip.php?page=type_urls [QSA,E=url_propre:$0,L]
### ###
# Divers # 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...) # bloquer les acces aux repertoires .svn/ (SPIP, plugins, squelettes...)
RewriteRule ^(.*/)?\.svn/ - [F] RewriteRule ^(.*/)?\.svn/ - [F]
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter