source: trunk/spip/2.1/extensions/magusine-portage2.1/ie7/ie7-dhtml.js @ 756

Last change on this file since 756 was 756, checked in by guillermoacedo@…, 14 years ago

se agrego la correccion de magusine para 2.1 basica

File size: 1.9 KB
Line 
1/*
2        IE7, version 0.9 (alpha) (2005-08-19)
3        Copyright: 2004-2005, Dean Edwards (http://dean.edwards.name/)
4        License: http://creativecommons.org/licenses/LGPL/2.1/
5*/
6IE7.addModule("ie7-dhtml", function() {
7
8/* ---------------------------------------------------------------------
9  This module is still in development and should not be used.
10--------------------------------------------------------------------- */
11
12ie7CSS.specialize("recalc", function() {
13        this.inherit();
14        for (var i = 0; i < this.recalcs.length; i++) {
15                var $recalc = this.recalcs[i];
16                for (var j = 0; i < $recalc[3].length; i++) {
17                        _addPropertyChangeHandler($recalc[3][j], _getPropertyName($recalc[2]), $recalc[1]);
18                }
19        }
20});
21
22// constants
23var _PATTERNS = {
24        width: "(width|paddingLeft|paddingRight|borderLeftWidth|borderRightWidth|borderLeftStyle|borderRightStyle)",
25        height: "(height|paddingTop|paddingBottom|borderTopHeight|borderBottomHeight|borderTopStyle|borderBottomStyle)"
26};
27var _PROPERTY_NAMES = {
28        width: "fixedWidth",
29        height: "fixedHeight",
30        right: "width",
31        bottom: "height"
32};
33var _DASH_LETTER = /-(\w)/g;
34var _PROPERTY_NAME = /\w+/;
35
36function _addPropertyChangeHandler($element, $propertyName, $fix) {
37        addEventHandler($element, "onpropertychange", function() {
38                if (_getPattern($propertyName).test(event.propertyName)) {
39                        _reset($element, $propertyName);
40                        $fix($element);
41                }
42        });
43};
44function _upper($match, $letter) {return $letter.toUpperCase()};
45function _getPropertyName($pattern) {
46        return String(String($pattern).toLowerCase().replace(_DASH_LETTER, _upper).match(_PROPERTY_NAME));
47};
48function _getPattern($propertyName) {
49        return eval("/^style." + (_PATTERNS[$propertyName] || $propertyName) + "$/");
50};
51function _reset($element, $propertyName) {
52        $element.runtimeStyle[$propertyName] = "";
53        $propertyName = _PROPERTY_NAMES[$propertyName]
54        if ($propertyName) $element.runtimeStyle[$propertyName] = "";
55};
56
57});
Note: See TracBrowser for help on using the repository browser.