1if(!Fundable) { 2 var Fundable = {}; 3} 4 5if(!Fundable.Constants) 6{ 7 Fundable.Constants = { 8 deleteKeyCodes: [ 8, 46 ], 9 escapeKeyCode: 27 10 } 11} 12 13Fundable.UI = {}; 14 15Fundable.UI.init = function() { 16 Fundable.UI.Tabs.init(); 17 Fundable.UI.Modal.init(); 18 Fundable.UI.Bindables.init(); 19 Fundable.UI.CharacterLimitField.init(); 20 Fundable.UI.PhoneField.init(); 21 Fundable.UI.NumberField.init(); 22 Fundable.UI.MoneyField.init(); 23 Fundable.UI.PercentField.init(); 24 Fundable.UI.Popover.init(); 25 Fundable.UI.EditorUploadModal.init(); 26 27 $('.focus-on-load').focus(); 28 $('.click-on-load').click(); 29 30 if($('.spinning').length) 31 { 32 $('.spinning').transition({rotate:'360deg'}, 1000); 33 } 34 35 if(!$.support.transition) 36 { 37 $.fn.transition = $.fn.animate; 38 } 39 40 $('a[href="#"]').on('click', function(e) { 41 e.preventDefault(); 42 }); 43 44 if($('#uimsg') && $('#uimsg').length) 45 { 46 var msg = $('#uimsg').val(); 47 var isError = $('#uimsg-error').val(); 48 49 if(Fundable.UI.Messages[msg]) 50 { 51 msg = Fundable.UI.Messages[msg]; 52 } 53 54 if(isError && msg) 55 { 56 setTimeout(function() { Fundable.Common.errorMessage(msg); }, 250); 57 58 } 59 else 60 { 61 setTimeout(function() { Fundable.Common.successMessage(msg); }, 250); 62 } 63 } 64}; 65 66Fundable.UI.PagedList = { 67 loadMore:function(button) 68 { 69 $list = $(button).closest('div.paged-list'); 70 $results = $list.find('div.paged-list-results'); 71 72 $list.addClass('loaded'); 73 74 var page = $list.attr('data-page'); 75 $list.attr('data-page', parseInt(page) + 1); 76 77 var url = $list.attr('data-url').replace('page=0', 'page='+page); 78 79 $(button).addClass('disabled'); 80 81 Fundable.Common.ajaxRequest('GET', url, {}, function(response) { 82 $list.find('div.loading-state').hide(); 83 $list.find('div.blank-state').hide(); 84 $results.show(); 85 86 if(response) 87 { 88 $results.append(response); 89 $(button).removeClass('disabled'); 90 } 91 else if(page == 1) 92 { 93 $list.find('div.blank-state').show(); 94 $(button).hide(); 95 } 96 else 97 { 98 $(button).hide(); 99 } 100 }); 101 } 102}; 103 104Fundable.UI.Tabs = { 105 init:function() { 106 $('*[data-toggle="tab"]').on('click', function(e) { 107 Fundable.UI.Tabs.openTab(this); 108 e.preventDefault(); 109 return false; 110 }); 111 }, 112 openTab:function(tab) { 113 var container = $(tab).closest('div.tab-container'); 114 if(container && container.length > 0) 115 { 116 $(container).find('div.tab-pane:visible:first').removeClass('active').hide(); 117 } 118 else 119 { 120 $('div.tab-pane').removeClass('active').hide(); 121 } 122 var href = $(tab).attr('href'); 123 $(tab).closest('ul').find('li').removeClass('active'); 124 $(tab).closest('li').addClass('active'); 125 $(href).show().addClass('active'); 126 127 if($(tab).attr('data-on-tab-open')) 128 { 129 return eval($(tab).attr('data-on-tab-open')); 130 } 131 return false; 132 } 133}; 134 135Fundable.UI.Alert = { 136 confirm:function(question, buttons) 137 { 138 139 }, 140 ask:function(question, fields) 141 { 142 143 }, 144 notify:function(text) 145 { 146 147 } 148}; 149 150Fundable.UI.NotificationBar = { 151 enabled: true, 152 success:function(text) 153 { 154 if(!Fundable.UI.NotificationBar.enabled) 155 { 156 return false; 157 } 158 if(!text) { text = "Success!" }; 159 if($('#saved-message-bar').length == 0) 160 { 161 $('body').prepend('<div id="saved-message-bar" style="display:none;"><p>Success!</p></div>'); 162 } 163 $('#saved-message-bar p').html(text); 164 $('#saved-message-bar').fadeIn(); 165 setTimeout(function() { $('#saved-message-bar').fadeOut(); }, 3000); 166 167 }, 168 error:function(text) 169 { 170 if(!Fundable.UI.NotificationBar.enabled) 171 { 172 return false;
173 } 174 if(!text) { text = "An Error Occurred"; } 175 if($('#saved-message-bar').length == 0) 176 { 177 $('body').prepend('<div id="saved-message-bar" style="display:none;background:#990000;"><p>Success!</p></div>'); 178 } 179 $('#saved-message-bar').removeAttr('style'); 180 181 $('#saved-message-bar p').html(text); 182 $('#saved-message-bar').fadeIn(); 183 $('#saved-message-bar').css('background', '#990000'); 184 clearTimeout(Fundable.UI.NotificationBar.timeout); 185 setTimeout(function () { 186 $('#saved-message-bar').fadeOut(); 187 Fundable.UI.NotificationBar.timeout = setTimeout(function() { $('#saved-message-bar').css('background', ''); }, 2000); 188 }, 3000); 189 }, 190 open:function(text, isError) 191 { 192 193 }, 194 timeout:function() {} 195} 196 197Fundable.UI.Modal = { 198 init:function(container) { 199 if(!container) 200 { 201 container = 'body'; 202 } 203 $(container).find('*[data-toggle="modal"]').on('click', function(e) { 204 Fundable.UI.Modal.open($(this).attr('href'), $(this).hasClass('immediate'), $(this).hasClass('locked')); 205 e.preventDefault(); 206 return false; 207 }); 208 $(container).find('div.custom-modal .close').on('click', function(e) { 209 Fundable.UI.Modal.close($(this).hasClass('immediate')); 210 e.preventDefault(); 211 return false; 212 }); 213 $(container).find('div.custom-modal-overlay').on('click', function(e) { 214 if($(this).is(e.target)) 215 { 216 Fundable.UI.Modal.close(); 217 } 218 }); 219 $(document).on('keyup', function(e) { 220 if(e.keyCode == Fundable.Constants.escapeKeyCode && $('div.custom-modal-overlay:visible').length) 221 { 222 Fundable.UI.Modal.close(); 223 } 224 }); 225 }, 226 open:function(selector, immediate, locked) { 227 if ($(selector)) { 228 var $modal = $(selector);
229 var $overlay = $(selector).closest('div.custom-modal-overlay'); 230 var $window = $(window); 231 232 $modal.addClass('opening'); 233 234 $overlay.height($(window).height()); 235 $overlay.width($(window).width()); 236 237 $modal.css({ 238 top: parseInt($window.height() / 10) + 'px', 239 left: parseInt($window.width() / 2 - $modal.outerWidth() / 2) + 'px' 240 }); 241 242 if ($overlay) { 243 if (immediate) { 244 $overlay.show(); 245 } else { 246 $modal.css('opacity', 0); 247 $overlay.css({display:'block', opacity:0}).transition({opacity:1}, 250); 248 setTimeout(function() { 249 $modal.transition({scale:1.02, opacity:0.75},250).transition({scale:1, opacity:1}, 250); 250 251 }, 100); 252 } 253 } else { 254 if (immediate) { 255 $modal.show(); 256 } 257 else { 258 $modal.css({display:'block', opacity:0}).transition({opacity:1}, 500); 259 } 260 } 261 262 if (locked) 263 { 264 $overlay.addClass('locked'); 265 } 266 Fundable.UI.Modal.reposition($modal); 267 268 $(window).resize(function () { Fundable.UI.Modal.reposition($modal); }); 269 } 270 }, 271 focus:function() { 272 $('div.custom-modal:visible').find('input[type="text"]:first').focus(); 273 }, 274 close: function (immediate) { 275 $modal = $('div.custom-modal:visible') 276 $overlay = $modal.closest('div.custom-modal-overlay'); 277 278 if ($overlay.hasClass('locked')) 279 return false; /* the modal is locked open! */ 280 281 if($overlay) { 282 if(immediate) { 283 $overlay.hide(); 284 } else { 285 $modal.transition({scale:0.95}, 250); 286 setTimeout(function() { 287 $overlay.transition({opacity:0}, 500, function() { $(this).hide(); }); 288 }, 0); 289 290 } 291 } else { 292 if(immediate) { 293 $modal.hide(); 294 } else { 295 $modal.fadeOut(); 296 } 297 } 298 }, 299 unlock:function() 300 { 301 $('div.custom-modal-overlay').removeClass('locked'); 302 }, 303 reposition:function(modal) { 304 if(!modal) 305 { 306 modal = 'div.custom-modal:visible'; 307 } 308 var $modal = $(modal);
309 var $overlay = $modal.closest('div.custom-modal-overlay'); 310 var $window = $(window); 311 if ($overlay) { 312 $overlay.height($window.height()); 313 $overlay.width($window.width()); 314 } 315 var modalTop = parseInt($window.height()/2.25 - $(modal).height()/2); 316 if ($modal) { 317 $modal.css({ 318 top: (modalTop > 0 ? modalTop : 0)+ 'px', 319 left: parseInt($window.width() / 2 - $modal.width() / 2) + 'px' 320 }); 321 } 322 } 323}; 324 325 326Fundable.UI.Bindables = { 327 init:function() { 328 var func = function (el) { 329 var bindName = ""; 330 if($(el).attr('data-binding')) 331 { 332 bindName = $(el).attr('data-binding'); 333 } 334 else 335 { 336 bindName = $(el).attr('name'); 337 } 338 var targetSelector = '.bindable[data-binding="' + bindName + '"]'; 339 var val = $(el).val(); 340 $(targetSelector).each(function () { 341 var formattedVal = val; 342 if ($(this).attr('data-binding-formatter')) { 343 eval($(this).attr('data-binding-formatter')); 344 } 345 $(this).val(formattedVal); 346 $(this).html(formattedVal); 347 }); 348 349 } 350 351 var activate = function(el) { 352 var bindName = ""; 353 if($(el).attr('data-binding')) 354 { 355 bindName = $(el).attr('data-binding'); 356 } 357 else 358 { 359 bindName = $(el).attr('name'); 360 } 361 var targetSelector = '.bindable[data-binding="' + bindName + '"]'; 362 $(this).addClass('bindable-active'); 363 $(targetSelector).addClass('bindable-active'); 364 } 365 366 var deactivate = function(el) { 367 var bindName = ""; 368 if($(el).attr('data-binding')) 369 { 370 bindName = $(el).attr('data-binding'); 371 } 372 else 373 { 374 bindName = $(el).attr('name'); 375 } 376 var targetSelector = '.bindable[data-binding="' + bindName + '"]'; 377 $(this).removeClass('bindable-active'); 378 $(targetSelector).removeClass('bindable-active'); 379 } 380 381 $('.bindable-source').on('focus', function() { activate(this); }); 382 $('.bindable-source').on('keyup', function () { func(this); } ); 383 $('.bindable-source').on('blur', function () { func(this);deactivate(this); }); 384 $('.bindable-source').on('change', function () { func(this); }); 385 } 386}; 387 388Fundable.UI.NumberField = { 389 init:function() { 390 $('.format-number').on('focus', function () { 391 var newVal = accounting.formatNumber($(this).val()); 392 if (newVal == 0) { newVal = '' } 393 $(this).val(newVal); 394 }); 395 $('.format-number').on('keyup', function () { 396 var newVal = accounting.formatNumber($(this).val()); 397 if (newVal == 0) { newVal = '' } 398 $(this).val(newVal); 399 }); 400 $('.format-number').on('blur', function () { 401 $(this).val(accounting.formatNumber($(this).val())); 402 }); 403 $('.format-number').blur(); 404 } 405}; 406 407Fundable.UI.MoneyField = { 408 init:function() { 409 $('.format-money').on('focus', function () { 410 var newVal = '$' + accounting.formatNumber($(this).val()) 411 if (newVal == '$0') { newVal = '$' } 412 $(this).val(newVal); 413 }); 414 $('.format-money').on('keyup', function () { 415 var newVal = '$' + accounting.formatNumber($(this).val()) 416 if (newVal == '$0') { newVal = '$' } 417 $(this).val(newVal); 418 }); 419 $('.format-money').on('blur', function () { 420 $(this).val(accounting.formatMoney($(this).val(), '$', 0)); 421 if ($(this).val() == '$0' && $(this).attr('placeholder')) { $(this).val(''); } 422 }); 423 $('.format-money').blur(); 424 } 425}; 426 427Fundable.UI.PercentField = { 428 init:function() { 429 $('.format-percent').on('focus', function () { 430 if ($(this).val() == '0.000%') { 431 $(this).val(''); 432 } 433 $(this).val($(this).val().replace('%', '')); 434 }); 435 $('.format-percent').on('blur', function () { 436 $(this).val(accounting.formatNumber($(this).val(), 3) + '%'); 437 }); 438 $('.format-percent').blur(); 439 } 440}; 441 442Fundable.UI.PhoneField = { 443 init: function () { 444 $('.format-phone').on('keyup', function (e) { 445 if (!Fundable.Common.equalsOneOf(e.keyCode, Fundable.Constants.deleteKeyCodes)) { 446 $(this).val(Fundable.Common.formatPhoneNumber($(this).val())); 447 } 448 }); 449 $('.format-phone').on('blur', function (e) { 450 if (!Fundable.Common.equalsOneOf(e.keyCode, Fundable.Constants.deleteKeyCodes)) { 451 $(this).val(Fundable.Common.formatPhoneNumber($(this).val())); 452 } 453 }); 454 $('.format-phone').blur(); 455 } 456}; 457 458Fundable.UI.CharacterLimitField = { 459 init:function() { 460 $('.character-limit, *[maxlength]').on('keyup', function () { 461 var val = $(this).val(); 462 var limit = parseInt($(this).attr('data-character-limit')) 463 if (limit == 0) { 464 limit = $(this).attr('maxlength'); 465 } 466 var enforce = $(this).attr('data-enforce-character-limit') || $(this).attr('maxlength'); 467 if (parseInt(val.length) > limit && enforce) 468 { 469 $(this).val(val.substr(0, $(this).attr('data-character-limit'))); 470 return false;
471 } 472 if ($(this).closest('div.field').find('.remaining-character-count')) { 473 if (parseInt(val.length) + 10 > limit) { 474 $(this).closest('div.field').find('.remaining-character-count').addClass('error'); 475 } 476 else { 477 $(this).closest('div.field').find('.remaining-character-count').removeClass('error'); 478 } 479 $(this).closest('div.field').find('.remaining-character-count').html(limit - $(this).val().length); 480 } 481 }); 482 $('.character-limit').keyup(); 483 } 484}; 485 486 487Fundable.UI.EditorUploadModal = { 488 init:function() 489 { 490 if($('#editor-upload-modal-wrapper').length) { 491 $('#editor-upload-modal-wrapper').remove(); 492 } 493 var modalHtml = '<div id="editor-upload-modal-wrapper" class="custom-modal-overlay hide"><div class="custom-modal paper" id="editor-upload-modal" style="width: 660px; "><div class="dismiss"><button class="btn small bold subtle close" onclick="Fundable.UI.Modal.close();"><span class="pictos">*</span> CLOSE</button></div><div class="body padding40"><h3>Select an image to upload:</h3><br/><div class="doc-uploader" style="width:580px;"><div class="text" style="width:100px;padding-top:16px;">File:</div><div class="target" style="width:450px;"><div class="swf" style="width:451px;"><div class="progress"><div class="bar"></div></div><input type="file" class="hide" id="editor-upload-modal-uploader" style="display: none;" width="451" height="28" /></div><button class="btn custom custom2">Select Image</button></div><div class="clear"></div></div></div></div></div>'; 494 $('body').append(modalHtml); 495 496 }, 497 activeEditor: false, 498 initUploader:function(uploadUrl) 499 { 500 Fundable.UI.EditorUploadModal.init(); 501 var uploader = $('#editor-upload-modal-uploader'); 502 var docUploader = $(uploader).closest('div.doc-uploader'); 503 $('#editor-upload-modal-uploader').uploadifive({ 504 swf: Fundable.Config.uploadify.uploader, 505 height: $(uploader).closest('div.swf').height(), 506 width: $(uploader).closest('div.swf').width(), 507 buttonText: '', 508 method: 'post', 509 uploadScript: uploadUrl, 510 fileTypeExts: '*.gif; *.jpg; *.png; *.jpeg', 511 fileTypeDesc: 'Select an image to upload (gif, jpg, or png)', 512 fileObjName: 'file', 513 auto: true, 514 removeCompleted: true, 515 onSelect: function (queue) { 516 $(docUploader).find('div.text').html('Uploading...'); 517 $(docUploader).find('div.progress').show(); 518 }, 519 onError: function (errorMsg) { 520 alert('Upload failed.' + errorMsg + '. If you continue to experience this problem, please contact [email protected]'); 521 $(docUploader).find('div.progress').hide(); 522 $(docUploader).find('div.text').html('File:'); 523 Fundable.UI.Modal.close(); 524 }, 525 onProgress: function (file, e) { 526 var percentComplete = 100; 527 if (e.lengthComputable) { 528 percentComplete = Math.round((e.loaded / e.total) * 100); 529 } 530 $(docUploader).find('div.progress div.bar').css({ width: percentComplete + '%' }); 531 if(percentComplete > 99) 532 { 533 $(docUploader).find('div.text').html('<img height="10" width="10" src="/web/v1/images/loaders/light-small.gif"/> Processing'); 534 } 535 }, 536 onUploadComplete: function (file, data) { 537 $(docUploader).find('div.progress').hide(); 538 $(docUploader).find('div.text').html('File:'); 539 540 if (typeof data != 'object') { data = $.parseJSON(data); } 541 if (data.success) { 542 Fundable.UI.Modal.close(); 543 if(Fundable.UI.EditorUploadModal.activeEditor) 544 { 545 Fundable.UI.EditorUploadModal.activeEditor.insertHtml('<p style="text-align:center;"><img src="'+data.url+'" /></p>'); 546 } 547 } 548 else { 549 alert('Upload failed.'); 550 } 551 } 552 }); 553 }, 554 open:function(editor) 555 { 556 var $textarea = $('#'+editor.name); 557 Fundable.UI.EditorUploadModal.initUploader($textarea.attr('data-upload-url')); 558 Fundable.UI.EditorUploadModal.activeEditor = editor; 559 Fundable.UI.Modal.open('#editor-upload-modal'); 560 } 561}; 562 563 564Fundable.UI.Expandable = { 565 expand:function(button) 566 { 567 var $button = $(button); 568 $button.closest('.expandable').find('.toggle').show(); 569 $button.closest('.expandable').toggleClass('expanded collapsed'); 570 }, 571 collapse:function(button) 572 { 573 var $button = $(button); 574 $button.closest('.expandable').find('.toggle').hide(); 575 $button.closest('.expandable').toggleClass('expanded collapsed'); 576 }, 577 toggle:function(button) 578 { 579 var $button = $(button); 580 if($button.closeEvents('.expandable').hasClass('expanded')) 581 { 582 Fundable.UI.Expandable.collapse(button); 583 } 584 else 585 { 586 Fundable.UI.Expandable.expand(button); 587 } 588 } 589}; 590Fundable.UI.PopMenu = { 591 toggle:function(target) 592 { 593 594 $t = $(target); 595 $m = $t.parent().find('ul.pop-menu'); 596 597 var closing = $m.is(':visible'); 598 599 $('ul.pop-menu:visible').each(function(i,el) { 600 $(el).parent().find('.btn').removeClass('active'); 601 $(el).hide(); 602 }); 603 604 if($m.length) 605 { 606 if(closing) 607 { 608 $t.removeClass('active'); 609 $m.hide(); 610 } 611 else 612 { 613 $t.addClass('active'); 614 $m.show(); 615 $m.css({ 616 top: $t.offset().top + $t.outerHeight(), 617 left: $t.offset().left + $t.outerWidth()/2 - $m.outerWidth()/2 618 }); 619 $m.find('a').on('click', function() { $(this).closest('ul').hide(); $t.removeClass('active'); }); 620 } 621 622 } 623 } 624}; 625Fundable.UI.Expandable = { 626 toggle:function(target) 627 { 628 var $target = $(target); 629 630 if(!$target.hasClass('expandable-container')) 631 { 632 $target = $target.closest('.expandable-container'); 633 } 634 635 if($target) 636 { 637 if($target.hasClass('open')) 638 { 639 $target.find('.expandable').slideUp(200, function() { 640 $target.toggleClass('open closed'); 641 }); 642 } 643 else 644 { 645 $target.find('.expandable').slideDown(200, function() { 646 $target.toggleClass('open closed'); 647 }); 648 } 649 } 650 651 } 652}; 653Fundable.UI.Popover = { 654 openEvents: 'focus mouseenter', 655 closeEvents: 'blur mouseout', 656 init:function(container) 657 { 658 if(!container) { container = 'body'; } 659 $(container).find('*[rel="popover"], *[data-toggle="popover"], .popover-trigger').on(Fundable.UI.Popover.openEvents+' '+Fundable.UI.Popover.closeEvents, function(event) { Fundable.UI.Popover.toggle(this, event); }); 660 }, 661 toggle:function(trigger, event, delayed) 662 { 663 664 var openEvents = $(trigger).attr('data-popover-open-on') ? $(trigger).attr('data-popover-open-on') : Fundable.UI.Popover.openEvents; 665 var closeEvents = $(trigger).attr('data-popover-close-on') ? $(trigger).attr('data-popover-close-on') :Fundable.UI.Popover.closeEvents; 666 var popoverId = $(trigger).attr('data-popover-element-id'); 667 var popover = Fundable.UI.Popover.popovers[popoverId]; 668 var eventOpposites = { click:'click', mouseeneter:'mouseout', mouseout:'mouseenter', focus:'blur', blur:'focus' }; 669 670 if(popoverId && event.type == 'focus') 671 { 672 popover.openedBy = 'focus'; 673 } 674 675 if(popoverId && Fundable.UI.Popover.closeEvents.indexOf(event.type) > -1) 676 { 677 if(event.type == 'mouseout' && (Fundable.Utilities.isMouseOverChild(trigger, event))) 678 { 679 return; 680 } 681 if(popover && popover.openedBy == eventOpposites[event.type]) 682 { 683 Fundable.UI.Popover.close(popoverId); 684 } 685 } 686 else if(!popoverId && Fundable.UI.Popover.openEvents.indexOf(event.type) > -1) 687 { 688 var id = Fundable.UI.Popover.open(trigger); 689 Fundable.UI.Popover.popovers[id] = { openedBy:event.type }; 690 } 691 692 if(event.type == 'click') 693 { 694 event.preventDefault(); 695 } 696 }, 697 popovers: [], 698 open:function(trigger) 699 { 700 var popoverId = Fundable.Utilities.randomString(); 701 var options = {
702 placement: $(trigger).attr('data-popover-placement') ? $(trigger).attr('data-popover-placement') : 'right', 703 title: $(trigger).attr('data-popover-title') ? $(trigger).attr('data-popover-title') : '', 704 content: $(trigger).attr('data-popover-content') ? $(trigger).attr('data-popover-content') : '', 705 html: $(trigger).attr('data-popover-html') ? $(trigger).attr('data-popover-html') : '', 706 template: '<div class="popover" id="'+popoverId+'" style="display:none;"><div class="arrow"></div><div class="popover-content"></div></div>', 707 xPosition: 0, 708 yPosition: 0, 709 }; 710 711 $('body').append(options.template); 712 var $trigger = $(trigger); 713 var $popover = $('#'+popoverId); 714 var $arrow = $popover.find('div.arrow'); 715 $(trigger).attr('data-popover-element-id', '#'+popoverId); 716 717 if(!options.html) 718 { 719 if(options.title) 720 { 721 options.html += '<h3 class="popover-title">'+options.title+'</h3>'; 722 } 723 if(options.content) 724 { 725 options.html += '<div class="popover-text">'+options.content+'</div>'; 726 } 727 options.html = '<div class="padded">'+options.html+'</div>'; 728 } 729 730 var pp = {top:0, left:0}; 731 var ap = {top:0, left:0}; 732 733 $popover.find('div.popover-content').html(options.html); 734 $popover.addClass(options.placement); 735 736 var arrowSize = 10; 737 738 switch(options.placement) 739 { 740 case 'top': 741 pp.left = $(trigger).offset().left + ($(trigger).outerWidth()/2) - ($popover.outerWidth()/2); 742 pp.top = $(trigger).offset().top - $popover.outerHeight() - arrowSize; 743 ap.left = ($popover.width()/2)-($arrow.outerWidth()/2); 744 break; 745 case 'left': 746 pp.left = $(trigger).offset().left - $popover.outerWidth() - arrowSize; 747 pp.top = $(trigger).offset().top + ($(trigger).outerHeight()/2) - $popover.outerHeight()/2; 748 ap.top = ($popover.height()/2) - ($arrow.outerHeight()/2); 749 break; 750 case 'right': 751 pp.left = $(trigger).offset().left + $(trigger).outerWidth() + arrowSize; 752 pp.top = $(trigger).offset().top + ($(trigger).outerHeight()/2) - $popover.outerHeight()/2; 753 ap.top = ($popover.height()/2) - ($arrow.outerHeight()/2); 754 break; 755 case 'bottom': 756 pp.left = $(trigger).offset().left + ($(trigger).outerWidth()/2) - ($popover.outerWidth()/2); 757 pp.top = $(trigger).offset().top + $(trigger).outerHeight() + arrowSize; 758 ap.left = ($popover.width()/2)-($arrow.outerWidth()/2); 759 break; 760 } 761 $popover.css(pp); 762 if(ap.top) 763 { 764 $arrow.css('top', ap.top); 765 } 766 else 767 { 768 $arrow.css('left', ap.left); 769 } 770 $popover.fadeIn(150); 771 return '#'+popoverId; 772 }, 773 close:function(popoverSelector) 774 { 775 $('*[data-popover-element-id="'+popoverSelector+'"]').removeAttr('data-popover-element-id'); 776 $(popoverSelector).stop().fadeOut(150, function() { 777 $(popoverSelector).remove(); 778 }); 779 } 780}; 781 782Fundable.UI.HowItWorks = { 783 open:function(button) { 784 if($('#hiw4-modal').length) 785 { 786 Fundable.UI.Modal.open('#hiw4-modal'); 787 } 788 else 789 { 790 var url = '/content-block/view/hiw4_modal'; 791 $('body').append('<div class="custom-modal-overlay"><div class="custom-modal paper" id="hiw4-modal" style="width:923px;height:650px;"><br/><br/><div class="loading-state" style="height:0px;"></div><br/><br/><br/></div></div>'); 792 Fundable.UI.Modal.open('#hiw4-modal'); 793 $.get(url, function(html) { 794 if(html) 795 { 796 $('#hiw4-modal').html(html); 797 $('#hiw4-modal').attr('style', ''); 798 Fundable.UI.Modal.reposition('#hiw4-modal'); 799 Fundable.UI.Tabs.init(); 800 } 801 }); 802 } 803 804 } 805}; 806 807Fundable.UI.Messages = { 808 password_reset_complete: 'Your password has been updated.' 809}
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.