Diffstat (limited to 'frontend/gamma/js/MochiKit/DOM.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/gamma/js/MochiKit/DOM.js | 165 |
1 files changed, 100 insertions, 65 deletions
diff --git a/frontend/gamma/js/MochiKit/DOM.js b/frontend/gamma/js/MochiKit/DOM.js index af5d46f..944ab78 100644 --- a/frontend/gamma/js/MochiKit/DOM.js +++ b/frontend/gamma/js/MochiKit/DOM.js | |||
@@ -9,5 +9,5 @@ See <http://mochikit.com/> for documentation, downloads, license, etc. | |||
9 | ***/ | 9 | ***/ |
10 | 10 | ||
11 | MochiKit.Base._module('DOM', '1.5', ['Base']); | 11 | MochiKit.Base.module(MochiKit, 'DOM', '1.5', ['Base']); |
12 | 12 | ||
13 | MochiKit.Base.update(MochiKit.DOM, { | 13 | MochiKit.Base.update(MochiKit.DOM, { |
@@ -298,9 +298,9 @@ MochiKit.Base.update(MochiKit.DOM, { | |||
298 | var elem = node; | 298 | var elem = node; |
299 | var self = MochiKit.DOM; | 299 | var self = MochiKit.DOM; |
300 | var base = MochiKit.Base; | ||
300 | if (typeof(node) == 'string') { | 301 | if (typeof(node) == 'string') { |
301 | elem = self.getElement(node); | 302 | elem = self.getElement(node); |
302 | } | 303 | } |
303 | if (attrs) { | 304 | if (attrs) { |
304 | var updatetree = MochiKit.Base.updatetree; | ||
305 | if (self.attributeArray.compliant) { | 305 | if (self.attributeArray.compliant) { |
306 | // not IE, good. | 306 | // not IE, good. |
@@ -311,5 +311,5 @@ MochiKit.Base.update(MochiKit.DOM, { | |||
311 | MochiKit.Style.setStyle(elem, v); | 311 | MochiKit.Style.setStyle(elem, v); |
312 | } else { | 312 | } else { |
313 | updatetree(elem[k], v); | 313 | base.updatetree(elem[k], v); |
314 | } | 314 | } |
315 | } else if (k.substring(0, 2) == "on") { | 315 | } else if (k.substring(0, 2) == "on") { |
@@ -321,6 +321,6 @@ MochiKit.Base.update(MochiKit.DOM, { | |||
321 | elem.setAttribute(k, v); | 321 | elem.setAttribute(k, v); |
322 | } | 322 | } |
323 | if (typeof(elem[k]) == "string" && elem[k] != v) { | 323 | if (base.isValue(elem[k]) && elem[k] != v) { |
324 | // Also set property for weird attributes (see #302) | 324 | // Also set property for weird attributes (see #302 & #335) |
325 | elem[k] = v; | 325 | elem[k] = v; |
326 | } | 326 | } |
@@ -341,5 +341,5 @@ MochiKit.Base.update(MochiKit.DOM, { | |||
341 | MochiKit.Style.setStyle(elem, v); | 341 | MochiKit.Style.setStyle(elem, v); |
342 | } else { | 342 | } else { |
343 | updatetree(elem[k], v); | 343 | base.updatetree(elem[k], v); |
344 | } | 344 | } |
345 | } else if (k.substring(0, 2) == "on") { | 345 | } else if (k.substring(0, 2) == "on") { |
@@ -351,6 +351,6 @@ MochiKit.Base.update(MochiKit.DOM, { | |||
351 | elem.setAttribute(k, v); | 351 | elem.setAttribute(k, v); |
352 | } | 352 | } |
353 | if (typeof(elem[k]) == "string" && elem[k] != v) { | 353 | if (base.isValue(elem[k]) && elem[k] != v) { |
354 | // Also set property for weird attributes (see #302) | 354 | // Also set property for weird attributes (see #302 & #335) |
355 | elem[k] = v; | 355 | elem[k] = v; |
356 | } | 356 | } |
@@ -991,4 +991,5 @@ MochiKit.Base.update(MochiKit.DOM, { | |||
991 | "readonly": "readOnly", | 991 | "readonly": "readOnly", |
992 | "colspan": "colSpan", | 992 | "colspan": "colSpan", |
993 | "rowspan": "rowSpan", | ||
993 | "bgcolor": "bgColor", | 994 | "bgcolor": "bgColor", |
994 | "cellspacing": "cellSpacing", | 995 | "cellspacing": "cellSpacing", |
@@ -1008,5 +1009,5 @@ MochiKit.Base.update(MochiKit.DOM, { | |||
1008 | // Backwards compatibility aliases | 1009 | // Backwards compatibility aliases |
1009 | /** @id MochiKit.DOM.computedStyle */ | 1010 | /** @id MochiKit.DOM.computedStyle */ |
1010 | m._deprecated(this, 'computedStyle', 'MochiKit.Style.getStyle', '1.4'); | 1011 | m._deprecated(this, 'computedStyle', 'MochiKit.Style.getStyle', '1.4', true); |
1011 | /** @id MochiKit.DOM.elementDimensions */ | 1012 | /** @id MochiKit.DOM.elementDimensions */ |
1012 | m._deprecated(this, 'elementDimensions', 'MochiKit.Style.getElementDimensions', '1.4'); | 1013 | m._deprecated(this, 'elementDimensions', 'MochiKit.Style.getElementDimensions', '1.4'); |
@@ -1042,46 +1043,36 @@ MochiKit.Base.update(MochiKit.DOM, { | |||
1042 | // shorthand for createDOM syntax | 1043 | // shorthand for createDOM syntax |
1043 | var createDOMFunc = this.createDOMFunc; | 1044 | var createDOMFunc = this.createDOMFunc; |
1044 | /** @id MochiKit.DOM.UL */ | ||
1045 | this.UL = createDOMFunc("ul"); | ||
1046 | /** @id MochiKit.DOM.OL */ | ||
1047 | this.OL = createDOMFunc("ol"); | ||
1048 | /** @id MochiKit.DOM.LI */ | ||
1049 | this.LI = createDOMFunc("li"); | ||
1050 | /** @id MochiKit.DOM.DL */ | ||
1051 | this.DL = createDOMFunc("dl"); | ||
1052 | /** @id MochiKit.DOM.DT */ | ||
1053 | this.DT = createDOMFunc("dt"); | ||
1054 | /** @id MochiKit.DOM.DD */ | ||
1055 | this.DD = createDOMFunc("dd"); | ||
1056 | /** @id MochiKit.DOM.TD */ | ||
1057 | this.TD = createDOMFunc("td"); | ||
1058 | /** @id MochiKit.DOM.TR */ | ||
1059 | this.TR = createDOMFunc("tr"); | ||
1060 | /** @id MochiKit.DOM.TBODY */ | ||
1061 | this.TBODY = createDOMFunc("tbody"); | ||
1062 | /** @id MochiKit.DOM.THEAD */ | ||
1063 | this.THEAD = createDOMFunc("thead"); | ||
1064 | /** @id MochiKit.DOM.TFOOT */ | ||
1065 | this.TFOOT = createDOMFunc("tfoot"); | ||
1066 | /** @id MochiKit.DOM.TABLE */ | ||
1067 | this.TABLE = createDOMFunc("table"); | ||
1068 | /** @id MochiKit.DOM.TH */ | ||
1069 | this.TH = createDOMFunc("th"); | ||
1070 | /** @id MochiKit.DOM.INPUT */ | ||
1071 | this.INPUT = createDOMFunc("input"); | ||
1072 | /** @id MochiKit.DOM.SPAN */ | ||
1073 | this.SPAN = createDOMFunc("span"); | ||
1074 | /** @id MochiKit.DOM.A */ | 1045 | /** @id MochiKit.DOM.A */ |
1075 | this.A = createDOMFunc("a"); | 1046 | this.A = createDOMFunc("a"); |
1076 | /** @id MochiKit.DOM.DIV */ | 1047 | /** @id MochiKit.DOM.ARTICLE */ |
1077 | this.DIV = createDOMFunc("div"); | 1048 | this.ARTICLE = createDOMFunc("article"); |
1078 | /** @id MochiKit.DOM.IMG */ | 1049 | /** @id MochiKit.DOM.ASIDE */ |
1079 | this.IMG = createDOMFunc("img"); | 1050 | this.ASIDE = createDOMFunc("aside"); |
1051 | /** @id MochiKit.DOM.BR */ | ||
1052 | this.BR = createDOMFunc("br"); | ||
1080 | /** @id MochiKit.DOM.BUTTON */ | 1053 | /** @id MochiKit.DOM.BUTTON */ |
1081 | this.BUTTON = createDOMFunc("button"); | 1054 | this.BUTTON = createDOMFunc("button"); |
1082 | /** @id MochiKit.DOM.TT */ | 1055 | /** @id MochiKit.DOM.CANVAS */ |
1083 | this.TT = createDOMFunc("tt"); | 1056 | this.CANVAS = createDOMFunc("canvas"); |
1084 | /** @id MochiKit.DOM.PRE */ | 1057 | /** @id MochiKit.DOM.CAPTION */ |
1085 | this.PRE = createDOMFunc("pre"); | 1058 | this.CAPTION = createDOMFunc("caption"); |
1059 | /** @id MochiKit.DOM.DD */ | ||
1060 | this.DD = createDOMFunc("dd"); | ||
1061 | /** @id MochiKit.DOM.DIV */ | ||
1062 | this.DIV = createDOMFunc("div"); | ||
1063 | /** @id MochiKit.DOM.DL */ | ||
1064 | this.DL = createDOMFunc("dl"); | ||
1065 | /** @id MochiKit.DOM.DT */ | ||
1066 | this.DT = createDOMFunc("dt"); | ||
1067 | /** @id MochiKit.DOM.FIELDSET */ | ||
1068 | this.FIELDSET = createDOMFunc("fieldset"); | ||
1069 | /** @id MochiKit.DOM.FIGURE */ | ||
1070 | this.FIGURE = createDOMFunc("figure"); | ||
1071 | /** @id MochiKit.DOM.FIGCAPTION */ | ||
1072 | this.FIGCAPTION = createDOMFunc("figcaption"); | ||
1073 | /** @id MochiKit.DOM.FOOTER */ | ||
1074 | this.FOOTER = createDOMFunc("footer"); | ||
1075 | /** @id MochiKit.DOM.FORM */ | ||
1076 | this.FORM = createDOMFunc("form"); | ||
1086 | /** @id MochiKit.DOM.H1 */ | 1077 | /** @id MochiKit.DOM.H1 */ |
1087 | this.H1 = createDOMFunc("h1"); | 1078 | this.H1 = createDOMFunc("h1"); |
@@ -1096,36 +1087,80 @@ MochiKit.Base.update(MochiKit.DOM, { | |||
1096 | /** @id MochiKit.DOM.H6 */ | 1087 | /** @id MochiKit.DOM.H6 */ |
1097 | this.H6 = createDOMFunc("h6"); | 1088 | this.H6 = createDOMFunc("h6"); |
1098 | /** @id MochiKit.DOM.BR */ | 1089 | /** @id MochiKit.DOM.HEADER */ |
1099 | this.BR = createDOMFunc("br"); | 1090 | this.HEADER = createDOMFunc("header"); |
1091 | /** @id MochiKit.DOM.HGROUP */ | ||
1092 | this.HGROUP = createDOMFunc("hgroup"); | ||
1100 | /** @id MochiKit.DOM.HR */ | 1093 | /** @id MochiKit.DOM.HR */ |
1101 | this.HR = createDOMFunc("hr"); | 1094 | this.HR = createDOMFunc("hr"); |
1095 | /** @id MochiKit.DOM.IFRAME */ | ||
1096 | this.IFRAME = createDOMFunc("iframe"); | ||
1097 | /** @id MochiKit.DOM.IMG */ | ||
1098 | this.IMG = createDOMFunc("img"); | ||
1099 | /** @id MochiKit.DOM.INPUT */ | ||
1100 | this.INPUT = createDOMFunc("input"); | ||
1102 | /** @id MochiKit.DOM.LABEL */ | 1101 | /** @id MochiKit.DOM.LABEL */ |
1103 | this.LABEL = createDOMFunc("label"); | 1102 | this.LABEL = createDOMFunc("label"); |
1104 | /** @id MochiKit.DOM.TEXTAREA */ | 1103 | /** @id MochiKit.DOM.LEGEND */ |
1105 | this.TEXTAREA = createDOMFunc("textarea"); | 1104 | this.LEGEND = createDOMFunc("legend"); |
1106 | /** @id MochiKit.DOM.FORM */ | 1105 | /** @id MochiKit.DOM.LI */ |
1107 | this.FORM = createDOMFunc("form"); | 1106 | this.LI = createDOMFunc("li"); |
1107 | /** @id MochiKit.DOM.LINK */ | ||
1108 | this.LINK = createDOMFunc("link"); | ||
1109 | /** @id MochiKit.DOM.MARK */ | ||
1110 | this.MARK = createDOMFunc("mark"); | ||
1111 | /** @id MochiKit.DOM.METER */ | ||
1112 | this.METER = createDOMFunc("meter"); | ||
1113 | /** @id MochiKit.DOM.NAV */ | ||
1114 | this.NAV = createDOMFunc("nav"); | ||
1115 | /** @id MochiKit.DOM.OL */ | ||
1116 | this.OL = createDOMFunc("ol"); | ||
1117 | /** @id MochiKit.DOM.OPTGROUP */ | ||
1118 | this.OPTGROUP = createDOMFunc("optgroup"); | ||
1119 | /** @id MochiKit.DOM.OPTION */ | ||
1120 | this.OPTION = createDOMFunc("option"); | ||
1108 | /** @id MochiKit.DOM.P */ | 1121 | /** @id MochiKit.DOM.P */ |
1109 | this.P = createDOMFunc("p"); | 1122 | this.P = createDOMFunc("p"); |
1123 | /** @id MochiKit.DOM.PRE */ | ||
1124 | this.PRE = createDOMFunc("pre"); | ||
1125 | /** @id MochiKit.DOM.PROGRESS */ | ||
1126 | this.PROGRESS = createDOMFunc("progress"); | ||
1127 | /** @id MochiKit.DOM.SCRIPT */ | ||
1128 | this.SCRIPT = createDOMFunc("script"); | ||
1129 | /** @id MochiKit.DOM.SECTION */ | ||
1130 | this.SECTION = createDOMFunc("section"); | ||
1110 | /** @id MochiKit.DOM.SELECT */ | 1131 | /** @id MochiKit.DOM.SELECT */ |
1111 | this.SELECT = createDOMFunc("select"); | 1132 | this.SELECT = createDOMFunc("select"); |
1112 | /** @id MochiKit.DOM.OPTION */ | 1133 | /** @id MochiKit.DOM.SPAN */ |
1113 | this.OPTION = createDOMFunc("option"); | 1134 | this.SPAN = createDOMFunc("span"); |
1114 | /** @id MochiKit.DOM.OPTGROUP */ | ||
1115 | this.OPTGROUP = createDOMFunc("optgroup"); | ||
1116 | /** @id MochiKit.DOM.LEGEND */ | ||
1117 | this.LEGEND = createDOMFunc("legend"); | ||
1118 | /** @id MochiKit.DOM.FIELDSET */ | ||
1119 | this.FIELDSET = createDOMFunc("fieldset"); | ||
1120 | /** @id MochiKit.DOM.STRONG */ | 1135 | /** @id MochiKit.DOM.STRONG */ |
1121 | this.STRONG = createDOMFunc("strong"); | 1136 | this.STRONG = createDOMFunc("strong"); |
1122 | /** @id MochiKit.DOM.CANVAS */ | 1137 | /** @id MochiKit.DOM.STYLE */ |
1123 | this.CANVAS = createDOMFunc("canvas"); | 1138 | this.STYLE = createDOMFunc("style"); |
1124 | 1139 | /** @id MochiKit.DOM.TABLE */ | |
1140 | this.TABLE = createDOMFunc("table"); | ||
1141 | /** @id MochiKit.DOM.TBODY */ | ||
1142 | this.TBODY = createDOMFunc("tbody"); | ||
1143 | /** @id MochiKit.DOM.TD */ | ||
1144 | this.TD = createDOMFunc("td"); | ||
1145 | /** @id MochiKit.DOM.TEXTAREA */ | ||
1146 | this.TEXTAREA = createDOMFunc("textarea"); | ||
1147 | /** @id MochiKit.DOM.TFOOT */ | ||
1148 | this.TFOOT = createDOMFunc("tfoot"); | ||
1149 | /** @id MochiKit.DOM.TH */ | ||
1150 | this.TH = createDOMFunc("th"); | ||
1151 | /** @id MochiKit.DOM.THEAD */ | ||
1152 | this.THEAD = createDOMFunc("thead"); | ||
1153 | /** @id MochiKit.DOM.TR */ | ||
1154 | this.TR = createDOMFunc("tr"); | ||
1155 | /** @id MochiKit.DOM.TT */ | ||
1156 | this.TT = createDOMFunc("tt"); | ||
1157 | /** @id MochiKit.DOM.UL */ | ||
1158 | this.UL = createDOMFunc("ul"); | ||
1159 | /** @id MochiKit.DOM.NBSP */ | ||
1160 | this.NBSP = "\u00a0"; | ||
1125 | /** @id MochiKit.DOM.$ */ | 1161 | /** @id MochiKit.DOM.$ */ |
1126 | this.$ = this.getElement; | 1162 | this.$ = this.getElement; |
1127 | 1163 | ||
1128 | m.nameFunctions(this); | 1164 | m.nameFunctions(this); |
1129 | |||
1130 | } | 1165 | } |
1131 | }); | 1166 | }); |