1/** 2 * Revolution Lightbox PACKAGED v3.0 3 * Simple button. 4 * 5 * @author Tibi - FWDesign [https://webdesign-flash.ro/] 6 * Copyright © 2006 All Rights Reserved. 7 */ 8(function (window){ 9 var FWDRLSimpleButton = function(nImg, sPath, cls, html, nClass, sClass){ 10 11 var _s = this; 12 var prototype = FWDRLSimpleButton.prototype; 13 14 _s.nImg = nImg; 15 _s.sPath = sPath; 16 _s.inst; 17 _s.html = html; 18 _s.nClass = nClass; 19 _s.sClass = sClass; 20 21 if(_s.nImg){ 22 _s.totalWidth = _s.nImg.width; 23 _s.totalHeight = _s.nImg.height; 24 } 25 26 _s.isShowed = true; 27 _s.isMbl = FWDRLUtils.isMbl; 28 _s.hasPointerEvent_bl = FWDRLUtils.hasPointerEvent; 29 30 31 /** 32 * Initiolize. 33 */ 34 _s.init = function(){ 35 _s.setupMainContainers(); 36 }; 37 38 39 /** 40 * Setup main containers. 41 */ 42 _s.setupMainContainers = function(){ 43 44 if(_s.html){ 45 _s.n_do = new FWDEVPDO("div"); 46 _s.n_do.setInnerHTML(_s.html); 47 _s.setNormalState(); 48 _s.addChild(_s.n_do); 49 50 setTimeout(function(){ 51 _s.setWidth(parseInt(getComputedStyle(_s.n_do.screen).getPropertyValue("width"))); 52 _s.setHeight(parseInt(getComputedStyle(_s.n_do.screen).getPropertyValue("height"))); 53 }, 5); 54 55 }else{ 56 _s.buttonsHolder_do = new FWDRLDO("div"); 57 _s.buttonsHolder_do.setOverflow("visible"); 58 59 _s.n_do = new FWDRLDO("img"); 60 _s.n_do.setScreen(_s.nImg); 61 _s.buttonsHolder_do.addChild(_s.n_do); 62 63 var img1 = new Image(); 64 img1.src = _s.sPath; 65 _s.s_do = new FWDRLDO("img"); 66 _s.s_do.setScreen(img1); 67 _s.s_do.setWidth(_s.totalWidth); 68 _s.s_do.setHeight(_s.totalHeight); 69 _s.s_do.setAlpha(0); 70 _s.buttonsHolder_do.addChild(_s.s_do); 71 _s.setWidth(_s.totalWidth); 72 _s.setHeight(_s.totalHeight); 73 74 _s.screen.style.yellowOverlayPointerEvents = "none"; 75 _s.addChild(_s.buttonsHolder_do); 76 } 77 78 _s.setButtonMode(true); 79 80 if(_s.isMbl){ 81 if(_s.hasPointerEvent_bl){ 82 _s.screen.addEventListener("pointerup", _s.onMouseUp); 83 _s.screen.addEventListener("pointerover", _s.onMouseOver); 84 _s.screen.addEventListener("pointerout", _s.onMouseOut); 85 }else{ 86 _s.screen.addEventListener("touchend", _s.onMouseUp); 87 } 88 }else{ 89 _s.screen.addEventListener("mouseover", _s.onMouseOver); 90 _s.screen.addEventListener("mouseout", _s.onMouseOut); 91 _s.screen.addEventListener("mouseup", _s.onMouseUp); 92 } 93 }; 94 95 _s.onMouseOver = function(e){ 96 _s.dispatchEvent(FWDRLSimpleButton.SHOW_TOOLTIP, {e:e}); 97 if(_s.isDisabledForGood_bl) return; 98 if(!e.pointerType || e.pointerType == e.MSPOINTER_TYPE_MOUSE || e.pointerType == "mouse"){ 99 if(_s.isDisabled_bl || _s.isSelectedFinal_bl) return; 100 _s.dispatchEvent(FWDRLSimpleButton.MOUSE_OVER, {e:e}); 101 _s.setSelectedState(true); 102 } 103 }; 104 105 _s.onMouseOut = function(e){ 106 if(_s.isDisabledForGood_bl) return; 107 if(!e.pointerType || e.pointerType == e.MSPOINTER_TYPE_MOUSE || e.pointerType == "mouse"){ 108 if(_s.isDisabled_bl || _s.isSelectedFinal_bl || _s.isDisabled2) return; 109 _s.dispatchEvent(FWDRLSimpleButton.MOUSE_OUT, {e:e}); 110 _s.setNormalState(true); 111 } 112 }; 113 114 _s.onMouseUp = function(e){ 115 if(_s.isDisabledForGood_bl) return; 116 if(e.preventDefault) e.preventDefault(); 117 if(_s.isDisabled_bl || e.button == 2) return; 118 _s.dispatchEvent(FWDRLSimpleButton.MOUSE_UP, {e:e, inst:_s.inst}); 119 }; 120 121 122 /** 123 * Set normal/selected state. 124 */ 125 _s.setNormalState = function(anim){ 126 if(_s.html){ 127 _s.n_do.screen.className = _s.nClass; 128 }else{ 129 FWDAnimation.killTweensOf(_s.s_do); 130 FWDAnimation.to(_s.s_do, .5, {alpha:0, ease:Expo.easeOut}); 131 } 132 }; 133 134 _s.setSelectedState = function(anim){ 135 if(_s.html){ 136 _s.n_do.screen.className = _s.nClass + ' ' + _s.sClass; 137 }else{ 138 FWDAnimation.killTweensOf(_s.s_do); 139 FWDAnimation.to(_s.s_do, .5, {alpha:1, delay:.1, ease:Expo.easeOut}); 140 } 141 }; 142 143 /** 144 * Disable/enable. 145 */ 146 _s.disable = function(setNormalState){ 147 if(_s.isDisabledForGood_bl || _s.isDisabled_bl) return; 148 _s.isDisabled_bl = true; 149 _s.setButtonMode(false); 150 FWDAnimation.to(_s, .6, {alpha:.4}); 151 if(!setNormalState) _s.setNormalState(); 152 }; 153
154 _s.enable = function(){ 155 if(_s.isDisabledForGood_bl || !_s.isDisabled_bl) return; 156 _s.isDisabled_bl = false; 157 _s.setButtonMode(true); 158 FWDAnimation.to(_s, .6, {alpha:1}); 159 }; 160 161 _s.disableForGood = function(){ 162 _s.isDisabledForGood_bl = true; 163 _s.setButtonMode(false); 164 }; 165 166 _s.disable2 = function(setNormalState){ 167 if(_s.isDisabled2) return; 168 _s.isDisabled2 = true; 169 FWDAnimation.to(_s, .6, {alpha:.4}); 170 if(!setNormalState) _s.setNormalState(); 171 }; 172 173 _s.enable2 = function(){ 174 if(!_s.isDisabled2) return; 175 _s.isDisabled2 = false; 176 FWDAnimation.to(_s, .6, {alpha:1}); 177 }; 178 179 180 /** 181 * Set button style if the button is a share type. 182 * @param {String} inst 183 */ 184 _s.setShareButton = function(inst){ 185 _s.inst = inst; 186 _s.screen.className = cls + '-share-button'; 187 _s.style().position = 'relative'; 188 _s.style().display = 'inline-block'; 189 } 190 191 192 /** 193 * Set opacitiy when item is dragged. 194 * @param {String} inst 195 */ 196 _s.setHideDrag = function(hide){ 197 FWDAnimation.killTweensOf(_s.n_do); 198 if(!hide){ 199 FWDAnimation.to(_s.n_do, .4, {alpha:1}); 200 }else{ 201 FWDAnimation.to(_s.n_do, .4, {alpha:.3, delay:.4}); 202 } 203 } 204 205 _s.init(); 206 }; 207 208 /** 209 * Set prototype. 210 */ 211 FWDRLSimpleButton.setPrototype = function(hasTransform){ 212 FWDRLSimpleButton.prototype = new FWDRLDO("div"); 213 }; 214 215 FWDRLSimpleButton.CLICK = "onClick"; 216 FWDRLSimpleButton.MOUSE_OVER = "onMouseOver"; 217 FWDRLSimpleButton.SHOW_TOOLTIP = "showTooltip"; 218 FWDRLSimpleButton.MOUSE_OUT = "onMouseOut"; 219 FWDRLSimpleButton.MOUSE_UP = "onMouseDown"; 220 221 FWDRLSimpleButton.prototype = null; 222 window.FWDRLSimpleButton = FWDRLSimpleButton; 223}(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.