1// Generated by Haxe 4.3.6 2var $hx_exports = typeof exports != "undefined" ? exports : typeof window != "undefined" ? window : typeof self != "undefined" ? self : this; 3(function ($global) { "use strict"; 4var $estr = function() { return js_Boot.__string_rec(this,''); },$hxEnums = $hxEnums || {},$_; 5function $extend(from, fields) { 6 var proto = Object.create(from); 7 for (var name in fields) proto[name] = fields[name]; 8 if( fields.toString !== Object.prototype.toString ) proto.toString = fields.toString; 9 return proto; 10} 11var DateTools = function() { }; 12DateTools.__name__ = true; 13DateTools.__format_get = function(d,e) { 14 switch(e) { 15 case "%": 16 return "%"; 17 case "A": 18 return DateTools.DAY_NAMES[d.getDay()]; 19 case "B": 20 return DateTools.MONTH_NAMES[d.getMonth()]; 21 case "C": 22 return StringTools.lpad(Std.string(d.getFullYear() / 100 | 0),"0",2); 23 case "D": 24 return DateTools.__format(d,"%m/%d/%y"); 25 case "F": 26 return DateTools.__format(d,"%Y-%m-%d"); 27 case "M": 28 return StringTools.lpad(Std.string(d.getMinutes()),"0",2); 29 case "R": 30 return DateTools.__format(d,"%H:%M"); 31 case "S": 32 return StringTools.lpad(Std.string(d.getSeconds()),"0",2); 33 case "T": 34 return DateTools.__format(d,"%H:%M:%S"); 35 case "Y": 36 return Std.string(d.getFullYear()); 37 case "a": 38 return DateTools.DAY_SHORT_NAMES[d.getDay()]; 39 case "d": 40 return StringTools.lpad(Std.string(d.getDate()),"0",2); 41 case "e": 42 return Std.string(d.getDate()); 43 case "b":case "h": 44 return DateTools.MONTH_SHORT_NAMES[d.getMonth()]; 45 case "H":case "k": 46 return StringTools.lpad(Std.string(d.getHours()),e == "H" ? "0" : " ",2); 47 case "I":case "l": 48 var hour = d.getHours() % 12; 49 return StringTools.lpad(Std.string(hour == 0 ? 12 : hour),e == "I" ? "0" : " ",2); 50 case "m": 51 return StringTools.lpad(Std.string(d.getMonth() + 1),"0",2); 52 case "n": 53 return "\n"; 54 case "p": 55 if(d.getHours() > 11) { 56 return "PM"; 57 } else { 58 return "AM"; 59 } 60 break; 61 case "r": 62 return DateTools.__format(d,"%I:%M:%S %p"); 63 case "s": 64 return Std.string(d.getTime() / 1000 | 0); 65 case "t": 66 return "\t"; 67 case "u": 68 var t = d.getDay(); 69 if(t == 0) { 70 return "7"; 71 } else if(t == null) { 72 return "null"; 73 } else { 74 return "" + t; 75 } 76 break; 77 case "w": 78 return Std.string(d.getDay()); 79 case "y": 80 return StringTools.lpad(Std.string(d.getFullYear() % 100),"0",2); 81 default: 82 throw new haxe_exceptions_NotImplementedException("Date.format %" + e + "- not implemented yet.",null,{ fileName : "DateTools.hx", lineNumber : 101, className : "DateTools", methodName : "__format_get"}); 83 } 84}; 85DateTools.__format = function(d,f) { 86 var r_b = ""; 87 var p = 0; 88 while(true) { 89 var np = f.indexOf("%",p); 90 if(np < 0) { 91 break; 92 } 93 var len = np - p; 94 r_b += len == null ? HxOverrides.substr(f,p,null) : HxOverrides.substr(f,p,len); 95 r_b += Std.string(DateTools.__format_get(d,HxOverrides.substr(f,np + 1,1))); 96 p = np + 2; 97 } 98 var len = f.length - p; 99 r_b += len == null ? HxOverrides.substr(f,p,null) : HxOverrides.substr(f,p,len); 100 return r_b; 101}; 102DateTools.format = function(d,f) { 103 return DateTools.__format(d,f); 104}; 105var HxOverrides = function() { }; 106HxOverrides.__name__ = true; 107HxOverrides.cca = function(s,index) { 108 var x = s.charCodeAt(index); 109 if(x != x) { 110 return undefined; 111 } 112 return x; 113}; 114HxOverrides.substr = function(s,pos,len) { 115 if(len == null) { 116 len = s.length; 117 } else if(len < 0) { 118 if(pos == 0) { 119 len = s.length + len; 120 } else { 121 return ""; 122 } 123 } 124 return s.substr(pos,len); 125}; 126HxOverrides.now = function() { 127 return Date.now(); 128}; 129var Lambda = function() { }; 130Lambda.__name__ = true; 131Lambda.array = function(it) { 132 var a = []; 133 var i = $getIterator(it); 134 while(i.hasNext()) { 135 var i1 = i.next(); 136 a.push(i1); 137 } 138 return a; 139}; 140Math.__name__ = true; 141var PmaxGThumb = function() { }; 142$hx_exports["PmaxGThumb"] = PmaxGThumb; 143PmaxGThumb.__name__ = true; 144PmaxGThumb.main = function() { 145}; 146PmaxGThumb.place = function(oldOptions) { 147 if(oldOptions == null || oldOptions.key == null) { 148 throw haxe_Exception.thrown("Option 'key' was not set"); 149 } 150 var newOptions = { }; 151 var key = Std.string(oldOptions.key); 152 newOptions.instance = key; 153 if(key.length > 6) { 154 newOptions.instance = HxOverrides.substr(key,0,key.length - 6); 155 } 156 newOptions.map = false;
157 newOptions.instanceName = false; 158 newOptions.weather = false; 159 newOptions.instanceLogo = false; 160 newOptions.timelapse = false; 161 if(oldOptions.id != null) { 162 newOptions.id = oldOptions.id; 163 var element = window.document.getElementById(oldOptions.id); 164 if(element != null) { 165 newOptions.id = oldOptions.id; 166 } else { 167 haxe_Log.trace("No element with ID '" + Std.string(oldOptions.id) + "' could be found. Ignoring 'id' parameter. Please update your PmaxGThumb configuration. For more information visit https://www.panomax.com",{ fileName : "src/PmaxGThumb.hx", lineNumber : 41, className : "PmaxGThumb", methodName : "place"}); 168 } 169 } 170 if(oldOptions.resolution != null) { 171 newOptions.resolution = oldOptions.resolution; 172 } 173 if(oldOptions.width != null) { 174 newOptions.width = oldOptions.width; 175 } 176 if(oldOptions.height != null) { 177 newOptions.height = oldOptions.height; 178 } 179 if(oldOptions.timestamp != null) { 180 newOptions.timestamp = oldOptions.timestamp; 181 } 182 if(oldOptions.target != null) { 183 newOptions.target = oldOptions.target; 184 } 185 if(oldOptions.continuous != null) { 186 newOptions.continuous = oldOptions.continuous; 187 } 188 if(oldOptions.noLink != null) { 189 newOptions.noLink = oldOptions.noLink; 190 } 191 PmaxThumbnail.place(newOptions); 192}; 193PmaxGThumb.open = function(key) { 194 haxe_Log.trace("The function 'open' is deprecated. Please update your PmaxGThumb configuration. For more information visit https://www.panomax.com",{ fileName : "src/PmaxGThumb.hx", lineNumber : 73, className : "PmaxGThumb", methodName : "open"}); 195}; 196var PmaxThumbnail = function() { }; 197$hx_exports["PmaxThumbnail"] = PmaxThumbnail; 198PmaxThumbnail.__name__ = true; 199PmaxThumbnail.main = function() { 200 PmaxGThumb.main(); 201}; 202PmaxThumbnail.place = function(options) { 203 var pmax = pmax_PmaxHelper.getPmax(); 204 pmax.manager.place(options); 205}; 206var Reflect = function() { }; 207Reflect.__name__ = true; 208Reflect.field = function(o,field) { 209 try { 210 return o[field]; 211 } catch( _g ) { 212 return null; 213 } 214}; 215Reflect.fields = function(o) { 216 var a = []; 217 if(o != null) { 218 var hasOwnProperty = Object.prototype.hasOwnProperty; 219 for( var f in o ) { 220 if(f != "__id__" && f != "hx__closures__" && hasOwnProperty.call(o,f)) { 221 a.push(f); 222 } 223 } 224 } 225 return a; 226}; 227Reflect.compare = function(a,b) { 228 if(a == b) { 229 return 0; 230 } else if(a > b) { 231 return 1; 232 } else { 233 return -1; 234 } 235}; 236var Std = function() { }; 237Std.__name__ = true; 238Std.string = function(s) { 239 return js_Boot.__string_rec(s,""); 240}; 241Std.parseInt = function(x) { 242 var v = parseInt(x); 243 if(isNaN(v)) { 244 return null; 245 } 246 return v; 247}; 248var StringBuf = function() { 249 this.b = ""; 250}; 251StringBuf.__name__ = true; 252StringBuf.prototype = { 253 __class__: StringBuf 254}; 255var StringTools = function() { }; 256StringTools.__name__ = true; 257StringTools.isSpace = function(s,pos) { 258 var c = HxOverrides.cca(s,pos); 259 if(!(c > 8 && c < 14)) { 260 return c == 32; 261 } else { 262 return true; 263 } 264}; 265StringTools.ltrim = function(s) { 266 var l = s.length; 267 var r = 0; 268 while(r < l && StringTools.isSpace(s,r)) ++r; 269 if(r > 0) { 270 return HxOverrides.substr(s,r,l - r); 271 } else { 272 return s; 273 } 274}; 275StringTools.rtrim = function(s) { 276 var l = s.length; 277 var r = 0; 278 while(r < l && StringTools.isSpace(s,l - r - 1)) ++r; 279 if(r > 0) { 280 return HxOverrides.substr(s,0,l - r); 281 } else { 282 return s; 283 } 284}; 285StringTools.trim = function(s) { 286 return StringTools.ltrim(StringTools.rtrim(s)); 287}; 288StringTools.lpad = function(s,c,l) { 289 if(c.length <= 0) { 290 return s; 291 } 292 var buf_b = ""; 293 l -= s.length; 294 while(buf_b.length < l) buf_b += c == null ? "null" : "" + c; 295 buf_b += s == null ? "null" : "" + s; 296 return buf_b; 297}; 298var ValueType = $hxEnums["ValueType"] = { __ename__:true,__constructs__:null 299 ,TNull: {_hx_name:"TNull",_hx_index:0,__enum__:"ValueType",toString:$estr} 300 ,TInt: {_hx_name:"TInt",_hx_index:1,__enum__:"ValueType",toString:$estr} 301 ,TFloat: {_hx_name:"TFloat",_hx_index:2,__enum__:"ValueType",toString:$estr} 302 ,TBool: {_hx_name:"TBool",_hx_index:3,__enum__:"ValueType",toString:$estr} 303 ,TObject: {_hx_name:"TObject",_hx_index:4,__enum__:"ValueType",toString:$estr} 304 ,TFunction: {_hx_name:"TFunction",_hx_index:5,__enum__:"ValueType",toString:$estr} 305 ,TClass: ($_=function(c) { return {_hx_index:6,c:c,__enum__:"ValueType",toString:$estr}; },$_._hx_name="TClass",$_.__params__ = ["c"],$_)
306 ,TEnum: ($_=function(e) { return {_hx_index:7,e:e,__enum__:"ValueType",toString:$estr}; },$_._hx_name="TEnum",$_.__params__ = ["e"],$_) 307 ,TUnknown: {_hx_name:"TUnknown",_hx_index:8,__enum__:"ValueType",toString:$estr} 308}; 309ValueType.__constructs__ = [ValueType.TNull,ValueType.TInt,ValueType.TFloat,ValueType.TBool,ValueType.TObject,ValueType.TFunction,ValueType.TClass,ValueType.TEnum,ValueType.TUnknown]; 310var Type = function() { }; 311Type.__name__ = true; 312Type.getEnum = function(o) { 313 if(o == null) { 314 return null; 315 } 316 return $hxEnums[o.__enum__]; 317}; 318Type.typeof = function(v) { 319 switch(typeof(v)) { 320 case "boolean": 321 return ValueType.TBool; 322 case "function": 323 if(v.__name__ || v.__ename__) { 324 return ValueType.TObject; 325 } 326 return ValueType.TFunction; 327 case "number": 328 if(Math.ceil(v) == v % 2147483648.0) { 329 return ValueType.TInt; 330 } 331 return ValueType.TFloat; 332 case "object": 333 if(v == null) { 334 return ValueType.TNull; 335 } 336 var e = v.__enum__; 337 if(e != null) { 338 return ValueType.TEnum($hxEnums[e]); 339 } 340 var c = js_Boot.getClass(v); 341 if(c != null) { 342 return ValueType.TClass(c); 343 } 344 return ValueType.TObject; 345 case "string": 346 return ValueType.TClass(String); 347 case "undefined": 348 return ValueType.TNull; 349 default: 350 return ValueType.TUnknown; 351 } 352}; 353Type.enumParameters = function(e) { 354 var enm = $hxEnums[e.__enum__]; 355 var params = enm.__constructs__[e._hx_index].__params__; 356 if(params != null) { 357 var _g = []; 358 var _g1 = 0; 359 while(_g1 < params.length) { 360 var p = params[_g1]; 361 ++_g1; 362 _g.push(e[p]); 363 } 364 return _g; 365 } else { 366 return []; 367 } 368}; 369var haxe_StackItem = $hxEnums["haxe.StackItem"] = { __ename__:true,__constructs__:null 370 ,CFunction: {_hx_name:"CFunction",_hx_index:0,__enum__:"haxe.StackItem",toString:$estr} 371 ,Module: ($_=function(m) { return {_hx_index:1,m:m,__enum__:"haxe.StackItem",toString:$estr}; },$_._hx_name="Module",$_.__params__ = ["m"],$_) 372 ,FilePos: ($_=function(s,file,line,column) { return {_hx_index:2,s:s,file:file,line:line,column:column,__enum__:"haxe.StackItem",toString:$estr}; },$_._hx_name="FilePos",$_.__params__ = ["s","file","line","column"],$_) 373 ,Method: ($_=function(classname,method) { return {_hx_index:3,classname:classname,method:method,__enum__:"haxe.StackItem",toString:$estr}; },$_._hx_name="Method",$_.__params__ = ["classname","method"],$_) 374 ,LocalFunction: ($_=function(v) { return {_hx_index:4,v:v,__enum__:"haxe.StackItem",toString:$estr}; },$_._hx_name="LocalFunction",$_.__params__ = ["v"],$_) 375}; 376haxe_StackItem.__constructs__ = [haxe_StackItem.CFunction,haxe_StackItem.Module,haxe_StackItem.FilePos,haxe_StackItem.Method,haxe_StackItem.LocalFunction]; 377var haxe_CallStack = {}; 378haxe_CallStack.callStack = function() { 379 return haxe_NativeStackTrace.toHaxe(haxe_NativeStackTrace.callStack()); 380}; 381haxe_CallStack.toString = function(stack) { 382 var b = new StringBuf(); 383 var _g = 0; 384 var _g1 = stack; 385 while(_g < _g1.length) { 386 var s = _g1[_g]; 387 ++_g; 388 b.b += "\nCalled from "; 389 haxe_CallStack.itemToString(b,s); 390 } 391 return b.b; 392}; 393haxe_CallStack.itemToString = function(b,s) { 394 switch(s._hx_index) { 395 case 0: 396 b.b += "a C function"; 397 break; 398 case 1: 399 var m = s.m; 400 b.b += "module "; 401 b.b += m == null ? "null" : "" + m; 402 break; 403 case 2: 404 var s1 = s.s; 405 var file = s.file; 406 var line = s.line; 407 var col = s.column; 408 if(s1 != null) { 409 haxe_CallStack.itemToString(b,s1); 410 b.b += " ("; 411 } 412 b.b += file == null ? "null" : "" + file; 413 b.b += " line "; 414 b.b += line == null ? "null" : "" + line; 415 if(col != null) { 416 b.b += " column "; 417 b.b += col == null ? "null" : "" + col; 418 } 419 if(s1 != null) { 420 b.b += ")"; 421 } 422 break; 423 case 3: 424 var cname = s.classname; 425 var meth = s.method; 426 b.b += Std.string(cname == null ? "<unknown>" : cname); 427 b.b += "."; 428 b.b += meth == null ? "null" : "" + meth; 429 break; 430 case 4: 431 var n = s.v; 432 b.b += "local function #"; 433 b.b += n == null ? "null" : "" + n; 434 break; 435 } 436}; 437var haxe_IMap = function() { }; 438haxe_IMap.__name__ = true; 439haxe_IMap.__isInterface__ = true; 440var haxe_Exception = function(message,previous,native) { 441 Error.call(this,message); 442 this.message = message; 443 this.__previousException = previous; 444 this.__nativeException = native != null ? native : this; 445}; 446haxe_Exception.__name__ = true; 447haxe_Exception.caught = function(value) { 448 if(((value) instanceof haxe_Exception)) { 449 return value; 450 } else if(((value) instanceof Error)) { 451 return new haxe_Exception(value.message,null,value); 452 } else { 453 return new haxe_ValueException(value,null,value); 454 } 455}; 456haxe_Exception.thrown = function(value) { 457 if(((value) instanceof haxe_Exception)) { 458 return value.get_native(); 459 } else if(((value) instanceof Error)) { 460 return value; 461 } else { 462 var e = new haxe_ValueException(value); 463 return e; 464 } 465}; 466haxe_Exception.__super__ = Error; 467haxe_Exception.prototype = $extend(Error.prototype,{ 468 unwrap: function() { 469 return this.__nativeException; 470 } 471 ,toString: function() { 472 return this.get_message(); 473 } 474 ,get_message: function() { 475 return this.message; 476 } 477 ,get_native: function() { 478 return this.__nativeException; 479 } 480 ,__class__: haxe_Exception 481}); 482var haxe_Log = function() { }; 483haxe_Log.__name__ = true; 484haxe_Log.formatOutput = function(v,infos) { 485 var str = Std.string(v); 486 if(infos == null) { 487 return str; 488 } 489 var pstr = infos.fileName + ":" + infos.lineNumber; 490 if(infos.customParams != null) { 491 var _g = 0; 492 var _g1 = infos.customParams; 493 while(_g < _g1.length) { 494 var v = _g1[_g]; 495 ++_g; 496 str += ", " + Std.string(v); 497 } 498 } 499 return pstr + ": " + str; 500}; 501haxe_Log.trace = function(v,infos) { 502 var str = haxe_Log.formatOutput(v,infos); 503 if(typeof(console) != "undefined" && console.log != null) { 504 console.log(str); 505 } 506}; 507var haxe_NativeStackTrace = function() { }; 508haxe_NativeStackTrace.__name__ = true; 509haxe_NativeStackTrace.callStack = function() { 510 var e = new Error(""); 511 var stack = haxe_NativeStackTrace.tryHaxeStack(e); 512 if(typeof(stack) == "undefined") { 513 try { 514 throw e; 515 } catch( _g ) { 516 } 517 stack = e.stack; 518 } 519 return haxe_NativeStackTrace.normalize(stack,2); 520}; 521haxe_NativeStackTrace.toHaxe = function(s,skip) { 522 if(skip == null) { 523 skip = 0; 524 } 525 if(s == null) { 526 return []; 527 } else if(typeof(s) == "string") { 528 var stack = s.split("\n"); 529 if(stack[0] == "Error") { 530 stack.shift(); 531 } 532 var m = []; 533 var _g = 0; 534 var _g1 = stack.length; 535 while(_g < _g1) { 536 var i = _g++; 537 if(skip > i) { 538 continue; 539 } 540 var line = stack[i]; 541 var matched = line.match(/^ at ([$A-Za-z0-9_. ]+) \(([^)]+):([0-9]+):([0-9]+)\)$/); 542 if(matched != null) { 543 var path = matched[1].split("."); 544 if(path[0] == "$hxClasses") { 545 path.shift(); 546 } 547 var meth = path.pop(); 548 var file = matched[2]; 549 var line1 = Std.parseInt(matched[3]); 550 var column = Std.parseInt(matched[4]); 551 m.push(haxe_StackItem.FilePos(meth == "Anonymous function" ? haxe_StackItem.LocalFunction() : meth == "Global code" ? null : haxe_StackItem.Method(path.join("."),meth),file,line1,column)); 552 } else { 553 m.push(haxe_StackItem.Module(StringTools.trim(line))); 554 } 555 } 556 return m; 557 } else if(skip > 0 && Array.isArray(s)) { 558 return s.slice(skip); 559 } else { 560 return s; 561 } 562}; 563haxe_NativeStackTrace.tryHaxeStack = function(e) { 564 if(e == null) { 565 return []; 566 } 567 var oldValue = Error.prepareStackTrace; 568 Error.prepareStackTrace = haxe_NativeStackTrace.prepareHxStackTrace; 569 var stack = e.stack; 570 Error.prepareStackTrace = oldValue; 571 return stack; 572}; 573haxe_NativeStackTrace.prepareHxStackTrace = function(e,callsites) { 574 var stack = []; 575 var _g = 0; 576 while(_g < callsites.length) { 577 var site = callsites[_g]; 578 ++_g; 579 if(haxe_NativeStackTrace.wrapCallSite != null) { 580 site = haxe_NativeStackTrace.wrapCallSite(site); 581 } 582 var method = null; 583 var fullName = site.getFunctionName(); 584 if(fullName != null) { 585 var idx = fullName.lastIndexOf("."); 586 if(idx >= 0) { 587 var className = fullName.substring(0,idx); 588 var methodName = fullName.substring(idx + 1); 589 method = haxe_StackItem.Method(className,methodName); 590 } else { 591 method = haxe_StackItem.Method(null,fullName); 592 } 593 } 594 var fileName = site.getFileName(); 595 var fileAddr = fileName == null ? -1 : fileName.indexOf("file:"); 596 if(haxe_NativeStackTrace.wrapCallSite != null && fileAddr > 0) { 597 fileName = fileName.substring(fileAddr + 6); 598 } 599 stack.push(haxe_StackItem.FilePos(method,fileName,site.getLineNumber(),site.getColumnNumber())); 600 } 601 return stack; 602}; 603haxe_NativeStackTrace.normalize = function(stack,skipItems) { 604 if(skipItems == null) { 605 skipItems = 0; 606 } 607 if(Array.isArray(stack) && skipItems > 0) { 608 return stack.slice(skipItems); 609 } else if(typeof(stack) == "string") { 610 switch(stack.substring(0,6)) { 611 case "Error\n":case "Error:": 612 ++skipItems; 613 break; 614 default: 615 } 616 return haxe_NativeStackTrace.skipLines(stack,skipItems); 617 } else { 618 return stack; 619 } 620}; 621haxe_NativeStackTrace.skipLines = function(stack,skip,pos) { 622 if(pos == null) { 623 pos = 0; 624 } 625 if(skip > 0) { 626 pos = stack.indexOf("\n",pos); 627 if(pos < 0) { 628 return ""; 629 } else { 630 return haxe_NativeStackTrace.skipLines(stack,--skip,pos + 1); 631 } 632 } else { 633 return stack.substring(pos); 634 } 635}; 636var haxe_Timer = function(time_ms) { 637 var me = this; 638 this.id = setInterval(function() { 639 me.run(); 640 },time_ms); 641}; 642haxe_Timer.__name__ = true; 643haxe_Timer.delay = function(f,time_ms) { 644 var t = new haxe_Timer(time_ms); 645 t.run = function() { 646 t.stop(); 647 f(); 648 }; 649 return t; 650}; 651haxe_Timer.prototype = { 652 stop: function() { 653 if(this.id == null) { 654 return; 655 }
656 clearInterval(this.id); 657 this.id = null; 658 } 659 ,run: function() { 660 } 661 ,__class__: haxe_Timer 662}; 663var haxe_ValueException = function(value,previous,native) { 664 haxe_Exception.call(this,String(value),previous,native); 665 this.value = value; 666}; 667haxe_ValueException.__name__ = true; 668haxe_ValueException.__super__ = haxe_Exception; 669haxe_ValueException.prototype = $extend(haxe_Exception.prototype,{ 670 unwrap: function() { 671 return this.value; 672 } 673 ,__class__: haxe_ValueException 674}); 675var haxe_ds_IntMap = function() { 676 this.h = { }; 677}; 678haxe_ds_IntMap.__name__ = true; 679haxe_ds_IntMap.__interfaces__ = [haxe_IMap]; 680haxe_ds_IntMap.prototype = { 681 remove: function(key) { 682 if(!this.h.hasOwnProperty(key)) { 683 return false; 684 } 685 delete(this.h[key]); 686 return true; 687 } 688 ,keys: function() { 689 var a = []; 690 for( var key in this.h ) if(this.h.hasOwnProperty(key)) a.push(+key); 691 return new haxe_iterators_ArrayIterator(a); 692 } 693 ,iterator: function() { 694 return { ref : this.h, it : this.keys(), hasNext : function() { 695 return this.it.hasNext(); 696 }, next : function() { 697 var i = this.it.next(); 698 return this.ref[i]; 699 }}; 700 } 701 ,__class__: haxe_ds_IntMap 702}; 703var haxe_ds_StringMap = function() { 704 this.h = Object.create(null); 705}; 706haxe_ds_StringMap.__name__ = true; 707haxe_ds_StringMap.__interfaces__ = [haxe_IMap]; 708haxe_ds_StringMap.prototype = { 709 iterator: function() { 710 return new haxe_ds__$StringMap_StringMapValueIterator(this.h); 711 } 712 ,__class__: haxe_ds_StringMap 713}; 714var haxe_ds__$StringMap_StringMapValueIterator = function(h) { 715 this.h = h; 716 this.keys = Object.keys(h); 717 this.length = this.keys.length; 718 this.current = 0; 719}; 720haxe_ds__$StringMap_StringMapValueIterator.__name__ = true; 721haxe_ds__$StringMap_StringMapValueIterator.prototype = { 722 hasNext: function() { 723 return this.current < this.length; 724 } 725 ,next: function() { 726 return this.h[this.keys[this.current++]]; 727 } 728 ,__class__: haxe_ds__$StringMap_StringMapValueIterator 729}; 730var haxe_exceptions_PosException = function(message,previous,pos) { 731 haxe_Exception.call(this,message,previous); 732 if(pos == null) { 733 this.posInfos = { fileName : "(unknown)", lineNumber : 0, className : "(unknown)", methodName : "(unknown)"}; 734 } else { 735 this.posInfos = pos; 736 } 737}; 738haxe_exceptions_PosException.__name__ = true; 739haxe_exceptions_PosException.__super__ = haxe_Exception; 740haxe_exceptions_PosException.prototype = $extend(haxe_Exception.prototype,{ 741 toString: function() { 742 return "" + haxe_Exception.prototype.toString.call(this) + " in " + this.posInfos.className + "." + this.posInfos.methodName + " at " + this.posInfos.fileName + ":" + this.posInfos.lineNumber; 743 } 744 ,__class__: haxe_exceptions_PosException 745}); 746var haxe_exceptions_NotImplementedException = function(message,previous,pos) { 747 if(message == null) { 748 message = "Not implemented"; 749 } 750 haxe_exceptions_PosException.call(this,message,previous,pos); 751}; 752haxe_exceptions_NotImplementedException.__name__ = true; 753haxe_exceptions_NotImplementedException.__super__ = haxe_exceptions_PosException; 754haxe_exceptions_NotImplementedException.prototype = $extend(haxe_exceptions_PosException.prototype,{ 755 __class__: haxe_exceptions_NotImplementedException 756}); 757var haxe_iterators_ArrayIterator = function(array) { 758 this.current = 0; 759 this.array = array; 760}; 761haxe_iterators_ArrayIterator.__name__ = true; 762haxe_iterators_ArrayIterator.prototype = { 763 hasNext: function() { 764 return this.current < this.array.length; 765 } 766 ,next: function() { 767 return this.array[this.current++]; 768 } 769 ,__class__: haxe_iterators_ArrayIterator 770}; 771var js_Boot = function() { }; 772js_Boot.__name__ = true; 773js_Boot.getClass = function(o) { 774 if(o == null) { 775 return null; 776 } else if(((o) instanceof Array)) { 777 return Array; 778 } else { 779 var cl = o.__class__; 780 if(cl != null) { 781 return cl; 782 } 783 var name = js_Boot.__nativeClassName(o); 784 if(name != null) { 785 return js_Boot.__resolveNativeClass(name); 786 } 787 return null; 788 } 789}; 790js_Boot.__string_rec = function(o,s) { 791 if(o == null) { 792 return "null"; 793 } 794 if(s.length >= 5) { 795 return "<...>"; 796 } 797 var t = typeof(o); 798 if(t == "function" && (o.__name__ || o.__ename__)) { 799 t = "object"; 800 } 801 switch(t) { 802 case "function": 803 return "<function>"; 804 case "object": 805 if(o.__enum__) { 806 var e = $hxEnums[o.__enum__]; 807 var con = e.__constructs__[o._hx_index]; 808 var n = con._hx_name; 809 if(con.__params__) { 810 s = s + "\t"; 811 return n + "(" + ((function($this) { 812 var $r; 813 var _g = []; 814 { 815 var _g1 = 0; 816 var _g2 = con.__params__; 817 while(true) { 818 if(!(_g1 < _g2.length)) { 819 break; 820 } 821 var p = _g2[_g1]; 822 _g1 = _g1 + 1; 823 _g.push(js_Boot.__string_rec(o[p],s)); 824 } 825 } 826 $r = _g; 827 return $r; 828 }(this))).join(",") + ")"; 829 } else { 830 return n; 831 } 832 } 833 if(((o) instanceof Array)) { 834 var str = "["; 835 s += "\t"; 836 var _g = 0; 837 var _g1 = o.length; 838 while(_g < _g1) { 839 var i = _g++; 840 str += (i > 0 ? "," : "") + js_Boot.__string_rec(o[i],s); 841 } 842 str += "]"; 843 return str; 844 } 845 var tostr; 846 try { 847 tostr = o.toString; 848 } catch( _g ) { 849 return "???"; 850 } 851 if(tostr != null && tostr != Object.toString && typeof(tostr) == "function") { 852 var s2 = o.toString(); 853 if(s2 != "[object Object]") { 854 return s2; 855 } 856 } 857 var str = "{\n"; 858 s += "\t"; 859 var hasp = o.hasOwnProperty != null; 860 var k = null; 861 for( k in o ) { 862 if(hasp && !o.hasOwnProperty(k)) { 863 continue; 864 } 865 if(k == "prototype" || k == "__class__" || k == "__super__" || k == "__interfaces__" || k == "__properties__") { 866 continue; 867 } 868 if(str.length != 2) { 869 str += ", \n"; 870 } 871 str += s + k + " : " + js_Boot.__string_rec(o[k],s); 872 } 873 s = s.substring(1); 874 str += "\n" + s + "}"; 875 return str; 876 case "string": 877 return o; 878 default: 879 return String(o); 880 } 881}; 882js_Boot.__interfLoop = function(cc,cl) { 883 if(cc == null) { 884 return false;
885 } 886 if(cc == cl) { 887 return true; 888 } 889 var intf = cc.__interfaces__; 890 if(intf != null) { 891 var _g = 0; 892 var _g1 = intf.length; 893 while(_g < _g1) { 894 var i = _g++; 895 var i1 = intf[i]; 896 if(i1 == cl || js_Boot.__interfLoop(i1,cl)) { 897 return true; 898 } 899 } 900 } 901 return js_Boot.__interfLoop(cc.__super__,cl); 902}; 903js_Boot.__instanceof = function(o,cl) { 904 if(cl == null) { 905 return false; 906 } 907 switch(cl) { 908 case Array: 909 return ((o) instanceof Array); 910 case Bool: 911 return typeof(o) == "boolean"; 912 case Dynamic: 913 return o != null; 914 case Float: 915 return typeof(o) == "number"; 916 case Int: 917 if(typeof(o) == "number") { 918 return ((o | 0) === o); 919 } else { 920 return false; 921 } 922 break; 923 case String: 924 return typeof(o) == "string"; 925 default: 926 if(o != null) { 927 if(typeof(cl) == "function") { 928 if(js_Boot.__downcastCheck(o,cl)) { 929 return true; 930 } 931 } else if(typeof(cl) == "object" && js_Boot.__isNativeObj(cl)) { 932 if(((o) instanceof cl)) { 933 return true; 934 } 935 } 936 } else { 937 return false; 938 } 939 if(cl == Class ? o.__name__ != null : false) { 940 return true; 941 } 942 if(cl == Enum ? o.__ename__ != null : false) { 943 return true; 944 } 945 return o.__enum__ != null ? $hxEnums[o.__enum__] == cl : false;
946 } 947}; 948js_Boot.__downcastCheck = function(o,cl) { 949 if(!((o) instanceof cl)) { 950 if(cl.__isInterface__) { 951 return js_Boot.__interfLoop(js_Boot.getClass(o),cl); 952 } else { 953 return false; 954 } 955 } else { 956 return true; 957 } 958}; 959js_Boot.__implements = function(o,iface) { 960 return js_Boot.__interfLoop(js_Boot.getClass(o),iface); 961}; 962js_Boot.__cast = function(o,t) { 963 if(o == null || js_Boot.__instanceof(o,t)) { 964 return o; 965 } else { 966 throw haxe_Exception.thrown("Cannot cast " + Std.string(o) + " to " + Std.string(t)); 967 } 968}; 969js_Boot.__nativeClassName = function(o) { 970 var name = js_Boot.__toStr.call(o).slice(8,-1); 971 if(name == "Object" || name == "Function" || name == "Math" || name == "JSON") { 972 return null; 973 } 974 return name; 975}; 976js_Boot.__isNativeObj = function(o) { 977 return js_Boot.__nativeClassName(o) != null; 978}; 979js_Boot.__resolveNativeClass = function(name) { 980 return $global[name]; 981}; 982var msignal_Signal = function(valueClasses) { 983 if(valueClasses == null) { 984 valueClasses = []; 985 } 986 this.valueClasses = valueClasses; 987 this.slots = msignal_SlotList.NIL; 988 this.priorityBased = false; 989}; 990msignal_Signal.__name__ = true; 991msignal_Signal.prototype = { 992 add: function(listener) { 993 return this.registerListener(listener); 994 } 995 ,addOnce: function(listener) { 996 return this.registerListener(listener,true); 997 } 998 ,addWithPriority: function(listener,priority) { 999 if(priority == null) { 1000 priority = 0; 1001 } 1002 return this.registerListener(listener,false,priority); 1003 } 1004 ,addOnceWithPriority: function(listener,priority) { 1005 if(priority == null) { 1006 priority = 0; 1007 } 1008 return this.registerListener(listener,true,priority); 1009 } 1010 ,remove: function(listener) { 1011 var slot = this.slots.find(listener); 1012 if(slot == null) { 1013 return null; 1014 } 1015 this.slots = this.slots.filterNot(listener); 1016 return slot; 1017 } 1018 ,removeAll: function() { 1019 this.slots = msignal_SlotList.NIL; 1020 } 1021 ,registerListener: function(listener,once,priority) { 1022 if(priority == null) { 1023 priority = 0; 1024 } 1025 if(once == null) { 1026 once = false; 1027 } 1028 if(this.registrationPossible(listener,once)) { 1029 var newSlot = this.createSlot(listener,once,priority); 1030 if(!this.priorityBased && priority != 0) { 1031 this.priorityBased = true; 1032 } 1033 if(!this.priorityBased && priority == 0) { 1034 this.slots = this.slots.prepend(newSlot); 1035 } else { 1036 this.slots = this.slots.insertWithPriority(newSlot); 1037 } 1038 return newSlot; 1039 } 1040 return this.slots.find(listener); 1041 } 1042 ,registrationPossible: function(listener,once) { 1043 if(!this.slots.nonEmpty) { 1044 return true; 1045 } 1046 var existingSlot = this.slots.find(listener); 1047 if(existingSlot == null) { 1048 return true; 1049 } 1050 if(existingSlot.once != once) { 1051 throw haxe_Exception.thrown("You cannot addOnce() then add() the same listener without removing the relationship first."); 1052 } 1053 return false; 1054 } 1055 ,createSlot: function(listener,once,priority) { 1056 if(priority == null) { 1057 priority = 0; 1058 } 1059 if(once == null) { 1060 once = false; 1061 } 1062 return null; 1063 } 1064 ,get_numListeners: function() { 1065 return this.slots.get_length(); 1066 } 1067 ,__class__: msignal_Signal 1068}; 1069var msignal_EventSignal = function(target) { 1070 msignal_Signal.call(this,[msignal_Event]); 1071 this.target = target; 1072}; 1073msignal_EventSignal.__name__ = true; 1074msignal_EventSignal.__super__ = msignal_Signal; 1075msignal_EventSignal.prototype = $extend(msignal_Signal.prototype,{ 1076 dispatch: function(event) { 1077 if(event.target == null) { 1078 event.target = this.target; 1079 event.signal = this; 1080 } 1081 event.currentTarget = this.target; 1082 var slotsToProcess = this.slots; 1083 while(slotsToProcess.nonEmpty) { 1084 slotsToProcess.head.execute(event); 1085 slotsToProcess = slotsToProcess.tail; 1086 } 1087 } 1088 ,dispatchType: function(type) { 1089 this.dispatch(new msignal_Event(type)); 1090 } 1091 ,bubble: function(event) { 1092 this.dispatch(event); 1093 var currentTarget = this.target; 1094 while(currentTarget != null && Object.prototype.hasOwnProperty.call(currentTarget,"parent")) { 1095 currentTarget = Reflect.field(currentTarget,"parent"); 1096 if(js_Boot.__implements(currentTarget,msignal_EventDispatcher)) { 1097 event.currentTarget = currentTarget; 1098 var dispatcher = js_Boot.__cast(currentTarget , msignal_EventDispatcher); 1099 if(!dispatcher.dispatchEvent(event)) { 1100 break; 1101 } 1102 } 1103 } 1104 } 1105 ,bubbleType: function(type) { 1106 this.bubble(new msignal_Event(type)); 1107 } 1108 ,createSlot: function(listener,once,priority) { 1109 if(priority == null) { 1110 priority = 0; 1111 } 1112 if(once == null) { 1113 once = false;
1114 } 1115 return new msignal_EventSlot(this,listener,once,priority); 1116 } 1117 ,__class__: msignal_EventSignal 1118}); 1119var msignal_Slot = function(signal,listener,once,priority) { 1120 if(priority == null) { 1121 priority = 0; 1122 } 1123 if(once == null) { 1124 once = false; 1125 } 1126 this.signal = signal; 1127 this.set_listener(listener); 1128 this.once = once; 1129 this.priority = priority; 1130 this.enabled = true; 1131}; 1132msignal_Slot.__name__ = true; 1133msignal_Slot.prototype = { 1134 remove: function() { 1135 this.signal.remove(this.listener); 1136 } 1137 ,set_listener: function(value) { 1138 if(value == null) { 1139 throw haxe_Exception.thrown("listener cannot be null"); 1140 } 1141 return this.listener = value; 1142 } 1143 ,__class__: msignal_Slot 1144}; 1145var msignal_EventSlot = function(signal,listener,once,priority) { 1146 if(priority == null) { 1147 priority = 0; 1148 } 1149 if(once == null) { 1150 once = false; 1151 } 1152 msignal_Slot.call(this,signal,listener,once,priority); 1153}; 1154msignal_EventSlot.__name__ = true; 1155msignal_EventSlot.typeEq = function(a,b) { 1156 if(a == b) { 1157 return true; 1158 } 1159 var _g = Type.typeof(a); 1160 if(_g._hx_index == 7) { 1161 var _g1 = _g.e; 1162 return msignal_EventSlot.enumTypeEq(a,b); 1163 } else { 1164 return false; 1165 } 1166}; 1167msignal_EventSlot.enumTypeEq = function(a,b) { 1168 if(a == b) { 1169 return true; 1170 } 1171 if(Type.getEnum(a) != Type.getEnum(b)) { 1172 return false; 1173 } 1174 if(a._hx_index != b._hx_index) { 1175 return false; 1176 } 1177 var aParams = Type.enumParameters(a); 1178 if(aParams.length == 0) { 1179 return true; 1180 } 1181 var bParams = Type.enumParameters(b); 1182 var _g = 0; 1183 var _g1 = aParams.length; 1184 while(_g < _g1) { 1185 var i = _g++; 1186 var aParam = aParams[i]; 1187 var bParam = bParams[i]; 1188 if(aParam == null) { 1189 continue; 1190 } 1191 if(!msignal_EventSlot.typeEq(aParam,bParam)) { 1192 return false; 1193 } 1194 } 1195 return true; 1196}; 1197msignal_EventSlot.__super__ = msignal_Slot; 1198msignal_EventSlot.prototype = $extend(msignal_Slot.prototype,{ 1199 execute: function(value1) { 1200 if(!this.enabled) { 1201 return; 1202 } 1203 if(this.filterType != null && !msignal_EventSlot.typeEq(this.filterType,value1.type)) { 1204 return; 1205 } 1206 if(this.once) { 1207 this.remove(); 1208 } 1209 this.listener(value1); 1210 } 1211 ,forType: function(value) { 1212 this.filterType = value; 1213 } 1214 ,__class__: msignal_EventSlot 1215}); 1216var msignal_Event = function(type) { 1217 this.type = type; 1218}; 1219msignal_Event.__name__ = true; 1220msignal_Event.prototype = { 1221 __class__: msignal_Event 1222}; 1223var msignal_EventDispatcher = function() { }; 1224msignal_EventDispatcher.__name__ = true; 1225msignal_EventDispatcher.__isInterface__ = true; 1226msignal_EventDispatcher.prototype = { 1227 __class__: msignal_EventDispatcher 1228}; 1229var msignal_Signal0 = function() { 1230 msignal_Signal.call(this); 1231}; 1232msignal_Signal0.__name__ = true; 1233msignal_Signal0.__super__ = msignal_Signal; 1234msignal_Signal0.prototype = $extend(msignal_Signal.prototype,{ 1235 dispatch: function() { 1236 var slotsToProcess = this.slots; 1237 while(slotsToProcess.nonEmpty) { 1238 slotsToProcess.head.execute(); 1239 slotsToProcess = slotsToProcess.tail; 1240 } 1241 } 1242 ,createSlot: function(listener,once,priority) { 1243 if(priority == null) { 1244 priority = 0; 1245 } 1246 if(once == null) { 1247 once = false; 1248 } 1249 return new msignal_Slot0(this,listener,once,priority); 1250 } 1251 ,__class__: msignal_Signal0 1252}); 1253var msignal_Signal1 = function(type) { 1254 msignal_Signal.call(this,[type]); 1255}; 1256msignal_Signal1.__name__ = true; 1257msignal_Signal1.__super__ = msignal_Signal; 1258msignal_Signal1.prototype = $extend(msignal_Signal.prototype,{ 1259 dispatch: function(value) { 1260 var slotsToProcess = this.slots; 1261 while(slotsToProcess.nonEmpty) { 1262 slotsToProcess.head.execute(value); 1263 slotsToProcess = slotsToProcess.tail; 1264 } 1265 } 1266 ,createSlot: function(listener,once,priority) { 1267 if(priority == null) { 1268 priority = 0; 1269 } 1270 if(once == null) { 1271 once = false; 1272 } 1273 return new msignal_Slot1(this,listener,once,priority); 1274 } 1275 ,__class__: msignal_Signal1 1276}); 1277var msignal_Signal2 = function(type1,type2) { 1278 msignal_Signal.call(this,[type1,type2]); 1279}; 1280msignal_Signal2.__name__ = true; 1281msignal_Signal2.__super__ = msignal_Signal; 1282msignal_Signal2.prototype = $extend(msignal_Signal.prototype,{ 1283 dispatch: function(value1,value2) { 1284 var slotsToProcess = this.slots; 1285 while(slotsToProcess.nonEmpty) { 1286 slotsToProcess.head.execute(value1,value2); 1287 slotsToProcess = slotsToProcess.tail; 1288 } 1289 } 1290 ,createSlot: function(listener,once,priority) { 1291 if(priority == null) { 1292 priority = 0; 1293 } 1294 if(once == null) { 1295 once = false;
1296 } 1297 return new msignal_Slot2(this,listener,once,priority); 1298 } 1299 ,__class__: msignal_Signal2 1300}); 1301var msignal_Slot0 = function(signal,listener,once,priority) { 1302 if(priority == null) { 1303 priority = 0; 1304 } 1305 if(once == null) { 1306 once = false; 1307 } 1308 msignal_Slot.call(this,signal,listener,once,priority); 1309}; 1310msignal_Slot0.__name__ = true; 1311msignal_Slot0.__super__ = msignal_Slot; 1312msignal_Slot0.prototype = $extend(msignal_Slot.prototype,{ 1313 execute: function() { 1314 if(!this.enabled) { 1315 return; 1316 } 1317 if(this.once) { 1318 this.remove(); 1319 } 1320 this.listener(); 1321 } 1322 ,__class__: msignal_Slot0 1323}); 1324var msignal_Slot1 = function(signal,listener,once,priority) { 1325 if(priority == null) { 1326 priority = 0; 1327 } 1328 if(once == null) { 1329 once = false; 1330 } 1331 msignal_Slot.call(this,signal,listener,once,priority); 1332}; 1333msignal_Slot1.__name__ = true; 1334msignal_Slot1.__super__ = msignal_Slot; 1335msignal_Slot1.prototype = $extend(msignal_Slot.prototype,{ 1336 execute: function(value1) { 1337 if(!this.enabled) { 1338 return; 1339 } 1340 if(this.once) { 1341 this.remove(); 1342 } 1343 if(this.param != null) { 1344 value1 = this.param; 1345 } 1346 this.listener(value1); 1347 } 1348 ,__class__: msignal_Slot1 1349}); 1350var msignal_Slot2 = function(signal,listener,once,priority) { 1351 if(priority == null) { 1352 priority = 0; 1353 } 1354 if(once == null) { 1355 once = false; 1356 } 1357 msignal_Slot.call(this,signal,listener,once,priority); 1358}; 1359msignal_Slot2.__name__ = true; 1360msignal_Slot2.__super__ = msignal_Slot; 1361msignal_Slot2.prototype = $extend(msignal_Slot.prototype,{ 1362 execute: function(value1,value2) { 1363 if(!this.enabled) { 1364 return; 1365 } 1366 if(this.once) { 1367 this.remove(); 1368 } 1369 if(this.param1 != null) { 1370 value1 = this.param1; 1371 } 1372 if(this.param2 != null) { 1373 value2 = this.param2; 1374 } 1375 this.listener(value1,value2); 1376 } 1377 ,__class__: msignal_Slot2 1378}); 1379var msignal_SlotList = function(head,tail) { 1380 this.nonEmpty = false; 1381 if(head == null && tail == null) { 1382 if(msignal_SlotList.NIL != null) { 1383 throw haxe_Exception.thrown("Parameters head and tail are null. Use the NIL element instead."); 1384 } 1385 this.nonEmpty = false; 1386 } else if(head == null) { 1387 throw haxe_Exception.thrown("Parameter head cannot be null."); 1388 } else { 1389 this.head = head; 1390 this.tail = tail == null ? msignal_SlotList.NIL : tail; 1391 this.nonEmpty = true; 1392 } 1393}; 1394msignal_SlotList.__name__ = true; 1395msignal_SlotList.prototype = { 1396 get_length: function() { 1397 if(!this.nonEmpty) { 1398 return 0; 1399 } 1400 if(this.tail == msignal_SlotList.NIL) { 1401 return 1; 1402 } 1403 var result = 0; 1404 var p = this; 1405 while(p.nonEmpty) { 1406 ++result; 1407 p = p.tail; 1408 } 1409 return result; 1410 } 1411 ,prepend: function(slot) { 1412 return new msignal_SlotList(slot,this); 1413 } 1414 ,append: function(slot) { 1415 if(slot == null) { 1416 return this; 1417 } 1418 if(!this.nonEmpty) { 1419 return new msignal_SlotList(slot); 1420 } 1421 if(this.tail == msignal_SlotList.NIL) { 1422 return new msignal_SlotList(slot).prepend(this.head); 1423 } 1424 var wholeClone = new msignal_SlotList(this.head); 1425 var subClone = wholeClone; 1426 var current = this.tail; 1427 while(current.nonEmpty) { 1428 subClone = subClone.tail = new msignal_SlotList(current.head); 1429 current = current.tail; 1430 } 1431 subClone.tail = new msignal_SlotList(slot); 1432 return wholeClone; 1433 } 1434 ,insertWithPriority: function(slot) { 1435 if(!this.nonEmpty) { 1436 return new msignal_SlotList(slot); 1437 } 1438 var priority = slot.priority; 1439 if(priority >= this.head.priority) { 1440 return this.prepend(slot); 1441 } 1442 var wholeClone = new msignal_SlotList(this.head); 1443 var subClone = wholeClone; 1444 var current = this.tail; 1445 while(current.nonEmpty) { 1446 if(priority > current.head.priority) { 1447 subClone.tail = current.prepend(slot); 1448 return wholeClone; 1449 } 1450 subClone = subClone.tail = new msignal_SlotList(current.head); 1451 current = current.tail; 1452 } 1453 subClone.tail = new msignal_SlotList(slot); 1454 return wholeClone; 1455 } 1456 ,filterNot: function(listener) { 1457 if(!this.nonEmpty || listener == null) { 1458 return this; 1459 } 1460 if(this.head.listener == listener) { 1461 return this.tail; 1462 } 1463 var wholeClone = new msignal_SlotList(this.head); 1464 var subClone = wholeClone; 1465 var current = this.tail; 1466 while(current.nonEmpty) { 1467 if(current.head.listener == listener) { 1468 subClone.tail = current.tail; 1469 return wholeClone; 1470 } 1471 subClone = subClone.tail = new msignal_SlotList(current.head); 1472 current = current.tail; 1473 } 1474 return this; 1475 } 1476 ,contains: function(listener) { 1477 if(!this.nonEmpty) { 1478 return false;
1479 } 1480 var p = this; 1481 while(p.nonEmpty) { 1482 if(p.head.listener == listener) { 1483 return true; 1484 } 1485 p = p.tail; 1486 } 1487 return false; 1488 } 1489 ,find: function(listener) { 1490 if(!this.nonEmpty) { 1491 return null; 1492 } 1493 var p = this; 1494 while(p.nonEmpty) { 1495 if(p.head.listener == listener) { 1496 return p.head; 1497 } 1498 p = p.tail; 1499 } 1500 return null; 1501 } 1502 ,__class__: msignal_SlotList 1503}; 1504var pmax_Pmax = function() { 1505 this.manager = new pmax_thumbnail_ThumbnailManager(); 1506}; 1507pmax_Pmax.__name__ = true; 1508pmax_Pmax.stack = function() { 1509 var stack = haxe_CallStack.callStack(); 1510 stack.shift(); 1511 haxe_Log.trace(haxe_CallStack.toString(stack),{ fileName : "src/pmax/Pmax.hx", lineNumber : 29, className : "pmax.Pmax", methodName : "stack"}); 1512}; 1513pmax_Pmax.prototype = { 1514 __class__: pmax_Pmax 1515}; 1516var pmax_PmaxHelper = function() { }; 1517pmax_PmaxHelper.__name__ = true; 1518pmax_PmaxHelper.getPmax = function() { 1519 var pmax = Reflect.field(window,pmax_PmaxHelper._pmaxWindowKey); 1520 if(pmax == null) { 1521 pmax = new pmax_Pmax(); 1522 } 1523 pmax_PmaxHelper.pmax = pmax; 1524 window[pmax_PmaxHelper._pmaxWindowKey] = pmax_PmaxHelper.pmax; 1525 return pmax_PmaxHelper.pmax; 1526}; 1527var pmax_config_ThumbnailConfig = function(index,options) { 1528 this.countryFlagUrl = "https://static.panomax.com/img/icons/flags2/gif/16px/"; 1529 this.countryFlag = true; 1530 this.noLink = false; 1531 this.timelapse = true; 1532 this.weather = true; 1533 this.map = true; 1534 this.instanceLogo = true; 1535 this.instanceName = true; 1536 this.continuous = true; 1537 this.showTimestamp = false; 1538 this.recent = true; 1539 this.width = "100%"; 1540 this.resolution = "small"; 1541 this.target = "_blank"; 1542 this.mode = "default"; 1543 this.failoverThumbnailImageBaseUrl = pmax_Pmax.failoverThumbnailImageBaseUrl; 1544 this.apiUrl = pmax_Pmax.apiUrl; 1545 this.index = index; 1546 if(options == null || options.instance == null) { 1547 throw haxe_Exception.thrown("Option 'instance' was not set"); 1548 } 1549 this.instance = options.instance; 1550 if(options.env != null) { 1551 this.apiUrl = "https://" + Std.string(options.env) + "/1.0"; 1552 } 1553 if(options.id != null) { 1554 this.id = Std.string(options.id); 1555 } 1556 if(options.target != null) { 1557 this.target = Std.string(options.target); 1558 } 1559 if(options.resolution != null) { 1560 this.resolution = Std.string(options.resolution); 1561 this.heightInt = pmax_etc_Resolution.getHeight(this.resolution); 1562 this.height = this.heightInt + "px"; 1563 } 1564 if(options.height != null) { 1565 this.heightInt = Std.parseInt(Std.string(options.height)); 1566 if(this.heightInt < 75) { 1567 this.heightInt = 75; 1568 } 1569 this.height = this.heightInt + "px"; 1570 this.resolution = pmax_etc_Resolution.getBestResolution(this.heightInt); 1571 } 1572 if(options.resolution == null && options.height == null) { 1573 this.resolution = pmax_etc_Resolution.getBestResolution(150); 1574 this.heightInt = pmax_etc_Resolution.getHeight(this.resolution); 1575 this.height = this.heightInt + "px"; 1576 } 1577 if(this.height == null) { 1578 var height = 150; 1579 this.height = height + "px"; 1580 this.resolution = pmax_etc_Resolution.getBestResolution(height); 1581 } 1582 if(options.width != null) { 1583 var f = options.width; 1584 if(isNaN(f)) { 1585 this.width = options.width; 1586 } else { 1587 this.width = Std.string(options.width) + "px"; 1588 } 1589 } 1590 if(options.culture != null) { 1591 this.culture = Std.string(options.culture); 1592 } 1593 if(options.timestamp != null) { 1594 this.recent = false; 1595 this.timestamp = pmax_etc_DateToolsExtended.parseTimestamp(Std.string(options.timestamp)); 1596 } 1597 if(options.continuous != null) { 1598 this.continuous = options.continuous; 1599 } 1600 if(options.instanceName != null) { 1601 this.instanceName = options.instanceName; 1602 } 1603 if(options.instanceLogo != null) { 1604 this.instanceLogo = options.instanceLogo; 1605 } 1606 if(options.map != null) { 1607 this.map = options.map; 1608 } 1609 if(options.weather != null) { 1610 this.weather = options.weather; 1611 } 1612 if(options.timelapse != null) { 1613 this.timelapse = options.timelapse; 1614 } 1615 if(options.showTimestamp != null) { 1616 this.showTimestamp = options.showTimestamp; 1617 } 1618 if(options.noLink != null) { 1619 this.noLink = options.noLink; 1620 } 1621 if(options.countryFlag != null) { 1622 this.countryFlag = options.countryFlag; 1623 if(!this.instanceName) { 1624 this.countryFlag = false;
1625 } 1626 } 1627 var tmp; 1628 var o = window; 1629 if(!Object.prototype.hasOwnProperty.call(o,"ontouchstart")) { 1630 var o = window; 1631 tmp = Object.prototype.hasOwnProperty.call(o,"DocumentTouch"); 1632 } else { 1633 tmp = true; 1634 } 1635 if(tmp) { 1636 this.timelapse = false; 1637 } 1638}; 1639pmax_config_ThumbnailConfig.__name__ = true; 1640pmax_config_ThumbnailConfig.prototype = { 1641 setResolution: function(resolution) { 1642 this.resolution = resolution; 1643 } 1644 ,setMode: function(mode) { 1645 this.mode = mode; 1646 } 1647 ,setCamId: function(camId) { 1648 this.camId = camId; 1649 } 1650 ,__class__: pmax_config_ThumbnailConfig 1651}; 1652var pmax_etc_DateToolsExtended = function() { }; 1653pmax_etc_DateToolsExtended.__name__ = true; 1654pmax_etc_DateToolsExtended.parseTimestamp = function(data) { 1655 if(data == null) { 1656 return null; 1657 } 1658 var parts = data.split(" "); 1659 var date = pmax_etc_DateToolsExtended.parseDate(parts[0]); 1660 if(date == null) { 1661 return null; 1662 } 1663 var time = pmax_etc_DateToolsExtended.parseTime(parts[1]); 1664 if(time == null) { 1665 return null; 1666 } 1667 return new Date(date.getFullYear(),date.getMonth(),date.getDate(),time.getHours(),time.getMinutes(),time.getSeconds()); 1668}; 1669pmax_etc_DateToolsExtended.parseDate = function(data) { 1670 if(data == null) { 1671 return null; 1672 } 1673 var parts = data.split("-"); 1674 return new Date(Std.parseInt(parts[0]),Std.parseInt(parts[1]) - 1,Std.parseInt(parts[2]),0,0,0); 1675}; 1676pmax_etc_DateToolsExtended.parseTime = function(data) { 1677 if(data == null) { 1678 return null; 1679 } 1680 var parts = data.split(":"); 1681 if(parts.length == 1) { 1682 parts = data.split("-"); 1683 } 1684 return new Date(0,0,0,Std.parseInt(parts[0]),Std.parseInt(parts[1]),Std.parseInt(parts[2])); 1685}; 1686pmax_etc_DateToolsExtended.formatDateTime = function(date) { 1687 if(date == null) { 1688 return null; 1689 } 1690 return pmax_etc_DateToolsExtended.formatDate(date) + " " + pmax_etc_DateToolsExtended.formatTime(date); 1691}; 1692pmax_etc_DateToolsExtended.formatDate = function(date) { 1693 return DateTools.format(date,"%Y-%m-%d"); 1694}; 1695pmax_etc_DateToolsExtended.formatTime = function(date) { 1696 return DateTools.format(date,"%H-%M-%S"); 1697}; 1698var pmax_etc_Dimension = function(width,height) { 1699 this.width = width; 1700 this.height = height; 1701}; 1702pmax_etc_Dimension.__name__ = true; 1703pmax_etc_Dimension.prototype = { 1704 __class__: pmax_etc_Dimension 1705}; 1706var pmax_etc_MapStorage = function() { 1707}; 1708pmax_etc_MapStorage.__name__ = true; 1709pmax_etc_MapStorage.prototype = { 1710 getMap: function(countryCode) { 1711 return pmax_Pmax.staticUrl + "/maps/" + countryCode + ".svg"; 1712 } 1713 ,__class__: pmax_etc_MapStorage 1714}; 1715var pmax_etc_Resolution = function() { }; 1716pmax_etc_Resolution.__name__ = true; 1717pmax_etc_Resolution.getHeight = function(resolution) { 1718 switch(resolution) { 1719 case "default": 1720 return 800; 1721 case "optimized": 1722 return 300; 1723 case "reduced": 1724 return 450; 1725 case "small": 1726 return 150; 1727 case "thumb": 1728 return 75; 1729 default: 1730 return 75; 1731 } 1732}; 1733pmax_etc_Resolution.getBestResolution = function(height) { 1734 if(height <= 75) { 1735 return "thumb"; 1736 } else if(height <= 150) { 1737 return "small"; 1738 } else if(height <= 300) { 1739 return "optimized"; 1740 } else if(height <= 450) { 1741 return "reduced"; 1742 } 1743 return "default"; 1744}; 1745var pmax_remoting_JsonInterface = function(url,method) { 1746 this.doneSignal = new msignal_EventSignal(this); 1747 this.errorSignal = new msignal_EventSignal(this); 1748 this.setUrlAndMethod(url,method); 1749 this.loaded = false; 1750 this.loading = false; 1751 this.erroneous = false; 1752}; 1753pmax_remoting_JsonInterface.__name__ = true; 1754pmax_remoting_JsonInterface.prototype = { 1755 setUrlAndMethod: function(url,method) { 1756 this._url = url; 1757 this._method = method; 1758 } 1759 ,loadInternal: function(data) { 1760 var _gthis = this; 1761 this.loading = true; 1762 this.erroneous = false; 1763 var xhr = new XMLHttpRequest(); 1764 xhr.onreadystatechange = function() { 1765 if(xhr.readyState == 4) { 1766 if(xhr.status == 200) { 1767 _gthis.onSuccess(xhr.response); 1768 } else { 1769 _gthis.onError(xhr.response); 1770 } 1771 } 1772 }; 1773 var url = this._url; 1774 var formData = null; 1775 if(this._method == "GET") { 1776 var query = []; 1777 if(data != null) { 1778 var h = data.h; 1779 var key_h = h; 1780 var key_keys = Object.keys(h); 1781 var key_length = key_keys.length; 1782 var key_current = 0; 1783 while(key_current < key_length) { 1784 var key = key_keys[key_current++];
1785 query.push(this.encode(key) + "=" + this.encode(data.h[key])); 1786 } 1787 } 1788 if(query.length > 0) { 1789 url += "?" + query.join("&"); 1790 } 1791 } else if(this._method == "POST") { 1792 formData = new FormData(); 1793 var h = data.h; 1794 var key_h = h; 1795 var key_keys = Object.keys(h); 1796 var key_length = key_keys.length; 1797 var key_current = 0; 1798 while(key_current < key_length) { 1799 var key = key_keys[key_current++]; 1800 formData.set(key,data.h[key]); 1801 } 1802 } 1803 xhr.open(this._method,url); 1804 xhr.send(formData); 1805 this._lastXhr = xhr; 1806 return xhr; 1807 } 1808 ,encode: function(string) { 1809 return encodeURIComponent(string); 1810 } 1811 ,cancel: function() { 1812 if(!this.loading || this._lastXhr == null) { 1813 return; 1814 } 1815 try { 1816 this._lastXhr.abort(); 1817 } catch( _g ) { 1818 } 1819 } 1820 ,onError: function(response) { 1821 this.onErroneous("Error",response); 1822 } 1823 ,onSuccess: function(response) { 1824 try { 1825 var data; 1826 if(Object.prototype.hasOwnProperty.call(JSON,"decode")) { 1827 data = JSON.decode(response); 1828 } else { 1829 data = JSON.parse(response); 1830 } 1831 this.onData(data); 1832 try { 1833 this.onDone(data); 1834 } catch( _g ) { 1835 var error = haxe_Exception.caught(_g).unwrap(); 1836 this.onErroneous("Done handler threw an exception",error); 1837 } 1838 } catch( _g ) { 1839 var error = haxe_Exception.caught(_g).unwrap(); 1840 this.onErroneous("Response not recognized",error); 1841 } 1842 } 1843 ,onDone: function(data) { 1844 this.loaded = true; 1845 this.loading = false; 1846 this.doneSignal.dispatch(new msignal_Event(data)); 1847 } 1848 ,onErroneous: function(message,error) { 1849 this.erroneous = true; 1850 this.loading = false; 1851 this.errorSignal.dispatch(new msignal_Event(error)); 1852 } 1853 ,onData: function(data) { 1854 throw haxe_Exception.thrown("onData() is not implemented"); 1855 } 1856 ,__class__: pmax_remoting_JsonInterface 1857}; 1858var pmax_remoting_MultiThumbnailData = function(thumbnails) { 1859 this._maxInstancesPerRequest = 50; 1860 this._thumbnails = thumbnails; 1861 pmax_remoting_JsonInterface.call(this,pmax_Pmax.apiUrl + "/instances/thumbnails","GET"); 1862}; 1863pmax_remoting_MultiThumbnailData.__name__ = true; 1864pmax_remoting_MultiThumbnailData.__super__ = pmax_remoting_JsonInterface; 1865pmax_remoting_MultiThumbnailData.prototype = $extend(pmax_remoting_JsonInterface.prototype,{ 1866 load: function() { 1867 if(this.loading) { 1868 return; 1869 } 1870 var instanceIdMap = new haxe_ds_StringMap(); 1871 var thumbnail = this._thumbnails.iterator(); 1872 while(thumbnail.hasNext()) { 1873 var thumbnail1 = thumbnail.next(); 1874 var instanceId = Std.string(thumbnail1.config.instance); 1875 if(!Object.prototype.hasOwnProperty.call(instanceIdMap.h,instanceId)) { 1876 instanceIdMap.h[instanceId] = instanceId; 1877 } 1878 } 1879 var instanceIds = Lambda.array(instanceIdMap); 1880 instanceIds.sort(function(a,b) { 1881 if(Std.parseInt(a) < Std.parseInt(b)) { 1882 return -1; 1883 } else { 1884 return 1; 1885 } 1886 }); 1887 var start = 0; 1888 var end = Math.ceil(instanceIds.length / this._maxInstancesPerRequest); 1889 var _g = start; 1890 var _g1 = end; 1891 while(_g < _g1) { 1892 var i = _g++; 1893 var partialInstanceIds = instanceIds.slice(i * this._maxInstancesPerRequest,(i + 1) * this._maxInstancesPerRequest); 1894 this.setUrlAndMethod(pmax_Pmax.apiUrl + "/instances/thumbnails/" + partialInstanceIds.join(","),"GET"); 1895 this.loadInternal(); 1896 } 1897 } 1898 ,onData: function(data) { 1899 var instanceIdDataMap_h = Object.create(null); 1900 var _g = 0; 1901 var _g1 = js_Boot.__cast(data , Array); 1902 while(_g < _g1.length) { 1903 var rawThumbnailData = _g1[_g]; 1904 ++_g; 1905 instanceIdDataMap_h[Std.string(rawThumbnailData.instance.id)] = rawThumbnailData; 1906 } 1907 var thumbnail = this._thumbnails.iterator(); 1908 while(thumbnail.hasNext()) { 1909 var thumbnail1 = thumbnail.next(); 1910 if(!Object.prototype.hasOwnProperty.call(instanceIdDataMap_h,thumbnail1.config.instance)) { 1911 continue; 1912 } 1913 var rawThumbnailData = instanceIdDataMap_h[thumbnail1.config.instance]; 1914 thumbnail1.data.onData(rawThumbnailData); 1915 thumbnail1.data.doneSignal.dispatch(new msignal_Event(rawThumbnailData)); 1916 } 1917 } 1918 ,__class__: pmax_remoting_MultiThumbnailData 1919}); 1920var pmax_remoting_ThumbnailData = function(config) { 1921 this.clippingHeight = 1; 1922 this.clippingWidth = 1; 1923 this.clippingY = 0; 1924 this.clippingX = 0; 1925 this.countryLongitudeMax = 183; 1926 this.countryLongitudeMin = -172; 1927 this.countryLatitudeMax = -52; 1928 this.countryLatitudeMin = 84.629244; 1929 this.country = "world"; 1930 this.instanceDisconnected = false;
1931 this._config = config; 1932 pmax_remoting_JsonInterface.call(this,config.apiUrl + "/instances/" + config.instance + "/thumbnail","GET"); 1933}; 1934pmax_remoting_ThumbnailData.__name__ = true; 1935pmax_remoting_ThumbnailData.__super__ = pmax_remoting_JsonInterface; 1936pmax_remoting_ThumbnailData.prototype = $extend(pmax_remoting_JsonInterface.prototype,{ 1937 load: function() { 1938 if(this.loading) { 1939 return; 1940 } 1941 var sendData = new haxe_ds_StringMap(); 1942 if(this._config.timestamp != null) { 1943 var value = pmax_etc_DateToolsExtended.formatDateTime(this._config.timestamp); 1944 sendData.h["timestamp"] = value; 1945 } 1946 if(this._config.culture != null) { 1947 sendData.h["culture"] = this._config.culture; 1948 } 1949 this.loadInternal(sendData); 1950 } 1951 ,get_customized: function() { 1952 if(!(this._config.timestamp != null || this._config.culture != null)) { 1953 return this._config.apiUrl != pmax_Pmax.apiUrl; 1954 } else { 1955 return true; 1956 } 1957 } 1958 ,onData: function(data) { 1959 this._loadedData = data; 1960 this.refresh(); 1961 } 1962 ,refresh: function() { 1963 this.dateImageMap = new haxe_ds_StringMap(); 1964 this.urlTimestampMap = new haxe_ds_StringMap(); 1965 this.dayImages = []; 1966 try { 1967 if(this._loadedData.mode != null) { 1968 this._config.setMode(Std.string(this._loadedData.mode)); 1969 } 1970 if(this._loadedData.instance != null) { 1971 if(this._loadedData.instance.cam != null) { 1972 if(this._loadedData.instance.cam.id != null) { 1973 this._config.setCamId(Std.parseInt(Std.string(this._loadedData.instance.cam.id))); 1974 } 1975 } 1976 } 1977 if(this._loadedData.name != null) { 1978 this.instanceName = Std.string(this._loadedData.name); 1979 } 1980 if(this._loadedData.url != null) { 1981 this.instanceUrl = Std.string(this._loadedData.url); 1982 } 1983 if(this._loadedData.tourCam != null) { 1984 this.tourCam = Std.string(this._loadedData.tourCam) == "true"; 1985 } 1986 if(this._loadedData.zeroDirection != null) { 1987 this.zeroDirection = parseFloat(Std.string(this._loadedData.zeroDirection)); 1988 } 1989 if(this._loadedData.viewAngle != null) { 1990 this.viewAngle = parseFloat(Std.string(this._loadedData.viewAngle)); 1991 } 1992 if(this._loadedData.initialDirection != null) { 1993 this.initialDirection = Std.parseInt(Std.string(this._loadedData.initialDirection)); 1994 } 1995 if(this._loadedData.logo != null) { 1996 this.logoUrl = Std.string(this._loadedData.logo); 1997 } 1998 if(this._loadedData.images != null) { 1999 if(this._config.mode != "failover") { 2000 var _g = 0; 2001 var _g1 = Reflect.fields(this._loadedData.images); 2002 while(_g < _g1.length) { 2003 var dateTime = _g1[_g]; 2004 ++_g; 2005 var imageResolutions = Reflect.field(this._loadedData.images,dateTime); 2006 if(!Object.prototype.hasOwnProperty.call(imageResolutions,this._config.resolution)) { 2007 continue; 2008 } 2009 var imageUrl = Reflect.field(imageResolutions,this._config.resolution); 2010 var imageTimestamp = pmax_etc_DateToolsExtended.parseTimestamp(dateTime); 2011 var imageData = new pmax_thumbnail_data_ImageData(imageUrl,imageTimestamp); 2012 this.dayImages.push(imageData); 2013 this.dateImageMap.h[dateTime] = imageData; 2014 this.urlTimestampMap.h[imageUrl] = imageData; 2015 } 2016 this.recentImage = this.dayImages.slice().pop(); 2017 if(this._config.timestamp != null) { 2018 var imageTimestamp = DateTools.format(this._config.timestamp,"%Y-%m-%d %H-%M-%S"); 2019 if(Object.prototype.hasOwnProperty.call(this.dateImageMap.h,imageTimestamp)) { 2020 this.recentImage = this.dateImageMap.h[imageTimestamp]; 2021 } else { 2022 var bestMatch = null; 2023 var minDiff = Infinity; 2024 var h = this.dateImageMap.h; 2025 var timestamp_h = h; 2026 var timestamp_keys = Object.keys(h); 2027 var timestamp_length = timestamp_keys.length; 2028 var timestamp_current = 0; 2029 while(timestamp_current < timestamp_length) { 2030 var timestamp = timestamp_keys[timestamp_current++]; 2031 var date = pmax_etc_DateToolsExtended.parseTimestamp(timestamp); 2032 var diff = Math.abs(date.getTime() - this._config.timestamp.getTime()); 2033 if(diff < minDiff) { 2034 minDiff = diff; 2035 bestMatch = timestamp; 2036 } 2037 } 2038 if(bestMatch != null) { 2039 this.recentImage = this.dateImageMap.h[bestMatch]; 2040 } 2041 } 2042 } 2043 } else { 2044 this.recentImage = new pmax_thumbnail_data_ImageData(this._config.failoverThumbnailImageBaseUrl + "/" + this._config.camId + "/recent_" + this._config.resolution + ".jpg",this._config.timestamp); 2045 } 2046 } 2047 if(this._loadedData.weather != null) { 2048 if(this._loadedData.weather.tempC != null) { 2049 this.temperature = parseFloat(Std.string(this._loadedData.weather.tempC)); 2050 } 2051 if(this._loadedData.weather.windSpeedKmh != null) { 2052 this.windSpeed = Std.parseInt(Std.string(this._loadedData.weather.windSpeedKmh)); 2053 } 2054 if(this._loadedData.weather.windDirectionDeg != null) { 2055 this.windDirection = Std.parseInt(Std.string(this._loadedData.weather.windDirectionDeg)); 2056 } 2057 } 2058 if(this._loadedData.culture != null) { 2059 this.countryCode = Std.string(this._loadedData.culture.cultureCode); 2060 } 2061 if(this._loadedData.country != null) { 2062 this.country = Std.string(this._loadedData.country.countryCode); 2063 if(this._loadedData.country.latitudeMin != null) { 2064 this.countryLatitudeMin = parseFloat(Std.string(this._loadedData.country.latitudeMin)); 2065 } 2066 if(this._loadedData.country.latitudeMax != null) { 2067 this.countryLatitudeMax = parseFloat(Std.string(this._loadedData.country.latitudeMax)); 2068 } 2069 if(this._loadedData.country.longitudeMin != null) { 2070 this.countryLongitudeMin = parseFloat(Std.string(this._loadedData.country.longitudeMin)); 2071 } 2072 if(this._loadedData.country.longitudeMax != null) { 2073 this.countryLongitudeMax = parseFloat(Std.string(this._loadedData.country.longitudeMax)); 2074 } 2075 } 2076 if(this._loadedData.position != null) { 2077 if(this._loadedData.position.latitude != null) { 2078 this.latitude = parseFloat(Std.string(this._loadedData.position.latitude)); 2079 } 2080 if(this._loadedData.position.longitude != null) { 2081 this.longitude = parseFloat(Std.string(this._loadedData.position.longitude)); 2082 } 2083 } 2084 if(this._loadedData.clipping != null) { 2085 if(this._loadedData.clipping.x != null) { 2086 this.clippingX = parseFloat(Std.string(this._loadedData.clipping.x)); 2087 } 2088 if(this._loadedData.clipping.y != null) { 2089 this.clippingY = parseFloat(Std.string(this._loadedData.clipping.y)); 2090 } 2091 if(this._loadedData.clipping.width != null) { 2092 this.clippingWidth = parseFloat(Std.string(this._loadedData.clipping.width)); 2093 } 2094 if(this._loadedData.clipping.height != null) { 2095 this.clippingHeight = parseFloat(Std.string(this._loadedData.clipping.height)); 2096 } 2097 } 2098 if(this._loadedData.instance.cam.disconnected != null) { 2099 this.instanceDisconnected = this._loadedData.instance.cam.disconnected; 2100 } 2101 } catch( _g ) { 2102 var error = haxe_Exception.caught(_g).unwrap(); 2103 throw haxe_Exception.thrown("Error occured while parsing the data: " + JSON.stringify(error)); 2104 } 2105 } 2106 ,__class__: pmax_remoting_ThumbnailData 2107});
2108var pmax_thumbnail_ThumbnailItem = function(main,config,data) { 2109 this._firstLoadErrorTimeout = 5; 2110 this._firstLoadErrorCount = 0; 2111 this._firstLoadErrorThreshold = 10; 2112 this._firstLoad = true; 2113 this._errorCount = 0; 2114 this._errorThreshold = 3; 2115 this.htmlDocument = null; 2116 this.timelapse = null; 2117 this.image = null; 2118 this.map = null; 2119 this.controls = null; 2120 this.details = null; 2121 this._main = main; 2122 this.config = config; 2123 this.data = data; 2124 this.data.doneSignal.add($bind(this,this.populate)); 2125 this.data.errorSignal.add($bind(this,this.onError)); 2126 this.initializedSignal = new msignal_Signal0(); 2127 this.removedSignal = new msignal_Signal0(); 2128 this.init(); 2129}; 2130pmax_thumbnail_ThumbnailItem.__name__ = true; 2131pmax_thumbnail_ThumbnailItem.prototype = { 2132 refresh: function() { 2133 this.data.load(); 2134 } 2135 ,onResize: function() { 2136 if(this.image != null) { 2137 this.image.resize(); 2138 this.image.draw(); 2139 } 2140 } 2141 ,init: function() { 2142 var _gthis = this; 2143 var document = window.document; 2144 this.htmlDocument = document; 2145 var id = this.config.id; 2146 var testElement = document.getElementById(id); 2147 if(id == null || testElement != null && !((testElement) instanceof HTMLAnchorElement) && this.config.noLink == false) { 2148 id = "gthumb_inst" + this.config.index; 2149 var container = document.createElement("a"); 2150 container.id = id; 2151 if(this.config.id == null) { 2152 document.write(container.outerHTML); 2153 } else { 2154 testElement.appendChild(container); 2155 } 2156 } 2157 var element = document.getElementById(id); 2158 this.element = element; 2159 if(!this.config.noLink) { 2160 if(!((element) instanceof HTMLAnchorElement)) { 2161 throw haxe_Exception.thrown("Element with id '" + id + "' must be an <a> tag!"); 2162 } 2163 this.cont = js_Boot.__cast(element , HTMLAnchorElement); 2164 this.cont.setAttribute("target",this.config.target); 2165 } else { 2166 this.cont = element; 2167 } 2168 this.cont.innerHTML = ""; 2169 this.cont.style.display = "block"; 2170 this.cont.style.position = "relative"; 2171 this.cont.style.clear = "both"; 2172 this.cont.style.width = this.config.width; 2173 this.cont.style.fontFamily = "Arial, sans-serif"; 2174 this.cont.style.color = "#FFF"; 2175 this.cont.style.fontSize = "12px"; 2176 this.cont.style.lineHeight = "normal"; 2177 this.cont.style.overflow = "hidden"; 2178 this.cont.style.boxSizing = "border-box"; 2179 this.cont.style.textDecoration = "none"; 2180 this.cont.style.setProperty("user-select","none"); 2181 if(this.config.noLink) { 2182 this.cont.style.cursor = "default"; 2183 } 2184 this._observer = new MutationObserver(function(records,observer) { 2185 var _g = 0; 2186 while(_g < records.length) { 2187 var record = records[_g]; 2188 ++_g; 2189 var _g1 = 0; 2190 var _g2 = record.removedNodes; 2191 while(_g1 < _g2.length) { 2192 var removedNode = _g2[_g1]; 2193 ++_g1; 2194 if(removedNode == _gthis.cont) { 2195 _gthis.removedSignal.dispatch(); 2196 break; 2197 } 2198 } 2199 } 2200 }); 2201 this._observer.observe(this.cont.parentNode,{ "childList" : true}); 2202 this.layout(); 2203 this.initializedSignal.dispatch(); 2204 } 2205 ,onError: function(signal) { 2206 this._errorCount++; 2207 if(this._firstLoad && this._firstLoadErrorCount < this._firstLoadErrorThreshold) { 2208 this._firstLoadErrorCount++; 2209 haxe_Timer.delay($bind(this,this.refresh),this._firstLoadErrorTimeout * 1000); 2210 return; 2211 } 2212 if(this.image != null && this._errorCount < this._errorThreshold) { 2213 return; 2214 } 2215 if(this._error != null) { 2216 return; 2217 } 2218 this.showError(); 2219 } 2220 ,showError: function() { 2221 this._error = window.document.createElement("span"); 2222 this._error.style.display = "block"; 2223 this._error.style.width = "100%"; 2224 this._error.style.height = "100%"; 2225 this._error.style.textAlign = "center"; 2226 this._error.style.fontSize = "25px"; 2227 this._error.style.paddingTop = "10px"; 2228 this._error.style.color = "#666"; 2229 this._error.style.backgroundColor = "#CCC"; 2230 this._error.style.zIndex = "10"; 2231 this._error.style.position = "absolute"; 2232 this._error.style.top = "0"; 2233 this._error.style.left = "0"; 2234 this._error.innerText = "Error loading panorama"; 2235 this.cont.appendChild(this._error); 2236 } 2237 ,hideError: function() { 2238 this._errorCount = 0; 2239 if(this._error == null) { 2240 return; 2241 } 2242 this._error.remove(); 2243 this._error = null; 2244 } 2245 ,populate: function(signal) {
2246 var _gthis = this; 2247 this.hideError(); 2248 this._firstLoad = false; 2249 this.layout(); 2250 if(this.data.instanceUrl != null && !this.config.noLink) { 2251 var instanceUrl = this.data.instanceUrl; 2252 if(this.config.timestamp != null) { 2253 instanceUrl += "?t=" + DateTools.format(this.config.timestamp,"%Y-%m-%d %H-%M-%S"); 2254 } 2255 this.cont.setAttribute("href",instanceUrl); 2256 this.cont.onclick = function(event) { 2257 _gthis.logClick(_gthis.config,"htmlThumbnail"); 2258 }; 2259 } 2260 if(this.config.instanceName || this.config.instanceLogo) { 2261 if(this.details != null) { 2262 this.details.refresh(); 2263 } else { 2264 this.details = new pmax_thumbnail_modules_ThumbnailDetails(this); 2265 } 2266 } 2267 if(this.config.mode != "failover") { 2268 if(this.config.timelapse) { 2269 if(this.timelapse == null) { 2270 this.timelapse = new pmax_thumbnail_modules_ThumbnailTimelapse(this); 2271 } 2272 } 2273 if(this.config.weather || this.config.timelapse || this.config.showTimestamp) { 2274 if(this.controls != null) { 2275 this.controls.refresh(); 2276 } else { 2277 this.controls = new pmax_thumbnail_modules_ThumbnailControls(this); 2278 } 2279 } 2280 if(this.config.map) { 2281 if(this.map != null) { 2282 this.map.refresh(); 2283 } else { 2284 this.map = new pmax_thumbnail_modules_ThumbnailMap(this); 2285 } 2286 } 2287 if(this.timelapse != null && this.timelapse.get_running()) { 2288 return; 2289 } 2290 } 2291 if(this.image != null) { 2292 this.image.refresh(); 2293 } else { 2294 this.image = new pmax_thumbnail_modules_ThumbnailImage(this); 2295 this.cont.addEventListener("start-animation",($_=this.image,$bind($_,$_.startAnimation))); 2296 this.cont.addEventListener("stop-animation",($_=this.image,$bind($_,$_.stopAnimation))); 2297 } 2298 if(this.data.instanceDisconnected) { 2299 this.addDisconnectIcon(); 2300 } 2301 } 2302 ,addDisconnectIcon: function() { 2303 var disconnectElement = this.cont.querySelector("#disconnect"); 2304 if(disconnectElement != null) { 2305 return; 2306 } 2307 var container = window.document.createElement("div"); 2308 container.id = "disconnect"; 2309 container.style.display = "flex"; 2310 container.style.position = "absolute"; 2311 container.style.top = "0"; 2312 container.style.justifyContent = "center"; 2313 container.style.alignItems = "center"; 2314 container.style.height = this.cont.clientHeight + "px"; 2315 container.style.width = "100%"; 2316 var imageData = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iODBweCIgaGVpZ2h0PSI4MHB4IiB2aWV3Qm94PSIwIDAgODAgODAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+aWNvbi1jYW0tb2ZmbGluZTwvdGl0bGU+CiAgICA8ZGVmcz4KICAgICAgICA8ZmlsdGVyIHg9Ii05My42JSIgeT0iLTkzLjklIiB3aWR0aD0iMjg3LjglIiBoZW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gMTUuNDMyNzcxMywxLjc3MDI4NjgzIDE1Ljk1NzQzNDgsMS43Njc1Njc2NyBaIiBpZD0iUGF0aC01IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMC40NjIzNTEsIDYuNzE3NjU2KSByb3RhdGUoLTQ1LjAwMDAwMCkgdHJhbnNsYXRlKC0xMC40NjIzNTEsIC02LjcxNzY1NikgIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICA8L2c+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4="; 2317 var disconnectImage = new Image(); 2318 disconnectImage.src = imageData; 2319 disconnectImage.style.width = "auto"; 2320 disconnectImage.style.height = this.cont.clientHeight / 2 + 20 + "px"; 2321 disconnectImage.style.maxHeight = "150px"; 2322 disconnectImage.style.border = "none"; 2323 disconnectImage.style.boxShadow = "none"; 2324 disconnectImage.style.borderColor = "transparent"; 2325 disconnectImage.style.zIndex = "1"; 2326 container.appendChild(disconnectImage); 2327 var tooltip = window.document.createElement("span"); 2328 tooltip.style.visibility = "hidden"; 2329 tooltip.style.backgroundColor = "#fff"; 2330 tooltip.style.width = "auto"; 2331 tooltip.innerHTML = "Currently out of order"; 2332 tooltip.style.padding = "5px 15px"; 2333 tooltip.style.color = "#000"; 2334 tooltip.style.borderStyle = "solid"; 2335 tooltip.style.borderRadius = "3px"; 2336 tooltip.style.borderWidth = "1px"; 2337 tooltip.style.borderColor = "#ccc"; 2338 tooltip.style.position = "absolute"; 2339 tooltip.style.zIndex = "2"; 2340 var circle = window.document.createElement("div"); 2341 circle.style.backgroundColor = "transparent";
2342 circle.style.borderRadius = "50%"; 2343 circle.style.position = "absolute"; 2344 circle.style.zIndex = "3"; 2345 container.appendChild(circle); 2346 this.cont.appendChild(container); 2347 circle.style.height = disconnectImage.clientHeight * 60 / 100 + "px"; 2348 circle.style.width = disconnectImage.clientHeight * 60 / 100 + "px"; 2349 circle.addEventListener("mouseover",function(event) { 2350 container.appendChild(tooltip); 2351 tooltip.style.visibility = "visible"; 2352 }); 2353 circle.addEventListener("mousemove",function(event) { 2354 tooltip.style.left = event.clientX + "px"; 2355 var tmp = circle.getBoundingClientRect().top - container.getBoundingClientRect().top; 2356 tooltip.style.top = tmp + "px"; 2357 }); 2358 circle.addEventListener("mouseout",function(event) { 2359 tooltip.remove(); 2360 }); 2361 } 2362 ,tickHandler: function() { 2363 if(this.image != null) { 2364 this.image.animate(); 2365 } 2366 } 2367 ,invalidate: function() { 2368 var positionElementTop = this.element.getBoundingClientRect().top; 2369 if(this.image != null) { 2370 if(window.innerHeight > positionElementTop && positionElementTop > -this.image.getDimension().height) { 2371 this.image.drawHandler(); 2372 } 2373 } 2374 } 2375 ,layout: function() { 2376 var height = this.config.height; 2377 if(height == null && this.data.clippingHeight < 1) { 2378 haxe_Log.trace(this.config.instance,{ fileName : "src/pmax/thumbnail/ThumbnailItem.hx", lineNumber : 395, className : "pmax.thumbnail.ThumbnailItem", methodName : "layout", customParams : [this.config.resolution,this.config.resolution]}); 2379 } 2380 if(height != null) { 2381 var currentResHeight = pmax_etc_Resolution.getHeight(this.config.resolution); 2382 var currentResHeightClipping = currentResHeight * this.data.clippingHeight | 0; 2383 if(currentResHeight != currentResHeightClipping) { 2384 var requiredResHeight = currentResHeight * (currentResHeight / currentResHeightClipping) | 0; 2385 this.config.setResolution(pmax_etc_Resolution.getBestResolution(requiredResHeight)); 2386 this.data.refresh(); 2387 } 2388 this.cont.style.height = height; 2389 return; 2390 } 2391 var resolutionHeight = pmax_etc_Resolution.getHeight(this.config.resolution) * this.data.clippingHeight | 0; 2392 this.cont.style.height = resolutionHeight + "px"; 2393 } 2394 ,logClick: function(config,type) { 2395 if(type == null) { 2396 type = "htmlThumbnailShow"; 2397 } 2398 var logClickCall = new pmax_remoting_JsonInterface(config.apiUrl + "/instances/" + config.instance + "/log-click","POST"); 2399 if(logClickCall.loading) { 2400 return; 2401 } 2402 var sendData = new haxe_ds_StringMap(); 2403 sendData.h["type"] = type; 2404 logClickCall.loadInternal(sendData); 2405 } 2406 ,__class__: pmax_thumbnail_ThumbnailItem 2407}; 2408var pmax_thumbnail_ThumbnailManager = function() { 2409 this._refreshInterval = 60; 2410 this._invalidateInterval = 22; 2411 this._tickInterval = 50; 2412 this._placeTimeout = 150; 2413 this._thumbnailsCount = 0; 2414 this._thumbnails = new haxe_ds_IntMap(); 2415 this._thumbnailsCustomized = new haxe_ds_IntMap(); 2416 this._refreshTimer = new haxe_Timer(this._refreshInterval * 1000); 2417 this._refreshTimer.run = $bind(this,this.refresh); 2418 this._tickTimer = new haxe_Timer(this._tickInterval); 2419 this._tickTimer.run = $bind(this,this.tickHandler); 2420 this._invalidateTimer = new haxe_Timer(this._invalidateInterval); 2421 this._invalidateTimer.run = $bind(this,this.invalidate); 2422 window.onresize = $bind(this,this.onResize); 2423}; 2424pmax_thumbnail_ThumbnailManager.__name__ = true; 2425pmax_thumbnail_ThumbnailManager.prototype = { 2426 place: function(options) { 2427 var _gthis = this; 2428 if(options.id == null && window.document.readyState == "complete") { 2429 return; 2430 } 2431 var thumbnailId = this._thumbnailsCount++; 2432 var config = new pmax_config_ThumbnailConfig(thumbnailId,options); 2433 var data = new pmax_remoting_ThumbnailData(config); 2434 var item = new pmax_thumbnail_ThumbnailItem(this,config,data); 2435 item.removedSignal.addOnce(function() { 2436 _gthis.onRemove(thumbnailId); 2437 }); 2438 if(data.get_customized()) { 2439 this._thumbnailsCustomized.h[thumbnailId] = item; 2440 } else { 2441 this._thumbnails.h[thumbnailId] = item; 2442 } 2443 if(this._placeTimer != null) { 2444 this._placeTimer.stop(); 2445 this._placeTimer = null; 2446 } 2447 this._placeTimer = haxe_Timer.delay($bind(this,this.refresh),this._placeTimeout); 2448 } 2449 ,refresh: function() { 2450 var thumbnail = this._thumbnailsCustomized.iterator(); 2451 while(thumbnail.hasNext()) { 2452 var thumbnail1 = [thumbnail.next()];
2453 haxe_Timer.delay((function(thumbnail) { 2454 return function() { 2455 thumbnail[0].refresh(); 2456 }; 2457 })(thumbnail1),Math.random() * 1000 | 0); 2458 } 2459 var multiData = new pmax_remoting_MultiThumbnailData(this._thumbnails); 2460 multiData.load(); 2461 } 2462 ,invalidate: function() { 2463 var thumbnail = this._thumbnailsCustomized.iterator(); 2464 while(thumbnail.hasNext()) { 2465 var thumbnail1 = thumbnail.next(); 2466 thumbnail1.invalidate(); 2467 } 2468 var thumbnail = this._thumbnails.iterator(); 2469 while(thumbnail.hasNext()) { 2470 var thumbnail1 = thumbnail.next(); 2471 thumbnail1.invalidate(); 2472 } 2473 } 2474 ,tickHandler: function() { 2475 var thumbnail = this._thumbnailsCustomized.iterator(); 2476 while(thumbnail.hasNext()) { 2477 var thumbnail1 = thumbnail.next(); 2478 thumbnail1.tickHandler(); 2479 } 2480 var thumbnail = this._thumbnails.iterator(); 2481 while(thumbnail.hasNext()) { 2482 var thumbnail1 = thumbnail.next(); 2483 thumbnail1.tickHandler(); 2484 } 2485 } 2486 ,onRemove: function(thumbnailId) { 2487 this._thumbnails.remove(thumbnailId); 2488 this._thumbnailsCustomized.remove(thumbnailId); 2489 } 2490 ,onResize: function() { 2491 var thumbnail = this._thumbnailsCustomized.iterator(); 2492 while(thumbnail.hasNext()) { 2493 var thumbnail1 = thumbnail.next(); 2494 thumbnail1.onResize(); 2495 } 2496 var thumbnail = this._thumbnails.iterator(); 2497 while(thumbnail.hasNext()) { 2498 var thumbnail1 = thumbnail.next(); 2499 thumbnail1.onResize(); 2500 } 2501 } 2502 ,__class__: pmax_thumbnail_ThumbnailManager 2503}; 2504var pmax_thumbnail_data_ImageData = function(url,timestamp) { 2505 this.url = url; 2506 this.timestamp = timestamp; 2507}; 2508pmax_thumbnail_data_ImageData.__name__ = true; 2509pmax_thumbnail_data_ImageData.prototype = { 2510 __class__: pmax_thumbnail_data_ImageData 2511}; 2512var pmax_thumbnail_modules_ThumbnailCanvas = function(image,cont) { 2513 this._invalid = false; 2514 this.cont = cont; 2515 this._image = image; 2516 this._context = cont.getContext("2d",null); 2517}; 2518pmax_thumbnail_modules_ThumbnailCanvas.__name__ = true; 2519pmax_thumbnail_modules_ThumbnailCanvas.prototype = { 2520 setDimensions: function(width,height) { 2521 if(this.cont.width == width && this.cont.height == height) { 2522 return; 2523 } 2524 this.cont.width = width; 2525 this.cont.style.width = width + "px"; 2526 this.cont.height = height; 2527 this.cont.style.height = height + "px"; 2528 this.invalidate(); 2529 } 2530 ,destroy: function() { 2531 if(this.cont != null) { 2532 this.cont.remove(); 2533 } 2534 } 2535 ,invalidate: function() { 2536 this._invalid = true; 2537 } 2538 ,getContext: function() { 2539 return this._context; 2540 } 2541 ,drawHandler: function() { 2542 if(this._invalid) { 2543 this._image.draw(); 2544 this._invalid = false; 2545 } 2546 } 2547 ,clear: function() { 2548 this._context.clearRect(0,0,this.cont.width,this.cont.height); 2549 } 2550 ,hide: function() { 2551 this.cont.style.display = "none"; 2552 } 2553 ,show: function() { 2554 this.cont.style.display = "block"; 2555 } 2556 ,__class__: pmax_thumbnail_modules_ThumbnailCanvas 2557}; 2558var pmax_thumbnail_modules_ThumbnailModule = function(item) { 2559 this._item = item; 2560 this.init(); 2561 if(this._item.cont != null && this._cont != null) { 2562 this._item.cont.appendChild(this._cont); 2563 } 2564}; 2565pmax_thumbnail_modules_ThumbnailModule.__name__ = true; 2566pmax_thumbnail_modules_ThumbnailModule.prototype = { 2567 init: function() { 2568 throw haxe_Exception.thrown("init() was not overwritten!"); 2569 } 2570 ,refresh: function() { 2571 throw haxe_Exception.thrown("refresh() was not overwritten!"); 2572 } 2573 ,__class__: pmax_thumbnail_modules_ThumbnailModule 2574}; 2575var pmax_thumbnail_modules_ThumbnailControls = function(item) { 2576 this._timestampFormat = "%d.%m.%Y %H:%M"; 2577 this._timelapseInactiveColor = "#A6D100"; 2578 this._timelapseActiveColor = "#FFFFFF"; 2579 this._showWeather = false; 2580 this._windIconUrl = "data:image/svg+xml;charset=utf-8;base64,PHN2ZyB3aWR0aD0iMTY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4cTAgMTI4IDg4IDIxN3QyMTYgODlxMTI5IDAgMjE3LjUgLTg5dDg4LjUgLTIxN3YtMTA1OHExMTMgLTc5IDE3NSAtMTk2LjV0NjIgLTI1My41cTAgLTE0OCAtNzIuNSAtMjczdC0xOTcuNSAtMTk3LjV0LTI3MyAtNzIuNXEtMTQ3IDAgLTI3MiA3Mi41dC0xOTggMTk3LjV0LTczIDI3M3pNMTg3IDI0NXEwIC0xNDkgMTA0LjUgLTI1NC41dDI1MS41IC0xMDUuNSBxMTQ5IDAgMjU2LjUgMTA3dDEwNy41IDI1M3EwIDEwMCAtNTEuNSAxODQuNXQtMTQwLjUgMTMxLjVsLTMwIDE1cS0xNiA3IC0xNiAzMXYxMTQ2cTAgNTIgLTM2IDg2dC05MCAzNHEtNTIgMCAtODguNSAtMzR0LTM2LjUgLTg2di0xMTQ2cTAgLTI0IC0xNSAtMzFsLTI5IC0xNXEtODggLTQ3IC0xMzcuNSAtMTMxdC00OS41IC0xODV6IiAvPg0KPC9zdmc+"; 2582 pmax_thumbnail_modules_ThumbnailModule.call(this,item); 2583}; 2584pmax_thumbnail_modules_ThumbnailControls.__name__ = true; 2585pmax_thumbnail_modules_ThumbnailControls.__super__ = pmax_thumbnail_modules_ThumbnailModule; 2586pmax_thumbnail_modules_ThumbnailControls.prototype = $extend(pmax_thumbnail_modules_ThumbnailModule.prototype,{ 2587 init: function() { 2588 this._cont = window.document.createElement("span"); 2589 this._cont.style.display = "block"; 2590 this._cont.style.position = "absolute"; 2591 this._cont.style.bottom = "0"; 2592 this._cont.style.left = "0"; 2593 this._cont.style.height = "16px"; 2594 this._cont.style.color = "#FFFFFF"; 2595 this._showWeather = this._item.config.weather && (this._item.data.temperature != null || this._item.data.windSpeed != null); 2596 if(this._showWeather) { 2597 this.initWeatherDisplay(); 2598 } 2599 if(this._item.config.timelapse) { 2600 this.initTimelapseDisplay(); 2601 } 2602 if(this._item.config.showTimestamp || this._item.config.timelapse) { 2603 this.initTimestampDisplay(); 2604 } 2605 this.refresh(); 2606 } 2607 ,initWeatherDisplay: function() { 2608 this._weather = window.document.createElement("span"); 2609 this._weather.style.verticalAlign = "top"; 2610 this._weather.style.backgroundColor = "rgba(0, 0, 0, 0.7)"; 2611 this._weather.style.display = "inline-block"; 2612 this._weather.style.paddingTop = "1px"; 2613 this._weather.style.paddingLeft = "2px"; 2614 this._weather.style.height = "100%"; 2615 this._weather.style.color = "#FFFFFF"; 2616 this._cont.appendChild(this._weather); 2617 var placeholder = window.document.createElement("span"); 2618 placeholder.style.position = "relative"; 2619 placeholder.style.width = "10px"; 2620 placeholder.style.height = "100%"; 2621 placeholder.style.display = "inline-block"; 2622 var triangleWeather = window.document.createElement("span"); 2623 triangleWeather.style.position = "absolute"; 2624 triangleWeather.style.top = "0"; 2625 triangleWeather.style.left = "0"; 2626 triangleWeather.style.width = "0"; 2627 triangleWeather.style.height = "0"; 2628 triangleWeather.style.borderBottom = "16px solid rgba(0, 0, 0, 0.7)"; 2629 triangleWeather.style.borderRight = "10px solid transparent";
2630 placeholder.appendChild(triangleWeather); 2631 if(this._item.config.timelapse) { 2632 this._triangleTimelapseLeft = window.document.createElement("span"); 2633 this._triangleTimelapseLeft.style.position = "absolute"; 2634 this._triangleTimelapseLeft.style.top = "0"; 2635 this._triangleTimelapseLeft.style.left = "0"; 2636 this._triangleTimelapseLeft.style.width = "0"; 2637 this._triangleTimelapseLeft.style.height = "0"; 2638 this._triangleTimelapseLeft.style.borderTop = "16px solid #A6D100"; 2639 this._triangleTimelapseLeft.style.borderLeft = "10px solid transparent"; 2640 placeholder.appendChild(this._triangleTimelapseLeft); 2641 } 2642 this._cont.appendChild(placeholder); 2643 } 2644 ,initTimelapseDisplay: function() { 2645 this._timelapse = window.document.createElement("span"); 2646 this._timelapse.style.position = "relative"; 2647 this._timelapse.style.backgroundColor = this._timelapseInactiveColor; 2648 this._timelapse.style.width = "28px"; 2649 this._timelapse.style.height = "100%"; 2650 this._timelapse.style.display = "inline-block"; 2651 var timelapsePlayLeft = window.document.createElement("span"); 2652 timelapsePlayLeft.style.position = "absolute"; 2653 timelapsePlayLeft.style.top = "3px"; 2654 timelapsePlayLeft.style.left = "10px"; 2655 timelapsePlayLeft.style.width = "0"; 2656 timelapsePlayLeft.style.height = "0"; 2657 timelapsePlayLeft.style.borderTop = "5px solid transparent"; 2658 timelapsePlayLeft.style.borderLeft = "5px solid #000"; 2659 timelapsePlayLeft.style.borderBottom = "5px solid transparent"; 2660 this._timelapse.appendChild(timelapsePlayLeft); 2661 var timelapsePlayRight = window.document.createElement("span"); 2662 timelapsePlayRight.style.position = "absolute"; 2663 timelapsePlayRight.style.top = "3px"; 2664 timelapsePlayRight.style.left = "15px"; 2665 timelapsePlayRight.style.width = "0"; 2666 timelapsePlayRight.style.height = "0"; 2667 timelapsePlayRight.style.borderTop = "5px solid transparent"; 2668 timelapsePlayRight.style.borderLeft = "5px solid #000"; 2669 timelapsePlayRight.style.borderBottom = "5px solid transparent"; 2670 this._timelapse.appendChild(timelapsePlayRight); 2671 this._triangleTimelapseRight = window.document.createElement("span"); 2672 this._triangleTimelapseRight.style.position = "absolute"; 2673 this._triangleTimelapseRight.style.top = "0"; 2674 this._triangleTimelapseRight.style.right = "-10px"; 2675 this._triangleTimelapseRight.style.width = "0"; 2676 this._triangleTimelapseRight.style.height = "0"; 2677 this._triangleTimelapseRight.style.borderBottom = "16px solid " + this._timelapseInactiveColor; 2678 this._triangleTimelapseRight.style.borderRight = "10px solid transparent"; 2679 this._timelapse.appendChild(this._triangleTimelapseRight); 2680 this._timelapse.addEventListener("mouseenter",$bind(this,this.startTimelapse)); 2681 this._timelapse.addEventListener("mouseleave",$bind(this,this.stopTimelapse)); 2682 this._cont.appendChild(this._timelapse); 2683 } 2684 ,initTimestampDisplay: function() { 2685 this._timestampCont = window.document.createElement("span"); 2686 this._timestampCont.style.position = "relative"; 2687 this._timestampCont.style.verticalAlign = "top"; 2688 this._timestampCont.style.backgroundColor = "rgba(0, 0, 0, 0.7)"; 2689 this._timestampCont.style.paddingTop = "1px"; 2690 this._timestampCont.style.paddingRight = "2px"; 2691 this._timestampCont.style.height = "100%"; 2692 this._timestampCont.style.display = "inline-block"; 2693 this._timestampCont.style.paddingLeft = "3px"; 2694 this._timestampCont.style.color = "#FFFFFF"; 2695 if(this._item.config.timelapse) { 2696 this._timestampCont.style.marginLeft = "10px"; 2697 } else if(this._showWeather) { 2698 this._timestampCont.style.marginLeft = "2px"; 2699 } 2700 if(this._item.config.timelapse || this._showWeather) { 2701 this._timestampCont.style.paddingLeft = "0"; 2702 var triangleTimestampLeft = window.document.createElement("span"); 2703 triangleTimestampLeft.style.position = "absolute"; 2704 triangleTimestampLeft.style.top = "0"; 2705 triangleTimestampLeft.style.left = "-10px"; 2706 triangleTimestampLeft.style.width = "0"; 2707 triangleTimestampLeft.style.height = "0"; 2708 triangleTimestampLeft.style.borderTop = "16px solid rgba(0, 0, 0, 0.7)"; 2709 triangleTimestampLeft.style.borderLeft = "10px solid transparent";
2710 this._timestampCont.appendChild(triangleTimestampLeft); 2711 } 2712 var triangleTimestampRight = window.document.createElement("span"); 2713 triangleTimestampRight.style.position = "absolute"; 2714 triangleTimestampRight.style.top = "0"; 2715 triangleTimestampRight.style.left = "100%"; 2716 triangleTimestampRight.style.width = "0"; 2717 triangleTimestampRight.style.height = "0"; 2718 triangleTimestampRight.style.borderBottom = "16px solid rgba(0, 0, 0, 0.7)"; 2719 triangleTimestampRight.style.borderRight = "10px solid transparent"; 2720 this._timestampCont.appendChild(triangleTimestampRight); 2721 this._timestamp = window.document.createElement("span"); 2722 this._timestamp.style.color = "#FFFFFF"; 2723 this._timestampCont.appendChild(this._timestamp); 2724 this._cont.appendChild(this._timestampCont); 2725 } 2726 ,refresh: function() { 2727 if(this._item.config.weather) { 2728 var weatherText = []; 2729 if(this._item.data.temperature != null) { 2730 var thermometerIcon = new Image(); 2731 thermometerIcon.src = this._thermometerIconUrl; 2732 thermometerIcon.style.verticalAlign = "top"; 2733 thermometerIcon.style.width = "14px"; 2734 thermometerIcon.style.height = "14px"; 2735 thermometerIcon.style.transform = "rotate(180deg)"; 2736 thermometerIcon.style.boxShadow = "none"; 2737 thermometerIcon.style.border = "none"; 2738 thermometerIcon.style.setProperty("margin","0","important"); 2739 weatherText.push(thermometerIcon.outerHTML); 2740 weatherText.push(this._item.data.temperature + "°C"); 2741 } 2742 if(this._item.data.windSpeed != null) { 2743 var windIcon = new Image(); 2744 windIcon.src = this._windIconUrl; 2745 windIcon.style.verticalAlign = "top"; 2746 windIcon.style.width = "14px"; 2747 windIcon.style.height = "14px"; 2748 windIcon.style.boxShadow = "none"; 2749 windIcon.style.border = "none"; 2750 windIcon.style.setProperty("margin","0","important"); 2751 if(this._item.data.windDirection != null) { 2752 windIcon.style.transform = "rotate(" + (this._item.data.windDirection + 180) + "deg)"; 2753 } else { 2754 windIcon.style.transform = "rotate(-135deg)"; 2755 } 2756 if(this._item.data.temperature != null) { 2757 windIcon.style.marginLeft = "5px"; 2758 } 2759 weatherText.push(windIcon.outerHTML); 2760 weatherText.push(this._item.data.windSpeed + " km/h"); 2761 } 2762 if(weatherText.length > 0) { 2763 this._weather.innerHTML = weatherText.join(" "); 2764 } 2765 } 2766 if(this._item.config.timelapse) { 2767 if(this._item.timelapse.get_running() || this._item.config.showTimestamp) { 2768 if(this._item.image != null && this._item.image.currentImage != null) { 2769 this._timestampCont.style.display = "inline-block"; 2770 var currentImageData = this._item.data.urlTimestampMap.h[this._item.image.currentImage.src]; 2771 this._timestamp.innerHTML = DateTools.format(currentImageData.timestamp,this._timestampFormat); 2772 } 2773 } else { 2774 this._timestampCont.style.display = "none"; 2775 } 2776 } else if(this._item.config.showTimestamp && this._item.image != null) { 2777 var currentImageData = this._item.data.urlTimestampMap.h[this._item.image.currentImage.src]; 2778 if(this._timestamp != null && currentImageData != null) { 2779 this._timestamp.innerHTML = DateTools.format(currentImageData.timestamp,this._timestampFormat); 2780 } 2781 } 2782 } 2783 ,startTimelapse: function() { 2784 this._timelapse.style.backgroundColor = this._timelapseActiveColor; 2785 if(this._triangleTimelapseLeft != null) { 2786 this._triangleTimelapseLeft.style.borderTopColor = this._timelapseActiveColor; 2787 } 2788 this._triangleTimelapseRight.style.borderBottomColor = this._timelapseActiveColor; 2789 this._item.timelapse.startTimelapse(); 2790 } 2791 ,stopTimelapse: function() { 2792 this._timelapse.style.backgroundColor = this._timelapseInactiveColor; 2793 if(this._triangleTimelapseLeft != null) { 2794 this._triangleTimelapseLeft.style.borderTopColor = this._timelapseInactiveColor; 2795 } 2796 this._triangleTimelapseRight.style.borderBottomColor = this._timelapseInactiveColor; 2797 this._item.timelapse.stopTimelapse(); 2798 } 2799 ,__class__: pmax_thumbnail_modules_ThumbnailControls 2800}); 2801var pmax_thumbnail_modules_ThumbnailDetails = function(item) { 2802 pmax_thumbnail_modules_ThumbnailModule.call(this,item); 2803}; 2804pmax_thumbnail_modules_ThumbnailDetails.__name__ = true; 2805pmax_thumbnail_modules_ThumbnailDetails.__super__ = pmax_thumbnail_modules_ThumbnailModule; 2806pmax_thumbnail_modules_ThumbnailDetails.prototype = $extend(pmax_thumbnail_modules_ThumbnailModule.prototype,{ 2807 init: function() {
2808 var _gthis = this; 2809 this._cont = window.document.createElement("span"); 2810 this._cont.style.display = "block"; 2811 this._cont.style.position = "absolute"; 2812 this._cont.style.top = "0"; 2813 this._cont.style.left = "0"; 2814 this._cont.style.height = "18px"; 2815 this._cont.style.width = "100%"; 2816 this._cont.style.boxSizing = "border-box"; 2817 this._cont.style.whiteSpace = "nowrap"; 2818 this._cont.style.textAlign = "left"; 2819 this._cont.style.paddingRight = "10px"; 2820 if(this._item.config.map && this._item.cont.offsetHeight <= 90) { 2821 this._cont.style.paddingRight = "100px"; 2822 } 2823 if(this._item.config.instanceLogo && this._item.data.logoUrl != null) { 2824 var logoHeight = Math.log(this._item.cont.clientHeight) * 15 - 35 | 0; 2825 this._logo = new Image(); 2826 this._logo.src = this._item.data.logoUrl; 2827 this._logo.style.maxHeight = logoHeight + "px"; 2828 this._logo.style.width = "auto"; 2829 this._logo.style.margin = "0"; 2830 this._logo.style.marginTop = "2px"; 2831 this._logo.style.marginLeft = "2px"; 2832 this._logo.style.boxShadow = "none"; 2833 this._logo.style.border = "none"; 2834 if(this._item.config.instanceName && this._item.data.instanceName != null) { 2835 this._logo.style.position = "absolute"; 2836 this._logo.style.top = "100%"; 2837 } 2838 this._cont.appendChild(this._logo); 2839 } 2840 if(this._item.config.instanceName && this._item.data.instanceName != null) { 2841 this._backgroundText = window.document.createElement("span"); 2842 this._backgroundText.style.display = "inline-block"; 2843 this._backgroundText.style.backgroundColor = "rgba(0, 0, 0, 0.7)"; 2844 this._backgroundText.style.height = "18px"; 2845 this._backgroundText.style.position = "relative"; 2846 this._backgroundText.style.verticalAlign = "top"; 2847 this._backgroundText.style.maxWidth = "100%"; 2848 this._backgroundText.style.paddingTop = "1px"; 2849 this._backgroundText.style.paddingLeft = "2px"; 2850 this._instanceName = window.document.createElement("span"); 2851 this._instanceName.style.display = "inline-block"; 2852 this._instanceName.style.margin = " 0 5px"; 2853 this._instanceName.style.verticalAlign = "middle"; 2854 this._instanceName.style.whiteSpace = "nowrap"; 2855 this._instanceName.style.overflow = "hidden"; 2856 this._instanceName.style.textOverflow = "ellipsis"; 2857 this._instanceName.style.textDecoration = "none"; 2858 this._instanceName.style.color = "#FFFFFF"; 2859 this._backgroundText.appendChild(this._instanceName); 2860 var triangle = window.document.createElement("span"); 2861 triangle.style.position = "absolute"; 2862 triangle.style.top = "0"; 2863 triangle.style.right = "-11px"; 2864 triangle.style.width = "0"; 2865 triangle.style.height = "0"; 2866 triangle.style.borderTop = "18px solid rgba(0, 0, 0, 0.7)"; 2867 triangle.style.borderRight = "11px solid transparent"; 2868 this._backgroundText.appendChild(triangle); 2869 this._cont.appendChild(this._backgroundText); 2870 if(this._item.config.countryFlag && this._item.data.country != "world") { 2871 this._flag = new Image(); 2872 this._flag.src = this._item.config.countryFlagUrl + this._item.data.country + ".gif"; 2873 this._flag.addEventListener("load",function(event) { 2874 _gthis._flag.style.width = _gthis._flag.naturalWidth + "px"; 2875 _gthis._flag.style.height = _gthis._flag.naturalHeight + "px"; 2876 }); 2877 this._flag.style.display = "inline-block"; 2878 this._flag.style.verticalAlign = "middle"; 2879 this._flag.style.height = "auto"; 2880 this._flag.style.width = "auto"; 2881 this._flag.style.margin = "2px 1px 2px 5px"; 2882 this._flag.style.border = "0.5px solid rgba(255,255,255,0.5)"; 2883 this._flag.style.boxShadow = "none"; 2884 this._backgroundText.insertBefore(this._flag,this._instanceName); 2885 } 2886 } 2887 this.refresh(); 2888 } 2889 ,refresh: function() { 2890 if(this._logo != null) { 2891 this._logo.src = this._item.data.logoUrl; 2892 } 2893 if(this._instanceName != null) { 2894 this._instanceName.innerText = this._item.data.instanceName; 2895 } 2896 } 2897 ,__class__: pmax_thumbnail_modules_ThumbnailDetails 2898}); 2899var pmax_thumbnail_modules_ThumbnailImage = function(item) { 2900 this._fadingTimerInterval = 20; 2901 this._fadingOpacityStep = 10; 2902 this._animationOffset = 0; 2903 this._animationIncrement = -1; 2904 this._animationStopped = false;
2905 this._firstAnimation = true; 2906 pmax_thumbnail_modules_ThumbnailModule.call(this,item); 2907}; 2908pmax_thumbnail_modules_ThumbnailImage.__name__ = true; 2909pmax_thumbnail_modules_ThumbnailImage.__super__ = pmax_thumbnail_modules_ThumbnailModule; 2910pmax_thumbnail_modules_ThumbnailImage.prototype = $extend(pmax_thumbnail_modules_ThumbnailModule.prototype,{ 2911 init: function() { 2912 this._cont = window.document.createElement("span"); 2913 this._cont.style.display = "block"; 2914 this._cont.style.whiteSpace = "nowrap"; 2915 this._cont.style.height = "100%"; 2916 this.currentImage = new Image(); 2917 this._loadingImagesMap = new haxe_ds_StringMap(); 2918 this._loadedImagesMap = new haxe_ds_StringMap(); 2919 this.refresh(); 2920 } 2921 ,refresh: function() { 2922 var imageUrl = this._item.data.recentImage.url; 2923 this.showImage(imageUrl); 2924 } 2925 ,getImageOffset: function() { 2926 if(this._item.data.initialDirection == null || this._item.data.zeroDirection == null || this._item.data.viewAngle == null) { 2927 return 0; 2928 } 2929 var imageDimensions = this.getDimension(); 2930 var degreesToMove = -(this._item.data.initialDirection - this._item.data.zeroDirection + this._item.data.viewAngle / 2); 2931 var pixelsToMove = degreesToMove / this._item.data.viewAngle * imageDimensions.width + this._item.cont.offsetWidth / 2; 2932 while(pixelsToMove > 0) pixelsToMove -= imageDimensions.width; 2933 return pixelsToMove; 2934 } 2935 ,getLoadedImages: function() { 2936 var loadedImages = []; 2937 var h = this._loadedImagesMap.h; 2938 var imageUrl_h = h; 2939 var imageUrl_keys = Object.keys(h); 2940 var imageUrl_length = imageUrl_keys.length; 2941 var imageUrl_current = 0; 2942 while(imageUrl_current < imageUrl_length) { 2943 var imageUrl = imageUrl_keys[imageUrl_current++]; 2944 loadedImages.push(imageUrl); 2945 } 2946 loadedImages.sort(function(a,b) { 2947 return Reflect.compare(a.toLowerCase(),b.toLowerCase()); 2948 }); 2949 return loadedImages; 2950 } 2951 ,loadImage: function(imageUrl,onLoad) { 2952 var _gthis = this; 2953 if(Object.prototype.hasOwnProperty.call(this._loadedImagesMap.h,imageUrl)) { 2954 if(onLoad != null) { 2955 onLoad(); 2956 } 2957 return; 2958 } 2959 if(Object.prototype.hasOwnProperty.call(this._loadingImagesMap.h,imageUrl)) { 2960 return; 2961 } 2962 var image = new Image(); 2963 image.src = imageUrl; 2964 image.onload = function() { 2965 _gthis._loadedImagesMap.h[imageUrl] = image; 2966 var _this = _gthis._loadingImagesMap; 2967 if(Object.prototype.hasOwnProperty.call(_this.h,imageUrl)) { 2968 delete(_this.h[imageUrl]); 2969 } 2970 if(onLoad != null) { 2971 onLoad(); 2972 } 2973 }; 2974 this._loadingImagesMap.h[imageUrl] = image; 2975 } 2976 ,showImage: function(imageUrl,fadeOut) { 2977 if(fadeOut == null) { 2978 fadeOut = false;
2979 } 2980 var _gthis = this; 2981 if(imageUrl == this.currentImage.src) { 2982 return; 2983 } 2984 this._previousImage = new Image(); 2985 this._previousImage.src = this.currentImage.src; 2986 this.loadImage(imageUrl,function() { 2987 _gthis.currentImage.src = imageUrl; 2988 if(_gthis._item.controls != null) { 2989 _gthis._item.controls.refresh(); 2990 } 2991 if(_gthis._canvas == null) { 2992 _gthis.initCanvas(); 2993 } 2994 _gthis.resize(); 2995 if(fadeOut) { 2996 _gthis.fadeOut(); 2997 } else { 2998 _gthis.draw(); 2999 _gthis.startAnimation(); 3000 } 3001 haxe_Timer.delay(function() { 3002 _gthis._item.logClick(_gthis._item.config); 3003 },1500); 3004 }); 3005 } 3006 ,fadeOut: function() { 3007 var _gthis = this; 3008 if(this._fadingTimer != null) { 3009 this._fadingTimer.stop(); 3010 } 3011 var opacity = 100; 3012 this._fadingTimer = new haxe_Timer(this._fadingTimerInterval); 3013 this._fadingTimer.run = function() { 3014 opacity -= _gthis._fadingOpacityStep; 3015 if(opacity <= 0) { 3016 opacity = 0; 3017 } 3018 _gthis.draw(_gthis.currentImage,1); 3019 _gthis.draw(_gthis._previousImage,opacity / 100); 3020 if(opacity <= 0) { 3021 _gthis._fadingTimer.stop(); 3022 } 3023 }; 3024 } 3025 ,resize: function() { 3026 if(this._canvas == null) { 3027 return; 3028 } 3029 this._canvas.setDimensions(this._cont.offsetWidth,this._cont.offsetHeight); 3030 } 3031 ,clear: function() { 3032 if(this._canvas == null) { 3033 return; 3034 } 3035 this._canvas.clear(); 3036 } 3037 ,drawHandler: function() { 3038 if(this._canvas == null) { 3039 return; 3040 } 3041 this._canvas.drawHandler(); 3042 } 3043 ,draw: function(drawImage,opacity) { 3044 if(opacity == null) { 3045 opacity = 1; 3046 } 3047 if(this._canvas == null) { 3048 return; 3049 } 3050 if(drawImage == null) { 3051 drawImage = this.currentImage; 3052 } 3053 var imageCount = 1; 3054 var dimension = this.getDimension(drawImage); 3055 if(this._item.config.continuous) { 3056 imageCount += Math.ceil(this._item.cont.offsetWidth / dimension.width); 3057 } else { 3058 this._item.cont.style.maxWidth = Std.string(dimension.width + "px"); 3059 this.resize(); 3060 } 3061 this._canvas.getContext().globalAlpha = opacity; 3062 var _g = 0; 3063 var _g1 = imageCount; 3064 while(_g < _g1) { 3065 var i = _g++; 3066 this._canvas.getContext().drawImage(drawImage,this._item.data.clippingX * drawImage.width | 0,this._item.data.clippingY * drawImage.height | 0,this._item.data.clippingWidth * drawImage.width | 0,this._item.data.clippingHeight * drawImage.height | 0,i * dimension.width + this._animationOffset,0,dimension.width,dimension.height); 3067 } 3068 } 3069 ,initCanvas: function() { 3070 var canvasElem = window.document.createElement("canvas"); 3071 if(this._canvas == null) { 3072 this._canvas = new pmax_thumbnail_modules_ThumbnailCanvas(this,canvasElem); 3073 } else { 3074 this._canvas.cont = canvasElem; 3075 } 3076 this._cont.appendChild(canvasElem); 3077 } 3078 ,startAnimation: function() { 3079 this._animationStopped = false; 3080 } 3081 ,stopAnimation: function() { 3082 this._animationStopped = true; 3083 } 3084 ,getDimension: function(image) { 3085 if(image == null) { 3086 image = this.currentImage; 3087 } 3088 var imageWidth = this._item.data.clippingWidth * image.width | 0; 3089 var imageHeight = this._item.data.clippingHeight * image.height | 0; 3090 var imageRatio = imageWidth / imageHeight; 3091 var itemWidth = this._cont.offsetWidth; 3092 var itemHeight = this._cont.offsetHeight; 3093 if(imageHeight != itemHeight) { 3094 imageHeight = itemHeight; 3095 imageWidth = Math.ceil(imageHeight * imageRatio); 3096 } 3097 return new pmax_etc_Dimension(imageWidth,imageHeight); 3098 } 3099 ,animate: function() { 3100 if(this._animationStopped || this._canvas == null || this.currentImage == null) { 3101 return; 3102 } 3103 var oldAnimationOfffset = this._animationOffset; 3104 this._animationOffset += this._animationIncrement; 3105 if(this._firstAnimation) { 3106 this._animationOffset += this.getImageOffset() | 0; 3107 this._firstAnimation = false; 3108 } 3109 var dimensions = this.getDimension(); 3110 if(this._item.config.continuous) { 3111 if(this._animationOffset < -dimensions.width) { 3112 this._animationOffset += dimensions.width; 3113 } 3114 } else if(this._item.cont.offsetWidth >= dimensions.width || dimensions.width - this._item.cont.offsetWidth < dimensions.width * 0.2) { 3115 this._animationOffset = Math.round(this._item.cont.offsetWidth / 2 - dimensions.width / 2); 3116 } else if(this._animationOffset <= this._item.cont.offsetWidth - dimensions.width || this._animationOffset >= 0) { 3117 if(this._animationOffset > 0) { 3118 this._animationOffset = 0; 3119 } 3120 if(this._animationOffset < this._item.cont.offsetWidth - dimensions.width) { 3121 this._animationOffset = this._item.cont.offsetWidth - dimensions.width; 3122 } 3123 this._animationIncrement *= -1; 3124 } 3125 if(oldAnimationOfffset != this._animationOffset) { 3126 this._canvas.invalidate(); 3127 } 3128 } 3129 ,__class__: pmax_thumbnail_modules_ThumbnailImage 3130}); 3131var pmax_thumbnail_modules_ThumbnailMap = function(item) { 3132 pmax_thumbnail_modules_ThumbnailModule.call(this,item); 3133}; 3134pmax_thumbnail_modules_ThumbnailMap.__name__ = true; 3135pmax_thumbnail_modules_ThumbnailMap.__super__ = pmax_thumbnail_modules_ThumbnailModule; 3136pmax_thumbnail_modules_ThumbnailMap.prototype = $extend(pmax_thumbnail_modules_ThumbnailModule.prototype,{ 3137 init: function() { 3138 if(this._item.data.country == null && !this._item.data.tourCam || this._item.data.latitude == null || this._item.data.longitude == null) { 3139 return; 3140 } 3141 this._mapStorage = new pmax_etc_MapStorage(); 3142 this._cont = window.document.createElement("span"); 3143 this._cont.style.display = "block"; 3144 this._cont.style.position = "absolute"; 3145 this._cont.style.right = "0"; 3146 this._cont.style.bottom = "0"; 3147 this._cont.style.width = "90px"; 3148 this._cont.style.height = "75px"; 3149 this._mapContainer = window.document.createElement("span"); 3150 this._mapContainer.style.display = "block"; 3151 this._mapContainer.style.position = "absolute"; 3152 this._mapContainer.style.bottom = "5px"; 3153 this._mapContainer.style.right = "5px"; 3154 this._mapContainer.style.maxWidth = "85px"; 3155 this._mapContainer.style.maxHeight = "65px"; 3156 this._mapContainer.style.fontSize = "0"; 3157 this._mapContainer.style.width = "85px"; 3158 this._mapContainer.style.textAlign = "right"; 3159 this._map = new Image(); 3160 this._map.style.boxShadow = "none"; 3161 this._map.style.border = "none"; 3162 this._map.style.setProperty("margin","0","important"); 3163 this._map.style.transition = "none"; 3164 this._map.style.display = "inline-block"; 3165 this._pointer = window.document.createElement("span"); 3166 this._pointer.style.display = "block"; 3167 this._pointer.style.width = "4px"; 3168 this._pointer.style.height = "4px"; 3169 this._pointer.style.backgroundColor = "#A6D100"; 3170 this._pointer.style.border = "1px solid #000"; 3171 this._pointer.style.position = "absolute"; 3172 this._pointer.style.borderRadius = "50%"; 3173 this._pointer.style.boxSizing = "content-box"; 3174 this._mapContainer.appendChild(this._map); 3175 this._mapContainer.appendChild(this._pointer); 3176 this._cont.appendChild(this._mapContainer); 3177 this.refresh(); 3178 } 3179 ,setPointer: function(latitude,longitude) { 3180 var latTop = this._item.data.countryLatitudeMin; 3181 var latBottom = this._item.data.countryLatitudeMax; 3182 var normLat = latitude - latTop; 3183 var normLatBottom = latBottom - latTop; 3184 var diff = 0; 3185 var offset = 0; 3186 if(this._item.data.tourCam) { 3187 if(latitude > 0) { 3188 diff = -90 / latBottom; 3189 offset = diff / 10; 3190 } else { 3191 diff = 90 / latTop; 3192 offset = diff / 100; 3193 } 3194 } 3195 var latPercentage = normLat / normLatBottom; 3196 var lngLeft = this._item.data.countryLongitudeMin; 3197 var lngRight = this._item.data.countryLongitudeMax; 3198 var normLng = longitude - lngLeft; 3199 var normLngRight = lngRight - lngLeft; 3200 var lngPercentage = normLng / normLngRight; 3201 var bottomOffset = 1 - (latPercentage + offset); 3202 var rightOffset = 1 - lngPercentage; 3203 this._pointer.style.bottom = bottomOffset * this._map.offsetHeight - this._pointer.offsetHeight / 2 + "px"; 3204 this._pointer.style.right = rightOffset * this._map.offsetWidth - this._pointer.offsetWidth / 2 + "px"; 3205 } 3206 ,refresh: function() {
3207 var _gthis = this; 3208 if(this._cont == null || this._map == null) { 3209 return; 3210 } 3211 var country = this._item.data.country; 3212 if(this._item.data.tourCam) { 3213 country = "world"; 3214 } 3215 if(country == null || country == "") { 3216 return; 3217 } 3218 var mapUrl = this._mapStorage.getMap(country); 3219 if(mapUrl == null) { 3220 this._cont.style.display = "none"; 3221 return; 3222 } else { 3223 this._cont.style.display = "block"; 3224 } 3225 this._map.onload = function() { 3226 _gthis._map.style.height = _gthis._map.offsetHeight + "px"; 3227 _gthis._map.style.width = _gthis._map.offsetWidth + "px"; 3228 _gthis.fitMap(); 3229 if(_gthis._item.data.latitude != null && _gthis._item.data.longitude != null) { 3230 _gthis.setPointer(_gthis._item.data.latitude,_gthis._item.data.longitude); 3231 } 3232 }; 3233 if(mapUrl != this._map.src) { 3234 this._map.src = mapUrl; 3235 } 3236 } 3237 ,fitMap: function() { 3238 var maxWidth = 85; 3239 var maxHeight = 65; 3240 var mapWidth = this._map.offsetWidth; 3241 var mapHeight = this._map.offsetHeight; 3242 if(mapWidth > maxWidth) { 3243 var ratio = maxWidth / this._map.offsetWidth; 3244 this._map.style.width = maxWidth + "px"; 3245 this._map.style.height = Math.round(this._map.offsetHeight * ratio) + "px"; 3246 } 3247 mapWidth = this._map.offsetWidth; 3248 mapHeight = this._map.offsetHeight; 3249 if(mapHeight > maxHeight) { 3250 var ratio = maxHeight / this._map.offsetHeight; 3251 this._map.style.height = maxHeight + "px"; 3252 this._map.style.width = Math.round(this._map.offsetWidth * ratio) + "px"; 3253 } 3254 } 3255 ,__class__: pmax_thumbnail_modules_ThumbnailMap 3256}); 3257var pmax_thumbnail_modules_ThumbnailTimelapse = function(item) { 3258 this._timelapseTime = 150; 3259 this._timelapseTimer = null; 3260 this._imagesBatchLoad = 7; 3261 pmax_thumbnail_modules_ThumbnailModule.call(this,item); 3262}; 3263pmax_thumbnail_modules_ThumbnailTimelapse.__name__ = true; 3264pmax_thumbnail_modules_ThumbnailTimelapse.__super__ = pmax_thumbnail_modules_ThumbnailModule; 3265pmax_thumbnail_modules_ThumbnailTimelapse.prototype = $extend(pmax_thumbnail_modules_ThumbnailModule.prototype,{ 3266 init: function() { 3267 this._cont = window.document.createElement("span"); 3268 this._cont.style.width = "100%"; 3269 this._cont.style.height = "3px"; 3270 this._cont.style.background = "#A6D100"; 3271 this._cont.style.position = "absolute"; 3272 this._cont.style.bottom = "0"; 3273 this._cont.style.left = "0"; 3274 this.refresh(); 3275 } 3276 ,refresh: function() { 3277 if(!this.get_running()) { 3278 this._cont.style.display = "none"; 3279 return; 3280 } 3281 this._cont.style.display = "block"; 3282 var progressInTimelapse = this._timelapseIndex / (this._tmpLoadedImages.length - 1); 3283 if(progressInTimelapse == 0) { 3284 this._cont.style.removeProperty("transition"); 3285 } else { 3286 this._cont.style.transition = "width " + this._timelapseTime + "ms linear"; 3287 } 3288 this._cont.style.width = progressInTimelapse * 100 + "%"; 3289 } 3290 ,startTimelapse: function() { 3291 if(this._timelapseTimer == null) { 3292 this._originalImage = this._item.data.recentImage; 3293 this._timelapseIndex = 0; 3294 this._tmpLoadedImages = []; 3295 this._timelapseLoadTimers = []; 3296 if(this._item.image.getLoadedImages().length < this._item.data.dayImages.length) { 3297 this.loadTimelapseImages(); 3298 } 3299 this._item.image.stopAnimation(); 3300 this._timelapseTimer = new haxe_Timer(this._timelapseTime); 3301 this._timelapseTimer.run = $bind(this,this.timelapseAction); 3302 } 3303 } 3304 ,stopTimelapse: function() { 3305 this._timelapseTimer.stop(); 3306 this._timelapseTimer = null; 3307 if(this._timelapseLoadTimers.length > 0) { 3308 var _g = 0; 3309 var _g1 = this._timelapseLoadTimers; 3310 while(_g < _g1.length) { 3311 var timer = _g1[_g]; 3312 ++_g; 3313 timer.stop(); 3314 } 3315 } 3316 this._item.image.showImage(this._originalImage.url); 3317 this._item.image.startAnimation(); 3318 this._originalImage = null; 3319 this.refresh(); 3320 } 3321 ,timelapseAction: function() { 3322 if(this._timelapseIndex <= 1) { 3323 this._tmpLoadedImages = this._item.image.getLoadedImages(); 3324 if(this._tmpLoadedImages.length <= 2) { 3325 return; 3326 } 3327 } 3328 if(this._timelapseIndex >= this._tmpLoadedImages.length) { 3329 this._timelapseIndex = 0; 3330 } 3331 this._item.image.showImage(this._tmpLoadedImages[this._timelapseIndex],true); 3332 this.refresh(); 3333 this._timelapseIndex++; 3334 } 3335 ,loadTimelapseImages: function() {
3336 var _gthis = this; 3337 var imagesToLoad = this._imagesBatchLoad; 3338 var imagesLength = this._item.data.dayImages.length; 3339 var imageStep = Math.ceil(imagesLength / imagesToLoad); 3340 var _g = 0; 3341 var _g1 = imageStep; 3342 while(_g < _g1) { 3343 var i = _g++; 3344 var batch = [imageStep - i - 1]; 3345 this._timelapseLoadTimers.push(haxe_Timer.delay((function(batch) { 3346 return function() { 3347 if(_gthis._timelapseTimer == null) { 3348 return; 3349 } 3350 var _g = 0; 3351 var _g1 = imagesLength; 3352 while(_g < _g1) { 3353 var i = _g++; 3354 if(imagesLength <= imagesToLoad) { 3355 _gthis._item.image.loadImage(_gthis._item.data.dayImages[i].url); 3356 } else if(i % imageStep == batch[0]) { 3357 _gthis._item.image.loadImage(_gthis._item.data.dayImages[i].url); 3358 } 3359 } 3360 }; 3361 })(batch),500 * (imageStep - batch[0] - 1) + 1)); 3362 } 3363 } 3364 ,get_running: function() { 3365 return this._timelapseTimer != null; 3366 } 3367 ,__class__: pmax_thumbnail_modules_ThumbnailTimelapse 3368}); 3369function $getIterator(o) { if( o instanceof Array ) return new haxe_iterators_ArrayIterator(o); else return o.iterator(); } 3370function $bind(o,m) { if( m == null ) return null; if( m.__id__ == null ) m.__id__ = $global.$haxeUID++; var f; if( o.hx__closures__ == null ) o.hx__closures__ = {}; else f = o.hx__closures__[m.__id__]; if( f == null ) { f = m.bind(o); o.hx__closures__[m.__id__] = f; } return f; } 3371$global.$haxeUID |= 0; 3372if(typeof(performance) != "undefined" ? typeof(performance.now) == "function" : false) { 3373 HxOverrides.now = performance.now.bind(performance); 3374} 3375Object.defineProperty(String.prototype,"__class__",{ value : String, enumerable : false, writable : true}); 3376String.__name__ = true; 3377Array.__name__ = true; 3378Date.prototype.__class__ = Date; 3379Date.__name__ = "Date"; 3380var Int = { }; 3381var Dynamic = { }; 3382var Float = Number; 3383var Bool = Boolean; 3384var Class = { }; 3385var Enum = { }; 3386js_Boot.__toStr = ({ }).toString; 3387msignal_SlotList.NIL = new msignal_SlotList(null,null); 3388DateTools.DAY_SHORT_NAMES = ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]; 3389DateTools.DAY_NAMES = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]; 3390DateTools.MONTH_SHORT_NAMES = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]; 3391DateTools.MONTH_NAMES = ["January","February","March","April","May","June","July","August","September","October","November","December"]; 3392pmax_Pmax.apiUrl = "https://api.panomax.com/1.0"; 3393pmax_Pmax.staticUrl = "https://static.panomax.com/front/thumbnail"; 3394pmax_Pmax.failoverThumbnailImageBaseUrl = "https://panodata-alternate.panomax.com/cams"; 3395pmax_PmaxHelper._pmaxWindowKey = "PmaxThumbnailPmax"; 3396PmaxThumbnail.main(); 3397})(typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this); 3398var PmaxGThumb = $hx_exports["PmaxGThumb"]; 3399var PmaxThumbnail = $hx_exports["PmaxThumbnail"]; 3400 3401//# sourceMappingURL=pmaxthumbnail.js.map
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.