Changeset 48576 in spip-zone
- Timestamp:
- Jun 8, 2011, 11:13:59 AM (10 years ago)
- Location:
- _plugins_/css_imbriques
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/css_imbriques/css_imbriques_fonctions.php
r47366 r48576 87 87 // -spip-font-smoothing 88 88 89 $pie = url_absolue(chemin("PIE.htc")); 90 89 91 $style = $regs[1]; 90 92 $val = trim($regs[2]); … … 94 96 $ret .= "-moz-border-radius:$val;"; 95 97 $ret .= "border-radius:$val;"; 98 $ret .= "behavior: url($pie);"; 96 99 break; 97 100 case "border-top-right-radius" : … … 99 102 $ret .= "-moz-border-radius-topright:$val;"; 100 103 $ret .= "border-top-right-radius:$val;"; 104 $ret .= "behavior: url($pie);"; 101 105 break; 102 106 case "border-top-left-radius" : … … 104 108 $ret .= "-moz-border-radius-topleft:$val;"; 105 109 $ret .= "border-top-left-radius:$val;"; 110 $ret .= "behavior: url($pie);"; 106 111 break; 107 112 case "border-bottom-right-radius" : … … 109 114 $ret .= "-moz-border-radius-bottomright:$val;"; 110 115 $ret .= "border-bottom-right-radius:$val;"; 116 $ret .= "behavior: url($pie);"; 111 117 break; 112 118 case "border-bottom-left-radius" : … … 114 120 $ret .= "-moz-border-radius-bottomleft:$val;"; 115 121 $ret .= "border-bottom-left-radius:$val;"; 122 $ret .= "behavior: url($pie);"; 116 123 break; 117 124 … … 142 149 $ret .= "-moz-box-shadow:$val;"; 143 150 $ret .= "box-shadow:$val;"; 144 145 if (preg_match(",(\-?[0-9]+)px\ *(\-?[0-9]+)px\ *([0-9]+)px\ *(#?[0-9a-zA-Z]*),", $val, $val_ie)) { 146 $x = $val_ie[1]; 147 $y = $val_ie[2]; 148 $s = $val_ie[3]; 149 $coul = $val_ie[4]; 150 151 /* 152 if ($x == 0) { 153 if ($y > 0) $angle = 180; 154 else $angle = 0; 155 } else if ($x > 0 && $y >= 0) { 156 $angle = 90 - round(rad2deg(atan(-1 * $y / $x))); 157 } else if ($x > 0 && $y < 0) { 158 $angle = 90 - round(rad2deg(atan(-1 * $y / $x))); 159 } else if ($x < 0 && $y >= 0) { 160 $angle = round(rad2deg(atan($y / $x))) - 90; 161 } else if ($x < 0 && $y < 0) { 162 $angle = round(rad2deg(atan($y / $x))) - 90; 163 } 164 165 if ($angle < 0) $angle = $angle + 360; 166 167 $distance = round(sqrt($x*$x + $y*$y)); 168 */ 169 // Bon, ca ne marche pas bien, il faut plus de tests... 170 //$ret .= "zoom:1; filter: progid:DXImageTransform.Microsoft.Shadow(color=$coul,direction=$angle, Strength=$s);"; 171 } 151 $ret .= "behavior: url($pie);"; 172 152 break; 173 153 case "background-color": … … 257 237 } 258 238 239 function css_imbriques_forcer_position($css) { 240 if (preg_match("/border[a-z\-]*\-radius|box\-shadow/", $css) && !preg_match("/position\ ?\:/", $css)) { 241 242 $css .= "position:relative;"; 243 } 244 return $css; 245 } 246 259 247 260 248 function css_imbriques_decouper ($css) { … … 286 274 287 275 $def = trim($regs[2]); 276 $def = css_imbriques_forcer_position($def); 277 288 278 289 279 $chaine = $regs[0]; … … 292 282 $fin = substr($css, $pos + strlen($chaine), strlen($css)); 293 283 294 295 296 // echo "<li>$intitule</li>";297 284 298 285 if (preg_match("#\,#", $intitule)) { … … 332 319 } 333 320 334 $definition[$compteur] = preg_replace("#[\ \n]*\[\[[0-9]*\]\][\ \n]*#", "", $definition[$compteur]);321 $definition[$compteur] = css_imbriques_forcer_position(preg_replace("#[\ \n]*\[\[[0-9]*\]\][\ \n]*#", "", $definition[$compteur])); 335 322 // echo "<li>".$definition[$compteur]; 336 323 -
_plugins_/css_imbriques/plugin.xml
r47366 r48576 2 2 <nom>CSS imbriqués</nom> 3 3 <auteur>ARNO*</auteur> 4 <version>1. 8</version>4 <version>1.9</version> 5 5 <etat>stable</etat> 6 6 <description>
Note: See TracChangeset
for help on using the changeset viewer.