PageRenderTime 21ms CodeModel.GetById 13ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/Frameworks/AppKit/rhino.platform/CPDOMWindowLayer.j

http://github.com/polymar/polish
Unknown | 76 lines | 76 code | 0 blank | 0 comment | 0 complexity | 13733edce8749a2eee0f88f63ad023c4 MD5 | raw file
 1I;20;Foundation/CPArray.jI;21;Foundation/CPObject.jc;2417;
 2var _1=objj_allocateClassPair(CPObject,"CPDOMWindowLayer"),_2=_1.isa;
 3class_addIvars(_1,[new objj_ivar("_level"),new objj_ivar("_windows"),new objj_ivar("_DOMElement")]);
 4objj_registerClassPair(_1);
 5objj_addClassForBundle(_1,objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
 6class_addMethods(_1,[new objj_method(sel_getUid("initWithLevel:"),function(_3,_4,_5){
 7with(_3){
 8_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPObject")},"init");
 9if(_3){
10_level=_5;
11_windows=[];
12_DOMElement=document.createElement("div");
13_DOMElement.style.position="absolute";
14_DOMElement.style.top="0px";
15_DOMElement.style.left="0px";
16_DOMElement.style.width="1px";
17_DOMElement.style.height="1px";
18}
19return _3;
20}
21}),new objj_method(sel_getUid("level"),function(_6,_7){
22with(_6){
23return _level;
24}
25}),new objj_method(sel_getUid("removeWindow:"),function(_8,_9,_a){
26with(_8){
27if(!_a._isVisible){
28return;
29}
30var _b=_a._index,_c=_windows.length-1;
31CPDOMDisplayServerInstructions[CPDOMDisplayServerInstructionCount++]=8;
32CPDOMDisplayServerInstructions[CPDOMDisplayServerInstructionCount++]=_DOMElement;
33CPDOMDisplayServerInstructions[CPDOMDisplayServerInstructionCount++]=_a._DOMElement;
34objj_msgSend(_windows,"removeObjectAtIndex:",_a._index);
35for(;_b<_c;++_b){
36_windows[_b]._index=_b;
37_windows[_b]._DOMElement.style.zIndex=_b;
38}
39_a._isVisible=NO;
40}
41}),new objj_method(sel_getUid("insertWindow:atIndex:"),function(_d,_e,_f,_10){
42with(_d){
43var _11=objj_msgSend(_windows,"count"),_12=(_10==CPNotFound?_11:_10),_13=_f._isVisible;
44if(_13){
45_12=MIN(_12,_f._index);
46objj_msgSend(_windows,"removeObjectAtIndex:",_f._index);
47}else{
48++_11;
49}
50if(_10==CPNotFound||_10>=_11){
51objj_msgSend(_windows,"addObject:",_f);
52}else{
53objj_msgSend(_windows,"insertObject:atIndex:",_f,_10);
54}
55for(;_12<_11;++_12){
56_windows[_12]._index=_12;
57_windows[_12]._DOMElement.style.zIndex=_12;
58}
59if(!_13){
60if(_f._DOMElement.CPDOMDisplayContext){
61_f._DOMElement.CPDOMDisplayContext[0]=-1;
62}
63CPDOMDisplayServerInstructions[CPDOMDisplayServerInstructionCount++]=6;
64CPDOMDisplayServerInstructions[CPDOMDisplayServerInstructionCount++]=_DOMElement;
65CPDOMDisplayServerInstructions[CPDOMDisplayServerInstructionCount++]=_f._DOMElement;
66_f._isVisible=YES;
67if(objj_msgSend(_f,"isFullBridge")){
68objj_msgSend(_f,"setFrame:",objj_msgSend(_f._bridge,"contentBounds"));
69}
70}
71}
72}),new objj_method(sel_getUid("orderedWindows"),function(_14,_15){
73with(_14){
74return _windows;
75}
76})]);