1/** 2 * Revolution Lightbox PACKAGED v3.0 3 * Caption. 4 * 5 * @author Tibi - FWDesign [https://webdesign-flash.ro/] 6 * Copyright © 2006 All Rights Reserved. 7 */ 8(function (window){ 9 10 var FWDRLCaption = function( 11 prt, 12 captionAnimationType, 13 captionPosition, 14 borderSize, 15 type 16 ){ 17 18 var _s = this; 19 var prototype = FWDRLCaption.prototype; 20 21 _s.captionAnimationType = captionAnimationType; 22 _s.captionPosition = captionPosition; 23 _s.borderSize = borderSize; 24 _s.finalW = 0; 25 _s.finalH = 0; 26 _s.finalY = 0; 27 _s.type = type; 28 29 if(_s.type == 'out'){ 30 _s.captionPosition = 'bottom'; 31 } 32 _s.isHiddenDone_bl = true; 33 34 35 /** 36 * Initialize. 37 */ 38 _s.init = function(){ 39 _s.setupMainContainers(); 40 }; 41 42 43 /** 44 * Setup main containers. 45 */ 46 _s.setupMainContainers = function(){ 47 48 _s.main_do = new FWDRLDO("div"); 49 50 _s.main_do.style().width = "100%"; 51 _s.main_do.style().height = "100%"; 52 _s.main_do.setBackfaceVisibility(); 53 54 _s.text_do = new FWDRLDO("div"); 55 _s.text_do.style().width = "100%"; 56 _s.text_do.setBackfaceVisibility(); 57 58 _s.bk_do = new FWDRLDO("div"); 59 _s.bk_do.screen.className = 'background'; 60 _s.bk_do.setResizableSizeAfterParent(); 61 _s.bk_do.setBackfaceVisibility(); 62 63 if(_s.type == 'in'){ 64 _s.main_do.addChild(_s.bk_do); 65 } 66 67 _s.main_do.addChild(_s.text_do); 68 _s.addChild(_s.main_do); 69 }; 70 71 72 /** 73 * Set text. 74 * @param {String} pText 75 */ 76 _s.setText = function(pText){ 77 _s.text_do.setInnerHTML(pText); 78 _s.resizeAndPosition(); 79 }; 80 81 82 /** 83 * Resize. 84 * @param {Integer} finalW 85 * @param {Boolean} anim 86 */ 87 _s.resizeAndPosition = function(finalW, anim){ 88 if(finalW) _s.finalW = finalW; 89 _s.finalH = _s.text_do.getHeight(); 90 91 _s.setFinalSize(); 92 clearTimeout(_s.resizeWithDelayId_to); 93 _s.resizeWithDelayId_to = setTimeout(function(){ 94 _s.setFinalSize(anim); 95 }, 91); 96 97 }; 98 99 _s.setFinalSize = function(){ 100 var cls = prt.cls + '-caption'; 101 102 if(_s.type == 'in'){ 103 cls += ' in'; 104 if(prt.stageH <= 550){ 105 cls += ' small-screen'; 106 } 107 }else{ 108 cls += ' out' 109 } 110 111 _s.finalH = _s.text_do.getHeight(); 112 _s.finalW = prt.itemHld_do.w; 113 114 var itemHldX = prt.itemHld_do.x; 115 var itemHldY = prt.itemHld_do.y; 116 var itemHldH = prt.itemHld_do.h 117 118 if(prt.itemHld_do.w < 50){ 119 itemHldX = prt.finalX; 120 itemHldY = prt.finalY; 121 itemHldH = prt.finalH; 122 _s.finalW = prt.finalW; 123 } 124 125 if(_s.type =='in'){ 126 _s.finalW -= _s.borderSize * 2; 127 _s.finalX = _s.borderSize; 128 if(_s.captionPosition == "topin"){ 129 cls += ' topin' 130 _s.style().top = '0'; 131 _s.style().bottom = 'auto'; 132 _s.text_do.style().top = 0; 133 _s.text_do.style().bottom = 'auto'; 134 }else{ 135 cls += ' bottomin' 136 _s.style().top = 'auto'; 137 _s.style().bottom = '0'; 138 _s.text_do.style().top = 'auto'; 139 _s.text_do.style().bottom = 0; 140 } 141 }else{ 142 _s.finalX = itemHldX; 143 _s.finalY = itemHldY + itemHldH; 144 _s.setY(_s.finalY); 145 _s.setWH(); 146 } 147 148 _s.screen.className = cls; 149 if(_s.type == 'in'){ 150 _s.setWidth(_s.finalW); 151 _s.main_do.setHeight(_s.finalH); 152 _s.setHeight(_s.finalH); 153 } 154 155 }; 156 157 _s.setWH = function(w,h){ 158 _s.setWidth(prt.finalW); 159 _s.main_do.setHeight(_s.finalH); 160 _s.setHeight(_s.finalH); 161 _s.setX(prt.finalX); 162 } 163 164 165 /** 166 * Hide caption. 167 * @param {Boolean} animate 168 * @param {Boolean} overwrite 169 * @param {Boolean} isShowedFirstTime 170 */ 171 _s.hide = function(animate, overwrite, isShowedFirstTime, inverse){ 172 if(!_s.isShowed && !overwrite) return; 173 _s.isShowed = false; 174 _s.finalH = _s.text_do.getHeight(); 175 var opacity = 1; 176 if(isShowedFirstTime) _s.isShowedFirstTime_bl = false; 177 178 FWDAnimation.killTweensOf(_s.main_do); 179 if(animate){ 180 if(_s.captionAnimationType == "motion"){ 181 var pos; 182 if(_s.captionPosition == "topin"){ 183 pos = -_s.finalH 184 }else{ 185 _s.setOverflow('hidden'); 186 if(_s.type == 'in'){ 187 pos = _s.finalH; 188 }else{ 189 pos = - _s.finalH - 3; 190 if(inverse){ 191 _s.setOverflow('visible'); 192 opacity = 0; 193 pos *= -1; 194 } 195 196 } 197 } 198 FWDAnimation.to(_s.main_do, .8, {y:pos, alpha:opacity, ease:Expo.easeInOut, onComplete:function(){_s.hideComplete(inverse)}}); 199 }else{ 200 FWDAnimation.to(_s.main_do, .4, {alpha:0, ease:Quint.easeOut, onComplete:_s.hideComplete}); 201 } 202 }else{ 203 _s.hideComplete(); 204 } 205 }; 206 207 _s.hideComplete = function(inverse){ 208 _s.setVisible(false); 209 if(_s.captionAnimationType == "motion"){ 210 var pos; 211 if(_s.captionPosition == "topin"){ 212 pos = -_s.finalH; 213 _s.setX(_s.borderSize); 214 _s.setY(_s.borderSize) 215 }else{ 216 if(_s.type == 'in'){ 217 pos = _s.finalH; 218 _s.setX(_s.borderSize); 219 _s.setY(-_s.borderSize) 220 }else{ 221 pos = - _s.finalH; 222 if(inverse){ 223 _s.setOverflow('visible'); 224 pos *= -1; 225 } 226 } 227 } 228 _s.main_do.setY(pos); 229 }else{ 230 _s.main_do.setAlpha(0); 231 } 232 }; 233 234 235 /** 236 * Show caption. 237 * @param {Boolean} animate 238 */ 239 _s.show = function(animate, inverse){ 240 if(_s.isShowed) return; 241
242 _s.isShowed = true; 243 setTimeout(function(){ 244 _s.setAlpha(1); 245 }, 100); 246 247 if(!_s.isShowedFirstTime_bl){ 248 _s.isShowedFirstTime_bl = true; 249 _s.hideComplete(); 250 _s.resizeAndPosition(); 251 } 252 _s.setVisible(true); 253 254 FWDAnimation.killTweensOf(_s.main_do); 255 if(_s.captionAnimationType == "motion"){ 256 if(!inverse && _s.main_do.alpha != 1) _s.main_do.setAlpha(1); 257 if(animate){ 258 FWDAnimation.to(_s.main_do, .8, {y:0, alpha:1, ease:Expo.easeInOut}); 259 }else{ 260 _s.main_do.setY(0); 261 } 262 }else{ 263 _s.main_do.setY(0); 264 var dl = .4; 265 if(prt.showFirstTimeDone) dl = 0; 266 console.log(dl) 267 if(animate){ 268 FWDAnimation.to(_s.main_do, .6, {alpha:1, delay:dl}); 269 }else{ 270 _s.main_do.setAlpha(1); 271 } 272 } 273 }; 274 275 _s.init(); 276 }; 277 278 /** 279 * Prototype and globals. 280 */ 281 FWDRLCaption.setPrototype = function(){ 282 FWDRLCaption.prototype = new FWDRLDO("div"); 283 }; 284 285 FWDRLCaption.HIDE_COMPLETE = "infoWindowHideComplete"; 286 FWDRLCaption.prototype = null; 287 window.FWDRLCaption = FWDRLCaption; 288 289}(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.