Commit d3391bad20e1f33e3a4017e00a4b3b6a7b576b03
1 parent
d5384caa
Removed old MochiKit. Fixed portlet rendering.
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@6087 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
5 changed files
with
1634 additions
and
3631 deletions
resources/css/kt-framing.css
| @@ -38,6 +38,7 @@ body | @@ -38,6 +38,7 @@ body | ||
| 38 | position: relative; | 38 | position: relative; |
| 39 | border: 1px solid white; | 39 | border: 1px solid white; |
| 40 | z-index: 0; | 40 | z-index: 0; |
| 41 | + height: 100%; | ||
| 41 | } | 42 | } |
| 42 | 43 | ||
| 43 | #pageBodyBg { | 44 | #pageBodyBg { |
| @@ -292,7 +293,8 @@ a.main_nav_item { | @@ -292,7 +293,8 @@ a.main_nav_item { | ||
| 292 | 293 | ||
| 293 | #portletbar | 294 | #portletbar |
| 294 | { | 295 | { |
| 295 | - position: absolute; | 296 | +/* position: absolute;*/ |
| 297 | + float: left; | ||
| 296 | width: 16em; | 298 | width: 16em; |
| 297 | left: 1em; | 299 | left: 1em; |
| 298 | /* top: 0; */ /* stupid IE bug: absolute position ate my scrollbars */ | 300 | /* top: 0; */ /* stupid IE bug: absolute position ate my scrollbars */ |
| @@ -300,6 +302,7 @@ a.main_nav_item { | @@ -300,6 +302,7 @@ a.main_nav_item { | ||
| 300 | margin: 0 10px 0 0 ; | 302 | margin: 0 10px 0 0 ; |
| 301 | padding: 0; | 303 | padding: 0; |
| 302 | z-index: 2; /* IE layers this below the content bar. */ | 304 | z-index: 2; /* IE layers this below the content bar. */ |
| 305 | + overflow: auto; | ||
| 303 | } | 306 | } |
| 304 | 307 | ||
| 305 | /* horrible, custom dashboard hack. */ | 308 | /* horrible, custom dashboard hack. */ |
| @@ -571,6 +574,7 @@ a.main_nav_item { | @@ -571,6 +574,7 @@ a.main_nav_item { | ||
| 571 | { | 574 | { |
| 572 | border: 1px solid #ccc; | 575 | border: 1px solid #ccc; |
| 573 | padding: 1em; | 576 | padding: 1em; |
| 577 | + background-color: white; | ||
| 574 | } | 578 | } |
| 575 | 579 | ||
| 576 | #content fieldset legend | 580 | #content fieldset legend |
| @@ -848,7 +852,6 @@ a.main_nav_item { | @@ -848,7 +852,6 @@ a.main_nav_item { | ||
| 848 | .detail_fieldset | 852 | .detail_fieldset |
| 849 | { | 853 | { |
| 850 | display: block; | 854 | display: block; |
| 851 | - clear: both; | ||
| 852 | margin-top: 1em; | 855 | margin-top: 1em; |
| 853 | overflow: hidden; | 856 | overflow: hidden; |
| 854 | } | 857 | } |
| @@ -1408,6 +1411,7 @@ hr { | @@ -1408,6 +1411,7 @@ hr { | ||
| 1408 | text-align: right; | 1411 | text-align: right; |
| 1409 | margin-bottom: -3em; | 1412 | margin-bottom: -3em; |
| 1410 | margin-right: 1em; | 1413 | margin-right: 1em; |
| 1414 | + z-index: 100; | ||
| 1411 | } | 1415 | } |
| 1412 | 1416 | ||
| 1413 | .dashboard_block_handle | 1417 | .dashboard_block_handle |
resources/js/dashboard.js
| @@ -75,7 +75,7 @@ KTDashboard.prototype = { | @@ -75,7 +75,7 @@ KTDashboard.prototype = { | ||
| 75 | 75 | ||
| 76 | // make add button | 76 | // make add button |
| 77 | var breadcrumbs = $('breadcrumbs'); | 77 | var breadcrumbs = $('breadcrumbs'); |
| 78 | - this.addButton = INPUT({'id':'add_dashlet', 'type':'submit', 'value':'Add Dashlet'}, 'Add Dashlet'); | 78 | + this.addButton = INPUT({'id':'add_dashlet', 'type':'submit', 'value':'Add Dashlet'}); |
| 79 | breadcrumbs.insertBefore(this.addButton, breadcrumbs.firstChild); | 79 | breadcrumbs.insertBefore(this.addButton, breadcrumbs.firstChild); |
| 80 | this.hideAddButton(); | 80 | this.hideAddButton(); |
| 81 | 81 | ||
| @@ -203,7 +203,7 @@ KTDashboard.prototype = { | @@ -203,7 +203,7 @@ KTDashboard.prototype = { | ||
| 203 | ret[col] = []; | 203 | ret[col] = []; |
| 204 | var container = this.getColumn(col); | 204 | var container = this.getColumn(col); |
| 205 | forEach(getElementsByTagAndClassName('*', 'dashboard_block', container), function(e) { | 205 | forEach(getElementsByTagAndClassName('*', 'dashboard_block', container), function(e) { |
| 206 | - if(e.id != '') { | 206 | + if(e.id) { |
| 207 | try { | 207 | try { |
| 208 | ret[col].push({'id':e.id, 'state':self.dashlets[e.id]['state']}); | 208 | ret[col].push({'id':e.id, 'state':self.dashlets[e.id]['state']}); |
| 209 | } catch(e) { | 209 | } catch(e) { |
| @@ -258,7 +258,7 @@ KTDashboard.prototype = { | @@ -258,7 +258,7 @@ KTDashboard.prototype = { | ||
| 258 | xmlreq.send(null); | 258 | xmlreq.send(null); |
| 259 | } | 259 | } |
| 260 | 260 | ||
| 261 | -} | 261 | +}; |
| 262 | 262 | ||
| 263 | 263 | ||
| 264 | 264 |
templates/kt3/standard_page.smarty
| @@ -137,6 +137,7 @@ | @@ -137,6 +137,7 @@ | ||
| 137 | {/if} | 137 | {/if} |
| 138 | </div> | 138 | </div> |
| 139 | <div id="kt-wrapper"> | 139 | <div id="kt-wrapper"> |
| 140 | + | ||
| 140 | <div id="portletbar"> | 141 | <div id="portletbar"> |
| 141 | {foreach item=oPortlet from=$page->portlets} | 142 | {foreach item=oPortlet from=$page->portlets} |
| 142 | {assign var=portlet_output value=$oPortlet->render() } | 143 | {assign var=portlet_output value=$oPortlet->render() } |
| @@ -155,7 +156,6 @@ | @@ -155,7 +156,6 @@ | ||
| 155 | </div> | 156 | </div> |
| 156 | {/if} | 157 | {/if} |
| 157 | {/foreach} | 158 | {/foreach} |
| 158 | - <div class="floatClear"></div> | ||
| 159 | </div> | 159 | </div> |
| 160 | <div id="content" {if $page->content_class}class="{$page->content_class}"{/if}> | 160 | <div id="content" {if $page->content_class}class="{$page->content_class}"{/if}> |
| 161 | {if (!$page->hide_section)} | 161 | {if (!$page->hide_section)} |
| @@ -182,6 +182,7 @@ | @@ -182,6 +182,7 @@ | ||
| 182 | {$page->contents} | 182 | {$page->contents} |
| 183 | <div class="floatClear"></div> | 183 | <div class="floatClear"></div> |
| 184 | </div> | 184 | </div> |
| 185 | + <div class="floatClear"></div> | ||
| 185 | </div> | 186 | </div> |
| 186 | </div> | 187 | </div> |
| 187 | <div id="copyrightbarBorder"> | 188 | <div id="copyrightbarBorder"> |
thirdpartyjs/MochiKit/MochiKitPacked.js
| 1 | /*** | 1 | /*** |
| 2 | 2 | ||
| 3 | - MochiKit.MochiKit 1.4 : PACKED VERSION | 3 | + MochiKit.MochiKit 1.3.1 : PACKED VERSION |
| 4 | 4 | ||
| 5 | THIS FILE IS AUTOMATICALLY GENERATED. If creating patches, please | 5 | THIS FILE IS AUTOMATICALLY GENERATED. If creating patches, please |
| 6 | diff against the source tree, not this file. | 6 | diff against the source tree, not this file. |
| @@ -20,10 +20,7 @@ MochiKit={}; | @@ -20,10 +20,7 @@ MochiKit={}; | ||
| 20 | if(typeof (MochiKit.Base)=="undefined"){ | 20 | if(typeof (MochiKit.Base)=="undefined"){ |
| 21 | MochiKit.Base={}; | 21 | MochiKit.Base={}; |
| 22 | } | 22 | } |
| 23 | -if(typeof (MochiKit.__export__)=="undefined"){ | ||
| 24 | -MochiKit.__export__=(MochiKit.__compat__||(typeof (JSAN)=="undefined"&&typeof (dojo)=="undefined")); | ||
| 25 | -} | ||
| 26 | -MochiKit.Base.VERSION="1.4"; | 23 | +MochiKit.Base.VERSION="1.3.1"; |
| 27 | MochiKit.Base.NAME="MochiKit.Base"; | 24 | MochiKit.Base.NAME="MochiKit.Base"; |
| 28 | MochiKit.Base.update=function(_1,_2){ | 25 | MochiKit.Base.update=function(_1,_2){ |
| 29 | if(_1===null){ | 26 | if(_1===null){ |
| @@ -43,13 +40,6 @@ MochiKit.Base.update(MochiKit.Base,{__repr__:function(){ | @@ -43,13 +40,6 @@ MochiKit.Base.update(MochiKit.Base,{__repr__:function(){ | ||
| 43 | return "["+this.NAME+" "+this.VERSION+"]"; | 40 | return "["+this.NAME+" "+this.VERSION+"]"; |
| 44 | },toString:function(){ | 41 | },toString:function(){ |
| 45 | return this.__repr__(); | 42 | return this.__repr__(); |
| 46 | -},camelize:function(_6){ | ||
| 47 | -var _7=_6.split("-"); | ||
| 48 | -var cc=_7[0]; | ||
| 49 | -for(var i=1;i<_7.length;i++){ | ||
| 50 | -cc+=_7[i].charAt(0).toUpperCase()+_7[i].substring(1); | ||
| 51 | -} | ||
| 52 | -return cc; | ||
| 53 | },counter:function(n){ | 43 | },counter:function(n){ |
| 54 | if(arguments.length===0){ | 44 | if(arguments.length===0){ |
| 55 | n=1; | 45 | n=1; |
| @@ -57,42 +47,30 @@ n=1; | @@ -57,42 +47,30 @@ n=1; | ||
| 57 | return function(){ | 47 | return function(){ |
| 58 | return n++; | 48 | return n++; |
| 59 | }; | 49 | }; |
| 60 | -},clone:function(obj){ | 50 | +},clone:function(_7){ |
| 61 | var me=arguments.callee; | 51 | var me=arguments.callee; |
| 62 | if(arguments.length==1){ | 52 | if(arguments.length==1){ |
| 63 | -me.prototype=obj; | 53 | +me.prototype=_7; |
| 64 | return new me(); | 54 | return new me(); |
| 65 | } | 55 | } |
| 66 | -},_flattenArray:function(res,lst){ | ||
| 67 | -for(var i=0;i<lst.length;i++){ | ||
| 68 | -var o=lst[i]; | ||
| 69 | -if(o instanceof Array){ | ||
| 70 | -arguments.callee(res,o); | ||
| 71 | -}else{ | ||
| 72 | -res.push(o); | ||
| 73 | -} | ||
| 74 | -} | ||
| 75 | -return res; | ||
| 76 | -},flattenArray:function(lst){ | ||
| 77 | -return MochiKit.Base._flattenArray([],lst); | ||
| 78 | -},flattenArguments:function(lst){ | 56 | +},flattenArguments:function(_9){ |
| 79 | var res=[]; | 57 | var res=[]; |
| 80 | var m=MochiKit.Base; | 58 | var m=MochiKit.Base; |
| 81 | -var _15=m.extend(null,arguments); | ||
| 82 | -while(_15.length){ | ||
| 83 | -var o=_15.shift(); | 59 | +var _12=m.extend(null,arguments); |
| 60 | +while(_12.length){ | ||
| 61 | +var o=_12.shift(); | ||
| 84 | if(o&&typeof (o)=="object"&&typeof (o.length)=="number"){ | 62 | if(o&&typeof (o)=="object"&&typeof (o.length)=="number"){ |
| 85 | for(var i=o.length-1;i>=0;i--){ | 63 | for(var i=o.length-1;i>=0;i--){ |
| 86 | -_15.unshift(o[i]); | 64 | +_12.unshift(o[i]); |
| 87 | } | 65 | } |
| 88 | }else{ | 66 | }else{ |
| 89 | res.push(o); | 67 | res.push(o); |
| 90 | } | 68 | } |
| 91 | } | 69 | } |
| 92 | return res; | 70 | return res; |
| 93 | -},extend:function(_16,obj,_17){ | ||
| 94 | -if(!_17){ | ||
| 95 | -_17=0; | 71 | +},extend:function(_13,obj,_15){ |
| 72 | +if(!_15){ | ||
| 73 | +_15=0; | ||
| 96 | } | 74 | } |
| 97 | if(obj){ | 75 | if(obj){ |
| 98 | var l=obj.length; | 76 | var l=obj.length; |
| @@ -104,74 +82,68 @@ l=obj.length; | @@ -104,74 +82,68 @@ l=obj.length; | ||
| 104 | throw new TypeError("Argument not an array-like and MochiKit.Iter not present"); | 82 | throw new TypeError("Argument not an array-like and MochiKit.Iter not present"); |
| 105 | } | 83 | } |
| 106 | } | 84 | } |
| 107 | -if(!_16){ | ||
| 108 | -_16=[]; | 85 | +if(!_13){ |
| 86 | +_13=[]; | ||
| 109 | } | 87 | } |
| 110 | -for(var i=_17;i<l;i++){ | ||
| 111 | -_16.push(obj[i]); | 88 | +for(var i=_15;i<l;i++){ |
| 89 | +_13.push(obj[i]); | ||
| 112 | } | 90 | } |
| 113 | } | 91 | } |
| 114 | -return _16; | ||
| 115 | -},updatetree:function(_19,obj){ | ||
| 116 | -if(_19===null){ | ||
| 117 | -_19={}; | 92 | +return _13; |
| 93 | +},updatetree:function(_17,obj){ | ||
| 94 | +if(_17===null){ | ||
| 95 | +_17={}; | ||
| 118 | } | 96 | } |
| 119 | for(var i=1;i<arguments.length;i++){ | 97 | for(var i=1;i<arguments.length;i++){ |
| 120 | var o=arguments[i]; | 98 | var o=arguments[i]; |
| 121 | if(typeof (o)!="undefined"&&o!==null){ | 99 | if(typeof (o)!="undefined"&&o!==null){ |
| 122 | for(var k in o){ | 100 | for(var k in o){ |
| 123 | var v=o[k]; | 101 | var v=o[k]; |
| 124 | -if(typeof (_19[k])=="object"&&typeof (v)=="object"){ | ||
| 125 | -arguments.callee(_19[k],v); | 102 | +if(typeof (_17[k])=="object"&&typeof (v)=="object"){ |
| 103 | +arguments.callee(_17[k],v); | ||
| 126 | }else{ | 104 | }else{ |
| 127 | -_19[k]=v; | 105 | +_17[k]=v; |
| 128 | } | 106 | } |
| 129 | } | 107 | } |
| 130 | } | 108 | } |
| 131 | } | 109 | } |
| 132 | -return _19; | ||
| 133 | -},setdefault:function(_21,obj){ | ||
| 134 | -if(_21===null){ | ||
| 135 | -_21={}; | 110 | +return _17; |
| 111 | +},setdefault:function(_19,obj){ | ||
| 112 | +if(_19===null){ | ||
| 113 | +_19={}; | ||
| 136 | } | 114 | } |
| 137 | for(var i=1;i<arguments.length;i++){ | 115 | for(var i=1;i<arguments.length;i++){ |
| 138 | var o=arguments[i]; | 116 | var o=arguments[i]; |
| 139 | for(var k in o){ | 117 | for(var k in o){ |
| 140 | -if(!(k in _21)){ | ||
| 141 | -_21[k]=o[k]; | 118 | +if(!(k in _19)){ |
| 119 | +_19[k]=o[k]; | ||
| 142 | } | 120 | } |
| 143 | } | 121 | } |
| 144 | } | 122 | } |
| 145 | -return _21; | 123 | +return _19; |
| 146 | },keys:function(obj){ | 124 | },keys:function(obj){ |
| 147 | -var _22=[]; | ||
| 148 | -for(var _23 in obj){ | ||
| 149 | -_22.push(_23); | ||
| 150 | -} | ||
| 151 | -return _22; | ||
| 152 | -},values:function(obj){ | ||
| 153 | -var _24=[]; | ||
| 154 | -for(var _25 in obj){ | ||
| 155 | -_24.push(obj[_25]); | 125 | +var _20=[]; |
| 126 | +for(var _21 in obj){ | ||
| 127 | +_20.push(_21); | ||
| 156 | } | 128 | } |
| 157 | -return _24; | 129 | +return _20; |
| 158 | },items:function(obj){ | 130 | },items:function(obj){ |
| 159 | -var _26=[]; | 131 | +var _22=[]; |
| 160 | var e; | 132 | var e; |
| 161 | -for(var _28 in obj){ | 133 | +for(var _24 in obj){ |
| 162 | var v; | 134 | var v; |
| 163 | try{ | 135 | try{ |
| 164 | -v=obj[_28]; | 136 | +v=obj[_24]; |
| 165 | } | 137 | } |
| 166 | catch(e){ | 138 | catch(e){ |
| 167 | continue; | 139 | continue; |
| 168 | } | 140 | } |
| 169 | -_26.push([_28,v]); | 141 | +_22.push([_24,v]); |
| 170 | } | 142 | } |
| 171 | -return _26; | ||
| 172 | -},_newNamedError:function(_29,_30,_31){ | ||
| 173 | -_31.prototype=new MochiKit.Base.NamedError(_29.NAME+"."+_30); | ||
| 174 | -_29[_30]=_31; | 143 | +return _22; |
| 144 | +},_newNamedError:function(_25,_26,_27){ | ||
| 145 | +_27.prototype=new MochiKit.Base.NamedError(_25.NAME+"."+_26); | ||
| 146 | +_25[_26]=_27; | ||
| 175 | },operator:{truth:function(a){ | 147 | },operator:{truth:function(a){ |
| 176 | return !!a; | 148 | return !!a; |
| 177 | },lognot:function(a){ | 149 | },lognot:function(a){ |
| @@ -216,10 +188,6 @@ return a>=b; | @@ -216,10 +188,6 @@ return a>=b; | ||
| 216 | return a<b; | 188 | return a<b; |
| 217 | },le:function(a,b){ | 189 | },le:function(a,b){ |
| 218 | return a<=b; | 190 | return a<=b; |
| 219 | -},seq:function(a,b){ | ||
| 220 | -return a===b; | ||
| 221 | -},sne:function(a,b){ | ||
| 222 | -return a!==b; | ||
| 223 | },ceq:function(a,b){ | 191 | },ceq:function(a,b){ |
| 224 | return MochiKit.Base.compare(a,b)===0; | 192 | return MochiKit.Base.compare(a,b)===0; |
| 225 | },cne:function(a,b){ | 193 | },cne:function(a,b){ |
| @@ -238,23 +206,23 @@ return a&&b; | @@ -238,23 +206,23 @@ return a&&b; | ||
| 238 | return a||b; | 206 | return a||b; |
| 239 | },contains:function(a,b){ | 207 | },contains:function(a,b){ |
| 240 | return b in a; | 208 | return b in a; |
| 241 | -}},forwardCall:function(_34){ | 209 | +}},forwardCall:function(_30){ |
| 242 | return function(){ | 210 | return function(){ |
| 243 | -return this[_34].apply(this,arguments); | 211 | +return this[_30].apply(this,arguments); |
| 244 | }; | 212 | }; |
| 245 | -},itemgetter:function(_35){ | 213 | +},itemgetter:function(_31){ |
| 246 | return function(arg){ | 214 | return function(arg){ |
| 247 | -return arg[_35]; | 215 | +return arg[_31]; |
| 248 | }; | 216 | }; |
| 249 | },typeMatcher:function(){ | 217 | },typeMatcher:function(){ |
| 250 | -var _37={}; | 218 | +var _33={}; |
| 251 | for(var i=0;i<arguments.length;i++){ | 219 | for(var i=0;i<arguments.length;i++){ |
| 252 | var typ=arguments[i]; | 220 | var typ=arguments[i]; |
| 253 | -_37[typ]=typ; | 221 | +_33[typ]=typ; |
| 254 | } | 222 | } |
| 255 | return function(){ | 223 | return function(){ |
| 256 | for(var i=0;i<arguments.length;i++){ | 224 | for(var i=0;i<arguments.length;i++){ |
| 257 | -if(!(typeof (arguments[i]) in _37)){ | 225 | +if(!(typeof (arguments[i]) in _33)){ |
| 258 | return false; | 226 | return false; |
| 259 | } | 227 | } |
| 260 | } | 228 | } |
| @@ -289,7 +257,7 @@ return true; | @@ -289,7 +257,7 @@ return true; | ||
| 289 | for(var i=0;i<arguments.length;i++){ | 257 | for(var i=0;i<arguments.length;i++){ |
| 290 | var o=arguments[i]; | 258 | var o=arguments[i]; |
| 291 | var typ=typeof (o); | 259 | var typ=typeof (o); |
| 292 | -if((typ!="object"&&!(typ=="function"&&typeof (o.item)=="function"))||o===null||typeof (o.length)!="number"||o.nodeType===3){ | 260 | +if((typ!="object"&&!(typ=="function"&&typeof (o.item)=="function"))||o===null||typeof (o.length)!="number"){ |
| 293 | return false; | 261 | return false; |
| 294 | } | 262 | } |
| 295 | } | 263 | } |
| @@ -306,17 +274,17 @@ return true; | @@ -306,17 +274,17 @@ return true; | ||
| 306 | if(fn===null){ | 274 | if(fn===null){ |
| 307 | return MochiKit.Base.extend(null,arguments,1); | 275 | return MochiKit.Base.extend(null,arguments,1); |
| 308 | } | 276 | } |
| 309 | -var _40=[]; | 277 | +var _36=[]; |
| 310 | for(var i=1;i<arguments.length;i++){ | 278 | for(var i=1;i<arguments.length;i++){ |
| 311 | -_40.push(fn(arguments[i])); | 279 | +_36.push(fn(arguments[i])); |
| 312 | } | 280 | } |
| 313 | -return _40; | 281 | +return _36; |
| 314 | },map:function(fn,lst){ | 282 | },map:function(fn,lst){ |
| 315 | var m=MochiKit.Base; | 283 | var m=MochiKit.Base; |
| 316 | var itr=MochiKit.Iter; | 284 | var itr=MochiKit.Iter; |
| 317 | -var _42=m.isArrayLike; | 285 | +var _39=m.isArrayLike; |
| 318 | if(arguments.length<=2){ | 286 | if(arguments.length<=2){ |
| 319 | -if(!_42(lst)){ | 287 | +if(!_39(lst)){ |
| 320 | if(itr){ | 288 | if(itr){ |
| 321 | lst=itr.list(lst); | 289 | lst=itr.list(lst); |
| 322 | if(fn===null){ | 290 | if(fn===null){ |
| @@ -329,18 +297,18 @@ throw new TypeError("Argument not an array-like and MochiKit.Iter not present"); | @@ -329,18 +297,18 @@ throw new TypeError("Argument not an array-like and MochiKit.Iter not present"); | ||
| 329 | if(fn===null){ | 297 | if(fn===null){ |
| 330 | return m.extend(null,lst); | 298 | return m.extend(null,lst); |
| 331 | } | 299 | } |
| 332 | -var _43=[]; | 300 | +var _40=[]; |
| 333 | for(var i=0;i<lst.length;i++){ | 301 | for(var i=0;i<lst.length;i++){ |
| 334 | -_43.push(fn(lst[i])); | 302 | +_40.push(fn(lst[i])); |
| 335 | } | 303 | } |
| 336 | -return _43; | 304 | +return _40; |
| 337 | }else{ | 305 | }else{ |
| 338 | if(fn===null){ | 306 | if(fn===null){ |
| 339 | fn=Array; | 307 | fn=Array; |
| 340 | } | 308 | } |
| 341 | -var _44=null; | 309 | +var _41=null; |
| 342 | for(i=1;i<arguments.length;i++){ | 310 | for(i=1;i<arguments.length;i++){ |
| 343 | -if(!_42(arguments[i])){ | 311 | +if(!_39(arguments[i])){ |
| 344 | if(itr){ | 312 | if(itr){ |
| 345 | return itr.list(itr.imap.apply(null,arguments)); | 313 | return itr.list(itr.imap.apply(null,arguments)); |
| 346 | }else{ | 314 | }else{ |
| @@ -348,34 +316,34 @@ throw new TypeError("Argument not an array-like and MochiKit.Iter not present"); | @@ -348,34 +316,34 @@ throw new TypeError("Argument not an array-like and MochiKit.Iter not present"); | ||
| 348 | } | 316 | } |
| 349 | } | 317 | } |
| 350 | var l=arguments[i].length; | 318 | var l=arguments[i].length; |
| 351 | -if(_44===null||_44>l){ | ||
| 352 | -_44=l; | 319 | +if(_41===null||_41>l){ |
| 320 | +_41=l; | ||
| 353 | } | 321 | } |
| 354 | } | 322 | } |
| 355 | -_43=[]; | ||
| 356 | -for(i=0;i<_44;i++){ | ||
| 357 | -var _45=[]; | 323 | +_40=[]; |
| 324 | +for(i=0;i<_41;i++){ | ||
| 325 | +var _42=[]; | ||
| 358 | for(var j=1;j<arguments.length;j++){ | 326 | for(var j=1;j<arguments.length;j++){ |
| 359 | -_45.push(arguments[j][i]); | 327 | +_42.push(arguments[j][i]); |
| 360 | } | 328 | } |
| 361 | -_43.push(fn.apply(this,_45)); | 329 | +_40.push(fn.apply(this,_42)); |
| 362 | } | 330 | } |
| 363 | -return _43; | 331 | +return _40; |
| 364 | } | 332 | } |
| 365 | },xfilter:function(fn){ | 333 | },xfilter:function(fn){ |
| 366 | -var _47=[]; | 334 | +var _44=[]; |
| 367 | if(fn===null){ | 335 | if(fn===null){ |
| 368 | fn=MochiKit.Base.operator.truth; | 336 | fn=MochiKit.Base.operator.truth; |
| 369 | } | 337 | } |
| 370 | for(var i=1;i<arguments.length;i++){ | 338 | for(var i=1;i<arguments.length;i++){ |
| 371 | var o=arguments[i]; | 339 | var o=arguments[i]; |
| 372 | if(fn(o)){ | 340 | if(fn(o)){ |
| 373 | -_47.push(o); | 341 | +_44.push(o); |
| 374 | } | 342 | } |
| 375 | } | 343 | } |
| 376 | -return _47; | ||
| 377 | -},filter:function(fn,lst,_48){ | ||
| 378 | -var _49=[]; | 344 | +return _44; |
| 345 | +},filter:function(fn,lst,_45){ | ||
| 346 | +var _46=[]; | ||
| 379 | var m=MochiKit.Base; | 347 | var m=MochiKit.Base; |
| 380 | if(!m.isArrayLike(lst)){ | 348 | if(!m.isArrayLike(lst)){ |
| 381 | if(MochiKit.Iter){ | 349 | if(MochiKit.Iter){ |
| @@ -388,146 +356,115 @@ if(fn===null){ | @@ -388,146 +356,115 @@ if(fn===null){ | ||
| 388 | fn=m.operator.truth; | 356 | fn=m.operator.truth; |
| 389 | } | 357 | } |
| 390 | if(typeof (Array.prototype.filter)=="function"){ | 358 | if(typeof (Array.prototype.filter)=="function"){ |
| 391 | -return Array.prototype.filter.call(lst,fn,_48); | 359 | +return Array.prototype.filter.call(lst,fn,_45); |
| 392 | }else{ | 360 | }else{ |
| 393 | -if(typeof (_48)=="undefined"||_48===null){ | 361 | +if(typeof (_45)=="undefined"||_45===null){ |
| 394 | for(var i=0;i<lst.length;i++){ | 362 | for(var i=0;i<lst.length;i++){ |
| 395 | var o=lst[i]; | 363 | var o=lst[i]; |
| 396 | if(fn(o)){ | 364 | if(fn(o)){ |
| 397 | -_49.push(o); | 365 | +_46.push(o); |
| 398 | } | 366 | } |
| 399 | } | 367 | } |
| 400 | }else{ | 368 | }else{ |
| 401 | for(i=0;i<lst.length;i++){ | 369 | for(i=0;i<lst.length;i++){ |
| 402 | o=lst[i]; | 370 | o=lst[i]; |
| 403 | -if(fn.call(_48,o)){ | ||
| 404 | -_49.push(o); | 371 | +if(fn.call(_45,o)){ |
| 372 | +_46.push(o); | ||
| 405 | } | 373 | } |
| 406 | } | 374 | } |
| 407 | } | 375 | } |
| 408 | } | 376 | } |
| 409 | -return _49; | ||
| 410 | -},_wrapDumbFunction:function(_50){ | 377 | +return _46; |
| 378 | +},_wrapDumbFunction:function(_47){ | ||
| 411 | return function(){ | 379 | return function(){ |
| 412 | switch(arguments.length){ | 380 | switch(arguments.length){ |
| 413 | case 0: | 381 | case 0: |
| 414 | -return _50(); | 382 | +return _47(); |
| 415 | case 1: | 383 | case 1: |
| 416 | -return _50(arguments[0]); | 384 | +return _47(arguments[0]); |
| 417 | case 2: | 385 | case 2: |
| 418 | -return _50(arguments[0],arguments[1]); | 386 | +return _47(arguments[0],arguments[1]); |
| 419 | case 3: | 387 | case 3: |
| 420 | -return _50(arguments[0],arguments[1],arguments[2]); | 388 | +return _47(arguments[0],arguments[1],arguments[2]); |
| 421 | } | 389 | } |
| 422 | -var _51=[]; | 390 | +var _48=[]; |
| 423 | for(var i=0;i<arguments.length;i++){ | 391 | for(var i=0;i<arguments.length;i++){ |
| 424 | -_51.push("arguments["+i+"]"); | 392 | +_48.push("arguments["+i+"]"); |
| 425 | } | 393 | } |
| 426 | -return eval("(func("+_51.join(",")+"))"); | ||
| 427 | -}; | ||
| 428 | -},methodcaller:function(_52){ | ||
| 429 | -var _53=MochiKit.Base.extend(null,arguments,1); | ||
| 430 | -if(typeof (_52)=="function"){ | ||
| 431 | -return function(obj){ | ||
| 432 | -return _52.apply(obj,_53); | 394 | +return eval("(func("+_48.join(",")+"))"); |
| 433 | }; | 395 | }; |
| 434 | -}else{ | ||
| 435 | -return function(obj){ | ||
| 436 | -return obj[_52].apply(obj,_53); | ||
| 437 | -}; | ||
| 438 | -} | ||
| 439 | -},method:function(_54,_55){ | ||
| 440 | -var m=MochiKit.Base; | ||
| 441 | -return m.bind.apply(this,m.extend([_55,_54],arguments,2)); | ||
| 442 | -},compose:function(f1,f2){ | ||
| 443 | -var _58=[]; | 396 | +},method:function(_49,_50){ |
| 444 | var m=MochiKit.Base; | 397 | var m=MochiKit.Base; |
| 445 | -if(arguments.length===0){ | ||
| 446 | -throw new TypeError("compose() requires at least one argument"); | ||
| 447 | -} | ||
| 448 | -for(var i=0;i<arguments.length;i++){ | ||
| 449 | -var fn=arguments[i]; | ||
| 450 | -if(typeof (fn)!="function"){ | ||
| 451 | -throw new TypeError(m.repr(fn)+" is not a function"); | ||
| 452 | -} | ||
| 453 | -_58.push(fn); | ||
| 454 | -} | ||
| 455 | -return function(){ | ||
| 456 | -var _59=arguments; | ||
| 457 | -for(var i=_58.length-1;i>=0;i--){ | ||
| 458 | -_59=[_58[i].apply(this,_59)]; | ||
| 459 | -} | ||
| 460 | -return _59[0]; | ||
| 461 | -}; | ||
| 462 | -},bind:function(_60,_61){ | ||
| 463 | -if(typeof (_60)=="string"){ | ||
| 464 | -_60=_61[_60]; | ||
| 465 | -} | ||
| 466 | -var _62=_60.im_func; | ||
| 467 | -var _63=_60.im_preargs; | ||
| 468 | -var _64=_60.im_self; | 398 | +return m.bind.apply(this,m.extend([_50,_49],arguments,2)); |
| 399 | +},bind:function(_51,_52){ | ||
| 400 | +if(typeof (_51)=="string"){ | ||
| 401 | +_51=_52[_51]; | ||
| 402 | +} | ||
| 403 | +var _53=_51.im_func; | ||
| 404 | +var _54=_51.im_preargs; | ||
| 405 | +var _55=_51.im_self; | ||
| 469 | var m=MochiKit.Base; | 406 | var m=MochiKit.Base; |
| 470 | -if(typeof (_60)=="function"&&typeof (_60.apply)=="undefined"){ | ||
| 471 | -_60=m._wrapDumbFunction(_60); | 407 | +if(typeof (_51)=="function"&&typeof (_51.apply)=="undefined"){ |
| 408 | +_51=m._wrapDumbFunction(_51); | ||
| 472 | } | 409 | } |
| 473 | -if(typeof (_62)!="function"){ | ||
| 474 | -_62=_60; | 410 | +if(typeof (_53)!="function"){ |
| 411 | +_53=_51; | ||
| 475 | } | 412 | } |
| 476 | -if(typeof (_61)!="undefined"){ | ||
| 477 | -_64=_61; | 413 | +if(typeof (_52)!="undefined"){ |
| 414 | +_55=_52; | ||
| 478 | } | 415 | } |
| 479 | -if(typeof (_63)=="undefined"){ | ||
| 480 | -_63=[]; | 416 | +if(typeof (_54)=="undefined"){ |
| 417 | +_54=[]; | ||
| 481 | }else{ | 418 | }else{ |
| 482 | -_63=_63.slice(); | 419 | +_54=_54.slice(); |
| 483 | } | 420 | } |
| 484 | -m.extend(_63,arguments,2); | ||
| 485 | -var _65=function(){ | ||
| 486 | -var _66=arguments; | 421 | +m.extend(_54,arguments,2); |
| 422 | +var _56=function(){ | ||
| 423 | +var _57=arguments; | ||
| 487 | var me=arguments.callee; | 424 | var me=arguments.callee; |
| 488 | if(me.im_preargs.length>0){ | 425 | if(me.im_preargs.length>0){ |
| 489 | -_66=m.concat(me.im_preargs,_66); | 426 | +_57=m.concat(me.im_preargs,_57); |
| 490 | } | 427 | } |
| 491 | -var _61=me.im_self; | ||
| 492 | -if(!_61){ | ||
| 493 | -_61=this; | 428 | +var _52=me.im_self; |
| 429 | +if(!_52){ | ||
| 430 | +_52=this; | ||
| 494 | } | 431 | } |
| 495 | -return me.im_func.apply(_61,_66); | 432 | +return me.im_func.apply(_52,_57); |
| 496 | }; | 433 | }; |
| 497 | -_65.im_self=_64; | ||
| 498 | -_65.im_func=_62; | ||
| 499 | -_65.im_preargs=_63; | ||
| 500 | -return _65; | ||
| 501 | -},bindMethods:function(_67){ | ||
| 502 | -var _68=MochiKit.Base.bind; | ||
| 503 | -for(var k in _67){ | ||
| 504 | -var _69=_67[k]; | ||
| 505 | -if(typeof (_69)=="function"){ | ||
| 506 | -_67[k]=_68(_69,_67); | ||
| 507 | -} | ||
| 508 | -} | ||
| 509 | -},registerComparator:function(_70,_71,_72,_73){ | ||
| 510 | -MochiKit.Base.comparatorRegistry.register(_70,_71,_72,_73); | 434 | +_56.im_self=_55; |
| 435 | +_56.im_func=_53; | ||
| 436 | +_56.im_preargs=_54; | ||
| 437 | +return _56; | ||
| 438 | +},bindMethods:function(_58){ | ||
| 439 | +var _59=MochiKit.Base.bind; | ||
| 440 | +for(var k in _58){ | ||
| 441 | +var _60=_58[k]; | ||
| 442 | +if(typeof (_60)=="function"){ | ||
| 443 | +_58[k]=_59(_60,_58); | ||
| 444 | +} | ||
| 445 | +} | ||
| 446 | +},registerComparator:function(_61,_62,_63,_64){ | ||
| 447 | +MochiKit.Base.comparatorRegistry.register(_61,_62,_63,_64); | ||
| 511 | },_primitives:{"boolean":true,"string":true,"number":true},compare:function(a,b){ | 448 | },_primitives:{"boolean":true,"string":true,"number":true},compare:function(a,b){ |
| 512 | if(a==b){ | 449 | if(a==b){ |
| 513 | return 0; | 450 | return 0; |
| 514 | } | 451 | } |
| 515 | -var _74=(typeof (a)=="undefined"||a===null); | ||
| 516 | -var _75=(typeof (b)=="undefined"||b===null); | ||
| 517 | -if(_74&&_75){ | 452 | +var _65=(typeof (a)=="undefined"||a===null); |
| 453 | +var _66=(typeof (b)=="undefined"||b===null); | ||
| 454 | +if(_65&&_66){ | ||
| 518 | return 0; | 455 | return 0; |
| 519 | }else{ | 456 | }else{ |
| 520 | -if(_74){ | 457 | +if(_65){ |
| 521 | return -1; | 458 | return -1; |
| 522 | }else{ | 459 | }else{ |
| 523 | -if(_75){ | 460 | +if(_66){ |
| 524 | return 1; | 461 | return 1; |
| 525 | } | 462 | } |
| 526 | } | 463 | } |
| 527 | } | 464 | } |
| 528 | var m=MochiKit.Base; | 465 | var m=MochiKit.Base; |
| 529 | -var _76=m._primitives; | ||
| 530 | -if(!(typeof (a) in _76&&typeof (b) in _76)){ | 466 | +var _67=m._primitives; |
| 467 | +if(!(typeof (a) in _67&&typeof (b) in _67)){ | ||
| 531 | try{ | 468 | try{ |
| 532 | return m.comparatorRegistry.match(a,b); | 469 | return m.comparatorRegistry.match(a,b); |
| 533 | } | 470 | } |
| @@ -544,31 +481,31 @@ if(a>b){ | @@ -544,31 +481,31 @@ if(a>b){ | ||
| 544 | return 1; | 481 | return 1; |
| 545 | } | 482 | } |
| 546 | } | 483 | } |
| 547 | -var _77=m.repr; | ||
| 548 | -throw new TypeError(_77(a)+" and "+_77(b)+" can not be compared"); | 484 | +var _68=m.repr; |
| 485 | +throw new TypeError(_68(a)+" and "+_68(b)+" can not be compared"); | ||
| 549 | },compareDateLike:function(a,b){ | 486 | },compareDateLike:function(a,b){ |
| 550 | return MochiKit.Base.compare(a.getTime(),b.getTime()); | 487 | return MochiKit.Base.compare(a.getTime(),b.getTime()); |
| 551 | },compareArrayLike:function(a,b){ | 488 | },compareArrayLike:function(a,b){ |
| 552 | -var _78=MochiKit.Base.compare; | ||
| 553 | -var _79=a.length; | ||
| 554 | -var _80=0; | ||
| 555 | -if(_79>b.length){ | ||
| 556 | -_80=1; | ||
| 557 | -_79=b.length; | 489 | +var _69=MochiKit.Base.compare; |
| 490 | +var _70=a.length; | ||
| 491 | +var _71=0; | ||
| 492 | +if(_70>b.length){ | ||
| 493 | +_71=1; | ||
| 494 | +_70=b.length; | ||
| 558 | }else{ | 495 | }else{ |
| 559 | -if(_79<b.length){ | ||
| 560 | -_80=-1; | 496 | +if(_70<b.length){ |
| 497 | +_71=-1; | ||
| 561 | } | 498 | } |
| 562 | } | 499 | } |
| 563 | -for(var i=0;i<_79;i++){ | ||
| 564 | -var cmp=_78(a[i],b[i]); | 500 | +for(var i=0;i<_70;i++){ |
| 501 | +var cmp=_69(a[i],b[i]); | ||
| 565 | if(cmp){ | 502 | if(cmp){ |
| 566 | return cmp; | 503 | return cmp; |
| 567 | } | 504 | } |
| 568 | } | 505 | } |
| 569 | -return _80; | ||
| 570 | -},registerRepr:function(_82,_83,_84,_85){ | ||
| 571 | -MochiKit.Base.reprRegistry.register(_82,_83,_84,_85); | 506 | +return _71; |
| 507 | +},registerRepr:function(_73,_74,_75,_76){ | ||
| 508 | +MochiKit.Base.reprRegistry.register(_73,_74,_75,_76); | ||
| 572 | },repr:function(o){ | 509 | },repr:function(o){ |
| 573 | if(typeof (o)=="undefined"){ | 510 | if(typeof (o)=="undefined"){ |
| 574 | return "undefined"; | 511 | return "undefined"; |
| @@ -593,19 +530,19 @@ return o.NAME; | @@ -593,19 +530,19 @@ return o.NAME; | ||
| 593 | } | 530 | } |
| 594 | } | 531 | } |
| 595 | try{ | 532 | try{ |
| 596 | -var _86=(o+""); | 533 | +var _77=(o+""); |
| 597 | } | 534 | } |
| 598 | catch(e){ | 535 | catch(e){ |
| 599 | return "["+typeof (o)+"]"; | 536 | return "["+typeof (o)+"]"; |
| 600 | } | 537 | } |
| 601 | if(typeof (o)=="function"){ | 538 | if(typeof (o)=="function"){ |
| 602 | -o=_86.replace(/^\s+/,""); | 539 | +o=_77.replace(/^\s+/,""); |
| 603 | var idx=o.indexOf("{"); | 540 | var idx=o.indexOf("{"); |
| 604 | if(idx!=-1){ | 541 | if(idx!=-1){ |
| 605 | o=o.substr(0,idx)+"{...}"; | 542 | o=o.substr(0,idx)+"{...}"; |
| 606 | } | 543 | } |
| 607 | } | 544 | } |
| 608 | -return _86; | 545 | +return _77; |
| 609 | },reprArrayLike:function(o){ | 546 | },reprArrayLike:function(o){ |
| 610 | var m=MochiKit.Base; | 547 | var m=MochiKit.Base; |
| 611 | return "["+m.map(m.repr,o).join(", ")+"]"; | 548 | return "["+m.map(m.repr,o).join(", ")+"]"; |
| @@ -613,39 +550,43 @@ return "["+m.map(m.repr,o).join(", ")+"]"; | @@ -613,39 +550,43 @@ return "["+m.map(m.repr,o).join(", ")+"]"; | ||
| 613 | return ("\""+o.replace(/(["\\])/g,"\\$1")+"\"").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r"); | 550 | return ("\""+o.replace(/(["\\])/g,"\\$1")+"\"").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r"); |
| 614 | },reprNumber:function(o){ | 551 | },reprNumber:function(o){ |
| 615 | return o+""; | 552 | return o+""; |
| 616 | -},registerJSON:function(_88,_89,_90,_91){ | ||
| 617 | -MochiKit.Base.jsonRegistry.register(_88,_89,_90,_91); | 553 | +},registerJSON:function(_79,_80,_81,_82){ |
| 554 | +MochiKit.Base.jsonRegistry.register(_79,_80,_81,_82); | ||
| 618 | },evalJSON:function(){ | 555 | },evalJSON:function(){ |
| 619 | return eval("("+arguments[0]+")"); | 556 | return eval("("+arguments[0]+")"); |
| 620 | },serializeJSON:function(o){ | 557 | },serializeJSON:function(o){ |
| 621 | -var _92=typeof (o); | ||
| 622 | -if(_92=="number"||_92=="boolean"){ | 558 | +var _83=typeof (o); |
| 559 | +if(_83=="undefined"){ | ||
| 560 | +return "undefined"; | ||
| 561 | +}else{ | ||
| 562 | +if(_83=="number"||_83=="boolean"){ | ||
| 623 | return o+""; | 563 | return o+""; |
| 624 | }else{ | 564 | }else{ |
| 625 | if(o===null){ | 565 | if(o===null){ |
| 626 | return "null"; | 566 | return "null"; |
| 627 | } | 567 | } |
| 628 | } | 568 | } |
| 569 | +} | ||
| 629 | var m=MochiKit.Base; | 570 | var m=MochiKit.Base; |
| 630 | -var _93=m.reprString; | ||
| 631 | -if(_92=="string"){ | ||
| 632 | -return _93(o); | 571 | +var _84=m.reprString; |
| 572 | +if(_83=="string"){ | ||
| 573 | +return _84(o); | ||
| 633 | } | 574 | } |
| 634 | var me=arguments.callee; | 575 | var me=arguments.callee; |
| 635 | -var _94; | 576 | +var _85; |
| 636 | if(typeof (o.__json__)=="function"){ | 577 | if(typeof (o.__json__)=="function"){ |
| 637 | -_94=o.__json__(); | ||
| 638 | -if(o!==_94){ | ||
| 639 | -return me(_94); | 578 | +_85=o.__json__(); |
| 579 | +if(o!==_85){ | ||
| 580 | +return me(_85); | ||
| 640 | } | 581 | } |
| 641 | } | 582 | } |
| 642 | if(typeof (o.json)=="function"){ | 583 | if(typeof (o.json)=="function"){ |
| 643 | -_94=o.json(); | ||
| 644 | -if(o!==_94){ | ||
| 645 | -return me(_94); | 584 | +_85=o.json(); |
| 585 | +if(o!==_85){ | ||
| 586 | +return me(_85); | ||
| 646 | } | 587 | } |
| 647 | } | 588 | } |
| 648 | -if(_92!="function"&&typeof (o.length)=="number"){ | 589 | +if(_83!="function"&&typeof (o.length)=="number"){ |
| 649 | var res=[]; | 590 | var res=[]; |
| 650 | for(var i=0;i<o.length;i++){ | 591 | for(var i=0;i<o.length;i++){ |
| 651 | var val=me(o[i]); | 592 | var val=me(o[i]); |
| @@ -657,30 +598,25 @@ res.push(val); | @@ -657,30 +598,25 @@ res.push(val); | ||
| 657 | return "["+res.join(", ")+"]"; | 598 | return "["+res.join(", ")+"]"; |
| 658 | } | 599 | } |
| 659 | try{ | 600 | try{ |
| 660 | -_94=m.jsonRegistry.match(o); | ||
| 661 | -if(o!==_94){ | ||
| 662 | -return me(_94); | ||
| 663 | -} | 601 | +_85=m.jsonRegistry.match(o); |
| 602 | +return me(_85); | ||
| 664 | } | 603 | } |
| 665 | catch(e){ | 604 | catch(e){ |
| 666 | if(e!=m.NotFound){ | 605 | if(e!=m.NotFound){ |
| 667 | throw e; | 606 | throw e; |
| 668 | } | 607 | } |
| 669 | } | 608 | } |
| 670 | -if(_92=="undefined"){ | ||
| 671 | -throw new TypeError("undefined can not be serialized as JSON"); | ||
| 672 | -} | ||
| 673 | -if(_92=="function"){ | 609 | +if(_83=="function"){ |
| 674 | return null; | 610 | return null; |
| 675 | } | 611 | } |
| 676 | res=[]; | 612 | res=[]; |
| 677 | for(var k in o){ | 613 | for(var k in o){ |
| 678 | -var _96; | 614 | +var _87; |
| 679 | if(typeof (k)=="number"){ | 615 | if(typeof (k)=="number"){ |
| 680 | -_96="\""+k+"\""; | 616 | +_87="\""+k+"\""; |
| 681 | }else{ | 617 | }else{ |
| 682 | if(typeof (k)=="string"){ | 618 | if(typeof (k)=="string"){ |
| 683 | -_96=_93(k); | 619 | +_87=_84(k); |
| 684 | }else{ | 620 | }else{ |
| 685 | continue; | 621 | continue; |
| 686 | } | 622 | } |
| @@ -689,57 +625,57 @@ val=me(o[k]); | @@ -689,57 +625,57 @@ val=me(o[k]); | ||
| 689 | if(typeof (val)!="string"){ | 625 | if(typeof (val)!="string"){ |
| 690 | continue; | 626 | continue; |
| 691 | } | 627 | } |
| 692 | -res.push(_96+":"+val); | 628 | +res.push(_87+":"+val); |
| 693 | } | 629 | } |
| 694 | return "{"+res.join(", ")+"}"; | 630 | return "{"+res.join(", ")+"}"; |
| 695 | },objEqual:function(a,b){ | 631 | },objEqual:function(a,b){ |
| 696 | return (MochiKit.Base.compare(a,b)===0); | 632 | return (MochiKit.Base.compare(a,b)===0); |
| 697 | -},arrayEqual:function(_97,arr){ | ||
| 698 | -if(_97.length!=arr.length){ | 633 | +},arrayEqual:function(_88,arr){ |
| 634 | +if(_88.length!=arr.length){ | ||
| 699 | return false; | 635 | return false; |
| 700 | } | 636 | } |
| 701 | -return (MochiKit.Base.compare(_97,arr)===0); | 637 | +return (MochiKit.Base.compare(_88,arr)===0); |
| 702 | },concat:function(){ | 638 | },concat:function(){ |
| 703 | -var _99=[]; | ||
| 704 | -var _100=MochiKit.Base.extend; | 639 | +var _90=[]; |
| 640 | +var _91=MochiKit.Base.extend; | ||
| 705 | for(var i=0;i<arguments.length;i++){ | 641 | for(var i=0;i<arguments.length;i++){ |
| 706 | -_100(_99,arguments[i]); | 642 | +_91(_90,arguments[i]); |
| 707 | } | 643 | } |
| 708 | -return _99; | 644 | +return _90; |
| 709 | },keyComparator:function(key){ | 645 | },keyComparator:function(key){ |
| 710 | var m=MochiKit.Base; | 646 | var m=MochiKit.Base; |
| 711 | -var _102=m.compare; | 647 | +var _93=m.compare; |
| 712 | if(arguments.length==1){ | 648 | if(arguments.length==1){ |
| 713 | return function(a,b){ | 649 | return function(a,b){ |
| 714 | -return _102(a[key],b[key]); | 650 | +return _93(a[key],b[key]); |
| 715 | }; | 651 | }; |
| 716 | } | 652 | } |
| 717 | -var _103=m.extend(null,arguments); | 653 | +var _94=m.extend(null,arguments); |
| 718 | return function(a,b){ | 654 | return function(a,b){ |
| 719 | -var rval=0; | ||
| 720 | -for(var i=0;(rval===0)&&(i<_103.length);i++){ | ||
| 721 | -var key=_103[i]; | ||
| 722 | -rval=_102(a[key],b[key]); | 655 | +var _95=0; |
| 656 | +for(var i=0;(_95===0)&&(i<_94.length);i++){ | ||
| 657 | +var key=_94[i]; | ||
| 658 | +_95=_93(a[key],b[key]); | ||
| 723 | } | 659 | } |
| 724 | -return rval; | 660 | +return _95; |
| 725 | }; | 661 | }; |
| 726 | },reverseKeyComparator:function(key){ | 662 | },reverseKeyComparator:function(key){ |
| 727 | -var _105=MochiKit.Base.keyComparator.apply(this,arguments); | 663 | +var _96=MochiKit.Base.keyComparator.apply(this,arguments); |
| 728 | return function(a,b){ | 664 | return function(a,b){ |
| 729 | -return _105(b,a); | 665 | +return _96(b,a); |
| 730 | }; | 666 | }; |
| 731 | -},partial:function(func){ | 667 | +},partial:function(_97){ |
| 732 | var m=MochiKit.Base; | 668 | var m=MochiKit.Base; |
| 733 | -return m.bind.apply(this,m.extend([func,undefined],arguments,1)); | ||
| 734 | -},listMinMax:function(_107,lst){ | 669 | +return m.bind.apply(this,m.extend([_97,undefined],arguments,1)); |
| 670 | +},listMinMax:function(_98,lst){ | ||
| 735 | if(lst.length===0){ | 671 | if(lst.length===0){ |
| 736 | return null; | 672 | return null; |
| 737 | } | 673 | } |
| 738 | var cur=lst[0]; | 674 | var cur=lst[0]; |
| 739 | -var _109=MochiKit.Base.compare; | 675 | +var _100=MochiKit.Base.compare; |
| 740 | for(var i=1;i<lst.length;i++){ | 676 | for(var i=1;i<lst.length;i++){ |
| 741 | var o=lst[i]; | 677 | var o=lst[i]; |
| 742 | -if(_109(o,cur)==_107){ | 678 | +if(_100(o,cur)==_98){ |
| 743 | cur=o; | 679 | cur=o; |
| 744 | } | 680 | } |
| 745 | } | 681 | } |
| @@ -748,83 +684,45 @@ return cur; | @@ -748,83 +684,45 @@ return cur; | ||
| 748 | return MochiKit.Base.listMinMax(1,arguments); | 684 | return MochiKit.Base.listMinMax(1,arguments); |
| 749 | },objMin:function(){ | 685 | },objMin:function(){ |
| 750 | return MochiKit.Base.listMinMax(-1,arguments); | 686 | return MochiKit.Base.listMinMax(-1,arguments); |
| 751 | -},findIdentical:function(lst,_110,_111,end){ | 687 | +},findIdentical:function(lst,_101,_102,end){ |
| 752 | if(typeof (end)=="undefined"||end===null){ | 688 | if(typeof (end)=="undefined"||end===null){ |
| 753 | end=lst.length; | 689 | end=lst.length; |
| 754 | } | 690 | } |
| 755 | -if(typeof (_111)=="undefined"||_111===null){ | ||
| 756 | -_111=0; | ||
| 757 | -} | ||
| 758 | -for(var i=_111;i<end;i++){ | ||
| 759 | -if(lst[i]===_110){ | 691 | +for(var i=(_102||0);i<end;i++){ |
| 692 | +if(lst[i]===_101){ | ||
| 760 | return i; | 693 | return i; |
| 761 | } | 694 | } |
| 762 | } | 695 | } |
| 763 | return -1; | 696 | return -1; |
| 764 | -},mean:function(){ | ||
| 765 | -var sum=0; | ||
| 766 | -var m=MochiKit.Base; | ||
| 767 | -var args=m.extend(null,arguments); | ||
| 768 | -var _115=args.length; | ||
| 769 | -while(args.length){ | ||
| 770 | -var o=args.shift(); | ||
| 771 | -if(o&&typeof (o)=="object"&&typeof (o.length)=="number"){ | ||
| 772 | -_115+=o.length-1; | ||
| 773 | -for(var i=o.length-1;i>=0;i--){ | ||
| 774 | -sum+=o[i]; | ||
| 775 | -} | ||
| 776 | -}else{ | ||
| 777 | -sum+=o; | ||
| 778 | -} | ||
| 779 | -} | ||
| 780 | -if(_115<=0){ | ||
| 781 | -throw new TypeError("mean() requires at least one argument"); | ||
| 782 | -} | ||
| 783 | -return sum/_115; | ||
| 784 | -},median:function(){ | ||
| 785 | -var data=MochiKit.Base.flattenArguments(arguments); | ||
| 786 | -if(data.length===0){ | ||
| 787 | -throw new TypeError("median() requires at least one argument"); | ||
| 788 | -} | ||
| 789 | -data.sort(compare); | ||
| 790 | -if(data.length%2==0){ | ||
| 791 | -var _117=data.length/2; | ||
| 792 | -return (data[_117]+data[_117-1])/2; | ||
| 793 | -}else{ | ||
| 794 | -return data[(data.length-1)/2]; | ||
| 795 | -} | ||
| 796 | -},findValue:function(lst,_118,_119,end){ | 697 | +},findValue:function(lst,_104,_105,end){ |
| 797 | if(typeof (end)=="undefined"||end===null){ | 698 | if(typeof (end)=="undefined"||end===null){ |
| 798 | end=lst.length; | 699 | end=lst.length; |
| 799 | } | 700 | } |
| 800 | -if(typeof (_119)=="undefined"||_119===null){ | ||
| 801 | -_119=0; | ||
| 802 | -} | ||
| 803 | var cmp=MochiKit.Base.compare; | 701 | var cmp=MochiKit.Base.compare; |
| 804 | -for(var i=_119;i<end;i++){ | ||
| 805 | -if(cmp(lst[i],_118)===0){ | 702 | +for(var i=(_105||0);i<end;i++){ |
| 703 | +if(cmp(lst[i],_104)===0){ | ||
| 806 | return i; | 704 | return i; |
| 807 | } | 705 | } |
| 808 | } | 706 | } |
| 809 | return -1; | 707 | return -1; |
| 810 | -},nodeWalk:function(node,_121){ | ||
| 811 | -var _122=[node]; | ||
| 812 | -var _123=MochiKit.Base.extend; | ||
| 813 | -while(_122.length){ | ||
| 814 | -var res=_121(_122.shift()); | 708 | +},nodeWalk:function(node,_107){ |
| 709 | +var _108=[node]; | ||
| 710 | +var _109=MochiKit.Base.extend; | ||
| 711 | +while(_108.length){ | ||
| 712 | +var res=_107(_108.shift()); | ||
| 815 | if(res){ | 713 | if(res){ |
| 816 | -_123(_122,res); | 714 | +_109(_108,res); |
| 817 | } | 715 | } |
| 818 | } | 716 | } |
| 819 | -},nameFunctions:function(_124){ | ||
| 820 | -var base=_124.NAME; | 717 | +},nameFunctions:function(_110){ |
| 718 | +var base=_110.NAME; | ||
| 821 | if(typeof (base)=="undefined"){ | 719 | if(typeof (base)=="undefined"){ |
| 822 | base=""; | 720 | base=""; |
| 823 | }else{ | 721 | }else{ |
| 824 | base=base+"."; | 722 | base=base+"."; |
| 825 | } | 723 | } |
| 826 | -for(var name in _124){ | ||
| 827 | -var o=_124[name]; | 724 | +for(var name in _110){ |
| 725 | +var o=_110[name]; | ||
| 828 | if(typeof (o)=="function"&&typeof (o.NAME)=="undefined"){ | 726 | if(typeof (o)=="function"&&typeof (o.NAME)=="undefined"){ |
| 829 | try{ | 727 | try{ |
| 830 | o.NAME=base+name; | 728 | o.NAME=base+name; |
| @@ -833,78 +731,59 @@ catch(e){ | @@ -833,78 +731,59 @@ catch(e){ | ||
| 833 | } | 731 | } |
| 834 | } | 732 | } |
| 835 | } | 733 | } |
| 836 | -},queryString:function(_127,_128){ | ||
| 837 | -if(typeof (MochiKit.DOM)!="undefined"&&arguments.length==1&&(typeof (_127)=="string"||(typeof (_127.nodeType)!="undefined"&&_127.nodeType>0))){ | ||
| 838 | -var kv=MochiKit.DOM.formContents(_127); | ||
| 839 | -_127=kv[0]; | ||
| 840 | -_128=kv[1]; | 734 | +},queryString:function(_113,_114){ |
| 735 | +if(typeof (MochiKit.DOM)!="undefined"&&arguments.length==1&&(typeof (_113)=="string"||(typeof (_113.nodeType)!="undefined"&&_113.nodeType>0))){ | ||
| 736 | +var kv=MochiKit.DOM.formContents(_113); | ||
| 737 | +_113=kv[0]; | ||
| 738 | +_114=kv[1]; | ||
| 841 | }else{ | 739 | }else{ |
| 842 | if(arguments.length==1){ | 740 | if(arguments.length==1){ |
| 843 | -if(typeof (_127.length)=="number"&&_127.length==2){ | ||
| 844 | -return arguments.callee(_127[0],_127[1]); | ||
| 845 | -} | ||
| 846 | -var o=_127; | ||
| 847 | -_127=[]; | ||
| 848 | -_128=[]; | 741 | +var o=_113; |
| 742 | +_113=[]; | ||
| 743 | +_114=[]; | ||
| 849 | for(var k in o){ | 744 | for(var k in o){ |
| 850 | var v=o[k]; | 745 | var v=o[k]; |
| 851 | -if(typeof (v)=="function"){ | ||
| 852 | -continue; | ||
| 853 | -}else{ | ||
| 854 | -if(typeof (v)!="string"&&typeof (v.length)=="number"){ | ||
| 855 | -for(var i=0;i<v.length;i++){ | ||
| 856 | -_127.push(k); | ||
| 857 | -_128.push(v[i]); | ||
| 858 | -} | ||
| 859 | -}else{ | ||
| 860 | -_127.push(k); | ||
| 861 | -_128.push(v); | ||
| 862 | -} | 746 | +if(typeof (v)!="function"){ |
| 747 | +_113.push(k); | ||
| 748 | +_114.push(v); | ||
| 863 | } | 749 | } |
| 864 | } | 750 | } |
| 865 | } | 751 | } |
| 866 | } | 752 | } |
| 867 | var rval=[]; | 753 | var rval=[]; |
| 868 | -var len=Math.min(_127.length,_128.length); | ||
| 869 | -var _131=MochiKit.Base.urlEncode; | 754 | +var len=Math.min(_113.length,_114.length); |
| 755 | +var _118=MochiKit.Base.urlEncode; | ||
| 870 | for(var i=0;i<len;i++){ | 756 | for(var i=0;i<len;i++){ |
| 871 | -v=_128[i]; | 757 | +v=_114[i]; |
| 872 | if(typeof (v)!="undefined"&&v!==null){ | 758 | if(typeof (v)!="undefined"&&v!==null){ |
| 873 | -rval.push(_131(_127[i])+"="+_131(v)); | 759 | +rval.push(_118(_113[i])+"="+_118(v)); |
| 874 | } | 760 | } |
| 875 | } | 761 | } |
| 876 | return rval.join("&"); | 762 | return rval.join("&"); |
| 877 | -},parseQueryString:function(_132,_133){ | ||
| 878 | -var qstr=(_132.charAt(0)=="?")?_132.substring(1):_132; | ||
| 879 | -var _135=qstr.replace(/\+/g,"%20").split(/(\&\;|\&\#38\;|\&|\&)/); | 763 | +},parseQueryString:function(_119,_120){ |
| 764 | +var _121=_119.replace(/\+/g,"%20").split("&"); | ||
| 880 | var o={}; | 765 | var o={}; |
| 881 | -var _136; | 766 | +var _122; |
| 882 | if(typeof (decodeURIComponent)!="undefined"){ | 767 | if(typeof (decodeURIComponent)!="undefined"){ |
| 883 | -_136=decodeURIComponent; | 768 | +_122=decodeURIComponent; |
| 884 | }else{ | 769 | }else{ |
| 885 | -_136=unescape; | 770 | +_122=unescape; |
| 886 | } | 771 | } |
| 887 | -if(_133){ | ||
| 888 | -for(var i=0;i<_135.length;i++){ | ||
| 889 | -var pair=_135[i].split("="); | ||
| 890 | -if(pair.length!==2){ | ||
| 891 | -continue; | ||
| 892 | -} | ||
| 893 | -var name=_136(pair[0]); | 772 | +if(_120){ |
| 773 | +for(var i=0;i<_121.length;i++){ | ||
| 774 | +var pair=_121[i].split("="); | ||
| 775 | +var name=_122(pair[0]); | ||
| 894 | var arr=o[name]; | 776 | var arr=o[name]; |
| 895 | if(!(arr instanceof Array)){ | 777 | if(!(arr instanceof Array)){ |
| 896 | arr=[]; | 778 | arr=[]; |
| 897 | o[name]=arr; | 779 | o[name]=arr; |
| 898 | } | 780 | } |
| 899 | -arr.push(_136(pair[1])); | 781 | +arr.push(_122(pair[1])); |
| 900 | } | 782 | } |
| 901 | }else{ | 783 | }else{ |
| 902 | -for(i=0;i<_135.length;i++){ | ||
| 903 | -pair=_135[i].split("="); | ||
| 904 | -if(pair.length!==2){ | ||
| 905 | -continue; | ||
| 906 | -} | ||
| 907 | -o[_136(pair[0])]=_136(pair[1]); | 784 | +for(i=0;i<_121.length;i++){ |
| 785 | +pair=_121[i].split("="); | ||
| 786 | +o[_122(pair[0])]=_122(pair[1]); | ||
| 908 | } | 787 | } |
| 909 | } | 788 | } |
| 910 | return o; | 789 | return o; |
| @@ -912,11 +791,11 @@ return o; | @@ -912,11 +791,11 @@ return o; | ||
| 912 | MochiKit.Base.AdapterRegistry=function(){ | 791 | MochiKit.Base.AdapterRegistry=function(){ |
| 913 | this.pairs=[]; | 792 | this.pairs=[]; |
| 914 | }; | 793 | }; |
| 915 | -MochiKit.Base.AdapterRegistry.prototype={register:function(name,_138,wrap,_140){ | ||
| 916 | -if(_140){ | ||
| 917 | -this.pairs.unshift([name,_138,wrap]); | 794 | +MochiKit.Base.AdapterRegistry.prototype={register:function(name,_124,wrap,_126){ |
| 795 | +if(_126){ | ||
| 796 | +this.pairs.unshift([name,_124,wrap]); | ||
| 918 | }else{ | 797 | }else{ |
| 919 | -this.pairs.push([name,_138,wrap]); | 798 | +this.pairs.push([name,_124,wrap]); |
| 920 | } | 799 | } |
| 921 | },match:function(){ | 800 | },match:function(){ |
| 922 | for(var i=0;i<this.pairs.length;i++){ | 801 | for(var i=0;i<this.pairs.length;i++){ |
| @@ -936,29 +815,31 @@ return true; | @@ -936,29 +815,31 @@ return true; | ||
| 936 | } | 815 | } |
| 937 | return false; | 816 | return false; |
| 938 | }}; | 817 | }}; |
| 939 | -MochiKit.Base.EXPORT=["flattenArray","noop","camelize","counter","clone","extend","update","updatetree","setdefault","keys","values","items","NamedError","operator","forwardCall","itemgetter","typeMatcher","isCallable","isUndefined","isUndefinedOrNull","isNull","isEmpty","isNotEmpty","isArrayLike","isDateLike","xmap","map","xfilter","filter","methodcaller","compose","bind","bindMethods","NotFound","AdapterRegistry","registerComparator","compare","registerRepr","repr","objEqual","arrayEqual","concat","keyComparator","reverseKeyComparator","partial","merge","listMinMax","listMax","listMin","objMax","objMin","nodeWalk","zip","urlEncode","queryString","serializeJSON","registerJSON","evalJSON","parseQueryString","findValue","findIdentical","flattenArguments","method","average","mean","median"]; | 818 | +MochiKit.Base.EXPORT=["counter","clone","extend","update","updatetree","setdefault","keys","items","NamedError","operator","forwardCall","itemgetter","typeMatcher","isCallable","isUndefined","isUndefinedOrNull","isNull","isEmpty","isNotEmpty","isArrayLike","isDateLike","xmap","map","xfilter","filter","bind","bindMethods","NotFound","AdapterRegistry","registerComparator","compare","registerRepr","repr","objEqual","arrayEqual","concat","keyComparator","reverseKeyComparator","partial","merge","listMinMax","listMax","listMin","objMax","objMin","nodeWalk","zip","urlEncode","queryString","serializeJSON","registerJSON","evalJSON","parseQueryString","findValue","findIdentical","flattenArguments","method"]; |
| 940 | MochiKit.Base.EXPORT_OK=["nameFunctions","comparatorRegistry","reprRegistry","jsonRegistry","compareDateLike","compareArrayLike","reprArrayLike","reprString","reprNumber"]; | 819 | MochiKit.Base.EXPORT_OK=["nameFunctions","comparatorRegistry","reprRegistry","jsonRegistry","compareDateLike","compareArrayLike","reprArrayLike","reprString","reprNumber"]; |
| 941 | -MochiKit.Base._exportSymbols=function(_141,_142){ | 820 | +MochiKit.Base._exportSymbols=function(_127,_128){ |
| 821 | +if(typeof (MochiKit.__export__)=="undefined"){ | ||
| 822 | +MochiKit.__export__=(MochiKit.__compat__||(typeof (JSAN)=="undefined"&&typeof (dojo)=="undefined")); | ||
| 823 | +} | ||
| 942 | if(!MochiKit.__export__){ | 824 | if(!MochiKit.__export__){ |
| 943 | return; | 825 | return; |
| 944 | } | 826 | } |
| 945 | -var all=_142.EXPORT_TAGS[":all"]; | 827 | +var all=_128.EXPORT_TAGS[":all"]; |
| 946 | for(var i=0;i<all.length;i++){ | 828 | for(var i=0;i<all.length;i++){ |
| 947 | -_141[all[i]]=_142[all[i]]; | 829 | +_127[all[i]]=_128[all[i]]; |
| 948 | } | 830 | } |
| 949 | }; | 831 | }; |
| 950 | MochiKit.Base.__new__=function(){ | 832 | MochiKit.Base.__new__=function(){ |
| 951 | var m=this; | 833 | var m=this; |
| 952 | -m.noop=m.operator.identity; | ||
| 953 | m.forward=m.forwardCall; | 834 | m.forward=m.forwardCall; |
| 954 | m.find=m.findValue; | 835 | m.find=m.findValue; |
| 955 | if(typeof (encodeURIComponent)!="undefined"){ | 836 | if(typeof (encodeURIComponent)!="undefined"){ |
| 956 | -m.urlEncode=function(_144){ | ||
| 957 | -return encodeURIComponent(_144).replace(/\'/g,"%27"); | 837 | +m.urlEncode=function(_130){ |
| 838 | +return encodeURIComponent(_130).replace(/\'/g,"%27"); | ||
| 958 | }; | 839 | }; |
| 959 | }else{ | 840 | }else{ |
| 960 | -m.urlEncode=function(_145){ | ||
| 961 | -return escape(_145).replace(/\+/g,"%2B").replace(/\"/g,"%22").rval.replace(/\'/g,"%27"); | 841 | +m.urlEncode=function(_131){ |
| 842 | +return escape(_131).replace(/\+/g,"%2B").replace(/\"/g,"%22").rval.replace(/\'/g,"%27"); | ||
| 962 | }; | 843 | }; |
| 963 | } | 844 | } |
| 964 | m.NamedError=function(name){ | 845 | m.NamedError=function(name){ |
| @@ -980,7 +861,6 @@ m.isCallable=m.typeMatcher("function"); | @@ -980,7 +861,6 @@ m.isCallable=m.typeMatcher("function"); | ||
| 980 | m.isUndefined=m.typeMatcher("undefined"); | 861 | m.isUndefined=m.typeMatcher("undefined"); |
| 981 | m.merge=m.partial(m.update,null); | 862 | m.merge=m.partial(m.update,null); |
| 982 | m.zip=m.partial(m.map,null); | 863 | m.zip=m.partial(m.map,null); |
| 983 | -m.average=m.mean; | ||
| 984 | m.comparatorRegistry=new m.AdapterRegistry(); | 864 | m.comparatorRegistry=new m.AdapterRegistry(); |
| 985 | m.registerComparator("dateLike",m.isDateLike,m.compareDateLike); | 865 | m.registerComparator("dateLike",m.isDateLike,m.compareDateLike); |
| 986 | m.registerComparator("arrayLike",m.isArrayLike,m.compareArrayLike); | 866 | m.registerComparator("arrayLike",m.isArrayLike,m.compareArrayLike); |
| @@ -994,10 +874,8 @@ m.EXPORT_TAGS={":common":m.concat(m.EXPORT_OK),":all":all}; | @@ -994,10 +874,8 @@ m.EXPORT_TAGS={":common":m.concat(m.EXPORT_OK),":all":all}; | ||
| 994 | m.nameFunctions(this); | 874 | m.nameFunctions(this); |
| 995 | }; | 875 | }; |
| 996 | MochiKit.Base.__new__(); | 876 | MochiKit.Base.__new__(); |
| 997 | -if(MochiKit.__export__){ | 877 | +if(!MochiKit.__compat__){ |
| 998 | compare=MochiKit.Base.compare; | 878 | compare=MochiKit.Base.compare; |
| 999 | -compose=MochiKit.Base.compose; | ||
| 1000 | -serializeJSON=MochiKit.Base.serializeJSON; | ||
| 1001 | } | 879 | } |
| 1002 | MochiKit.Base._exportSymbols(this,MochiKit.Base); | 880 | MochiKit.Base._exportSymbols(this,MochiKit.Base); |
| 1003 | if(typeof (dojo)!="undefined"){ | 881 | if(typeof (dojo)!="undefined"){ |
| @@ -1019,34 +897,34 @@ if(typeof (MochiKit.Iter)=="undefined"){ | @@ -1019,34 +897,34 @@ if(typeof (MochiKit.Iter)=="undefined"){ | ||
| 1019 | MochiKit.Iter={}; | 897 | MochiKit.Iter={}; |
| 1020 | } | 898 | } |
| 1021 | MochiKit.Iter.NAME="MochiKit.Iter"; | 899 | MochiKit.Iter.NAME="MochiKit.Iter"; |
| 1022 | -MochiKit.Iter.VERSION="1.4"; | 900 | +MochiKit.Iter.VERSION="1.3.1"; |
| 1023 | MochiKit.Base.update(MochiKit.Iter,{__repr__:function(){ | 901 | MochiKit.Base.update(MochiKit.Iter,{__repr__:function(){ |
| 1024 | return "["+this.NAME+" "+this.VERSION+"]"; | 902 | return "["+this.NAME+" "+this.VERSION+"]"; |
| 1025 | },toString:function(){ | 903 | },toString:function(){ |
| 1026 | return this.__repr__(); | 904 | return this.__repr__(); |
| 1027 | -},registerIteratorFactory:function(name,_146,_147,_148){ | ||
| 1028 | -MochiKit.Iter.iteratorRegistry.register(name,_146,_147,_148); | ||
| 1029 | -},iter:function(_149,_150){ | 905 | +},registerIteratorFactory:function(name,_132,_133,_134){ |
| 906 | +MochiKit.Iter.iteratorRegistry.register(name,_132,_133,_134); | ||
| 907 | +},iter:function(_135,_136){ | ||
| 1030 | var self=MochiKit.Iter; | 908 | var self=MochiKit.Iter; |
| 1031 | if(arguments.length==2){ | 909 | if(arguments.length==2){ |
| 1032 | return self.takewhile(function(a){ | 910 | return self.takewhile(function(a){ |
| 1033 | -return a!=_150; | ||
| 1034 | -},_149); | 911 | +return a!=_136; |
| 912 | +},_135); | ||
| 1035 | } | 913 | } |
| 1036 | -if(typeof (_149.next)=="function"){ | ||
| 1037 | -return _149; | 914 | +if(typeof (_135.next)=="function"){ |
| 915 | +return _135; | ||
| 1038 | }else{ | 916 | }else{ |
| 1039 | -if(typeof (_149.iter)=="function"){ | ||
| 1040 | -return _149.iter(); | 917 | +if(typeof (_135.iter)=="function"){ |
| 918 | +return _135.iter(); | ||
| 1041 | } | 919 | } |
| 1042 | } | 920 | } |
| 1043 | try{ | 921 | try{ |
| 1044 | -return self.iteratorRegistry.match(_149); | 922 | +return self.iteratorRegistry.match(_135); |
| 1045 | } | 923 | } |
| 1046 | catch(e){ | 924 | catch(e){ |
| 1047 | var m=MochiKit.Base; | 925 | var m=MochiKit.Base; |
| 1048 | if(e==m.NotFound){ | 926 | if(e==m.NotFound){ |
| 1049 | -e=new TypeError(typeof (_149)+": "+m.repr(_149)+" is not iterable"); | 927 | +e=new TypeError(typeof (_135)+": "+m.repr(_135)+" is not iterable"); |
| 1050 | } | 928 | } |
| 1051 | throw e; | 929 | throw e; |
| 1052 | } | 930 | } |
| @@ -1062,12 +940,12 @@ return "count("+n+")"; | @@ -1062,12 +940,12 @@ return "count("+n+")"; | ||
| 1062 | var self=MochiKit.Iter; | 940 | var self=MochiKit.Iter; |
| 1063 | var m=MochiKit.Base; | 941 | var m=MochiKit.Base; |
| 1064 | var lst=[]; | 942 | var lst=[]; |
| 1065 | -var _153=self.iter(p); | 943 | +var _139=self.iter(p); |
| 1066 | return {repr:function(){ | 944 | return {repr:function(){ |
| 1067 | return "cycle(...)"; | 945 | return "cycle(...)"; |
| 1068 | },toString:m.forwardCall("repr"),next:function(){ | 946 | },toString:m.forwardCall("repr"),next:function(){ |
| 1069 | try{ | 947 | try{ |
| 1070 | -var rval=_153.next(); | 948 | +var rval=_139.next(); |
| 1071 | lst.push(rval); | 949 | lst.push(rval); |
| 1072 | return rval; | 950 | return rval; |
| 1073 | } | 951 | } |
| @@ -1107,17 +985,16 @@ throw MochiKit.Iter.StopIteration; | @@ -1107,17 +985,16 @@ throw MochiKit.Iter.StopIteration; | ||
| 1107 | n-=1; | 985 | n-=1; |
| 1108 | return elem; | 986 | return elem; |
| 1109 | }}; | 987 | }}; |
| 1110 | -},next:function(_155){ | ||
| 1111 | -return _155.next(); | 988 | +},next:function(_141){ |
| 989 | +return _141.next(); | ||
| 1112 | },izip:function(p,q){ | 990 | },izip:function(p,q){ |
| 1113 | var m=MochiKit.Base; | 991 | var m=MochiKit.Base; |
| 1114 | -var self=MochiKit.Iter; | ||
| 1115 | -var next=self.next; | ||
| 1116 | -var _158=m.map(self.iter,arguments); | 992 | +var next=MochiKit.Iter.next; |
| 993 | +var _144=m.map(iter,arguments); | ||
| 1117 | return {repr:function(){ | 994 | return {repr:function(){ |
| 1118 | return "izip(...)"; | 995 | return "izip(...)"; |
| 1119 | },toString:m.forwardCall("repr"),next:function(){ | 996 | },toString:m.forwardCall("repr"),next:function(){ |
| 1120 | -return m.map(next,_158); | 997 | +return m.map(next,_144); |
| 1121 | }}; | 998 | }}; |
| 1122 | },ifilter:function(pred,seq){ | 999 | },ifilter:function(pred,seq){ |
| 1123 | var m=MochiKit.Base; | 1000 | var m=MochiKit.Base; |
| @@ -1157,7 +1034,7 @@ return undefined; | @@ -1157,7 +1034,7 @@ return undefined; | ||
| 1157 | var self=MochiKit.Iter; | 1034 | var self=MochiKit.Iter; |
| 1158 | var m=MochiKit.Base; | 1035 | var m=MochiKit.Base; |
| 1159 | seq=self.iter(seq); | 1036 | seq=self.iter(seq); |
| 1160 | -var _161=0; | 1037 | +var _147=0; |
| 1161 | var stop=0; | 1038 | var stop=0; |
| 1162 | var step=1; | 1039 | var step=1; |
| 1163 | var i=-1; | 1040 | var i=-1; |
| @@ -1165,38 +1042,38 @@ if(arguments.length==2){ | @@ -1165,38 +1042,38 @@ if(arguments.length==2){ | ||
| 1165 | stop=arguments[1]; | 1042 | stop=arguments[1]; |
| 1166 | }else{ | 1043 | }else{ |
| 1167 | if(arguments.length==3){ | 1044 | if(arguments.length==3){ |
| 1168 | -_161=arguments[1]; | 1045 | +_147=arguments[1]; |
| 1169 | stop=arguments[2]; | 1046 | stop=arguments[2]; |
| 1170 | }else{ | 1047 | }else{ |
| 1171 | -_161=arguments[1]; | 1048 | +_147=arguments[1]; |
| 1172 | stop=arguments[2]; | 1049 | stop=arguments[2]; |
| 1173 | step=arguments[3]; | 1050 | step=arguments[3]; |
| 1174 | } | 1051 | } |
| 1175 | } | 1052 | } |
| 1176 | return {repr:function(){ | 1053 | return {repr:function(){ |
| 1177 | -return "islice("+["...",_161,stop,step].join(", ")+")"; | 1054 | +return "islice("+["...",_147,stop,step].join(", ")+")"; |
| 1178 | },toString:m.forwardCall("repr"),next:function(){ | 1055 | },toString:m.forwardCall("repr"),next:function(){ |
| 1179 | var rval; | 1056 | var rval; |
| 1180 | -while(i<_161){ | 1057 | +while(i<_147){ |
| 1181 | rval=seq.next(); | 1058 | rval=seq.next(); |
| 1182 | i++; | 1059 | i++; |
| 1183 | } | 1060 | } |
| 1184 | -if(_161>=stop){ | 1061 | +if(_147>=stop){ |
| 1185 | throw self.StopIteration; | 1062 | throw self.StopIteration; |
| 1186 | } | 1063 | } |
| 1187 | -_161+=step; | 1064 | +_147+=step; |
| 1188 | return rval; | 1065 | return rval; |
| 1189 | }}; | 1066 | }}; |
| 1190 | },imap:function(fun,p,q){ | 1067 | },imap:function(fun,p,q){ |
| 1191 | var m=MochiKit.Base; | 1068 | var m=MochiKit.Base; |
| 1192 | var self=MochiKit.Iter; | 1069 | var self=MochiKit.Iter; |
| 1193 | -var _165=m.map(self.iter,m.extend(null,arguments,1)); | 1070 | +var _151=m.map(self.iter,m.extend(null,arguments,1)); |
| 1194 | var map=m.map; | 1071 | var map=m.map; |
| 1195 | var next=self.next; | 1072 | var next=self.next; |
| 1196 | return {repr:function(){ | 1073 | return {repr:function(){ |
| 1197 | return "imap(...)"; | 1074 | return "imap(...)"; |
| 1198 | },toString:m.forwardCall("repr"),next:function(){ | 1075 | },toString:m.forwardCall("repr"),next:function(){ |
| 1199 | -return fun.apply(this,map(next,_165)); | 1076 | +return fun.apply(this,map(next,_151)); |
| 1200 | }}; | 1077 | }}; |
| 1201 | },applymap:function(fun,seq,self){ | 1078 | },applymap:function(fun,seq,self){ |
| 1202 | seq=MochiKit.Iter.iter(seq); | 1079 | seq=MochiKit.Iter.iter(seq); |
| @@ -1212,23 +1089,23 @@ var m=MochiKit.Base; | @@ -1212,23 +1089,23 @@ var m=MochiKit.Base; | ||
| 1212 | if(arguments.length==1){ | 1089 | if(arguments.length==1){ |
| 1213 | return self.iter(arguments[0]); | 1090 | return self.iter(arguments[0]); |
| 1214 | } | 1091 | } |
| 1215 | -var _167=m.map(self.iter,arguments); | 1092 | +var _153=m.map(self.iter,arguments); |
| 1216 | return {repr:function(){ | 1093 | return {repr:function(){ |
| 1217 | return "chain(...)"; | 1094 | return "chain(...)"; |
| 1218 | },toString:m.forwardCall("repr"),next:function(){ | 1095 | },toString:m.forwardCall("repr"),next:function(){ |
| 1219 | -while(_167.length>1){ | 1096 | +while(_153.length>1){ |
| 1220 | try{ | 1097 | try{ |
| 1221 | -return _167[0].next(); | 1098 | +return _153[0].next(); |
| 1222 | } | 1099 | } |
| 1223 | catch(e){ | 1100 | catch(e){ |
| 1224 | if(e!=self.StopIteration){ | 1101 | if(e!=self.StopIteration){ |
| 1225 | throw e; | 1102 | throw e; |
| 1226 | } | 1103 | } |
| 1227 | -_167.shift(); | 1104 | +_153.shift(); |
| 1228 | } | 1105 | } |
| 1229 | } | 1106 | } |
| 1230 | -if(_167.length==1){ | ||
| 1231 | -var arg=_167.shift(); | 1107 | +if(_153.length==1){ |
| 1108 | +var arg=_153.shift(); | ||
| 1232 | this.next=m.bind("next",arg); | 1109 | this.next=m.bind("next",arg); |
| 1233 | return this.next(); | 1110 | return this.next(); |
| 1234 | } | 1111 | } |
| @@ -1265,58 +1142,58 @@ break; | @@ -1265,58 +1142,58 @@ break; | ||
| 1265 | this.next=bind("next",seq); | 1142 | this.next=bind("next",seq); |
| 1266 | return rval; | 1143 | return rval; |
| 1267 | }}; | 1144 | }}; |
| 1268 | -},_tee:function(_169,sync,_171){ | ||
| 1269 | -sync.pos[_169]=-1; | 1145 | +},_tee:function(_155,sync,_157){ |
| 1146 | +sync.pos[_155]=-1; | ||
| 1270 | var m=MochiKit.Base; | 1147 | var m=MochiKit.Base; |
| 1271 | -var _172=m.listMin; | 1148 | +var _158=m.listMin; |
| 1272 | return {repr:function(){ | 1149 | return {repr:function(){ |
| 1273 | -return "tee("+_169+", ...)"; | 1150 | +return "tee("+_155+", ...)"; |
| 1274 | },toString:m.forwardCall("repr"),next:function(){ | 1151 | },toString:m.forwardCall("repr"),next:function(){ |
| 1275 | var rval; | 1152 | var rval; |
| 1276 | -var i=sync.pos[_169]; | 1153 | +var i=sync.pos[_155]; |
| 1277 | if(i==sync.max){ | 1154 | if(i==sync.max){ |
| 1278 | -rval=_171.next(); | 1155 | +rval=_157.next(); |
| 1279 | sync.deque.push(rval); | 1156 | sync.deque.push(rval); |
| 1280 | sync.max+=1; | 1157 | sync.max+=1; |
| 1281 | -sync.pos[_169]+=1; | 1158 | +sync.pos[_155]+=1; |
| 1282 | }else{ | 1159 | }else{ |
| 1283 | rval=sync.deque[i-sync.min]; | 1160 | rval=sync.deque[i-sync.min]; |
| 1284 | -sync.pos[_169]+=1; | ||
| 1285 | -if(i==sync.min&&_172(sync.pos)!=sync.min){ | 1161 | +sync.pos[_155]+=1; |
| 1162 | +if(i==sync.min&&_158(sync.pos)!=sync.min){ | ||
| 1286 | sync.min+=1; | 1163 | sync.min+=1; |
| 1287 | sync.deque.shift(); | 1164 | sync.deque.shift(); |
| 1288 | } | 1165 | } |
| 1289 | } | 1166 | } |
| 1290 | return rval; | 1167 | return rval; |
| 1291 | }}; | 1168 | }}; |
| 1292 | -},tee:function(_173,n){ | 1169 | +},tee:function(_159,n){ |
| 1293 | var rval=[]; | 1170 | var rval=[]; |
| 1294 | var sync={"pos":[],"deque":[],"max":-1,"min":-1}; | 1171 | var sync={"pos":[],"deque":[],"max":-1,"min":-1}; |
| 1295 | -if(arguments.length==1||typeof (n)=="undefined"||n===null){ | 1172 | +if(arguments.length==1){ |
| 1296 | n=2; | 1173 | n=2; |
| 1297 | } | 1174 | } |
| 1298 | var self=MochiKit.Iter; | 1175 | var self=MochiKit.Iter; |
| 1299 | -_173=self.iter(_173); | 1176 | +_159=self.iter(_159); |
| 1300 | var _tee=self._tee; | 1177 | var _tee=self._tee; |
| 1301 | for(var i=0;i<n;i++){ | 1178 | for(var i=0;i<n;i++){ |
| 1302 | -rval.push(_tee(i,sync,_173)); | 1179 | +rval.push(_tee(i,sync,_159)); |
| 1303 | } | 1180 | } |
| 1304 | return rval; | 1181 | return rval; |
| 1305 | -},list:function(_175){ | 1182 | +},list:function(_161){ |
| 1306 | var m=MochiKit.Base; | 1183 | var m=MochiKit.Base; |
| 1307 | -if(typeof (_175.slice)=="function"){ | ||
| 1308 | -return _175.slice(); | 1184 | +if(typeof (_161.slice)=="function"){ |
| 1185 | +return _161.slice(); | ||
| 1309 | }else{ | 1186 | }else{ |
| 1310 | -if(m.isArrayLike(_175)){ | ||
| 1311 | -return m.concat(_175); | 1187 | +if(m.isArrayLike(_161)){ |
| 1188 | +return m.concat(_161); | ||
| 1312 | } | 1189 | } |
| 1313 | } | 1190 | } |
| 1314 | var self=MochiKit.Iter; | 1191 | var self=MochiKit.Iter; |
| 1315 | -_175=self.iter(_175); | 1192 | +_161=self.iter(_161); |
| 1316 | var rval=[]; | 1193 | var rval=[]; |
| 1317 | try{ | 1194 | try{ |
| 1318 | while(true){ | 1195 | while(true){ |
| 1319 | -rval.push(_175.next()); | 1196 | +rval.push(_161.next()); |
| 1320 | } | 1197 | } |
| 1321 | } | 1198 | } |
| 1322 | catch(e){ | 1199 | catch(e){ |
| @@ -1326,14 +1203,14 @@ throw e; | @@ -1326,14 +1203,14 @@ throw e; | ||
| 1326 | return rval; | 1203 | return rval; |
| 1327 | } | 1204 | } |
| 1328 | return undefined; | 1205 | return undefined; |
| 1329 | -},reduce:function(fn,_176,_177){ | 1206 | +},reduce:function(fn,_162,_163){ |
| 1330 | var i=0; | 1207 | var i=0; |
| 1331 | -var x=_177; | 1208 | +var x=_163; |
| 1332 | var self=MochiKit.Iter; | 1209 | var self=MochiKit.Iter; |
| 1333 | -_176=self.iter(_176); | 1210 | +_162=self.iter(_162); |
| 1334 | if(arguments.length<3){ | 1211 | if(arguments.length<3){ |
| 1335 | try{ | 1212 | try{ |
| 1336 | -x=_176.next(); | 1213 | +x=_162.next(); |
| 1337 | } | 1214 | } |
| 1338 | catch(e){ | 1215 | catch(e){ |
| 1339 | if(e==self.StopIteration){ | 1216 | if(e==self.StopIteration){ |
| @@ -1345,7 +1222,7 @@ i++; | @@ -1345,7 +1222,7 @@ i++; | ||
| 1345 | } | 1222 | } |
| 1346 | try{ | 1223 | try{ |
| 1347 | while(true){ | 1224 | while(true){ |
| 1348 | -x=fn(x,_176.next()); | 1225 | +x=fn(x,_162.next()); |
| 1349 | } | 1226 | } |
| 1350 | } | 1227 | } |
| 1351 | catch(e){ | 1228 | catch(e){ |
| @@ -1355,18 +1232,18 @@ throw e; | @@ -1355,18 +1232,18 @@ throw e; | ||
| 1355 | } | 1232 | } |
| 1356 | return x; | 1233 | return x; |
| 1357 | },range:function(){ | 1234 | },range:function(){ |
| 1358 | -var _179=0; | 1235 | +var _165=0; |
| 1359 | var stop=0; | 1236 | var stop=0; |
| 1360 | var step=1; | 1237 | var step=1; |
| 1361 | if(arguments.length==1){ | 1238 | if(arguments.length==1){ |
| 1362 | stop=arguments[0]; | 1239 | stop=arguments[0]; |
| 1363 | }else{ | 1240 | }else{ |
| 1364 | if(arguments.length==2){ | 1241 | if(arguments.length==2){ |
| 1365 | -_179=arguments[0]; | 1242 | +_165=arguments[0]; |
| 1366 | stop=arguments[1]; | 1243 | stop=arguments[1]; |
| 1367 | }else{ | 1244 | }else{ |
| 1368 | if(arguments.length==3){ | 1245 | if(arguments.length==3){ |
| 1369 | -_179=arguments[0]; | 1246 | +_165=arguments[0]; |
| 1370 | stop=arguments[1]; | 1247 | stop=arguments[1]; |
| 1371 | step=arguments[2]; | 1248 | step=arguments[2]; |
| 1372 | }else{ | 1249 | }else{ |
| @@ -1378,25 +1255,22 @@ if(step===0){ | @@ -1378,25 +1255,22 @@ if(step===0){ | ||
| 1378 | throw new TypeError("range() step must not be 0"); | 1255 | throw new TypeError("range() step must not be 0"); |
| 1379 | } | 1256 | } |
| 1380 | return {next:function(){ | 1257 | return {next:function(){ |
| 1381 | -if((step>0&&_179>=stop)||(step<0&&_179<=stop)){ | 1258 | +if((step>0&&_165>=stop)||(step<0&&_165<=stop)){ |
| 1382 | throw MochiKit.Iter.StopIteration; | 1259 | throw MochiKit.Iter.StopIteration; |
| 1383 | } | 1260 | } |
| 1384 | -var rval=_179; | ||
| 1385 | -_179+=step; | 1261 | +var rval=_165; |
| 1262 | +_165+=step; | ||
| 1386 | return rval; | 1263 | return rval; |
| 1387 | },repr:function(){ | 1264 | },repr:function(){ |
| 1388 | -return "range("+[_179,stop,step].join(", ")+")"; | 1265 | +return "range("+[_165,stop,step].join(", ")+")"; |
| 1389 | },toString:MochiKit.Base.forwardCall("repr")}; | 1266 | },toString:MochiKit.Base.forwardCall("repr")}; |
| 1390 | -},sum:function(_180,_181){ | ||
| 1391 | -if(typeof (_181)=="undefined"||_181===null){ | ||
| 1392 | -_181=0; | ||
| 1393 | -} | ||
| 1394 | -var x=_181; | 1267 | +},sum:function(_166,_167){ |
| 1268 | +var x=_167||0; | ||
| 1395 | var self=MochiKit.Iter; | 1269 | var self=MochiKit.Iter; |
| 1396 | -_180=self.iter(_180); | 1270 | +_166=self.iter(_166); |
| 1397 | try{ | 1271 | try{ |
| 1398 | while(true){ | 1272 | while(true){ |
| 1399 | -x+=_180.next(); | 1273 | +x+=_166.next(); |
| 1400 | } | 1274 | } |
| 1401 | } | 1275 | } |
| 1402 | catch(e){ | 1276 | catch(e){ |
| @@ -1405,12 +1279,12 @@ throw e; | @@ -1405,12 +1279,12 @@ throw e; | ||
| 1405 | } | 1279 | } |
| 1406 | } | 1280 | } |
| 1407 | return x; | 1281 | return x; |
| 1408 | -},exhaust:function(_182){ | 1282 | +},exhaust:function(_168){ |
| 1409 | var self=MochiKit.Iter; | 1283 | var self=MochiKit.Iter; |
| 1410 | -_182=self.iter(_182); | 1284 | +_168=self.iter(_168); |
| 1411 | try{ | 1285 | try{ |
| 1412 | while(true){ | 1286 | while(true){ |
| 1413 | -_182.next(); | 1287 | +_168.next(); |
| 1414 | } | 1288 | } |
| 1415 | } | 1289 | } |
| 1416 | catch(e){ | 1290 | catch(e){ |
| @@ -1418,15 +1292,15 @@ if(e!=self.StopIteration){ | @@ -1418,15 +1292,15 @@ if(e!=self.StopIteration){ | ||
| 1418 | throw e; | 1292 | throw e; |
| 1419 | } | 1293 | } |
| 1420 | } | 1294 | } |
| 1421 | -},forEach:function(_183,func,self){ | 1295 | +},forEach:function(_169,func,self){ |
| 1422 | var m=MochiKit.Base; | 1296 | var m=MochiKit.Base; |
| 1423 | if(arguments.length>2){ | 1297 | if(arguments.length>2){ |
| 1424 | func=m.bind(func,self); | 1298 | func=m.bind(func,self); |
| 1425 | } | 1299 | } |
| 1426 | -if(m.isArrayLike(_183)){ | 1300 | +if(m.isArrayLike(_169)){ |
| 1427 | try{ | 1301 | try{ |
| 1428 | -for(var i=0;i<_183.length;i++){ | ||
| 1429 | -func(_183[i]); | 1302 | +for(var i=0;i<_169.length;i++){ |
| 1303 | +func(_169[i]); | ||
| 1430 | } | 1304 | } |
| 1431 | } | 1305 | } |
| 1432 | catch(e){ | 1306 | catch(e){ |
| @@ -1436,12 +1310,12 @@ throw e; | @@ -1436,12 +1310,12 @@ throw e; | ||
| 1436 | } | 1310 | } |
| 1437 | }else{ | 1311 | }else{ |
| 1438 | self=MochiKit.Iter; | 1312 | self=MochiKit.Iter; |
| 1439 | -self.exhaust(self.imap(func,_183)); | 1313 | +self.exhaust(self.imap(func,_169)); |
| 1440 | } | 1314 | } |
| 1441 | -},every:function(_184,func){ | 1315 | +},every:function(_171,func){ |
| 1442 | var self=MochiKit.Iter; | 1316 | var self=MochiKit.Iter; |
| 1443 | try{ | 1317 | try{ |
| 1444 | -self.ifilterfalse(func,_184).next(); | 1318 | +self.ifilterfalse(func,_171).next(); |
| 1445 | return false; | 1319 | return false; |
| 1446 | } | 1320 | } |
| 1447 | catch(e){ | 1321 | catch(e){ |
| @@ -1450,21 +1324,21 @@ throw e; | @@ -1450,21 +1324,21 @@ throw e; | ||
| 1450 | } | 1324 | } |
| 1451 | return true; | 1325 | return true; |
| 1452 | } | 1326 | } |
| 1453 | -},sorted:function(_185,cmp){ | ||
| 1454 | -var rval=MochiKit.Iter.list(_185); | 1327 | +},sorted:function(_172,cmp){ |
| 1328 | +var rval=MochiKit.Iter.list(_172); | ||
| 1455 | if(arguments.length==1){ | 1329 | if(arguments.length==1){ |
| 1456 | cmp=MochiKit.Base.compare; | 1330 | cmp=MochiKit.Base.compare; |
| 1457 | } | 1331 | } |
| 1458 | rval.sort(cmp); | 1332 | rval.sort(cmp); |
| 1459 | return rval; | 1333 | return rval; |
| 1460 | -},reversed:function(_186){ | ||
| 1461 | -var rval=MochiKit.Iter.list(_186); | 1334 | +},reversed:function(_173){ |
| 1335 | +var rval=MochiKit.Iter.list(_173); | ||
| 1462 | rval.reverse(); | 1336 | rval.reverse(); |
| 1463 | return rval; | 1337 | return rval; |
| 1464 | -},some:function(_187,func){ | 1338 | +},some:function(_174,func){ |
| 1465 | var self=MochiKit.Iter; | 1339 | var self=MochiKit.Iter; |
| 1466 | try{ | 1340 | try{ |
| 1467 | -self.ifilter(func,_187).next(); | 1341 | +self.ifilter(func,_174).next(); |
| 1468 | return true; | 1342 | return true; |
| 1469 | } | 1343 | } |
| 1470 | catch(e){ | 1344 | catch(e){ |
| @@ -1473,17 +1347,17 @@ throw e; | @@ -1473,17 +1347,17 @@ throw e; | ||
| 1473 | } | 1347 | } |
| 1474 | return false; | 1348 | return false; |
| 1475 | } | 1349 | } |
| 1476 | -},iextend:function(lst,_188){ | ||
| 1477 | -if(MochiKit.Base.isArrayLike(_188)){ | ||
| 1478 | -for(var i=0;i<_188.length;i++){ | ||
| 1479 | -lst.push(_188[i]); | 1350 | +},iextend:function(lst,_175){ |
| 1351 | +if(MochiKit.Base.isArrayLike(_175)){ | ||
| 1352 | +for(var i=0;i<_175.length;i++){ | ||
| 1353 | +lst.push(_175[i]); | ||
| 1480 | } | 1354 | } |
| 1481 | }else{ | 1355 | }else{ |
| 1482 | var self=MochiKit.Iter; | 1356 | var self=MochiKit.Iter; |
| 1483 | -_188=self.iter(_188); | 1357 | +_175=self.iter(_175); |
| 1484 | try{ | 1358 | try{ |
| 1485 | while(true){ | 1359 | while(true){ |
| 1486 | -lst.push(_188.next()); | 1360 | +lst.push(_175.next()); |
| 1487 | } | 1361 | } |
| 1488 | } | 1362 | } |
| 1489 | catch(e){ | 1363 | catch(e){ |
| @@ -1493,34 +1367,33 @@ throw e; | @@ -1493,34 +1367,33 @@ throw e; | ||
| 1493 | } | 1367 | } |
| 1494 | } | 1368 | } |
| 1495 | return lst; | 1369 | return lst; |
| 1496 | -},groupby:function(_189,_190){ | 1370 | +},groupby:function(_176,_177){ |
| 1497 | var m=MochiKit.Base; | 1371 | var m=MochiKit.Base; |
| 1498 | var self=MochiKit.Iter; | 1372 | var self=MochiKit.Iter; |
| 1499 | if(arguments.length<2){ | 1373 | if(arguments.length<2){ |
| 1500 | -_190=m.operator.identity; | 1374 | +_177=m.operator.identity; |
| 1501 | } | 1375 | } |
| 1502 | -_189=self.iter(_189); | 1376 | +_176=self.iter(_176); |
| 1503 | var pk=undefined; | 1377 | var pk=undefined; |
| 1504 | var k=undefined; | 1378 | var k=undefined; |
| 1505 | var v; | 1379 | var v; |
| 1506 | function fetch(){ | 1380 | function fetch(){ |
| 1507 | -v=_189.next(); | ||
| 1508 | -k=_190(v); | 1381 | +v=_176.next(); |
| 1382 | +k=_177(v); | ||
| 1509 | } | 1383 | } |
| 1510 | function eat(){ | 1384 | function eat(){ |
| 1511 | var ret=v; | 1385 | var ret=v; |
| 1512 | v=undefined; | 1386 | v=undefined; |
| 1513 | return ret; | 1387 | return ret; |
| 1514 | } | 1388 | } |
| 1515 | -var _193=true; | ||
| 1516 | -var _194=m.compare; | 1389 | +var _180=true; |
| 1517 | return {repr:function(){ | 1390 | return {repr:function(){ |
| 1518 | return "groupby(...)"; | 1391 | return "groupby(...)"; |
| 1519 | },next:function(){ | 1392 | },next:function(){ |
| 1520 | -while(_194(k,pk)===0){ | 1393 | +while(k==pk){ |
| 1521 | fetch(); | 1394 | fetch(); |
| 1522 | -if(_193){ | ||
| 1523 | -_193=false; | 1395 | +if(_180){ |
| 1396 | +_180=false; | ||
| 1524 | break; | 1397 | break; |
| 1525 | } | 1398 | } |
| 1526 | } | 1399 | } |
| @@ -1529,27 +1402,26 @@ return [k,{next:function(){ | @@ -1529,27 +1402,26 @@ return [k,{next:function(){ | ||
| 1529 | if(v==undefined){ | 1402 | if(v==undefined){ |
| 1530 | fetch(); | 1403 | fetch(); |
| 1531 | } | 1404 | } |
| 1532 | -if(_194(k,pk)!==0){ | 1405 | +if(k!=pk){ |
| 1533 | throw self.StopIteration; | 1406 | throw self.StopIteration; |
| 1534 | } | 1407 | } |
| 1535 | return eat(); | 1408 | return eat(); |
| 1536 | }}]; | 1409 | }}]; |
| 1537 | }}; | 1410 | }}; |
| 1538 | -},groupby_as_array:function(_195,_196){ | 1411 | +},groupby_as_array:function(_181,_182){ |
| 1539 | var m=MochiKit.Base; | 1412 | var m=MochiKit.Base; |
| 1540 | var self=MochiKit.Iter; | 1413 | var self=MochiKit.Iter; |
| 1541 | if(arguments.length<2){ | 1414 | if(arguments.length<2){ |
| 1542 | -_196=m.operator.identity; | 1415 | +_182=m.operator.identity; |
| 1543 | } | 1416 | } |
| 1544 | -_195=self.iter(_195); | ||
| 1545 | -var _197=[]; | ||
| 1546 | -var _198=true; | ||
| 1547 | -var _199; | ||
| 1548 | -var _200=m.compare; | 1417 | +_181=self.iter(_181); |
| 1418 | +var _183=[]; | ||
| 1419 | +var _184=true; | ||
| 1420 | +var _185; | ||
| 1549 | while(true){ | 1421 | while(true){ |
| 1550 | try{ | 1422 | try{ |
| 1551 | -var _201=_195.next(); | ||
| 1552 | -var key=_196(_201); | 1423 | +var _186=_181.next(); |
| 1424 | +var key=_182(_186); | ||
| 1553 | } | 1425 | } |
| 1554 | catch(e){ | 1426 | catch(e){ |
| 1555 | if(e==self.StopIteration){ | 1427 | if(e==self.StopIteration){ |
| @@ -1557,32 +1429,32 @@ break; | @@ -1557,32 +1429,32 @@ break; | ||
| 1557 | } | 1429 | } |
| 1558 | throw e; | 1430 | throw e; |
| 1559 | } | 1431 | } |
| 1560 | -if(_198||_200(key,_199)!==0){ | ||
| 1561 | -var _202=[]; | ||
| 1562 | -_197.push([key,_202]); | 1432 | +if(_184||key!=_185){ |
| 1433 | +var _187=[]; | ||
| 1434 | +_183.push([key,_187]); | ||
| 1563 | } | 1435 | } |
| 1564 | -_202.push(_201); | ||
| 1565 | -_198=false; | ||
| 1566 | -_199=key; | 1436 | +_187.push(_186); |
| 1437 | +_184=false; | ||
| 1438 | +_185=key; | ||
| 1567 | } | 1439 | } |
| 1568 | -return _197; | ||
| 1569 | -},arrayLikeIter:function(_203){ | 1440 | +return _183; |
| 1441 | +},arrayLikeIter:function(_188){ | ||
| 1570 | var i=0; | 1442 | var i=0; |
| 1571 | return {repr:function(){ | 1443 | return {repr:function(){ |
| 1572 | return "arrayLikeIter(...)"; | 1444 | return "arrayLikeIter(...)"; |
| 1573 | },toString:MochiKit.Base.forwardCall("repr"),next:function(){ | 1445 | },toString:MochiKit.Base.forwardCall("repr"),next:function(){ |
| 1574 | -if(i>=_203.length){ | 1446 | +if(i>=_188.length){ |
| 1575 | throw MochiKit.Iter.StopIteration; | 1447 | throw MochiKit.Iter.StopIteration; |
| 1576 | } | 1448 | } |
| 1577 | -return _203[i++]; | 1449 | +return _188[i++]; |
| 1578 | }}; | 1450 | }}; |
| 1579 | -},hasIterateNext:function(_204){ | ||
| 1580 | -return (_204&&typeof (_204.iterateNext)=="function"); | ||
| 1581 | -},iterateNextIter:function(_205){ | 1451 | +},hasIterateNext:function(_189){ |
| 1452 | +return (_189&&typeof (_189.iterateNext)=="function"); | ||
| 1453 | +},iterateNextIter:function(_190){ | ||
| 1582 | return {repr:function(){ | 1454 | return {repr:function(){ |
| 1583 | return "iterateNextIter(...)"; | 1455 | return "iterateNextIter(...)"; |
| 1584 | },toString:MochiKit.Base.forwardCall("repr"),next:function(){ | 1456 | },toString:MochiKit.Base.forwardCall("repr"),next:function(){ |
| 1585 | -var rval=_205.iterateNext(); | 1457 | +var rval=_190.iterateNext(); |
| 1586 | if(rval===null||rval===undefined){ | 1458 | if(rval===null||rval===undefined){ |
| 1587 | throw MochiKit.Iter.StopIteration; | 1459 | throw MochiKit.Iter.StopIteration; |
| 1588 | } | 1460 | } |
| @@ -1593,11 +1465,7 @@ MochiKit.Iter.EXPORT_OK=["iteratorRegistry","arrayLikeIter","hasIterateNext","it | @@ -1593,11 +1465,7 @@ MochiKit.Iter.EXPORT_OK=["iteratorRegistry","arrayLikeIter","hasIterateNext","it | ||
| 1593 | MochiKit.Iter.EXPORT=["StopIteration","registerIteratorFactory","iter","count","cycle","repeat","next","izip","ifilter","ifilterfalse","islice","imap","applymap","chain","takewhile","dropwhile","tee","list","reduce","range","sum","exhaust","forEach","every","sorted","reversed","some","iextend","groupby","groupby_as_array"]; | 1465 | MochiKit.Iter.EXPORT=["StopIteration","registerIteratorFactory","iter","count","cycle","repeat","next","izip","ifilter","ifilterfalse","islice","imap","applymap","chain","takewhile","dropwhile","tee","list","reduce","range","sum","exhaust","forEach","every","sorted","reversed","some","iextend","groupby","groupby_as_array"]; |
| 1594 | MochiKit.Iter.__new__=function(){ | 1466 | MochiKit.Iter.__new__=function(){ |
| 1595 | var m=MochiKit.Base; | 1467 | var m=MochiKit.Base; |
| 1596 | -if(typeof (StopIteration)!="undefined"){ | ||
| 1597 | -this.StopIteration=StopIteration; | ||
| 1598 | -}else{ | ||
| 1599 | this.StopIteration=new m.NamedError("StopIteration"); | 1468 | this.StopIteration=new m.NamedError("StopIteration"); |
| 1600 | -} | ||
| 1601 | this.iteratorRegistry=new m.AdapterRegistry(); | 1469 | this.iteratorRegistry=new m.AdapterRegistry(); |
| 1602 | this.registerIteratorFactory("arrayLike",m.isArrayLike,this.arrayLikeIter); | 1470 | this.registerIteratorFactory("arrayLike",m.isArrayLike,this.arrayLikeIter); |
| 1603 | this.registerIteratorFactory("iterateNext",this.hasIterateNext,this.iterateNextIter); | 1471 | this.registerIteratorFactory("iterateNext",this.hasIterateNext,this.iterateNextIter); |
| @@ -1605,7 +1473,7 @@ this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_ | @@ -1605,7 +1473,7 @@ this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_ | ||
| 1605 | m.nameFunctions(this); | 1473 | m.nameFunctions(this); |
| 1606 | }; | 1474 | }; |
| 1607 | MochiKit.Iter.__new__(); | 1475 | MochiKit.Iter.__new__(); |
| 1608 | -if(MochiKit.__export__){ | 1476 | +if(!MochiKit.__compat__){ |
| 1609 | reduce=MochiKit.Iter.reduce; | 1477 | reduce=MochiKit.Iter.reduce; |
| 1610 | } | 1478 | } |
| 1611 | MochiKit.Base._exportSymbols(this,MochiKit.Iter); | 1479 | MochiKit.Base._exportSymbols(this,MochiKit.Iter); |
| @@ -1628,7 +1496,7 @@ if(typeof (MochiKit.Logging)=="undefined"){ | @@ -1628,7 +1496,7 @@ if(typeof (MochiKit.Logging)=="undefined"){ | ||
| 1628 | MochiKit.Logging={}; | 1496 | MochiKit.Logging={}; |
| 1629 | } | 1497 | } |
| 1630 | MochiKit.Logging.NAME="MochiKit.Logging"; | 1498 | MochiKit.Logging.NAME="MochiKit.Logging"; |
| 1631 | -MochiKit.Logging.VERSION="1.4"; | 1499 | +MochiKit.Logging.VERSION="1.3.1"; |
| 1632 | MochiKit.Logging.__repr__=function(){ | 1500 | MochiKit.Logging.__repr__=function(){ |
| 1633 | return "["+this.NAME+" "+this.VERSION+"]"; | 1501 | return "["+this.NAME+" "+this.VERSION+"]"; |
| 1634 | }; | 1502 | }; |
| @@ -1637,9 +1505,9 @@ return this.__repr__(); | @@ -1637,9 +1505,9 @@ return this.__repr__(); | ||
| 1637 | }; | 1505 | }; |
| 1638 | MochiKit.Logging.EXPORT=["LogLevel","LogMessage","Logger","alertListener","logger","log","logError","logDebug","logFatal","logWarning"]; | 1506 | MochiKit.Logging.EXPORT=["LogLevel","LogMessage","Logger","alertListener","logger","log","logError","logDebug","logFatal","logWarning"]; |
| 1639 | MochiKit.Logging.EXPORT_OK=["logLevelAtLeast","isLogMessage","compareLogMessage"]; | 1507 | MochiKit.Logging.EXPORT_OK=["logLevelAtLeast","isLogMessage","compareLogMessage"]; |
| 1640 | -MochiKit.Logging.LogMessage=function(num,_207,info){ | 1508 | +MochiKit.Logging.LogMessage=function(num,_192,info){ |
| 1641 | this.num=num; | 1509 | this.num=num; |
| 1642 | -this.level=_207; | 1510 | +this.level=_192; |
| 1643 | this.info=info; | 1511 | this.info=info; |
| 1644 | this.timestamp=new Date(); | 1512 | this.timestamp=new Date(); |
| 1645 | }; | 1513 | }; |
| @@ -1647,22 +1515,22 @@ MochiKit.Logging.LogMessage.prototype={repr:function(){ | @@ -1647,22 +1515,22 @@ MochiKit.Logging.LogMessage.prototype={repr:function(){ | ||
| 1647 | var m=MochiKit.Base; | 1515 | var m=MochiKit.Base; |
| 1648 | return "LogMessage("+m.map(m.repr,[this.num,this.level,this.info]).join(", ")+")"; | 1516 | return "LogMessage("+m.map(m.repr,[this.num,this.level,this.info]).join(", ")+")"; |
| 1649 | },toString:MochiKit.Base.forwardCall("repr")}; | 1517 | },toString:MochiKit.Base.forwardCall("repr")}; |
| 1650 | -MochiKit.Base.update(MochiKit.Logging,{logLevelAtLeast:function(_209){ | 1518 | +MochiKit.Base.update(MochiKit.Logging,{logLevelAtLeast:function(_194){ |
| 1651 | var self=MochiKit.Logging; | 1519 | var self=MochiKit.Logging; |
| 1652 | -if(typeof (_209)=="string"){ | ||
| 1653 | -_209=self.LogLevel[_209]; | 1520 | +if(typeof (_194)=="string"){ |
| 1521 | +_194=self.LogLevel[_194]; | ||
| 1654 | } | 1522 | } |
| 1655 | return function(msg){ | 1523 | return function(msg){ |
| 1656 | -var _211=msg.level; | ||
| 1657 | -if(typeof (_211)=="string"){ | ||
| 1658 | -_211=self.LogLevel[_211]; | 1524 | +var _196=msg.level; |
| 1525 | +if(typeof (_196)=="string"){ | ||
| 1526 | +_196=self.LogLevel[_196]; | ||
| 1659 | } | 1527 | } |
| 1660 | -return _211>=_209; | 1528 | +return _196>=_194; |
| 1661 | }; | 1529 | }; |
| 1662 | },isLogMessage:function(){ | 1530 | },isLogMessage:function(){ |
| 1663 | -var _212=MochiKit.Logging.LogMessage; | 1531 | +var _197=MochiKit.Logging.LogMessage; |
| 1664 | for(var i=0;i<arguments.length;i++){ | 1532 | for(var i=0;i<arguments.length;i++){ |
| 1665 | -if(!(arguments[i] instanceof _212)){ | 1533 | +if(!(arguments[i] instanceof _197)){ |
| 1666 | return false; | 1534 | return false; |
| 1667 | } | 1535 | } |
| 1668 | } | 1536 | } |
| @@ -1672,12 +1540,12 @@ return MochiKit.Base.compare([a.level,a.info],[b.level,b.info]); | @@ -1672,12 +1540,12 @@ return MochiKit.Base.compare([a.level,a.info],[b.level,b.info]); | ||
| 1672 | },alertListener:function(msg){ | 1540 | },alertListener:function(msg){ |
| 1673 | alert("num: "+msg.num+"\nlevel: "+msg.level+"\ninfo: "+msg.info.join(" ")); | 1541 | alert("num: "+msg.num+"\nlevel: "+msg.level+"\ninfo: "+msg.info.join(" ")); |
| 1674 | }}); | 1542 | }}); |
| 1675 | -MochiKit.Logging.Logger=function(_213){ | 1543 | +MochiKit.Logging.Logger=function(_198){ |
| 1676 | this.counter=0; | 1544 | this.counter=0; |
| 1677 | -if(typeof (_213)=="undefined"||_213===null){ | ||
| 1678 | -_213=-1; | 1545 | +if(typeof (_198)=="undefined"||_198===null){ |
| 1546 | +_198=-1; | ||
| 1679 | } | 1547 | } |
| 1680 | -this.maxSize=_213; | 1548 | +this.maxSize=_198; |
| 1681 | this._messages=[]; | 1549 | this._messages=[]; |
| 1682 | this.listeners={}; | 1550 | this.listeners={}; |
| 1683 | this.useNativeConsole=false; | 1551 | this.useNativeConsole=false; |
| @@ -1686,21 +1554,13 @@ MochiKit.Logging.Logger.prototype={clear:function(){ | @@ -1686,21 +1554,13 @@ MochiKit.Logging.Logger.prototype={clear:function(){ | ||
| 1686 | this._messages.splice(0,this._messages.length); | 1554 | this._messages.splice(0,this._messages.length); |
| 1687 | },logToConsole:function(msg){ | 1555 | },logToConsole:function(msg){ |
| 1688 | if(typeof (window)!="undefined"&&window.console&&window.console.log){ | 1556 | if(typeof (window)!="undefined"&&window.console&&window.console.log){ |
| 1689 | -window.console.log(msg.replace(/%/g,"\uff05")); | 1557 | +window.console.log(msg); |
| 1690 | }else{ | 1558 | }else{ |
| 1691 | if(typeof (opera)!="undefined"&&opera.postError){ | 1559 | if(typeof (opera)!="undefined"&&opera.postError){ |
| 1692 | opera.postError(msg); | 1560 | opera.postError(msg); |
| 1693 | }else{ | 1561 | }else{ |
| 1694 | if(typeof (printfire)=="function"){ | 1562 | if(typeof (printfire)=="function"){ |
| 1695 | printfire(msg); | 1563 | printfire(msg); |
| 1696 | -}else{ | ||
| 1697 | -if(typeof (Debug)!="undefined"&&Debug.writeln){ | ||
| 1698 | -Debug.writeln(msg); | ||
| 1699 | -}else{ | ||
| 1700 | -if(typeof (debug)!="undefined"&&debug.trace){ | ||
| 1701 | -debug.trace(msg); | ||
| 1702 | -} | ||
| 1703 | -} | ||
| 1704 | } | 1564 | } |
| 1705 | } | 1565 | } |
| 1706 | } | 1566 | } |
| @@ -1712,17 +1572,17 @@ continue; | @@ -1712,17 +1572,17 @@ continue; | ||
| 1712 | } | 1572 | } |
| 1713 | pair[1](msg); | 1573 | pair[1](msg); |
| 1714 | } | 1574 | } |
| 1715 | -},addListener:function(_214,_215,_216){ | ||
| 1716 | -if(typeof (_215)=="string"){ | ||
| 1717 | -_215=MochiKit.Logging.logLevelAtLeast(_215); | ||
| 1718 | -} | ||
| 1719 | -var _217=[_215,_216]; | ||
| 1720 | -_217.ident=_214; | ||
| 1721 | -this.listeners[_214]=_217; | ||
| 1722 | -},removeListener:function(_218){ | ||
| 1723 | -delete this.listeners[_218]; | ||
| 1724 | -},baseLog:function(_219,_220){ | ||
| 1725 | -var msg=new MochiKit.Logging.LogMessage(this.counter,_219,MochiKit.Base.extend(null,arguments,1)); | 1575 | +},addListener:function(_199,_200,_201){ |
| 1576 | +if(typeof (_200)=="string"){ | ||
| 1577 | +_200=MochiKit.Logging.logLevelAtLeast(_200); | ||
| 1578 | +} | ||
| 1579 | +var _202=[_200,_201]; | ||
| 1580 | +_202.ident=_199; | ||
| 1581 | +this.listeners[_199]=_202; | ||
| 1582 | +},removeListener:function(_203){ | ||
| 1583 | +delete this.listeners[_203]; | ||
| 1584 | +},baseLog:function(_204,_205){ | ||
| 1585 | +var msg=new MochiKit.Logging.LogMessage(this.counter,_204,MochiKit.Base.extend(null,arguments,1)); | ||
| 1726 | this._messages.push(msg); | 1586 | this._messages.push(msg); |
| 1727 | this.dispatchListeners(msg); | 1587 | this.dispatchListeners(msg); |
| 1728 | if(this.useNativeConsole){ | 1588 | if(this.useNativeConsole){ |
| @@ -1732,52 +1592,52 @@ this.counter+=1; | @@ -1732,52 +1592,52 @@ this.counter+=1; | ||
| 1732 | while(this.maxSize>=0&&this._messages.length>this.maxSize){ | 1592 | while(this.maxSize>=0&&this._messages.length>this.maxSize){ |
| 1733 | this._messages.shift(); | 1593 | this._messages.shift(); |
| 1734 | } | 1594 | } |
| 1735 | -},getMessages:function(_221){ | ||
| 1736 | -var _222=0; | ||
| 1737 | -if(!(typeof (_221)=="undefined"||_221===null)){ | ||
| 1738 | -_222=Math.max(0,this._messages.length-_221); | 1595 | +},getMessages:function(_206){ |
| 1596 | +var _207=0; | ||
| 1597 | +if(!(typeof (_206)=="undefined"||_206===null)){ | ||
| 1598 | +_207=Math.max(0,this._messages.length-_206); | ||
| 1739 | } | 1599 | } |
| 1740 | -return this._messages.slice(_222); | ||
| 1741 | -},getMessageText:function(_223){ | ||
| 1742 | -if(typeof (_223)=="undefined"||_223===null){ | ||
| 1743 | -_223=30; | 1600 | +return this._messages.slice(_207); |
| 1601 | +},getMessageText:function(_208){ | ||
| 1602 | +if(typeof (_208)=="undefined"||_208===null){ | ||
| 1603 | +_208=30; | ||
| 1744 | } | 1604 | } |
| 1745 | -var _224=this.getMessages(_223); | ||
| 1746 | -if(_224.length){ | 1605 | +var _209=this.getMessages(_208); |
| 1606 | +if(_209.length){ | ||
| 1747 | var lst=map(function(m){ | 1607 | var lst=map(function(m){ |
| 1748 | return "\n ["+m.num+"] "+m.level+": "+m.info.join(" "); | 1608 | return "\n ["+m.num+"] "+m.level+": "+m.info.join(" "); |
| 1749 | -},_224); | ||
| 1750 | -lst.unshift("LAST "+_224.length+" MESSAGES:"); | 1609 | +},_209); |
| 1610 | +lst.unshift("LAST "+_209.length+" MESSAGES:"); | ||
| 1751 | return lst.join(""); | 1611 | return lst.join(""); |
| 1752 | } | 1612 | } |
| 1753 | return ""; | 1613 | return ""; |
| 1754 | -},debuggingBookmarklet:function(_225){ | 1614 | +},debuggingBookmarklet:function(_210){ |
| 1755 | if(typeof (MochiKit.LoggingPane)=="undefined"){ | 1615 | if(typeof (MochiKit.LoggingPane)=="undefined"){ |
| 1756 | alert(this.getMessageText()); | 1616 | alert(this.getMessageText()); |
| 1757 | }else{ | 1617 | }else{ |
| 1758 | -MochiKit.LoggingPane.createLoggingPane(_225||false); | 1618 | +MochiKit.LoggingPane.createLoggingPane(_210||false); |
| 1759 | } | 1619 | } |
| 1760 | }}; | 1620 | }}; |
| 1761 | MochiKit.Logging.__new__=function(){ | 1621 | MochiKit.Logging.__new__=function(){ |
| 1762 | this.LogLevel={ERROR:40,FATAL:50,WARNING:30,INFO:20,DEBUG:10}; | 1622 | this.LogLevel={ERROR:40,FATAL:50,WARNING:30,INFO:20,DEBUG:10}; |
| 1763 | var m=MochiKit.Base; | 1623 | var m=MochiKit.Base; |
| 1764 | m.registerComparator("LogMessage",this.isLogMessage,this.compareLogMessage); | 1624 | m.registerComparator("LogMessage",this.isLogMessage,this.compareLogMessage); |
| 1765 | -var _226=m.partial; | ||
| 1766 | -var _227=this.Logger; | ||
| 1767 | -var _228=_227.prototype.baseLog; | ||
| 1768 | -m.update(this.Logger.prototype,{debug:_226(_228,"DEBUG"),log:_226(_228,"INFO"),error:_226(_228,"ERROR"),fatal:_226(_228,"FATAL"),warning:_226(_228,"WARNING")}); | 1625 | +var _211=m.partial; |
| 1626 | +var _212=this.Logger; | ||
| 1627 | +var _213=_212.prototype.baseLog; | ||
| 1628 | +m.update(this.Logger.prototype,{debug:_211(_213,"DEBUG"),log:_211(_213,"INFO"),error:_211(_213,"ERROR"),fatal:_211(_213,"FATAL"),warning:_211(_213,"WARNING")}); | ||
| 1769 | var self=this; | 1629 | var self=this; |
| 1770 | -var _229=function(name){ | 1630 | +var _214=function(name){ |
| 1771 | return function(){ | 1631 | return function(){ |
| 1772 | self.logger[name].apply(self.logger,arguments); | 1632 | self.logger[name].apply(self.logger,arguments); |
| 1773 | }; | 1633 | }; |
| 1774 | }; | 1634 | }; |
| 1775 | -this.log=_229("log"); | ||
| 1776 | -this.logError=_229("error"); | ||
| 1777 | -this.logDebug=_229("debug"); | ||
| 1778 | -this.logFatal=_229("fatal"); | ||
| 1779 | -this.logWarning=_229("warning"); | ||
| 1780 | -this.logger=new _227(); | 1635 | +this.log=_214("log"); |
| 1636 | +this.logError=_214("error"); | ||
| 1637 | +this.logDebug=_214("debug"); | ||
| 1638 | +this.logFatal=_214("fatal"); | ||
| 1639 | +this.logWarning=_214("warning"); | ||
| 1640 | +this.logger=new _212(); | ||
| 1781 | this.logger.useNativeConsole=true; | 1641 | this.logger.useNativeConsole=true; |
| 1782 | this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)}; | 1642 | this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)}; |
| 1783 | m.nameFunctions(this); | 1643 | m.nameFunctions(this); |
| @@ -1802,7 +1662,7 @@ if(typeof (MochiKit.DateTime)=="undefined"){ | @@ -1802,7 +1662,7 @@ if(typeof (MochiKit.DateTime)=="undefined"){ | ||
| 1802 | MochiKit.DateTime={}; | 1662 | MochiKit.DateTime={}; |
| 1803 | } | 1663 | } |
| 1804 | MochiKit.DateTime.NAME="MochiKit.DateTime"; | 1664 | MochiKit.DateTime.NAME="MochiKit.DateTime"; |
| 1805 | -MochiKit.DateTime.VERSION="1.4"; | 1665 | +MochiKit.DateTime.VERSION="1.3.1"; |
| 1806 | MochiKit.DateTime.__repr__=function(){ | 1666 | MochiKit.DateTime.__repr__=function(){ |
| 1807 | return "["+this.NAME+" "+this.VERSION+"]"; | 1667 | return "["+this.NAME+" "+this.VERSION+"]"; |
| 1808 | }; | 1668 | }; |
| @@ -1865,33 +1725,33 @@ ofs=0; | @@ -1865,33 +1725,33 @@ ofs=0; | ||
| 1865 | } | 1725 | } |
| 1866 | return new Date(Date.UTC(year,month,day,hour,min,sec,msec)-ofs); | 1726 | return new Date(Date.UTC(year,month,day,hour,min,sec,msec)-ofs); |
| 1867 | }; | 1727 | }; |
| 1868 | -MochiKit.DateTime.toISOTime=function(date,_236){ | 1728 | +MochiKit.DateTime.toISOTime=function(date,_221){ |
| 1869 | if(typeof (date)=="undefined"||date===null){ | 1729 | if(typeof (date)=="undefined"||date===null){ |
| 1870 | return null; | 1730 | return null; |
| 1871 | } | 1731 | } |
| 1872 | var hh=date.getHours(); | 1732 | var hh=date.getHours(); |
| 1873 | var mm=date.getMinutes(); | 1733 | var mm=date.getMinutes(); |
| 1874 | var ss=date.getSeconds(); | 1734 | var ss=date.getSeconds(); |
| 1875 | -var lst=[((_236&&(hh<10))?"0"+hh:hh),((mm<10)?"0"+mm:mm),((ss<10)?"0"+ss:ss)]; | 1735 | +var lst=[((_221&&(hh<10))?"0"+hh:hh),((mm<10)?"0"+mm:mm),((ss<10)?"0"+ss:ss)]; |
| 1876 | return lst.join(":"); | 1736 | return lst.join(":"); |
| 1877 | }; | 1737 | }; |
| 1878 | -MochiKit.DateTime.toISOTimestamp=function(date,_240){ | 1738 | +MochiKit.DateTime.toISOTimestamp=function(date,_225){ |
| 1879 | if(typeof (date)=="undefined"||date===null){ | 1739 | if(typeof (date)=="undefined"||date===null){ |
| 1880 | return null; | 1740 | return null; |
| 1881 | } | 1741 | } |
| 1882 | -var sep=_240?"T":" "; | ||
| 1883 | -var foot=_240?"Z":""; | ||
| 1884 | -if(_240){ | 1742 | +var sep=_225?"T":" "; |
| 1743 | +var foot=_225?"Z":""; | ||
| 1744 | +if(_225){ | ||
| 1885 | date=new Date(date.getTime()+(date.getTimezoneOffset()*60000)); | 1745 | date=new Date(date.getTime()+(date.getTimezoneOffset()*60000)); |
| 1886 | } | 1746 | } |
| 1887 | -return MochiKit.DateTime.toISODate(date)+sep+MochiKit.DateTime.toISOTime(date,_240)+foot; | 1747 | +return MochiKit.DateTime.toISODate(date)+sep+MochiKit.DateTime.toISOTime(date,_225)+foot; |
| 1888 | }; | 1748 | }; |
| 1889 | MochiKit.DateTime.toISODate=function(date){ | 1749 | MochiKit.DateTime.toISODate=function(date){ |
| 1890 | if(typeof (date)=="undefined"||date===null){ | 1750 | if(typeof (date)=="undefined"||date===null){ |
| 1891 | return null; | 1751 | return null; |
| 1892 | } | 1752 | } |
| 1893 | -var _243=MochiKit.DateTime._padTwo; | ||
| 1894 | -return [date.getFullYear(),_243(date.getMonth()+1),_243(date.getDate())].join("-"); | 1753 | +var _228=MochiKit.DateTime._padTwo; |
| 1754 | +return [date.getFullYear(),_228(date.getMonth()+1),_228(date.getDate())].join("-"); | ||
| 1895 | }; | 1755 | }; |
| 1896 | MochiKit.DateTime.americanDate=function(d){ | 1756 | MochiKit.DateTime.americanDate=function(d){ |
| 1897 | d=d+""; | 1757 | d=d+""; |
| @@ -1908,8 +1768,8 @@ MochiKit.DateTime.toPaddedAmericanDate=function(d){ | @@ -1908,8 +1768,8 @@ MochiKit.DateTime.toPaddedAmericanDate=function(d){ | ||
| 1908 | if(typeof (d)=="undefined"||d===null){ | 1768 | if(typeof (d)=="undefined"||d===null){ |
| 1909 | return null; | 1769 | return null; |
| 1910 | } | 1770 | } |
| 1911 | -var _245=MochiKit.DateTime._padTwo; | ||
| 1912 | -return [_245(d.getMonth()+1),_245(d.getDate()),d.getFullYear()].join("/"); | 1771 | +var _230=MochiKit.DateTime._padTwo; |
| 1772 | +return [_230(d.getMonth()+1),_230(d.getDate()),d.getFullYear()].join("/"); | ||
| 1913 | }; | 1773 | }; |
| 1914 | MochiKit.DateTime.toAmericanDate=function(d){ | 1774 | MochiKit.DateTime.toAmericanDate=function(d){ |
| 1915 | if(typeof (d)=="undefined"||d===null){ | 1775 | if(typeof (d)=="undefined"||d===null){ |
| @@ -1937,11 +1797,11 @@ MochiKit.DateTime.__new__(); | @@ -1937,11 +1797,11 @@ MochiKit.DateTime.__new__(); | ||
| 1937 | if(typeof (MochiKit.Base)!="undefined"){ | 1797 | if(typeof (MochiKit.Base)!="undefined"){ |
| 1938 | MochiKit.Base._exportSymbols(this,MochiKit.DateTime); | 1798 | MochiKit.Base._exportSymbols(this,MochiKit.DateTime); |
| 1939 | }else{ | 1799 | }else{ |
| 1940 | -(function(_246,_247){ | ||
| 1941 | -if((typeof (JSAN)=="undefined"&&typeof (dojo)=="undefined")||(MochiKit.__export__===false)){ | ||
| 1942 | -var all=_247.EXPORT_TAGS[":all"]; | 1800 | +(function(_231,_232){ |
| 1801 | +if((typeof (JSAN)=="undefined"&&typeof (dojo)=="undefined")||(typeof (MochiKit.__compat__)=="boolean"&&MochiKit.__compat__)){ | ||
| 1802 | +var all=_232.EXPORT_TAGS[":all"]; | ||
| 1943 | for(var i=0;i<all.length;i++){ | 1803 | for(var i=0;i<all.length;i++){ |
| 1944 | -_246[all[i]]=_247[all[i]]; | 1804 | +_231[all[i]]=_232[all[i]]; |
| 1945 | } | 1805 | } |
| 1946 | } | 1806 | } |
| 1947 | })(this,MochiKit.DateTime); | 1807 | })(this,MochiKit.DateTime); |
| @@ -1956,87 +1816,87 @@ if(typeof (MochiKit.Format)=="undefined"){ | @@ -1956,87 +1816,87 @@ if(typeof (MochiKit.Format)=="undefined"){ | ||
| 1956 | MochiKit.Format={}; | 1816 | MochiKit.Format={}; |
| 1957 | } | 1817 | } |
| 1958 | MochiKit.Format.NAME="MochiKit.Format"; | 1818 | MochiKit.Format.NAME="MochiKit.Format"; |
| 1959 | -MochiKit.Format.VERSION="1.4"; | 1819 | +MochiKit.Format.VERSION="1.3.1"; |
| 1960 | MochiKit.Format.__repr__=function(){ | 1820 | MochiKit.Format.__repr__=function(){ |
| 1961 | return "["+this.NAME+" "+this.VERSION+"]"; | 1821 | return "["+this.NAME+" "+this.VERSION+"]"; |
| 1962 | }; | 1822 | }; |
| 1963 | MochiKit.Format.toString=function(){ | 1823 | MochiKit.Format.toString=function(){ |
| 1964 | return this.__repr__(); | 1824 | return this.__repr__(); |
| 1965 | }; | 1825 | }; |
| 1966 | -MochiKit.Format._numberFormatter=function(_248,_249,_250,_251,_252,_253,_254,_255,_256){ | 1826 | +MochiKit.Format._numberFormatter=function(_233,_234,_235,_236,_237,_238,_239,_240,_241){ |
| 1967 | return function(num){ | 1827 | return function(num){ |
| 1968 | num=parseFloat(num); | 1828 | num=parseFloat(num); |
| 1969 | if(typeof (num)=="undefined"||num===null||isNaN(num)){ | 1829 | if(typeof (num)=="undefined"||num===null||isNaN(num)){ |
| 1970 | -return _248; | 1830 | +return _233; |
| 1971 | } | 1831 | } |
| 1972 | -var _257=_249; | ||
| 1973 | -var _258=_250; | 1832 | +var _242=_234; |
| 1833 | +var _243=_235; | ||
| 1974 | if(num<0){ | 1834 | if(num<0){ |
| 1975 | num=-num; | 1835 | num=-num; |
| 1976 | }else{ | 1836 | }else{ |
| 1977 | -_257=_257.replace(/-/,""); | 1837 | +_242=_242.replace(/-/,""); |
| 1978 | } | 1838 | } |
| 1979 | var me=arguments.callee; | 1839 | var me=arguments.callee; |
| 1980 | -var fmt=MochiKit.Format.formatLocale(_251); | ||
| 1981 | -if(_252){ | 1840 | +var fmt=MochiKit.Format.formatLocale(_236); |
| 1841 | +if(_237){ | ||
| 1982 | num=num*100; | 1842 | num=num*100; |
| 1983 | -_258=fmt.percent+_258; | 1843 | +_243=fmt.percent+_243; |
| 1984 | } | 1844 | } |
| 1985 | -num=MochiKit.Format.roundToFixed(num,_253); | ||
| 1986 | -var _260=num.split(/\./); | ||
| 1987 | -var _261=_260[0]; | ||
| 1988 | -var frac=(_260.length==1)?"":_260[1]; | 1845 | +num=MochiKit.Format.roundToFixed(num,_238); |
| 1846 | +var _245=num.split(/\./); | ||
| 1847 | +var _246=_245[0]; | ||
| 1848 | +var frac=(_245.length==1)?"":_245[1]; | ||
| 1989 | var res=""; | 1849 | var res=""; |
| 1990 | -while(_261.length<_254){ | ||
| 1991 | -_261="0"+_261; | 1850 | +while(_246.length<_239){ |
| 1851 | +_246="0"+_246; | ||
| 1992 | } | 1852 | } |
| 1993 | -if(_255){ | ||
| 1994 | -while(_261.length>_255){ | ||
| 1995 | -var i=_261.length-_255; | ||
| 1996 | -res=fmt.separator+_261.substring(i,_261.length)+res; | ||
| 1997 | -_261=_261.substring(0,i); | 1853 | +if(_240){ |
| 1854 | +while(_246.length>_240){ | ||
| 1855 | +var i=_246.length-_240; | ||
| 1856 | +res=fmt.separator+_246.substring(i,_246.length)+res; | ||
| 1857 | +_246=_246.substring(0,i); | ||
| 1998 | } | 1858 | } |
| 1999 | } | 1859 | } |
| 2000 | -res=_261+res; | ||
| 2001 | -if(_253>0){ | ||
| 2002 | -while(frac.length<_256){ | 1860 | +res=_246+res; |
| 1861 | +if(_238>0){ | ||
| 1862 | +while(frac.length<_241){ | ||
| 2003 | frac=frac+"0"; | 1863 | frac=frac+"0"; |
| 2004 | } | 1864 | } |
| 2005 | res=res+fmt.decimal+frac; | 1865 | res=res+fmt.decimal+frac; |
| 2006 | } | 1866 | } |
| 2007 | -return _257+res+_258; | 1867 | +return _242+res+_243; |
| 2008 | }; | 1868 | }; |
| 2009 | }; | 1869 | }; |
| 2010 | -MochiKit.Format.numberFormatter=function(_263,_264,_265){ | ||
| 2011 | -if(typeof (_264)=="undefined"){ | ||
| 2012 | -_264=""; | 1870 | +MochiKit.Format.numberFormatter=function(_248,_249,_250){ |
| 1871 | +if(typeof (_249)=="undefined"){ | ||
| 1872 | +_249=""; | ||
| 2013 | } | 1873 | } |
| 2014 | -var _266=_263.match(/((?:[0#]+,)?[0#]+)(?:\.([0#]+))?(%)?/); | ||
| 2015 | -if(!_266){ | 1874 | +var _251=_248.match(/((?:[0#]+,)?[0#]+)(?:\.([0#]+))?(%)?/); |
| 1875 | +if(!_251){ | ||
| 2016 | throw TypeError("Invalid pattern"); | 1876 | throw TypeError("Invalid pattern"); |
| 2017 | } | 1877 | } |
| 2018 | -var _267=_263.substr(0,_266.index); | ||
| 2019 | -var _268=_263.substr(_266.index+_266[0].length); | ||
| 2020 | -if(_267.search(/-/)==-1){ | ||
| 2021 | -_267=_267+"-"; | 1878 | +var _252=_248.substr(0,_251.index); |
| 1879 | +var _253=_248.substr(_251.index+_251[0].length); | ||
| 1880 | +if(_252.search(/-/)==-1){ | ||
| 1881 | +_252=_252+"-"; | ||
| 2022 | } | 1882 | } |
| 2023 | -var _269=_266[1]; | ||
| 2024 | -var frac=(typeof (_266[2])=="string"&&_266[2]!="")?_266[2]:""; | ||
| 2025 | -var _270=(typeof (_266[3])=="string"&&_266[3]!=""); | ||
| 2026 | -var tmp=_269.split(/,/); | ||
| 2027 | -var _272; | ||
| 2028 | -if(typeof (_265)=="undefined"){ | ||
| 2029 | -_265="default"; | 1883 | +var _254=_251[1]; |
| 1884 | +var frac=(typeof (_251[2])=="string"&&_251[2]!="")?_251[2]:""; | ||
| 1885 | +var _255=(typeof (_251[3])=="string"&&_251[3]!=""); | ||
| 1886 | +var tmp=_254.split(/,/); | ||
| 1887 | +var _257; | ||
| 1888 | +if(typeof (_250)=="undefined"){ | ||
| 1889 | +_250="default"; | ||
| 2030 | } | 1890 | } |
| 2031 | if(tmp.length==1){ | 1891 | if(tmp.length==1){ |
| 2032 | -_272=null; | 1892 | +_257=null; |
| 2033 | }else{ | 1893 | }else{ |
| 2034 | -_272=tmp[1].length; | 1894 | +_257=tmp[1].length; |
| 2035 | } | 1895 | } |
| 2036 | -var _273=_269.length-_269.replace(/0/g,"").length; | ||
| 2037 | -var _274=frac.length-frac.replace(/0/g,"").length; | ||
| 2038 | -var _275=frac.length; | ||
| 2039 | -var rval=MochiKit.Format._numberFormatter(_264,_267,_268,_265,_270,_275,_273,_272,_274); | 1896 | +var _258=_254.length-_254.replace(/0/g,"").length; |
| 1897 | +var _259=frac.length-frac.replace(/0/g,"").length; | ||
| 1898 | +var _260=frac.length; | ||
| 1899 | +var rval=MochiKit.Format._numberFormatter(_249,_252,_253,_250,_255,_260,_258,_257,_259); | ||
| 2040 | var m=MochiKit.Base; | 1900 | var m=MochiKit.Base; |
| 2041 | if(m){ | 1901 | if(m){ |
| 2042 | var fn=arguments.callee; | 1902 | var fn=arguments.callee; |
| @@ -2047,33 +1907,33 @@ return [self.NAME,"(",map(m.repr,args).join(", "),")"].join(""); | @@ -2047,33 +1907,33 @@ return [self.NAME,"(",map(m.repr,args).join(", "),")"].join(""); | ||
| 2047 | } | 1907 | } |
| 2048 | return rval; | 1908 | return rval; |
| 2049 | }; | 1909 | }; |
| 2050 | -MochiKit.Format.formatLocale=function(_276){ | ||
| 2051 | -if(typeof (_276)=="undefined"||_276===null){ | ||
| 2052 | -_276="default"; | 1910 | +MochiKit.Format.formatLocale=function(_262){ |
| 1911 | +if(typeof (_262)=="undefined"||_262===null){ | ||
| 1912 | +_262="default"; | ||
| 2053 | } | 1913 | } |
| 2054 | -if(typeof (_276)=="string"){ | ||
| 2055 | -var rval=MochiKit.Format.LOCALE[_276]; | 1914 | +if(typeof (_262)=="string"){ |
| 1915 | +var rval=MochiKit.Format.LOCALE[_262]; | ||
| 2056 | if(typeof (rval)=="string"){ | 1916 | if(typeof (rval)=="string"){ |
| 2057 | rval=arguments.callee(rval); | 1917 | rval=arguments.callee(rval); |
| 2058 | -MochiKit.Format.LOCALE[_276]=rval; | 1918 | +MochiKit.Format.LOCALE[_262]=rval; |
| 2059 | } | 1919 | } |
| 2060 | return rval; | 1920 | return rval; |
| 2061 | }else{ | 1921 | }else{ |
| 2062 | -return _276; | 1922 | +return _262; |
| 2063 | } | 1923 | } |
| 2064 | }; | 1924 | }; |
| 2065 | -MochiKit.Format.twoDigitAverage=function(_277,_278){ | ||
| 2066 | -if(_278){ | ||
| 2067 | -var res=_277/_278; | 1925 | +MochiKit.Format.twoDigitAverage=function(_263,_264){ |
| 1926 | +if(_264){ | ||
| 1927 | +var res=_263/_264; | ||
| 2068 | if(!isNaN(res)){ | 1928 | if(!isNaN(res)){ |
| 2069 | -return MochiKit.Format.twoDigitFloat(_277/_278); | 1929 | +return MochiKit.Format.twoDigitFloat(_263/_264); |
| 2070 | } | 1930 | } |
| 2071 | } | 1931 | } |
| 2072 | return "0"; | 1932 | return "0"; |
| 2073 | }; | 1933 | }; |
| 2074 | -MochiKit.Format.twoDigitFloat=function(_279){ | ||
| 2075 | -var sign=(_279<0?"-":""); | ||
| 2076 | -var s=Math.floor(Math.abs(_279)*100).toString(); | 1934 | +MochiKit.Format.twoDigitFloat=function(_265){ |
| 1935 | +var sign=(_265<0?"-":""); | ||
| 1936 | +var s=Math.floor(Math.abs(_265)*100).toString(); | ||
| 2077 | if(s=="0"){ | 1937 | if(s=="0"){ |
| 2078 | return s; | 1938 | return s; |
| 2079 | } | 1939 | } |
| @@ -2095,45 +1955,45 @@ return head+"."+tail; | @@ -2095,45 +1955,45 @@ return head+"."+tail; | ||
| 2095 | } | 1955 | } |
| 2096 | } | 1956 | } |
| 2097 | }; | 1957 | }; |
| 2098 | -MochiKit.Format.lstrip=function(str,_284){ | 1958 | +MochiKit.Format.lstrip=function(str,_270){ |
| 2099 | str=str+""; | 1959 | str=str+""; |
| 2100 | if(typeof (str)!="string"){ | 1960 | if(typeof (str)!="string"){ |
| 2101 | return null; | 1961 | return null; |
| 2102 | } | 1962 | } |
| 2103 | -if(!_284){ | 1963 | +if(!_270){ |
| 2104 | return str.replace(/^\s+/,""); | 1964 | return str.replace(/^\s+/,""); |
| 2105 | }else{ | 1965 | }else{ |
| 2106 | -return str.replace(new RegExp("^["+_284+"]+"),""); | 1966 | +return str.replace(new RegExp("^["+_270+"]+"),""); |
| 2107 | } | 1967 | } |
| 2108 | }; | 1968 | }; |
| 2109 | -MochiKit.Format.rstrip=function(str,_285){ | 1969 | +MochiKit.Format.rstrip=function(str,_271){ |
| 2110 | str=str+""; | 1970 | str=str+""; |
| 2111 | if(typeof (str)!="string"){ | 1971 | if(typeof (str)!="string"){ |
| 2112 | return null; | 1972 | return null; |
| 2113 | } | 1973 | } |
| 2114 | -if(!_285){ | 1974 | +if(!_271){ |
| 2115 | return str.replace(/\s+$/,""); | 1975 | return str.replace(/\s+$/,""); |
| 2116 | }else{ | 1976 | }else{ |
| 2117 | -return str.replace(new RegExp("["+_285+"]+$"),""); | 1977 | +return str.replace(new RegExp("["+_271+"]+$"),""); |
| 2118 | } | 1978 | } |
| 2119 | }; | 1979 | }; |
| 2120 | -MochiKit.Format.strip=function(str,_286){ | 1980 | +MochiKit.Format.strip=function(str,_272){ |
| 2121 | var self=MochiKit.Format; | 1981 | var self=MochiKit.Format; |
| 2122 | -return self.rstrip(self.lstrip(str,_286),_286); | 1982 | +return self.rstrip(self.lstrip(str,_272),_272); |
| 2123 | }; | 1983 | }; |
| 2124 | -MochiKit.Format.truncToFixed=function(_287,_288){ | ||
| 2125 | -_287=Math.floor(_287*Math.pow(10,_288)); | ||
| 2126 | -var res=(_287*Math.pow(10,-_288)).toFixed(_288); | 1984 | +MochiKit.Format.truncToFixed=function(_273,_274){ |
| 1985 | +_273=Math.floor(_273*Math.pow(10,_274)); | ||
| 1986 | +var res=(_273*Math.pow(10,-_274)).toFixed(_274); | ||
| 2127 | if(res.charAt(0)=="."){ | 1987 | if(res.charAt(0)=="."){ |
| 2128 | res="0"+res; | 1988 | res="0"+res; |
| 2129 | } | 1989 | } |
| 2130 | return res; | 1990 | return res; |
| 2131 | }; | 1991 | }; |
| 2132 | -MochiKit.Format.roundToFixed=function(_289,_290){ | ||
| 2133 | -return MochiKit.Format.truncToFixed(_289+0.5*Math.pow(10,-_290),_290); | 1992 | +MochiKit.Format.roundToFixed=function(_275,_276){ |
| 1993 | +return MochiKit.Format.truncToFixed(_275+0.5*Math.pow(10,-_276),_276); | ||
| 2134 | }; | 1994 | }; |
| 2135 | -MochiKit.Format.percentFormat=function(_291){ | ||
| 2136 | -return MochiKit.Format.twoDigitFloat(100*_291)+"%"; | 1995 | +MochiKit.Format.percentFormat=function(_277){ |
| 1996 | +return MochiKit.Format.twoDigitFloat(100*_277)+"%"; | ||
| 2137 | }; | 1997 | }; |
| 2138 | MochiKit.Format.EXPORT=["truncToFixed","roundToFixed","numberFormatter","formatLocale","twoDigitAverage","twoDigitFloat","percentFormat","lstrip","rstrip","strip"]; | 1998 | MochiKit.Format.EXPORT=["truncToFixed","roundToFixed","numberFormatter","formatLocale","twoDigitAverage","twoDigitFloat","percentFormat","lstrip","rstrip","strip"]; |
| 2139 | MochiKit.Format.LOCALE={en_US:{separator:",",decimal:".",percent:"%"},de_DE:{separator:".",decimal:",",percent:"%"},fr_FR:{separator:" ",decimal:",",percent:"%"},"default":"en_US"}; | 1999 | MochiKit.Format.LOCALE={en_US:{separator:",",decimal:".",percent:"%"},de_DE:{separator:".",decimal:",",percent:"%"},fr_FR:{separator:" ",decimal:",",percent:"%"},"default":"en_US"}; |
| @@ -2166,11 +2026,11 @@ MochiKit.Format.__new__(); | @@ -2166,11 +2026,11 @@ MochiKit.Format.__new__(); | ||
| 2166 | if(typeof (MochiKit.Base)!="undefined"){ | 2026 | if(typeof (MochiKit.Base)!="undefined"){ |
| 2167 | MochiKit.Base._exportSymbols(this,MochiKit.Format); | 2027 | MochiKit.Base._exportSymbols(this,MochiKit.Format); |
| 2168 | }else{ | 2028 | }else{ |
| 2169 | -(function(_292,_293){ | ||
| 2170 | -if((typeof (JSAN)=="undefined"&&typeof (dojo)=="undefined")||(MochiKit.__export__===false)){ | ||
| 2171 | -var all=_293.EXPORT_TAGS[":all"]; | 2029 | +(function(_278,_279){ |
| 2030 | +if((typeof (JSAN)=="undefined"&&typeof (dojo)=="undefined")||(typeof (MochiKit.__compat__)=="boolean"&&MochiKit.__compat__)){ | ||
| 2031 | +var all=_279.EXPORT_TAGS[":all"]; | ||
| 2172 | for(var i=0;i<all.length;i++){ | 2032 | for(var i=0;i<all.length;i++){ |
| 2173 | -_292[all[i]]=_293[all[i]]; | 2033 | +_278[all[i]]=_279[all[i]]; |
| 2174 | } | 2034 | } |
| 2175 | } | 2035 | } |
| 2176 | })(this,MochiKit.Format); | 2036 | })(this,MochiKit.Format); |
| @@ -2194,35 +2054,35 @@ if(typeof (MochiKit.Async)=="undefined"){ | @@ -2194,35 +2054,35 @@ if(typeof (MochiKit.Async)=="undefined"){ | ||
| 2194 | MochiKit.Async={}; | 2054 | MochiKit.Async={}; |
| 2195 | } | 2055 | } |
| 2196 | MochiKit.Async.NAME="MochiKit.Async"; | 2056 | MochiKit.Async.NAME="MochiKit.Async"; |
| 2197 | -MochiKit.Async.VERSION="1.4"; | 2057 | +MochiKit.Async.VERSION="1.3.1"; |
| 2198 | MochiKit.Async.__repr__=function(){ | 2058 | MochiKit.Async.__repr__=function(){ |
| 2199 | return "["+this.NAME+" "+this.VERSION+"]"; | 2059 | return "["+this.NAME+" "+this.VERSION+"]"; |
| 2200 | }; | 2060 | }; |
| 2201 | MochiKit.Async.toString=function(){ | 2061 | MochiKit.Async.toString=function(){ |
| 2202 | return this.__repr__(); | 2062 | return this.__repr__(); |
| 2203 | }; | 2063 | }; |
| 2204 | -MochiKit.Async.Deferred=function(_294){ | 2064 | +MochiKit.Async.Deferred=function(_280){ |
| 2205 | this.chain=[]; | 2065 | this.chain=[]; |
| 2206 | this.id=this._nextId(); | 2066 | this.id=this._nextId(); |
| 2207 | this.fired=-1; | 2067 | this.fired=-1; |
| 2208 | this.paused=0; | 2068 | this.paused=0; |
| 2209 | this.results=[null,null]; | 2069 | this.results=[null,null]; |
| 2210 | -this.canceller=_294; | 2070 | +this.canceller=_280; |
| 2211 | this.silentlyCancelled=false; | 2071 | this.silentlyCancelled=false; |
| 2212 | this.chained=false; | 2072 | this.chained=false; |
| 2213 | }; | 2073 | }; |
| 2214 | MochiKit.Async.Deferred.prototype={repr:function(){ | 2074 | MochiKit.Async.Deferred.prototype={repr:function(){ |
| 2215 | -var _295; | 2075 | +var _281; |
| 2216 | if(this.fired==-1){ | 2076 | if(this.fired==-1){ |
| 2217 | -_295="unfired"; | 2077 | +_281="unfired"; |
| 2218 | }else{ | 2078 | }else{ |
| 2219 | if(this.fired===0){ | 2079 | if(this.fired===0){ |
| 2220 | -_295="success"; | 2080 | +_281="success"; |
| 2221 | }else{ | 2081 | }else{ |
| 2222 | -_295="error"; | 2082 | +_281="error"; |
| 2223 | } | 2083 | } |
| 2224 | } | 2084 | } |
| 2225 | -return "Deferred("+this.id+", "+_295+")"; | 2085 | +return "Deferred("+this.id+", "+_281+")"; |
| 2226 | },toString:MochiKit.Base.forwardCall("repr"),_nextId:MochiKit.Base.counter(),cancel:function(){ | 2086 | },toString:MochiKit.Base.forwardCall("repr"),_nextId:MochiKit.Base.counter(),cancel:function(){ |
| 2227 | var self=MochiKit.Async; | 2087 | var self=MochiKit.Async; |
| 2228 | if(this.fired==-1){ | 2088 | if(this.fired==-1){ |
| @@ -2239,6 +2099,16 @@ if((this.fired===0)&&(this.results[0] instanceof self.Deferred)){ | @@ -2239,6 +2099,16 @@ if((this.fired===0)&&(this.results[0] instanceof self.Deferred)){ | ||
| 2239 | this.results[0].cancel(); | 2099 | this.results[0].cancel(); |
| 2240 | } | 2100 | } |
| 2241 | } | 2101 | } |
| 2102 | +},_pause:function(){ | ||
| 2103 | +this.paused++; | ||
| 2104 | +},_unpause:function(){ | ||
| 2105 | +this.paused--; | ||
| 2106 | +if((this.paused===0)&&(this.fired>=0)){ | ||
| 2107 | +this._fire(); | ||
| 2108 | +} | ||
| 2109 | +},_continue:function(res){ | ||
| 2110 | +this._resback(res); | ||
| 2111 | +this._unpause(); | ||
| 2242 | },_resback:function(res){ | 2112 | },_resback:function(res){ |
| 2243 | this.fired=((res instanceof Error)?1:0); | 2113 | this.fired=((res instanceof Error)?1:0); |
| 2244 | this.results[this.fired]=res; | 2114 | this.results[this.fired]=res; |
| @@ -2292,41 +2162,37 @@ this._fire(); | @@ -2292,41 +2162,37 @@ this._fire(); | ||
| 2292 | } | 2162 | } |
| 2293 | return this; | 2163 | return this; |
| 2294 | },_fire:function(){ | 2164 | },_fire:function(){ |
| 2295 | -var _298=this.chain; | ||
| 2296 | -var _299=this.fired; | ||
| 2297 | -var res=this.results[_299]; | 2165 | +var _284=this.chain; |
| 2166 | +var _285=this.fired; | ||
| 2167 | +var res=this.results[_285]; | ||
| 2298 | var self=this; | 2168 | var self=this; |
| 2299 | var cb=null; | 2169 | var cb=null; |
| 2300 | -while(_298.length>0&&this.paused===0){ | ||
| 2301 | -var pair=_298.shift(); | ||
| 2302 | -var f=pair[_299]; | 2170 | +while(_284.length>0&&this.paused===0){ |
| 2171 | +var pair=_284.shift(); | ||
| 2172 | +var f=pair[_285]; | ||
| 2303 | if(f===null){ | 2173 | if(f===null){ |
| 2304 | continue; | 2174 | continue; |
| 2305 | } | 2175 | } |
| 2306 | try{ | 2176 | try{ |
| 2307 | res=f(res); | 2177 | res=f(res); |
| 2308 | -_299=((res instanceof Error)?1:0); | 2178 | +_285=((res instanceof Error)?1:0); |
| 2309 | if(res instanceof MochiKit.Async.Deferred){ | 2179 | if(res instanceof MochiKit.Async.Deferred){ |
| 2310 | cb=function(res){ | 2180 | cb=function(res){ |
| 2311 | -self._resback(res); | ||
| 2312 | -self.paused--; | ||
| 2313 | -if((self.paused===0)&&(self.fired>=0)){ | ||
| 2314 | -self._fire(); | ||
| 2315 | -} | 2181 | +self._continue(res); |
| 2316 | }; | 2182 | }; |
| 2317 | -this.paused++; | 2183 | +this._pause(); |
| 2318 | } | 2184 | } |
| 2319 | } | 2185 | } |
| 2320 | catch(err){ | 2186 | catch(err){ |
| 2321 | -_299=1; | 2187 | +_285=1; |
| 2322 | if(!(err instanceof Error)){ | 2188 | if(!(err instanceof Error)){ |
| 2323 | err=new MochiKit.Async.GenericError(err); | 2189 | err=new MochiKit.Async.GenericError(err); |
| 2324 | } | 2190 | } |
| 2325 | res=err; | 2191 | res=err; |
| 2326 | } | 2192 | } |
| 2327 | } | 2193 | } |
| 2328 | -this.fired=_299; | ||
| 2329 | -this.results[_299]=res; | 2194 | +this.fired=_285; |
| 2195 | +this.results[_285]=res; | ||
| 2330 | if(cb&&this.paused){ | 2196 | if(cb&&this.paused){ |
| 2331 | res.addBoth(cb); | 2197 | res.addBoth(cb); |
| 2332 | res.chained=true; | 2198 | res.chained=true; |
| @@ -2334,18 +2200,18 @@ res.chained=true; | @@ -2334,18 +2200,18 @@ res.chained=true; | ||
| 2334 | }}; | 2200 | }}; |
| 2335 | MochiKit.Base.update(MochiKit.Async,{evalJSONRequest:function(){ | 2201 | MochiKit.Base.update(MochiKit.Async,{evalJSONRequest:function(){ |
| 2336 | return eval("("+arguments[0].responseText+")"); | 2202 | return eval("("+arguments[0].responseText+")"); |
| 2337 | -},succeed:function(_301){ | 2203 | +},succeed:function(_287){ |
| 2338 | var d=new MochiKit.Async.Deferred(); | 2204 | var d=new MochiKit.Async.Deferred(); |
| 2339 | d.callback.apply(d,arguments); | 2205 | d.callback.apply(d,arguments); |
| 2340 | return d; | 2206 | return d; |
| 2341 | -},fail:function(_302){ | 2207 | +},fail:function(_288){ |
| 2342 | var d=new MochiKit.Async.Deferred(); | 2208 | var d=new MochiKit.Async.Deferred(); |
| 2343 | d.errback.apply(d,arguments); | 2209 | d.errback.apply(d,arguments); |
| 2344 | return d; | 2210 | return d; |
| 2345 | },getXMLHttpRequest:function(){ | 2211 | },getXMLHttpRequest:function(){ |
| 2346 | var self=arguments.callee; | 2212 | var self=arguments.callee; |
| 2347 | if(!self.XMLHttpRequest){ | 2213 | if(!self.XMLHttpRequest){ |
| 2348 | -var _303=[function(){ | 2214 | +var _289=[function(){ |
| 2349 | return new XMLHttpRequest(); | 2215 | return new XMLHttpRequest(); |
| 2350 | },function(){ | 2216 | },function(){ |
| 2351 | return new ActiveXObject("Msxml2.XMLHTTP"); | 2217 | return new ActiveXObject("Msxml2.XMLHTTP"); |
| @@ -2356,8 +2222,8 @@ return new ActiveXObject("Msxml2.XMLHTTP.4.0"); | @@ -2356,8 +2222,8 @@ return new ActiveXObject("Msxml2.XMLHTTP.4.0"); | ||
| 2356 | },function(){ | 2222 | },function(){ |
| 2357 | throw new MochiKit.Async.BrowserComplianceError("Browser does not support XMLHttpRequest"); | 2223 | throw new MochiKit.Async.BrowserComplianceError("Browser does not support XMLHttpRequest"); |
| 2358 | }]; | 2224 | }]; |
| 2359 | -for(var i=0;i<_303.length;i++){ | ||
| 2360 | -var func=_303[i]; | 2225 | +for(var i=0;i<_289.length;i++){ |
| 2226 | +var func=_289[i]; | ||
| 2361 | try{ | 2227 | try{ |
| 2362 | self.XMLHttpRequest=func; | 2228 | self.XMLHttpRequest=func; |
| 2363 | return func(); | 2229 | return func(); |
| @@ -2367,29 +2233,29 @@ catch(e){ | @@ -2367,29 +2233,29 @@ catch(e){ | ||
| 2367 | } | 2233 | } |
| 2368 | } | 2234 | } |
| 2369 | return self.XMLHttpRequest(); | 2235 | return self.XMLHttpRequest(); |
| 2236 | +},_nothing:function(){ | ||
| 2370 | },_xhr_onreadystatechange:function(d){ | 2237 | },_xhr_onreadystatechange:function(d){ |
| 2371 | -var m=MochiKit.Base; | ||
| 2372 | if(this.readyState==4){ | 2238 | if(this.readyState==4){ |
| 2373 | try{ | 2239 | try{ |
| 2374 | this.onreadystatechange=null; | 2240 | this.onreadystatechange=null; |
| 2375 | } | 2241 | } |
| 2376 | catch(e){ | 2242 | catch(e){ |
| 2377 | try{ | 2243 | try{ |
| 2378 | -this.onreadystatechange=m.noop; | 2244 | +this.onreadystatechange=MochiKit.Async._nothing; |
| 2379 | } | 2245 | } |
| 2380 | catch(e){ | 2246 | catch(e){ |
| 2381 | } | 2247 | } |
| 2382 | } | 2248 | } |
| 2383 | -var _304=null; | 2249 | +var _290=null; |
| 2384 | try{ | 2250 | try{ |
| 2385 | -_304=this.status; | ||
| 2386 | -if(!_304&&m.isNotEmpty(this.responseText)){ | ||
| 2387 | -_304=304; | 2251 | +_290=this.status; |
| 2252 | +if(!_290&&MochiKit.Base.isNotEmpty(this.responseText)){ | ||
| 2253 | +_290=304; | ||
| 2388 | } | 2254 | } |
| 2389 | } | 2255 | } |
| 2390 | catch(e){ | 2256 | catch(e){ |
| 2391 | } | 2257 | } |
| 2392 | -if(_304==200||_304==201||_304==204||_304==304||_304==1223){ | 2258 | +if(_290==200||_290==304){ |
| 2393 | d.callback(this); | 2259 | d.callback(this); |
| 2394 | }else{ | 2260 | }else{ |
| 2395 | var err=new MochiKit.Async.XMLHttpRequestError(this,"Request failed"); | 2261 | var err=new MochiKit.Async.XMLHttpRequestError(this,"Request failed"); |
| @@ -2406,22 +2272,22 @@ req.onreadystatechange=null; | @@ -2406,22 +2272,22 @@ req.onreadystatechange=null; | ||
| 2406 | } | 2272 | } |
| 2407 | catch(e){ | 2273 | catch(e){ |
| 2408 | try{ | 2274 | try{ |
| 2409 | -req.onreadystatechange=MochiKit.Base.noop; | 2275 | +req.onreadystatechange=MochiKit.Async._nothing; |
| 2410 | } | 2276 | } |
| 2411 | catch(e){ | 2277 | catch(e){ |
| 2412 | } | 2278 | } |
| 2413 | } | 2279 | } |
| 2414 | req.abort(); | 2280 | req.abort(); |
| 2415 | -},sendXMLHttpRequest:function(req,_307){ | ||
| 2416 | -if(typeof (_307)=="undefined"||_307===null){ | ||
| 2417 | -_307=""; | 2281 | +},sendXMLHttpRequest:function(req,_293){ |
| 2282 | +if(typeof (_293)=="undefined"||_293===null){ | ||
| 2283 | +_293=""; | ||
| 2418 | } | 2284 | } |
| 2419 | var m=MochiKit.Base; | 2285 | var m=MochiKit.Base; |
| 2420 | var self=MochiKit.Async; | 2286 | var self=MochiKit.Async; |
| 2421 | var d=new self.Deferred(m.partial(self._xhr_canceller,req)); | 2287 | var d=new self.Deferred(m.partial(self._xhr_canceller,req)); |
| 2422 | try{ | 2288 | try{ |
| 2423 | req.onreadystatechange=m.bind(self._xhr_onreadystatechange,req,d); | 2289 | req.onreadystatechange=m.bind(self._xhr_onreadystatechange,req,d); |
| 2424 | -req.send(_307); | 2290 | +req.send(_293); |
| 2425 | } | 2291 | } |
| 2426 | catch(e){ | 2292 | catch(e){ |
| 2427 | try{ | 2293 | try{ |
| @@ -2432,75 +2298,45 @@ catch(ignore){ | @@ -2432,75 +2298,45 @@ catch(ignore){ | ||
| 2432 | d.errback(e); | 2298 | d.errback(e); |
| 2433 | } | 2299 | } |
| 2434 | return d; | 2300 | return d; |
| 2435 | -},doXHR:function(url,opts){ | ||
| 2436 | -var m=MochiKit.Base; | ||
| 2437 | -opts=m.update({method:"GET",sendContent:""},opts); | 2301 | +},doSimpleXMLHttpRequest:function(url){ |
| 2438 | var self=MochiKit.Async; | 2302 | var self=MochiKit.Async; |
| 2439 | var req=self.getXMLHttpRequest(); | 2303 | var req=self.getXMLHttpRequest(); |
| 2440 | -if(opts.queryString){ | ||
| 2441 | -var qs=m.queryString(opts.queryString); | ||
| 2442 | -if(qs){ | ||
| 2443 | -url+="?"+qs; | ||
| 2444 | -} | ||
| 2445 | -} | ||
| 2446 | -req.open(opts.method,url,true,opts.username,opts.password); | ||
| 2447 | -if(req.overrideMimeType&&opts.mimeType){ | ||
| 2448 | -req.overrideMimeType(opts.mimeType); | ||
| 2449 | -} | ||
| 2450 | -if(opts.headers){ | ||
| 2451 | -var _311=opts.headers; | ||
| 2452 | -if(!m.isArrayLike(_311)){ | ||
| 2453 | -_311=m.items(_311); | ||
| 2454 | -} | ||
| 2455 | -for(var i=0;i<_311.length;i++){ | ||
| 2456 | -var _312=_311[i]; | ||
| 2457 | -var name=_312[0]; | ||
| 2458 | -var _313=_312[1]; | ||
| 2459 | -req.setRequestHeader(name,_313); | ||
| 2460 | -} | ||
| 2461 | -} | ||
| 2462 | -return self.sendXMLHttpRequest(req,opts.sendContent); | ||
| 2463 | -},_buildURL:function(url){ | ||
| 2464 | if(arguments.length>1){ | 2304 | if(arguments.length>1){ |
| 2465 | var m=MochiKit.Base; | 2305 | var m=MochiKit.Base; |
| 2466 | var qs=m.queryString.apply(null,m.extend(null,arguments,1)); | 2306 | var qs=m.queryString.apply(null,m.extend(null,arguments,1)); |
| 2467 | if(qs){ | 2307 | if(qs){ |
| 2468 | -return url+"?"+qs; | 2308 | +url+="?"+qs; |
| 2469 | } | 2309 | } |
| 2470 | } | 2310 | } |
| 2471 | -return url; | ||
| 2472 | -},doSimpleXMLHttpRequest:function(url){ | ||
| 2473 | -var self=MochiKit.Async; | ||
| 2474 | -url=self._buildURL.apply(self,arguments); | ||
| 2475 | -return self.doXHR(url); | 2311 | +req.open("GET",url,true); |
| 2312 | +return self.sendXMLHttpRequest(req); | ||
| 2476 | },loadJSONDoc:function(url){ | 2313 | },loadJSONDoc:function(url){ |
| 2477 | var self=MochiKit.Async; | 2314 | var self=MochiKit.Async; |
| 2478 | -url=self._buildURL.apply(self,arguments); | ||
| 2479 | -var d=self.doXHR(url,{"mimeType":"text/plain","headers":[["Accept","application/json"]]}); | 2315 | +var d=self.doSimpleXMLHttpRequest.apply(self,arguments); |
| 2480 | d=d.addCallback(self.evalJSONRequest); | 2316 | d=d.addCallback(self.evalJSONRequest); |
| 2481 | return d; | 2317 | return d; |
| 2482 | -},wait:function(_314,_315){ | 2318 | +},wait:function(_296,_297){ |
| 2483 | var d=new MochiKit.Async.Deferred(); | 2319 | var d=new MochiKit.Async.Deferred(); |
| 2484 | var m=MochiKit.Base; | 2320 | var m=MochiKit.Base; |
| 2485 | -if(typeof (_315)!="undefined"){ | 2321 | +if(typeof (_297)!="undefined"){ |
| 2486 | d.addCallback(function(){ | 2322 | d.addCallback(function(){ |
| 2487 | -return _315; | 2323 | +return _297; |
| 2488 | }); | 2324 | }); |
| 2489 | } | 2325 | } |
| 2490 | -var _316=setTimeout(m.bind("callback",d),Math.floor(_314*1000)); | 2326 | +var _298=setTimeout(m.bind("callback",d),Math.floor(_296*1000)); |
| 2491 | d.canceller=function(){ | 2327 | d.canceller=function(){ |
| 2492 | try{ | 2328 | try{ |
| 2493 | -clearTimeout(_316); | 2329 | +clearTimeout(_298); |
| 2494 | } | 2330 | } |
| 2495 | catch(e){ | 2331 | catch(e){ |
| 2496 | } | 2332 | } |
| 2497 | }; | 2333 | }; |
| 2498 | return d; | 2334 | return d; |
| 2499 | -},callLater:function(_317,func){ | 2335 | +},callLater:function(_299,func){ |
| 2500 | var m=MochiKit.Base; | 2336 | var m=MochiKit.Base; |
| 2501 | -var _318=m.partial.apply(m,m.extend(null,arguments,1)); | ||
| 2502 | -return MochiKit.Async.wait(_317).addCallback(function(res){ | ||
| 2503 | -return _318(); | 2337 | +var _300=m.partial.apply(m,m.extend(null,arguments,1)); |
| 2338 | +return MochiKit.Async.wait(_299).addCallback(function(res){ | ||
| 2339 | +return _300(); | ||
| 2504 | }); | 2340 | }); |
| 2505 | }}); | 2341 | }}); |
| 2506 | MochiKit.Async.DeferredLock=function(){ | 2342 | MochiKit.Async.DeferredLock=function(){ |
| @@ -2509,7 +2345,7 @@ this.locked=false; | @@ -2509,7 +2345,7 @@ this.locked=false; | ||
| 2509 | this.id=this._nextId(); | 2345 | this.id=this._nextId(); |
| 2510 | }; | 2346 | }; |
| 2511 | MochiKit.Async.DeferredLock.prototype={__class__:MochiKit.Async.DeferredLock,acquire:function(){ | 2347 | MochiKit.Async.DeferredLock.prototype={__class__:MochiKit.Async.DeferredLock,acquire:function(){ |
| 2512 | -var d=new MochiKit.Async.Deferred(); | 2348 | +d=new MochiKit.Async.Deferred(); |
| 2513 | if(this.locked){ | 2349 | if(this.locked){ |
| 2514 | this.waiting.push(d); | 2350 | this.waiting.push(d); |
| 2515 | }else{ | 2351 | }else{ |
| @@ -2527,44 +2363,48 @@ this.locked=true; | @@ -2527,44 +2363,48 @@ this.locked=true; | ||
| 2527 | this.waiting.shift().callback(this); | 2363 | this.waiting.shift().callback(this); |
| 2528 | } | 2364 | } |
| 2529 | },_nextId:MochiKit.Base.counter(),repr:function(){ | 2365 | },_nextId:MochiKit.Base.counter(),repr:function(){ |
| 2530 | -var _319; | 2366 | +var _301; |
| 2531 | if(this.locked){ | 2367 | if(this.locked){ |
| 2532 | -_319="locked, "+this.waiting.length+" waiting"; | 2368 | +_301="locked, "+this.waiting.length+" waiting"; |
| 2533 | }else{ | 2369 | }else{ |
| 2534 | -_319="unlocked"; | 2370 | +_301="unlocked"; |
| 2535 | } | 2371 | } |
| 2536 | -return "DeferredLock("+this.id+", "+_319+")"; | 2372 | +return "DeferredLock("+this.id+", "+_301+")"; |
| 2537 | },toString:MochiKit.Base.forwardCall("repr")}; | 2373 | },toString:MochiKit.Base.forwardCall("repr")}; |
| 2538 | -MochiKit.Async.DeferredList=function(list,_321,_322,_323,_324){ | ||
| 2539 | -MochiKit.Async.Deferred.apply(this,[_324]); | 2374 | +MochiKit.Async.DeferredList=function(list,_303,_304,_305,_306){ |
| 2540 | this.list=list; | 2375 | this.list=list; |
| 2541 | -var _325=[]; | ||
| 2542 | -this.resultList=_325; | ||
| 2543 | -this.finishedCount=0; | ||
| 2544 | -this.fireOnOneCallback=_321; | ||
| 2545 | -this.fireOnOneErrback=_322; | ||
| 2546 | -this.consumeErrors=_323; | ||
| 2547 | -var cb=MochiKit.Base.bind(this._cbDeferred,this); | ||
| 2548 | -for(var i=0;i<list.length;i++){ | ||
| 2549 | -var d=list[i]; | ||
| 2550 | -_325.push(undefined); | ||
| 2551 | -d.addCallback(cb,i,true); | ||
| 2552 | -d.addErrback(cb,i,false); | ||
| 2553 | -} | ||
| 2554 | -if(list.length===0&&!_321){ | 2376 | +this.resultList=new Array(this.list.length); |
| 2377 | +this.chain=[]; | ||
| 2378 | +this.id=this._nextId(); | ||
| 2379 | +this.fired=-1; | ||
| 2380 | +this.paused=0; | ||
| 2381 | +this.results=[null,null]; | ||
| 2382 | +this.canceller=_306; | ||
| 2383 | +this.silentlyCancelled=false; | ||
| 2384 | +if(this.list.length===0&&!_303){ | ||
| 2555 | this.callback(this.resultList); | 2385 | this.callback(this.resultList); |
| 2556 | } | 2386 | } |
| 2557 | -}; | ||
| 2558 | -MochiKit.Async.DeferredList.prototype=new MochiKit.Async.Deferred(); | ||
| 2559 | -MochiKit.Async.DeferredList.prototype._cbDeferred=function(_326,_327,_328){ | ||
| 2560 | -this.resultList[_326]=[_327,_328]; | 2387 | +this.finishedCount=0; |
| 2388 | +this.fireOnOneCallback=_303; | ||
| 2389 | +this.fireOnOneErrback=_304; | ||
| 2390 | +this.consumeErrors=_305; | ||
| 2391 | +var _307=0; | ||
| 2392 | +MochiKit.Base.map(MochiKit.Base.bind(function(d){ | ||
| 2393 | +d.addCallback(MochiKit.Base.bind(this._cbDeferred,this),_307,true); | ||
| 2394 | +d.addErrback(MochiKit.Base.bind(this._cbDeferred,this),_307,false); | ||
| 2395 | +_307+=1; | ||
| 2396 | +},this),this.list); | ||
| 2397 | +}; | ||
| 2398 | +MochiKit.Base.update(MochiKit.Async.DeferredList.prototype,MochiKit.Async.Deferred.prototype); | ||
| 2399 | +MochiKit.Base.update(MochiKit.Async.DeferredList.prototype,{_cbDeferred:function(_308,_309,_310){ | ||
| 2400 | +this.resultList[_308]=[_309,_310]; | ||
| 2561 | this.finishedCount+=1; | 2401 | this.finishedCount+=1; |
| 2562 | -if(this.fired==-1){ | ||
| 2563 | -if(_327&&this.fireOnOneCallback){ | ||
| 2564 | -this.callback([_326,_328]); | 2402 | +if(this.fired!==0){ |
| 2403 | +if(_309&&this.fireOnOneCallback){ | ||
| 2404 | +this.callback([_308,_310]); | ||
| 2565 | }else{ | 2405 | }else{ |
| 2566 | -if(!_327&&this.fireOnOneErrback){ | ||
| 2567 | -this.errback(_328); | 2406 | +if(!_309&&this.fireOnOneErrback){ |
| 2407 | +this.errback(_310); | ||
| 2568 | }else{ | 2408 | }else{ |
| 2569 | if(this.finishedCount==this.list.length){ | 2409 | if(this.finishedCount==this.list.length){ |
| 2570 | this.callback(this.resultList); | 2410 | this.callback(this.resultList); |
| @@ -2572,17 +2412,17 @@ this.callback(this.resultList); | @@ -2572,17 +2412,17 @@ this.callback(this.resultList); | ||
| 2572 | } | 2412 | } |
| 2573 | } | 2413 | } |
| 2574 | } | 2414 | } |
| 2575 | -if(!_327&&this.consumeErrors){ | ||
| 2576 | -_328=null; | 2415 | +if(!_309&&this.consumeErrors){ |
| 2416 | +_310=null; | ||
| 2577 | } | 2417 | } |
| 2578 | -return _328; | ||
| 2579 | -}; | ||
| 2580 | -MochiKit.Async.gatherResults=function(_329){ | ||
| 2581 | -var d=new MochiKit.Async.DeferredList(_329,false,true,false); | ||
| 2582 | -d.addCallback(function(_330){ | 2418 | +return _310; |
| 2419 | +}}); | ||
| 2420 | +MochiKit.Async.gatherResults=function(_311){ | ||
| 2421 | +var d=new MochiKit.Async.DeferredList(_311,false,true,false); | ||
| 2422 | +d.addCallback(function(_312){ | ||
| 2583 | var ret=[]; | 2423 | var ret=[]; |
| 2584 | -for(var i=0;i<_330.length;i++){ | ||
| 2585 | -ret.push(_330[i][1]); | 2424 | +for(var i=0;i<_312.length;i++){ |
| 2425 | +ret.push(_312[i][1]); | ||
| 2586 | } | 2426 | } |
| 2587 | return ret; | 2427 | return ret; |
| 2588 | }); | 2428 | }); |
| @@ -2590,34 +2430,34 @@ return d; | @@ -2590,34 +2430,34 @@ return d; | ||
| 2590 | }; | 2430 | }; |
| 2591 | MochiKit.Async.maybeDeferred=function(func){ | 2431 | MochiKit.Async.maybeDeferred=function(func){ |
| 2592 | var self=MochiKit.Async; | 2432 | var self=MochiKit.Async; |
| 2593 | -var _331; | 2433 | +var _313; |
| 2594 | try{ | 2434 | try{ |
| 2595 | var r=func.apply(null,MochiKit.Base.extend([],arguments,1)); | 2435 | var r=func.apply(null,MochiKit.Base.extend([],arguments,1)); |
| 2596 | if(r instanceof self.Deferred){ | 2436 | if(r instanceof self.Deferred){ |
| 2597 | -_331=r; | 2437 | +_313=r; |
| 2598 | }else{ | 2438 | }else{ |
| 2599 | if(r instanceof Error){ | 2439 | if(r instanceof Error){ |
| 2600 | -_331=self.fail(r); | 2440 | +_313=self.fail(r); |
| 2601 | }else{ | 2441 | }else{ |
| 2602 | -_331=self.succeed(r); | 2442 | +_313=self.succeed(r); |
| 2603 | } | 2443 | } |
| 2604 | } | 2444 | } |
| 2605 | } | 2445 | } |
| 2606 | catch(e){ | 2446 | catch(e){ |
| 2607 | -_331=self.fail(e); | 2447 | +_313=self.fail(e); |
| 2608 | } | 2448 | } |
| 2609 | -return _331; | 2449 | +return _313; |
| 2610 | }; | 2450 | }; |
| 2611 | -MochiKit.Async.EXPORT=["AlreadyCalledError","CancelledError","BrowserComplianceError","GenericError","XMLHttpRequestError","Deferred","succeed","fail","getXMLHttpRequest","doSimpleXMLHttpRequest","loadJSONDoc","wait","callLater","sendXMLHttpRequest","DeferredLock","DeferredList","gatherResults","maybeDeferred","doXHR"]; | 2451 | +MochiKit.Async.EXPORT=["AlreadyCalledError","CancelledError","BrowserComplianceError","GenericError","XMLHttpRequestError","Deferred","succeed","fail","getXMLHttpRequest","doSimpleXMLHttpRequest","loadJSONDoc","wait","callLater","sendXMLHttpRequest","DeferredLock","DeferredList","gatherResults","maybeDeferred"]; |
| 2612 | MochiKit.Async.EXPORT_OK=["evalJSONRequest"]; | 2452 | MochiKit.Async.EXPORT_OK=["evalJSONRequest"]; |
| 2613 | MochiKit.Async.__new__=function(){ | 2453 | MochiKit.Async.__new__=function(){ |
| 2614 | var m=MochiKit.Base; | 2454 | var m=MochiKit.Base; |
| 2615 | var ne=m.partial(m._newNamedError,this); | 2455 | var ne=m.partial(m._newNamedError,this); |
| 2616 | -ne("AlreadyCalledError",function(_334){ | ||
| 2617 | -this.deferred=_334; | 2456 | +ne("AlreadyCalledError",function(_316){ |
| 2457 | +this.deferred=_316; | ||
| 2618 | }); | 2458 | }); |
| 2619 | -ne("CancelledError",function(_335){ | ||
| 2620 | -this.deferred=_335; | 2459 | +ne("CancelledError",function(_317){ |
| 2460 | +this.deferred=_317; | ||
| 2621 | }); | 2461 | }); |
| 2622 | ne("BrowserComplianceError",function(msg){ | 2462 | ne("BrowserComplianceError",function(msg){ |
| 2623 | this.message=msg; | 2463 | this.message=msg; |
| @@ -2641,35 +2481,182 @@ MochiKit.Async.__new__(); | @@ -2641,35 +2481,182 @@ MochiKit.Async.__new__(); | ||
| 2641 | MochiKit.Base._exportSymbols(this,MochiKit.Async); | 2481 | MochiKit.Base._exportSymbols(this,MochiKit.Async); |
| 2642 | if(typeof (dojo)!="undefined"){ | 2482 | if(typeof (dojo)!="undefined"){ |
| 2643 | dojo.provide("MochiKit.DOM"); | 2483 | dojo.provide("MochiKit.DOM"); |
| 2644 | -dojo.require("MochiKit.Base"); | 2484 | +dojo.require("MochiKit.Iter"); |
| 2645 | } | 2485 | } |
| 2646 | if(typeof (JSAN)!="undefined"){ | 2486 | if(typeof (JSAN)!="undefined"){ |
| 2647 | -JSAN.use("MochiKit.Base",[]); | 2487 | +JSAN.use("MochiKit.Iter",[]); |
| 2648 | } | 2488 | } |
| 2649 | try{ | 2489 | try{ |
| 2650 | -if(typeof (MochiKit.Base)=="undefined"){ | 2490 | +if(typeof (MochiKit.Iter)=="undefined"){ |
| 2651 | throw ""; | 2491 | throw ""; |
| 2652 | } | 2492 | } |
| 2653 | } | 2493 | } |
| 2654 | catch(e){ | 2494 | catch(e){ |
| 2655 | -throw "MochiKit.DOM depends on MochiKit.Base!"; | 2495 | +throw "MochiKit.DOM depends on MochiKit.Iter!"; |
| 2656 | } | 2496 | } |
| 2657 | if(typeof (MochiKit.DOM)=="undefined"){ | 2497 | if(typeof (MochiKit.DOM)=="undefined"){ |
| 2658 | MochiKit.DOM={}; | 2498 | MochiKit.DOM={}; |
| 2659 | } | 2499 | } |
| 2660 | MochiKit.DOM.NAME="MochiKit.DOM"; | 2500 | MochiKit.DOM.NAME="MochiKit.DOM"; |
| 2661 | -MochiKit.DOM.VERSION="1.4"; | 2501 | +MochiKit.DOM.VERSION="1.3.1"; |
| 2662 | MochiKit.DOM.__repr__=function(){ | 2502 | MochiKit.DOM.__repr__=function(){ |
| 2663 | return "["+this.NAME+" "+this.VERSION+"]"; | 2503 | return "["+this.NAME+" "+this.VERSION+"]"; |
| 2664 | }; | 2504 | }; |
| 2665 | MochiKit.DOM.toString=function(){ | 2505 | MochiKit.DOM.toString=function(){ |
| 2666 | return this.__repr__(); | 2506 | return this.__repr__(); |
| 2667 | }; | 2507 | }; |
| 2668 | -MochiKit.DOM.EXPORT=["removeEmptyTextNodes","formContents","currentWindow","currentDocument","withWindow","withDocument","registerDOMConverter","coerceToDOM","createDOM","createDOMFunc","isChildNode","getNodeAttribute","removeNodeAttribute","setNodeAttribute","updateNodeAttributes","appendChildNodes","insertSiblingNodesAfter","insertSiblingNodesBefore","replaceChildNodes","removeElement","swapDOM","BUTTON","TT","PRE","H1","H2","H3","BR","CANVAS","HR","LABEL","TEXTAREA","FORM","STRONG","SELECT","OPTION","OPTGROUP","LEGEND","FIELDSET","P","UL","OL","LI","TD","TR","THEAD","TBODY","TFOOT","TABLE","TH","INPUT","SPAN","A","DIV","IMG","getElement","$","getElementsByTagAndClassName","addToCallStack","addLoadEvent","focusOnLoad","setElementClass","toggleElementClass","addElementClass","removeElementClass","swapElementClass","hasElementClass","escapeHTML","toHTML","emitHTML","scrapeText","isParent","getFirstParentByTagAndClassName","makeClipping","undoClipping","makePositioned","undoPositioned","getFirstElementByTagAndClassName"]; | 2508 | +MochiKit.DOM.EXPORT=["formContents","currentWindow","currentDocument","withWindow","withDocument","registerDOMConverter","coerceToDOM","createDOM","createDOMFunc","getNodeAttribute","setNodeAttribute","updateNodeAttributes","appendChildNodes","replaceChildNodes","removeElement","swapDOM","BUTTON","TT","PRE","H1","H2","H3","BR","CANVAS","HR","LABEL","TEXTAREA","FORM","STRONG","SELECT","OPTION","OPTGROUP","LEGEND","FIELDSET","P","UL","OL","LI","TD","TR","THEAD","TBODY","TFOOT","TABLE","TH","INPUT","SPAN","A","DIV","IMG","getElement","$","computedStyle","getElementsByTagAndClassName","addToCallStack","addLoadEvent","focusOnLoad","setElementClass","toggleElementClass","addElementClass","removeElementClass","swapElementClass","hasElementClass","escapeHTML","toHTML","emitHTML","setDisplayForElement","hideElement","showElement","scrapeText","elementDimensions","elementPosition","setElementDimensions","setElementPosition","getViewportDimensions","setOpacity"]; |
| 2669 | MochiKit.DOM.EXPORT_OK=["domConverters"]; | 2509 | MochiKit.DOM.EXPORT_OK=["domConverters"]; |
| 2670 | -MochiKit.DOM.DEPRECATED=[["computedStyle","MochiKit.Style.getStyle","1.4"],["elementDimensions","MochiKit.Style.getElementDimensions","1.4"],["elementPosition","MochiKit.Style.getElementPosition","1.4"],["hideElement","MochiKit.Style.hideElement","1.4"],["setElementDimensions","MochiKit.Style.setElementDimensions","1.4"],["setElementPosition","MochiKit.Style.setElementPosition","1.4"],["setDisplayForElement","MochiKit.Style.setDisplayForElement","1.4"],["setOpacity","MochiKit.Style.setOpacity","1.4"],["showElement","MochiKit.Style.showElement","1.4"],["Coordinates","MochiKit.Style.Coordinates","1.4"],["Dimensions","MochiKit.Style.Dimensions","1.4"]]; | ||
| 2671 | -MochiKit.DOM.getViewportDimensions=new Function(""+"if (!MochiKit[\"Style\"]) {"+" throw new Error(\"This function has been deprecated and depends on MochiKit.Style.\");"+"}"+"return MochiKit.Style.getViewportDimensions.apply(this, arguments);"); | ||
| 2672 | -MochiKit.Base.update(MochiKit.DOM,{currentWindow:function(){ | 2510 | +MochiKit.DOM.Dimensions=function(w,h){ |
| 2511 | +this.w=w; | ||
| 2512 | +this.h=h; | ||
| 2513 | +}; | ||
| 2514 | +MochiKit.DOM.Dimensions.prototype.repr=function(){ | ||
| 2515 | +var repr=MochiKit.Base.repr; | ||
| 2516 | +return "{w: "+repr(this.w)+", h: "+repr(this.h)+"}"; | ||
| 2517 | +}; | ||
| 2518 | +MochiKit.DOM.Coordinates=function(x,y){ | ||
| 2519 | +this.x=x; | ||
| 2520 | +this.y=y; | ||
| 2521 | +}; | ||
| 2522 | +MochiKit.DOM.Coordinates.prototype.repr=function(){ | ||
| 2523 | +var repr=MochiKit.Base.repr; | ||
| 2524 | +return "{x: "+repr(this.x)+", y: "+repr(this.y)+"}"; | ||
| 2525 | +}; | ||
| 2526 | +MochiKit.DOM.Coordinates.prototype.toString=function(){ | ||
| 2527 | +return this.repr(); | ||
| 2528 | +}; | ||
| 2529 | +MochiKit.Base.update(MochiKit.DOM,{setOpacity:function(elem,o){ | ||
| 2530 | +elem=MochiKit.DOM.getElement(elem); | ||
| 2531 | +MochiKit.DOM.updateNodeAttributes(elem,{"style":{"opacity":o,"-moz-opacity":o,"-khtml-opacity":o,"filter":" alpha(opacity="+(o*100)+")"}}); | ||
| 2532 | +},getViewportDimensions:function(){ | ||
| 2533 | +var d=new MochiKit.DOM.Dimensions(); | ||
| 2534 | +var w=MochiKit.DOM._window; | ||
| 2535 | +var b=MochiKit.DOM._document.body; | ||
| 2536 | +if(w.innerWidth){ | ||
| 2537 | +d.w=w.innerWidth; | ||
| 2538 | +d.h=w.innerHeight; | ||
| 2539 | +}else{ | ||
| 2540 | +if(b.parentElement.clientWidth){ | ||
| 2541 | +d.w=b.parentElement.clientWidth; | ||
| 2542 | +d.h=b.parentElement.clientHeight; | ||
| 2543 | +}else{ | ||
| 2544 | +if(b&&b.clientWidth){ | ||
| 2545 | +d.w=b.clientWidth; | ||
| 2546 | +d.h=b.clientHeight; | ||
| 2547 | +} | ||
| 2548 | +} | ||
| 2549 | +} | ||
| 2550 | +return d; | ||
| 2551 | +},elementDimensions:function(elem){ | ||
| 2552 | +var self=MochiKit.DOM; | ||
| 2553 | +if(typeof (elem.w)=="number"||typeof (elem.h)=="number"){ | ||
| 2554 | +return new self.Dimensions(elem.w||0,elem.h||0); | ||
| 2555 | +} | ||
| 2556 | +elem=self.getElement(elem); | ||
| 2557 | +if(!elem){ | ||
| 2558 | +return undefined; | ||
| 2559 | +} | ||
| 2560 | +if(self.computedStyle(elem,"display")!="none"){ | ||
| 2561 | +return new self.Dimensions(elem.offsetWidth||0,elem.offsetHeight||0); | ||
| 2562 | +} | ||
| 2563 | +var s=elem.style; | ||
| 2564 | +var _322=s.visibility; | ||
| 2565 | +var _323=s.position; | ||
| 2566 | +s.visibility="hidden"; | ||
| 2567 | +s.position="absolute"; | ||
| 2568 | +s.display=""; | ||
| 2569 | +var _324=elem.offsetWidth; | ||
| 2570 | +var _325=elem.offsetHeight; | ||
| 2571 | +s.display="none"; | ||
| 2572 | +s.position=_323; | ||
| 2573 | +s.visibility=_322; | ||
| 2574 | +return new self.Dimensions(_324,_325); | ||
| 2575 | +},elementPosition:function(elem,_326){ | ||
| 2576 | +var self=MochiKit.DOM; | ||
| 2577 | +elem=self.getElement(elem); | ||
| 2578 | +if(!elem){ | ||
| 2579 | +return undefined; | ||
| 2580 | +} | ||
| 2581 | +var c=new self.Coordinates(0,0); | ||
| 2582 | +if(elem.x&&elem.y){ | ||
| 2583 | +c.x+=elem.x||0; | ||
| 2584 | +c.y+=elem.y||0; | ||
| 2585 | +return c; | ||
| 2586 | +}else{ | ||
| 2587 | +if(elem.parentNode===null||self.computedStyle(elem,"display")=="none"){ | ||
| 2588 | +return undefined; | ||
| 2589 | +} | ||
| 2590 | +} | ||
| 2591 | +var box=null; | ||
| 2592 | +var _329=null; | ||
| 2593 | +var d=MochiKit.DOM._document; | ||
| 2594 | +var de=d.documentElement; | ||
| 2595 | +var b=d.body; | ||
| 2596 | +if(elem.getBoundingClientRect){ | ||
| 2597 | +box=elem.getBoundingClientRect(); | ||
| 2598 | +c.x+=box.left+(de.scrollLeft||b.scrollLeft)-(de.clientLeft||b.clientLeft); | ||
| 2599 | +c.y+=box.top+(de.scrollTop||b.scrollTop)-(de.clientTop||b.clientTop); | ||
| 2600 | +}else{ | ||
| 2601 | +if(d.getBoxObjectFor){ | ||
| 2602 | +box=d.getBoxObjectFor(elem); | ||
| 2603 | +c.x+=box.x; | ||
| 2604 | +c.y+=box.y; | ||
| 2605 | +}else{ | ||
| 2606 | +if(elem.offsetParent){ | ||
| 2607 | +c.x+=elem.offsetLeft; | ||
| 2608 | +c.y+=elem.offsetTop; | ||
| 2609 | +_329=elem.offsetParent; | ||
| 2610 | +if(_329!=elem){ | ||
| 2611 | +while(_329){ | ||
| 2612 | +c.x+=_329.offsetLeft; | ||
| 2613 | +c.y+=_329.offsetTop; | ||
| 2614 | +_329=_329.offsetParent; | ||
| 2615 | +} | ||
| 2616 | +} | ||
| 2617 | +var ua=navigator.userAgent.toLowerCase(); | ||
| 2618 | +if((typeof (opera)!="undefined"&&parseFloat(opera.version())<9)||(ua.indexOf("safari")!=-1&&self.computedStyle(elem,"position")=="absolute")){ | ||
| 2619 | +c.x-=b.offsetLeft; | ||
| 2620 | +c.y-=b.offsetTop; | ||
| 2621 | +} | ||
| 2622 | +} | ||
| 2623 | +} | ||
| 2624 | +} | ||
| 2625 | +if(typeof (_326)!="undefined"){ | ||
| 2626 | +_326=arguments.callee(_326); | ||
| 2627 | +if(_326){ | ||
| 2628 | +c.x-=(_326.x||0); | ||
| 2629 | +c.y-=(_326.y||0); | ||
| 2630 | +} | ||
| 2631 | +} | ||
| 2632 | +if(elem.parentNode){ | ||
| 2633 | +_329=elem.parentNode; | ||
| 2634 | +}else{ | ||
| 2635 | +_329=null; | ||
| 2636 | +} | ||
| 2637 | +while(_329&&_329.tagName!="BODY"&&_329.tagName!="HTML"){ | ||
| 2638 | +c.x-=_329.scrollLeft; | ||
| 2639 | +c.y-=_329.scrollTop; | ||
| 2640 | +if(_329.parentNode){ | ||
| 2641 | +_329=_329.parentNode; | ||
| 2642 | +}else{ | ||
| 2643 | +_329=null; | ||
| 2644 | +} | ||
| 2645 | +} | ||
| 2646 | +return c; | ||
| 2647 | +},setElementDimensions:function(elem,_332,_333){ | ||
| 2648 | +elem=MochiKit.DOM.getElement(elem); | ||
| 2649 | +if(typeof (_333)=="undefined"){ | ||
| 2650 | +_333="px"; | ||
| 2651 | +} | ||
| 2652 | +MochiKit.DOM.updateNodeAttributes(elem,{"style":{"width":_332.w+_333,"height":_332.h+_333}}); | ||
| 2653 | +},setElementPosition:function(elem,_334,_335){ | ||
| 2654 | +elem=MochiKit.DOM.getElement(elem); | ||
| 2655 | +if(typeof (_335)=="undefined"){ | ||
| 2656 | +_335="px"; | ||
| 2657 | +} | ||
| 2658 | +MochiKit.DOM.updateNodeAttributes(elem,{"style":{"left":_334.x+_335,"top":_334.y+_335}}); | ||
| 2659 | +},currentWindow:function(){ | ||
| 2673 | return MochiKit.DOM._window; | 2660 | return MochiKit.DOM._window; |
| 2674 | },currentDocument:function(){ | 2661 | },currentDocument:function(){ |
| 2675 | return MochiKit.DOM._document; | 2662 | return MochiKit.DOM._document; |
| @@ -2697,61 +2684,29 @@ var _340=[]; | @@ -2697,61 +2684,29 @@ var _340=[]; | ||
| 2697 | var m=MochiKit.Base; | 2684 | var m=MochiKit.Base; |
| 2698 | var self=MochiKit.DOM; | 2685 | var self=MochiKit.DOM; |
| 2699 | if(typeof (elem)=="undefined"||elem===null){ | 2686 | if(typeof (elem)=="undefined"||elem===null){ |
| 2700 | -elem=self._document.body; | 2687 | +elem=self._document; |
| 2701 | }else{ | 2688 | }else{ |
| 2702 | elem=self.getElement(elem); | 2689 | elem=self.getElement(elem); |
| 2703 | } | 2690 | } |
| 2704 | m.nodeWalk(elem,function(elem){ | 2691 | m.nodeWalk(elem,function(elem){ |
| 2705 | var name=elem.name; | 2692 | var name=elem.name; |
| 2706 | if(m.isNotEmpty(name)){ | 2693 | if(m.isNotEmpty(name)){ |
| 2707 | -var _341=elem.tagName.toUpperCase(); | ||
| 2708 | -if(_341==="INPUT"&&(elem.type=="radio"||elem.type=="checkbox")&&!elem.checked){ | 2694 | +var _341=elem.nodeName; |
| 2695 | +if(_341=="INPUT"&&(elem.type=="radio"||elem.type=="checkbox")&&!elem.checked){ | ||
| 2709 | return null; | 2696 | return null; |
| 2710 | } | 2697 | } |
| 2711 | -if(_341==="SELECT"){ | ||
| 2712 | -if(elem.type=="select-one"){ | 2698 | +if(_341=="SELECT"){ |
| 2713 | if(elem.selectedIndex>=0){ | 2699 | if(elem.selectedIndex>=0){ |
| 2714 | var opt=elem.options[elem.selectedIndex]; | 2700 | var opt=elem.options[elem.selectedIndex]; |
| 2715 | -var v=opt.value; | ||
| 2716 | -if(!v){ | ||
| 2717 | -var h=opt.outerHTML; | ||
| 2718 | -if(h&&!h.match(/^[^>]+\svalue\s*=/i)){ | ||
| 2719 | -v=opt.text; | ||
| 2720 | -} | ||
| 2721 | -} | ||
| 2722 | _339.push(name); | 2701 | _339.push(name); |
| 2723 | -_340.push(v); | 2702 | +_340.push((opt.value)?opt.value:opt.text); |
| 2724 | return null; | 2703 | return null; |
| 2725 | } | 2704 | } |
| 2726 | _339.push(name); | 2705 | _339.push(name); |
| 2727 | _340.push(""); | 2706 | _340.push(""); |
| 2728 | return null; | 2707 | return null; |
| 2729 | -}else{ | ||
| 2730 | -var opts=elem.options; | ||
| 2731 | -if(!opts.length){ | ||
| 2732 | -_339.push(name); | ||
| 2733 | -_340.push(""); | ||
| 2734 | -return null; | ||
| 2735 | -} | ||
| 2736 | -for(var i=0;i<opts.length;i++){ | ||
| 2737 | -var opt=opts[i]; | ||
| 2738 | -if(!opt.selected){ | ||
| 2739 | -continue; | ||
| 2740 | -} | ||
| 2741 | -var v=opt.value; | ||
| 2742 | -if(!v){ | ||
| 2743 | -var h=opt.outerHTML; | ||
| 2744 | -if(h&&!h.match(/^[^>]+\svalue\s*=/i)){ | ||
| 2745 | -v=opt.text; | ||
| 2746 | -} | ||
| 2747 | -} | ||
| 2748 | -_339.push(name); | ||
| 2749 | -_340.push(v); | ||
| 2750 | -} | ||
| 2751 | -return null; | ||
| 2752 | -} | ||
| 2753 | } | 2708 | } |
| 2754 | -if(_341==="FORM"||_341==="P"||_341==="SPAN"||_341==="DIV"){ | 2709 | +if(_341=="FORM"||_341=="P"||_341=="SPAN"||_341=="DIV"){ |
| 2755 | return elem.childNodes; | 2710 | return elem.childNodes; |
| 2756 | } | 2711 | } |
| 2757 | _339.push(name); | 2712 | _339.push(name); |
| @@ -2763,32 +2718,29 @@ return elem.childNodes; | @@ -2763,32 +2718,29 @@ return elem.childNodes; | ||
| 2763 | return [_339,_340]; | 2718 | return [_339,_340]; |
| 2764 | },withDocument:function(doc,func){ | 2719 | },withDocument:function(doc,func){ |
| 2765 | var self=MochiKit.DOM; | 2720 | var self=MochiKit.DOM; |
| 2766 | -var _345=self._document; | 2721 | +var _344=self._document; |
| 2767 | var rval; | 2722 | var rval; |
| 2768 | try{ | 2723 | try{ |
| 2769 | self._document=doc; | 2724 | self._document=doc; |
| 2770 | rval=func(); | 2725 | rval=func(); |
| 2771 | } | 2726 | } |
| 2772 | catch(e){ | 2727 | catch(e){ |
| 2773 | -self._document=_345; | 2728 | +self._document=_344; |
| 2774 | throw e; | 2729 | throw e; |
| 2775 | } | 2730 | } |
| 2776 | -self._document=_345; | 2731 | +self._document=_344; |
| 2777 | return rval; | 2732 | return rval; |
| 2778 | -},registerDOMConverter:function(name,_346,wrap,_347){ | ||
| 2779 | -MochiKit.DOM.domConverters.register(name,_346,wrap,_347); | 2733 | +},registerDOMConverter:function(name,_345,wrap,_346){ |
| 2734 | +MochiKit.DOM.domConverters.register(name,_345,wrap,_346); | ||
| 2780 | },coerceToDOM:function(node,ctx){ | 2735 | },coerceToDOM:function(node,ctx){ |
| 2781 | -var m=MochiKit.Base; | ||
| 2782 | var im=MochiKit.Iter; | 2736 | var im=MochiKit.Iter; |
| 2783 | var self=MochiKit.DOM; | 2737 | var self=MochiKit.DOM; |
| 2784 | -if(im){ | ||
| 2785 | var iter=im.iter; | 2738 | var iter=im.iter; |
| 2786 | -var _351=im.repeat; | ||
| 2787 | -var map=m.map; | ||
| 2788 | -} | 2739 | +var _350=im.repeat; |
| 2740 | +var imap=im.imap; | ||
| 2789 | var _352=self.domConverters; | 2741 | var _352=self.domConverters; |
| 2790 | -var _353=arguments.callee; | ||
| 2791 | -var _354=m.NotFound; | 2742 | +var _353=self.coerceToDOM; |
| 2743 | +var _354=MochiKit.Base.NotFound; | ||
| 2792 | while(true){ | 2744 | while(true){ |
| 2793 | if(typeof (node)=="undefined"||node===null){ | 2745 | if(typeof (node)=="undefined"||node===null){ |
| 2794 | return null; | 2746 | return null; |
| @@ -2802,19 +2754,14 @@ node=node.toString(); | @@ -2802,19 +2754,14 @@ node=node.toString(); | ||
| 2802 | if(typeof (node)=="string"){ | 2754 | if(typeof (node)=="string"){ |
| 2803 | return self._document.createTextNode(node); | 2755 | return self._document.createTextNode(node); |
| 2804 | } | 2756 | } |
| 2805 | -if(typeof (node.__dom__)=="function"){ | ||
| 2806 | -node=node.__dom__(ctx); | ||
| 2807 | -continue; | ||
| 2808 | -} | ||
| 2809 | -if(typeof (node.dom)=="function"){ | ||
| 2810 | -node=node.dom(ctx); | 2757 | +if(typeof (node.toDOM)=="function"){ |
| 2758 | +node=node.toDOM(ctx); | ||
| 2811 | continue; | 2759 | continue; |
| 2812 | } | 2760 | } |
| 2813 | if(typeof (node)=="function"){ | 2761 | if(typeof (node)=="function"){ |
| 2814 | -node=node.apply(ctx,[ctx]); | 2762 | +node=node(ctx); |
| 2815 | continue; | 2763 | continue; |
| 2816 | } | 2764 | } |
| 2817 | -if(im){ | ||
| 2818 | var _355=null; | 2765 | var _355=null; |
| 2819 | try{ | 2766 | try{ |
| 2820 | _355=iter(node); | 2767 | _355=iter(node); |
| @@ -2822,8 +2769,7 @@ _355=iter(node); | @@ -2822,8 +2769,7 @@ _355=iter(node); | ||
| 2822 | catch(e){ | 2769 | catch(e){ |
| 2823 | } | 2770 | } |
| 2824 | if(_355){ | 2771 | if(_355){ |
| 2825 | -return map(_353,_355,_351(ctx)); | ||
| 2826 | -} | 2772 | +return imap(_353,_355,_350(ctx)); |
| 2827 | } | 2773 | } |
| 2828 | try{ | 2774 | try{ |
| 2829 | node=_352.match(node,ctx); | 2775 | node=_352.match(node,ctx); |
| @@ -2837,27 +2783,9 @@ throw e; | @@ -2837,27 +2783,9 @@ throw e; | ||
| 2837 | return self._document.createTextNode(node.toString()); | 2783 | return self._document.createTextNode(node.toString()); |
| 2838 | } | 2784 | } |
| 2839 | return undefined; | 2785 | return undefined; |
| 2840 | -},isChildNode:function(node,_356){ | ||
| 2841 | -var self=MochiKit.DOM; | ||
| 2842 | -if(typeof (node)=="string"){ | ||
| 2843 | -node=self.getElement(node); | ||
| 2844 | -} | ||
| 2845 | -if(typeof (_356)=="string"){ | ||
| 2846 | -_356=self.getElement(_356); | ||
| 2847 | -} | ||
| 2848 | -if(node===_356){ | ||
| 2849 | -return true; | ||
| 2850 | -} | ||
| 2851 | -while(node&&node.tagName.toUpperCase()!="BODY"){ | ||
| 2852 | -node=node.parentNode; | ||
| 2853 | -if(node===_356){ | ||
| 2854 | -return true; | ||
| 2855 | -} | ||
| 2856 | -} | ||
| 2857 | -return false; | ||
| 2858 | -},setNodeAttribute:function(node,attr,_358){ | 2786 | +},setNodeAttribute:function(node,attr,_357){ |
| 2859 | var o={}; | 2787 | var o={}; |
| 2860 | -o[attr]=_358; | 2788 | +o[attr]=_357; |
| 2861 | try{ | 2789 | try{ |
| 2862 | return MochiKit.DOM.updateNodeAttributes(node,o); | 2790 | return MochiKit.DOM.updateNodeAttributes(node,o); |
| 2863 | } | 2791 | } |
| @@ -2866,47 +2794,30 @@ catch(e){ | @@ -2866,47 +2794,30 @@ catch(e){ | ||
| 2866 | return null; | 2794 | return null; |
| 2867 | },getNodeAttribute:function(node,attr){ | 2795 | },getNodeAttribute:function(node,attr){ |
| 2868 | var self=MochiKit.DOM; | 2796 | var self=MochiKit.DOM; |
| 2869 | -var _359=self.attributeArray.renames[attr]; | 2797 | +var _358=self.attributeArray.renames[attr]; |
| 2870 | node=self.getElement(node); | 2798 | node=self.getElement(node); |
| 2871 | try{ | 2799 | try{ |
| 2872 | -if(_359){ | ||
| 2873 | -return node[_359]; | 2800 | +if(_358){ |
| 2801 | +return node[_358]; | ||
| 2874 | } | 2802 | } |
| 2875 | return node.getAttribute(attr); | 2803 | return node.getAttribute(attr); |
| 2876 | } | 2804 | } |
| 2877 | catch(e){ | 2805 | catch(e){ |
| 2878 | } | 2806 | } |
| 2879 | return null; | 2807 | return null; |
| 2880 | -},removeNodeAttribute:function(node,attr){ | ||
| 2881 | -var self=MochiKit.DOM; | ||
| 2882 | -var _360=self.attributeArray.renames[attr]; | ||
| 2883 | -node=self.getElement(node); | ||
| 2884 | -try{ | ||
| 2885 | -if(_360){ | ||
| 2886 | -return node[_360]; | ||
| 2887 | -} | ||
| 2888 | -return node.removeAttribute(attr); | ||
| 2889 | -} | ||
| 2890 | -catch(e){ | ||
| 2891 | -} | ||
| 2892 | -return null; | ||
| 2893 | -},updateNodeAttributes:function(node,_361){ | 2808 | +},updateNodeAttributes:function(node,_359){ |
| 2894 | var elem=node; | 2809 | var elem=node; |
| 2895 | var self=MochiKit.DOM; | 2810 | var self=MochiKit.DOM; |
| 2896 | if(typeof (node)=="string"){ | 2811 | if(typeof (node)=="string"){ |
| 2897 | elem=self.getElement(node); | 2812 | elem=self.getElement(node); |
| 2898 | } | 2813 | } |
| 2899 | -if(_361){ | ||
| 2900 | -var _362=MochiKit.Base.updatetree; | 2814 | +if(_359){ |
| 2815 | +var _360=MochiKit.Base.updatetree; | ||
| 2901 | if(self.attributeArray.compliant){ | 2816 | if(self.attributeArray.compliant){ |
| 2902 | -for(var k in _361){ | ||
| 2903 | -var v=_361[k]; | 2817 | +for(var k in _359){ |
| 2818 | +var v=_359[k]; | ||
| 2904 | if(typeof (v)=="object"&&typeof (elem[k])=="object"){ | 2819 | if(typeof (v)=="object"&&typeof (elem[k])=="object"){ |
| 2905 | -if(k=="style"&&MochiKit.Style){ | ||
| 2906 | -MochiKit.Style.setStyle(elem,v); | ||
| 2907 | -}else{ | ||
| 2908 | -_362(elem[k],v); | ||
| 2909 | -} | 2820 | +_360(elem[k],v); |
| 2910 | }else{ | 2821 | }else{ |
| 2911 | if(k.substring(0,2)=="on"){ | 2822 | if(k.substring(0,2)=="on"){ |
| 2912 | if(typeof (v)=="string"){ | 2823 | if(typeof (v)=="string"){ |
| @@ -2919,22 +2830,18 @@ elem.setAttribute(k,v); | @@ -2919,22 +2830,18 @@ elem.setAttribute(k,v); | ||
| 2919 | } | 2830 | } |
| 2920 | } | 2831 | } |
| 2921 | }else{ | 2832 | }else{ |
| 2922 | -var _363=self.attributeArray.renames; | ||
| 2923 | -for(k in _361){ | ||
| 2924 | -v=_361[k]; | ||
| 2925 | -var _364=_363[k]; | 2833 | +var _361=self.attributeArray.renames; |
| 2834 | +for(k in _359){ | ||
| 2835 | +v=_359[k]; | ||
| 2836 | +var _362=_361[k]; | ||
| 2926 | if(k=="style"&&typeof (v)=="string"){ | 2837 | if(k=="style"&&typeof (v)=="string"){ |
| 2927 | elem.style.cssText=v; | 2838 | elem.style.cssText=v; |
| 2928 | }else{ | 2839 | }else{ |
| 2929 | -if(typeof (_364)=="string"){ | ||
| 2930 | -elem[_364]=v; | 2840 | +if(typeof (_362)=="string"){ |
| 2841 | +elem[_362]=v; | ||
| 2931 | }else{ | 2842 | }else{ |
| 2932 | if(typeof (elem[k])=="object"&&typeof (v)=="object"){ | 2843 | if(typeof (elem[k])=="object"&&typeof (v)=="object"){ |
| 2933 | -if(k=="style"&&MochiKit.Style){ | ||
| 2934 | -MochiKit.Style.setStyle(elem,v); | ||
| 2935 | -}else{ | ||
| 2936 | -_362(elem[k],v); | ||
| 2937 | -} | 2844 | +_360(elem[k],v); |
| 2938 | }else{ | 2845 | }else{ |
| 2939 | if(k.substring(0,2)=="on"){ | 2846 | if(k.substring(0,2)=="on"){ |
| 2940 | if(typeof (v)=="string"){ | 2847 | if(typeof (v)=="string"){ |
| @@ -2957,53 +2864,20 @@ var self=MochiKit.DOM; | @@ -2957,53 +2864,20 @@ var self=MochiKit.DOM; | ||
| 2957 | if(typeof (node)=="string"){ | 2864 | if(typeof (node)=="string"){ |
| 2958 | elem=self.getElement(node); | 2865 | elem=self.getElement(node); |
| 2959 | } | 2866 | } |
| 2960 | -var _365=[self.coerceToDOM(MochiKit.Base.extend(null,arguments,1),elem)]; | ||
| 2961 | -var _366=MochiKit.Base.concat; | ||
| 2962 | -while(_365.length){ | ||
| 2963 | -var n=_365.shift(); | 2867 | +var _363=[self.coerceToDOM(MochiKit.Base.extend(null,arguments,1),elem)]; |
| 2868 | +var _364=MochiKit.Base.concat; | ||
| 2869 | +while(_363.length){ | ||
| 2870 | +var n=_363.shift(); | ||
| 2964 | if(typeof (n)=="undefined"||n===null){ | 2871 | if(typeof (n)=="undefined"||n===null){ |
| 2965 | }else{ | 2872 | }else{ |
| 2966 | if(typeof (n.nodeType)=="number"){ | 2873 | if(typeof (n.nodeType)=="number"){ |
| 2967 | elem.appendChild(n); | 2874 | elem.appendChild(n); |
| 2968 | }else{ | 2875 | }else{ |
| 2969 | -_365=_366(n,_365); | 2876 | +_363=_364(n,_363); |
| 2970 | } | 2877 | } |
| 2971 | } | 2878 | } |
| 2972 | } | 2879 | } |
| 2973 | return elem; | 2880 | return elem; |
| 2974 | -},insertSiblingNodesBefore:function(node){ | ||
| 2975 | -var elem=node; | ||
| 2976 | -var self=MochiKit.DOM; | ||
| 2977 | -if(typeof (node)=="string"){ | ||
| 2978 | -elem=self.getElement(node); | ||
| 2979 | -} | ||
| 2980 | -var _367=[self.coerceToDOM(MochiKit.Base.extend(null,arguments,1),elem)]; | ||
| 2981 | -var _368=elem.parentNode; | ||
| 2982 | -var _369=MochiKit.Base.concat; | ||
| 2983 | -while(_367.length){ | ||
| 2984 | -var n=_367.shift(); | ||
| 2985 | -if(typeof (n)=="undefined"||n===null){ | ||
| 2986 | -}else{ | ||
| 2987 | -if(typeof (n.nodeType)=="number"){ | ||
| 2988 | -_368.insertBefore(n,elem); | ||
| 2989 | -}else{ | ||
| 2990 | -_367=_369(n,_367); | ||
| 2991 | -} | ||
| 2992 | -} | ||
| 2993 | -} | ||
| 2994 | -return _368; | ||
| 2995 | -},insertSiblingNodesAfter:function(node){ | ||
| 2996 | -var elem=node; | ||
| 2997 | -var self=MochiKit.DOM; | ||
| 2998 | -if(typeof (node)=="string"){ | ||
| 2999 | -elem=self.getElement(node); | ||
| 3000 | -} | ||
| 3001 | -var _370=[self.coerceToDOM(MochiKit.Base.extend(null,arguments,1),elem)]; | ||
| 3002 | -if(elem.nextSibling){ | ||
| 3003 | -return self.insertSiblingNodesBefore(elem.nextSibling,_370); | ||
| 3004 | -}else{ | ||
| 3005 | -return self.appendChildNodes(elem.parentNode,_370); | ||
| 3006 | -} | ||
| 3007 | },replaceChildNodes:function(node){ | 2881 | },replaceChildNodes:function(node){ |
| 3008 | var elem=node; | 2882 | var elem=node; |
| 3009 | var self=MochiKit.DOM; | 2883 | var self=MochiKit.DOM; |
| @@ -3011,49 +2885,33 @@ if(typeof (node)=="string"){ | @@ -3011,49 +2885,33 @@ if(typeof (node)=="string"){ | ||
| 3011 | elem=self.getElement(node); | 2885 | elem=self.getElement(node); |
| 3012 | arguments[0]=elem; | 2886 | arguments[0]=elem; |
| 3013 | } | 2887 | } |
| 3014 | -var _371; | ||
| 3015 | -while((_371=elem.firstChild)){ | ||
| 3016 | -elem.removeChild(_371); | 2888 | +var _365; |
| 2889 | +while((_365=elem.firstChild)){ | ||
| 2890 | +elem.removeChild(_365); | ||
| 3017 | } | 2891 | } |
| 3018 | if(arguments.length<2){ | 2892 | if(arguments.length<2){ |
| 3019 | return elem; | 2893 | return elem; |
| 3020 | }else{ | 2894 | }else{ |
| 3021 | return self.appendChildNodes.apply(this,arguments); | 2895 | return self.appendChildNodes.apply(this,arguments); |
| 3022 | } | 2896 | } |
| 3023 | -},createDOM:function(name,_372){ | 2897 | +},createDOM:function(name,_366){ |
| 3024 | var elem; | 2898 | var elem; |
| 3025 | var self=MochiKit.DOM; | 2899 | var self=MochiKit.DOM; |
| 3026 | var m=MochiKit.Base; | 2900 | var m=MochiKit.Base; |
| 3027 | -if(typeof (_372)=="string"||typeof (_372)=="number"){ | 2901 | +if(typeof (_366)=="string"||typeof (_366)=="number"){ |
| 3028 | var args=m.extend([name,null],arguments,1); | 2902 | var args=m.extend([name,null],arguments,1); |
| 3029 | return arguments.callee.apply(this,args); | 2903 | return arguments.callee.apply(this,args); |
| 3030 | } | 2904 | } |
| 3031 | if(typeof (name)=="string"){ | 2905 | if(typeof (name)=="string"){ |
| 3032 | -var _373=self._xhtml; | ||
| 3033 | -if(_372&&!self.attributeArray.compliant){ | ||
| 3034 | -var _374=""; | ||
| 3035 | -if("name" in _372){ | ||
| 3036 | -_374+=" name=\""+self.escapeHTML(_372.name)+"\""; | ||
| 3037 | -} | ||
| 3038 | -if(name=="input"&&"type" in _372){ | ||
| 3039 | -_374+=" type=\""+self.escapeHTML(_372.type)+"\""; | ||
| 3040 | -} | ||
| 3041 | -if(_374){ | ||
| 3042 | -name="<"+name+_374+">"; | ||
| 3043 | -_373=false; | ||
| 3044 | -} | ||
| 3045 | -} | ||
| 3046 | -var d=self._document; | ||
| 3047 | -if(_373&&d===document){ | ||
| 3048 | -elem=d.createElementNS("http://www.w3.org/1999/xhtml",name); | ||
| 3049 | -}else{ | ||
| 3050 | -elem=d.createElement(name); | 2906 | +if(_366&&"name" in _366&&!self.attributeArray.compliant){ |
| 2907 | +name=("<"+name+" name=\""+self.escapeHTML(_366.name)+"\">"); | ||
| 3051 | } | 2908 | } |
| 2909 | +elem=self._document.createElement(name); | ||
| 3052 | }else{ | 2910 | }else{ |
| 3053 | elem=name; | 2911 | elem=name; |
| 3054 | } | 2912 | } |
| 3055 | -if(_372){ | ||
| 3056 | -self.updateNodeAttributes(elem,_372); | 2913 | +if(_366){ |
| 2914 | +self.updateNodeAttributes(elem,_366); | ||
| 3057 | } | 2915 | } |
| 3058 | if(arguments.length<=2){ | 2916 | if(arguments.length<=2){ |
| 3059 | return elem; | 2917 | return elem; |
| @@ -3064,19 +2922,15 @@ return self.appendChildNodes.apply(this,args); | @@ -3064,19 +2922,15 @@ return self.appendChildNodes.apply(this,args); | ||
| 3064 | },createDOMFunc:function(){ | 2922 | },createDOMFunc:function(){ |
| 3065 | var m=MochiKit.Base; | 2923 | var m=MochiKit.Base; |
| 3066 | return m.partial.apply(this,m.extend([MochiKit.DOM.createDOM],arguments)); | 2924 | return m.partial.apply(this,m.extend([MochiKit.DOM.createDOM],arguments)); |
| 3067 | -},removeElement:function(elem){ | ||
| 3068 | -var e=MochiKit.DOM.getElement(elem); | ||
| 3069 | -e.parentNode.removeChild(e); | ||
| 3070 | -return e; | ||
| 3071 | },swapDOM:function(dest,src){ | 2925 | },swapDOM:function(dest,src){ |
| 3072 | var self=MochiKit.DOM; | 2926 | var self=MochiKit.DOM; |
| 3073 | dest=self.getElement(dest); | 2927 | dest=self.getElement(dest); |
| 3074 | -var _377=dest.parentNode; | 2928 | +var _369=dest.parentNode; |
| 3075 | if(src){ | 2929 | if(src){ |
| 3076 | src=self.getElement(src); | 2930 | src=self.getElement(src); |
| 3077 | -_377.replaceChild(src,dest); | 2931 | +_369.replaceChild(src,dest); |
| 3078 | }else{ | 2932 | }else{ |
| 3079 | -_377.removeChild(dest); | 2933 | +_369.removeChild(dest); |
| 3080 | } | 2934 | } |
| 3081 | return src; | 2935 | return src; |
| 3082 | },getElement:function(id){ | 2936 | },getElement:function(id){ |
| @@ -3086,40 +2940,60 @@ return ((typeof (id)=="string")?self._document.getElementById(id):id); | @@ -3086,40 +2940,60 @@ return ((typeof (id)=="string")?self._document.getElementById(id):id); | ||
| 3086 | }else{ | 2940 | }else{ |
| 3087 | return MochiKit.Base.map(self.getElement,arguments); | 2941 | return MochiKit.Base.map(self.getElement,arguments); |
| 3088 | } | 2942 | } |
| 3089 | -},getElementsByTagAndClassName:function(_379,_380,_381){ | 2943 | +},computedStyle:function(_371,_372,_373){ |
| 2944 | +if(arguments.length==2){ | ||
| 2945 | +_373=_372; | ||
| 2946 | +} | ||
| 3090 | var self=MochiKit.DOM; | 2947 | var self=MochiKit.DOM; |
| 3091 | -if(typeof (_379)=="undefined"||_379===null){ | ||
| 3092 | -_379="*"; | 2948 | +var el=self.getElement(_371); |
| 2949 | +var _375=self._document; | ||
| 2950 | +if(!el||el==_375){ | ||
| 2951 | +return undefined; | ||
| 3093 | } | 2952 | } |
| 3094 | -if(typeof (_381)=="undefined"||_381===null){ | ||
| 3095 | -_381=self._document; | 2953 | +if(el.currentStyle){ |
| 2954 | +return el.currentStyle[_372]; | ||
| 3096 | } | 2955 | } |
| 3097 | -_381=self.getElement(_381); | ||
| 3098 | -var _382=(_381.getElementsByTagName(_379)||self._document.all); | ||
| 3099 | -if(typeof (_380)=="undefined"||_380===null){ | ||
| 3100 | -return MochiKit.Base.extend(null,_382); | 2956 | +if(typeof (_375.defaultView)=="undefined"){ |
| 2957 | +return undefined; | ||
| 3101 | } | 2958 | } |
| 3102 | -var _383=[]; | ||
| 3103 | -for(var i=0;i<_382.length;i++){ | ||
| 3104 | -var _384=_382[i]; | ||
| 3105 | -var cls=_384.className; | ||
| 3106 | -if(!cls){ | ||
| 3107 | -continue; | 2959 | +if(_375.defaultView===null){ |
| 2960 | +return undefined; | ||
| 2961 | +} | ||
| 2962 | +var _376=_375.defaultView.getComputedStyle(el,null); | ||
| 2963 | +if(typeof (_376)=="undefined"||_376===null){ | ||
| 2964 | +return undefined; | ||
| 2965 | +} | ||
| 2966 | +return _376.getPropertyValue(_373); | ||
| 2967 | +},getElementsByTagAndClassName:function(_377,_378,_379){ | ||
| 2968 | +var self=MochiKit.DOM; | ||
| 2969 | +if(typeof (_377)=="undefined"||_377===null){ | ||
| 2970 | +_377="*"; | ||
| 3108 | } | 2971 | } |
| 3109 | -var _386=cls.split(" "); | ||
| 3110 | -for(var j=0;j<_386.length;j++){ | ||
| 3111 | -if(_386[j]==_380){ | ||
| 3112 | -_383.push(_384); | 2972 | +if(typeof (_379)=="undefined"||_379===null){ |
| 2973 | +_379=self._document; | ||
| 2974 | +} | ||
| 2975 | +_379=self.getElement(_379); | ||
| 2976 | +var _380=(_379.getElementsByTagName(_377)||self._document.all); | ||
| 2977 | +if(typeof (_378)=="undefined"||_378===null){ | ||
| 2978 | +return MochiKit.Base.extend(null,_380); | ||
| 2979 | +} | ||
| 2980 | +var _381=[]; | ||
| 2981 | +for(var i=0;i<_380.length;i++){ | ||
| 2982 | +var _382=_380[i]; | ||
| 2983 | +var _383=_382.className.split(" "); | ||
| 2984 | +for(var j=0;j<_383.length;j++){ | ||
| 2985 | +if(_383[j]==_378){ | ||
| 2986 | +_381.push(_382); | ||
| 3113 | break; | 2987 | break; |
| 3114 | } | 2988 | } |
| 3115 | } | 2989 | } |
| 3116 | } | 2990 | } |
| 3117 | -return _383; | 2991 | +return _381; |
| 3118 | },_newCallStack:function(path,once){ | 2992 | },_newCallStack:function(path,once){ |
| 3119 | var rval=function(){ | 2993 | var rval=function(){ |
| 3120 | -var _389=arguments.callee.callStack; | ||
| 3121 | -for(var i=0;i<_389.length;i++){ | ||
| 3122 | -if(_389[i].apply(this,arguments)===false){ | 2994 | +var _386=arguments.callee.callStack; |
| 2995 | +for(var i=0;i<_386.length;i++){ | ||
| 2996 | +if(_386[i].apply(this,arguments)===false){ | ||
| 3123 | break; | 2997 | break; |
| 3124 | } | 2998 | } |
| 3125 | } | 2999 | } |
| @@ -3133,102 +3007,98 @@ catch(e){ | @@ -3133,102 +3007,98 @@ catch(e){ | ||
| 3133 | }; | 3007 | }; |
| 3134 | rval.callStack=[]; | 3008 | rval.callStack=[]; |
| 3135 | return rval; | 3009 | return rval; |
| 3136 | -},addToCallStack:function(_390,path,func,once){ | 3010 | +},addToCallStack:function(_387,path,func,once){ |
| 3137 | var self=MochiKit.DOM; | 3011 | var self=MochiKit.DOM; |
| 3138 | -var _391=_390[path]; | ||
| 3139 | -var _392=_391; | ||
| 3140 | -if(!(typeof (_391)=="function"&&typeof (_391.callStack)=="object"&&_391.callStack!==null)){ | ||
| 3141 | -_392=self._newCallStack(path,once); | ||
| 3142 | -if(typeof (_391)=="function"){ | ||
| 3143 | -_392.callStack.push(_391); | 3012 | +var _388=_387[path]; |
| 3013 | +var _389=_388; | ||
| 3014 | +if(!(typeof (_388)=="function"&&typeof (_388.callStack)=="object"&&_388.callStack!==null)){ | ||
| 3015 | +_389=self._newCallStack(path,once); | ||
| 3016 | +if(typeof (_388)=="function"){ | ||
| 3017 | +_389.callStack.push(_388); | ||
| 3144 | } | 3018 | } |
| 3145 | -_390[path]=_392; | 3019 | +_387[path]=_389; |
| 3146 | } | 3020 | } |
| 3147 | -_392.callStack.push(func); | 3021 | +_389.callStack.push(func); |
| 3148 | },addLoadEvent:function(func){ | 3022 | },addLoadEvent:function(func){ |
| 3149 | var self=MochiKit.DOM; | 3023 | var self=MochiKit.DOM; |
| 3150 | self.addToCallStack(self._window,"onload",func,true); | 3024 | self.addToCallStack(self._window,"onload",func,true); |
| 3151 | -},focusOnLoad:function(_393){ | 3025 | +},focusOnLoad:function(_390){ |
| 3152 | var self=MochiKit.DOM; | 3026 | var self=MochiKit.DOM; |
| 3153 | self.addLoadEvent(function(){ | 3027 | self.addLoadEvent(function(){ |
| 3154 | -_393=self.getElement(_393); | ||
| 3155 | -if(_393){ | ||
| 3156 | -_393.focus(); | 3028 | +_390=self.getElement(_390); |
| 3029 | +if(_390){ | ||
| 3030 | +_390.focus(); | ||
| 3157 | } | 3031 | } |
| 3158 | }); | 3032 | }); |
| 3159 | -},setElementClass:function(_394,_395){ | 3033 | +},setElementClass:function(_391,_392){ |
| 3160 | var self=MochiKit.DOM; | 3034 | var self=MochiKit.DOM; |
| 3161 | -var obj=self.getElement(_394); | 3035 | +var obj=self.getElement(_391); |
| 3162 | if(self.attributeArray.compliant){ | 3036 | if(self.attributeArray.compliant){ |
| 3163 | -obj.setAttribute("class",_395); | 3037 | +obj.setAttribute("class",_392); |
| 3164 | }else{ | 3038 | }else{ |
| 3165 | -obj.setAttribute("className",_395); | 3039 | +obj.setAttribute("className",_392); |
| 3166 | } | 3040 | } |
| 3167 | -},toggleElementClass:function(_396){ | 3041 | +},toggleElementClass:function(_393){ |
| 3168 | var self=MochiKit.DOM; | 3042 | var self=MochiKit.DOM; |
| 3169 | for(var i=1;i<arguments.length;i++){ | 3043 | for(var i=1;i<arguments.length;i++){ |
| 3170 | var obj=self.getElement(arguments[i]); | 3044 | var obj=self.getElement(arguments[i]); |
| 3171 | -if(!self.addElementClass(obj,_396)){ | ||
| 3172 | -self.removeElementClass(obj,_396); | 3045 | +if(!self.addElementClass(obj,_393)){ |
| 3046 | +self.removeElementClass(obj,_393); | ||
| 3173 | } | 3047 | } |
| 3174 | } | 3048 | } |
| 3175 | -},addElementClass:function(_397,_398){ | 3049 | +},addElementClass:function(_394,_395){ |
| 3176 | var self=MochiKit.DOM; | 3050 | var self=MochiKit.DOM; |
| 3177 | -var obj=self.getElement(_397); | 3051 | +var obj=self.getElement(_394); |
| 3178 | var cls=obj.className; | 3052 | var cls=obj.className; |
| 3179 | -if(cls==undefined||cls.length===0){ | ||
| 3180 | -self.setElementClass(obj,_398); | 3053 | +if(cls.length===0){ |
| 3054 | +self.setElementClass(obj,_395); | ||
| 3181 | return true; | 3055 | return true; |
| 3182 | } | 3056 | } |
| 3183 | -if(cls==_398){ | 3057 | +if(cls==_395){ |
| 3184 | return false; | 3058 | return false; |
| 3185 | } | 3059 | } |
| 3186 | -var _399=cls.split(" "); | ||
| 3187 | -for(var i=0;i<_399.length;i++){ | ||
| 3188 | -if(_399[i]==_398){ | 3060 | +var _397=obj.className.split(" "); |
| 3061 | +for(var i=0;i<_397.length;i++){ | ||
| 3062 | +if(_397[i]==_395){ | ||
| 3189 | return false; | 3063 | return false; |
| 3190 | } | 3064 | } |
| 3191 | } | 3065 | } |
| 3192 | -self.setElementClass(obj,cls+" "+_398); | 3066 | +self.setElementClass(obj,cls+" "+_395); |
| 3193 | return true; | 3067 | return true; |
| 3194 | -},removeElementClass:function(_400,_401){ | 3068 | +},removeElementClass:function(_398,_399){ |
| 3195 | var self=MochiKit.DOM; | 3069 | var self=MochiKit.DOM; |
| 3196 | -var obj=self.getElement(_400); | 3070 | +var obj=self.getElement(_398); |
| 3197 | var cls=obj.className; | 3071 | var cls=obj.className; |
| 3198 | -if(cls==undefined||cls.length===0){ | 3072 | +if(cls.length===0){ |
| 3199 | return false; | 3073 | return false; |
| 3200 | } | 3074 | } |
| 3201 | -if(cls==_401){ | 3075 | +if(cls==_399){ |
| 3202 | self.setElementClass(obj,""); | 3076 | self.setElementClass(obj,""); |
| 3203 | return true; | 3077 | return true; |
| 3204 | } | 3078 | } |
| 3205 | -var _402=cls.split(" "); | ||
| 3206 | -for(var i=0;i<_402.length;i++){ | ||
| 3207 | -if(_402[i]==_401){ | ||
| 3208 | -_402.splice(i,1); | ||
| 3209 | -self.setElementClass(obj,_402.join(" ")); | 3079 | +var _400=obj.className.split(" "); |
| 3080 | +for(var i=0;i<_400.length;i++){ | ||
| 3081 | +if(_400[i]==_399){ | ||
| 3082 | +_400.splice(i,1); | ||
| 3083 | +self.setElementClass(obj,_400.join(" ")); | ||
| 3210 | return true; | 3084 | return true; |
| 3211 | } | 3085 | } |
| 3212 | } | 3086 | } |
| 3213 | return false; | 3087 | return false; |
| 3214 | -},swapElementClass:function(_403,_404,_405){ | ||
| 3215 | -var obj=MochiKit.DOM.getElement(_403); | ||
| 3216 | -var res=MochiKit.DOM.removeElementClass(obj,_404); | 3088 | +},swapElementClass:function(_401,_402,_403){ |
| 3089 | +var obj=MochiKit.DOM.getElement(_401); | ||
| 3090 | +var res=MochiKit.DOM.removeElementClass(obj,_402); | ||
| 3217 | if(res){ | 3091 | if(res){ |
| 3218 | -MochiKit.DOM.addElementClass(obj,_405); | 3092 | +MochiKit.DOM.addElementClass(obj,_403); |
| 3219 | } | 3093 | } |
| 3220 | return res; | 3094 | return res; |
| 3221 | -},hasElementClass:function(_406,_407){ | ||
| 3222 | -var obj=MochiKit.DOM.getElement(_406); | ||
| 3223 | -var cls=obj.className; | ||
| 3224 | -if(!cls){ | ||
| 3225 | -return false; | ||
| 3226 | -} | ||
| 3227 | -var _408=cls.split(" "); | 3095 | +},hasElementClass:function(_404,_405){ |
| 3096 | +var obj=MochiKit.DOM.getElement(_404); | ||
| 3097 | +var _406=obj.className.split(" "); | ||
| 3228 | for(var i=1;i<arguments.length;i++){ | 3098 | for(var i=1;i<arguments.length;i++){ |
| 3229 | var good=false; | 3099 | var good=false; |
| 3230 | -for(var j=0;j<_408.length;j++){ | ||
| 3231 | -if(_408[j]==arguments[i]){ | 3100 | +for(var j=0;j<_406.length;j++){ |
| 3101 | +if(_406[j]==arguments[i]){ | ||
| 3232 | good=true; | 3102 | good=true; |
| 3233 | break; | 3103 | break; |
| 3234 | } | 3104 | } |
| @@ -3246,49 +3116,55 @@ return MochiKit.DOM.emitHTML(dom).join(""); | @@ -3246,49 +3116,55 @@ return MochiKit.DOM.emitHTML(dom).join(""); | ||
| 3246 | if(typeof (lst)=="undefined"||lst===null){ | 3116 | if(typeof (lst)=="undefined"||lst===null){ |
| 3247 | lst=[]; | 3117 | lst=[]; |
| 3248 | } | 3118 | } |
| 3249 | -var _411=[dom]; | 3119 | +var _409=[dom]; |
| 3250 | var self=MochiKit.DOM; | 3120 | var self=MochiKit.DOM; |
| 3251 | -var _412=self.escapeHTML; | ||
| 3252 | -var _413=self.attributeArray; | ||
| 3253 | -while(_411.length){ | ||
| 3254 | -dom=_411.pop(); | 3121 | +var _410=self.escapeHTML; |
| 3122 | +var _411=self.attributeArray; | ||
| 3123 | +while(_409.length){ | ||
| 3124 | +dom=_409.pop(); | ||
| 3255 | if(typeof (dom)=="string"){ | 3125 | if(typeof (dom)=="string"){ |
| 3256 | lst.push(dom); | 3126 | lst.push(dom); |
| 3257 | }else{ | 3127 | }else{ |
| 3258 | if(dom.nodeType==1){ | 3128 | if(dom.nodeType==1){ |
| 3259 | -lst.push("<"+dom.tagName.toLowerCase()); | ||
| 3260 | -var _414=[]; | ||
| 3261 | -var _415=_413(dom); | ||
| 3262 | -for(var i=0;i<_415.length;i++){ | ||
| 3263 | -var a=_415[i]; | ||
| 3264 | -_414.push([" ",a.name,"=\"",_412(a.value),"\""]); | 3129 | +lst.push("<"+dom.nodeName.toLowerCase()); |
| 3130 | +var _412=[]; | ||
| 3131 | +var _413=_411(dom); | ||
| 3132 | +for(var i=0;i<_413.length;i++){ | ||
| 3133 | +var a=_413[i]; | ||
| 3134 | +_412.push([" ",a.name,"=\"",_410(a.value),"\""]); | ||
| 3265 | } | 3135 | } |
| 3266 | -_414.sort(); | ||
| 3267 | -for(i=0;i<_414.length;i++){ | ||
| 3268 | -var _416=_414[i]; | ||
| 3269 | -for(var j=0;j<_416.length;j++){ | ||
| 3270 | -lst.push(_416[j]); | 3136 | +_412.sort(); |
| 3137 | +for(i=0;i<_412.length;i++){ | ||
| 3138 | +var _414=_412[i]; | ||
| 3139 | +for(var j=0;j<_414.length;j++){ | ||
| 3140 | +lst.push(_414[j]); | ||
| 3271 | } | 3141 | } |
| 3272 | } | 3142 | } |
| 3273 | if(dom.hasChildNodes()){ | 3143 | if(dom.hasChildNodes()){ |
| 3274 | lst.push(">"); | 3144 | lst.push(">"); |
| 3275 | -_411.push("</"+dom.tagName.toLowerCase()+">"); | ||
| 3276 | -var _417=dom.childNodes; | ||
| 3277 | -for(i=_417.length-1;i>=0;i--){ | ||
| 3278 | -_411.push(_417[i]); | 3145 | +_409.push("</"+dom.nodeName.toLowerCase()+">"); |
| 3146 | +var _415=dom.childNodes; | ||
| 3147 | +for(i=_415.length-1;i>=0;i--){ | ||
| 3148 | +_409.push(_415[i]); | ||
| 3279 | } | 3149 | } |
| 3280 | }else{ | 3150 | }else{ |
| 3281 | lst.push("/>"); | 3151 | lst.push("/>"); |
| 3282 | } | 3152 | } |
| 3283 | }else{ | 3153 | }else{ |
| 3284 | if(dom.nodeType==3){ | 3154 | if(dom.nodeType==3){ |
| 3285 | -lst.push(_412(dom.nodeValue)); | 3155 | +lst.push(_410(dom.nodeValue)); |
| 3286 | } | 3156 | } |
| 3287 | } | 3157 | } |
| 3288 | } | 3158 | } |
| 3289 | } | 3159 | } |
| 3290 | return lst; | 3160 | return lst; |
| 3291 | -},scrapeText:function(node,_418){ | 3161 | +},setDisplayForElement:function(_416,_417){ |
| 3162 | +var m=MochiKit.Base; | ||
| 3163 | +var _418=m.extend(null,arguments,1); | ||
| 3164 | +MochiKit.Iter.forEach(m.filter(null,m.map(MochiKit.DOM.getElement,_418)),function(_417){ | ||
| 3165 | +_417.style.display=_416; | ||
| 3166 | +}); | ||
| 3167 | +},scrapeText:function(node,_419){ | ||
| 3292 | var rval=[]; | 3168 | var rval=[]; |
| 3293 | (function(node){ | 3169 | (function(node){ |
| 3294 | var cn=node.childNodes; | 3170 | var cn=node.childNodes; |
| @@ -3297,856 +3173,93 @@ for(var i=0;i<cn.length;i++){ | @@ -3297,856 +3173,93 @@ for(var i=0;i<cn.length;i++){ | ||
| 3297 | arguments.callee.call(this,cn[i]); | 3173 | arguments.callee.call(this,cn[i]); |
| 3298 | } | 3174 | } |
| 3299 | } | 3175 | } |
| 3300 | -var _420=node.nodeValue; | ||
| 3301 | -if(typeof (_420)=="string"){ | ||
| 3302 | -rval.push(_420); | 3176 | +var _421=node.nodeValue; |
| 3177 | +if(typeof (_421)=="string"){ | ||
| 3178 | +rval.push(_421); | ||
| 3303 | } | 3179 | } |
| 3304 | })(MochiKit.DOM.getElement(node)); | 3180 | })(MochiKit.DOM.getElement(node)); |
| 3305 | -if(_418){ | 3181 | +if(_419){ |
| 3306 | return rval; | 3182 | return rval; |
| 3307 | }else{ | 3183 | }else{ |
| 3308 | return rval.join(""); | 3184 | return rval.join(""); |
| 3309 | } | 3185 | } |
| 3310 | -},removeEmptyTextNodes:function(_421){ | ||
| 3311 | -_421=MochiKit.DOM.getElement(_421); | ||
| 3312 | -for(var i=0;i<_421.childNodes.length;i++){ | ||
| 3313 | -var node=_421.childNodes[i]; | ||
| 3314 | -if(node.nodeType==3&&!/\S/.test(node.nodeValue)){ | ||
| 3315 | -node.parentNode.removeChild(node); | ||
| 3316 | -} | ||
| 3317 | -} | ||
| 3318 | -},makeClipping:function(_422){ | ||
| 3319 | -_422=MochiKit.DOM.getElement(_422); | ||
| 3320 | -var _423=_422.style.overflow; | ||
| 3321 | -if((MochiKit.Style.getStyle(_422,"overflow")||"visible")!="hidden"){ | ||
| 3322 | -_422.style.overflow="hidden"; | ||
| 3323 | -} | ||
| 3324 | -return _423; | ||
| 3325 | -},undoClipping:function(_424,_425){ | ||
| 3326 | -_424=MochiKit.DOM.getElement(_424); | ||
| 3327 | -if(!_425){ | ||
| 3328 | -return; | ||
| 3329 | -} | ||
| 3330 | -_424.style.overflow=_425; | ||
| 3331 | -},makePositioned:function(_426){ | ||
| 3332 | -_426=MochiKit.DOM.getElement(_426); | ||
| 3333 | -var pos=MochiKit.Style.getStyle(_426,"position"); | ||
| 3334 | -if(pos=="static"||!pos){ | ||
| 3335 | -_426.style.position="relative"; | ||
| 3336 | -if(/Opera/.test(navigator.userAgent)){ | ||
| 3337 | -_426.style.top=0; | ||
| 3338 | -_426.style.left=0; | ||
| 3339 | -} | ||
| 3340 | -} | ||
| 3341 | -},undoPositioned:function(_428){ | ||
| 3342 | -_428=MochiKit.DOM.getElement(_428); | ||
| 3343 | -if(_428.style.position=="relative"){ | ||
| 3344 | -_428.style.position=_428.style.top=_428.style.left=_428.style.bottom=_428.style.right=""; | ||
| 3345 | -} | ||
| 3346 | -},getFirstElementByTagAndClassName:function(_429,_430,_431){ | ||
| 3347 | -var self=MochiKit.DOM; | ||
| 3348 | -if(typeof (_429)=="undefined"||_429===null){ | ||
| 3349 | -_429="*"; | ||
| 3350 | -} | ||
| 3351 | -if(typeof (_431)=="undefined"||_431===null){ | ||
| 3352 | -_431=self._document; | ||
| 3353 | -} | ||
| 3354 | -_431=self.getElement(_431); | ||
| 3355 | -var _432=(_431.getElementsByTagName(_429)||self._document.all); | ||
| 3356 | -if(typeof (_430)=="undefined"||_430===null){ | ||
| 3357 | -return _432[0]; | ||
| 3358 | -} | ||
| 3359 | -for(var i=0;i<_432.length;i++){ | ||
| 3360 | -var _433=_432[i]; | ||
| 3361 | -var _434=_433.className.split(" "); | ||
| 3362 | -for(var j=0;j<_434.length;j++){ | ||
| 3363 | -if(_434[j]==_430){ | ||
| 3364 | -return _433; | ||
| 3365 | -} | ||
| 3366 | -} | ||
| 3367 | -} | ||
| 3368 | -},getFirstParentByTagAndClassName:function(elem,_435,_436){ | ||
| 3369 | -var self=MochiKit.DOM; | ||
| 3370 | -elem=self.getElement(elem); | ||
| 3371 | -if(typeof (_435)=="undefined"||_435===null){ | ||
| 3372 | -_435="*"; | ||
| 3373 | -}else{ | ||
| 3374 | -_435=_435.toUpperCase(); | ||
| 3375 | -} | ||
| 3376 | -if(typeof (_436)=="undefined"||_436===null){ | ||
| 3377 | -_436=null; | ||
| 3378 | -} | ||
| 3379 | -var _437=""; | ||
| 3380 | -var _438=""; | ||
| 3381 | -while(elem&&elem.tagName){ | ||
| 3382 | -elem=elem.parentNode; | ||
| 3383 | -if(_435=="*"&&_436===null){ | ||
| 3384 | -return elem; | ||
| 3385 | -} | ||
| 3386 | -_437=elem.className.split(" "); | ||
| 3387 | -_438=elem.tagName.toUpperCase(); | ||
| 3388 | -if(_436===null&&_435==_438){ | ||
| 3389 | -return elem; | ||
| 3390 | -}else{ | ||
| 3391 | -if(_436!==null){ | ||
| 3392 | -for(var i=0;i<_437.length;i++){ | ||
| 3393 | -if(_435=="*"&&_437[i]==_436){ | ||
| 3394 | -return elem; | ||
| 3395 | -}else{ | ||
| 3396 | -if(_435==_438&&_437[i]==_436){ | ||
| 3397 | -return elem; | ||
| 3398 | -} | ||
| 3399 | -} | ||
| 3400 | -} | ||
| 3401 | -} | ||
| 3402 | -} | ||
| 3403 | -} | ||
| 3404 | -return elem; | ||
| 3405 | -},isParent:function(_439,_440){ | ||
| 3406 | -if(!_439.parentNode||_439==_440){ | ||
| 3407 | -return false; | ||
| 3408 | -} | ||
| 3409 | -if(_439.parentNode==_440){ | ||
| 3410 | -return true; | ||
| 3411 | -} | ||
| 3412 | -return MochiKit.DOM.isParent(_439.parentNode,_440); | ||
| 3413 | -},__new__:function(win){ | ||
| 3414 | -var m=MochiKit.Base; | ||
| 3415 | -if(typeof (document)!="undefined"){ | ||
| 3416 | -this._document=document; | ||
| 3417 | -var _441="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; | ||
| 3418 | -this._xhtml=(document.documentElement&&document.createElementNS&&document.documentElement.namespaceURI===_441); | ||
| 3419 | -}else{ | ||
| 3420 | -if(MochiKit.MockDOM){ | ||
| 3421 | -this._document=MochiKit.MockDOM.document; | ||
| 3422 | -} | ||
| 3423 | -} | ||
| 3424 | -this._window=win; | ||
| 3425 | -this.domConverters=new m.AdapterRegistry(); | ||
| 3426 | -var _442=this._document.createElement("span"); | ||
| 3427 | -var _443; | ||
| 3428 | -if(_442&&_442.attributes&&_442.attributes.length>0){ | ||
| 3429 | -var _444=m.filter; | ||
| 3430 | -_443=function(node){ | ||
| 3431 | -return _444(_443.ignoreAttrFilter,node.attributes); | ||
| 3432 | -}; | ||
| 3433 | -_443.ignoreAttr={}; | ||
| 3434 | -var _445=_442.attributes; | ||
| 3435 | -var _446=_443.ignoreAttr; | ||
| 3436 | -for(var i=0;i<_445.length;i++){ | ||
| 3437 | -var a=_445[i]; | ||
| 3438 | -_446[a.name]=a.value; | ||
| 3439 | -} | ||
| 3440 | -_443.ignoreAttrFilter=function(a){ | ||
| 3441 | -return (_443.ignoreAttr[a.name]!=a.value); | ||
| 3442 | -}; | ||
| 3443 | -_443.compliant=false; | ||
| 3444 | -_443.renames={"class":"className","checked":"defaultChecked","usemap":"useMap","for":"htmlFor","readonly":"readOnly","colspan":"colSpan","bgcolor":"bgColor"}; | ||
| 3445 | -}else{ | ||
| 3446 | -_443=function(node){ | ||
| 3447 | -return node.attributes; | ||
| 3448 | -}; | ||
| 3449 | -_443.compliant=true; | ||
| 3450 | -_443.renames={}; | ||
| 3451 | -} | ||
| 3452 | -this.attributeArray=_443; | ||
| 3453 | -var _447=function(_448,arr){ | ||
| 3454 | -var _449=arr[1].split("."); | ||
| 3455 | -var str=""; | ||
| 3456 | -var obj={}; | ||
| 3457 | -str+="if (!MochiKit."+_449[1]+") { throw new Error(\""; | ||
| 3458 | -str+="This function has been deprecated and depends on MochiKit."; | ||
| 3459 | -str+=_449[1]+".\");}"; | ||
| 3460 | -str+="return MochiKit."+_449[1]+"."+arr[0]; | ||
| 3461 | -str+=".apply(this, arguments);"; | ||
| 3462 | -obj[_449[2]]=new Function(str); | ||
| 3463 | -MochiKit.Base.update(MochiKit[_448],obj); | ||
| 3464 | -}; | ||
| 3465 | -for(var i;i<MochiKit.DOM.DEPRECATED.length;i++){ | ||
| 3466 | -_447("DOM",MochiKit.DOM.DEPRECATED[i]); | ||
| 3467 | -} | ||
| 3468 | -var _450=this.createDOMFunc; | ||
| 3469 | -this.UL=_450("ul"); | ||
| 3470 | -this.OL=_450("ol"); | ||
| 3471 | -this.LI=_450("li"); | ||
| 3472 | -this.TD=_450("td"); | ||
| 3473 | -this.TR=_450("tr"); | ||
| 3474 | -this.TBODY=_450("tbody"); | ||
| 3475 | -this.THEAD=_450("thead"); | ||
| 3476 | -this.TFOOT=_450("tfoot"); | ||
| 3477 | -this.TABLE=_450("table"); | ||
| 3478 | -this.TH=_450("th"); | ||
| 3479 | -this.INPUT=_450("input"); | ||
| 3480 | -this.SPAN=_450("span"); | ||
| 3481 | -this.A=_450("a"); | ||
| 3482 | -this.DIV=_450("div"); | ||
| 3483 | -this.IMG=_450("img"); | ||
| 3484 | -this.BUTTON=_450("button"); | ||
| 3485 | -this.TT=_450("tt"); | ||
| 3486 | -this.PRE=_450("pre"); | ||
| 3487 | -this.H1=_450("h1"); | ||
| 3488 | -this.H2=_450("h2"); | ||
| 3489 | -this.H3=_450("h3"); | ||
| 3490 | -this.BR=_450("br"); | ||
| 3491 | -this.HR=_450("hr"); | ||
| 3492 | -this.LABEL=_450("label"); | ||
| 3493 | -this.TEXTAREA=_450("textarea"); | ||
| 3494 | -this.FORM=_450("form"); | ||
| 3495 | -this.P=_450("p"); | ||
| 3496 | -this.SELECT=_450("select"); | ||
| 3497 | -this.OPTION=_450("option"); | ||
| 3498 | -this.OPTGROUP=_450("optgroup"); | ||
| 3499 | -this.LEGEND=_450("legend"); | ||
| 3500 | -this.FIELDSET=_450("fieldset"); | ||
| 3501 | -this.STRONG=_450("strong"); | ||
| 3502 | -this.CANVAS=_450("canvas"); | ||
| 3503 | -this.$=this.getElement; | ||
| 3504 | -this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)}; | ||
| 3505 | -m.nameFunctions(this); | ||
| 3506 | -}}); | ||
| 3507 | -MochiKit.DOM.__new__(((typeof (window)=="undefined")?this:window)); | ||
| 3508 | -if(MochiKit.__export__){ | ||
| 3509 | -withWindow=MochiKit.DOM.withWindow; | ||
| 3510 | -withDocument=MochiKit.DOM.withDocument; | ||
| 3511 | -} | ||
| 3512 | -MochiKit.Base._exportSymbols(this,MochiKit.DOM); | ||
| 3513 | -if(typeof (dojo)!="undefined"){ | ||
| 3514 | -dojo.provide("MochiKit.Selector"); | ||
| 3515 | -dojo.require("MochiKit.Base"); | ||
| 3516 | -dojo.require("MochiKit.DOM"); | ||
| 3517 | -dojo.require("MochiKit.Iter"); | ||
| 3518 | -} | ||
| 3519 | -if(typeof (JSAN)!="undefined"){ | ||
| 3520 | -JSAN.use("MochiKit.Base",[]); | ||
| 3521 | -JSAN.use("MochiKit.DOM",[]); | ||
| 3522 | -JSAN.use("MochiKit.Iter",[]); | ||
| 3523 | -} | ||
| 3524 | -try{ | ||
| 3525 | -if(typeof (MochiKit.Base)==="undefined"||typeof (MochiKit.DOM)==="undefined"||typeof (MochiKit.Iter)==="undefined"){ | ||
| 3526 | -throw ""; | ||
| 3527 | -} | ||
| 3528 | -} | ||
| 3529 | -catch(e){ | ||
| 3530 | -throw "MochiKit.Selector depends on MochiKit.Base, MochiKit.DOM and MochiKit.Iter!"; | ||
| 3531 | -} | ||
| 3532 | -if(typeof (MochiKit.Selector)=="undefined"){ | ||
| 3533 | -MochiKit.Selector={}; | ||
| 3534 | -} | ||
| 3535 | -MochiKit.Selector.NAME="MochiKit.Selector"; | ||
| 3536 | -MochiKit.Selector.VERSION="1.4"; | ||
| 3537 | -MochiKit.Selector.__repr__=function(){ | ||
| 3538 | -return "["+this.NAME+" "+this.VERSION+"]"; | ||
| 3539 | -}; | ||
| 3540 | -MochiKit.Selector.toString=function(){ | ||
| 3541 | -return this.__repr__(); | ||
| 3542 | -}; | ||
| 3543 | -MochiKit.Selector.Selector=function(_451){ | ||
| 3544 | -this.params={classNames:[],pseudoClassNames:[]}; | ||
| 3545 | -this.expression=_451.toString().replace(/(^\s+|\s+$)/g,""); | ||
| 3546 | -this.parseExpression(); | ||
| 3547 | -this.compileMatcher(); | ||
| 3548 | -}; | ||
| 3549 | -MochiKit.Selector.Selector.prototype={__class__:MochiKit.Selector.Selector,parseExpression:function(){ | ||
| 3550 | -function abort(_452){ | ||
| 3551 | -throw "Parse error in selector: "+_452; | ||
| 3552 | -} | ||
| 3553 | -if(this.expression==""){ | ||
| 3554 | -abort("empty expression"); | ||
| 3555 | -} | ||
| 3556 | -var repr=MochiKit.Base.repr; | ||
| 3557 | -var _454=this.params; | ||
| 3558 | -var expr=this.expression; | ||
| 3559 | -var _456,modifier,clause,rest; | ||
| 3560 | -while(_456=expr.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!^$*]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i)){ | ||
| 3561 | -_454.attributes=_454.attributes||[]; | ||
| 3562 | -_454.attributes.push({name:_456[2],operator:_456[3],value:_456[4]||_456[5]||""}); | ||
| 3563 | -expr=_456[1]; | ||
| 3564 | -} | ||
| 3565 | -if(expr=="*"){ | ||
| 3566 | -return this.params.wildcard=true; | ||
| 3567 | -} | ||
| 3568 | -while(_456=expr.match(/^([^a-z0-9_-])?([a-z0-9_-]+(?:\([^)]*\))?)(.*)/i)){ | ||
| 3569 | -modifier=_456[1]; | ||
| 3570 | -clause=_456[2]; | ||
| 3571 | -rest=_456[3]; | ||
| 3572 | -switch(modifier){ | ||
| 3573 | -case "#": | ||
| 3574 | -_454.id=clause; | ||
| 3575 | -break; | ||
| 3576 | -case ".": | ||
| 3577 | -_454.classNames.push(clause); | ||
| 3578 | -break; | ||
| 3579 | -case ":": | ||
| 3580 | -_454.pseudoClassNames.push(clause); | ||
| 3581 | -break; | ||
| 3582 | -case "": | ||
| 3583 | -case undefined: | ||
| 3584 | -_454.tagName=clause.toUpperCase(); | ||
| 3585 | -break; | ||
| 3586 | -default: | ||
| 3587 | -abort(repr(expr)); | ||
| 3588 | -} | ||
| 3589 | -expr=rest; | ||
| 3590 | -} | ||
| 3591 | -if(expr.length>0){ | ||
| 3592 | -abort(repr(expr)); | ||
| 3593 | -} | ||
| 3594 | -},buildMatchExpression:function(){ | ||
| 3595 | -var repr=MochiKit.Base.repr; | ||
| 3596 | -var _457=this.params; | ||
| 3597 | -var _458=[]; | ||
| 3598 | -var _459,i; | ||
| 3599 | -function childElements(_460){ | ||
| 3600 | -return "MochiKit.Base.filter(function (node) { return node.nodeType == 1; }, "+_460+".childNodes)"; | ||
| 3601 | -} | ||
| 3602 | -if(_457.wildcard){ | ||
| 3603 | -_458.push("true"); | ||
| 3604 | -} | ||
| 3605 | -if(_459=_457.id){ | ||
| 3606 | -_458.push("element.id == "+repr(_459)); | ||
| 3607 | -} | ||
| 3608 | -if(_459=_457.tagName){ | ||
| 3609 | -_458.push("element.tagName.toUpperCase() == "+repr(_459)); | ||
| 3610 | -} | ||
| 3611 | -if((_459=_457.classNames).length>0){ | ||
| 3612 | -for(i=0;i<_459.length;i++){ | ||
| 3613 | -_458.push("MochiKit.DOM.hasElementClass(element, "+repr(_459[i])+")"); | ||
| 3614 | -} | ||
| 3615 | -} | ||
| 3616 | -if((_459=_457.pseudoClassNames).length>0){ | ||
| 3617 | -for(i=0;i<_459.length;i++){ | ||
| 3618 | -var _461=_459[i].match(/^([^(]+)(?:\((.*)\))?$/); | ||
| 3619 | -var _462=_461[1]; | ||
| 3620 | -var _463=_461[2]; | ||
| 3621 | -switch(_462){ | ||
| 3622 | -case "root": | ||
| 3623 | -_458.push("element.nodeType == 9 || element === element.ownerDocument.documentElement"); | ||
| 3624 | -break; | ||
| 3625 | -case "nth-child": | ||
| 3626 | -case "nth-last-child": | ||
| 3627 | -case "nth-of-type": | ||
| 3628 | -case "nth-last-of-type": | ||
| 3629 | -_461=_463.match(/^((?:(\d+)n\+)?(\d+)|odd|even)$/); | ||
| 3630 | -if(!_461){ | ||
| 3631 | -throw "Invalid argument to pseudo element nth-child: "+_463; | ||
| 3632 | -} | ||
| 3633 | -var a,b; | ||
| 3634 | -if(_461[0]=="odd"){ | ||
| 3635 | -a=2; | ||
| 3636 | -b=1; | ||
| 3637 | -}else{ | ||
| 3638 | -if(_461[0]=="even"){ | ||
| 3639 | -a=2; | ||
| 3640 | -b=0; | ||
| 3641 | -}else{ | ||
| 3642 | -a=_461[2]&&parseInt(_461)||null; | ||
| 3643 | -b=parseInt(_461[3]); | ||
| 3644 | -} | ||
| 3645 | -} | ||
| 3646 | -_458.push("this.nthChild(element,"+a+","+b+","+!!_462.match("^nth-last")+","+!!_462.match("of-type$")+")"); | ||
| 3647 | -break; | ||
| 3648 | -case "first-child": | ||
| 3649 | -_458.push("this.nthChild(element, null, 1)"); | ||
| 3650 | -break; | ||
| 3651 | -case "last-child": | ||
| 3652 | -_458.push("this.nthChild(element, null, 1, true)"); | ||
| 3653 | -break; | ||
| 3654 | -case "first-of-type": | ||
| 3655 | -_458.push("this.nthChild(element, null, 1, false, true)"); | ||
| 3656 | -break; | ||
| 3657 | -case "last-of-type": | ||
| 3658 | -_458.push("this.nthChild(element, null, 1, true, true)"); | ||
| 3659 | -break; | ||
| 3660 | -case "only-child": | ||
| 3661 | -_458.push(childElements("element.parentNode")+".length == 1"); | ||
| 3662 | -break; | ||
| 3663 | -case "only-of-type": | ||
| 3664 | -_458.push("MochiKit.Base.filter(function (node) { return node.tagName == element.tagName; }, "+childElements("element.parentNode")+").length == 1"); | ||
| 3665 | -break; | ||
| 3666 | -case "empty": | ||
| 3667 | -_458.push("element.childNodes.length == 0"); | ||
| 3668 | -break; | ||
| 3669 | -case "enabled": | ||
| 3670 | -_458.push("(this.isUIElement(element) && element.disabled === false)"); | ||
| 3671 | -break; | ||
| 3672 | -case "disabled": | ||
| 3673 | -_458.push("(this.isUIElement(element) && element.disabled === true)"); | ||
| 3674 | -break; | ||
| 3675 | -case "checked": | ||
| 3676 | -_458.push("(this.isUIElement(element) && element.checked === true)"); | ||
| 3677 | -break; | ||
| 3678 | -case "not": | ||
| 3679 | -var _464=new MochiKit.Selector.Selector(_463); | ||
| 3680 | -_458.push("!( "+_464.buildMatchExpression()+")"); | ||
| 3681 | -break; | ||
| 3682 | -} | ||
| 3683 | -} | ||
| 3684 | -} | ||
| 3685 | -if(_459=_457.attributes){ | ||
| 3686 | -MochiKit.Base.map(function(_465){ | ||
| 3687 | -var _466="MochiKit.DOM.getNodeAttribute(element, "+repr(_465.name)+")"; | ||
| 3688 | -var _467=function(_468){ | ||
| 3689 | -return _466+" && "+_466+".split("+repr(_468)+")"; | ||
| 3690 | -}; | ||
| 3691 | -switch(_465.operator){ | ||
| 3692 | -case "=": | ||
| 3693 | -_458.push(_466+" == "+repr(_465.value)); | ||
| 3694 | -break; | ||
| 3695 | -case "~=": | ||
| 3696 | -_458.push("MochiKit.Base.findValue("+_467(" ")+", "+repr(_465.value)+") > -1"); | ||
| 3697 | -break; | ||
| 3698 | -case "^=": | ||
| 3699 | -_458.push(_466+".substring(0, "+_465.value.length+") == "+repr(_465.value)); | ||
| 3700 | -break; | ||
| 3701 | -case "$=": | ||
| 3702 | -_458.push(_466+".substring("+_466+".length - "+_465.value.length+") == "+repr(_465.value)); | ||
| 3703 | -break; | ||
| 3704 | -case "*=": | ||
| 3705 | -_458.push(_466+".match("+repr(_465.value)+")"); | ||
| 3706 | -break; | ||
| 3707 | -case "|=": | ||
| 3708 | -_458.push(_467("-")+"[0].toUpperCase() == "+repr(_465.value.toUpperCase())); | ||
| 3709 | -break; | ||
| 3710 | -case "!=": | ||
| 3711 | -_458.push(_466+" != "+repr(_465.value)); | ||
| 3712 | -break; | ||
| 3713 | -case "": | ||
| 3714 | -case undefined: | ||
| 3715 | -_458.push(_466+" != null"); | ||
| 3716 | -break; | ||
| 3717 | -default: | ||
| 3718 | -throw "Unknown operator "+_465.operator+" in selector"; | ||
| 3719 | -} | ||
| 3720 | -},_459); | ||
| 3721 | -} | ||
| 3722 | -return _458.join(" && "); | ||
| 3723 | -},compileMatcher:function(){ | ||
| 3724 | -this.match=new Function("element","if (!element.tagName) return false; return "+this.buildMatchExpression()); | ||
| 3725 | -},nthChild:function(_469,a,b,_470,_471){ | ||
| 3726 | -var _472=MochiKit.Base.filter(function(node){ | ||
| 3727 | -return node.nodeType==1; | ||
| 3728 | -},_469.parentNode.childNodes); | ||
| 3729 | -if(_471){ | ||
| 3730 | -_472=MochiKit.Base.filter(function(node){ | ||
| 3731 | -return node.tagName==_469.tagName; | ||
| 3732 | -},_472); | ||
| 3733 | -} | ||
| 3734 | -if(_470){ | ||
| 3735 | -_472=MochiKit.Iter.reversed(_472); | ||
| 3736 | -} | ||
| 3737 | -if(a){ | ||
| 3738 | -var _473=MochiKit.Base.findIdentical(_472,_469); | ||
| 3739 | -return ((_473+1-b)/a)%1==0; | ||
| 3740 | -}else{ | ||
| 3741 | -return b==MochiKit.Base.findIdentical(_472,_469)+1; | ||
| 3742 | -} | ||
| 3743 | -},isUIElement:function(_474){ | ||
| 3744 | -return findValue(["input","button","select","option","textarea","object"],_474.tagName.toLowerCase())>-1; | ||
| 3745 | -},findElements:function(_475,axis){ | ||
| 3746 | -var _477; | ||
| 3747 | -if(axis==undefined){ | ||
| 3748 | -axis=""; | ||
| 3749 | -} | ||
| 3750 | -function inScope(_477,_475){ | ||
| 3751 | -if(axis==""){ | ||
| 3752 | -return MochiKit.DOM.isChildNode(_477,_475); | ||
| 3753 | -}else{ | ||
| 3754 | -if(axis==">"){ | ||
| 3755 | -return _477.parentNode==_475; | ||
| 3756 | -}else{ | ||
| 3757 | -if(axis=="+"){ | ||
| 3758 | -return _477==nextSiblingElement(_475); | ||
| 3759 | -}else{ | ||
| 3760 | -if(axis=="~"){ | ||
| 3761 | -var _478=_475; | ||
| 3762 | -while(_478=nextSiblingElement(_478)){ | ||
| 3763 | -if(_477==_478){ | ||
| 3764 | -return true; | ||
| 3765 | -} | ||
| 3766 | -} | ||
| 3767 | -return false; | ||
| 3768 | -}else{ | ||
| 3769 | -throw "Invalid axis: "+axis; | ||
| 3770 | -} | ||
| 3771 | -} | ||
| 3772 | -} | ||
| 3773 | -} | ||
| 3774 | -} | ||
| 3775 | -if(element=MochiKit.DOM.getElement(this.params.id)){ | ||
| 3776 | -if(this.match(element)){ | ||
| 3777 | -if(!scope||inScope(element,scope)){ | ||
| 3778 | -return [element]; | ||
| 3779 | -} | ||
| 3780 | -} | ||
| 3781 | -} | ||
| 3782 | -function nextSiblingElement(node){ | ||
| 3783 | -node=node.nextSibling; | ||
| 3784 | -while(node&&node.nodeType!=1){ | ||
| 3785 | -node=node.nextSibling; | ||
| 3786 | -} | ||
| 3787 | -return node; | ||
| 3788 | -} | ||
| 3789 | -if(axis==""){ | ||
| 3790 | -scope=(scope||currentDocument()).getElementsByTagName(this.params.tagName||"*"); | ||
| 3791 | -}else{ | ||
| 3792 | -if(axis==">"){ | ||
| 3793 | -if(!scope){ | ||
| 3794 | -throw "> combinator not allowed without preceeding expression"; | ||
| 3795 | -} | ||
| 3796 | -scope=MochiKit.Base.filter(function(node){ | ||
| 3797 | -return node.nodeType==1; | ||
| 3798 | -},scope.childNodes); | ||
| 3799 | -}else{ | ||
| 3800 | -if(axis=="+"){ | ||
| 3801 | -if(!scope){ | ||
| 3802 | -throw "+ combinator not allowed without preceeding expression"; | ||
| 3803 | -} | ||
| 3804 | -scope=nextSiblingElement(scope)&&[nextSiblingElement(scope)]; | ||
| 3805 | -}else{ | ||
| 3806 | -if(axis=="~"){ | ||
| 3807 | -if(!scope){ | ||
| 3808 | -throw "~ combinator not allowed without preceeding expression"; | ||
| 3809 | -} | ||
| 3810 | -var _479=[]; | ||
| 3811 | -while(nextSiblingElement(scope)){ | ||
| 3812 | -scope=nextSiblingElement(scope); | ||
| 3813 | -_479.push(scope); | ||
| 3814 | -} | ||
| 3815 | -scope=_479; | ||
| 3816 | -} | ||
| 3817 | -} | ||
| 3818 | -} | ||
| 3819 | -} | ||
| 3820 | -if(!scope){ | ||
| 3821 | -return []; | ||
| 3822 | -} | ||
| 3823 | -var _480=MochiKit.Base.filter(MochiKit.Base.bind(function(_481){ | ||
| 3824 | -return this.match(_481); | ||
| 3825 | -},this),scope); | ||
| 3826 | -return _480; | ||
| 3827 | -},repr:function(){ | ||
| 3828 | -return "Selector("+this.expression+")"; | ||
| 3829 | -},toString:MochiKit.Base.forwardCall("repr")}; | ||
| 3830 | -MochiKit.Base.update(MochiKit.Selector,{findChildElements:function(_482,_483){ | ||
| 3831 | -return MochiKit.Base.flattenArray(MochiKit.Base.map(function(_484){ | ||
| 3832 | -var _485=""; | ||
| 3833 | -return MochiKit.Iter.reduce(function(_486,expr){ | ||
| 3834 | -if(match=expr.match(/^[>+~]$/)){ | ||
| 3835 | -_485=match[0]; | ||
| 3836 | -return _486; | ||
| 3837 | -}else{ | ||
| 3838 | -var _487=new MochiKit.Selector.Selector(expr); | ||
| 3839 | -var _488=MochiKit.Iter.reduce(function(_488,_489){ | ||
| 3840 | -return MochiKit.Base.extend(_488,_487.findElements(_489||_482,_485)); | ||
| 3841 | -},_486,[]); | ||
| 3842 | -_485=""; | ||
| 3843 | -return elements; | ||
| 3844 | -} | ||
| 3845 | -},_484.replace(/(^\s+|\s+$)/g,"").split(/\s+/),[null]); | ||
| 3846 | -},_483)); | ||
| 3847 | -}}); | ||
| 3848 | -function $$(){ | ||
| 3849 | -return MochiKit.Selector.findChildElements(MochiKit.DOM.currentDocument(),arguments); | ||
| 3850 | -} | ||
| 3851 | -if(typeof (dojo)!="undefined"){ | ||
| 3852 | -dojo.provide("MochiKit.Style"); | ||
| 3853 | -dojo.require("MochiKit.Base"); | ||
| 3854 | -dojo.require("MochiKit.DOM"); | ||
| 3855 | -} | ||
| 3856 | -if(typeof (JSAN)!="undefined"){ | ||
| 3857 | -JSAN.use("MochiKit.Base",[]); | ||
| 3858 | -} | ||
| 3859 | -try{ | ||
| 3860 | -if(typeof (MochiKit.Base)=="undefined"){ | ||
| 3861 | -throw ""; | ||
| 3862 | -} | ||
| 3863 | -} | ||
| 3864 | -catch(e){ | ||
| 3865 | -throw "MochiKit.Style depends on MochiKit.Base!"; | ||
| 3866 | -} | ||
| 3867 | -try{ | ||
| 3868 | -if(typeof (MochiKit.DOM)=="undefined"){ | ||
| 3869 | -throw ""; | ||
| 3870 | -} | ||
| 3871 | -} | ||
| 3872 | -catch(e){ | ||
| 3873 | -throw "MochiKit.Style depends on MochiKit.DOM!"; | ||
| 3874 | -} | ||
| 3875 | -if(typeof (MochiKit.Style)=="undefined"){ | ||
| 3876 | -MochiKit.Style={}; | ||
| 3877 | -} | ||
| 3878 | -MochiKit.Style.NAME="MochiKit.Style"; | ||
| 3879 | -MochiKit.Style.VERSION="1.4"; | ||
| 3880 | -MochiKit.Style.__repr__=function(){ | ||
| 3881 | -return "["+this.NAME+" "+this.VERSION+"]"; | ||
| 3882 | -}; | ||
| 3883 | -MochiKit.Style.toString=function(){ | ||
| 3884 | -return this.__repr__(); | ||
| 3885 | -}; | ||
| 3886 | -MochiKit.Style.EXPORT_OK=[]; | ||
| 3887 | -MochiKit.Style.EXPORT=["setStyle","setOpacity","getStyle","getElementDimensions","elementDimensions","setElementDimensions","getElementPosition","elementPosition","setElementPosition","setDisplayForElement","hideElement","showElement","getViewportDimensions","getViewportPosition","Dimensions","Coordinates"]; | ||
| 3888 | -MochiKit.Style.Dimensions=function(w,h){ | ||
| 3889 | -this.w=w; | ||
| 3890 | -this.h=h; | ||
| 3891 | -}; | ||
| 3892 | -MochiKit.Style.Dimensions.prototype.__repr__=function(){ | ||
| 3893 | -var repr=MochiKit.Base.repr; | ||
| 3894 | -return "{w: "+repr(this.w)+", h: "+repr(this.h)+"}"; | ||
| 3895 | -}; | ||
| 3896 | -MochiKit.Style.Dimensions.prototype.toString=function(){ | ||
| 3897 | -return this.__repr__(); | ||
| 3898 | -}; | ||
| 3899 | -MochiKit.Style.Coordinates=function(x,y){ | ||
| 3900 | -this.x=x; | ||
| 3901 | -this.y=y; | ||
| 3902 | -}; | ||
| 3903 | -MochiKit.Style.Coordinates.prototype.__repr__=function(){ | ||
| 3904 | -var repr=MochiKit.Base.repr; | ||
| 3905 | -return "{x: "+repr(this.x)+", y: "+repr(this.y)+"}"; | ||
| 3906 | -}; | ||
| 3907 | -MochiKit.Style.Coordinates.prototype.toString=function(){ | ||
| 3908 | -return this.__repr__(); | ||
| 3909 | -}; | ||
| 3910 | -MochiKit.Base.update(MochiKit.Style,{getStyle:function(elem,_492){ | ||
| 3911 | -var dom=MochiKit.DOM; | ||
| 3912 | -var d=dom._document; | ||
| 3913 | -elem=dom.getElement(elem); | ||
| 3914 | -_492=MochiKit.Base.camelize(_492); | ||
| 3915 | -if(!elem||elem==d){ | ||
| 3916 | -return undefined; | ||
| 3917 | -} | ||
| 3918 | -if(_492=="opacity"&&elem.filters){ | ||
| 3919 | -var _493; | ||
| 3920 | -if(_493=(MochiKit.Style.getStyle(elem,"filter")||"").match(/alpha\(opacity=(.*)\)/)){ | ||
| 3921 | -if(_493[1]){ | ||
| 3922 | -return parseFloat(_493[1])/100; | ||
| 3923 | -} | ||
| 3924 | -} | ||
| 3925 | -return 1; | ||
| 3926 | -} | ||
| 3927 | -var _494=elem.style?elem.style[_492]:null; | ||
| 3928 | -if(!_494){ | ||
| 3929 | -if(d.defaultView&&d.defaultView.getComputedStyle){ | ||
| 3930 | -var css=d.defaultView.getComputedStyle(elem,null); | ||
| 3931 | -_492=_492.replace(/([A-Z])/g,"-$1").toLowerCase(); | ||
| 3932 | -_494=css?css.getPropertyValue(_492):null; | ||
| 3933 | -}else{ | ||
| 3934 | -if(elem.currentStyle){ | ||
| 3935 | -_494=elem.currentStyle[_492]; | ||
| 3936 | -} | ||
| 3937 | -} | ||
| 3938 | -} | ||
| 3939 | -if(_492=="opacity"){ | ||
| 3940 | -_494=parseFloat(_494); | ||
| 3941 | -} | ||
| 3942 | -if(/Opera/.test(navigator.userAgent)&&(MochiKit.Base.find(["left","top","right","bottom"],_492)!=-1)){ | ||
| 3943 | -if(MochiKit.Style.getStyle(elem,"position")=="static"){ | ||
| 3944 | -_494="auto"; | ||
| 3945 | -} | ||
| 3946 | -} | ||
| 3947 | -return _494=="auto"?null:_494; | ||
| 3948 | -},setStyle:function(elem,_496){ | ||
| 3949 | -elem=MochiKit.DOM.getElement(elem); | ||
| 3950 | -for(name in _496){ | ||
| 3951 | -if(name=="opacity"){ | ||
| 3952 | -MochiKit.Style.setOpacity(elem,_496[name]); | ||
| 3953 | -}else{ | ||
| 3954 | -elem.style[MochiKit.Base.camelize(name)]=_496[name]; | ||
| 3955 | -} | ||
| 3956 | -} | ||
| 3957 | -},setOpacity:function(elem,o){ | ||
| 3958 | -elem=MochiKit.DOM.getElement(elem); | ||
| 3959 | -var self=MochiKit.Style; | ||
| 3960 | -if(o==1){ | ||
| 3961 | -var _497=/Gecko/.test(navigator.userAgent)&&!(/Konqueror|Safari|KHTML/.test(navigator.userAgent)); | ||
| 3962 | -elem.style[name]=_497?0.999999:1; | ||
| 3963 | -if(/MSIE/.test(navigator.userAgent)){ | ||
| 3964 | -elem.style["filter"]=self.getStyle(elem,"filter").replace(/alpha\([^\)]*\)/gi,""); | ||
| 3965 | -} | ||
| 3966 | -}else{ | ||
| 3967 | -if(o<0.00001){ | ||
| 3968 | -o=0; | ||
| 3969 | -} | ||
| 3970 | -elem.style[name]=o; | ||
| 3971 | -if(/MSIE/.test(navigator.userAgent)){ | ||
| 3972 | -elem.style["filter"]=self.getStyle(elem,"filter").replace(/alpha\([^\)]*\)/gi,"")+"alpha(opacity="+o*100+")"; | ||
| 3973 | -} | ||
| 3974 | -} | ||
| 3975 | -},getElementPosition:function(elem,_498){ | ||
| 3976 | -var self=MochiKit.Style; | ||
| 3977 | -var dom=MochiKit.DOM; | ||
| 3978 | -elem=dom.getElement(elem); | ||
| 3979 | -if(!elem||(!(elem.x&&elem.y)&&(!elem.parentNode==null||self.getStyle(elem,"display")=="none"))){ | ||
| 3980 | -return undefined; | ||
| 3981 | -} | ||
| 3982 | -var c=new self.Coordinates(0,0); | ||
| 3983 | -var box=null; | ||
| 3984 | -var _501=null; | ||
| 3985 | -var d=MochiKit.DOM._document; | ||
| 3986 | -var de=d.documentElement; | ||
| 3987 | -var b=d.body; | ||
| 3988 | -if(!elem.parentNode&&elem.x&&elem.y){ | ||
| 3989 | -c.x+=elem.x||0; | ||
| 3990 | -c.y+=elem.y||0; | ||
| 3991 | -}else{ | ||
| 3992 | -if(elem.getBoundingClientRect){ | ||
| 3993 | -box=elem.getBoundingClientRect(); | ||
| 3994 | -c.x+=box.left+(de.scrollLeft||b.scrollLeft)-(de.clientLeft||0); | ||
| 3995 | -c.y+=box.top+(de.scrollTop||b.scrollTop)-(de.clientTop||0); | ||
| 3996 | -}else{ | ||
| 3997 | -if(elem.offsetParent){ | ||
| 3998 | -c.x+=elem.offsetLeft; | ||
| 3999 | -c.y+=elem.offsetTop; | ||
| 4000 | -_501=elem.offsetParent; | ||
| 4001 | -if(_501!=elem){ | ||
| 4002 | -while(_501){ | ||
| 4003 | -c.x+=_501.offsetLeft; | ||
| 4004 | -c.y+=_501.offsetTop; | ||
| 4005 | -_501=_501.offsetParent; | ||
| 4006 | -} | ||
| 4007 | -} | ||
| 4008 | -var ua=navigator.userAgent.toLowerCase(); | ||
| 4009 | -if((typeof (opera)!="undefined"&&parseFloat(opera.version())<9)||(ua.indexOf("safari")!=-1&&self.getStyle(elem,"position")=="absolute")){ | ||
| 4010 | -c.x-=b.offsetLeft; | ||
| 4011 | -c.y-=b.offsetTop; | ||
| 4012 | -} | ||
| 4013 | -} | ||
| 4014 | -} | ||
| 4015 | -} | ||
| 4016 | -if(typeof (_498)!="undefined"){ | ||
| 4017 | -_498=arguments.callee(_498); | ||
| 4018 | -if(_498){ | ||
| 4019 | -c.x-=(_498.x||0); | ||
| 4020 | -c.y-=(_498.y||0); | ||
| 4021 | -} | ||
| 4022 | -} | ||
| 4023 | -if(elem.parentNode){ | ||
| 4024 | -_501=elem.parentNode; | ||
| 4025 | -}else{ | ||
| 4026 | -_501=null; | ||
| 4027 | -} | ||
| 4028 | -while(_501){ | ||
| 4029 | -var _504=_501.tagName.toUpperCase(); | ||
| 4030 | -if(_504==="BODY"||_504==="HTML"){ | ||
| 4031 | -break; | ||
| 4032 | -} | ||
| 4033 | -c.x-=_501.scrollLeft; | ||
| 4034 | -c.y-=_501.scrollTop; | ||
| 4035 | -if(_501.parentNode){ | ||
| 4036 | -_501=_501.parentNode; | ||
| 4037 | -}else{ | ||
| 4038 | -_501=null; | ||
| 4039 | -} | ||
| 4040 | -} | ||
| 4041 | -return c; | ||
| 4042 | -},setElementPosition:function(elem,_505,_506){ | ||
| 4043 | -elem=MochiKit.DOM.getElement(elem); | ||
| 4044 | -if(typeof (_506)=="undefined"){ | ||
| 4045 | -_506="px"; | ||
| 4046 | -} | ||
| 4047 | -var _507={}; | ||
| 4048 | -var _508=MochiKit.Base.isUndefinedOrNull; | ||
| 4049 | -if(!_508(_505.x)){ | ||
| 4050 | -_507["left"]=_505.x+_506; | ||
| 4051 | -} | ||
| 4052 | -if(!_508(_505.y)){ | ||
| 4053 | -_507["top"]=_505.y+_506; | ||
| 4054 | -} | ||
| 4055 | -MochiKit.DOM.updateNodeAttributes(elem,{"style":_507}); | ||
| 4056 | -},getElementDimensions:function(elem){ | ||
| 4057 | -var self=MochiKit.Style; | ||
| 4058 | -var dom=MochiKit.DOM; | ||
| 4059 | -if(typeof (elem.w)=="number"||typeof (elem.h)=="number"){ | ||
| 4060 | -return new self.Dimensions(elem.w||0,elem.h||0); | ||
| 4061 | -} | ||
| 4062 | -elem=dom.getElement(elem); | ||
| 4063 | -if(!elem){ | ||
| 4064 | -return undefined; | ||
| 4065 | -} | ||
| 4066 | -var disp=self.getStyle(elem,"display"); | ||
| 4067 | -if(disp!="none"&&disp!=""&&typeof (disp)!="undefined"){ | ||
| 4068 | -return new self.Dimensions(elem.offsetWidth||0,elem.offsetHeight||0); | ||
| 4069 | -} | ||
| 4070 | -var s=elem.style; | ||
| 4071 | -var _510=s.visibility; | ||
| 4072 | -var _511=s.position; | ||
| 4073 | -s.visibility="hidden"; | ||
| 4074 | -s.position="absolute"; | ||
| 4075 | -s.display=""; | ||
| 4076 | -var _512=elem.offsetWidth; | ||
| 4077 | -var _513=elem.offsetHeight; | ||
| 4078 | -s.display="none"; | ||
| 4079 | -s.position=_511; | ||
| 4080 | -s.visibility=_510; | ||
| 4081 | -return new self.Dimensions(_512,_513); | ||
| 4082 | -},setElementDimensions:function(elem,_514,_515){ | ||
| 4083 | -elem=MochiKit.DOM.getElement(elem); | ||
| 4084 | -if(typeof (_515)=="undefined"){ | ||
| 4085 | -_515="px"; | ||
| 4086 | -} | ||
| 4087 | -var _516={}; | ||
| 4088 | -var _517=MochiKit.Base.isUndefinedOrNull; | ||
| 4089 | -if(!_517(_514.w)){ | ||
| 4090 | -_516["width"]=_514.w+_515; | ||
| 4091 | -} | ||
| 4092 | -if(!_517(_514.h)){ | ||
| 4093 | -_516["height"]=_514.h+_515; | ||
| 4094 | -} | ||
| 4095 | -MochiKit.DOM.updateNodeAttributes(elem,{"style":_516}); | ||
| 4096 | -},setDisplayForElement:function(_518,_519){ | ||
| 4097 | -var _520=MochiKit.Base.extend(null,arguments,1); | ||
| 4098 | -var _521=MochiKit.DOM.getElement; | ||
| 4099 | -for(var i=0;i<_520.length;i++){ | ||
| 4100 | -var _519=_521(_520[i]); | ||
| 4101 | -if(_519){ | ||
| 4102 | -_519.style.display=_518; | ||
| 4103 | -} | ||
| 4104 | -} | ||
| 4105 | -},getViewportDimensions:function(){ | ||
| 4106 | -var d=new MochiKit.Style.Dimensions(); | ||
| 4107 | -var w=MochiKit.DOM._window; | ||
| 4108 | -var b=MochiKit.DOM._document.body; | ||
| 4109 | -if(w.innerWidth){ | ||
| 4110 | -d.w=w.innerWidth; | ||
| 4111 | -d.h=w.innerHeight; | ||
| 4112 | -}else{ | ||
| 4113 | -if(b.parentElement.clientWidth){ | ||
| 4114 | -d.w=b.parentElement.clientWidth; | ||
| 4115 | -d.h=b.parentElement.clientHeight; | ||
| 4116 | -}else{ | ||
| 4117 | -if(b&&b.clientWidth){ | ||
| 4118 | -d.w=b.clientWidth; | ||
| 4119 | -d.h=b.clientHeight; | ||
| 4120 | -} | ||
| 4121 | -} | ||
| 4122 | -} | ||
| 4123 | -return d; | ||
| 4124 | -},getViewportPosition:function(){ | ||
| 4125 | -var c=new MochiKit.Style.Coordinates(0,0); | ||
| 4126 | -var d=MochiKit.DOM._document; | ||
| 4127 | -var de=d.documentElement; | ||
| 4128 | -var db=d.body; | ||
| 4129 | -if(de&&(de.scrollTop||de.scrollLeft)){ | ||
| 4130 | -c.x=de.scrollLeft; | ||
| 4131 | -c.y=de.scrollTop; | ||
| 4132 | -}else{ | ||
| 4133 | -if(db){ | ||
| 4134 | -c.x=db.scrollLeft; | ||
| 4135 | -c.y=db.scrollTop; | ||
| 4136 | -} | ||
| 4137 | -} | ||
| 4138 | -return c; | ||
| 4139 | -},__new__:function(){ | 3186 | +},__new__:function(win){ |
| 4140 | var m=MochiKit.Base; | 3187 | var m=MochiKit.Base; |
| 4141 | -this.elementPosition=this.getElementPosition; | ||
| 4142 | -this.elementDimensions=this.getElementDimensions; | 3188 | +this._document=document; |
| 3189 | +this._window=win; | ||
| 3190 | +this.domConverters=new m.AdapterRegistry(); | ||
| 3191 | +var _422=this._document.createElement("span"); | ||
| 3192 | +var _423; | ||
| 3193 | +if(_422&&_422.attributes&&_422.attributes.length>0){ | ||
| 3194 | +var _424=m.filter; | ||
| 3195 | +_423=function(node){ | ||
| 3196 | +return _424(_423.ignoreAttrFilter,node.attributes); | ||
| 3197 | +}; | ||
| 3198 | +_423.ignoreAttr={}; | ||
| 3199 | +MochiKit.Iter.forEach(_422.attributes,function(a){ | ||
| 3200 | +_423.ignoreAttr[a.name]=a.value; | ||
| 3201 | +}); | ||
| 3202 | +_423.ignoreAttrFilter=function(a){ | ||
| 3203 | +return (_423.ignoreAttr[a.name]!=a.value); | ||
| 3204 | +}; | ||
| 3205 | +_423.compliant=false; | ||
| 3206 | +_423.renames={"class":"className","checked":"defaultChecked","usemap":"useMap","for":"htmlFor"}; | ||
| 3207 | +}else{ | ||
| 3208 | +_423=function(node){ | ||
| 3209 | +return node.attributes; | ||
| 3210 | +}; | ||
| 3211 | +_423.compliant=true; | ||
| 3212 | +_423.renames={}; | ||
| 3213 | +} | ||
| 3214 | +this.attributeArray=_423; | ||
| 3215 | +var _425=this.createDOMFunc; | ||
| 3216 | +this.UL=_425("ul"); | ||
| 3217 | +this.OL=_425("ol"); | ||
| 3218 | +this.LI=_425("li"); | ||
| 3219 | +this.TD=_425("td"); | ||
| 3220 | +this.TR=_425("tr"); | ||
| 3221 | +this.TBODY=_425("tbody"); | ||
| 3222 | +this.THEAD=_425("thead"); | ||
| 3223 | +this.TFOOT=_425("tfoot"); | ||
| 3224 | +this.TABLE=_425("table"); | ||
| 3225 | +this.TH=_425("th"); | ||
| 3226 | +this.INPUT=_425("input"); | ||
| 3227 | +this.SPAN=_425("span"); | ||
| 3228 | +this.A=_425("a"); | ||
| 3229 | +this.DIV=_425("div"); | ||
| 3230 | +this.IMG=_425("img"); | ||
| 3231 | +this.BUTTON=_425("button"); | ||
| 3232 | +this.TT=_425("tt"); | ||
| 3233 | +this.PRE=_425("pre"); | ||
| 3234 | +this.H1=_425("h1"); | ||
| 3235 | +this.H2=_425("h2"); | ||
| 3236 | +this.H3=_425("h3"); | ||
| 3237 | +this.BR=_425("br"); | ||
| 3238 | +this.HR=_425("hr"); | ||
| 3239 | +this.LABEL=_425("label"); | ||
| 3240 | +this.TEXTAREA=_425("textarea"); | ||
| 3241 | +this.FORM=_425("form"); | ||
| 3242 | +this.P=_425("p"); | ||
| 3243 | +this.SELECT=_425("select"); | ||
| 3244 | +this.OPTION=_425("option"); | ||
| 3245 | +this.OPTGROUP=_425("optgroup"); | ||
| 3246 | +this.LEGEND=_425("legend"); | ||
| 3247 | +this.FIELDSET=_425("fieldset"); | ||
| 3248 | +this.STRONG=_425("strong"); | ||
| 3249 | +this.CANVAS=_425("canvas"); | ||
| 4143 | this.hideElement=m.partial(this.setDisplayForElement,"none"); | 3250 | this.hideElement=m.partial(this.setDisplayForElement,"none"); |
| 4144 | this.showElement=m.partial(this.setDisplayForElement,"block"); | 3251 | this.showElement=m.partial(this.setDisplayForElement,"block"); |
| 3252 | +this.removeElement=this.swapDOM; | ||
| 3253 | +this.$=this.getElement; | ||
| 4145 | this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)}; | 3254 | this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)}; |
| 4146 | m.nameFunctions(this); | 3255 | m.nameFunctions(this); |
| 4147 | }}); | 3256 | }}); |
| 4148 | -MochiKit.Style.__new__(); | ||
| 4149 | -MochiKit.Base._exportSymbols(this,MochiKit.Style); | 3257 | +MochiKit.DOM.__new__(((typeof (window)=="undefined")?this:window)); |
| 3258 | +if(!MochiKit.__compat__){ | ||
| 3259 | +withWindow=MochiKit.DOM.withWindow; | ||
| 3260 | +withDocument=MochiKit.DOM.withDocument; | ||
| 3261 | +} | ||
| 3262 | +MochiKit.Base._exportSymbols(this,MochiKit.DOM); | ||
| 4150 | if(typeof (dojo)!="undefined"){ | 3263 | if(typeof (dojo)!="undefined"){ |
| 4151 | dojo.provide("MochiKit.LoggingPane"); | 3264 | dojo.provide("MochiKit.LoggingPane"); |
| 4152 | dojo.require("MochiKit.Logging"); | 3265 | dojo.require("MochiKit.Logging"); |
| @@ -4168,41 +3281,41 @@ if(typeof (MochiKit.LoggingPane)=="undefined"){ | @@ -4168,41 +3281,41 @@ if(typeof (MochiKit.LoggingPane)=="undefined"){ | ||
| 4168 | MochiKit.LoggingPane={}; | 3281 | MochiKit.LoggingPane={}; |
| 4169 | } | 3282 | } |
| 4170 | MochiKit.LoggingPane.NAME="MochiKit.LoggingPane"; | 3283 | MochiKit.LoggingPane.NAME="MochiKit.LoggingPane"; |
| 4171 | -MochiKit.LoggingPane.VERSION="1.4"; | 3284 | +MochiKit.LoggingPane.VERSION="1.3.1"; |
| 4172 | MochiKit.LoggingPane.__repr__=function(){ | 3285 | MochiKit.LoggingPane.__repr__=function(){ |
| 4173 | return "["+this.NAME+" "+this.VERSION+"]"; | 3286 | return "["+this.NAME+" "+this.VERSION+"]"; |
| 4174 | }; | 3287 | }; |
| 4175 | MochiKit.LoggingPane.toString=function(){ | 3288 | MochiKit.LoggingPane.toString=function(){ |
| 4176 | return this.__repr__(); | 3289 | return this.__repr__(); |
| 4177 | }; | 3290 | }; |
| 4178 | -MochiKit.LoggingPane.createLoggingPane=function(_523){ | 3291 | +MochiKit.LoggingPane.createLoggingPane=function(_426){ |
| 4179 | var m=MochiKit.LoggingPane; | 3292 | var m=MochiKit.LoggingPane; |
| 4180 | -_523=!(!_523); | ||
| 4181 | -if(m._loggingPane&&m._loggingPane.inline!=_523){ | 3293 | +_426=!(!_426); |
| 3294 | +if(m._loggingPane&&m._loggingPane.inline!=_426){ | ||
| 4182 | m._loggingPane.closePane(); | 3295 | m._loggingPane.closePane(); |
| 4183 | m._loggingPane=null; | 3296 | m._loggingPane=null; |
| 4184 | } | 3297 | } |
| 4185 | if(!m._loggingPane||m._loggingPane.closed){ | 3298 | if(!m._loggingPane||m._loggingPane.closed){ |
| 4186 | -m._loggingPane=new m.LoggingPane(_523,MochiKit.Logging.logger); | 3299 | +m._loggingPane=new m.LoggingPane(_426,MochiKit.Logging.logger); |
| 4187 | } | 3300 | } |
| 4188 | return m._loggingPane; | 3301 | return m._loggingPane; |
| 4189 | }; | 3302 | }; |
| 4190 | -MochiKit.LoggingPane.LoggingPane=function(_524,_525){ | ||
| 4191 | -if(typeof (_525)=="undefined"||_525===null){ | ||
| 4192 | -_525=MochiKit.Logging.logger; | 3303 | +MochiKit.LoggingPane.LoggingPane=function(_427,_428){ |
| 3304 | +if(typeof (_428)=="undefined"||_428===null){ | ||
| 3305 | +_428=MochiKit.Logging.logger; | ||
| 4193 | } | 3306 | } |
| 4194 | -this.logger=_525; | ||
| 4195 | -var _526=MochiKit.Base.update; | ||
| 4196 | -var _527=MochiKit.Base.updatetree; | 3307 | +this.logger=_428; |
| 3308 | +var _429=MochiKit.Base.update; | ||
| 3309 | +var _430=MochiKit.Base.updatetree; | ||
| 4197 | var bind=MochiKit.Base.bind; | 3310 | var bind=MochiKit.Base.bind; |
| 4198 | -var _528=MochiKit.Base.clone; | 3311 | +var _431=MochiKit.Base.clone; |
| 4199 | var win=window; | 3312 | var win=window; |
| 4200 | var uid="_MochiKit_LoggingPane"; | 3313 | var uid="_MochiKit_LoggingPane"; |
| 4201 | if(typeof (MochiKit.DOM)!="undefined"){ | 3314 | if(typeof (MochiKit.DOM)!="undefined"){ |
| 4202 | win=MochiKit.DOM.currentWindow(); | 3315 | win=MochiKit.DOM.currentWindow(); |
| 4203 | } | 3316 | } |
| 4204 | -if(!_524){ | ||
| 4205 | -var url=win.location.href.split("?")[0].replace(/[#:\/.><&-]/g,"_"); | 3317 | +if(!_427){ |
| 3318 | +var url=win.location.href.split("?")[0].replace(/[:\/.><&]/g,"_"); | ||
| 4206 | var name=uid+"_"+url; | 3319 | var name=uid+"_"+url; |
| 4207 | var nwin=win.open("",name,"dependent,resizable,height=200"); | 3320 | var nwin=win.open("",name,"dependent,resizable,height=200"); |
| 4208 | if(!nwin){ | 3321 | if(!nwin){ |
| @@ -4216,89 +3329,89 @@ win=nwin; | @@ -4216,89 +3329,89 @@ win=nwin; | ||
| 4216 | } | 3329 | } |
| 4217 | var doc=win.document; | 3330 | var doc=win.document; |
| 4218 | this.doc=doc; | 3331 | this.doc=doc; |
| 4219 | -var _531=doc.getElementById(uid); | ||
| 4220 | -var _532=!!_531; | ||
| 4221 | -if(_531&&typeof (_531.loggingPane)!="undefined"){ | ||
| 4222 | -_531.loggingPane.logger=this.logger; | ||
| 4223 | -_531.loggingPane.buildAndApplyFilter(); | ||
| 4224 | -return _531.loggingPane; | ||
| 4225 | -} | ||
| 4226 | -if(_532){ | ||
| 4227 | -var _533; | ||
| 4228 | -while((_533=_531.firstChild)){ | ||
| 4229 | -_531.removeChild(_533); | ||
| 4230 | -} | ||
| 4231 | -}else{ | ||
| 4232 | -_531=doc.createElement("div"); | ||
| 4233 | -_531.id=uid; | ||
| 4234 | -} | ||
| 4235 | -_531.loggingPane=this; | ||
| 4236 | -var _534=doc.createElement("input"); | ||
| 4237 | -var _535=doc.createElement("input"); | ||
| 4238 | -var _536=doc.createElement("button"); | ||
| 4239 | -var _537=doc.createElement("button"); | ||
| 4240 | -var _538=doc.createElement("button"); | ||
| 4241 | -var _539=doc.createElement("button"); | ||
| 4242 | -var _540=doc.createElement("div"); | ||
| 4243 | -var _541=doc.createElement("div"); | ||
| 4244 | -var _542=uid+"_Listener"; | ||
| 4245 | -this.colorTable=_528(this.colorTable); | ||
| 4246 | -var _543=[]; | ||
| 4247 | -var _544=null; | ||
| 4248 | -var _545=function(msg){ | ||
| 4249 | -var _546=msg.level; | ||
| 4250 | -if(typeof (_546)=="number"){ | ||
| 4251 | -_546=MochiKit.Logging.LogLevel[_546]; | ||
| 4252 | -} | ||
| 4253 | -return _546; | ||
| 4254 | -}; | ||
| 4255 | -var _547=function(msg){ | 3332 | +var _434=doc.getElementById(uid); |
| 3333 | +var _435=!!_434; | ||
| 3334 | +if(_434&&typeof (_434.loggingPane)!="undefined"){ | ||
| 3335 | +_434.loggingPane.logger=this.logger; | ||
| 3336 | +_434.loggingPane.buildAndApplyFilter(); | ||
| 3337 | +return _434.loggingPane; | ||
| 3338 | +} | ||
| 3339 | +if(_435){ | ||
| 3340 | +var _436; | ||
| 3341 | +while((_436=_434.firstChild)){ | ||
| 3342 | +_434.removeChild(_436); | ||
| 3343 | +} | ||
| 3344 | +}else{ | ||
| 3345 | +_434=doc.createElement("div"); | ||
| 3346 | +_434.id=uid; | ||
| 3347 | +} | ||
| 3348 | +_434.loggingPane=this; | ||
| 3349 | +var _437=doc.createElement("input"); | ||
| 3350 | +var _438=doc.createElement("input"); | ||
| 3351 | +var _439=doc.createElement("button"); | ||
| 3352 | +var _440=doc.createElement("button"); | ||
| 3353 | +var _441=doc.createElement("button"); | ||
| 3354 | +var _442=doc.createElement("button"); | ||
| 3355 | +var _443=doc.createElement("div"); | ||
| 3356 | +var _444=doc.createElement("div"); | ||
| 3357 | +var _445=uid+"_Listener"; | ||
| 3358 | +this.colorTable=_431(this.colorTable); | ||
| 3359 | +var _446=[]; | ||
| 3360 | +var _447=null; | ||
| 3361 | +var _448=function(msg){ | ||
| 3362 | +var _449=msg.level; | ||
| 3363 | +if(typeof (_449)=="number"){ | ||
| 3364 | +_449=MochiKit.Logging.LogLevel[_449]; | ||
| 3365 | +} | ||
| 3366 | +return _449; | ||
| 3367 | +}; | ||
| 3368 | +var _450=function(msg){ | ||
| 4256 | return msg.info.join(" "); | 3369 | return msg.info.join(" "); |
| 4257 | }; | 3370 | }; |
| 4258 | -var _548=bind(function(msg){ | ||
| 4259 | -var _549=_545(msg); | ||
| 4260 | -var text=_547(msg); | ||
| 4261 | -var c=this.colorTable[_549]; | 3371 | +var _451=bind(function(msg){ |
| 3372 | +var _452=_448(msg); | ||
| 3373 | +var text=_450(msg); | ||
| 3374 | +var c=this.colorTable[_452]; | ||
| 4262 | var p=doc.createElement("span"); | 3375 | var p=doc.createElement("span"); |
| 4263 | -p.className="MochiKit-LogMessage MochiKit-LogLevel-"+_549; | 3376 | +p.className="MochiKit-LogMessage MochiKit-LogLevel-"+_452; |
| 4264 | p.style.cssText="margin: 0px; white-space: -moz-pre-wrap; white-space: -o-pre-wrap; white-space: pre-wrap; white-space: pre-line; word-wrap: break-word; wrap-option: emergency; color: "+c; | 3377 | p.style.cssText="margin: 0px; white-space: -moz-pre-wrap; white-space: -o-pre-wrap; white-space: pre-wrap; white-space: pre-line; word-wrap: break-word; wrap-option: emergency; color: "+c; |
| 4265 | -p.appendChild(doc.createTextNode(_549+": "+text)); | ||
| 4266 | -_541.appendChild(p); | ||
| 4267 | -_541.appendChild(doc.createElement("br")); | ||
| 4268 | -if(_540.offsetHeight>_540.scrollHeight){ | ||
| 4269 | -_540.scrollTop=0; | 3378 | +p.appendChild(doc.createTextNode(_452+": "+text)); |
| 3379 | +_444.appendChild(p); | ||
| 3380 | +_444.appendChild(doc.createElement("br")); | ||
| 3381 | +if(_443.offsetHeight>_443.scrollHeight){ | ||
| 3382 | +_443.scrollTop=0; | ||
| 4270 | }else{ | 3383 | }else{ |
| 4271 | -_540.scrollTop=_540.scrollHeight; | 3384 | +_443.scrollTop=_443.scrollHeight; |
| 4272 | } | 3385 | } |
| 4273 | },this); | 3386 | },this); |
| 4274 | -var _551=function(msg){ | ||
| 4275 | -_543[_543.length]=msg; | ||
| 4276 | -_548(msg); | 3387 | +var _454=function(msg){ |
| 3388 | +_446[_446.length]=msg; | ||
| 3389 | +_451(msg); | ||
| 4277 | }; | 3390 | }; |
| 4278 | -var _552=function(){ | ||
| 4279 | -var _553,infore; | 3391 | +var _455=function(){ |
| 3392 | +var _456,infore; | ||
| 4280 | try{ | 3393 | try{ |
| 4281 | -_553=new RegExp(_534.value); | ||
| 4282 | -infore=new RegExp(_535.value); | 3394 | +_456=new RegExp(_437.value); |
| 3395 | +infore=new RegExp(_438.value); | ||
| 4283 | } | 3396 | } |
| 4284 | catch(e){ | 3397 | catch(e){ |
| 4285 | logDebug("Error in filter regex: "+e.message); | 3398 | logDebug("Error in filter regex: "+e.message); |
| 4286 | return null; | 3399 | return null; |
| 4287 | } | 3400 | } |
| 4288 | return function(msg){ | 3401 | return function(msg){ |
| 4289 | -return (_553.test(_545(msg))&&infore.test(_547(msg))); | 3402 | +return (_456.test(_448(msg))&&infore.test(_450(msg))); |
| 4290 | }; | 3403 | }; |
| 4291 | }; | 3404 | }; |
| 4292 | -var _554=function(){ | ||
| 4293 | -while(_541.firstChild){ | ||
| 4294 | -_541.removeChild(_541.firstChild); | 3405 | +var _457=function(){ |
| 3406 | +while(_444.firstChild){ | ||
| 3407 | +_444.removeChild(_444.firstChild); | ||
| 4295 | } | 3408 | } |
| 4296 | }; | 3409 | }; |
| 4297 | -var _555=function(){ | ||
| 4298 | -_543=[]; | ||
| 4299 | -_554(); | 3410 | +var _458=function(){ |
| 3411 | +_446=[]; | ||
| 3412 | +_457(); | ||
| 4300 | }; | 3413 | }; |
| 4301 | -var _556=bind(function(){ | 3414 | +var _459=bind(function(){ |
| 4302 | if(this.closed){ | 3415 | if(this.closed){ |
| 4303 | return; | 3416 | return; |
| 4304 | } | 3417 | } |
| @@ -4306,94 +3419,85 @@ this.closed=true; | @@ -4306,94 +3419,85 @@ this.closed=true; | ||
| 4306 | if(MochiKit.LoggingPane._loggingPane==this){ | 3419 | if(MochiKit.LoggingPane._loggingPane==this){ |
| 4307 | MochiKit.LoggingPane._loggingPane=null; | 3420 | MochiKit.LoggingPane._loggingPane=null; |
| 4308 | } | 3421 | } |
| 4309 | -this.logger.removeListener(_542); | ||
| 4310 | -try{ | ||
| 4311 | -try{ | ||
| 4312 | -_531.loggingPane=null; | ||
| 4313 | -} | ||
| 4314 | -catch(e){ | ||
| 4315 | -logFatal("Bookmarklet was closed incorrectly."); | ||
| 4316 | -} | ||
| 4317 | -if(_524){ | ||
| 4318 | -_531.parentNode.removeChild(_531); | 3422 | +this.logger.removeListener(_445); |
| 3423 | +_434.loggingPane=null; | ||
| 3424 | +if(_427){ | ||
| 3425 | +_434.parentNode.removeChild(_434); | ||
| 4319 | }else{ | 3426 | }else{ |
| 4320 | this.win.close(); | 3427 | this.win.close(); |
| 4321 | } | 3428 | } |
| 4322 | -} | ||
| 4323 | -catch(e){ | ||
| 4324 | -} | ||
| 4325 | },this); | 3429 | },this); |
| 4326 | -var _557=function(){ | ||
| 4327 | -_554(); | ||
| 4328 | -for(var i=0;i<_543.length;i++){ | ||
| 4329 | -var msg=_543[i]; | ||
| 4330 | -if(_544===null||_544(msg)){ | ||
| 4331 | -_548(msg); | 3430 | +var _460=function(){ |
| 3431 | +_457(); | ||
| 3432 | +for(var i=0;i<_446.length;i++){ | ||
| 3433 | +var msg=_446[i]; | ||
| 3434 | +if(_447===null||_447(msg)){ | ||
| 3435 | +_451(msg); | ||
| 4332 | } | 3436 | } |
| 4333 | } | 3437 | } |
| 4334 | }; | 3438 | }; |
| 4335 | this.buildAndApplyFilter=function(){ | 3439 | this.buildAndApplyFilter=function(){ |
| 4336 | -_544=_552(); | ||
| 4337 | -_557(); | ||
| 4338 | -this.logger.removeListener(_542); | ||
| 4339 | -this.logger.addListener(_542,_544,_551); | ||
| 4340 | -}; | ||
| 4341 | -var _558=bind(function(){ | ||
| 4342 | -_543=this.logger.getMessages(); | ||
| 4343 | -_557(); | 3440 | +_447=_455(); |
| 3441 | +_460(); | ||
| 3442 | +this.logger.removeListener(_445); | ||
| 3443 | +this.logger.addListener(_445,_447,_454); | ||
| 3444 | +}; | ||
| 3445 | +var _461=bind(function(){ | ||
| 3446 | +_446=this.logger.getMessages(); | ||
| 3447 | +_460(); | ||
| 4344 | },this); | 3448 | },this); |
| 4345 | -var _559=bind(function(_560){ | ||
| 4346 | -_560=_560||window.event; | ||
| 4347 | -key=_560.which||_560.keyCode; | 3449 | +var _462=bind(function(_463){ |
| 3450 | +_463=_463||window.event; | ||
| 3451 | +key=_463.which||_463.keyCode; | ||
| 4348 | if(key==13){ | 3452 | if(key==13){ |
| 4349 | this.buildAndApplyFilter(); | 3453 | this.buildAndApplyFilter(); |
| 4350 | } | 3454 | } |
| 4351 | },this); | 3455 | },this); |
| 4352 | -var _561="display: block; z-index: 1000; left: 0px; bottom: 0px; position: fixed; width: 100%; background-color: white; font: "+this.logFont; | ||
| 4353 | -if(_524){ | ||
| 4354 | -_561+="; height: 10em; border-top: 2px solid black"; | ||
| 4355 | -}else{ | ||
| 4356 | -_561+="; height: 100%;"; | ||
| 4357 | -} | ||
| 4358 | -_531.style.cssText=_561; | ||
| 4359 | -if(!_532){ | ||
| 4360 | -doc.body.appendChild(_531); | ||
| 4361 | -} | ||
| 4362 | -_561={"cssText":"width: 33%; display: inline; font: "+this.logFont}; | ||
| 4363 | -_527(_534,{"value":"FATAL|ERROR|WARNING|INFO|DEBUG","onkeypress":_559,"style":_561}); | ||
| 4364 | -_531.appendChild(_534); | ||
| 4365 | -_527(_535,{"value":".*","onkeypress":_559,"style":_561}); | ||
| 4366 | -_531.appendChild(_535); | ||
| 4367 | -_561="width: 8%; display:inline; font: "+this.logFont; | ||
| 4368 | -_536.appendChild(doc.createTextNode("Filter")); | ||
| 4369 | -_536.onclick=bind("buildAndApplyFilter",this); | ||
| 4370 | -_536.style.cssText=_561; | ||
| 4371 | -_531.appendChild(_536); | ||
| 4372 | -_537.appendChild(doc.createTextNode("Load")); | ||
| 4373 | -_537.onclick=_558; | ||
| 4374 | -_537.style.cssText=_561; | ||
| 4375 | -_531.appendChild(_537); | ||
| 4376 | -_538.appendChild(doc.createTextNode("Clear")); | ||
| 4377 | -_538.onclick=_555; | ||
| 4378 | -_538.style.cssText=_561; | ||
| 4379 | -_531.appendChild(_538); | ||
| 4380 | -_539.appendChild(doc.createTextNode("Close")); | ||
| 4381 | -_539.onclick=_556; | ||
| 4382 | -_539.style.cssText=_561; | ||
| 4383 | -_531.appendChild(_539); | ||
| 4384 | -_540.style.cssText="overflow: auto; width: 100%"; | ||
| 4385 | -_541.style.cssText="width: 100%; height: "+(_524?"8em":"100%"); | ||
| 4386 | -_540.appendChild(_541); | ||
| 4387 | -_531.appendChild(_540); | 3456 | +var _464="display: block; z-index: 1000; left: 0px; bottom: 0px; position: fixed; width: 100%; background-color: white; font: "+this.logFont; |
| 3457 | +if(_427){ | ||
| 3458 | +_464+="; height: 10em; border-top: 2px solid black"; | ||
| 3459 | +}else{ | ||
| 3460 | +_464+="; height: 100%;"; | ||
| 3461 | +} | ||
| 3462 | +_434.style.cssText=_464; | ||
| 3463 | +if(!_435){ | ||
| 3464 | +doc.body.appendChild(_434); | ||
| 3465 | +} | ||
| 3466 | +_464={"cssText":"width: 33%; display: inline; font: "+this.logFont}; | ||
| 3467 | +_430(_437,{"value":"FATAL|ERROR|WARNING|INFO|DEBUG","onkeypress":_462,"style":_464}); | ||
| 3468 | +_434.appendChild(_437); | ||
| 3469 | +_430(_438,{"value":".*","onkeypress":_462,"style":_464}); | ||
| 3470 | +_434.appendChild(_438); | ||
| 3471 | +_464="width: 8%; display:inline; font: "+this.logFont; | ||
| 3472 | +_439.appendChild(doc.createTextNode("Filter")); | ||
| 3473 | +_439.onclick=bind("buildAndApplyFilter",this); | ||
| 3474 | +_439.style.cssText=_464; | ||
| 3475 | +_434.appendChild(_439); | ||
| 3476 | +_440.appendChild(doc.createTextNode("Load")); | ||
| 3477 | +_440.onclick=_461; | ||
| 3478 | +_440.style.cssText=_464; | ||
| 3479 | +_434.appendChild(_440); | ||
| 3480 | +_441.appendChild(doc.createTextNode("Clear")); | ||
| 3481 | +_441.onclick=_458; | ||
| 3482 | +_441.style.cssText=_464; | ||
| 3483 | +_434.appendChild(_441); | ||
| 3484 | +_442.appendChild(doc.createTextNode("Close")); | ||
| 3485 | +_442.onclick=_459; | ||
| 3486 | +_442.style.cssText=_464; | ||
| 3487 | +_434.appendChild(_442); | ||
| 3488 | +_443.style.cssText="overflow: auto; width: 100%"; | ||
| 3489 | +_444.style.cssText="width: 100%; height: "+(_427?"8em":"100%"); | ||
| 3490 | +_443.appendChild(_444); | ||
| 3491 | +_434.appendChild(_443); | ||
| 4388 | this.buildAndApplyFilter(); | 3492 | this.buildAndApplyFilter(); |
| 4389 | -_558(); | ||
| 4390 | -if(_524){ | 3493 | +_461(); |
| 3494 | +if(_427){ | ||
| 4391 | this.win=undefined; | 3495 | this.win=undefined; |
| 4392 | }else{ | 3496 | }else{ |
| 4393 | this.win=win; | 3497 | this.win=win; |
| 4394 | } | 3498 | } |
| 4395 | -this.inline=_524; | ||
| 4396 | -this.closePane=_556; | 3499 | +this.inline=_427; |
| 3500 | +this.closePane=_459; | ||
| 4397 | this.closed=false; | 3501 | this.closed=false; |
| 4398 | return this; | 3502 | return this; |
| 4399 | }; | 3503 | }; |
| @@ -4410,13 +3514,9 @@ MochiKit.Base._exportSymbols(this,MochiKit.LoggingPane); | @@ -4410,13 +3514,9 @@ MochiKit.Base._exportSymbols(this,MochiKit.LoggingPane); | ||
| 4410 | if(typeof (dojo)!="undefined"){ | 3514 | if(typeof (dojo)!="undefined"){ |
| 4411 | dojo.provide("MochiKit.Color"); | 3515 | dojo.provide("MochiKit.Color"); |
| 4412 | dojo.require("MochiKit.Base"); | 3516 | dojo.require("MochiKit.Base"); |
| 4413 | -dojo.require("MochiKit.DOM"); | ||
| 4414 | -dojo.require("MochiKit.Style"); | ||
| 4415 | } | 3517 | } |
| 4416 | if(typeof (JSAN)!="undefined"){ | 3518 | if(typeof (JSAN)!="undefined"){ |
| 4417 | JSAN.use("MochiKit.Base",[]); | 3519 | JSAN.use("MochiKit.Base",[]); |
| 4418 | -JSAN.use("MochiKit.DOM",[]); | ||
| 4419 | -JSAN.use("MochiKit.Style",[]); | ||
| 4420 | } | 3520 | } |
| 4421 | try{ | 3521 | try{ |
| 4422 | if(typeof (MochiKit.Base)=="undefined"){ | 3522 | if(typeof (MochiKit.Base)=="undefined"){ |
| @@ -4426,80 +3526,64 @@ throw ""; | @@ -4426,80 +3526,64 @@ throw ""; | ||
| 4426 | catch(e){ | 3526 | catch(e){ |
| 4427 | throw "MochiKit.Color depends on MochiKit.Base"; | 3527 | throw "MochiKit.Color depends on MochiKit.Base"; |
| 4428 | } | 3528 | } |
| 4429 | -try{ | ||
| 4430 | -if(typeof (MochiKit.Base)=="undefined"){ | ||
| 4431 | -throw ""; | ||
| 4432 | -} | ||
| 4433 | -} | ||
| 4434 | -catch(e){ | ||
| 4435 | -throw "MochiKit.Color depends on MochiKit.DOM"; | ||
| 4436 | -} | ||
| 4437 | -try{ | ||
| 4438 | -if(typeof (MochiKit.Base)=="undefined"){ | ||
| 4439 | -throw ""; | ||
| 4440 | -} | ||
| 4441 | -} | ||
| 4442 | -catch(e){ | ||
| 4443 | -throw "MochiKit.Color depends on MochiKit.Style"; | ||
| 4444 | -} | ||
| 4445 | if(typeof (MochiKit.Color)=="undefined"){ | 3529 | if(typeof (MochiKit.Color)=="undefined"){ |
| 4446 | MochiKit.Color={}; | 3530 | MochiKit.Color={}; |
| 4447 | } | 3531 | } |
| 4448 | MochiKit.Color.NAME="MochiKit.Color"; | 3532 | MochiKit.Color.NAME="MochiKit.Color"; |
| 4449 | -MochiKit.Color.VERSION="1.4"; | 3533 | +MochiKit.Color.VERSION="1.3.1"; |
| 4450 | MochiKit.Color.__repr__=function(){ | 3534 | MochiKit.Color.__repr__=function(){ |
| 4451 | return "["+this.NAME+" "+this.VERSION+"]"; | 3535 | return "["+this.NAME+" "+this.VERSION+"]"; |
| 4452 | }; | 3536 | }; |
| 4453 | MochiKit.Color.toString=function(){ | 3537 | MochiKit.Color.toString=function(){ |
| 4454 | return this.__repr__(); | 3538 | return this.__repr__(); |
| 4455 | }; | 3539 | }; |
| 4456 | -MochiKit.Color.Color=function(red,_563,blue,_565){ | ||
| 4457 | -if(typeof (_565)=="undefined"||_565===null){ | ||
| 4458 | -_565=1; | 3540 | +MochiKit.Color.Color=function(red,_466,blue,_468){ |
| 3541 | +if(typeof (_468)=="undefined"||_468===null){ | ||
| 3542 | +_468=1; | ||
| 4459 | } | 3543 | } |
| 4460 | -this.rgb={r:red,g:_563,b:blue,a:_565}; | 3544 | +this.rgb={r:red,g:_466,b:blue,a:_468}; |
| 4461 | }; | 3545 | }; |
| 4462 | -MochiKit.Color.Color.prototype={__class__:MochiKit.Color.Color,colorWithAlpha:function(_566){ | 3546 | +MochiKit.Color.Color.prototype={__class__:MochiKit.Color.Color,colorWithAlpha:function(_469){ |
| 4463 | var rgb=this.rgb; | 3547 | var rgb=this.rgb; |
| 4464 | var m=MochiKit.Color; | 3548 | var m=MochiKit.Color; |
| 4465 | -return m.Color.fromRGB(rgb.r,rgb.g,rgb.b,_566); | 3549 | +return m.Color.fromRGB(rgb.r,rgb.g,rgb.b,_469); |
| 4466 | },colorWithHue:function(hue){ | 3550 | },colorWithHue:function(hue){ |
| 4467 | var hsl=this.asHSL(); | 3551 | var hsl=this.asHSL(); |
| 4468 | hsl.h=hue; | 3552 | hsl.h=hue; |
| 4469 | var m=MochiKit.Color; | 3553 | var m=MochiKit.Color; |
| 4470 | return m.Color.fromHSL(hsl); | 3554 | return m.Color.fromHSL(hsl); |
| 4471 | -},colorWithSaturation:function(_570){ | 3555 | +},colorWithSaturation:function(_473){ |
| 4472 | var hsl=this.asHSL(); | 3556 | var hsl=this.asHSL(); |
| 4473 | -hsl.s=_570; | 3557 | +hsl.s=_473; |
| 4474 | var m=MochiKit.Color; | 3558 | var m=MochiKit.Color; |
| 4475 | return m.Color.fromHSL(hsl); | 3559 | return m.Color.fromHSL(hsl); |
| 4476 | -},colorWithLightness:function(_571){ | 3560 | +},colorWithLightness:function(_474){ |
| 4477 | var hsl=this.asHSL(); | 3561 | var hsl=this.asHSL(); |
| 4478 | -hsl.l=_571; | 3562 | +hsl.l=_474; |
| 4479 | var m=MochiKit.Color; | 3563 | var m=MochiKit.Color; |
| 4480 | return m.Color.fromHSL(hsl); | 3564 | return m.Color.fromHSL(hsl); |
| 4481 | -},darkerColorWithLevel:function(_572){ | 3565 | +},darkerColorWithLevel:function(_475){ |
| 4482 | var hsl=this.asHSL(); | 3566 | var hsl=this.asHSL(); |
| 4483 | -hsl.l=Math.max(hsl.l-_572,0); | 3567 | +hsl.l=Math.max(hsl.l-_475,0); |
| 4484 | var m=MochiKit.Color; | 3568 | var m=MochiKit.Color; |
| 4485 | return m.Color.fromHSL(hsl); | 3569 | return m.Color.fromHSL(hsl); |
| 4486 | -},lighterColorWithLevel:function(_573){ | 3570 | +},lighterColorWithLevel:function(_476){ |
| 4487 | var hsl=this.asHSL(); | 3571 | var hsl=this.asHSL(); |
| 4488 | -hsl.l=Math.min(hsl.l+_573,1); | 3572 | +hsl.l=Math.min(hsl.l+_476,1); |
| 4489 | var m=MochiKit.Color; | 3573 | var m=MochiKit.Color; |
| 4490 | return m.Color.fromHSL(hsl); | 3574 | return m.Color.fromHSL(hsl); |
| 4491 | -},blendedColor:function(_574,_575){ | ||
| 4492 | -if(typeof (_575)=="undefined"||_575===null){ | ||
| 4493 | -_575=0.5; | 3575 | +},blendedColor:function(_477,_478){ |
| 3576 | +if(typeof (_478)=="undefined"||_478===null){ | ||
| 3577 | +_478=0.5; | ||
| 4494 | } | 3578 | } |
| 4495 | -var sf=1-_575; | 3579 | +var sf=1-_478; |
| 4496 | var s=this.rgb; | 3580 | var s=this.rgb; |
| 4497 | -var d=_574.rgb; | ||
| 4498 | -var df=_575; | 3581 | +var d=_477.rgb; |
| 3582 | +var df=_478; | ||
| 4499 | return MochiKit.Color.Color.fromRGB((s.r*sf)+(d.r*df),(s.g*sf)+(d.g*df),(s.b*sf)+(d.b*df),(s.a*sf)+(d.a*df)); | 3583 | return MochiKit.Color.Color.fromRGB((s.r*sf)+(d.r*df),(s.g*sf)+(d.g*df),(s.b*sf)+(d.b*df),(s.a*sf)+(d.a*df)); |
| 4500 | -},compareRGB:function(_578){ | 3584 | +},compareRGB:function(_481){ |
| 4501 | var a=this.asRGB(); | 3585 | var a=this.asRGB(); |
| 4502 | -var b=_578.asRGB(); | 3586 | +var b=_481.asRGB(); |
| 4503 | return MochiKit.Base.compare([a.r,a.g,a.b,a.a],[b.r,b.g,b.b,b.a]); | 3587 | return MochiKit.Base.compare([a.r,a.g,a.b,a.a],[b.r,b.g,b.b,b.a]); |
| 4504 | },isLight:function(){ | 3588 | },isLight:function(){ |
| 4505 | return this.asHSL().b>0.5; | 3589 | return this.asHSL().b>0.5; |
| @@ -4573,114 +3657,114 @@ var c=this.rgb; | @@ -4573,114 +3657,114 @@ var c=this.rgb; | ||
| 4573 | var col=[c.r,c.g,c.b,c.a]; | 3657 | var col=[c.r,c.g,c.b,c.a]; |
| 4574 | return this.__class__.NAME+"("+col.join(", ")+")"; | 3658 | return this.__class__.NAME+"("+col.join(", ")+")"; |
| 4575 | }}; | 3659 | }}; |
| 4576 | -MochiKit.Base.update(MochiKit.Color.Color,{fromRGB:function(red,_583,blue,_584){ | ||
| 4577 | -var _585=MochiKit.Color.Color; | 3660 | +MochiKit.Base.update(MochiKit.Color.Color,{fromRGB:function(red,_486,blue,_487){ |
| 3661 | +var _488=MochiKit.Color.Color; | ||
| 4578 | if(arguments.length==1){ | 3662 | if(arguments.length==1){ |
| 4579 | var rgb=red; | 3663 | var rgb=red; |
| 4580 | red=rgb.r; | 3664 | red=rgb.r; |
| 4581 | -_583=rgb.g; | 3665 | +_486=rgb.g; |
| 4582 | blue=rgb.b; | 3666 | blue=rgb.b; |
| 4583 | if(typeof (rgb.a)=="undefined"){ | 3667 | if(typeof (rgb.a)=="undefined"){ |
| 4584 | -_584=undefined; | 3668 | +_487=undefined; |
| 4585 | }else{ | 3669 | }else{ |
| 4586 | -_584=rgb.a; | 3670 | +_487=rgb.a; |
| 4587 | } | 3671 | } |
| 4588 | } | 3672 | } |
| 4589 | -return new _585(red,_583,blue,_584); | ||
| 4590 | -},fromHSL:function(hue,_586,_587,_588){ | 3673 | +return new _488(red,_486,blue,_487); |
| 3674 | +},fromHSL:function(hue,_489,_490,_491){ | ||
| 4591 | var m=MochiKit.Color; | 3675 | var m=MochiKit.Color; |
| 4592 | return m.Color.fromRGB(m.hslToRGB.apply(m,arguments)); | 3676 | return m.Color.fromRGB(m.hslToRGB.apply(m,arguments)); |
| 4593 | -},fromHSV:function(hue,_589,_590,_591){ | 3677 | +},fromHSV:function(hue,_492,_493,_494){ |
| 4594 | var m=MochiKit.Color; | 3678 | var m=MochiKit.Color; |
| 4595 | return m.Color.fromRGB(m.hsvToRGB.apply(m,arguments)); | 3679 | return m.Color.fromRGB(m.hsvToRGB.apply(m,arguments)); |
| 4596 | },fromName:function(name){ | 3680 | },fromName:function(name){ |
| 4597 | -var _592=MochiKit.Color.Color; | 3681 | +var _495=MochiKit.Color.Color; |
| 4598 | if(name.charAt(0)=="\""){ | 3682 | if(name.charAt(0)=="\""){ |
| 4599 | name=name.substr(1,name.length-2); | 3683 | name=name.substr(1,name.length-2); |
| 4600 | } | 3684 | } |
| 4601 | -var _593=_592._namedColors[name.toLowerCase()]; | ||
| 4602 | -if(typeof (_593)=="string"){ | ||
| 4603 | -return _592.fromHexString(_593); | 3685 | +var _496=_495._namedColors[name.toLowerCase()]; |
| 3686 | +if(typeof (_496)=="string"){ | ||
| 3687 | +return _495.fromHexString(_496); | ||
| 4604 | }else{ | 3688 | }else{ |
| 4605 | if(name=="transparent"){ | 3689 | if(name=="transparent"){ |
| 4606 | -return _592.transparentColor(); | 3690 | +return _495.transparentColor(); |
| 4607 | } | 3691 | } |
| 4608 | } | 3692 | } |
| 4609 | return null; | 3693 | return null; |
| 4610 | -},fromString:function(_594){ | 3694 | +},fromString:function(_497){ |
| 4611 | var self=MochiKit.Color.Color; | 3695 | var self=MochiKit.Color.Color; |
| 4612 | -var _595=_594.substr(0,3); | ||
| 4613 | -if(_595=="rgb"){ | ||
| 4614 | -return self.fromRGBString(_594); | 3696 | +var _498=_497.substr(0,3); |
| 3697 | +if(_498=="rgb"){ | ||
| 3698 | +return self.fromRGBString(_497); | ||
| 4615 | }else{ | 3699 | }else{ |
| 4616 | -if(_595=="hsl"){ | ||
| 4617 | -return self.fromHSLString(_594); | 3700 | +if(_498=="hsl"){ |
| 3701 | +return self.fromHSLString(_497); | ||
| 4618 | }else{ | 3702 | }else{ |
| 4619 | -if(_594.charAt(0)=="#"){ | ||
| 4620 | -return self.fromHexString(_594); | 3703 | +if(_497.charAt(0)=="#"){ |
| 3704 | +return self.fromHexString(_497); | ||
| 4621 | } | 3705 | } |
| 4622 | } | 3706 | } |
| 4623 | } | 3707 | } |
| 4624 | -return self.fromName(_594); | ||
| 4625 | -},fromHexString:function(_596){ | ||
| 4626 | -if(_596.charAt(0)=="#"){ | ||
| 4627 | -_596=_596.substring(1); | 3708 | +return self.fromName(_497); |
| 3709 | +},fromHexString:function(_499){ | ||
| 3710 | +if(_499.charAt(0)=="#"){ | ||
| 3711 | +_499=_499.substring(1); | ||
| 4628 | } | 3712 | } |
| 4629 | -var _597=[]; | 3713 | +var _500=[]; |
| 4630 | var i,hex; | 3714 | var i,hex; |
| 4631 | -if(_596.length==3){ | 3715 | +if(_499.length==3){ |
| 4632 | for(i=0;i<3;i++){ | 3716 | for(i=0;i<3;i++){ |
| 4633 | -hex=_596.substr(i,1); | ||
| 4634 | -_597.push(parseInt(hex+hex,16)/255); | 3717 | +hex=_499.substr(i,1); |
| 3718 | +_500.push(parseInt(hex+hex,16)/255); | ||
| 4635 | } | 3719 | } |
| 4636 | }else{ | 3720 | }else{ |
| 4637 | for(i=0;i<6;i+=2){ | 3721 | for(i=0;i<6;i+=2){ |
| 4638 | -hex=_596.substr(i,2); | ||
| 4639 | -_597.push(parseInt(hex,16)/255); | 3722 | +hex=_499.substr(i,2); |
| 3723 | +_500.push(parseInt(hex,16)/255); | ||
| 4640 | } | 3724 | } |
| 4641 | } | 3725 | } |
| 4642 | -var _598=MochiKit.Color.Color; | ||
| 4643 | -return _598.fromRGB.apply(_598,_597); | ||
| 4644 | -},_fromColorString:function(pre,_600,_601,_602){ | ||
| 4645 | -if(_602.indexOf(pre)===0){ | ||
| 4646 | -_602=_602.substring(_602.indexOf("(",3)+1,_602.length-1); | 3726 | +var _501=MochiKit.Color.Color; |
| 3727 | +return _501.fromRGB.apply(_501,_500); | ||
| 3728 | +},_fromColorString:function(pre,_503,_504,_505){ | ||
| 3729 | +if(_505.indexOf(pre)===0){ | ||
| 3730 | +_505=_505.substring(_505.indexOf("(",3)+1,_505.length-1); | ||
| 4647 | } | 3731 | } |
| 4648 | -var _603=_602.split(/\s*,\s*/); | ||
| 4649 | -var _604=[]; | ||
| 4650 | -for(var i=0;i<_603.length;i++){ | ||
| 4651 | -var c=_603[i]; | 3732 | +var _506=_505.split(/\s*,\s*/); |
| 3733 | +var _507=[]; | ||
| 3734 | +for(var i=0;i<_506.length;i++){ | ||
| 3735 | +var c=_506[i]; | ||
| 4652 | var val; | 3736 | var val; |
| 4653 | -var _605=c.substring(c.length-3); | 3737 | +var _508=c.substring(c.length-3); |
| 4654 | if(c.charAt(c.length-1)=="%"){ | 3738 | if(c.charAt(c.length-1)=="%"){ |
| 4655 | val=0.01*parseFloat(c.substring(0,c.length-1)); | 3739 | val=0.01*parseFloat(c.substring(0,c.length-1)); |
| 4656 | }else{ | 3740 | }else{ |
| 4657 | -if(_605=="deg"){ | 3741 | +if(_508=="deg"){ |
| 4658 | val=parseFloat(c)/360; | 3742 | val=parseFloat(c)/360; |
| 4659 | }else{ | 3743 | }else{ |
| 4660 | -if(_605=="rad"){ | 3744 | +if(_508=="rad"){ |
| 4661 | val=parseFloat(c)/(Math.PI*2); | 3745 | val=parseFloat(c)/(Math.PI*2); |
| 4662 | }else{ | 3746 | }else{ |
| 4663 | -val=_601[i]*parseFloat(c); | 3747 | +val=_504[i]*parseFloat(c); |
| 4664 | } | 3748 | } |
| 4665 | } | 3749 | } |
| 4666 | } | 3750 | } |
| 4667 | -_604.push(val); | 3751 | +_507.push(val); |
| 4668 | } | 3752 | } |
| 4669 | -return this[_600].apply(this,_604); | ||
| 4670 | -},fromComputedStyle:function(elem,_606){ | 3753 | +return this[_503].apply(this,_507); |
| 3754 | +},fromComputedStyle:function(elem,_509,_510){ | ||
| 4671 | var d=MochiKit.DOM; | 3755 | var d=MochiKit.DOM; |
| 4672 | var cls=MochiKit.Color.Color; | 3756 | var cls=MochiKit.Color.Color; |
| 4673 | for(elem=d.getElement(elem);elem;elem=elem.parentNode){ | 3757 | for(elem=d.getElement(elem);elem;elem=elem.parentNode){ |
| 4674 | -var _607=MochiKit.Style.getStyle.apply(d,arguments); | ||
| 4675 | -if(!_607){ | 3758 | +var _511=d.computedStyle.apply(d,arguments); |
| 3759 | +if(!_511){ | ||
| 4676 | continue; | 3760 | continue; |
| 4677 | } | 3761 | } |
| 4678 | -var _608=cls.fromString(_607); | ||
| 4679 | -if(!_608){ | 3762 | +var _512=cls.fromString(_511); |
| 3763 | +if(!_512){ | ||
| 4680 | break; | 3764 | break; |
| 4681 | } | 3765 | } |
| 4682 | -if(_608.asRGB().a>0){ | ||
| 4683 | -return _608; | 3766 | +if(_512.asRGB().a>0){ |
| 3767 | +return _512; | ||
| 4684 | } | 3768 | } |
| 4685 | } | 3769 | } |
| 4686 | return null; | 3770 | return null; |
| @@ -4693,13 +3777,13 @@ return cls.fromComputedStyle(elem,"color","color")||cls.blackColor(); | @@ -4693,13 +3777,13 @@ return cls.fromComputedStyle(elem,"color","color")||cls.blackColor(); | ||
| 4693 | },namedColors:function(){ | 3777 | },namedColors:function(){ |
| 4694 | return MochiKit.Base.clone(MochiKit.Color.Color._namedColors); | 3778 | return MochiKit.Base.clone(MochiKit.Color.Color._namedColors); |
| 4695 | }}); | 3779 | }}); |
| 4696 | -MochiKit.Base.update(MochiKit.Color,{clampColorComponent:function(v,_609){ | ||
| 4697 | -v*=_609; | 3780 | +MochiKit.Base.update(MochiKit.Color,{clampColorComponent:function(v,_513){ |
| 3781 | +v*=_513; | ||
| 4698 | if(v<0){ | 3782 | if(v<0){ |
| 4699 | return 0; | 3783 | return 0; |
| 4700 | }else{ | 3784 | }else{ |
| 4701 | -if(v>_609){ | ||
| 4702 | -return _609; | 3785 | +if(v>_513){ |
| 3786 | +return _513; | ||
| 4703 | }else{ | 3787 | }else{ |
| 4704 | return v; | 3788 | return v; |
| 4705 | } | 3789 | } |
| @@ -4727,118 +3811,118 @@ val=n1; | @@ -4727,118 +3811,118 @@ val=n1; | ||
| 4727 | } | 3811 | } |
| 4728 | } | 3812 | } |
| 4729 | return val; | 3813 | return val; |
| 4730 | -},hsvToRGB:function(hue,_612,_613,_614){ | 3814 | +},hsvToRGB:function(hue,_516,_517,_518){ |
| 4731 | if(arguments.length==1){ | 3815 | if(arguments.length==1){ |
| 4732 | var hsv=hue; | 3816 | var hsv=hue; |
| 4733 | hue=hsv.h; | 3817 | hue=hsv.h; |
| 4734 | -_612=hsv.s; | ||
| 4735 | -_613=hsv.v; | ||
| 4736 | -_614=hsv.a; | 3818 | +_516=hsv.s; |
| 3819 | +_517=hsv.v; | ||
| 3820 | +_518=hsv.a; | ||
| 4737 | } | 3821 | } |
| 4738 | var red; | 3822 | var red; |
| 4739 | -var _615; | 3823 | +var _519; |
| 4740 | var blue; | 3824 | var blue; |
| 4741 | -if(_612===0){ | 3825 | +if(_516===0){ |
| 4742 | red=0; | 3826 | red=0; |
| 4743 | -_615=0; | 3827 | +_519=0; |
| 4744 | blue=0; | 3828 | blue=0; |
| 4745 | }else{ | 3829 | }else{ |
| 4746 | var i=Math.floor(hue*6); | 3830 | var i=Math.floor(hue*6); |
| 4747 | var f=(hue*6)-i; | 3831 | var f=(hue*6)-i; |
| 4748 | -var p=_613*(1-_612); | ||
| 4749 | -var q=_613*(1-(_612*f)); | ||
| 4750 | -var t=_613*(1-(_612*(1-f))); | 3832 | +var p=_517*(1-_516); |
| 3833 | +var q=_517*(1-(_516*f)); | ||
| 3834 | +var t=_517*(1-(_516*(1-f))); | ||
| 4751 | switch(i){ | 3835 | switch(i){ |
| 4752 | case 1: | 3836 | case 1: |
| 4753 | red=q; | 3837 | red=q; |
| 4754 | -_615=_613; | 3838 | +_519=_517; |
| 4755 | blue=p; | 3839 | blue=p; |
| 4756 | break; | 3840 | break; |
| 4757 | case 2: | 3841 | case 2: |
| 4758 | red=p; | 3842 | red=p; |
| 4759 | -_615=_613; | 3843 | +_519=_517; |
| 4760 | blue=t; | 3844 | blue=t; |
| 4761 | break; | 3845 | break; |
| 4762 | case 3: | 3846 | case 3: |
| 4763 | red=p; | 3847 | red=p; |
| 4764 | -_615=q; | ||
| 4765 | -blue=_613; | 3848 | +_519=q; |
| 3849 | +blue=_517; | ||
| 4766 | break; | 3850 | break; |
| 4767 | case 4: | 3851 | case 4: |
| 4768 | red=t; | 3852 | red=t; |
| 4769 | -_615=p; | ||
| 4770 | -blue=_613; | 3853 | +_519=p; |
| 3854 | +blue=_517; | ||
| 4771 | break; | 3855 | break; |
| 4772 | case 5: | 3856 | case 5: |
| 4773 | -red=_613; | ||
| 4774 | -_615=p; | 3857 | +red=_517; |
| 3858 | +_519=p; | ||
| 4775 | blue=q; | 3859 | blue=q; |
| 4776 | break; | 3860 | break; |
| 4777 | case 6: | 3861 | case 6: |
| 4778 | case 0: | 3862 | case 0: |
| 4779 | -red=_613; | ||
| 4780 | -_615=t; | 3863 | +red=_517; |
| 3864 | +_519=t; | ||
| 4781 | blue=p; | 3865 | blue=p; |
| 4782 | break; | 3866 | break; |
| 4783 | } | 3867 | } |
| 4784 | } | 3868 | } |
| 4785 | -return {r:red,g:_615,b:blue,a:_614}; | ||
| 4786 | -},hslToRGB:function(hue,_617,_618,_619){ | 3869 | +return {r:red,g:_519,b:blue,a:_518}; |
| 3870 | +},hslToRGB:function(hue,_521,_522,_523){ | ||
| 4787 | if(arguments.length==1){ | 3871 | if(arguments.length==1){ |
| 4788 | var hsl=hue; | 3872 | var hsl=hue; |
| 4789 | hue=hsl.h; | 3873 | hue=hsl.h; |
| 4790 | -_617=hsl.s; | ||
| 4791 | -_618=hsl.l; | ||
| 4792 | -_619=hsl.a; | 3874 | +_521=hsl.s; |
| 3875 | +_522=hsl.l; | ||
| 3876 | +_523=hsl.a; | ||
| 4793 | } | 3877 | } |
| 4794 | var red; | 3878 | var red; |
| 4795 | -var _620; | 3879 | +var _524; |
| 4796 | var blue; | 3880 | var blue; |
| 4797 | -if(_617===0){ | ||
| 4798 | -red=_618; | ||
| 4799 | -_620=_618; | ||
| 4800 | -blue=_618; | 3881 | +if(_521===0){ |
| 3882 | +red=_522; | ||
| 3883 | +_524=_522; | ||
| 3884 | +blue=_522; | ||
| 4801 | }else{ | 3885 | }else{ |
| 4802 | var m2; | 3886 | var m2; |
| 4803 | -if(_618<=0.5){ | ||
| 4804 | -m2=_618*(1+_617); | 3887 | +if(_522<=0.5){ |
| 3888 | +m2=_522*(1+_521); | ||
| 4805 | }else{ | 3889 | }else{ |
| 4806 | -m2=_618+_617-(_618*_617); | 3890 | +m2=_522+_521-(_522*_521); |
| 4807 | } | 3891 | } |
| 4808 | -var m1=(2*_618)-m2; | 3892 | +var m1=(2*_522)-m2; |
| 4809 | var f=MochiKit.Color._hslValue; | 3893 | var f=MochiKit.Color._hslValue; |
| 4810 | var h6=hue*6; | 3894 | var h6=hue*6; |
| 4811 | red=f(m1,m2,h6+2); | 3895 | red=f(m1,m2,h6+2); |
| 4812 | -_620=f(m1,m2,h6); | 3896 | +_524=f(m1,m2,h6); |
| 4813 | blue=f(m1,m2,h6-2); | 3897 | blue=f(m1,m2,h6-2); |
| 4814 | } | 3898 | } |
| 4815 | -return {r:red,g:_620,b:blue,a:_619}; | ||
| 4816 | -},rgbToHSV:function(red,_624,blue,_625){ | 3899 | +return {r:red,g:_524,b:blue,a:_523}; |
| 3900 | +},rgbToHSV:function(red,_528,blue,_529){ | ||
| 4817 | if(arguments.length==1){ | 3901 | if(arguments.length==1){ |
| 4818 | var rgb=red; | 3902 | var rgb=red; |
| 4819 | red=rgb.r; | 3903 | red=rgb.r; |
| 4820 | -_624=rgb.g; | 3904 | +_528=rgb.g; |
| 4821 | blue=rgb.b; | 3905 | blue=rgb.b; |
| 4822 | -_625=rgb.a; | 3906 | +_529=rgb.a; |
| 4823 | } | 3907 | } |
| 4824 | -var max=Math.max(Math.max(red,_624),blue); | ||
| 4825 | -var min=Math.min(Math.min(red,_624),blue); | 3908 | +var max=Math.max(Math.max(red,_528),blue); |
| 3909 | +var min=Math.min(Math.min(red,_528),blue); | ||
| 4826 | var hue; | 3910 | var hue; |
| 4827 | -var _628; | ||
| 4828 | -var _629=max; | 3911 | +var _532; |
| 3912 | +var _533=max; | ||
| 4829 | if(min==max){ | 3913 | if(min==max){ |
| 4830 | hue=0; | 3914 | hue=0; |
| 4831 | -_628=0; | 3915 | +_532=0; |
| 4832 | }else{ | 3916 | }else{ |
| 4833 | -var _630=(max-min); | ||
| 4834 | -_628=_630/max; | 3917 | +var _534=(max-min); |
| 3918 | +_532=_534/max; | ||
| 4835 | if(red==max){ | 3919 | if(red==max){ |
| 4836 | -hue=(_624-blue)/_630; | 3920 | +hue=(_528-blue)/_534; |
| 4837 | }else{ | 3921 | }else{ |
| 4838 | -if(_624==max){ | ||
| 4839 | -hue=2+((blue-red)/_630); | 3922 | +if(_528==max){ |
| 3923 | +hue=2+((blue-red)/_534); | ||
| 4840 | }else{ | 3924 | }else{ |
| 4841 | -hue=4+((red-_624)/_630); | 3925 | +hue=4+((red-_528)/_534); |
| 4842 | } | 3926 | } |
| 4843 | } | 3927 | } |
| 4844 | hue/=6; | 3928 | hue/=6; |
| @@ -4849,37 +3933,37 @@ if(hue>1){ | @@ -4849,37 +3933,37 @@ if(hue>1){ | ||
| 4849 | hue-=1; | 3933 | hue-=1; |
| 4850 | } | 3934 | } |
| 4851 | } | 3935 | } |
| 4852 | -return {h:hue,s:_628,v:_629,a:_625}; | ||
| 4853 | -},rgbToHSL:function(red,_631,blue,_632){ | 3936 | +return {h:hue,s:_532,v:_533,a:_529}; |
| 3937 | +},rgbToHSL:function(red,_535,blue,_536){ | ||
| 4854 | if(arguments.length==1){ | 3938 | if(arguments.length==1){ |
| 4855 | var rgb=red; | 3939 | var rgb=red; |
| 4856 | red=rgb.r; | 3940 | red=rgb.r; |
| 4857 | -_631=rgb.g; | 3941 | +_535=rgb.g; |
| 4858 | blue=rgb.b; | 3942 | blue=rgb.b; |
| 4859 | -_632=rgb.a; | 3943 | +_536=rgb.a; |
| 4860 | } | 3944 | } |
| 4861 | -var max=Math.max(red,Math.max(_631,blue)); | ||
| 4862 | -var min=Math.min(red,Math.min(_631,blue)); | 3945 | +var max=Math.max(red,Math.max(_535,blue)); |
| 3946 | +var min=Math.min(red,Math.min(_535,blue)); | ||
| 4863 | var hue; | 3947 | var hue; |
| 4864 | -var _633; | ||
| 4865 | -var _634=(max+min)/2; | ||
| 4866 | -var _635=max-min; | ||
| 4867 | -if(_635===0){ | 3948 | +var _537; |
| 3949 | +var _538=(max+min)/2; | ||
| 3950 | +var _539=max-min; | ||
| 3951 | +if(_539===0){ | ||
| 4868 | hue=0; | 3952 | hue=0; |
| 4869 | -_633=0; | 3953 | +_537=0; |
| 4870 | }else{ | 3954 | }else{ |
| 4871 | -if(_634<=0.5){ | ||
| 4872 | -_633=_635/(max+min); | 3955 | +if(_538<=0.5){ |
| 3956 | +_537=_539/(max+min); | ||
| 4873 | }else{ | 3957 | }else{ |
| 4874 | -_633=_635/(2-max-min); | 3958 | +_537=_539/(2-max-min); |
| 4875 | } | 3959 | } |
| 4876 | if(red==max){ | 3960 | if(red==max){ |
| 4877 | -hue=(_631-blue)/_635; | 3961 | +hue=(_535-blue)/_539; |
| 4878 | }else{ | 3962 | }else{ |
| 4879 | -if(_631==max){ | ||
| 4880 | -hue=2+((blue-red)/_635); | 3963 | +if(_535==max){ |
| 3964 | +hue=2+((blue-red)/_539); | ||
| 4881 | }else{ | 3965 | }else{ |
| 4882 | -hue=4+((red-_631)/_635); | 3966 | +hue=4+((red-_535)/_539); |
| 4883 | } | 3967 | } |
| 4884 | } | 3968 | } |
| 4885 | hue/=6; | 3969 | hue/=6; |
| @@ -4890,33 +3974,33 @@ if(hue>1){ | @@ -4890,33 +3974,33 @@ if(hue>1){ | ||
| 4890 | hue-=1; | 3974 | hue-=1; |
| 4891 | } | 3975 | } |
| 4892 | } | 3976 | } |
| 4893 | -return {h:hue,s:_633,l:_634,a:_632}; | 3977 | +return {h:hue,s:_537,l:_538,a:_536}; |
| 4894 | },toColorPart:function(num){ | 3978 | },toColorPart:function(num){ |
| 4895 | num=Math.round(num); | 3979 | num=Math.round(num); |
| 4896 | -var _636=num.toString(16); | 3980 | +var _540=num.toString(16); |
| 4897 | if(num<16){ | 3981 | if(num<16){ |
| 4898 | -return "0"+_636; | 3982 | +return "0"+_540; |
| 4899 | } | 3983 | } |
| 4900 | -return _636; | 3984 | +return _540; |
| 4901 | },__new__:function(){ | 3985 | },__new__:function(){ |
| 4902 | var m=MochiKit.Base; | 3986 | var m=MochiKit.Base; |
| 4903 | this.Color.fromRGBString=m.bind(this.Color._fromColorString,this.Color,"rgb","fromRGB",[1/255,1/255,1/255,1]); | 3987 | this.Color.fromRGBString=m.bind(this.Color._fromColorString,this.Color,"rgb","fromRGB",[1/255,1/255,1/255,1]); |
| 4904 | this.Color.fromHSLString=m.bind(this.Color._fromColorString,this.Color,"hsl","fromHSL",[1/360,0.01,0.01,1]); | 3988 | this.Color.fromHSLString=m.bind(this.Color._fromColorString,this.Color,"hsl","fromHSL",[1/360,0.01,0.01,1]); |
| 4905 | -var _637=1/3; | ||
| 4906 | -var _638={black:[0,0,0],blue:[0,0,1],brown:[0.6,0.4,0.2],cyan:[0,1,1],darkGray:[_637,_637,_637],gray:[0.5,0.5,0.5],green:[0,1,0],lightGray:[2*_637,2*_637,2*_637],magenta:[1,0,1],orange:[1,0.5,0],purple:[0.5,0,0.5],red:[1,0,0],transparent:[0,0,0,0],white:[1,1,1],yellow:[1,1,0]}; | ||
| 4907 | -var _639=function(name,r,g,b,a){ | 3989 | +var _541=1/3; |
| 3990 | +var _542={black:[0,0,0],blue:[0,0,1],brown:[0.6,0.4,0.2],cyan:[0,1,1],darkGray:[_541,_541,_541],gray:[0.5,0.5,0.5],green:[0,1,0],lightGray:[2*_541,2*_541,2*_541],magenta:[1,0,1],orange:[1,0.5,0],purple:[0.5,0,0.5],red:[1,0,0],transparent:[0,0,0,0],white:[1,1,1],yellow:[1,1,0]}; | ||
| 3991 | +var _543=function(name,r,g,b,a){ | ||
| 4908 | var rval=this.fromRGB(r,g,b,a); | 3992 | var rval=this.fromRGB(r,g,b,a); |
| 4909 | this[name]=function(){ | 3993 | this[name]=function(){ |
| 4910 | return rval; | 3994 | return rval; |
| 4911 | }; | 3995 | }; |
| 4912 | return rval; | 3996 | return rval; |
| 4913 | }; | 3997 | }; |
| 4914 | -for(var k in _638){ | 3998 | +for(var k in _542){ |
| 4915 | var name=k+"Color"; | 3999 | var name=k+"Color"; |
| 4916 | -var _641=m.concat([_639,this.Color,name],_638[k]); | ||
| 4917 | -this.Color[name]=m.bind.apply(null,_641); | 4000 | +var _545=m.concat([_543,this.Color,name],_542[k]); |
| 4001 | +this.Color[name]=m.bind.apply(null,_545); | ||
| 4918 | } | 4002 | } |
| 4919 | -var _642=function(){ | 4003 | +var _546=function(){ |
| 4920 | for(var i=0;i<arguments.length;i++){ | 4004 | for(var i=0;i<arguments.length;i++){ |
| 4921 | if(!(arguments[i] instanceof Color)){ | 4005 | if(!(arguments[i] instanceof Color)){ |
| 4922 | return false; | 4006 | return false; |
| @@ -4924,11 +4008,11 @@ return false; | @@ -4924,11 +4008,11 @@ return false; | ||
| 4924 | } | 4008 | } |
| 4925 | return true; | 4009 | return true; |
| 4926 | }; | 4010 | }; |
| 4927 | -var _643=function(a,b){ | 4011 | +var _547=function(a,b){ |
| 4928 | return a.compareRGB(b); | 4012 | return a.compareRGB(b); |
| 4929 | }; | 4013 | }; |
| 4930 | m.nameFunctions(this); | 4014 | m.nameFunctions(this); |
| 4931 | -m.registerComparator(this.Color.NAME,_642,_643); | 4015 | +m.registerComparator(this.Color.NAME,_546,_547); |
| 4932 | this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)}; | 4016 | this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)}; |
| 4933 | }}); | 4017 | }}); |
| 4934 | MochiKit.Color.EXPORT=["Color"]; | 4018 | MochiKit.Color.EXPORT=["Color"]; |
| @@ -4940,12 +4024,10 @@ if(typeof (dojo)!="undefined"){ | @@ -4940,12 +4024,10 @@ if(typeof (dojo)!="undefined"){ | ||
| 4940 | dojo.provide("MochiKit.Signal"); | 4024 | dojo.provide("MochiKit.Signal"); |
| 4941 | dojo.require("MochiKit.Base"); | 4025 | dojo.require("MochiKit.Base"); |
| 4942 | dojo.require("MochiKit.DOM"); | 4026 | dojo.require("MochiKit.DOM"); |
| 4943 | -dojo.require("MochiKit.Style"); | ||
| 4944 | } | 4027 | } |
| 4945 | if(typeof (JSAN)!="undefined"){ | 4028 | if(typeof (JSAN)!="undefined"){ |
| 4946 | JSAN.use("MochiKit.Base",[]); | 4029 | JSAN.use("MochiKit.Base",[]); |
| 4947 | JSAN.use("MochiKit.DOM",[]); | 4030 | JSAN.use("MochiKit.DOM",[]); |
| 4948 | -JSAN.use("MochiKit.Style",[]); | ||
| 4949 | } | 4031 | } |
| 4950 | try{ | 4032 | try{ |
| 4951 | if(typeof (MochiKit.Base)=="undefined"){ | 4033 | if(typeof (MochiKit.Base)=="undefined"){ |
| @@ -4963,19 +4045,11 @@ throw ""; | @@ -4963,19 +4045,11 @@ throw ""; | ||
| 4963 | catch(e){ | 4045 | catch(e){ |
| 4964 | throw "MochiKit.Signal depends on MochiKit.DOM!"; | 4046 | throw "MochiKit.Signal depends on MochiKit.DOM!"; |
| 4965 | } | 4047 | } |
| 4966 | -try{ | ||
| 4967 | -if(typeof (MochiKit.Style)=="undefined"){ | ||
| 4968 | -throw ""; | ||
| 4969 | -} | ||
| 4970 | -} | ||
| 4971 | -catch(e){ | ||
| 4972 | -throw "MochiKit.Signal depends on MochiKit.Style!"; | ||
| 4973 | -} | ||
| 4974 | if(typeof (MochiKit.Signal)=="undefined"){ | 4048 | if(typeof (MochiKit.Signal)=="undefined"){ |
| 4975 | MochiKit.Signal={}; | 4049 | MochiKit.Signal={}; |
| 4976 | } | 4050 | } |
| 4977 | MochiKit.Signal.NAME="MochiKit.Signal"; | 4051 | MochiKit.Signal.NAME="MochiKit.Signal"; |
| 4978 | -MochiKit.Signal.VERSION="1.4"; | 4052 | +MochiKit.Signal.VERSION="1.3.1"; |
| 4979 | MochiKit.Signal._observers=[]; | 4053 | MochiKit.Signal._observers=[]; |
| 4980 | MochiKit.Signal.Event=function(src,e){ | 4054 | MochiKit.Signal.Event=function(src,e){ |
| 4981 | this._event=e||window.event; | 4055 | this._event=e||window.event; |
| @@ -4983,10 +4057,7 @@ this._src=src; | @@ -4983,10 +4057,7 @@ this._src=src; | ||
| 4983 | }; | 4057 | }; |
| 4984 | MochiKit.Base.update(MochiKit.Signal.Event.prototype,{__repr__:function(){ | 4058 | MochiKit.Base.update(MochiKit.Signal.Event.prototype,{__repr__:function(){ |
| 4985 | var repr=MochiKit.Base.repr; | 4059 | var repr=MochiKit.Base.repr; |
| 4986 | -var str="{event(): "+repr(this.event())+", src(): "+repr(this.src())+", type(): "+repr(this.type())+", target(): "+repr(this.target()); | ||
| 4987 | -if(this.type()&&this.type().indexOf("key")===0||this.type().indexOf("mouse")===0||this.type().indexOf("click")!=-1||this.type()=="contextmenu"){ | ||
| 4988 | -str+=", modifier(): "+"{alt: "+repr(this.modifier().alt)+", ctrl: "+repr(this.modifier().ctrl)+", meta: "+repr(this.modifier().meta)+", shift: "+repr(this.modifier().shift)+", any: "+repr(this.modifier().any)+"}"; | ||
| 4989 | -} | 4060 | +var str="{event(): "+repr(this.event())+", src(): "+repr(this.src())+", type(): "+repr(this.type())+", target(): "+repr(this.target())+", modifier(): "+"{alt: "+repr(this.modifier().alt)+", ctrl: "+repr(this.modifier().ctrl)+", meta: "+repr(this.modifier().meta)+", shift: "+repr(this.modifier().shift)+", any: "+repr(this.modifier().any)+"}"; |
| 4990 | if(this.type()&&this.type().indexOf("key")===0){ | 4061 | if(this.type()&&this.type().indexOf("key")===0){ |
| 4991 | str+=", key(): {code: "+repr(this.key().code)+", string: "+repr(this.key().string)+"}"; | 4062 | str+=", key(): {code: "+repr(this.key().code)+", string: "+repr(this.key().string)+"}"; |
| 4992 | } | 4063 | } |
| @@ -5013,45 +4084,29 @@ return this._event; | @@ -5013,45 +4084,29 @@ return this._event; | ||
| 5013 | return this._event.type||undefined; | 4084 | return this._event.type||undefined; |
| 5014 | },target:function(){ | 4085 | },target:function(){ |
| 5015 | return this._event.target||this._event.srcElement; | 4086 | return this._event.target||this._event.srcElement; |
| 5016 | -},_relatedTarget:null,relatedTarget:function(){ | ||
| 5017 | -if(this._relatedTarget!==null){ | ||
| 5018 | -return this._relatedTarget; | ||
| 5019 | -} | ||
| 5020 | -var elem=null; | 4087 | +},relatedTarget:function(){ |
| 5021 | if(this.type()=="mouseover"){ | 4088 | if(this.type()=="mouseover"){ |
| 5022 | -elem=(this._event.relatedTarget||this._event.fromElement); | 4089 | +return (this._event.relatedTarget||this._event.fromElement); |
| 5023 | }else{ | 4090 | }else{ |
| 5024 | if(this.type()=="mouseout"){ | 4091 | if(this.type()=="mouseout"){ |
| 5025 | -elem=(this._event.relatedTarget||this._event.toElement); | ||
| 5026 | -} | 4092 | +return (this._event.relatedTarget||this._event.toElement); |
| 5027 | } | 4093 | } |
| 5028 | -if(elem!==null){ | ||
| 5029 | -this._relatedTarget=elem; | ||
| 5030 | -return elem; | ||
| 5031 | } | 4094 | } |
| 5032 | return undefined; | 4095 | return undefined; |
| 5033 | -},_modifier:null,modifier:function(){ | ||
| 5034 | -if(this._modifier!==null){ | ||
| 5035 | -return this._modifier; | ||
| 5036 | -} | 4096 | +},modifier:function(){ |
| 5037 | var m={}; | 4097 | var m={}; |
| 5038 | m.alt=this._event.altKey; | 4098 | m.alt=this._event.altKey; |
| 5039 | m.ctrl=this._event.ctrlKey; | 4099 | m.ctrl=this._event.ctrlKey; |
| 5040 | m.meta=this._event.metaKey||false; | 4100 | m.meta=this._event.metaKey||false; |
| 5041 | m.shift=this._event.shiftKey; | 4101 | m.shift=this._event.shiftKey; |
| 5042 | m.any=m.alt||m.ctrl||m.shift||m.meta; | 4102 | m.any=m.alt||m.ctrl||m.shift||m.meta; |
| 5043 | -this._modifier=m; | ||
| 5044 | return m; | 4103 | return m; |
| 5045 | -},_key:null,key:function(){ | ||
| 5046 | -if(this._key!==null){ | ||
| 5047 | -return this._key; | ||
| 5048 | -} | 4104 | +},key:function(){ |
| 5049 | var k={}; | 4105 | var k={}; |
| 5050 | if(this.type()&&this.type().indexOf("key")===0){ | 4106 | if(this.type()&&this.type().indexOf("key")===0){ |
| 5051 | if(this.type()=="keydown"||this.type()=="keyup"){ | 4107 | if(this.type()=="keydown"||this.type()=="keyup"){ |
| 5052 | k.code=this._event.keyCode; | 4108 | k.code=this._event.keyCode; |
| 5053 | k.string=(MochiKit.Signal._specialKeys[k.code]||"KEY_UNKNOWN"); | 4109 | k.string=(MochiKit.Signal._specialKeys[k.code]||"KEY_UNKNOWN"); |
| 5054 | -this._key=k; | ||
| 5055 | return k; | 4110 | return k; |
| 5056 | }else{ | 4111 | }else{ |
| 5057 | if(this.type()=="keypress"){ | 4112 | if(this.type()=="keypress"){ |
| @@ -5066,33 +4121,29 @@ k.code=this._event.keyCode; | @@ -5066,33 +4121,29 @@ k.code=this._event.keyCode; | ||
| 5066 | k.string=String.fromCharCode(k.code); | 4121 | k.string=String.fromCharCode(k.code); |
| 5067 | } | 4122 | } |
| 5068 | } | 4123 | } |
| 5069 | -this._key=k; | ||
| 5070 | return k; | 4124 | return k; |
| 5071 | } | 4125 | } |
| 5072 | } | 4126 | } |
| 5073 | } | 4127 | } |
| 5074 | return undefined; | 4128 | return undefined; |
| 5075 | -},_mouse:null,mouse:function(){ | ||
| 5076 | -if(this._mouse!==null){ | ||
| 5077 | -return this._mouse; | ||
| 5078 | -} | 4129 | +},mouse:function(){ |
| 5079 | var m={}; | 4130 | var m={}; |
| 5080 | var e=this._event; | 4131 | var e=this._event; |
| 5081 | if(this.type()&&(this.type().indexOf("mouse")===0||this.type().indexOf("click")!=-1||this.type()=="contextmenu")){ | 4132 | if(this.type()&&(this.type().indexOf("mouse")===0||this.type().indexOf("click")!=-1||this.type()=="contextmenu")){ |
| 5082 | -m.client=new MochiKit.Style.Coordinates(0,0); | 4133 | +m.client=new MochiKit.DOM.Coordinates(0,0); |
| 5083 | if(e.clientX||e.clientY){ | 4134 | if(e.clientX||e.clientY){ |
| 5084 | m.client.x=(!e.clientX||e.clientX<0)?0:e.clientX; | 4135 | m.client.x=(!e.clientX||e.clientX<0)?0:e.clientX; |
| 5085 | m.client.y=(!e.clientY||e.clientY<0)?0:e.clientY; | 4136 | m.client.y=(!e.clientY||e.clientY<0)?0:e.clientY; |
| 5086 | } | 4137 | } |
| 5087 | -m.page=new MochiKit.Style.Coordinates(0,0); | 4138 | +m.page=new MochiKit.DOM.Coordinates(0,0); |
| 5088 | if(e.pageX||e.pageY){ | 4139 | if(e.pageX||e.pageY){ |
| 5089 | m.page.x=(!e.pageX||e.pageX<0)?0:e.pageX; | 4140 | m.page.x=(!e.pageX||e.pageX<0)?0:e.pageX; |
| 5090 | m.page.y=(!e.pageY||e.pageY<0)?0:e.pageY; | 4141 | m.page.y=(!e.pageY||e.pageY<0)?0:e.pageY; |
| 5091 | }else{ | 4142 | }else{ |
| 5092 | var de=MochiKit.DOM._document.documentElement; | 4143 | var de=MochiKit.DOM._document.documentElement; |
| 5093 | var b=MochiKit.DOM._document.body; | 4144 | var b=MochiKit.DOM._document.body; |
| 5094 | -m.page.x=e.clientX+(de.scrollLeft||b.scrollLeft)-(de.clientLeft||0); | ||
| 5095 | -m.page.y=e.clientY+(de.scrollTop||b.scrollTop)-(de.clientTop||0); | 4145 | +m.page.x=e.clientX+(de.scrollLeft||b.scrollLeft)-(de.clientLeft||b.clientLeft); |
| 4146 | +m.page.y=e.clientY+(de.scrollTop||b.scrollTop)-(de.clientTop||b.clientTop); | ||
| 5096 | } | 4147 | } |
| 5097 | if(this.type()!="mousemove"){ | 4148 | if(this.type()!="mousemove"){ |
| 5098 | m.button={}; | 4149 | m.button={}; |
| @@ -5109,7 +4160,6 @@ m.button.right=!!(e.button&2); | @@ -5109,7 +4160,6 @@ m.button.right=!!(e.button&2); | ||
| 5109 | m.button.middle=!!(e.button&4); | 4160 | m.button.middle=!!(e.button&4); |
| 5110 | } | 4161 | } |
| 5111 | } | 4162 | } |
| 5112 | -this._mouse=m; | ||
| 5113 | return m; | 4163 | return m; |
| 5114 | } | 4164 | } |
| 5115 | return undefined; | 4165 | return undefined; |
| @@ -5126,48 +4176,35 @@ this._event.cancelBubble=true; | @@ -5126,48 +4176,35 @@ this._event.cancelBubble=true; | ||
| 5126 | if(this._event.preventDefault){ | 4176 | if(this._event.preventDefault){ |
| 5127 | this._event.preventDefault(); | 4177 | this._event.preventDefault(); |
| 5128 | }else{ | 4178 | }else{ |
| 5129 | -if(this._confirmUnload===null){ | ||
| 5130 | this._event.returnValue=false; | 4179 | this._event.returnValue=false; |
| 5131 | } | 4180 | } |
| 5132 | -} | ||
| 5133 | -},_confirmUnload:null,confirmUnload:function(msg){ | ||
| 5134 | -if(this.type()=="beforeunload"){ | ||
| 5135 | -this._confirmUnload=msg; | ||
| 5136 | -this._event.returnValue=msg; | ||
| 5137 | -} | ||
| 5138 | }}); | 4181 | }}); |
| 5139 | MochiKit.Signal._specialMacKeys={3:"KEY_ENTER",63289:"KEY_NUM_PAD_CLEAR",63276:"KEY_PAGE_UP",63277:"KEY_PAGE_DOWN",63275:"KEY_END",63273:"KEY_HOME",63234:"KEY_ARROW_LEFT",63232:"KEY_ARROW_UP",63235:"KEY_ARROW_RIGHT",63233:"KEY_ARROW_DOWN",63302:"KEY_INSERT",63272:"KEY_DELETE"}; | 4182 | MochiKit.Signal._specialMacKeys={3:"KEY_ENTER",63289:"KEY_NUM_PAD_CLEAR",63276:"KEY_PAGE_UP",63277:"KEY_PAGE_DOWN",63275:"KEY_END",63273:"KEY_HOME",63234:"KEY_ARROW_LEFT",63232:"KEY_ARROW_UP",63235:"KEY_ARROW_RIGHT",63233:"KEY_ARROW_DOWN",63302:"KEY_INSERT",63272:"KEY_DELETE"}; |
| 5140 | -(function(){ | ||
| 5141 | -var _644=MochiKit.Signal._specialMacKeys; | ||
| 5142 | for(i=63236;i<=63242;i++){ | 4183 | for(i=63236;i<=63242;i++){ |
| 5143 | -_644[i]="KEY_F"+(i-63236+1); | 4184 | +MochiKit.Signal._specialMacKeys[i]="KEY_F"+(i-63236+1); |
| 5144 | } | 4185 | } |
| 5145 | -})(); | ||
| 5146 | MochiKit.Signal._specialKeys={8:"KEY_BACKSPACE",9:"KEY_TAB",12:"KEY_NUM_PAD_CLEAR",13:"KEY_ENTER",16:"KEY_SHIFT",17:"KEY_CTRL",18:"KEY_ALT",19:"KEY_PAUSE",20:"KEY_CAPS_LOCK",27:"KEY_ESCAPE",32:"KEY_SPACEBAR",33:"KEY_PAGE_UP",34:"KEY_PAGE_DOWN",35:"KEY_END",36:"KEY_HOME",37:"KEY_ARROW_LEFT",38:"KEY_ARROW_UP",39:"KEY_ARROW_RIGHT",40:"KEY_ARROW_DOWN",44:"KEY_PRINT_SCREEN",45:"KEY_INSERT",46:"KEY_DELETE",59:"KEY_SEMICOLON",91:"KEY_WINDOWS_LEFT",92:"KEY_WINDOWS_RIGHT",93:"KEY_SELECT",106:"KEY_NUM_PAD_ASTERISK",107:"KEY_NUM_PAD_PLUS_SIGN",109:"KEY_NUM_PAD_HYPHEN-MINUS",110:"KEY_NUM_PAD_FULL_STOP",111:"KEY_NUM_PAD_SOLIDUS",144:"KEY_NUM_LOCK",145:"KEY_SCROLL_LOCK",186:"KEY_SEMICOLON",187:"KEY_EQUALS_SIGN",188:"KEY_COMMA",189:"KEY_HYPHEN-MINUS",190:"KEY_FULL_STOP",191:"KEY_SOLIDUS",192:"KEY_GRAVE_ACCENT",219:"KEY_LEFT_SQUARE_BRACKET",220:"KEY_REVERSE_SOLIDUS",221:"KEY_RIGHT_SQUARE_BRACKET",222:"KEY_APOSTROPHE"}; | 4186 | MochiKit.Signal._specialKeys={8:"KEY_BACKSPACE",9:"KEY_TAB",12:"KEY_NUM_PAD_CLEAR",13:"KEY_ENTER",16:"KEY_SHIFT",17:"KEY_CTRL",18:"KEY_ALT",19:"KEY_PAUSE",20:"KEY_CAPS_LOCK",27:"KEY_ESCAPE",32:"KEY_SPACEBAR",33:"KEY_PAGE_UP",34:"KEY_PAGE_DOWN",35:"KEY_END",36:"KEY_HOME",37:"KEY_ARROW_LEFT",38:"KEY_ARROW_UP",39:"KEY_ARROW_RIGHT",40:"KEY_ARROW_DOWN",44:"KEY_PRINT_SCREEN",45:"KEY_INSERT",46:"KEY_DELETE",59:"KEY_SEMICOLON",91:"KEY_WINDOWS_LEFT",92:"KEY_WINDOWS_RIGHT",93:"KEY_SELECT",106:"KEY_NUM_PAD_ASTERISK",107:"KEY_NUM_PAD_PLUS_SIGN",109:"KEY_NUM_PAD_HYPHEN-MINUS",110:"KEY_NUM_PAD_FULL_STOP",111:"KEY_NUM_PAD_SOLIDUS",144:"KEY_NUM_LOCK",145:"KEY_SCROLL_LOCK",186:"KEY_SEMICOLON",187:"KEY_EQUALS_SIGN",188:"KEY_COMMA",189:"KEY_HYPHEN-MINUS",190:"KEY_FULL_STOP",191:"KEY_SOLIDUS",192:"KEY_GRAVE_ACCENT",219:"KEY_LEFT_SQUARE_BRACKET",220:"KEY_REVERSE_SOLIDUS",221:"KEY_RIGHT_SQUARE_BRACKET",222:"KEY_APOSTROPHE"}; |
| 5147 | -(function(){ | ||
| 5148 | -var _645=MochiKit.Signal._specialKeys; | ||
| 5149 | for(var i=48;i<=57;i++){ | 4187 | for(var i=48;i<=57;i++){ |
| 5150 | -_645[i]="KEY_"+(i-48); | 4188 | +MochiKit.Signal._specialKeys[i]="KEY_"+(i-48); |
| 5151 | } | 4189 | } |
| 5152 | for(i=65;i<=90;i++){ | 4190 | for(i=65;i<=90;i++){ |
| 5153 | -_645[i]="KEY_"+String.fromCharCode(i); | 4191 | +MochiKit.Signal._specialKeys[i]="KEY_"+String.fromCharCode(i); |
| 5154 | } | 4192 | } |
| 5155 | for(i=96;i<=105;i++){ | 4193 | for(i=96;i<=105;i++){ |
| 5156 | -_645[i]="KEY_NUM_PAD_"+(i-96); | 4194 | +MochiKit.Signal._specialKeys[i]="KEY_NUM_PAD_"+(i-96); |
| 5157 | } | 4195 | } |
| 5158 | for(i=112;i<=123;i++){ | 4196 | for(i=112;i<=123;i++){ |
| 5159 | -_645[i]="KEY_F"+(i-112+1); | 4197 | +MochiKit.Signal._specialKeys[i]="KEY_F"+(i-112+1); |
| 5160 | } | 4198 | } |
| 5161 | -})(); | ||
| 5162 | MochiKit.Base.update(MochiKit.Signal,{__repr__:function(){ | 4199 | MochiKit.Base.update(MochiKit.Signal,{__repr__:function(){ |
| 5163 | return "["+this.NAME+" "+this.VERSION+"]"; | 4200 | return "["+this.NAME+" "+this.VERSION+"]"; |
| 5164 | },toString:function(){ | 4201 | },toString:function(){ |
| 5165 | return this.__repr__(); | 4202 | return this.__repr__(); |
| 5166 | },_unloadCache:function(){ | 4203 | },_unloadCache:function(){ |
| 5167 | var self=MochiKit.Signal; | 4204 | var self=MochiKit.Signal; |
| 5168 | -var _646=self._observers; | ||
| 5169 | -for(var i=0;i<_646.length;i++){ | ||
| 5170 | -self._disconnect(_646[i]); | 4205 | +var _548=self._observers; |
| 4206 | +for(var i=0;i<_548.length;i++){ | ||
| 4207 | +self._disconnect(_548[i]); | ||
| 5171 | } | 4208 | } |
| 5172 | delete self._observers; | 4209 | delete self._observers; |
| 5173 | try{ | 4210 | try{ |
| @@ -5180,267 +4217,165 @@ window.onunload=undefined; | @@ -5180,267 +4217,165 @@ window.onunload=undefined; | ||
| 5180 | } | 4217 | } |
| 5181 | catch(e){ | 4218 | catch(e){ |
| 5182 | } | 4219 | } |
| 5183 | -},_listener:function(src,func,obj,_647){ | ||
| 5184 | -var self=MochiKit.Signal; | ||
| 5185 | -var E=self.Event; | ||
| 5186 | -if(!_647){ | 4220 | +},_listener:function(src,func,obj,_549){ |
| 4221 | +var E=MochiKit.Signal.Event; | ||
| 4222 | +if(!_549){ | ||
| 5187 | return MochiKit.Base.bind(func,obj); | 4223 | return MochiKit.Base.bind(func,obj); |
| 5188 | } | 4224 | } |
| 5189 | obj=obj||src; | 4225 | obj=obj||src; |
| 5190 | if(typeof (func)=="string"){ | 4226 | if(typeof (func)=="string"){ |
| 5191 | -return function(_649){ | ||
| 5192 | -obj[func].apply(obj,[new E(src,_649)]); | 4227 | +return function(_551){ |
| 4228 | +obj[func].apply(obj,[new E(src,_551)]); | ||
| 5193 | }; | 4229 | }; |
| 5194 | }else{ | 4230 | }else{ |
| 5195 | -return function(_650){ | ||
| 5196 | -func.apply(obj,[new E(src,_650)]); | 4231 | +return function(_552){ |
| 4232 | +func.apply(obj,[new E(src,_552)]); | ||
| 5197 | }; | 4233 | }; |
| 5198 | } | 4234 | } |
| 5199 | -},_browserAlreadyHasMouseEnterAndLeave:function(){ | ||
| 5200 | -return /MSIE/.test(navigator.userAgent); | ||
| 5201 | -},_mouseEnterListener:function(src,sig,func,obj){ | ||
| 5202 | -var E=MochiKit.Signal.Event; | ||
| 5203 | -return function(_652){ | ||
| 5204 | -var e=new E(src,_652); | ||
| 5205 | -try{ | ||
| 5206 | -e.relatedTarget().nodeName; | ||
| 5207 | -} | ||
| 5208 | -catch(err){ | ||
| 5209 | -return; | ||
| 5210 | -} | ||
| 5211 | -e.stop(); | ||
| 5212 | -if(MochiKit.DOM.isChildNode(e.relatedTarget(),src)){ | ||
| 5213 | -return; | ||
| 5214 | -} | ||
| 5215 | -e.type=function(){ | ||
| 5216 | -return sig; | ||
| 5217 | -}; | ||
| 5218 | -if(typeof (func)=="string"){ | ||
| 5219 | -return obj[func].apply(obj,[e]); | ||
| 5220 | -}else{ | ||
| 5221 | -return func.apply(obj,[e]); | 4235 | +},connect:function(src,sig,_554,_555){ |
| 4236 | +src=MochiKit.DOM.getElement(src); | ||
| 4237 | +var self=MochiKit.Signal; | ||
| 4238 | +if(typeof (sig)!="string"){ | ||
| 4239 | +throw new Error("'sig' must be a string"); | ||
| 5222 | } | 4240 | } |
| 5223 | -}; | ||
| 5224 | -},_getDestPair:function(_653,_654){ | ||
| 5225 | var obj=null; | 4241 | var obj=null; |
| 5226 | var func=null; | 4242 | var func=null; |
| 5227 | -if(typeof (_654)!="undefined"){ | ||
| 5228 | -obj=_653; | ||
| 5229 | -func=_654; | ||
| 5230 | -if(typeof (_654)=="string"){ | ||
| 5231 | -if(typeof (_653[_654])!="function"){ | 4243 | +if(typeof (_555)!="undefined"){ |
| 4244 | +obj=_554; | ||
| 4245 | +func=_555; | ||
| 4246 | +if(typeof (_555)=="string"){ | ||
| 4247 | +if(typeof (_554[_555])!="function"){ | ||
| 5232 | throw new Error("'funcOrStr' must be a function on 'objOrFunc'"); | 4248 | throw new Error("'funcOrStr' must be a function on 'objOrFunc'"); |
| 5233 | } | 4249 | } |
| 5234 | }else{ | 4250 | }else{ |
| 5235 | -if(typeof (_654)!="function"){ | 4251 | +if(typeof (_555)!="function"){ |
| 5236 | throw new Error("'funcOrStr' must be a function or string"); | 4252 | throw new Error("'funcOrStr' must be a function or string"); |
| 5237 | } | 4253 | } |
| 5238 | } | 4254 | } |
| 5239 | }else{ | 4255 | }else{ |
| 5240 | -if(typeof (_653)!="function"){ | 4256 | +if(typeof (_554)!="function"){ |
| 5241 | throw new Error("'objOrFunc' must be a function if 'funcOrStr' is not given"); | 4257 | throw new Error("'objOrFunc' must be a function if 'funcOrStr' is not given"); |
| 5242 | }else{ | 4258 | }else{ |
| 5243 | -func=_653; | 4259 | +func=_554; |
| 5244 | } | 4260 | } |
| 5245 | } | 4261 | } |
| 5246 | -return [obj,func]; | ||
| 5247 | -},connect:function(src,sig,_655,_656){ | ||
| 5248 | -src=MochiKit.DOM.getElement(src); | ||
| 5249 | -var self=MochiKit.Signal; | ||
| 5250 | -if(typeof (sig)!="string"){ | ||
| 5251 | -throw new Error("'sig' must be a string"); | ||
| 5252 | -} | ||
| 5253 | -var _657=self._getDestPair(_655,_656); | ||
| 5254 | -var obj=_657[0]; | ||
| 5255 | -var func=_657[1]; | ||
| 5256 | if(typeof (obj)=="undefined"||obj===null){ | 4262 | if(typeof (obj)=="undefined"||obj===null){ |
| 5257 | obj=src; | 4263 | obj=src; |
| 5258 | } | 4264 | } |
| 5259 | -var _658=!!(src.addEventListener||src.attachEvent); | ||
| 5260 | -if(_658&&(sig==="onmouseenter"||sig==="onmouseleave")&&!self._browserAlreadyHasMouseEnterAndLeave()){ | ||
| 5261 | -var _659=self._mouseEnterListener(src,sig.substr(2),func,obj); | ||
| 5262 | -if(sig==="onmouseenter"){ | ||
| 5263 | -sig="onmouseover"; | ||
| 5264 | -}else{ | ||
| 5265 | -sig="onmouseout"; | ||
| 5266 | -} | ||
| 5267 | -}else{ | ||
| 5268 | -var _659=self._listener(src,func,obj,_658); | ||
| 5269 | -} | 4265 | +var _556=!!(src.addEventListener||src.attachEvent); |
| 4266 | +var _557=self._listener(src,func,obj,_556); | ||
| 5270 | if(src.addEventListener){ | 4267 | if(src.addEventListener){ |
| 5271 | -src.addEventListener(sig.substr(2),_659,false); | 4268 | +src.addEventListener(sig.substr(2),_557,false); |
| 5272 | }else{ | 4269 | }else{ |
| 5273 | if(src.attachEvent){ | 4270 | if(src.attachEvent){ |
| 5274 | -src.attachEvent(sig,_659); | ||
| 5275 | -} | 4271 | +src.attachEvent(sig,_557); |
| 5276 | } | 4272 | } |
| 5277 | -var _660=[src,sig,_659,_658,_655,_656,true]; | ||
| 5278 | -self._observers.push(_660); | ||
| 5279 | -if(!_658&&typeof (src.__connect__)=="function"){ | ||
| 5280 | -var args=MochiKit.Base.extend([_660],arguments,1); | ||
| 5281 | -src.__connect__.apply(src,args); | ||
| 5282 | } | 4273 | } |
| 5283 | -return _660; | ||
| 5284 | -},_disconnect:function(_661){ | ||
| 5285 | -if(!_661[6]){ | 4274 | +var _558=[src,sig,_557,_556,_554,_555]; |
| 4275 | +self._observers.push(_558); | ||
| 4276 | +return _558; | ||
| 4277 | +},_disconnect:function(_559){ | ||
| 4278 | +if(!_559[3]){ | ||
| 5286 | return; | 4279 | return; |
| 5287 | } | 4280 | } |
| 5288 | -_661[6]=false; | ||
| 5289 | -if(!_661[3]){ | ||
| 5290 | -return; | ||
| 5291 | -} | ||
| 5292 | -var src=_661[0]; | ||
| 5293 | -var sig=_661[1]; | ||
| 5294 | -var _662=_661[2]; | 4281 | +var src=_559[0]; |
| 4282 | +var sig=_559[1]; | ||
| 4283 | +var _560=_559[2]; | ||
| 5295 | if(src.removeEventListener){ | 4284 | if(src.removeEventListener){ |
| 5296 | -src.removeEventListener(sig.substr(2),_662,false); | 4285 | +src.removeEventListener(sig.substr(2),_560,false); |
| 5297 | }else{ | 4286 | }else{ |
| 5298 | if(src.detachEvent){ | 4287 | if(src.detachEvent){ |
| 5299 | -src.detachEvent(sig,_662); | 4288 | +src.detachEvent(sig,_560); |
| 5300 | }else{ | 4289 | }else{ |
| 5301 | throw new Error("'src' must be a DOM element"); | 4290 | throw new Error("'src' must be a DOM element"); |
| 5302 | } | 4291 | } |
| 5303 | } | 4292 | } |
| 5304 | -},disconnect:function(_663){ | 4293 | +},disconnect:function(_561){ |
| 5305 | var self=MochiKit.Signal; | 4294 | var self=MochiKit.Signal; |
| 5306 | -var _664=self._observers; | 4295 | +var _562=self._observers; |
| 5307 | var m=MochiKit.Base; | 4296 | var m=MochiKit.Base; |
| 5308 | if(arguments.length>1){ | 4297 | if(arguments.length>1){ |
| 5309 | var src=MochiKit.DOM.getElement(arguments[0]); | 4298 | var src=MochiKit.DOM.getElement(arguments[0]); |
| 5310 | var sig=arguments[1]; | 4299 | var sig=arguments[1]; |
| 5311 | var obj=arguments[2]; | 4300 | var obj=arguments[2]; |
| 5312 | var func=arguments[3]; | 4301 | var func=arguments[3]; |
| 5313 | -for(var i=_664.length-1;i>=0;i--){ | ||
| 5314 | -var o=_664[i]; | 4302 | +for(var i=_562.length-1;i>=0;i--){ |
| 4303 | +var o=_562[i]; | ||
| 5315 | if(o[0]===src&&o[1]===sig&&o[4]===obj&&o[5]===func){ | 4304 | if(o[0]===src&&o[1]===sig&&o[4]===obj&&o[5]===func){ |
| 5316 | self._disconnect(o); | 4305 | self._disconnect(o); |
| 5317 | -if(!self._lock){ | ||
| 5318 | -_664.splice(i,1); | ||
| 5319 | -}else{ | ||
| 5320 | -self._dirty=true; | ||
| 5321 | -} | 4306 | +_562.splice(i,1); |
| 5322 | return true; | 4307 | return true; |
| 5323 | } | 4308 | } |
| 5324 | } | 4309 | } |
| 5325 | }else{ | 4310 | }else{ |
| 5326 | -var idx=m.findIdentical(_664,_663); | 4311 | +var idx=m.findIdentical(_562,_561); |
| 5327 | if(idx>=0){ | 4312 | if(idx>=0){ |
| 5328 | -self._disconnect(_663); | ||
| 5329 | -if(!self._lock){ | ||
| 5330 | -_664.splice(idx,1); | ||
| 5331 | -}else{ | ||
| 5332 | -self._dirty=true; | ||
| 5333 | -} | 4313 | +self._disconnect(_561); |
| 4314 | +_562.splice(idx,1); | ||
| 5334 | return true; | 4315 | return true; |
| 5335 | } | 4316 | } |
| 5336 | } | 4317 | } |
| 5337 | return false; | 4318 | return false; |
| 5338 | -},disconnectAllTo:function(_665,_666){ | ||
| 5339 | -var self=MochiKit.Signal; | ||
| 5340 | -var _667=self._observers; | ||
| 5341 | -var _668=self._disconnect; | ||
| 5342 | -var _669=self._lock; | ||
| 5343 | -var _670=self._dirty; | ||
| 5344 | -if(typeof (_666)==="undefined"){ | ||
| 5345 | -_666=null; | ||
| 5346 | -} | ||
| 5347 | -for(var i=_667.length-1;i>=0;i--){ | ||
| 5348 | -var _671=_667[i]; | ||
| 5349 | -if(_671[4]===_665&&(_666===null||_671[5]===_666)){ | ||
| 5350 | -_668(_671); | ||
| 5351 | -if(_669){ | ||
| 5352 | -_670=true; | ||
| 5353 | -}else{ | ||
| 5354 | -_667.splice(i,1); | ||
| 5355 | -} | ||
| 5356 | -} | ||
| 5357 | -} | ||
| 5358 | -self._dirty=_670; | ||
| 5359 | },disconnectAll:function(src,sig){ | 4319 | },disconnectAll:function(src,sig){ |
| 5360 | src=MochiKit.DOM.getElement(src); | 4320 | src=MochiKit.DOM.getElement(src); |
| 5361 | var m=MochiKit.Base; | 4321 | var m=MochiKit.Base; |
| 5362 | -var _672=m.flattenArguments(m.extend(null,arguments,1)); | 4322 | +var _563=m.flattenArguments(m.extend(null,arguments,1)); |
| 5363 | var self=MochiKit.Signal; | 4323 | var self=MochiKit.Signal; |
| 5364 | -var _673=self._disconnect; | ||
| 5365 | -var _674=self._observers; | ||
| 5366 | -var i,ident; | ||
| 5367 | -var _675=self._lock; | ||
| 5368 | -var _676=self._dirty; | ||
| 5369 | -if(_672.length===0){ | ||
| 5370 | -for(i=_674.length-1;i>=0;i--){ | ||
| 5371 | -ident=_674[i]; | ||
| 5372 | -if(ident[0]===src){ | ||
| 5373 | -_673(ident); | ||
| 5374 | -if(!_675){ | ||
| 5375 | -_674.splice(i,1); | ||
| 5376 | -}else{ | ||
| 5377 | -_676=true; | ||
| 5378 | -} | 4324 | +var _564=self._disconnect; |
| 4325 | +var _565=self._observers; | ||
| 4326 | +if(_563.length===0){ | ||
| 4327 | +for(var i=_565.length-1;i>=0;i--){ | ||
| 4328 | +var _566=_565[i]; | ||
| 4329 | +if(_566[0]===src){ | ||
| 4330 | +_564(_566); | ||
| 4331 | +_565.splice(i,1); | ||
| 5379 | } | 4332 | } |
| 5380 | } | 4333 | } |
| 5381 | }else{ | 4334 | }else{ |
| 5382 | var sigs={}; | 4335 | var sigs={}; |
| 5383 | -for(i=0;i<_672.length;i++){ | ||
| 5384 | -sigs[_672[i]]=true; | ||
| 5385 | -} | ||
| 5386 | -for(i=_674.length-1;i>=0;i--){ | ||
| 5387 | -ident=_674[i]; | ||
| 5388 | -if(ident[0]===src&&ident[1] in sigs){ | ||
| 5389 | -_673(ident); | ||
| 5390 | -if(!_675){ | ||
| 5391 | -_674.splice(i,1); | ||
| 5392 | -}else{ | ||
| 5393 | -_676=true; | 4336 | +for(var i=0;i<_563.length;i++){ |
| 4337 | +sigs[_563[i]]=true; | ||
| 5394 | } | 4338 | } |
| 4339 | +for(var i=_565.length-1;i>=0;i--){ | ||
| 4340 | +var _566=_565[i]; | ||
| 4341 | +if(_566[0]===src&&_566[1] in sigs){ | ||
| 4342 | +_564(_566); | ||
| 4343 | +_565.splice(i,1); | ||
| 5395 | } | 4344 | } |
| 5396 | } | 4345 | } |
| 5397 | } | 4346 | } |
| 5398 | -self._dirty=_676; | ||
| 5399 | },signal:function(src,sig){ | 4347 | },signal:function(src,sig){ |
| 5400 | -var self=MochiKit.Signal; | ||
| 5401 | -var _678=self._observers; | 4348 | +var _568=MochiKit.Signal._observers; |
| 5402 | src=MochiKit.DOM.getElement(src); | 4349 | src=MochiKit.DOM.getElement(src); |
| 5403 | var args=MochiKit.Base.extend(null,arguments,2); | 4350 | var args=MochiKit.Base.extend(null,arguments,2); |
| 5404 | -var _679=[]; | ||
| 5405 | -self._lock=true; | ||
| 5406 | -for(var i=0;i<_678.length;i++){ | ||
| 5407 | -var _680=_678[i]; | ||
| 5408 | -if(_680[0]===src&&_680[1]===sig){ | 4351 | +var _569=[]; |
| 4352 | +for(var i=0;i<_568.length;i++){ | ||
| 4353 | +var _570=_568[i]; | ||
| 4354 | +if(_570[0]===src&&_570[1]===sig){ | ||
| 5409 | try{ | 4355 | try{ |
| 5410 | -_680[2].apply(src,args); | 4356 | +_570[2].apply(src,args); |
| 5411 | } | 4357 | } |
| 5412 | catch(e){ | 4358 | catch(e){ |
| 5413 | -_679.push(e); | ||
| 5414 | -} | ||
| 5415 | -} | ||
| 5416 | -} | ||
| 5417 | -self._lock=false; | ||
| 5418 | -if(self._dirty){ | ||
| 5419 | -self._dirty=false; | ||
| 5420 | -for(var i=_678.length-1;i>=0;i--){ | ||
| 5421 | -if(!_678[i][6]){ | ||
| 5422 | -_678.splice(i,1); | 4359 | +_569.push(e); |
| 5423 | } | 4360 | } |
| 5424 | } | 4361 | } |
| 5425 | } | 4362 | } |
| 5426 | -if(_679.length==1){ | ||
| 5427 | -throw _679[0]; | 4363 | +if(_569.length==1){ |
| 4364 | +throw _569[0]; | ||
| 5428 | }else{ | 4365 | }else{ |
| 5429 | -if(_679.length>1){ | 4366 | +if(_569.length>1){ |
| 5430 | var e=new Error("Multiple errors thrown in handling 'sig', see errors property"); | 4367 | var e=new Error("Multiple errors thrown in handling 'sig', see errors property"); |
| 5431 | -e.errors=_679; | 4368 | +e.errors=_569; |
| 5432 | throw e; | 4369 | throw e; |
| 5433 | } | 4370 | } |
| 5434 | } | 4371 | } |
| 5435 | }}); | 4372 | }}); |
| 5436 | MochiKit.Signal.EXPORT_OK=[]; | 4373 | MochiKit.Signal.EXPORT_OK=[]; |
| 5437 | -MochiKit.Signal.EXPORT=["connect","disconnect","signal","disconnectAll","disconnectAllTo"]; | 4374 | +MochiKit.Signal.EXPORT=["connect","disconnect","signal","disconnectAll"]; |
| 5438 | MochiKit.Signal.__new__=function(win){ | 4375 | MochiKit.Signal.__new__=function(win){ |
| 5439 | var m=MochiKit.Base; | 4376 | var m=MochiKit.Base; |
| 5440 | this._document=document; | 4377 | this._document=document; |
| 5441 | this._window=win; | 4378 | this._window=win; |
| 5442 | -this._lock=false; | ||
| 5443 | -this._dirty=false; | ||
| 5444 | try{ | 4379 | try{ |
| 5445 | this.connect(window,"onunload",this._unloadCache); | 4380 | this.connect(window,"onunload",this._unloadCache); |
| 5446 | } | 4381 | } |
| @@ -5450,7 +4385,7 @@ this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_ | @@ -5450,7 +4385,7 @@ this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_ | ||
| 5450 | m.nameFunctions(this); | 4385 | m.nameFunctions(this); |
| 5451 | }; | 4386 | }; |
| 5452 | MochiKit.Signal.__new__(this); | 4387 | MochiKit.Signal.__new__(this); |
| 5453 | -if(MochiKit.__export__){ | 4388 | +if(!MochiKit.__compat__){ |
| 5454 | connect=MochiKit.Signal.connect; | 4389 | connect=MochiKit.Signal.connect; |
| 5455 | disconnect=MochiKit.Signal.disconnect; | 4390 | disconnect=MochiKit.Signal.disconnect; |
| 5456 | disconnectAll=MochiKit.Signal.disconnectAll; | 4391 | disconnectAll=MochiKit.Signal.disconnectAll; |
| @@ -5458,376 +4393,220 @@ signal=MochiKit.Signal.signal; | @@ -5458,376 +4393,220 @@ signal=MochiKit.Signal.signal; | ||
| 5458 | } | 4393 | } |
| 5459 | MochiKit.Base._exportSymbols(this,MochiKit.Signal); | 4394 | MochiKit.Base._exportSymbols(this,MochiKit.Signal); |
| 5460 | if(typeof (dojo)!="undefined"){ | 4395 | if(typeof (dojo)!="undefined"){ |
| 5461 | -dojo.provide("MochiKit.Position"); | ||
| 5462 | -dojo.require("MochiKit.Base"); | ||
| 5463 | -dojo.require("MochiKit.DOM"); | ||
| 5464 | -dojo.require("MochiKit.Style"); | ||
| 5465 | -} | ||
| 5466 | -if(typeof (JSAN)!="undefined"){ | ||
| 5467 | -JSAN.use("MochiKit.Base",[]); | ||
| 5468 | -JSAN.use("MochiKit.DOM",[]); | ||
| 5469 | -JSAN.use("MochiKit.Style",[]); | ||
| 5470 | -} | ||
| 5471 | -try{ | ||
| 5472 | -if(typeof (MochiKit.Base)=="undefined"||typeof (MochiKit.Style)=="undefined"||typeof (MochiKit.DOM)=="undefined"){ | ||
| 5473 | -throw ""; | ||
| 5474 | -} | ||
| 5475 | -} | ||
| 5476 | -catch(e){ | ||
| 5477 | -throw "MochiKit.Style depends on MochiKit.Base, MochiKit.DOM, and MochiKit.Style!"; | ||
| 5478 | -} | ||
| 5479 | -if(typeof (MochiKit.Position)=="undefined"){ | ||
| 5480 | -MochiKit.Position={}; | ||
| 5481 | -} | ||
| 5482 | -MochiKit.Position.NAME="MochiKit.Position"; | ||
| 5483 | -MochiKit.Position.VERSION="1.4"; | ||
| 5484 | -MochiKit.Position.__repr__=function(){ | ||
| 5485 | -return "["+this.NAME+" "+this.VERSION+"]"; | ||
| 5486 | -}; | ||
| 5487 | -MochiKit.Position.toString=function(){ | ||
| 5488 | -return this.__repr__(); | ||
| 5489 | -}; | ||
| 5490 | -MochiKit.Position.EXPORT_OK=[]; | ||
| 5491 | -MochiKit.Position.EXPORT=[]; | ||
| 5492 | -MochiKit.Base.update(MochiKit.Position,{includeScrollOffsets:false,prepare:function(){ | ||
| 5493 | -var _681=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0; | ||
| 5494 | -var _682=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0; | ||
| 5495 | -this.windowOffset=new MochiKit.Style.Coordinates(_681,_682); | ||
| 5496 | -},cumulativeOffset:function(_683){ | ||
| 5497 | -var _684=0; | ||
| 5498 | -var _685=0; | ||
| 5499 | -do{ | ||
| 5500 | -_684+=_683.offsetTop||0; | ||
| 5501 | -_685+=_683.offsetLeft||0; | ||
| 5502 | -_683=_683.offsetParent; | ||
| 5503 | -}while(_683); | ||
| 5504 | -return new MochiKit.Style.Coordinates(_685,_684); | ||
| 5505 | -},realOffset:function(_686){ | ||
| 5506 | -var _687=0; | ||
| 5507 | -var _688=0; | ||
| 5508 | -do{ | ||
| 5509 | -_687+=_686.scrollTop||0; | ||
| 5510 | -_688+=_686.scrollLeft||0; | ||
| 5511 | -_686=_686.parentNode; | ||
| 5512 | -}while(_686); | ||
| 5513 | -return new MochiKit.Style.Coordinates(_688,_687); | ||
| 5514 | -},within:function(_689,x,y){ | ||
| 5515 | -if(this.includeScrollOffsets){ | ||
| 5516 | -return this.withinIncludingScrolloffsets(_689,x,y); | ||
| 5517 | -} | ||
| 5518 | -this.xcomp=x; | ||
| 5519 | -this.ycomp=y; | ||
| 5520 | -this.offset=this.cumulativeOffset(_689); | ||
| 5521 | -if(_689.style.position=="fixed"){ | ||
| 5522 | -this.offset.x+=this.windowOffset.x; | ||
| 5523 | -this.offset.y+=this.windowOffset.y; | ||
| 5524 | -} | ||
| 5525 | -return (y>=this.offset.y&&y<this.offset.y+_689.offsetHeight&&x>=this.offset.x&&x<this.offset.x+_689.offsetWidth); | ||
| 5526 | -},withinIncludingScrolloffsets:function(_690,x,y){ | ||
| 5527 | -var _691=this.realOffset(_690); | ||
| 5528 | -this.xcomp=x+_691.x-this.windowOffset.x; | ||
| 5529 | -this.ycomp=y+_691.y-this.windowOffset.y; | ||
| 5530 | -this.offset=this.cumulativeOffset(_690); | ||
| 5531 | -return (this.ycomp>=this.offset.y&&this.ycomp<this.offset.y+_690.offsetHeight&&this.xcomp>=this.offset.x&&this.xcomp<this.offset.x+_690.offsetWidth); | ||
| 5532 | -},overlap:function(mode,_693){ | ||
| 5533 | -if(!mode){ | ||
| 5534 | -return 0; | ||
| 5535 | -} | ||
| 5536 | -if(mode=="vertical"){ | ||
| 5537 | -return ((this.offset.y+_693.offsetHeight)-this.ycomp)/_693.offsetHeight; | ||
| 5538 | -} | ||
| 5539 | -if(mode=="horizontal"){ | ||
| 5540 | -return ((this.offset.x+_693.offsetWidth)-this.xcomp)/_693.offsetWidth; | ||
| 5541 | -} | ||
| 5542 | -},absolutize:function(_694){ | ||
| 5543 | -_694=MochiKit.DOM.getElement(_694); | ||
| 5544 | -if(_694.style.position=="absolute"){ | ||
| 5545 | -return; | ||
| 5546 | -} | ||
| 5547 | -MochiKit.Position.prepare(); | ||
| 5548 | -var _695=MochiKit.Position.positionedOffset(_694); | ||
| 5549 | -var _696=_694.clientWidth; | ||
| 5550 | -var _697=_694.clientHeight; | ||
| 5551 | -var _698={"position":_694.style.position,"left":_695.x-parseFloat(_694.style.left||0),"top":_695.y-parseFloat(_694.style.top||0),"width":_694.style.width,"height":_694.style.height}; | ||
| 5552 | -_694.style.position="absolute"; | ||
| 5553 | -_694.style.top=_695.y+"px"; | ||
| 5554 | -_694.style.left=_695.x+"px"; | ||
| 5555 | -_694.style.width=_696+"px"; | ||
| 5556 | -_694.style.height=_697+"px"; | ||
| 5557 | -return _698; | ||
| 5558 | -},positionedOffset:function(_699){ | ||
| 5559 | -var _700=0,valueL=0; | ||
| 5560 | -do{ | ||
| 5561 | -_700+=_699.offsetTop||0; | ||
| 5562 | -valueL+=_699.offsetLeft||0; | ||
| 5563 | -_699=_699.offsetParent; | ||
| 5564 | -if(_699){ | ||
| 5565 | -p=MochiKit.Style.getStyle(_699,"position"); | ||
| 5566 | -if(p=="relative"||p=="absolute"){ | ||
| 5567 | -break; | ||
| 5568 | -} | ||
| 5569 | -} | ||
| 5570 | -}while(_699); | ||
| 5571 | -return new MochiKit.Style.Coordinates(valueL,_700); | ||
| 5572 | -},relativize:function(_701,_702){ | ||
| 5573 | -_701=MochiKit.DOM.getElement(_701); | ||
| 5574 | -if(_701.style.position=="relative"){ | ||
| 5575 | -return; | ||
| 5576 | -} | ||
| 5577 | -MochiKit.Position.prepare(); | ||
| 5578 | -var top=parseFloat(_701.style.top||0)-(_702["top"]||0); | ||
| 5579 | -var left=parseFloat(_701.style.left||0)-(_702["left"]||0); | ||
| 5580 | -_701.style.position=_702["position"]; | ||
| 5581 | -_701.style.top=top+"px"; | ||
| 5582 | -_701.style.left=left+"px"; | ||
| 5583 | -_701.style.width=_702["width"]; | ||
| 5584 | -_701.style.height=_702["height"]; | ||
| 5585 | -},clone:function(_705,_706){ | ||
| 5586 | -_705=MochiKit.DOM.getElement(_705); | ||
| 5587 | -_706=MochiKit.DOM.getElement(_706); | ||
| 5588 | -_706.style.position="absolute"; | ||
| 5589 | -var _707=this.cumulativeOffset(_705); | ||
| 5590 | -_706.style.top=_707.y+"px"; | ||
| 5591 | -_706.style.left=_707.x+"px"; | ||
| 5592 | -_706.style.width=_705.offsetWidth+"px"; | ||
| 5593 | -_706.style.height=_705.offsetHeight+"px"; | ||
| 5594 | -},page:function(_708){ | ||
| 5595 | -var _709=0; | ||
| 5596 | -var _710=0; | ||
| 5597 | -var _711=_708; | ||
| 5598 | -do{ | ||
| 5599 | -_709+=_711.offsetTop||0; | ||
| 5600 | -_710+=_711.offsetLeft||0; | ||
| 5601 | -if(_711.offsetParent==document.body&&MochiKit.Style.getStyle(_711,"position")=="absolute"){ | ||
| 5602 | -break; | ||
| 5603 | -} | ||
| 5604 | -}while(_711=_711.offsetParent); | ||
| 5605 | -_711=_708; | ||
| 5606 | -do{ | ||
| 5607 | -_709-=_711.scrollTop||0; | ||
| 5608 | -_710-=_711.scrollLeft||0; | ||
| 5609 | -}while(_711=_711.parentNode); | ||
| 5610 | -return new MochiKit.Style.Coordinates(_710,_709); | ||
| 5611 | -}}); | ||
| 5612 | -if(typeof (dojo)!="undefined"){ | ||
| 5613 | dojo.provide("MochiKit.Visual"); | 4396 | dojo.provide("MochiKit.Visual"); |
| 5614 | dojo.require("MochiKit.Base"); | 4397 | dojo.require("MochiKit.Base"); |
| 5615 | dojo.require("MochiKit.DOM"); | 4398 | dojo.require("MochiKit.DOM"); |
| 5616 | -dojo.require("MochiKit.Style"); | ||
| 5617 | dojo.require("MochiKit.Color"); | 4399 | dojo.require("MochiKit.Color"); |
| 5618 | -dojo.require("MochiKit.Position"); | ||
| 5619 | } | 4400 | } |
| 5620 | if(typeof (JSAN)!="undefined"){ | 4401 | if(typeof (JSAN)!="undefined"){ |
| 5621 | JSAN.use("MochiKit.Base",[]); | 4402 | JSAN.use("MochiKit.Base",[]); |
| 5622 | JSAN.use("MochiKit.DOM",[]); | 4403 | JSAN.use("MochiKit.DOM",[]); |
| 5623 | -JSAN.use("MochiKit.Style",[]); | ||
| 5624 | JSAN.use("MochiKit.Color",[]); | 4404 | JSAN.use("MochiKit.Color",[]); |
| 5625 | -JSAN.use("MochiKit.Position",[]); | ||
| 5626 | } | 4405 | } |
| 5627 | try{ | 4406 | try{ |
| 5628 | -if(typeof (MochiKit.Base)==="undefined"||typeof (MochiKit.DOM)==="undefined"||typeof (MochiKit.Style)==="undefined"||typeof (MochiKit.Position)==="undefined"||typeof (MochiKit.Color)==="undefined"){ | 4407 | +if(typeof (MochiKit.Base)=="undefined"||typeof (MochiKit.DOM)=="undefined"||typeof (MochiKit.Color)=="undefined"){ |
| 5629 | throw ""; | 4408 | throw ""; |
| 5630 | } | 4409 | } |
| 5631 | } | 4410 | } |
| 5632 | catch(e){ | 4411 | catch(e){ |
| 5633 | -throw "MochiKit.Visual depends on MochiKit.Base, MochiKit.DOM, MochiKit.Style, MochiKit.Position and MochiKit.Color!"; | 4412 | +throw "MochiKit.Visual depends on MochiKit.Base, MochiKit.DOM and MochiKit.Color!"; |
| 5634 | } | 4413 | } |
| 5635 | if(typeof (MochiKit.Visual)=="undefined"){ | 4414 | if(typeof (MochiKit.Visual)=="undefined"){ |
| 5636 | MochiKit.Visual={}; | 4415 | MochiKit.Visual={}; |
| 5637 | } | 4416 | } |
| 5638 | MochiKit.Visual.NAME="MochiKit.Visual"; | 4417 | MochiKit.Visual.NAME="MochiKit.Visual"; |
| 5639 | -MochiKit.Visual.VERSION="1.4"; | 4418 | +MochiKit.Visual.VERSION="1.3.1"; |
| 5640 | MochiKit.Visual.__repr__=function(){ | 4419 | MochiKit.Visual.__repr__=function(){ |
| 5641 | return "["+this.NAME+" "+this.VERSION+"]"; | 4420 | return "["+this.NAME+" "+this.VERSION+"]"; |
| 5642 | }; | 4421 | }; |
| 5643 | MochiKit.Visual.toString=function(){ | 4422 | MochiKit.Visual.toString=function(){ |
| 5644 | return this.__repr__(); | 4423 | return this.__repr__(); |
| 5645 | }; | 4424 | }; |
| 5646 | -MochiKit.Visual._RoundCorners=function(e,_712){ | 4425 | +MochiKit.Visual._RoundCorners=function(e,_571){ |
| 5647 | e=MochiKit.DOM.getElement(e); | 4426 | e=MochiKit.DOM.getElement(e); |
| 5648 | -this._setOptions(_712); | 4427 | +this._setOptions(_571); |
| 5649 | if(this.options.__unstable__wrapElement){ | 4428 | if(this.options.__unstable__wrapElement){ |
| 5650 | e=this._doWrap(e); | 4429 | e=this._doWrap(e); |
| 5651 | } | 4430 | } |
| 5652 | -var _713=this.options.color; | 4431 | +var _572=this.options.color; |
| 5653 | var C=MochiKit.Color.Color; | 4432 | var C=MochiKit.Color.Color; |
| 5654 | -if(this.options.color==="fromElement"){ | ||
| 5655 | -_713=C.fromBackground(e); | 4433 | +if(this.options.color=="fromElement"){ |
| 4434 | +_572=C.fromBackground(e); | ||
| 5656 | }else{ | 4435 | }else{ |
| 5657 | -if(!(_713 instanceof C)){ | ||
| 5658 | -_713=C.fromString(_713); | 4436 | +if(!(_572 instanceof C)){ |
| 4437 | +_572=C.fromString(_572); | ||
| 5659 | } | 4438 | } |
| 5660 | } | 4439 | } |
| 5661 | -this.isTransparent=(_713.asRGB().a<=0); | ||
| 5662 | -var _715=this.options.bgColor; | ||
| 5663 | -if(this.options.bgColor==="fromParent"){ | ||
| 5664 | -_715=C.fromBackground(e.offsetParent); | 4440 | +this.isTransparent=(_572.asRGB().a<=0); |
| 4441 | +var _574=this.options.bgColor; | ||
| 4442 | +if(this.options.bgColor=="fromParent"){ | ||
| 4443 | +_574=C.fromBackground(e.offsetParent); | ||
| 5665 | }else{ | 4444 | }else{ |
| 5666 | -if(!(_715 instanceof C)){ | ||
| 5667 | -_715=C.fromString(_715); | 4445 | +if(!(_574 instanceof C)){ |
| 4446 | +_574=C.fromString(_574); | ||
| 5668 | } | 4447 | } |
| 5669 | } | 4448 | } |
| 5670 | -this._roundCornersImpl(e,_713,_715); | 4449 | +this._roundCornersImpl(e,_572,_574); |
| 5671 | }; | 4450 | }; |
| 5672 | MochiKit.Visual._RoundCorners.prototype={_doWrap:function(e){ | 4451 | MochiKit.Visual._RoundCorners.prototype={_doWrap:function(e){ |
| 5673 | -var _716=e.parentNode; | 4452 | +var _575=e.parentNode; |
| 5674 | var doc=MochiKit.DOM.currentDocument(); | 4453 | var doc=MochiKit.DOM.currentDocument(); |
| 5675 | -if(typeof (doc.defaultView)==="undefined"||doc.defaultView===null){ | 4454 | +if(typeof (doc.defaultView)=="undefined"||doc.defaultView===null){ |
| 5676 | return e; | 4455 | return e; |
| 5677 | } | 4456 | } |
| 5678 | -var _717=doc.defaultView.getComputedStyle(e,null); | ||
| 5679 | -if(typeof (_717)==="undefined"||_717===null){ | 4457 | +var _576=doc.defaultView.getComputedStyle(e,null); |
| 4458 | +if(typeof (_576)=="undefined"||_576===null){ | ||
| 5680 | return e; | 4459 | return e; |
| 5681 | } | 4460 | } |
| 5682 | -var _718=MochiKit.DOM.DIV({"style":{display:"block",marginTop:_717.getPropertyValue("padding-top"),marginRight:_717.getPropertyValue("padding-right"),marginBottom:_717.getPropertyValue("padding-bottom"),marginLeft:_717.getPropertyValue("padding-left"),padding:"0px"}}); | ||
| 5683 | -_718.innerHTML=e.innerHTML; | 4461 | +var _577=MochiKit.DOM.DIV({"style":{display:"block",marginTop:_576.getPropertyValue("padding-top"),marginRight:_576.getPropertyValue("padding-right"),marginBottom:_576.getPropertyValue("padding-bottom"),marginLeft:_576.getPropertyValue("padding-left"),padding:"0px"}}); |
| 4462 | +_577.innerHTML=e.innerHTML; | ||
| 5684 | e.innerHTML=""; | 4463 | e.innerHTML=""; |
| 5685 | -e.appendChild(_718); | 4464 | +e.appendChild(_577); |
| 5686 | return e; | 4465 | return e; |
| 5687 | -},_roundCornersImpl:function(e,_719,_720){ | 4466 | +},_roundCornersImpl:function(e,_578,_579){ |
| 5688 | if(this.options.border){ | 4467 | if(this.options.border){ |
| 5689 | -this._renderBorder(e,_720); | 4468 | +this._renderBorder(e,_579); |
| 5690 | } | 4469 | } |
| 5691 | if(this._isTopRounded()){ | 4470 | if(this._isTopRounded()){ |
| 5692 | -this._roundTopCorners(e,_719,_720); | 4471 | +this._roundTopCorners(e,_578,_579); |
| 5693 | } | 4472 | } |
| 5694 | if(this._isBottomRounded()){ | 4473 | if(this._isBottomRounded()){ |
| 5695 | -this._roundBottomCorners(e,_719,_720); | ||
| 5696 | -} | ||
| 5697 | -},_renderBorder:function(el,_722){ | ||
| 5698 | -var _723="1px solid "+this._borderColor(_722); | ||
| 5699 | -var _724="border-left: "+_723; | ||
| 5700 | -var _725="border-right: "+_723; | ||
| 5701 | -var _726="style='"+_724+";"+_725+"'"; | ||
| 5702 | -el.innerHTML="<div "+_726+">"+el.innerHTML+"</div>"; | ||
| 5703 | -},_roundTopCorners:function(el,_727,_728){ | ||
| 5704 | -var _729=this._createCorner(_728); | 4474 | +this._roundBottomCorners(e,_578,_579); |
| 4475 | +} | ||
| 4476 | +},_renderBorder:function(el,_580){ | ||
| 4477 | +var _581="1px solid "+this._borderColor(_580); | ||
| 4478 | +var _582="border-left: "+_581; | ||
| 4479 | +var _583="border-right: "+_581; | ||
| 4480 | +var _584="style='"+_582+";"+_583+"'"; | ||
| 4481 | +el.innerHTML="<div "+_584+">"+el.innerHTML+"</div>"; | ||
| 4482 | +},_roundTopCorners:function(el,_585,_586){ | ||
| 4483 | +var _587=this._createCorner(_586); | ||
| 5705 | for(var i=0;i<this.options.numSlices;i++){ | 4484 | for(var i=0;i<this.options.numSlices;i++){ |
| 5706 | -_729.appendChild(this._createCornerSlice(_727,_728,i,"top")); | 4485 | +_587.appendChild(this._createCornerSlice(_585,_586,i,"top")); |
| 5707 | } | 4486 | } |
| 5708 | el.style.paddingTop=0; | 4487 | el.style.paddingTop=0; |
| 5709 | -el.insertBefore(_729,el.firstChild); | ||
| 5710 | -},_roundBottomCorners:function(el,_730,_731){ | ||
| 5711 | -var _732=this._createCorner(_731); | 4488 | +el.insertBefore(_587,el.firstChild); |
| 4489 | +},_roundBottomCorners:function(el,_588,_589){ | ||
| 4490 | +var _590=this._createCorner(_589); | ||
| 5712 | for(var i=(this.options.numSlices-1);i>=0;i--){ | 4491 | for(var i=(this.options.numSlices-1);i>=0;i--){ |
| 5713 | -_732.appendChild(this._createCornerSlice(_730,_731,i,"bottom")); | 4492 | +_590.appendChild(this._createCornerSlice(_588,_589,i,"bottom")); |
| 5714 | } | 4493 | } |
| 5715 | el.style.paddingBottom=0; | 4494 | el.style.paddingBottom=0; |
| 5716 | -el.appendChild(_732); | ||
| 5717 | -},_createCorner:function(_733){ | 4495 | +el.appendChild(_590); |
| 4496 | +},_createCorner:function(_591){ | ||
| 5718 | var dom=MochiKit.DOM; | 4497 | var dom=MochiKit.DOM; |
| 5719 | -return dom.DIV({style:{backgroundColor:_733.toString()}}); | ||
| 5720 | -},_createCornerSlice:function(_734,_735,n,_736){ | ||
| 5721 | -var _737=MochiKit.DOM.SPAN(); | ||
| 5722 | -var _738=_737.style; | ||
| 5723 | -_738.backgroundColor=_734.toString(); | ||
| 5724 | -_738.display="block"; | ||
| 5725 | -_738.height="1px"; | ||
| 5726 | -_738.overflow="hidden"; | ||
| 5727 | -_738.fontSize="1px"; | ||
| 5728 | -var _739=this._borderColor(_734,_735); | 4498 | +return dom.DIV({style:{backgroundColor:_591.toString()}}); |
| 4499 | +},_createCornerSlice:function(_592,_593,n,_594){ | ||
| 4500 | +var _595=MochiKit.DOM.SPAN(); | ||
| 4501 | +var _596=_595.style; | ||
| 4502 | +_596.backgroundColor=_592.toString(); | ||
| 4503 | +_596.display="block"; | ||
| 4504 | +_596.height="1px"; | ||
| 4505 | +_596.overflow="hidden"; | ||
| 4506 | +_596.fontSize="1px"; | ||
| 4507 | +var _597=this._borderColor(_592,_593); | ||
| 5729 | if(this.options.border&&n===0){ | 4508 | if(this.options.border&&n===0){ |
| 5730 | -_738.borderTopStyle="solid"; | ||
| 5731 | -_738.borderTopWidth="1px"; | ||
| 5732 | -_738.borderLeftWidth="0px"; | ||
| 5733 | -_738.borderRightWidth="0px"; | ||
| 5734 | -_738.borderBottomWidth="0px"; | ||
| 5735 | -_738.height="0px"; | ||
| 5736 | -_738.borderColor=_739.toString(); | 4509 | +_596.borderTopStyle="solid"; |
| 4510 | +_596.borderTopWidth="1px"; | ||
| 4511 | +_596.borderLeftWidth="0px"; | ||
| 4512 | +_596.borderRightWidth="0px"; | ||
| 4513 | +_596.borderBottomWidth="0px"; | ||
| 4514 | +_596.height="0px"; | ||
| 4515 | +_596.borderColor=_597.toString(); | ||
| 5737 | }else{ | 4516 | }else{ |
| 5738 | -if(_739){ | ||
| 5739 | -_738.borderColor=_739.toString(); | ||
| 5740 | -_738.borderStyle="solid"; | ||
| 5741 | -_738.borderWidth="0px 1px"; | 4517 | +if(_597){ |
| 4518 | +_596.borderColor=_597.toString(); | ||
| 4519 | +_596.borderStyle="solid"; | ||
| 4520 | +_596.borderWidth="0px 1px"; | ||
| 5742 | } | 4521 | } |
| 5743 | } | 4522 | } |
| 5744 | if(!this.options.compact&&(n==(this.options.numSlices-1))){ | 4523 | if(!this.options.compact&&(n==(this.options.numSlices-1))){ |
| 5745 | -_738.height="2px"; | 4524 | +_596.height="2px"; |
| 5746 | } | 4525 | } |
| 5747 | -this._setMargin(_737,n,_736); | ||
| 5748 | -this._setBorder(_737,n,_736); | ||
| 5749 | -return _737; | ||
| 5750 | -},_setOptions:function(_740){ | 4526 | +this._setMargin(_595,n,_594); |
| 4527 | +this._setBorder(_595,n,_594); | ||
| 4528 | +return _595; | ||
| 4529 | +},_setOptions:function(_598){ | ||
| 5751 | this.options={corners:"all",color:"fromElement",bgColor:"fromParent",blend:true,border:false,compact:false,__unstable__wrapElement:false}; | 4530 | this.options={corners:"all",color:"fromElement",bgColor:"fromParent",blend:true,border:false,compact:false,__unstable__wrapElement:false}; |
| 5752 | -MochiKit.Base.update(this.options,_740); | 4531 | +MochiKit.Base.update(this.options,_598); |
| 5753 | this.options.numSlices=(this.options.compact?2:4); | 4532 | this.options.numSlices=(this.options.compact?2:4); |
| 5754 | },_whichSideTop:function(){ | 4533 | },_whichSideTop:function(){ |
| 5755 | -var _741=this.options.corners; | ||
| 5756 | -if(this._hasString(_741,"all","top")){ | 4534 | +var _599=this.options.corners; |
| 4535 | +if(this._hasString(_599,"all","top")){ | ||
| 5757 | return ""; | 4536 | return ""; |
| 5758 | } | 4537 | } |
| 5759 | -var _742=(_741.indexOf("tl")!=-1); | ||
| 5760 | -var _743=(_741.indexOf("tr")!=-1); | ||
| 5761 | -if(_742&&_743){ | 4538 | +var _600=(_599.indexOf("tl")!=-1); |
| 4539 | +var _601=(_599.indexOf("tr")!=-1); | ||
| 4540 | +if(_600&&_601){ | ||
| 5762 | return ""; | 4541 | return ""; |
| 5763 | } | 4542 | } |
| 5764 | -if(_742){ | 4543 | +if(_600){ |
| 5765 | return "left"; | 4544 | return "left"; |
| 5766 | } | 4545 | } |
| 5767 | -if(_743){ | 4546 | +if(_601){ |
| 5768 | return "right"; | 4547 | return "right"; |
| 5769 | } | 4548 | } |
| 5770 | return ""; | 4549 | return ""; |
| 5771 | },_whichSideBottom:function(){ | 4550 | },_whichSideBottom:function(){ |
| 5772 | -var _744=this.options.corners; | ||
| 5773 | -if(this._hasString(_744,"all","bottom")){ | 4551 | +var _602=this.options.corners; |
| 4552 | +if(this._hasString(_602,"all","bottom")){ | ||
| 5774 | return ""; | 4553 | return ""; |
| 5775 | } | 4554 | } |
| 5776 | -var _745=(_744.indexOf("bl")!=-1); | ||
| 5777 | -var _746=(_744.indexOf("br")!=-1); | ||
| 5778 | -if(_745&&_746){ | 4555 | +var _603=(_602.indexOf("bl")!=-1); |
| 4556 | +var _604=(_602.indexOf("br")!=-1); | ||
| 4557 | +if(_603&&_604){ | ||
| 5779 | return ""; | 4558 | return ""; |
| 5780 | } | 4559 | } |
| 5781 | -if(_745){ | 4560 | +if(_603){ |
| 5782 | return "left"; | 4561 | return "left"; |
| 5783 | } | 4562 | } |
| 5784 | -if(_746){ | 4563 | +if(_604){ |
| 5785 | return "right"; | 4564 | return "right"; |
| 5786 | } | 4565 | } |
| 5787 | return ""; | 4566 | return ""; |
| 5788 | -},_borderColor:function(_747,_748){ | ||
| 5789 | -if(_747=="transparent"){ | ||
| 5790 | -return _748; | 4567 | +},_borderColor:function(_605,_606){ |
| 4568 | +if(_605=="transparent"){ | ||
| 4569 | +return _606; | ||
| 5791 | }else{ | 4570 | }else{ |
| 5792 | if(this.options.border){ | 4571 | if(this.options.border){ |
| 5793 | return this.options.border; | 4572 | return this.options.border; |
| 5794 | }else{ | 4573 | }else{ |
| 5795 | if(this.options.blend){ | 4574 | if(this.options.blend){ |
| 5796 | -return _748.blendedColor(_747); | 4575 | +return _606.blendedColor(_605); |
| 5797 | } | 4576 | } |
| 5798 | } | 4577 | } |
| 5799 | } | 4578 | } |
| 5800 | return ""; | 4579 | return ""; |
| 5801 | -},_setMargin:function(el,n,_749){ | ||
| 5802 | -var _750=this._marginSize(n)+"px"; | ||
| 5803 | -var _751=(_749=="top"?this._whichSideTop():this._whichSideBottom()); | ||
| 5804 | -var _752=el.style; | ||
| 5805 | -if(_751=="left"){ | ||
| 5806 | -_752.marginLeft=_750; | ||
| 5807 | -_752.marginRight="0px"; | 4580 | +},_setMargin:function(el,n,_607){ |
| 4581 | +var _608=this._marginSize(n)+"px"; | ||
| 4582 | +var _609=(_607=="top"?this._whichSideTop():this._whichSideBottom()); | ||
| 4583 | +var _610=el.style; | ||
| 4584 | +if(_609=="left"){ | ||
| 4585 | +_610.marginLeft=_608; | ||
| 4586 | +_610.marginRight="0px"; | ||
| 5808 | }else{ | 4587 | }else{ |
| 5809 | -if(_751=="right"){ | ||
| 5810 | -_752.marginRight=_750; | ||
| 5811 | -_752.marginLeft="0px"; | 4588 | +if(_609=="right"){ |
| 4589 | +_610.marginRight=_608; | ||
| 4590 | +_610.marginLeft="0px"; | ||
| 5812 | }else{ | 4591 | }else{ |
| 5813 | -_752.marginLeft=_750; | ||
| 5814 | -_752.marginRight=_750; | 4592 | +_610.marginLeft=_608; |
| 4593 | +_610.marginRight=_608; | ||
| 5815 | } | 4594 | } |
| 5816 | } | 4595 | } |
| 5817 | -},_setBorder:function(el,n,_753){ | ||
| 5818 | -var _754=this._borderSize(n)+"px"; | ||
| 5819 | -var _755=(_753=="top"?this._whichSideTop():this._whichSideBottom()); | ||
| 5820 | -var _756=el.style; | ||
| 5821 | -if(_755=="left"){ | ||
| 5822 | -_756.borderLeftWidth=_754; | ||
| 5823 | -_756.borderRightWidth="0px"; | 4596 | +},_setBorder:function(el,n,_611){ |
| 4597 | +var _612=this._borderSize(n)+"px"; | ||
| 4598 | +var _613=(_611=="top"?this._whichSideTop():this._whichSideBottom()); | ||
| 4599 | +var _614=el.style; | ||
| 4600 | +if(_613=="left"){ | ||
| 4601 | +_614.borderLeftWidth=_612; | ||
| 4602 | +_614.borderRightWidth="0px"; | ||
| 5824 | }else{ | 4603 | }else{ |
| 5825 | -if(_755=="right"){ | ||
| 5826 | -_756.borderRightWidth=_754; | ||
| 5827 | -_756.borderLeftWidth="0px"; | 4604 | +if(_613=="right"){ |
| 4605 | +_614.borderRightWidth=_612; | ||
| 4606 | +_614.borderLeftWidth="0px"; | ||
| 5828 | }else{ | 4607 | }else{ |
| 5829 | -_756.borderLeftWidth=_754; | ||
| 5830 | -_756.borderRightWidth=_754; | 4608 | +_614.borderLeftWidth=_612; |
| 4609 | +_614.borderRightWidth=_612; | ||
| 5831 | } | 4610 | } |
| 5832 | } | 4611 | } |
| 5833 | },_marginSize:function(n){ | 4612 | },_marginSize:function(n){ |
| @@ -5836,39 +4615,39 @@ return 0; | @@ -5836,39 +4615,39 @@ return 0; | ||
| 5836 | } | 4615 | } |
| 5837 | var o=this.options; | 4616 | var o=this.options; |
| 5838 | if(o.compact&&o.blend){ | 4617 | if(o.compact&&o.blend){ |
| 5839 | -var _757=[1,0]; | ||
| 5840 | -return _757[n]; | 4618 | +var _615=[1,0]; |
| 4619 | +return _615[n]; | ||
| 5841 | }else{ | 4620 | }else{ |
| 5842 | if(o.compact){ | 4621 | if(o.compact){ |
| 5843 | -var _758=[2,1]; | ||
| 5844 | -return _758[n]; | 4622 | +var _616=[2,1]; |
| 4623 | +return _616[n]; | ||
| 5845 | }else{ | 4624 | }else{ |
| 5846 | if(o.blend){ | 4625 | if(o.blend){ |
| 5847 | -var _759=[3,2,1,0]; | ||
| 5848 | -return _759[n]; | 4626 | +var _617=[3,2,1,0]; |
| 4627 | +return _617[n]; | ||
| 5849 | }else{ | 4628 | }else{ |
| 5850 | -var _760=[5,3,2,1]; | ||
| 5851 | -return _760[n]; | 4629 | +var _618=[5,3,2,1]; |
| 4630 | +return _618[n]; | ||
| 5852 | } | 4631 | } |
| 5853 | } | 4632 | } |
| 5854 | } | 4633 | } |
| 5855 | },_borderSize:function(n){ | 4634 | },_borderSize:function(n){ |
| 5856 | var o=this.options; | 4635 | var o=this.options; |
| 5857 | -var _761; | 4636 | +var _619; |
| 5858 | if(o.compact&&(o.blend||this.isTransparent)){ | 4637 | if(o.compact&&(o.blend||this.isTransparent)){ |
| 5859 | return 1; | 4638 | return 1; |
| 5860 | }else{ | 4639 | }else{ |
| 5861 | if(o.compact){ | 4640 | if(o.compact){ |
| 5862 | -_761=[1,0]; | 4641 | +_619=[1,0]; |
| 5863 | }else{ | 4642 | }else{ |
| 5864 | if(o.blend){ | 4643 | if(o.blend){ |
| 5865 | -_761=[2,1,1,1]; | 4644 | +_619=[2,1,1,1]; |
| 5866 | }else{ | 4645 | }else{ |
| 5867 | if(o.border){ | 4646 | if(o.border){ |
| 5868 | -_761=[0,2,0,0]; | 4647 | +_619=[0,2,0,0]; |
| 5869 | }else{ | 4648 | }else{ |
| 5870 | if(this.isTransparent){ | 4649 | if(this.isTransparent){ |
| 5871 | -_761=[5,3,2,1]; | 4650 | +_619=[5,3,2,1]; |
| 5872 | }else{ | 4651 | }else{ |
| 5873 | return 0; | 4652 | return 0; |
| 5874 | } | 4653 | } |
| @@ -5876,7 +4655,7 @@ return 0; | @@ -5876,7 +4655,7 @@ return 0; | ||
| 5876 | } | 4655 | } |
| 5877 | } | 4656 | } |
| 5878 | } | 4657 | } |
| 5879 | -return _761[n]; | 4658 | +return _619[n]; |
| 5880 | },_hasString:function(str){ | 4659 | },_hasString:function(str){ |
| 5881 | for(var i=1;i<arguments.length;i++){ | 4660 | for(var i=1;i<arguments.length;i++){ |
| 5882 | if(str.indexOf(arguments[i])!=-1){ | 4661 | if(str.indexOf(arguments[i])!=-1){ |
| @@ -5891,782 +4670,14 @@ return this._hasString(this.options.corners,"all","bottom","bl","br"); | @@ -5891,782 +4670,14 @@ return this._hasString(this.options.corners,"all","bottom","bl","br"); | ||
| 5891 | },_hasSingleTextChild:function(el){ | 4670 | },_hasSingleTextChild:function(el){ |
| 5892 | return (el.childNodes.length==1&&el.childNodes[0].nodeType==3); | 4671 | return (el.childNodes.length==1&&el.childNodes[0].nodeType==3); |
| 5893 | }}; | 4672 | }}; |
| 5894 | -MochiKit.Visual.roundElement=function(e,_762){ | ||
| 5895 | -new MochiKit.Visual._RoundCorners(e,_762); | ||
| 5896 | -}; | ||
| 5897 | -MochiKit.Visual.roundClass=function(_763,_764,_765){ | ||
| 5898 | -var _766=MochiKit.DOM.getElementsByTagAndClassName(_763,_764); | ||
| 5899 | -for(var i=0;i<_766.length;i++){ | ||
| 5900 | -MochiKit.Visual.roundElement(_766[i],_765); | ||
| 5901 | -} | ||
| 5902 | -}; | ||
| 5903 | -MochiKit.Visual.tagifyText=function(_767,_768){ | ||
| 5904 | -var _768=_768||"position:relative"; | ||
| 5905 | -if(/MSIE/.test(navigator.userAgent)){ | ||
| 5906 | -_768+=";zoom:1"; | ||
| 5907 | -} | ||
| 5908 | -_767=MochiKit.DOM.getElement(_767); | ||
| 5909 | -var ma=MochiKit.Base.map; | ||
| 5910 | -ma(function(_770){ | ||
| 5911 | -if(_770.nodeType==3){ | ||
| 5912 | -ma(function(_771){ | ||
| 5913 | -_767.insertBefore(MochiKit.DOM.SPAN({style:_768},_771==" "?String.fromCharCode(160):_771),_770); | ||
| 5914 | -},_770.nodeValue.split("")); | ||
| 5915 | -MochiKit.DOM.removeElement(_770); | ||
| 5916 | -} | ||
| 5917 | -},_767.childNodes); | ||
| 5918 | -}; | ||
| 5919 | -MochiKit.Visual.forceRerendering=function(_772){ | ||
| 5920 | -try{ | ||
| 5921 | -_772=MochiKit.DOM.getElement(_772); | ||
| 5922 | -var n=document.createTextNode(" "); | ||
| 5923 | -_772.appendChild(n); | ||
| 5924 | -_772.removeChild(n); | ||
| 5925 | -} | ||
| 5926 | -catch(e){ | ||
| 5927 | -} | ||
| 5928 | -}; | ||
| 5929 | -MochiKit.Visual.multiple=function(_773,_774,_775){ | ||
| 5930 | -_775=MochiKit.Base.update({speed:0.1,delay:0},_775||{}); | ||
| 5931 | -var _776=_775.delay; | ||
| 5932 | -var _777=0; | ||
| 5933 | -MochiKit.Base.map(function(_778){ | ||
| 5934 | -_775.delay=_777*_775.speed+_776; | ||
| 5935 | -new _774(_778,_775); | ||
| 5936 | -_777+=1; | ||
| 5937 | -},_773); | ||
| 5938 | -}; | ||
| 5939 | -MochiKit.Visual.PAIRS={"slide":["slideDown","slideUp"],"blind":["blindDown","blindUp"],"appear":["appear","fade"],"size":["grow","shrink"]}; | ||
| 5940 | -MochiKit.Visual.toggle=function(_779,_780,_781){ | ||
| 5941 | -_779=MochiKit.DOM.getElement(_779); | ||
| 5942 | -_780=(_780||"appear").toLowerCase(); | ||
| 5943 | -_781=MochiKit.Base.update({queue:{position:"end",scope:(_779.id||"global"),limit:1}},_781||{}); | ||
| 5944 | -var v=MochiKit.Visual; | ||
| 5945 | -v[_779.style.display!="none"?v.PAIRS[_780][1]:v.PAIRS[_780][0]](_779,_781); | ||
| 5946 | -}; | ||
| 5947 | -MochiKit.Visual.Transitions={}; | ||
| 5948 | -MochiKit.Visual.Transitions.linear=function(pos){ | ||
| 5949 | -return pos; | ||
| 5950 | -}; | ||
| 5951 | -MochiKit.Visual.Transitions.sinoidal=function(pos){ | ||
| 5952 | -return (-Math.cos(pos*Math.PI)/2)+0.5; | ||
| 5953 | -}; | ||
| 5954 | -MochiKit.Visual.Transitions.reverse=function(pos){ | ||
| 5955 | -return 1-pos; | ||
| 5956 | -}; | ||
| 5957 | -MochiKit.Visual.Transitions.flicker=function(pos){ | ||
| 5958 | -return ((-Math.cos(pos*Math.PI)/4)+0.75)+Math.random()/4; | ||
| 5959 | -}; | ||
| 5960 | -MochiKit.Visual.Transitions.wobble=function(pos){ | ||
| 5961 | -return (-Math.cos(pos*Math.PI*(9*pos))/2)+0.5; | ||
| 5962 | -}; | ||
| 5963 | -MochiKit.Visual.Transitions.pulse=function(pos){ | ||
| 5964 | -return (Math.floor(pos*10)%2==0?(pos*10-Math.floor(pos*10)):1-(pos*10-Math.floor(pos*10))); | ||
| 5965 | -}; | ||
| 5966 | -MochiKit.Visual.Transitions.none=function(pos){ | ||
| 5967 | -return 0; | ||
| 5968 | -}; | ||
| 5969 | -MochiKit.Visual.Transitions.full=function(pos){ | ||
| 5970 | -return 1; | ||
| 5971 | -}; | ||
| 5972 | -MochiKit.Visual.ScopedQueue=function(){ | ||
| 5973 | -var cls=arguments.callee; | ||
| 5974 | -if(!(this instanceof cls)){ | ||
| 5975 | -return new cls(); | ||
| 5976 | -} | ||
| 5977 | -this.__init__(); | ||
| 5978 | -}; | ||
| 5979 | -MochiKit.Base.update(MochiKit.Visual.ScopedQueue.prototype,{__init__:function(){ | ||
| 5980 | -this.effects=[]; | ||
| 5981 | -this.interval=null; | ||
| 5982 | -},add:function(_782){ | ||
| 5983 | -var _783=new Date().getTime(); | ||
| 5984 | -var _784=(typeof (_782.options.queue)=="string")?_782.options.queue:_782.options.queue.position; | ||
| 5985 | -var ma=MochiKit.Base.map; | ||
| 5986 | -switch(_784){ | ||
| 5987 | -case "front": | ||
| 5988 | -ma(function(e){ | ||
| 5989 | -if(e.state=="idle"){ | ||
| 5990 | -e.startOn+=_782.finishOn; | ||
| 5991 | -e.finishOn+=_782.finishOn; | ||
| 5992 | -} | ||
| 5993 | -},this.effects); | ||
| 5994 | -break; | ||
| 5995 | -case "end": | ||
| 5996 | -var _785; | ||
| 5997 | -ma(function(e){ | ||
| 5998 | -var i=e.finishOn; | ||
| 5999 | -if(i>=(_785||i)){ | ||
| 6000 | -_785=i; | ||
| 6001 | -} | ||
| 6002 | -},this.effects); | ||
| 6003 | -_783=_785||_783; | ||
| 6004 | -break; | ||
| 6005 | -case "break": | ||
| 6006 | -ma(function(e){ | ||
| 6007 | -e.finalize(); | ||
| 6008 | -},this.effects); | ||
| 6009 | -break; | ||
| 6010 | -} | ||
| 6011 | -_782.startOn+=_783; | ||
| 6012 | -_782.finishOn+=_783; | ||
| 6013 | -if(!_782.options.queue.limit||this.effects.length<_782.options.queue.limit){ | ||
| 6014 | -this.effects.push(_782); | ||
| 6015 | -} | ||
| 6016 | -if(!this.interval){ | ||
| 6017 | -this.interval=this.startLoop(MochiKit.Base.bind(this.loop,this),40); | ||
| 6018 | -} | ||
| 6019 | -},startLoop:function(func,_786){ | ||
| 6020 | -return setInterval(func,_786); | ||
| 6021 | -},remove:function(_787){ | ||
| 6022 | -this.effects=MochiKit.Base.filter(function(e){ | ||
| 6023 | -return e!=_787; | ||
| 6024 | -},this.effects); | ||
| 6025 | -if(this.effects.length==0){ | ||
| 6026 | -this.stopLoop(this.interval); | ||
| 6027 | -this.interval=null; | ||
| 6028 | -} | ||
| 6029 | -},stopLoop:function(_788){ | ||
| 6030 | -clearInterval(_788); | ||
| 6031 | -},loop:function(){ | ||
| 6032 | -var _789=new Date().getTime(); | ||
| 6033 | -MochiKit.Base.map(function(_790){ | ||
| 6034 | -_790.loop(_789); | ||
| 6035 | -},this.effects); | ||
| 6036 | -}}); | ||
| 6037 | -MochiKit.Visual.Queues={instances:{},get:function(_791){ | ||
| 6038 | -if(typeof (_791)!="string"){ | ||
| 6039 | -return _791; | ||
| 6040 | -} | ||
| 6041 | -if(!this.instances[_791]){ | ||
| 6042 | -this.instances[_791]=new MochiKit.Visual.ScopedQueue(); | ||
| 6043 | -} | ||
| 6044 | -return this.instances[_791]; | ||
| 6045 | -}}; | ||
| 6046 | -MochiKit.Visual.Queue=MochiKit.Visual.Queues.get("global"); | ||
| 6047 | -MochiKit.Visual.DefaultOptions={transition:MochiKit.Visual.Transitions.sinoidal,duration:1,fps:25,sync:false,from:0,to:1,delay:0,queue:"parallel"}; | ||
| 6048 | -MochiKit.Visual.Base=function(){ | ||
| 6049 | -}; | ||
| 6050 | -MochiKit.Visual.Base.prototype={__class__:MochiKit.Visual.Base,start:function(_792){ | ||
| 6051 | -var v=MochiKit.Visual; | ||
| 6052 | -this.options=MochiKit.Base.setdefault(_792||{},v.DefaultOptions); | ||
| 6053 | -this.currentFrame=0; | ||
| 6054 | -this.state="idle"; | ||
| 6055 | -this.startOn=this.options.delay*1000; | ||
| 6056 | -this.finishOn=this.startOn+(this.options.duration*1000); | ||
| 6057 | -this.event("beforeStart"); | ||
| 6058 | -if(!this.options.sync){ | ||
| 6059 | -v.Queues.get(typeof (this.options.queue)=="string"?"global":this.options.queue.scope).add(this); | ||
| 6060 | -} | ||
| 6061 | -},loop:function(_793){ | ||
| 6062 | -if(_793>=this.startOn){ | ||
| 6063 | -if(_793>=this.finishOn){ | ||
| 6064 | -return this.finalize(); | ||
| 6065 | -} | ||
| 6066 | -var pos=(_793-this.startOn)/(this.finishOn-this.startOn); | ||
| 6067 | -var _794=Math.round(pos*this.options.fps*this.options.duration); | ||
| 6068 | -if(_794>this.currentFrame){ | ||
| 6069 | -this.render(pos); | ||
| 6070 | -this.currentFrame=_794; | ||
| 6071 | -} | ||
| 6072 | -} | ||
| 6073 | -},render:function(pos){ | ||
| 6074 | -if(this.state=="idle"){ | ||
| 6075 | -this.state="running"; | ||
| 6076 | -this.event("beforeSetup"); | ||
| 6077 | -this.setup(); | ||
| 6078 | -this.event("afterSetup"); | ||
| 6079 | -} | ||
| 6080 | -if(this.state=="running"){ | ||
| 6081 | -if(this.options.transition){ | ||
| 6082 | -pos=this.options.transition(pos); | ||
| 6083 | -} | ||
| 6084 | -pos*=(this.options.to-this.options.from); | ||
| 6085 | -pos+=this.options.from; | ||
| 6086 | -this.event("beforeUpdate"); | ||
| 6087 | -this.update(pos); | ||
| 6088 | -this.event("afterUpdate"); | ||
| 6089 | -} | ||
| 6090 | -},cancel:function(){ | ||
| 6091 | -if(!this.options.sync){ | ||
| 6092 | -MochiKit.Visual.Queues.get(typeof (this.options.queue)=="string"?"global":this.options.queue.scope).remove(this); | ||
| 6093 | -} | ||
| 6094 | -this.state="finished"; | ||
| 6095 | -},finalize:function(){ | ||
| 6096 | -this.render(1); | ||
| 6097 | -this.cancel(); | ||
| 6098 | -this.event("beforeFinish"); | ||
| 6099 | -this.finish(); | ||
| 6100 | -this.event("afterFinish"); | ||
| 6101 | -},setup:function(){ | ||
| 6102 | -},finish:function(){ | ||
| 6103 | -},update:function(_795){ | ||
| 6104 | -},event:function(_796){ | ||
| 6105 | -if(this.options[_796+"Internal"]){ | ||
| 6106 | -this.options[_796+"Internal"](this); | ||
| 6107 | -} | ||
| 6108 | -if(this.options[_796]){ | ||
| 6109 | -this.options[_796](this); | ||
| 6110 | -} | ||
| 6111 | -},repr:function(){ | ||
| 6112 | -return "["+this.__class__.NAME+", options:"+MochiKit.Base.repr(this.options)+"]"; | ||
| 6113 | -}}; | ||
| 6114 | -MochiKit.Visual.Parallel=function(_797,_798){ | ||
| 6115 | -var cls=arguments.callee; | ||
| 6116 | -if(!(this instanceof cls)){ | ||
| 6117 | -return new cls(_797,_798); | ||
| 6118 | -} | ||
| 6119 | -this.__init__(_797,_798); | ||
| 6120 | -}; | ||
| 6121 | -MochiKit.Visual.Parallel.prototype=new MochiKit.Visual.Base(); | ||
| 6122 | -MochiKit.Base.update(MochiKit.Visual.Parallel.prototype,{__init__:function(_799,_800){ | ||
| 6123 | -this.effects=_799||[]; | ||
| 6124 | -this.start(_800); | ||
| 6125 | -},update:function(_801){ | ||
| 6126 | -MochiKit.Base.map(function(_802){ | ||
| 6127 | -_802.render(_801); | ||
| 6128 | -},this.effects); | ||
| 6129 | -},finish:function(){ | ||
| 6130 | -MochiKit.Base.map(function(_803){ | ||
| 6131 | -_803.finalize(); | ||
| 6132 | -},this.effects); | ||
| 6133 | -}}); | ||
| 6134 | -MochiKit.Visual.Opacity=function(_804,_805){ | ||
| 6135 | -var cls=arguments.callee; | ||
| 6136 | -if(!(this instanceof cls)){ | ||
| 6137 | -return new cls(_804,_805); | ||
| 6138 | -} | ||
| 6139 | -this.__init__(_804,_805); | ||
| 6140 | -}; | ||
| 6141 | -MochiKit.Visual.Opacity.prototype=new MochiKit.Visual.Base(); | ||
| 6142 | -MochiKit.Base.update(MochiKit.Visual.Opacity.prototype,{__init__:function(_806,_807){ | ||
| 6143 | -var b=MochiKit.Base; | ||
| 6144 | -var s=MochiKit.Style; | ||
| 6145 | -this.element=MochiKit.DOM.getElement(_806); | ||
| 6146 | -if(this.element.currentStyle&&(!this.element.currentStyle.hasLayout)){ | ||
| 6147 | -s.setStyle(this.element,{zoom:1}); | ||
| 6148 | -} | ||
| 6149 | -_807=b.update({from:s.getStyle(this.element,"opacity")||0,to:1},_807||{}); | ||
| 6150 | -this.start(_807); | ||
| 6151 | -},update:function(_808){ | ||
| 6152 | -MochiKit.Style.setStyle(this.element,{"opacity":_808}); | ||
| 6153 | -}}); | ||
| 6154 | -MochiKit.Visual.Move=function(_809,_810){ | ||
| 6155 | -var cls=arguments.callee; | ||
| 6156 | -if(!(this instanceof cls)){ | ||
| 6157 | -return new cls(_809,_810); | ||
| 6158 | -} | ||
| 6159 | -this.__init__(_809,_810); | ||
| 6160 | -}; | ||
| 6161 | -MochiKit.Visual.Move.prototype=new MochiKit.Visual.Base(); | ||
| 6162 | -MochiKit.Base.update(MochiKit.Visual.Move.prototype,{__init__:function(_811,_812){ | ||
| 6163 | -this.element=MochiKit.DOM.getElement(_811); | ||
| 6164 | -_812=MochiKit.Base.update({x:0,y:0,mode:"relative"},_812||{}); | ||
| 6165 | -this.start(_812); | ||
| 6166 | -},setup:function(){ | ||
| 6167 | -MochiKit.DOM.makePositioned(this.element); | ||
| 6168 | -var s=this.element.style; | ||
| 6169 | -var _813=s.visibility; | ||
| 6170 | -var _814=s.display; | ||
| 6171 | -if(_814=="none"){ | ||
| 6172 | -s.visibility="hidden"; | ||
| 6173 | -s.display=""; | ||
| 6174 | -} | ||
| 6175 | -this.originalLeft=parseFloat(MochiKit.Style.getStyle(this.element,"left")||"0"); | ||
| 6176 | -this.originalTop=parseFloat(MochiKit.Style.getStyle(this.element,"top")||"0"); | ||
| 6177 | -if(this.options.mode=="absolute"){ | ||
| 6178 | -this.options.x-=this.originalLeft; | ||
| 6179 | -this.options.y-=this.originalTop; | ||
| 6180 | -} | ||
| 6181 | -if(_814=="none"){ | ||
| 6182 | -s.visibility=_813; | ||
| 6183 | -s.display=_814; | ||
| 6184 | -} | ||
| 6185 | -},update:function(_815){ | ||
| 6186 | -MochiKit.Style.setStyle(this.element,{left:Math.round(this.options.x*_815+this.originalLeft)+"px",top:Math.round(this.options.y*_815+this.originalTop)+"px"}); | ||
| 6187 | -}}); | ||
| 6188 | -MochiKit.Visual.Scale=function(_816,_817,_818){ | ||
| 6189 | -var cls=arguments.callee; | ||
| 6190 | -if(!(this instanceof cls)){ | ||
| 6191 | -return new cls(_816,_817,_818); | ||
| 6192 | -} | ||
| 6193 | -this.__init__(_816,_817,_818); | ||
| 6194 | -}; | ||
| 6195 | -MochiKit.Visual.Scale.prototype=new MochiKit.Visual.Base(); | ||
| 6196 | -MochiKit.Base.update(MochiKit.Visual.Scale.prototype,{__init__:function(_819,_820,_821){ | ||
| 6197 | -this.element=MochiKit.DOM.getElement(_819); | ||
| 6198 | -_821=MochiKit.Base.update({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:_820},_821||{}); | ||
| 6199 | -this.start(_821); | ||
| 6200 | -},setup:function(){ | ||
| 6201 | -this.restoreAfterFinish=this.options.restoreAfterFinish||false; | ||
| 6202 | -this.elementPositioning=MochiKit.Style.getStyle(this.element,"position"); | ||
| 6203 | -var ma=MochiKit.Base.map; | ||
| 6204 | -var b=MochiKit.Base.bind; | ||
| 6205 | -this.originalStyle={}; | ||
| 6206 | -ma(b(function(k){ | ||
| 6207 | -this.originalStyle[k]=this.element.style[k]; | ||
| 6208 | -},this),["top","left","width","height","fontSize"]); | ||
| 6209 | -this.originalTop=this.element.offsetTop; | ||
| 6210 | -this.originalLeft=this.element.offsetLeft; | ||
| 6211 | -var _822=MochiKit.Style.getStyle(this.element,"font-size")||"100%"; | ||
| 6212 | -ma(b(function(_823){ | ||
| 6213 | -if(_822.indexOf(_823)>0){ | ||
| 6214 | -this.fontSize=parseFloat(_822); | ||
| 6215 | -this.fontSizeType=_823; | ||
| 6216 | -} | ||
| 6217 | -},this),["em","px","%"]); | ||
| 6218 | -this.factor=(this.options.scaleTo-this.options.scaleFrom)/100; | ||
| 6219 | -if(/^content/.test(this.options.scaleMode)){ | ||
| 6220 | -this.dims=[this.element.scrollHeight,this.element.scrollWidth]; | ||
| 6221 | -}else{ | ||
| 6222 | -if(this.options.scaleMode=="box"){ | ||
| 6223 | -this.dims=[this.element.offsetHeight,this.element.offsetWidth]; | ||
| 6224 | -}else{ | ||
| 6225 | -this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth]; | ||
| 6226 | -} | ||
| 6227 | -} | ||
| 6228 | -},update:function(_824){ | ||
| 6229 | -var _825=(this.options.scaleFrom/100)+(this.factor*_824); | ||
| 6230 | -if(this.options.scaleContent&&this.fontSize){ | ||
| 6231 | -MochiKit.Style.setStyle(this.element,{fontSize:this.fontSize*_825+this.fontSizeType}); | ||
| 6232 | -} | ||
| 6233 | -this.setDimensions(this.dims[0]*_825,this.dims[1]*_825); | ||
| 6234 | -},finish:function(){ | ||
| 6235 | -if(this.restoreAfterFinish){ | ||
| 6236 | -MochiKit.Style.setStyle(this.element,this.originalStyle); | ||
| 6237 | -} | ||
| 6238 | -},setDimensions:function(_826,_827){ | ||
| 6239 | -var d={}; | ||
| 6240 | -var r=Math.round; | ||
| 6241 | -if(/MSIE/.test(navigator.userAgent)){ | ||
| 6242 | -r=Math.ceil; | ||
| 6243 | -} | ||
| 6244 | -if(this.options.scaleX){ | ||
| 6245 | -d.width=r(_827)+"px"; | ||
| 6246 | -} | ||
| 6247 | -if(this.options.scaleY){ | ||
| 6248 | -d.height=r(_826)+"px"; | ||
| 6249 | -} | ||
| 6250 | -if(this.options.scaleFromCenter){ | ||
| 6251 | -var topd=(_826-this.dims[0])/2; | ||
| 6252 | -var _829=(_827-this.dims[1])/2; | ||
| 6253 | -if(this.elementPositioning=="absolute"){ | ||
| 6254 | -if(this.options.scaleY){ | ||
| 6255 | -d.top=this.originalTop-topd+"px"; | ||
| 6256 | -} | ||
| 6257 | -if(this.options.scaleX){ | ||
| 6258 | -d.left=this.originalLeft-_829+"px"; | ||
| 6259 | -} | ||
| 6260 | -}else{ | ||
| 6261 | -if(this.options.scaleY){ | ||
| 6262 | -d.top=-topd+"px"; | ||
| 6263 | -} | ||
| 6264 | -if(this.options.scaleX){ | ||
| 6265 | -d.left=-_829+"px"; | ||
| 6266 | -} | ||
| 6267 | -} | ||
| 6268 | -} | ||
| 6269 | -MochiKit.Style.setStyle(this.element,d); | ||
| 6270 | -}}); | ||
| 6271 | -MochiKit.Visual.Highlight=function(_830,_831){ | ||
| 6272 | -var cls=arguments.callee; | ||
| 6273 | -if(!(this instanceof cls)){ | ||
| 6274 | -return new cls(_830,_831); | ||
| 6275 | -} | ||
| 6276 | -this.__init__(_830,_831); | ||
| 6277 | -}; | ||
| 6278 | -MochiKit.Visual.Highlight.prototype=new MochiKit.Visual.Base(); | ||
| 6279 | -MochiKit.Base.update(MochiKit.Visual.Highlight.prototype,{__init__:function(_832,_833){ | ||
| 6280 | -this.element=MochiKit.DOM.getElement(_832); | ||
| 6281 | -_833=MochiKit.Base.update({startcolor:"#ffff99"},_833||{}); | ||
| 6282 | -this.start(_833); | ||
| 6283 | -},setup:function(){ | ||
| 6284 | -var b=MochiKit.Base; | ||
| 6285 | -var s=MochiKit.Style; | ||
| 6286 | -if(s.getStyle(this.element,"display")=="none"){ | ||
| 6287 | -this.cancel(); | ||
| 6288 | -return; | ||
| 6289 | -} | ||
| 6290 | -this.oldStyle={backgroundImage:s.getStyle(this.element,"background-image")}; | ||
| 6291 | -s.setStyle(this.element,{backgroundImage:"none"}); | ||
| 6292 | -if(!this.options.endcolor){ | ||
| 6293 | -this.options.endcolor=MochiKit.Color.Color.fromBackground(this.element).toHexString(); | ||
| 6294 | -} | ||
| 6295 | -if(b.isUndefinedOrNull(this.options.restorecolor)){ | ||
| 6296 | -this.options.restorecolor=s.getStyle(this.element,"background-color"); | ||
| 6297 | -} | ||
| 6298 | -this._base=b.map(b.bind(function(i){ | ||
| 6299 | -return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16); | ||
| 6300 | -},this),[0,1,2]); | ||
| 6301 | -this._delta=b.map(b.bind(function(i){ | ||
| 6302 | -return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i]; | ||
| 6303 | -},this),[0,1,2]); | ||
| 6304 | -},update:function(_834){ | ||
| 6305 | -var m="#"; | ||
| 6306 | -MochiKit.Base.map(MochiKit.Base.bind(function(i){ | ||
| 6307 | -m+=MochiKit.Color.toColorPart(Math.round(this._base[i]+this._delta[i]*_834)); | ||
| 6308 | -},this),[0,1,2]); | ||
| 6309 | -MochiKit.Style.setStyle(this.element,{backgroundColor:m}); | ||
| 6310 | -},finish:function(){ | ||
| 6311 | -MochiKit.Style.setStyle(this.element,MochiKit.Base.update(this.oldStyle,{backgroundColor:this.options.restorecolor})); | ||
| 6312 | -}}); | ||
| 6313 | -MochiKit.Visual.ScrollTo=function(_835,_836){ | ||
| 6314 | -var cls=arguments.callee; | ||
| 6315 | -if(!(this instanceof cls)){ | ||
| 6316 | -return new cls(_835,_836); | ||
| 6317 | -} | ||
| 6318 | -this.__init__(_835,_836); | ||
| 6319 | -}; | ||
| 6320 | -MochiKit.Visual.ScrollTo.prototype=new MochiKit.Visual.Base(); | ||
| 6321 | -MochiKit.Base.update(MochiKit.Visual.ScrollTo.prototype,{__init__:function(_837,_838){ | ||
| 6322 | -this.element=MochiKit.DOM.getElement(_837); | ||
| 6323 | -this.start(_838||{}); | ||
| 6324 | -},setup:function(){ | ||
| 6325 | -var p=MochiKit.Position; | ||
| 6326 | -p.prepare(); | ||
| 6327 | -var _839=p.cumulativeOffset(this.element); | ||
| 6328 | -if(this.options.offset){ | ||
| 6329 | -_839.y+=this.options.offset; | ||
| 6330 | -} | ||
| 6331 | -var max; | ||
| 6332 | -if(window.innerHeight){ | ||
| 6333 | -max=window.innerHeight-window.height; | ||
| 6334 | -}else{ | ||
| 6335 | -if(document.documentElement&&document.documentElement.clientHeight){ | ||
| 6336 | -max=document.documentElement.clientHeight-document.body.scrollHeight; | ||
| 6337 | -}else{ | ||
| 6338 | -if(document.body){ | ||
| 6339 | -max=document.body.clientHeight-document.body.scrollHeight; | ||
| 6340 | -} | ||
| 6341 | -} | ||
| 6342 | -} | ||
| 6343 | -this.scrollStart=p.windowOffset.y; | ||
| 6344 | -this.delta=(_839.y>max?max:_839.y)-this.scrollStart; | ||
| 6345 | -},update:function(_840){ | ||
| 6346 | -var p=MochiKit.Position; | ||
| 6347 | -p.prepare(); | ||
| 6348 | -window.scrollTo(p.windowOffset.x,this.scrollStart+(_840*this.delta)); | ||
| 6349 | -}}); | ||
| 6350 | -MochiKit.Visual.fade=function(_841,_842){ | ||
| 6351 | -var s=MochiKit.Style; | ||
| 6352 | -var _843=s.getStyle(_841,"opacity"); | ||
| 6353 | -_842=MochiKit.Base.update({from:s.getStyle(_841,"opacity")||1,to:0,afterFinishInternal:function(_844){ | ||
| 6354 | -if(_844.options.to!==0){ | ||
| 6355 | -return; | ||
| 6356 | -} | ||
| 6357 | -s.hideElement(_844.element); | ||
| 6358 | -s.setStyle(_844.element,{"opacity":_843}); | ||
| 6359 | -}},_842||{}); | ||
| 6360 | -return new MochiKit.Visual.Opacity(_841,_842); | ||
| 6361 | -}; | ||
| 6362 | -MochiKit.Visual.appear=function(_845,_846){ | ||
| 6363 | -var s=MochiKit.Style; | ||
| 6364 | -var v=MochiKit.Visual; | ||
| 6365 | -_846=MochiKit.Base.update({from:(s.getStyle(_845,"display")=="none"?0:s.getStyle(_845,"opacity")||0),to:1,afterFinishInternal:function(_847){ | ||
| 6366 | -v.forceRerendering(_847.element); | ||
| 6367 | -},beforeSetupInternal:function(_848){ | ||
| 6368 | -s.setStyle(_848.element,{"opacity":_848.options.from}); | ||
| 6369 | -s.showElement(_848.element); | ||
| 6370 | -}},_846||{}); | ||
| 6371 | -return new v.Opacity(_845,_846); | ||
| 6372 | -}; | ||
| 6373 | -MochiKit.Visual.puff=function(_849,_850){ | ||
| 6374 | -var s=MochiKit.Style; | ||
| 6375 | -var v=MochiKit.Visual; | ||
| 6376 | -_849=MochiKit.DOM.getElement(_849); | ||
| 6377 | -var _851={position:s.getStyle(_849,"position"),top:_849.style.top,left:_849.style.left,width:_849.style.width,height:_849.style.height,opacity:s.getStyle(_849,"opacity")}; | ||
| 6378 | -_850=MochiKit.Base.update({beforeSetupInternal:function(_852){ | ||
| 6379 | -MochiKit.Position.absolutize(_852.effects[0].element); | ||
| 6380 | -},afterFinishInternal:function(_853){ | ||
| 6381 | -s.hideElement(_853.effects[0].element); | ||
| 6382 | -s.setStyle(_853.effects[0].element,_851); | ||
| 6383 | -}},_850||{}); | ||
| 6384 | -return new v.Parallel([new v.Scale(_849,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new v.Opacity(_849,{sync:true,to:0})],_850); | ||
| 6385 | -}; | ||
| 6386 | -MochiKit.Visual.blindUp=function(_854,_855){ | ||
| 6387 | -var d=MochiKit.DOM; | ||
| 6388 | -_854=d.getElement(_854); | ||
| 6389 | -var _856=d.makeClipping(_854); | ||
| 6390 | -_855=MochiKit.Base.update({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(_857){ | ||
| 6391 | -MochiKit.Style.hideElement(_857.element); | ||
| 6392 | -d.undoClipping(_857.element,_856); | ||
| 6393 | -}},_855||{}); | ||
| 6394 | -return new MochiKit.Visual.Scale(_854,0,_855); | ||
| 6395 | -}; | ||
| 6396 | -MochiKit.Visual.blindDown=function(_858,_859){ | ||
| 6397 | -var d=MochiKit.DOM; | ||
| 6398 | -var s=MochiKit.Style; | ||
| 6399 | -_858=d.getElement(_858); | ||
| 6400 | -var _860=s.getElementDimensions(_858); | ||
| 6401 | -var _861; | ||
| 6402 | -_859=MochiKit.Base.update({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_860.h,originalWidth:_860.w},restoreAfterFinish:true,afterSetupInternal:function(_862){ | ||
| 6403 | -_861=d.makeClipping(_862.element); | ||
| 6404 | -s.setStyle(_862.element,{height:"0px"}); | ||
| 6405 | -s.showElement(_862.element); | ||
| 6406 | -},afterFinishInternal:function(_863){ | ||
| 6407 | -d.undoClipping(_863.element,_861); | ||
| 6408 | -}},_859||{}); | ||
| 6409 | -return new MochiKit.Visual.Scale(_858,100,_859); | ||
| 6410 | -}; | ||
| 6411 | -MochiKit.Visual.switchOff=function(_864,_865){ | ||
| 6412 | -var d=MochiKit.DOM; | ||
| 6413 | -_864=d.getElement(_864); | ||
| 6414 | -var _866=MochiKit.Style.getStyle(_864,"opacity"); | ||
| 6415 | -var _867; | ||
| 6416 | -var _865=MochiKit.Base.update({duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetupInternal:function(_868){ | ||
| 6417 | -d.makePositioned(_868.element); | ||
| 6418 | -_867=d.makeClipping(_868.element); | ||
| 6419 | -},afterFinishInternal:function(_869){ | ||
| 6420 | -MochiKit.Style.hideElement(_869.element); | ||
| 6421 | -d.undoClipping(_869.element,_867); | ||
| 6422 | -d.undoPositioned(_869.element); | ||
| 6423 | -MochiKit.Style.setStyle(_869.element,{"opacity":_866}); | ||
| 6424 | -}},_865||{}); | ||
| 6425 | -var v=MochiKit.Visual; | ||
| 6426 | -return new v.appear(_864,{duration:0.4,from:0,transition:v.Transitions.flicker,afterFinishInternal:function(_870){ | ||
| 6427 | -new v.Scale(_870.element,1,_865); | ||
| 6428 | -}}); | ||
| 6429 | -}; | ||
| 6430 | -MochiKit.Visual.dropOut=function(_871,_872){ | ||
| 6431 | -var d=MochiKit.DOM; | ||
| 6432 | -var s=MochiKit.Style; | ||
| 6433 | -_871=d.getElement(_871); | ||
| 6434 | -var _873={top:s.getStyle(_871,"top"),left:s.getStyle(_871,"left"),opacity:s.getStyle(_871,"opacity")}; | ||
| 6435 | -_872=MochiKit.Base.update({duration:0.5,distance:100,beforeSetupInternal:function(_874){ | ||
| 6436 | -d.makePositioned(_874.effects[0].element); | ||
| 6437 | -},afterFinishInternal:function(_875){ | ||
| 6438 | -s.hideElement(_875.effects[0].element); | ||
| 6439 | -d.undoPositioned(_875.effects[0].element); | ||
| 6440 | -s.setStyle(_875.effects[0].element,_873); | ||
| 6441 | -}},_872||{}); | ||
| 6442 | -var v=MochiKit.Visual; | ||
| 6443 | -return new v.Parallel([new v.Move(_871,{x:0,y:_872.distance,sync:true}),new v.Opacity(_871,{sync:true,to:0})],_872); | ||
| 6444 | -}; | ||
| 6445 | -MochiKit.Visual.shake=function(_876,_877){ | ||
| 6446 | -var d=MochiKit.DOM; | ||
| 6447 | -var v=MochiKit.Visual; | ||
| 6448 | -var s=MochiKit.Style; | ||
| 6449 | -_876=d.getElement(_876); | ||
| 6450 | -_877=MochiKit.Base.update({x:-20,y:0,duration:0.05,afterFinishInternal:function(_878){ | ||
| 6451 | -d.undoPositioned(_878.element); | ||
| 6452 | -s.setStyle(_878.element,oldStyle); | ||
| 6453 | -}},_877||{}); | ||
| 6454 | -var _879={top:s.getStyle(_876,"top"),left:s.getStyle(_876,"left")}; | ||
| 6455 | -return new v.Move(_876,{x:20,y:0,duration:0.05,afterFinishInternal:function(_880){ | ||
| 6456 | -new v.Move(_880.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_880){ | ||
| 6457 | -new v.Move(_880.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_880){ | ||
| 6458 | -new v.Move(_880.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_880){ | ||
| 6459 | -new v.Move(_880.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_880){ | ||
| 6460 | -new v.Move(_880.element,_877); | ||
| 6461 | -}}); | ||
| 6462 | -}}); | ||
| 6463 | -}}); | ||
| 6464 | -}}); | ||
| 6465 | -}}); | ||
| 6466 | -}; | ||
| 6467 | -MochiKit.Visual.slideDown=function(_881,_882){ | ||
| 6468 | -var d=MochiKit.DOM; | ||
| 6469 | -var b=MochiKit.Base; | ||
| 6470 | -var s=MochiKit.Style; | ||
| 6471 | -_881=d.getElement(_881); | ||
| 6472 | -if(!_881.firstChild){ | ||
| 6473 | -throw "MochiKit.Visual.slideDown must be used on a element with a child"; | ||
| 6474 | -} | ||
| 6475 | -d.removeEmptyTextNodes(_881); | ||
| 6476 | -var _883=s.getStyle(_881.firstChild,"bottom")||0; | ||
| 6477 | -var _884=s.getElementDimensions(_881); | ||
| 6478 | -var _885; | ||
| 6479 | -_882=b.update({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_884.h,originalWidth:_884.w},restoreAfterFinish:true,afterSetupInternal:function(_886){ | ||
| 6480 | -d.makePositioned(_886.element); | ||
| 6481 | -d.makePositioned(_886.element.firstChild); | ||
| 6482 | -if(/Opera/.test(navigator.userAgent)){ | ||
| 6483 | -s.setStyle(_886.element,{top:""}); | ||
| 6484 | -} | ||
| 6485 | -_885=d.makeClipping(_886.element); | ||
| 6486 | -s.setStyle(_886.element,{height:"0px"}); | ||
| 6487 | -s.showElement(_886.element); | ||
| 6488 | -},afterUpdateInternal:function(_887){ | ||
| 6489 | -s.setStyle(_887.element.firstChild,{bottom:(_887.dims[0]-_887.element.clientHeight)+"px"}); | ||
| 6490 | -},afterFinishInternal:function(_888){ | ||
| 6491 | -d.undoClipping(_888.element,_885); | ||
| 6492 | -if(/MSIE/.test(navigator.userAgent)){ | ||
| 6493 | -d.undoPositioned(_888.element); | ||
| 6494 | -d.undoPositioned(_888.element.firstChild); | ||
| 6495 | -}else{ | ||
| 6496 | -d.undoPositioned(_888.element.firstChild); | ||
| 6497 | -d.undoPositioned(_888.element); | ||
| 6498 | -} | ||
| 6499 | -s.setStyle(_888.element.firstChild,{bottom:_883}); | ||
| 6500 | -}},_882||{}); | ||
| 6501 | -return new MochiKit.Visual.Scale(_881,100,_882); | ||
| 6502 | -}; | ||
| 6503 | -MochiKit.Visual.slideUp=function(_889,_890){ | ||
| 6504 | -var d=MochiKit.DOM; | ||
| 6505 | -var b=MochiKit.Base; | ||
| 6506 | -var s=MochiKit.Style; | ||
| 6507 | -_889=d.getElement(_889); | ||
| 6508 | -if(!_889.firstChild){ | ||
| 6509 | -throw "MochiKit.Visual.slideUp must be used on a element with a child"; | ||
| 6510 | -} | ||
| 6511 | -d.removeEmptyTextNodes(_889); | ||
| 6512 | -var _891=s.getStyle(_889.firstChild,"bottom"); | ||
| 6513 | -var _892; | ||
| 6514 | -_890=b.update({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,restoreAfterFinish:true,beforeStartInternal:function(_893){ | ||
| 6515 | -d.makePositioned(_893.element); | ||
| 6516 | -d.makePositioned(_893.element.firstChild); | ||
| 6517 | -if(/Opera/.test(navigator.userAgent)){ | ||
| 6518 | -s.setStyle(_893.element,{top:""}); | ||
| 6519 | -} | ||
| 6520 | -_892=d.makeClipping(_893.element); | ||
| 6521 | -s.showElement(_893.element); | ||
| 6522 | -},afterUpdateInternal:function(_894){ | ||
| 6523 | -s.setStyle(_894.element.firstChild,{bottom:(_894.dims[0]-_894.element.clientHeight)+"px"}); | ||
| 6524 | -},afterFinishInternal:function(_895){ | ||
| 6525 | -s.hideElement(_895.element); | ||
| 6526 | -d.undoClipping(_895.element,_892); | ||
| 6527 | -d.undoPositioned(_895.element.firstChild); | ||
| 6528 | -d.undoPositioned(_895.element); | ||
| 6529 | -s.setStyle(_895.element.firstChild,{bottom:_891}); | ||
| 6530 | -}},_890||{}); | ||
| 6531 | -return new MochiKit.Visual.Scale(_889,0,_890); | ||
| 6532 | -}; | ||
| 6533 | -MochiKit.Visual.squish=function(_896,_897){ | ||
| 6534 | -var d=MochiKit.DOM; | ||
| 6535 | -var b=MochiKit.Base; | ||
| 6536 | -var _898; | ||
| 6537 | -_897=b.update({restoreAfterFinish:true,beforeSetupInternal:function(_899){ | ||
| 6538 | -_898=d.makeClipping(_899.element); | ||
| 6539 | -},afterFinishInternal:function(_900){ | ||
| 6540 | -MochiKit.Style.hideElement(_900.element); | ||
| 6541 | -d.undoClipping(_900.element,_898); | ||
| 6542 | -}},_897||{}); | ||
| 6543 | -return new MochiKit.Visual.Scale(_896,/Opera/.test(navigator.userAgent)?1:0,_897); | ||
| 6544 | -}; | ||
| 6545 | -MochiKit.Visual.grow=function(_901,_902){ | ||
| 6546 | -var d=MochiKit.DOM; | ||
| 6547 | -var v=MochiKit.Visual; | ||
| 6548 | -var s=MochiKit.Style; | ||
| 6549 | -_901=d.getElement(_901); | ||
| 6550 | -_902=MochiKit.Base.update({direction:"center",moveTransition:v.Transitions.sinoidal,scaleTransition:v.Transitions.sinoidal,opacityTransition:v.Transitions.full},_902||{}); | ||
| 6551 | -var _903={top:_901.style.top,left:_901.style.left,height:_901.style.height,width:_901.style.width,opacity:s.getStyle(_901,"opacity")}; | ||
| 6552 | -var dims=s.getElementDimensions(_901); | ||
| 6553 | -var _905,initialMoveY; | ||
| 6554 | -var _906,moveY; | ||
| 6555 | -switch(_902.direction){ | ||
| 6556 | -case "top-left": | ||
| 6557 | -_905=initialMoveY=_906=moveY=0; | ||
| 6558 | -break; | ||
| 6559 | -case "top-right": | ||
| 6560 | -_905=dims.w; | ||
| 6561 | -initialMoveY=moveY=0; | ||
| 6562 | -_906=-dims.w; | ||
| 6563 | -break; | ||
| 6564 | -case "bottom-left": | ||
| 6565 | -_905=_906=0; | ||
| 6566 | -initialMoveY=dims.h; | ||
| 6567 | -moveY=-dims.h; | ||
| 6568 | -break; | ||
| 6569 | -case "bottom-right": | ||
| 6570 | -_905=dims.w; | ||
| 6571 | -initialMoveY=dims.h; | ||
| 6572 | -_906=-dims.w; | ||
| 6573 | -moveY=-dims.h; | ||
| 6574 | -break; | ||
| 6575 | -case "center": | ||
| 6576 | -_905=dims.w/2; | ||
| 6577 | -initialMoveY=dims.h/2; | ||
| 6578 | -_906=-dims.w/2; | ||
| 6579 | -moveY=-dims.h/2; | ||
| 6580 | -break; | ||
| 6581 | -} | ||
| 6582 | -var _907=MochiKit.Base.update({beforeSetupInternal:function(_908){ | ||
| 6583 | -s.setStyle(_908.effects[0].element,{height:"0px"}); | ||
| 6584 | -s.showElement(_908.effects[0].element); | ||
| 6585 | -},afterFinishInternal:function(_909){ | ||
| 6586 | -d.undoClipping(_909.effects[0].element); | ||
| 6587 | -d.undoPositioned(_909.effects[0].element); | ||
| 6588 | -s.setStyle(_909.effects[0].element,_903); | ||
| 6589 | -}},_902||{}); | ||
| 6590 | -return new v.Move(_901,{x:_905,y:initialMoveY,duration:0.01,beforeSetupInternal:function(_910){ | ||
| 6591 | -s.hideElement(_910.element); | ||
| 6592 | -d.makeClipping(_910.element); | ||
| 6593 | -d.makePositioned(_910.element); | ||
| 6594 | -},afterFinishInternal:function(_911){ | ||
| 6595 | -new v.Parallel([new v.Opacity(_911.element,{sync:true,to:1,from:0,transition:_902.opacityTransition}),new v.Move(_911.element,{x:_906,y:moveY,sync:true,transition:_902.moveTransition}),new v.Scale(_911.element,100,{scaleMode:{originalHeight:dims.h,originalWidth:dims.w},sync:true,scaleFrom:/Opera/.test(navigator.userAgent)?1:0,transition:_902.scaleTransition,restoreAfterFinish:true})],_907); | ||
| 6596 | -}}); | 4673 | +MochiKit.Visual.roundElement=function(e,_620){ |
| 4674 | +new MochiKit.Visual._RoundCorners(e,_620); | ||
| 6597 | }; | 4675 | }; |
| 6598 | -MochiKit.Visual.shrink=function(_912,_913){ | ||
| 6599 | -var d=MochiKit.DOM; | ||
| 6600 | -var v=MochiKit.Visual; | ||
| 6601 | -var s=MochiKit.Style; | ||
| 6602 | -_912=d.getElement(_912); | ||
| 6603 | -_913=MochiKit.Base.update({direction:"center",moveTransition:v.Transitions.sinoidal,scaleTransition:v.Transitions.sinoidal,opacityTransition:v.Transitions.none},_913||{}); | ||
| 6604 | -var _914={top:_912.style.top,left:_912.style.left,height:_912.style.height,width:_912.style.width,opacity:s.getStyle(_912,"opacity")}; | ||
| 6605 | -var dims=s.getElementDimensions(_912); | ||
| 6606 | -var _915,moveY; | ||
| 6607 | -switch(_913.direction){ | ||
| 6608 | -case "top-left": | ||
| 6609 | -_915=moveY=0; | ||
| 6610 | -break; | ||
| 6611 | -case "top-right": | ||
| 6612 | -_915=dims.w; | ||
| 6613 | -moveY=0; | ||
| 6614 | -break; | ||
| 6615 | -case "bottom-left": | ||
| 6616 | -_915=0; | ||
| 6617 | -moveY=dims.h; | ||
| 6618 | -break; | ||
| 6619 | -case "bottom-right": | ||
| 6620 | -_915=dims.w; | ||
| 6621 | -moveY=dims.h; | ||
| 6622 | -break; | ||
| 6623 | -case "center": | ||
| 6624 | -_915=dims.w/2; | ||
| 6625 | -moveY=dims.h/2; | ||
| 6626 | -break; | 4676 | +MochiKit.Visual.roundClass=function(_621,_622,_623){ |
| 4677 | +var _624=MochiKit.DOM.getElementsByTagAndClassName(_621,_622); | ||
| 4678 | +for(var i=0;i<_624.length;i++){ | ||
| 4679 | +MochiKit.Visual.roundElement(_624[i],_623); | ||
| 6627 | } | 4680 | } |
| 6628 | -var _916; | ||
| 6629 | -var _917=MochiKit.Base.update({beforeStartInternal:function(_918){ | ||
| 6630 | -_916=d.makePositioned(_918.effects[0].element); | ||
| 6631 | -d.makeClipping(_918.effects[0].element); | ||
| 6632 | -},afterFinishInternal:function(_919){ | ||
| 6633 | -s.hideElement(_919.effects[0].element); | ||
| 6634 | -d.undoClipping(_919.effects[0].element,_916); | ||
| 6635 | -d.undoPositioned(_919.effects[0].element); | ||
| 6636 | -s.setStyle(_919.effects[0].element,_914); | ||
| 6637 | -}},_913||{}); | ||
| 6638 | -return new v.Parallel([new v.Opacity(_912,{sync:true,to:0,from:1,transition:_913.opacityTransition}),new v.Scale(_912,/Opera/.test(navigator.userAgent)?1:0,{sync:true,transition:_913.scaleTransition,restoreAfterFinish:true}),new v.Move(_912,{x:_915,y:moveY,sync:true,transition:_913.moveTransition})],_917); | ||
| 6639 | -}; | ||
| 6640 | -MochiKit.Visual.pulsate=function(_920,_921){ | ||
| 6641 | -var d=MochiKit.DOM; | ||
| 6642 | -var v=MochiKit.Visual; | ||
| 6643 | -var b=MochiKit.Base; | ||
| 6644 | -var _922=MochiKit.Style.getStyle(_920,"opacity"); | ||
| 6645 | -_921=b.update({duration:3,from:0,afterFinishInternal:function(_923){ | ||
| 6646 | -MochiKit.Style.setStyle(_923.element,{"opacity":_922}); | ||
| 6647 | -}},_921||{}); | ||
| 6648 | -var _924=_921.transition||v.Transitions.sinoidal; | ||
| 6649 | -var _925=b.bind(function(pos){ | ||
| 6650 | -return _924(1-v.Transitions.pulse(pos)); | ||
| 6651 | -},_924); | ||
| 6652 | -b.bind(_925,_924); | ||
| 6653 | -return new v.Opacity(_920,b.update({transition:_925},_921)); | ||
| 6654 | -}; | ||
| 6655 | -MochiKit.Visual.fold=function(_926,_927){ | ||
| 6656 | -var d=MochiKit.DOM; | ||
| 6657 | -var v=MochiKit.Visual; | ||
| 6658 | -var s=MochiKit.Style; | ||
| 6659 | -_926=d.getElement(_926); | ||
| 6660 | -var _928={top:_926.style.top,left:_926.style.left,width:_926.style.width,height:_926.style.height}; | ||
| 6661 | -var _929=d.makeClipping(_926); | ||
| 6662 | -_927=MochiKit.Base.update({scaleContent:false,scaleX:false,afterFinishInternal:function(_930){ | ||
| 6663 | -new v.Scale(_926,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(_930){ | ||
| 6664 | -s.hideElement(_930.element); | ||
| 6665 | -d.undoClipping(_930.element,_929); | ||
| 6666 | -s.setStyle(_930.element,_928); | ||
| 6667 | -}}); | ||
| 6668 | -}},_927||{}); | ||
| 6669 | -return new v.Scale(_926,5,_927); | ||
| 6670 | }; | 4681 | }; |
| 6671 | MochiKit.Visual.Color=MochiKit.Color.Color; | 4682 | MochiKit.Visual.Color=MochiKit.Color.Color; |
| 6672 | MochiKit.Visual.getElementsComputedStyle=MochiKit.DOM.computedStyle; | 4683 | MochiKit.Visual.getElementsComputedStyle=MochiKit.DOM.computedStyle; |
| @@ -6675,8 +4686,8 @@ var m=MochiKit.Base; | @@ -6675,8 +4686,8 @@ var m=MochiKit.Base; | ||
| 6675 | m.nameFunctions(this); | 4686 | m.nameFunctions(this); |
| 6676 | this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)}; | 4687 | this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)}; |
| 6677 | }; | 4688 | }; |
| 6678 | -MochiKit.Visual.EXPORT=["roundElement","roundClass","tagifyText","multiple","toggle","Parallel","Opacity","Move","Scale","Highlight","ScrollTo","fade","appear","puff","blindUp","blindDown","switchOff","dropOut","shake","slideDown","slideUp","squish","grow","shrink","pulsate","fold"]; | ||
| 6679 | -MochiKit.Visual.EXPORT_OK=["Base","PAIRS"]; | 4689 | +MochiKit.Visual.EXPORT=["roundElement","roundClass"]; |
| 4690 | +MochiKit.Visual.EXPORT_OK=[]; | ||
| 6680 | MochiKit.Visual.__new__(); | 4691 | MochiKit.Visual.__new__(); |
| 6681 | MochiKit.Base._exportSymbols(this,MochiKit.Visual); | 4692 | MochiKit.Base._exportSymbols(this,MochiKit.Visual); |
| 6682 | if(typeof (MochiKit)=="undefined"){ | 4693 | if(typeof (MochiKit)=="undefined"){ |
| @@ -6686,44 +4697,50 @@ if(typeof (MochiKit.MochiKit)=="undefined"){ | @@ -6686,44 +4697,50 @@ if(typeof (MochiKit.MochiKit)=="undefined"){ | ||
| 6686 | MochiKit.MochiKit={}; | 4697 | MochiKit.MochiKit={}; |
| 6687 | } | 4698 | } |
| 6688 | MochiKit.MochiKit.NAME="MochiKit.MochiKit"; | 4699 | MochiKit.MochiKit.NAME="MochiKit.MochiKit"; |
| 6689 | -MochiKit.MochiKit.VERSION="1.4"; | 4700 | +MochiKit.MochiKit.VERSION="1.3.1"; |
| 6690 | MochiKit.MochiKit.__repr__=function(){ | 4701 | MochiKit.MochiKit.__repr__=function(){ |
| 6691 | return "["+this.NAME+" "+this.VERSION+"]"; | 4702 | return "["+this.NAME+" "+this.VERSION+"]"; |
| 6692 | }; | 4703 | }; |
| 6693 | MochiKit.MochiKit.toString=function(){ | 4704 | MochiKit.MochiKit.toString=function(){ |
| 6694 | return this.__repr__(); | 4705 | return this.__repr__(); |
| 6695 | }; | 4706 | }; |
| 6696 | -MochiKit.MochiKit.SUBMODULES=["Base","Iter","Logging","DateTime","Format","Async","DOM","Selector","Style","LoggingPane","Color","Signal","Position","Visual"]; | 4707 | +MochiKit.MochiKit.SUBMODULES=["Base","Iter","Logging","DateTime","Format","Async","DOM","LoggingPane","Color","Signal","Visual"]; |
| 6697 | if(typeof (JSAN)!="undefined"||typeof (dojo)!="undefined"){ | 4708 | if(typeof (JSAN)!="undefined"||typeof (dojo)!="undefined"){ |
| 6698 | if(typeof (dojo)!="undefined"){ | 4709 | if(typeof (dojo)!="undefined"){ |
| 6699 | dojo.provide("MochiKit.MochiKit"); | 4710 | dojo.provide("MochiKit.MochiKit"); |
| 6700 | dojo.require("MochiKit.*"); | 4711 | dojo.require("MochiKit.*"); |
| 6701 | } | 4712 | } |
| 6702 | if(typeof (JSAN)!="undefined"){ | 4713 | if(typeof (JSAN)!="undefined"){ |
| 6703 | -(function(lst){ | ||
| 6704 | -for(var i=0;i<lst.length;i++){ | ||
| 6705 | -JSAN.use("MochiKit."+lst[i],[]); | ||
| 6706 | -} | ||
| 6707 | -})(MochiKit.MochiKit.SUBMODULES); | 4714 | +JSAN.use("MochiKit.Base",[]); |
| 4715 | +JSAN.use("MochiKit.Iter",[]); | ||
| 4716 | +JSAN.use("MochiKit.Logging",[]); | ||
| 4717 | +JSAN.use("MochiKit.DateTime",[]); | ||
| 4718 | +JSAN.use("MochiKit.Format",[]); | ||
| 4719 | +JSAN.use("MochiKit.Async",[]); | ||
| 4720 | +JSAN.use("MochiKit.DOM",[]); | ||
| 4721 | +JSAN.use("MochiKit.LoggingPane",[]); | ||
| 4722 | +JSAN.use("MochiKit.Color",[]); | ||
| 4723 | +JSAN.use("MochiKit.Signal",[]); | ||
| 4724 | +JSAN.use("MochiKit.Visual",[]); | ||
| 6708 | } | 4725 | } |
| 6709 | (function(){ | 4726 | (function(){ |
| 6710 | -var _931=MochiKit.Base.extend; | 4727 | +var _625=MochiKit.Base.extend; |
| 6711 | var self=MochiKit.MochiKit; | 4728 | var self=MochiKit.MochiKit; |
| 6712 | -var _932=self.SUBMODULES; | ||
| 6713 | -var _933=[]; | ||
| 6714 | -var _934=[]; | ||
| 6715 | -var _935={}; | 4729 | +var _626=self.SUBMODULES; |
| 4730 | +var _627=[]; | ||
| 4731 | +var _628=[]; | ||
| 4732 | +var _629={}; | ||
| 6716 | var i,k,m,all; | 4733 | var i,k,m,all; |
| 6717 | -for(i=0;i<_932.length;i++){ | ||
| 6718 | -m=MochiKit[_932[i]]; | ||
| 6719 | -_931(_933,m.EXPORT); | ||
| 6720 | -_931(_934,m.EXPORT_OK); | 4734 | +for(i=0;i<_626.length;i++){ |
| 4735 | +m=MochiKit[_626[i]]; | ||
| 4736 | +_625(_627,m.EXPORT); | ||
| 4737 | +_625(_628,m.EXPORT_OK); | ||
| 6721 | for(k in m.EXPORT_TAGS){ | 4738 | for(k in m.EXPORT_TAGS){ |
| 6722 | -_935[k]=_931(_935[k],m.EXPORT_TAGS[k]); | 4739 | +_629[k]=_625(_629[k],m.EXPORT_TAGS[k]); |
| 6723 | } | 4740 | } |
| 6724 | all=m.EXPORT_TAGS[":all"]; | 4741 | all=m.EXPORT_TAGS[":all"]; |
| 6725 | if(!all){ | 4742 | if(!all){ |
| 6726 | -all=_931(null,m.EXPORT,m.EXPORT_OK); | 4743 | +all=_625(null,m.EXPORT,m.EXPORT_OK); |
| 6727 | } | 4744 | } |
| 6728 | var j; | 4745 | var j; |
| 6729 | for(j=0;j<all.length;j++){ | 4746 | for(j=0;j<all.length;j++){ |
| @@ -6731,53 +4748,50 @@ k=all[j]; | @@ -6731,53 +4748,50 @@ k=all[j]; | ||
| 6731 | self[k]=m[k]; | 4748 | self[k]=m[k]; |
| 6732 | } | 4749 | } |
| 6733 | } | 4750 | } |
| 6734 | -self.EXPORT=_933; | ||
| 6735 | -self.EXPORT_OK=_934; | ||
| 6736 | -self.EXPORT_TAGS=_935; | 4751 | +self.EXPORT=_627; |
| 4752 | +self.EXPORT_OK=_628; | ||
| 4753 | +self.EXPORT_TAGS=_629; | ||
| 6737 | }()); | 4754 | }()); |
| 6738 | }else{ | 4755 | }else{ |
| 6739 | if(typeof (MochiKit.__compat__)=="undefined"){ | 4756 | if(typeof (MochiKit.__compat__)=="undefined"){ |
| 6740 | MochiKit.__compat__=true; | 4757 | MochiKit.__compat__=true; |
| 6741 | } | 4758 | } |
| 6742 | (function(){ | 4759 | (function(){ |
| 6743 | -if(typeof (document)=="undefined"){ | ||
| 6744 | -return; | ||
| 6745 | -} | ||
| 6746 | -var _936=document.getElementsByTagName("script"); | ||
| 6747 | -var _937="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; | 4760 | +var _630=document.getElementsByTagName("script"); |
| 4761 | +var _631="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; | ||
| 6748 | var base=null; | 4762 | var base=null; |
| 6749 | -var _938=null; | ||
| 6750 | -var _939={}; | 4763 | +var _632=null; |
| 4764 | +var _633={}; | ||
| 6751 | var i; | 4765 | var i; |
| 6752 | -for(i=0;i<_936.length;i++){ | ||
| 6753 | -var src=_936[i].getAttribute("src"); | 4766 | +for(i=0;i<_630.length;i++){ |
| 4767 | +var src=_630[i].getAttribute("src"); | ||
| 6754 | if(!src){ | 4768 | if(!src){ |
| 6755 | continue; | 4769 | continue; |
| 6756 | } | 4770 | } |
| 6757 | -_939[src]=true; | 4771 | +_633[src]=true; |
| 6758 | if(src.match(/MochiKit.js$/)){ | 4772 | if(src.match(/MochiKit.js$/)){ |
| 6759 | base=src.substring(0,src.lastIndexOf("MochiKit.js")); | 4773 | base=src.substring(0,src.lastIndexOf("MochiKit.js")); |
| 6760 | -_938=_936[i]; | 4774 | +_632=_630[i]; |
| 6761 | } | 4775 | } |
| 6762 | } | 4776 | } |
| 6763 | if(base===null){ | 4777 | if(base===null){ |
| 6764 | return; | 4778 | return; |
| 6765 | } | 4779 | } |
| 6766 | -var _940=MochiKit.MochiKit.SUBMODULES; | ||
| 6767 | -for(var i=0;i<_940.length;i++){ | ||
| 6768 | -if(MochiKit[_940[i]]){ | 4780 | +var _634=MochiKit.MochiKit.SUBMODULES; |
| 4781 | +for(var i=0;i<_634.length;i++){ | ||
| 4782 | +if(MochiKit[_634[i]]){ | ||
| 6769 | continue; | 4783 | continue; |
| 6770 | } | 4784 | } |
| 6771 | -var uri=base+_940[i]+".js"; | ||
| 6772 | -if(uri in _939){ | 4785 | +var uri=base+_634[i]+".js"; |
| 4786 | +if(uri in _633){ | ||
| 6773 | continue; | 4787 | continue; |
| 6774 | } | 4788 | } |
| 6775 | -if(document.documentElement&&document.documentElement.namespaceURI==_937){ | ||
| 6776 | -var s=document.createElementNS(_937,"script"); | ||
| 6777 | -s.setAttribute("id","MochiKit_"+base+_940[i]); | 4789 | +if(document.documentElement&&document.documentElement.namespaceURI==_631){ |
| 4790 | +var s=document.createElementNS(_631,"script"); | ||
| 4791 | +s.setAttribute("id","MochiKit_"+base+_634[i]); | ||
| 6778 | s.setAttribute("src",uri); | 4792 | s.setAttribute("src",uri); |
| 6779 | s.setAttribute("type","application/x-javascript"); | 4793 | s.setAttribute("type","application/x-javascript"); |
| 6780 | -_938.parentNode.appendChild(s); | 4794 | +_632.parentNode.appendChild(s); |
| 6781 | }else{ | 4795 | }else{ |
| 6782 | document.write("<script src=\""+uri+"\" type=\"text/javascript\"></script>"); | 4796 | document.write("<script src=\""+uri+"\" type=\"text/javascript\"></script>"); |
| 6783 | } | 4797 | } |
thirdpartyjs/MochiKit/__package__.js
| 1 | -dojo.kwCompoundRequire({ | ||
| 2 | - "common": [ | ||
| 3 | - "MochiKit.Base", | ||
| 4 | - "MochiKit.Iter", | ||
| 5 | - "MochiKit.Logging", | ||
| 6 | - "MochiKit.DateTime", | ||
| 7 | - "MochiKit.Format", | ||
| 8 | - "MochiKit.Async", | ||
| 9 | - "MochiKit.DOM", | ||
| 10 | - "MochiKit.Style", | ||
| 11 | - "MochiKit.LoggingPane", | ||
| 12 | - "MochiKit.Color", | ||
| 13 | - "MochiKit.Signal", | ||
| 14 | - "MochiKit.Position", | ||
| 15 | - "MochiKit.Visual" | ||
| 16 | - ] | ||
| 17 | -}); | ||
| 18 | -dojo.provide("MochiKit.*"); | 1 | +dojo.hostenv.conditionalLoadModule({"common": ["MochiKit.MochiKit"]}); |
| 2 | +dojo.hostenv.moduleLoaded("MochiKit.*"); |