1(function(){ 2 var views = angular.module("siteviews", []); 3 4 views.directive('vPage', ['$sce', '$compile', 'sources', 'constants', 'pathmgr', 'browser', 'crm', 'pathmgr', function($sce, $compile, sources, constants, pathmgr, browser, crm, pathmgr){ 5 return { 6 'restrict' : 'E', 7 'template' : constants.templates.shadow.page, 8 'replace' : true, 9 'scope' : { 10 'feature' : '@' 11 }, 12 'link' : function(scope, element, attrs) { 13 setTimeout(function(){ 14 scope.done(); 15 }, 10); 16 }, 17 'controller' : function($scope, $element, $attrs){ 18 $scope.$on('$destroy', function(){ 19 }); 20 $scope.done = function(){ 21 $scope.scrlock = false; 22 var src = sources.grab(pathmgr.detect()); 23 var cfg = sources.grab('config'); 24 crm.lassoTrack(cfg['lasso-tracking'], src.metadata.title, pathmgr.decipher(true)); 25 26 $('title').html(src.metadata.title); 27 28 $scope.feature = src.content.acf['page-feature'].url; 29 for(var i in src.content.acf.blocks) { 30 $($element).find('.block-content').append('<'+src.content.acf.blocks[i].directive+' index="'+i+'" page="'+pathmgr.detect()+'"></'+src.content.acf.blocks[i].directive+'>') 31 } 32 33 $compile($($element).find('.block-content'))($scope); 34 35 $('.navigation-area').removeClass('filled'); 36 37 if($scope.$root.$$phase != '$apply' && $scope.$root.$$phase != '$digest') { 38 $scope.$apply(); 39 } 40 41 browser.delay.timeout.set(function(){ 42 $($element).on('scroll', function(){ 43 if(parseFloat($($element).scrollTop()) >= parseFloat($(window).height())) { 44 $('.navigation-area').addClass('filled'); 45 } 46 else{ 47 $('.navigation-area').removeClass('filled'); 48 } 49 }); 50 }, 60); 51 }; 52 53 var tmr = false; 54 55 $scope.scrollfunc = function($event, $delta, $deltaX, $deltaY) { 56 57 if(Modernizr.mq('(min-width: 1025px)')) { 58 if(!$scope.scrlock && pathmgr.detect() == 'home') { 59 $scope.scrlock = true; 60 if($deltaY > 0 && $($element).scrollTop() == 0) { 61 $('.faux-logo').removeClass('hide'); 62 $('.home-page').addClass('hide'); 63 64 $('#loading-screen').transition({ 65 'x' : 0, 66 'y' : 0 67 }); 68 69 $('#content-area').transition({ 70 'x' : 0, 71 'y' : '100%' 72 }, function(){ 73 $scope.scrlock = false; 74 $scope.$parent.$parent.isdone = true; 75 }); 76 } 77 else{ 78 clearTimeout(tmr); 79 tmr = setTimeout(function(){ 80 $scope.scrlock = false; 81 }, 1000); 82 } 83 } 84 } 85 86 87 }; 88 89 90 $scope.s = function(html) { 91 return $sce.trustAsHtml(browser.nl2br(html)); 92 } 93 94 $scope.sr = function(html) { 95 return $sce.trustAsHtml(html); 96 } 97 } 98 } 99 }]); 100 101 102 //====================================== BLOCK COMPONENTS 103 views.directive('largeText', ['$sce', '$compile', 'sources', 'constants', 'pathmgr', 'browser', 'modal', function($sce, $compile, sources, constants, pathmgr, browser, modal){ 104 return { 105 'restrict' : 'E', 106 'template' : constants.templates.blocks.largeText, 107 'replace' : true, 108 'scope' : { 109 'data' : '@' 110 }, 111 'link' : function(scope, element, attrs) { 112 setTimeout(function(){ 113 scope.done(); 114 }, 10); 115 }, 116 'controller' : function($scope, $element, $attrs){ 117 $scope.done = function(){ 118 var src = sources.grab($attrs.page).content.acf.blocks[$attrs.index]; 119 $scope.data = src.data; 120 $scope.gridclass = 'col-xs-12 col-md-10 col-hd-8'; 121 $scope.bodyclass = 'no-image'; 122 123 if(!(!$scope.data['thumbnail'])) { 124 $scope.gridclass = 'col-xs-12 col-md-6'; 125 $scope.bodyclass = 'with-image'; 126 } 127 128 if($scope.$root.$$phase != '$apply' && $scope.$root.$$phase != '$digest') { 129 $scope.$apply(); 130 } 131 }; 132 133 $scope.popvim = function(vidurl) { 134 var vimid = vidurl.replace('https://', '').replace('http://', '').split('?')[0].split('/').pop(); 135 modal.vimeo(vimid); 136 } 137 138 $scope.poptour = function(toururl) { 139 140 } 141 142 $scope.poplink = function(url, e) { 143 if(url.includes('kuula.co/share')) { 144 e.preventDefault(); 145 modal.kuula(url); 146 } 147 else if (url.includes('player.vimeo.com')) { 148 e.preventDefault(); 149 var vimid = url.replace('https://', '').replace('http://', '').split('?')[0].split('/').pop(); 150 modal.vimeo(vimid); 151 } 152 } 153 154 $scope.s = function(html) { 155 return $sce.trustAsHtml(browser.nl2br(html)); 156 } 157 158 $scope.sr = function(html) { 159 return $sce.trustAsHtml(html); 160 } 161 } 162 } 163 }]); 164 165 views.directive('pairText', ['$sce', '$compile', 'sources', 'constants', 'pathmgr', 'browser', 'modal', function($sce, $compile, sources, constants, pathmgr, browser, modal){ 166 return { 167 'restrict' : 'E', 168 'template' : constants.templates.blocks.pairText, 169 'replace' : true, 170 'scope' : { 171 'page' : '@' 172 }, 173 'link' : function(scope, element, attrs) { 174 setTimeout(function(){ 175 scope.done(); 176 }, 10); 177 }, 178 'controller' : function($scope, $element, $attrs){ 179 $scope.done = function(){ 180 var src = sources.grab($attrs.page).content.acf.blocks[$attrs.index]; 181 $scope.data = src.data; 182 $scope.base = constants.base; 183 184 $scope.imgtype = 'normal'; 185 186 if($scope.$root.$$phase != '$apply' && $scope.$root.$$phase != '$digest') { 187 $scope.$apply(); 188 } 189 190 if(src.data['is-gallery']) { 191 var slides = $($element).find('.slide').toArray(); 192 193 var cur = 0; 194 var lock = false;
195 196 $(slides[0]).css({ 197 'z-index' : 2 198 }); 199 200 $scope.next = function(){ 201 var next = cur + 1; 202 if(next >= slides.length) { 203 next = 0; 204 } 205 $scope.skip(next, true); 206 }; 207 208 $scope.prev = function(){ 209 var prev = cur - 1; 210 if(prev < 0) { 211 prev = slides.length - 1; 212 } 213 214 $scope.skip(prev, false); 215 }; 216 217 $scope.skip = function(next, forceright){ 218 if(!lock) { 219 lock = true; 220 if(next != cur) { 221 var pre, post; 222 if(typeof forceright == 'boolean') { 223 if(forceright) { 224 pre = '100%'; 225 post = '-100%'; 226 } 227 else{ 228 pre = '-100%'; 229 post = '100%'; 230 } 231 } 232 else{ 233 if(next > cur) { 234 pre = '100%'; 235 post = '-100%'; 236 } 237 else{ 238 pre = '-100%'; 239 post = '100%'; 240 } 241 } 242 243 $(slides[next]).css({ 244 'x' : pre, 245 'z-index' : 2 246 }); 247 248 $(slides[cur]).transition({ 249 'x' : post 250 }, 600); 251 252 $(slides[next]).transition({ 253 'x' : 0 254 }, 600, function(){ 255 $(slides[cur]).css({ 256 'z-index' : 1, 257 'x' : 0 258 }); 259 260 cur = next; 261 lock = false; 262 }); 263 } 264 else{ 265 lock = false; 266 } 267 } 268 }; 269 } 270 else{ 271 $scope.imglink = src.data['click-url']; 272 273 if(!(!$scope.imglink)) { 274 if($scope.imglink.includes('kuula.co/share')) { 275 $scope.imgtype = 'kuula'; 276 } 277 else if ($scope.imglink.includes('player.vimeo.com')) { 278 $scope.imgtype = 'vimeo'; 279 } 280 else{ 281 $scope.imgtype = 'url'; 282 } 283 } 284 } 285 }; 286 287 $scope.popvim = function(vidurl) { 288 //player.vimeo.com/video/421263363 289 var vimid = vidurl.replace('https://', '').replace('http://', '').split('?')[0].split('/').pop(); 290 modal.vimeo(vimid); 291 } 292 293 $scope.poptour = function(toururl) { 294 modal.kuula(toururl); 295 } 296 297 $scope.s = function(html) { 298 return $sce.trustAsHtml(browser.nl2br(html)); 299 } 300 301 $scope.sr = function(html) { 302 return $sce.trustAsHtml(html); 303 } 304 } 305 } 306 }]); 307 308 views.directive('pairTextBottom', ['$sce', '$compile', 'sources', 'constants', 'pathmgr', 'browser', 'modal', function($sce, $compile, sources, constants, pathmgr, browser, modal){ 309 return { 310 'restrict' : 'E', 311 'template' : constants.templates.blocks.pairTextBottom, 312 'replace' : true, 313 'scope' : { 314 'page' : '@' 315 }, 316 'link' : function(scope, element, attrs) { 317 setTimeout(function(){ 318 scope.done(); 319 }, 10); 320 }, 321 'controller' : function($scope, $element, $attrs){ 322 $scope.done = function(){ 323 var src = sources.grab($attrs.page).content.acf.blocks[$attrs.index]; 324 $scope.data = src.data; 325 326 if($scope.$root.$$phase != '$apply' && $scope.$root.$$phase != '$digest') { 327 $scope.$apply(); 328 } 329 }; 330 331 $scope.popvim = function(vidid) { 332 modal.vimeo(vidid); 333 } 334 335 $scope.s = function(html) { 336 return $sce.trustAsHtml(browser.nl2br(html)); 337 } 338 339 $scope.sr = function(html) { 340 return $sce.trustAsHtml(html); 341 } 342 } 343 } 344 }]); 345 346 views.directive('bodyText', ['$sce', '$compile', 'sources', 'constants', 'pathmgr', 'browser', 'modal', function($sce, $compile, sources, constants, pathmgr, browser, modal){ 347 return { 348 'restrict' : 'E', 349 'template' : constants.templates.blocks.bodyText, 350 'replace' : true, 351 'scope' : { 352 'page' : '@' 353 }, 354 'link' : function(scope, element, attrs) { 355 setTimeout(function(){ 356 scope.done(); 357 }, 10); 358 }, 359 'controller' : function($scope, $element, $attrs){ 360 $scope.done = function(){ 361 var src = sources.grab($attrs.page).content.acf.blocks[$attrs.index]; 362 $scope.data = src.data; 363 364 console.log(src.data); 365 366 if($scope.$root.$$phase != '$apply' && $scope.$root.$$phase != '$digest') { 367 $scope.$apply(); 368 } 369 }; 370 371 372 373 $scope.popvimeo = function(vidid) { 374 modal.vimeo(vidid); 375 } 376 377 $scope.s = function(html) { 378 return $sce.trustAsHtml(browser.nl2br(html)); 379 } 380 381 $scope.sr = function(html) { 382 return $sce.trustAsHtml(html); 383 } 384 } 385 } 386 }]); 387 388 views.directive('bannerBlock', ['$sce', '$compile', 'sources', 'constants', 'pathmgr', 'browser', function($sce, $compile, sources, constants, pathmgr, browser){ 389 return { 390 'restrict' : 'E', 391 'template' : constants.templates.blocks.banner, 392 'replace' : true, 393 'scope' : { 394 'page' : '@' 395 }, 396 'link' : function(scope, element, attrs) { 397 setTimeout(function(){ 398 scope.done(); 399 }, 10); 400 }, 401 'controller' : function($scope, $element, $attrs){ 402 $scope.done = function(){ 403 var src = sources.grab($attrs.page).content.acf.blocks[$attrs.index]; 404 $scope.data = src.data; 405 $scope.backdrop = 'transparent'; 406 $scope.borderclass = 'frame-fluid'; 407 408 if(src.data.scheme) { 409 $scope.backdrop = src.data['border-colour']; 410 $scope.borderclass = 'frame-bordered'; 411 } 412 413 if($scope.$root.$$phase != '$apply' && $scope.$root.$$phase != '$digest') { 414 $scope.$apply(); 415 } 416 417 $scope.capsize = function(text) { 418 if(text.length >= 25) { 419 return 'small'; 420 } 421 else{ 422 return 'large'; 423 } 424 } 425 426 $scope.colorize = function(sld) { 427 if(sld['set-color']) { 428 return { 429 'color' : sld['color'] 430 }; 431 } 432 else{ 433 return {}; 434 } 435 } 436 437 var slides = $($element).find('.slide').toArray(); 438 var links = $($element).find('.link').toArray(); 439 if(slides.length > 1) { 440 var cur = 0; 441 var lock = false;
442 443 $(links[0]).addClass('current'); 444 445 $(slides[0]).css({ 446 'z-index' : 2 447 }); 448 449 $scope.next = function(){ 450 var next = cur + 1; 451 if(next >= slides.length) { 452 next = 0; 453 } 454 $scope.skip(next, true); 455 }; 456 457 $scope.prev = function(){ 458 var prev = cur - 1; 459 if(prev < 0) { 460 prev = slides.length - 1; 461 } 462 463 $scope.skip(prev, false); 464 }; 465 466 $scope.skip = function(next, forceright){ 467 if(!lock) { 468 lock = true; 469 if(next != cur) { 470 var pre, post; 471 if(typeof forceright == 'boolean') { 472 if(forceright) { 473 pre = '100%'; 474 post = '-100%'; 475 } 476 else{ 477 pre = '-100%'; 478 post = '100%'; 479 } 480 } 481 else{ 482 if(next > cur) { 483 pre = '100%'; 484 post = '-100%'; 485 } 486 else{ 487 pre = '-100%'; 488 post = '100%'; 489 } 490 } 491 492 $(links).removeClass('current'); 493 494 $(links[next]).addClass('current'); 495 496 $(slides[next]).css({ 497 'x' : pre, 498 'z-index' : 2 499 }); 500 501 $(slides[cur]).transition({ 502 'x' : post 503 }, 600); 504 505 $(slides[next]).transition({ 506 'x' : 0 507 }, 600, function(){ 508 $(slides[cur]).css({ 509 'z-index' : 1, 510 'x' : 0 511 }); 512 513 cur = next; 514 lock = false; 515 }); 516 } 517 else{ 518 lock = false; 519 } 520 } 521 }; 522 } 523 }; 524 525 $scope.s = function(html) { 526 return $sce.trustAsHtml(browser.nl2br(html)); 527 } 528 529 $scope.sr = function(html) { 530 return $sce.trustAsHtml(html); 531 } 532 } 533 } 534 }]); 535 536 views.directive('formBlock', ['$sce', '$compile', 'sources', 'constants', 'pathmgr', 'browser', function($sce, $compile, sources, constants, pathmgr, browser){ 537 return { 538 'restrict' : 'E', 539 'template' : constants.templates.blocks.form, 540 'replace' : true, 541 'scope' : { 542 'title' : '@', 543 'fields' : '@', 544 'order' : '@' 545 }, 546 'link' : function(scope, element, attrs) { 547 setTimeout(function(){ 548 scope.done(); 549 }, 10); 550 }, 551 'controller' : function($scope, $element, $attrs){ 552 $scope.done = function(){ 553 var src = sources.grab($attrs.page).content.acf.blocks[$attrs.index]; 554 555 556 $scope.title = src.data.title; 557 $scope.fields = src.data.formdata.fields; 558 var indices = []; 559 for(var i in $scope.fields) { 560 indices.push(parseFloat(i)); 561 } 562 563 var exceptions = {}; 564 565 exceptions['submit'] = indices.pop(); 566 exceptions['consent'] = indices.pop(); 567 568 $scope.order = { 569 'l' : [], 570 'r' : [], 571 'c' : [exceptions['consent']], 572 's' : [exceptions['submit']] 573 }; 574 575 var limit = indices.length/2; 576 577 for(var i in indices) { 578 if(i < limit) { 579 $scope.order.l.push(parseFloat(i)); 580 } 581 else{ 582 $scope.order.r.push(parseFloat(i)); 583 } 584 } 585 586 if($scope.$root.$$phase != '$apply' && $scope.$root.$$phase != '$digest') { 587 $scope.$apply(); 588 } 589 }; 590 591 592 593 $scope.s = function(html) { 594 return $sce.trustAsHtml(browser.nl2br(html)); 595 } 596 597 $scope.sr = function(html) { 598 return $sce.trustAsHtml(html); 599 } 600 } 601 } 602 }]); 603 604 views.directive('nmapBlock', ['$sce', '$compile', 'sources', 'constants', 'pathmgr', 'browser', function($sce, $compile, sources, constants, pathmgr, browser){ 605 return { 606 'restrict' : 'E', 607 'template' : constants.templates.blocks.nmap, 608 'replace' : true, 609 'scope' : { 610 'page' : '@' 611 }, 612 'link' : function(scope, element, attrs) { 613 setTimeout(function(){ 614 scope.done(); 615 }, 10); 616 }, 617 'controller' : function($scope, $element, $attrs){ 618 $scope.done = function(){ 619 var src = sources.grab($attrs.page).content.acf.blocks[$attrs.index]; 620 $scope.data = src.data; 621 622 if($scope.$root.$$phase != '$apply' && $scope.$root.$$phase != '$digest') { 623 $scope.$apply(); 624 } 625 626 var moveX = $($element).find('.overlay-container').toArray()[0].scrollWidth - parseFloat($($element).find('.overlay-container').css('width')); 627 $($element).find('.overlay-container').scrollLeft(moveX/2); 628 }; 629 630 $scope.show = function(t) { 631 $($element).find('.sub-'+t).toggleClass('shown'); 632 if(Modernizr.mq('(max-width: 1024px)')) { 633 var moveX = $($element).find('.overlay-container').toArray()[0].scrollWidth - parseFloat($($element).find('.overlay-container').css('width')); 634 // console.log(moveX); 635 $($element).find('.overlay-container').animate({ 636 'scrollLeft' : (moveX/2)+'px' 637 }, 600); 638 639 $('.vue').animate({ 640 'scrollTop' : $('.overlay-container').offset().top + $('.vue').scrollTop() - 100 +'px' 641 }, 600); 642 } 643 }; 644 645 $scope.s = function(html) { 646 return $sce.trustAsHtml(browser.nl2br(html)); 647 }; 648 649 $scope.sr = function(html) { 650 return $sce.trustAsHtml(html); 651 }; 652 } 653 } 654 }]); 655 656 views.directive('floorplanBlock', ['$sce', '$compile', 'sources', 'constants', 'pathmgr', 'browser', function($sce, $compile, sources, constants, pathmgr, browser){ 657 return { 658 'restrict' : 'E', 659 'template' : constants.templates.blocks.floorplans, 660 'replace' : true, 661 'scope' : { 662 'data' : '@' 663 }, 664 'link' : function(scope, element, attrs) { 665 setTimeout(function(){ 666 scope.done(); 667 }, 10); 668 }, 669 'controller' : function($scope, $element, $attrs){ 670 $scope.done = function(){ 671 var src = sources.grab($attrs.page).content.acf.blocks[$attrs.index]; 672 $scope.lock = false;
673 $scope.sub = 0; 674 $scope.now = 0; 675 $scope.title = src.data.title; 676 $scope.download = src.data.downloadable; 677 $scope.download2 = src.data['downloadable-2']; 678 // console.log($scope.download); 679 $scope.plans = []; 680 for(var ex in src.data.accounts) { 681 $scope.plans.push(src.data.accounts[ex].account); 682 } 683 684 $scope.write(0); 685 browser.delay.timeout.set(function(){ 686 $($element).find('.display-0').parent().addClass('current'); 687 }, 60); 688 }; 689 690 $scope.write = function(index) { 691 //change bindings 692 $scope.current = $scope.plans[index]; 693 $scope.sub = 0; 694 if($scope.$root.$$phase != '$apply' && $scope.$root.$$phase != '$digest') { 695 $scope.$apply(); 696 } 697 698 //reinitialize HTML 699 $($element).find('.prev-container .main-sizer').append('<img src="'+$scope.plans[index].plans[0].image.url+'" class="full now" />'); 700 $($element).find('.prev-container .changer .label').append('<span class="phase">'+$scope.plans[index].plans[0].label+'</span>'); 701 702 if($scope.current.plans.length == 1) { 703 $($element).find('.prev-container .changer .arrow-up').css({ 704 'opacity' : 0, 705 'pointer-events' : 'none' 706 }); 707 708 $($element).find('.prev-container .changer .arrow-down').css({ 709 'opacity' : 0, 710 'pointer-events' : 'none' 711 }); 712 713 $($element).find('.prev-container .changer .label').css({ 714 'opacity' : 1 715 }); 716 } 717 else{ 718 $($element).find('.prev-container .changer .label').css({ 719 'opacity' : 1 720 }); 721 722 $($element).find('.prev-container .changer .arrow-up').css({ 723 'opacity' : 1, 724 'pointer-events' : '' 725 }); 726 727 $($element).find('.prev-container .changer .arrow-down').css({ 728 'opacity' : 0.5, 729 'pointer-events' : '' 730 }); 731 } 732 }; 733 734 $scope.reset = function() { 735 //label 736 $($element).find('.spec').remove(); 737 738 //preview 739 $($element).find('.prev-container .main-sizer').empty(); 740 $($element).find('.prev-container .changer .label').empty(); 741 }; 742 743 $scope.mobileToggle = function(){ 744 if(!$scope.lock) { 745 $scope.lock = true; 746 747 $($element).find('.selector').toggleClass('open'); 748 var targetHeight = parseFloat($($element).find('.selector .sel-sizer').css('height')); 749 750 if($($element).find('.selector').hasClass('open')) { 751 $($element).find('.selector').transition({ 752 'height' : targetHeight+'px' 753 },600, function(){ 754 $($element).find('.selector').css({ 755 'height' : 'auto' 756 }); 757 758 $scope.lock = false; 759 }) 760 } 761 else{ 762 $($element).find('.selector').css({ 763 'height' : targetHeight+'px' 764 }); 765 766 $($element).find('.selector').transition({ 767 'height' : 0 768 },600, function(){ 769 $scope.lock = false; 770 }); 771 } 772 } 773 }; 774 775 $scope.moveUp = function(){ 776 if(!$scope.lock) { 777 $scope.lock = true; 778 var next = $scope.sub + 1; 779 if(next >= $scope.current.plans.length) { 780 $scope.lock = false; 781 } 782 else{ 783 //animation vars 784 var pre = '-100%'; 785 var post = '100%'; 786 var ipre = '-60%'; 787 var ipost = '-40%'; 788 789 //do labels 790 791 $($element).find('.prev-container .changer .label').append('<span class="nxt">'+$scope.current.plans[next].label+'</span>'); 792 793 $($element).find('.prev-container .changer .label .nxt').css({ 794 'x' : 0, 795 'y' : pre 796 }); 797 798 //do preview 799 800 801 $($element).find('.prev-container .main-sizer').append('<img src="'+$scope.current.plans[next].image.url+'" class="full next" />'); 802 803 $($element).find('.prev-container .main-sizer .next').css({ 804 'x' : '-50%', 805 'y' : ipre, 806 'opacity' : 0 807 }); 808 809 setTimeout(function(){ 810 // do preview 811 $($element).find('.prev-container .main-sizer .next').transition({ 812 'x' : '-50%', 813 'y' : '-50%', 814 'opacity' : 1 815 }, 850); 816 817 $($element).find('.prev-container .main-sizer .now').transition({ 818 'x' : '-50%', 819 'y' : ipost, 820 'opacity' : 0 821 }, 850); 822 823 //do labels 824 825 $($element).find('.prev-container .changer .label .phase').transition({ 826 'x' : 0, 827 'y' : post 828 }, 850); 829 830 $($element).find('.prev-container .changer .label .nxt').transition({ 831 'x' : 0, 832 'y' : 0 833 }, 850, function(){ 834 $($element).find('.prev-container .changer .arrow-down').css({ 835 'opacity' : 1 836 }); 837 838 if(next == ($scope.current.plans.length - 1)) { 839 $($element).find('.prev-container .changer .arrow-up').css({ 840 'opacity' : 0.5 841 }); 842 } 843 844 $scope.sub = next; 845 $($element).find('.prev-container .changer .label .phase').remove(); 846 $($element).find('.prev-container .main-sizer .now').remove(); 847 848 $($element).find('.prev-container .main-sizer .next').attr('class', 'full now'); 849 $($element).find('.prev-container .changer .label .nxt').attr('class', 'phase'); 850 $scope.lock = false;
851 }); 852 853 854 }, 60); 855 } 856 } 857 }; 858 859 $scope.moveDown = function(){ 860 if(!$scope.lock) { 861 $scope.lock = true; 862 var next = $scope.sub - 1; 863 if(next < 0) { 864 $scope.lock = false; 865 } 866 else{ 867 //animation vars 868 var pre = '100%'; 869 var post = '-100%'; 870 var ipre = '-40%'; 871 var ipost = '-60%'; 872 873 //do labels 874 $($element).find('.prev-container .changer .label').append('<span class="nxt">'+$scope.current.plans[next].label+'</span>'); 875 876 $($element).find('.prev-container .changer .label .nxt').css({ 877 'x' : 0, 878 'y' : pre 879 }); 880 881 //do preview 882 883 884 $($element).find('.prev-container .main-sizer').append('<img src="'+$scope.current.plans[next].image.url+'" class="full next" />'); 885 886 $($element).find('.prev-container .main-sizer .next').css({ 887 'x' : '-50%', 888 'y' : ipre, 889 'opacity' : 0 890 }); 891 892 setTimeout(function(){ 893 // do preview 894 $($element).find('.prev-container .main-sizer .next').transition({ 895 'x' : '-50%', 896 'y' : '-50%', 897 'opacity' : 1 898 }, 850); 899 900 $($element).find('.prev-container .main-sizer .now').transition({ 901 'x' : '-50%', 902 'y' : ipost, 903 'opacity' : 0 904 }, 850); 905 906 //do labels 907 908 $($element).find('.prev-container .changer .label .phase').transition({ 909 'x' : 0, 910 'y' : post 911 }, 850); 912 913 $($element).find('.prev-container .changer .label .nxt').transition({ 914 'x' : 0, 915 'y' : 0 916 }, 850, function(){ 917 $($element).find('.prev-container .changer .arrow-up').css({ 918 'opacity' : 1 919 }); 920 921 if(next == 0) { 922 $($element).find('.prev-container .changer .arrow-down').css({ 923 'opacity' : 0.5 924 }); 925 } 926 927 $scope.sub = next; 928 $($element).find('.prev-container .changer .label .phase').remove(); 929 $($element).find('.prev-container .main-sizer .now').remove(); 930 931 $($element).find('.prev-container .main-sizer .next').attr('class', 'full now'); 932 $($element).find('.prev-container .changer .label .nxt').attr('class', 'phase'); 933 $scope.lock = false; 934 }); 935 936 937 }, 60); 938 } 939 } 940 }; 941 942 $scope.navigate = function(index){ 943 if(!$scope.lock && $scope.now != index) { 944 $scope.now = index; 945 $scope.lock = true; 946 947 //close mobile 948 if($($element).find('.selector').hasClass('open')) { 949 $($element).find('.selector').removeClass('open'); 950 var targetHeight = parseFloat($($element).find('.selector .sel-sizer').css('height')); 951 952 $($element).find('.selector').css({ 953 'height' : targetHeight+'px' 954 }); 955 956 $($element).find('.selector').transition({ 957 'height' : 0 958 },600); 959 } 960 961 //change 'current' selector 962 $($element).find('.sel').removeClass('current'); 963 964 $($element).find('.display-'+index).parent().addClass('current'); 965 966 //change navigator text 967 $($element).find('.navigator .title').transition({ 968 'color' : 'rgba(0,0,0,0)' 969 }, 600); 970 971 $($element).find('.navigator .type').transition({ 972 'color' : 'rgba(0,0,0,0)' 973 }, 600); 974 975 $($element).find('.prev-container').transition({ 976 'opacity' : 0 977 }, 600); 978 979 $($element).find('.keyplate').transition({ 980 'opacity' : 0 981 }, 600); 982 983 $($element).find('.navigator .specs').transition({ 984 'color' : 'rgba(0,0,0,0)' 985 }, 600, function(){ 986 $scope.reset(); 987 988 $scope.write(index); 989 990 // console.log($scope.current); 991 992 $($element).find('.navigator .specs').transition({ 993 'color' : '' 994 }, 600); 995 996 $($element).find('.navigator .type').transition({ 997 'color' : '' 998 }, 600); 999 1000 $($element).find('.prev-container').transition({ 1001 'opacity' : 1 1002 }, 600); 1003 1004 $($element).find('.keyplate').transition({ 1005 'opacity' : 1 1006 }, 600); 1007 1008 $($element).find('.navigator .title').transition({ 1009 'color' : '' 1010 }, 600, function(){ 1011 $scope.lock = false;
1012 }); 1013 }); 1014 } 1015 }; 1016 1017 $scope.s = function(html) { 1018 return $sce.trustAsHtml(browser.nl2br(html)); 1019 } 1020 1021 $scope.sr = function(html) { 1022 return $sce.trustAsHtml(html); 1023 } 1024 1025 $scope.st = function(html) { 1026 return $sce.trustAsHtml(html); 1027 } 1028 } 1029 } 1030 }]); 1031 1032 views.directive('framesBlock', ['$sce', '$compile', 'sources', 'constants', 'pathmgr', 'browser', function($sce, $compile, sources, constants, pathmgr, browser){ 1033 return { 1034 'restrict' : 'E', 1035 'template' : constants.templates.blocks.frames, 1036 'replace' : true, 1037 'scope' : { 1038 'page' : '@' 1039 }, 1040 'link' : function(scope, element, attrs) { 1041 setTimeout(function(){ 1042 scope.done(); 1043 }, 10); 1044 }, 1045 'controller' : function($scope, $element, $attrs){ 1046 $scope.done = function(){ 1047 var src = sources.grab($attrs.page).content.acf.blocks[$attrs.index]; 1048 $scope.data = src.data; 1049 $scope.intro = false; 1050 switch (src.data.type) { 1051 case 'starter': 1052 $scope.intro = true; 1053 $scope.handleclass = ['handle', 'clear-bottom']; 1054 break; 1055 case 'linked': 1056 $scope.handleclass = ['handle', 'clear-top']; 1057 break; 1058 case 'ender': 1059 $scope.handleclass = ['handle', 'clear-top']; 1060 break; 1061 case 'standalone': 1062 $scope.intro = true; 1063 $scope.handleclass = ['handle']; 1064 break; 1065 } 1066 1067 if($scope.$root.$$phase != '$apply' && $scope.$root.$$phase != '$digest') { 1068 $scope.$apply(); 1069 } 1070 }; 1071 1072 1073 1074 $scope.s = function(html) { 1075 return $sce.trustAsHtml(browser.nl2br(html)); 1076 } 1077 1078 $scope.sr = function(html) { 1079 return $sce.trustAsHtml(html); 1080 } 1081 } 1082 } 1083 }]); 1084 1085 views.directive('footer', ['$sce', '$compile', 'sources', 'constants', 'pathmgr', 'browser', function($sce, $compile, sources, constants, pathmgr, browser){ 1086 return { 1087 'restrict' : 'E', 1088 'template' : constants.templates['modified-elements'].footer, 1089 'replace' : true, 1090 'scope' : { 1091 'page' : '@' 1092 }, 1093 'link' : function(scope, element, attrs) { 1094 setTimeout(function(){ 1095 scope.done(); 1096 }, 10); 1097 }, 1098 'controller' : function($scope, $element, $attrs){ 1099 $scope.$on('$destroy', function(){ 1100 $scope.$parent.$parent.$parent.actions.resize.remove('footer-'+pathmgr.detect()); 1101 }); 1102 $scope.done = function(){ 1103 var data = sources.grab('config'); 1104 1105 $scope.data = data.footer; 1106 1107 if($scope.$root.$$phase != '$apply' && $scope.$root.$$phase != '$digest') { 1108 $scope.$apply(); 1109 } 1110 1111 browser.delay.timeout.set(function(){ 1112 $scope.links = $($element).find('.external-link').toArray(); 1113 $scope.resizeLogos(); 1114 1115 $scope.$parent.$parent.$parent.actions.resize.queue('footer-'+pathmgr.detect(), function(){ 1116 $scope.resizeLogos(); 1117 }); 1118 }, 60); 1119 }; 1120 1121 $scope.resizeLogos = function(){ 1122 var m = parseFloat($($element).find('.measure').css('height')); 1123 for(var i in $scope.links) { 1124 $($scope.links[i]).find('img').css({ 1125 'height' : (parseFloat($scope.data.externals[i].height) * m) + 'px' 1126 }); 1127 } 1128 }; 1129 1130 $scope.s = function(html) { 1131 return $sce.trustAsHtml(browser.nl2br(html)); 1132 } 1133 1134 $scope.sr = function(html) { 1135 return $sce.trustAsHtml(html); 1136 } 1137 } 1138 } 1139 }]); 1140})();
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.