1/* DigRotate 4.0.0 */ 2function DRGetByID(id) 3{ 4 return document.getElementById(id); 5} 6 7function DRSetCookie(name, value, days) { 8 if (days) { 9 var date = new Date(); 10 date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); 11 var expires = "; expires=" + date.toGMTString(); 12 } 13 else var expires = ""; 14 document.cookie = name + "=" + value + expires + "; path=/"; 15} 16 17function DRGetCookie(name) { 18 var nameEQ = name + "="; 19 var ca = document.cookie.split(';'); 20 for (var i = 0; i < ca.length; i++) { 21 var c = ca[i]; 22 while (c.charAt(0) == ' ') c = c.substring(1, c.length); 23 if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length); 24 } 25 return null; 26} 27 28function DREraseCookie(name) { 29 createCookie(name, "", -1); 30} 31 32function DigRotate(clientId) { 33 this.Container = DRGetByID(clientId); 34 this.Content1Div = DRGetByID(clientId + "Content1"); 35 this.Content2Div = DRGetByID(clientId + "Content2"); 36 this.Content1Div.style.zIndex = 1; 37 this.Content2Div.style.zIndex = 2; 38 this.PagerDiv = DRGetByID(clientId + "Pager1"); 39 40 this.TransStart = 0; 41 this.MasterWidth = "0px"; 42 this.MasterHeight = "0px"; 43 this.MasterHeightValue = 0; 44 this.MasterWidthValue = 0; 45 this.PauseRotation = 0; 46 this.ClientID = clientId; 47 this.CurrentPage = 0; 48 this.LastPage = -1; 49 this.ScrollStepX = 0; 50 this.ScrollStepY = 0; 51 this.FadeStep = 0; 52 this.FadeCounter = 0; 53 this.ScrollTimeout = window.opera ? 100 : 40; 54 this.SetMasterDimensions(); 55 this.AJAXInitialLoad = 0; 56 this.KillIframe = 1; 57 this.IframeKiller = 1; 58} 59 60DigRotate.prototype.InitData = function () { 61 if (this.ContentLoad == 1) { 62 this.Transition = 998; 63 this.AJAXInitialLoad = 1; 64 this.AjaxRotate(); 65 } 66 else { 67 if (this.ContentLoad == 2) 68 this.SetCurrentPage(this.CurrentPage); 69 DRSetCookie('ShowAt' + this.ModuleID, '0'); 70 var id = this.ClientID + "Data" + this.CurrentPage; 71 var dataDiv = DRGetByID(id); 72 if (dataDiv != null) 73 this.CopyHtml(this.Content1Div, dataDiv); 74 // this.Content1Div.innerHTML = dataDiv.innerHTML; 75 } 76 if (this.AutoAdvance == 0) 77 this.PauseRotation = 1; 78} 79DigRotate.prototype.SetRotateTimer = function () { 80 if (this.RotateTimer != null) 81 clearTimeout(this.RotateTimer); 82 var o1 = this; 83 this.RotateTimer = setTimeout(function () { o1.RotateNext(); }, this.AutoAdvanceDelay); 84} 85 86DigRotate.prototype.SetScrollInterval = function () { 87 if (this.ScrollTimer != null) 88 clearInterval(this.ScrollTimer); 89 var o1 = this; 90 this.ScrollTimer = setInterval(function () { o1.Scroll(); }, this.ScrollTimeout); 91} 92 93DigRotate.prototype.Start = function () { 94 this.SetTransition(); 95 this.InitData(); 96 this.UpdatePager(); 97 if (this.AutoAdvance == 1 && this.ContentLoad != 2) 98 this.SetRotateTimer(); 99} 100 101DigRotate.prototype.Pause = function () { 102 if (this.RotateTimer != null) 103 clearTimeout(this.RotateTimer); 104 this.PauseRotation = 1; 105 this.UpdatePager(); 106} 107DigRotate.prototype.Play = function () { 108 this.RotateNext(); 109} 110DigRotate.prototype.RotatePrev = function () { 111 if (this.RotateTimer != null) 112 clearTimeout(this.RotateTimer); 113 if (this.ScrollTimer != null) 114 clearInterval(this.ScrollTimer); 115 116 var page = this.CurrentPage; 117 if (page == 0) 118 page = this.ContentCount - 1; 119 else 120 page = page - 1; 121 this.SetCurrentPage(page); 122 this.PauseRotation = 0; 123 this.UpdatePager(); 124 this.Rotate(); 125} 126DigRotate.prototype.RotateNext = function () { 127 if (this.RotateTimer != null) 128 clearTimeout(this.RotateTimer); 129 if (this.ScrollTimer != null) 130 clearInterval(this.ScrollTimer); 131 132 var page = this.CurrentPage; 133 if (page == this.ContentCount - 1) 134 page = 0; 135 else 136 page = page + 1; 137 this.SetCurrentPage(page); 138 this.PauseRotation = 0; 139 this.UpdatePager(); 140 this.Rotate(); 141} 142DigRotate.prototype.UpdatePager = function () { 143 this.HidePagerObjects(this.PauseRotation); 144 this.EnablePages(this.CurrentPage, this.LastPage); 145} 146DigRotate.prototype.SubmitAt = function (page) { 147 this.SetCurrentPage(page); 148 DRSetCookie('ShowAt' + this.ModuleID, '1'); 149 window.location.reload(); 150} 151 152DigRotate.prototype.RotateAt = function (page) { 153 if (page != this.CurrentPage) { 154 this.SetCurrentPage(page); 155 this.PauseRotation = 1; 156 this.UpdatePager(); 157 this.Rotate(); 158 } 159 this.Pause(); 160} 161 162DigRotate.prototype.Rotate = function () { 163 if (this.ContentLoad == 1) 164 this.AjaxRotate(); 165 else { 166 var id = this.ClientID + "Data" + this.CurrentPage; 167 var dataDiv = DRGetByID(id); 168 this.BindContent(dataDiv, null); 169 } 170} 171 172DigRotate.prototype.BindContent = function (sobj, content) { 173 if (this.Transition == 998) { 174 if (sobj != null) 175 this.CopyHtml(this.Content1Div, sobj); 176 else 177 this.Content1Div.innerHTML = content; 178 this.MoveTo(this.Content1Div, 0, 0); 179 this.EnablePages(this.CurrentPage, this.LastPage); 180 if (this.PauseRotation == 0 && this.AutoAdvance == 1) { 181 var o1 = this; 182 this.RotateTimer = setTimeout(function () { o1.RotateNext(); }, this.AutoAdvanceDelay); 183 } 184 if (this.AJAXInitialLoad == 1) 185 this.SetTransition(); 186 } 187 else { 188 if (sobj != null) 189 this.CopyHtml(this.Content2Div, sobj); 190 else 191 this.Content2Div.innerHTML = content; 192 this.EnablePages(this.CurrentPage, this.LastPage); 193 this.SetDimensions(); 194 195 this.PrepareScroll(); 196 this.SetScrollInterval(); 197 } 198} 199 200DigRotate.prototype.AjaxRotate = function () { 201 clearTimeout(this.RotateTimer); 202 var o1 = this; 203 dnn.xmlhttp.doCallBack(this.CallbackControl, this.CurrentPage + "," + this.ModuleID + "," + this.SortOrder, o1.GetRotateHandler, this.ModuleID, o1.GetRotateError, null, true, null, 0); 204} 205 206DigRotate.prototype.GetRotateHandler = function (result, ctx, me) { 207 var varname = 'drotobj' + ctx; 208 var o1 = eval(varname); 209 o1.BindContent(null, result); 210 if (o1.KillIframe == 1) { 211 if (this._request.contextId != null) { 212 var frame = DRGetByID('dnniframe' + this._request.contextId + ''); 213 if (frame != null) { 214 o1.IframeKiller++; 215 dnn.dom.removeChild(frame); 216 } 217 } 218 } 219} 220 221DigRotate.prototype.GetRotateError = function (result, ctx) { 222 // This may hit because page refresh during callback 223} 224 225DigRotate.prototype.SetDimensions = function () { 226 this.Content1Div.style.height = this.Content2Div.offsetHeight; 227 this.Content1Div.style.width = this.Content2Div.offsetWidth; 228 this.Container.style.height = parseInt(this.Content2Div.offsetHeight) + "px"; 229 this.Container.style.width = parseInt(this.Content2Div.offsetWidth) + "px"; 230 this.SetMasterDimensions(); 231} 232 233DigRotate.prototype.SetMasterDimensions = function () { 234 this.MasterWidth = this.Container.offsetWidth; 235 this.MasterHeight = this.Container.offsetHeight; 236 this.MasterHeightValue = parseInt(this.MasterHeight); 237 this.MasterWidthValue = parseInt(this.MasterWidth);
238} 239 240DigRotate.prototype.PrepareScroll = function () { 241 this.SetTransition(); 242 this.MoveTo(this.Content1Div, 0, 0); 243 this.ScrollStepX = 0; 244 this.ScrollStepY = 0; 245 if (this.Transition == 24 || this.Transition == 28) { 246 this.MoveTo(this.Content2Div, 0, 0); 247 this.ScrollStepY = -Math.ceil((this.MasterHeightValue / ((this.TransitionSpeed * 1000.0) / this.ScrollTimeout))); 248 } 249 else if (this.Transition == 25 || this.Transition == 29) { 250 this.MoveTo(this.Content2Div, 0, -(this.MasterHeightValue * 2)); 251 this.ScrollStepY = Math.ceil((this.MasterHeightValue / ((this.TransitionSpeed * 1000.0) / this.ScrollTimeout))); 252 } 253 else if (this.Transition == 26 || this.Transition == 30) { 254 this.MoveTo(this.Content2Div, this.MasterWidth, -(this.MasterHeightValue)); 255 this.ScrollStepX = -Math.ceil((this.MasterWidthValue / ((this.TransitionSpeed * 1000.0) / this.ScrollTimeout))); 256 } 257 else if (this.Transition == 27 || this.Transition == 31) { 258 this.MoveTo(this.Content2Div, -this.MasterWidthValue, -(this.MasterHeightValue)); 259 this.ScrollStepX = Math.ceil((this.MasterWidthValue / ((this.TransitionSpeed * 1000.0) / this.ScrollTimeout))); 260 } 261 else if (this.Transition == 32 || this.Transition == 33) { 262 this.SetOpacity(this.Content1Div, 100); 263 this.SetOpacity(this.Content2Div, 0); 264 this.MoveTo(this.Content2Div, 0, -(this.MasterHeightValue)); 265 this.FadeCounter = 0; 266 this.FadeStep = 100.0 / ((this.TransitionSpeed * 1000.0) / this.ScrollTimeout); 267 } 268} 269DigRotate.prototype.MoveTo = function (obj, x, y) { 270 obj.style.left = x + "px"; 271 obj.style.top = y + "px"; 272} 273 274DigRotate.prototype.SetOpacity = function (obj, op) { 275 obj.style.opacity = (op / 100); 276 obj.opacity = (op / 100); 277 obj.MozOpacity = (op / 100); 278 obj.KhtmlOpacity = (op / 100); 279 280 if (op == 100) 281 obj.style.filter = ""; 282 else 283 obj.style.filter = "alpha(opacity=" + op + ")"; 284} 285 286DigRotate.prototype.SetTransition = function () { 287 this.Transition = 998; 288 if (this.XTrans.length > 0) { 289 transIndex = Math.floor(Math.random() * this.XTrans.length); 290 this.Transition = this.XTrans[transIndex]; 291 } 292} 293 294DigRotate.prototype.Scroll = function () { 295 var done = 0; 296 if (this.Transition == 32) { 297 this.FadeCounter = this.FadeCounter + this.FadeStep; 298 this.SetOpacity(this.Content1Div, 100 - this.FadeCounter); 299 this.SetOpacity(this.Content2Div, this.FadeCounter); 300 if (this.FadeCounter >= 100) 301 done = 1; 302 } 303 else if (this.Transition == 33) { 304 this.FadeCounter = this.FadeCounter + this.FadeStep; 305 var use1 = 100 - (this.FadeCounter * 2); 306 if (this.FadeCounter < 50) 307 this.SetOpacity(this.Content1Div, use1); 308 else { 309 this.SetOpacity(this.Content1Div, 0); 310 var use2 = (this.FadeCounter - 50) * 2; 311 this.SetOpacity(this.Content2Div, (this.FadeCounter - 50) * 2); 312 } 313 if (this.FadeCounter >= 100) 314 done = 1; 315 } 316 else { 317 var divY = parseInt(this.Content2Div.style.top); 318 var divX = parseInt(this.Content2Div.style.left); 319 320 if (this.Transition == 24 || this.Transition == 28) { 321 if (divY + this.ScrollStepY <= -this.MasterHeightValue) { 322 this.ScrollStepY = -(this.MasterHeightValue - divY); 323 done = 1; 324 } 325 } 326 else if (this.Transition == 25 || this.Transition == 29) { 327 if ((divY + this.ScrollStepY) >= -this.MasterHeightValue) { 328 this.ScrollStepY = -this.MasterHeightValue - divY; 329 done = 1; 330 } 331 } 332 else if (this.Transition == 26 || this.Transition == 30) { 333 if ((divX + this.ScrollStepX) <= 0) { 334 this.ScrollStepX = -divX; 335 done = 1; 336 } 337 } 338 else if (this.Transition == 27 || this.Transition == 31) { 339 if ((divX + this.ScrollStepX) >= 0) { 340 this.ScrollStepX = divX; 341 done = 1; 342 } 343 } 344 345 this.Content2Div.style.left = (divX + this.ScrollStepX) + "px"; 346 this.Content2Div.style.top = (divY + this.ScrollStepY) + "px"; 347 348 if (this.Transition == 24 || this.Transition == 25 || this.Transition == 26 || this.Transition == 27) { 349 this.Content1Div.style.left = (parseInt(this.Content1Div.style.left) + this.ScrollStepX) + "px"; 350 this.Content1Div.style.top = (parseInt(this.Content1Div.style.top) + this.ScrollStepY) + "px"; 351 } 352 } 353 if (done == 1) { 354 clearInterval(this.ScrollTimer); 355 // this.Content1Div.innerHTML = this.Content2Div.innerHTML; 356 this.CopyHtml(this.Content1Div, this.Content2Div); 357 this.MoveTo(this.Content1Div, 0, 0); 358 this.MoveTo(this.Content2Div, 0, 0); 359 if (this.Transition == 32 || this.Transition == 33) { 360 this.SetOpacity(this.Content1Div, 100);
361 this.SetOpacity(this.Content2Div, 100); 362 } 363 if (this.PauseRotation == 0) 364 this.SetRotateTimer(); 365 366 } 367} 368 369 370DigRotate.prototype.EnablePages = function (current, last) { 371 var o1 = DRGetByID(this.ClientID + "ispage" + current); 372 var o2 = DRGetByID(this.ClientID + "notpage" + current); 373 this.ShowDiv(o1, 1); 374 this.ShowDiv(o2, 0); 375 if (last != -1) { 376 var o3 = DRGetByID(this.ClientID + "ispage" + last); 377 var o4 = DRGetByID(this.ClientID + "notpage" + last); 378 this.ShowDiv(o3, 0); 379 this.ShowDiv(o4, 1); 380 } 381 382 // current 383 var oc = DRGetByID(this.ClientID + "Page" + current); 384 if (oc == null) 385 return; 386 oc.className = "current"; 387 if (last != -1) { 388 var oo = DRGetByID(this.ClientID + "Page" + last); 389 oo.className = ""; 390 } 391 392} 393 394DigRotate.prototype.HidePagerObjects = function (pause) { 395 var o1 = DRGetByID(this.ClientID + "ispause"); 396 var o2 = DRGetByID(this.ClientID + "notpause"); 397 this.ShowDiv(o1, pause); 398 this.ShowDiv(o2, pause == 1 ? 0 : 1); 399} 400 401DigRotate.prototype.SetCurrentPage = function (curPage) { 402 this.LastPage = this.CurrentPage; 403 this.CurrentPage = curPage; 404 DRSetCookie("LastRotate" + this.ModuleID, curPage.toString()); 405} 406 407DigRotate.prototype.ShowDiv = function (o, show) { 408 if (o == null) 409 return; 410 if (o.style == null) 411 return; 412 o.style.display = show == 0 ? "none" : "inline"; 413 o.style.visibility = show == 0 ? "hidden" : "visible"; 414} 415DigRotate.prototype.ClearHtml = function (o) { 416 while (o.firstChild) o.removeChild(o.firstChild); 417} 418 419DigRotate.prototype.CopyHtml = function (dobj, sobj) { 420 dobj.innerHTML = sobj.innerHTML; 421 /* this.ClearHtml(dobj); 422 for (x = 0; x < sobj.childNodes.length; x++) { 423 var newContent = sobj.childNodes[x].cloneNode(true); 424 dobj.appendChild(newContent); 425 }*/ 426}
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.