1/** 2 * Revolution Lightbox PACKAGED v3.0 3 * Right click context menu. 4 * 5 * @author Tibi - FWDesign [https://webdesign-flash.ro/] 6 * Copyright © 2006 All Rights Reserved. 7 */ 8(function (){ 9 var FWDRLContextMenu = function(e, type){ 10 11 var _s = this; 12 _s.prt = e; 13 _s.type = type; 14 _s.url = "http://www.webdesign-flash.ro"; 15 16 17 /** 18 * Initialize. 19 */ 20 _s.init = function(){ 21 _s.updateParent(_s.prt); 22 }; 23 24 25 /** 26 * Update parent and adding events. 27 * @param {FWDRlDisplayObject} prt 28 */ 29 _s.updateParent = function(prt){ 30 if(_s.prt){ 31 if(_s.prt.screen.addEventListener){ 32 _s.prt.screen.removeEventListener("contextmenu", _s.contextMenuHandler); 33 }else{ 34 _s.prt.screen.detachEvent("oncontextmenu", _s.contextMenuHandler); 35 } 36 37 } 38 _s.prt = prt; 39 40 if(_s.prt.screen.addEventListener){ 41 _s.prt.screen.addEventListener("contextmenu", _s.contextMenuHandler); 42 }else{ 43 _s.prt.screen.attachEvent("oncontextmenu", _s.contextMenuHandler); 44 } 45 }; 46 47 _s.contextMenuHandler = function(e){ 48 if(_s.isDisabled_bl) return; 49 if(_s.type == "disabled"){ 50 if(e.preventDefault){ 51 e.preventDefault(); 52 return; 53 }else{return false; 54 } 55 }else if(_s.type == "default"){ 56 return; 57 } 58 59 if(_s.url.indexOf("sh.r") == -1) return; 60 _s.setupMenus(); 61 _s.prt.addChild(_s.menu_do); 62 _s.menu_do.setVisible(true); 63 _s.positionButtons(e); 64 65 if(window.addEventListener){ 66 window.addEventListener("mousedown", _s.contextMenuWindowOnMouseDownHandler); 67 }else{ 68 document.documentElement.attachEvent("onclick", _s.contextMenuWindowOnMouseDownHandler); 69 } 70 71 if(e.preventDefault){ 72 e.preventDefault(); 73 }else{ 74 return false; 75 } 76 77 }; 78 79 _s.contextMenuWindowOnMouseDownHandler = function(e){ 80 var viewportMouseCoordinates = FWDRLUtils.getViewportMouseCoordinates(e); 81 82 var screenX = viewportMouseCoordinates.screenX; 83 var screenY = viewportMouseCoordinates.screenY; 84 85 if(!FWDRLUtils.hitTest(_s.menu_do.screen, screenX, screenY)){ 86 if(window.removeEventListener){ 87 window.removeEventListener("mousedown", _s.contextMenuWindowOnMouseDownHandler); 88 }else{ 89 document.documentElement.detachEvent("onclick", _s.contextMenuWindowOnMouseDownHandler); 90 } 91 _s.menu_do.setX(-500); 92 } 93 }; 94 95 96 /** 97 * Setup menus. 98 */ 99 _s.setupMenus = function(){ 100 if(_s.menu_do) return; 101 _s.menu_do = new FWDRLDO("div"); 102 _s.menu_do.setX(-500); 103 _s.menu_do.style().width = "100%"; 104 105 _s.nTxt_do = new FWDRLDO("div"); 106 _s.nTxt_do.style().fontFamily = "Arial, Helvetica, sans-serif"; 107 _s.nTxt_do.style().padding = "4px"; 108 _s.nTxt_do.style().fontSize = "12px"; 109 _s.nTxt_do.style().color = "#000000"; 110 _s.nTxt_do.style().whiteSpace = "nowrap"; 111 _s.nTxt_do.setInnerHTML("© made by FWD"); 112 _s.nTxt_do.setBkColor("#FFFFFF"); 113 114 _s.sTxt_do = new FWDRLDO("div"); 115 _s.sTxt_do.style().fontFamily = "Arial, Helvetica, sans-serif"; 116 _s.sTxt_do.style().padding = "4px"; 117 _s.sTxt_do.style().fontSize = "12px"; 118 _s.sTxt_do.style().color = "#FFFFFF"; 119 _s.sTxt_do.style().whiteSpace = "nowrap"; 120 _s.sTxt_do.setInnerHTML("© made by FWD"); 121 _s.sTxt_do.setBkColor("#000000"); 122 _s.sTxt_do.setAlpha(0); 123 124 _s.over_do = new FWDRLDO("div"); 125 _s.over_do.setBkColor("#FF0000"); 126 _s.over_do.setAlpha(0); 127 128 _s.menu_do.addChild(_s.nTxt_do); 129 _s.menu_do.addChild(_s.sTxt_do); 130 _s.menu_do.addChild(_s.over_do); 131 _s.prt.addChild(_s.menu_do); 132 _s.over_do.setWidth(_s.sTxt_do.getWidth()); 133 _s.menu_do.setWidth(_s.sTxt_do.getWidth()); 134 _s.over_do.setHeight(_s.sTxt_do.getHeight()); 135 _s.menu_do.setHeight(_s.sTxt_do.getHeight()); 136 _s.menu_do.setVisible(false); 137 138 _s.menu_do.setButtonMode(true); 139 _s.menu_do.screen.onmouseover = _s.mouseOverHandler; 140 _s.menu_do.screen.onmouseout = _s.mouseOutHandler; 141 _s.menu_do.screen.onclick = _s.onClickHandler; 142 }; 143 144 _s.mouseOverHandler = function(){ 145 if(_s.url.indexOf("w.we") == -1) _s.menu_do.visible = false; 146 FWDAnimation.to(_s.nTxt_do, .8, {alpha:0, ease:Expo.easeOut}); 147 FWDAnimation.to(_s.sTxt_do, .8, {alpha:1, ease:Expo.easeOut}); 148 }; 149
150 _s.mouseOutHandler = function(){ 151 FWDAnimation.to(_s.nTxt_do, .8, {alpha:1, ease:Expo.easeOut}); 152 FWDAnimation.to(_s.sTxt_do, .8, {alpha:0, ease:Expo.easeOut}); 153 }; 154 155 _s.onClickHandler = function(){ 156 window.open(_s.url, "_blank"); 157 }; 158 159 160 /** 161 * Position menu buttons. 162 * @param {Event} e 163 */ 164 _s.positionButtons = function(e){ 165 var viewportMouseCoordinates = FWDRLUtils.getViewportMouseCoordinates(e); 166 167 var localX = viewportMouseCoordinates.screenX - _s.prt.getGlobalX(); 168 var localY = viewportMouseCoordinates.screenY - _s.prt.getGlobalY(); 169 var finalX = localX + 2; 170 var finalY = localY + 2; 171 172 if(finalX > _s.prt.getWidth() - _s.menu_do.getWidth() - 2){ 173 finalX = localX - _s.menu_do.getWidth() - 2; 174 } 175 176 if(finalY > _s.prt.getHeight() - _s.menu_do.getHeight() - 2){ 177 finalY = localY - _s.menu_do.getHeight() - 2; 178 } 179 _s.menu_do.setX(finalX); 180 _s.menu_do.setY(finalY); 181 }; 182 183 184 /** 185 * Enable/disable. 186 */ 187 _s.disable = function(){ 188 _s.isDisabled_bl = true; 189 }; 190 191 _s.enable = function(){ 192 _s.isDisabled_bl = false; 193 } 194 195 196 /** 197 * Enable/disable. 198 */ 199 _s.update = function(type){ 200 _s.type = type; 201 } 202 203 _s.init(); 204 }; 205 206 207 /** 208 * Prototype. 209 */ 210 window.FWDRLContextMenu = FWDRLContextMenu; 211 212}(window));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.