Changeset 2542390
- Timestamp:
- 06/04/2021 07:25:02 AM (5 years ago)
- Location:
- solar-wizard-lite
- Files:
-
- 57 added
- 3 edited
-
tags/1.0.4 (added)
-
tags/1.0.4/LICENSE.txt (added)
-
tags/1.0.4/admin (added)
-
tags/1.0.4/admin/admin_settings.php (added)
-
tags/1.0.4/admin/css (added)
-
tags/1.0.4/admin/css/custom.css (added)
-
tags/1.0.4/admin/js (added)
-
tags/1.0.4/admin/js/custom.js (added)
-
tags/1.0.4/css (added)
-
tags/1.0.4/css/images (added)
-
tags/1.0.4/css/images/ui-icons_444444_256x240.png (added)
-
tags/1.0.4/css/jquery-ui.css (added)
-
tags/1.0.4/css/style.css (added)
-
tags/1.0.4/images (added)
-
tags/1.0.4/images/Icon_Cost.svg (added)
-
tags/1.0.4/images/Icons_blk_CreditScore.svg (added)
-
tags/1.0.4/images/Icons_blk_Rate.svg (added)
-
tags/1.0.4/images/Icons_blk_Term.svg (added)
-
tags/1.0.4/images/QuickIcon.svg (added)
-
tags/1.0.4/images/ThoroughIcon.svg (added)
-
tags/1.0.4/images/arrow.png (added)
-
tags/1.0.4/images/bd1.svg (added)
-
tags/1.0.4/images/bd2.svg (added)
-
tags/1.0.4/images/bd3.svg (added)
-
tags/1.0.4/images/bd4.svg (added)
-
tags/1.0.4/images/bs1.svg (added)
-
tags/1.0.4/images/bs2.svg (added)
-
tags/1.0.4/images/email.svg (added)
-
tags/1.0.4/images/fb1.svg (added)
-
tags/1.0.4/images/fb2.svg (added)
-
tags/1.0.4/images/fb3.svg (added)
-
tags/1.0.4/images/fb4.svg (added)
-
tags/1.0.4/images/fb5.svg (added)
-
tags/1.0.4/images/icon1.svg (added)
-
tags/1.0.4/images/icon2.svg (added)
-
tags/1.0.4/images/icon3.svg (added)
-
tags/1.0.4/images/icon4.svg (added)
-
tags/1.0.4/images/location.svg (added)
-
tags/1.0.4/images/mo1.svg (added)
-
tags/1.0.4/images/mo2.svg (added)
-
tags/1.0.4/images/mo3.svg (added)
-
tags/1.0.4/images/mo4.svg (added)
-
tags/1.0.4/images/phone.svg (added)
-
tags/1.0.4/images/ps1.svg (added)
-
tags/1.0.4/images/ps2.svg (added)
-
tags/1.0.4/images/ps3.svg (added)
-
tags/1.0.4/images/trusting_solar_image.png (added)
-
tags/1.0.4/images/upload.svg (added)
-
tags/1.0.4/include (added)
-
tags/1.0.4/include/shortcodeConstructor.php (added)
-
tags/1.0.4/includes.php (added)
-
tags/1.0.4/js (added)
-
tags/1.0.4/js/custom.js (added)
-
tags/1.0.4/js/jquery.validate.js (added)
-
tags/1.0.4/js/svg-inject.min.js (added)
-
tags/1.0.4/readme.txt (added)
-
tags/1.0.4/solar-wizard-lite.php (added)
-
trunk/js/custom.js (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/solar-wizard-lite.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
solar-wizard-lite/trunk/js/custom.js
r2541249 r2542390 134 134 $(this).closest( ".sw_form" ).find(".sw_monthly_bill" ).val( 0); 135 135 handle.append(bubble); 136 addTouchEvents(".ui-slider-horizontal .ui-slider-handle.ui-corner-all"); 136 137 }, 137 138 slide: function( event, ui ) { … … 531 532 return false; 532 533 }) 534 535 function addTouchEvents(pathForElements) { 536 function bindSliderFunctionality(targetElement) { 537 this.originValue = -9000; 538 this.endValue = 0; 539 this.originSet = false; 540 var _sliderThis = this; 541 function failsafe(e) { 542 if (e === undefined) { 543 return -1; 544 } 545 if (e.touches === undefined) { 546 return -1; 547 } 548 if (e.touches[0] === undefined) { 549 return -1; 550 } 551 } 552 targetElement.addEventListener('touchstart', function(e) { 553 if (failsafe(e) === -1) { 554 return; 555 } 556 if (_sliderThis.originSet === false) { 557 _sliderThis.originValue = e.touches[0].clientX; 558 _sliderThis.originSet = true; 559 } 560 }); 561 targetElement.addEventListener('touchmove', function(e) { 562 if (failsafe(e) === -1) { 563 return; 564 } 565 const start = _sliderThis.originValue; 566 const current = e.touches[0].clientX; 567 const sliderWidth = e.touches[0].target.parentElement.parentElement.clientWidth; 568 const sliderHeight = e.touches[0].target.parentElement.parentElement.clientHeight; 569 const installType = jQuery(targetElement).closest('form').find("input[name='describe_you']:checked").val(); 570 let newLeft; 571 if (start > sliderWidth) { 572 newLeft = (((current - start) / (sliderWidth))) * 100; 573 } else { 574 newLeft = (((current - start) / (sliderWidth - start))) * 100; 575 } 576 if (newLeft < 0) { 577 newLeft = 0; 578 } else if (newLeft < 0) { 579 newLeft = 0; 580 } else if (newLeft > 100) { 581 newLeft = 100; 582 } 583 let minimum = 0; 584 let limit = 1500; 585 let radix = 4; 586 let div = 100; 587 let billSubstr = 4; 588 if (installType === 'Commercial') { 589 limit = 10000; 590 radix = 6; 591 div = 100; 592 minimum = 500; 593 } 594 const newLeftStr = String(newLeft).substr(0,11) + '%'; 595 let newPrice; 596 if (installType === 'Commercial') { 597 newPrice = Number((((newLeft / 0.01) * (limit-minimum)) / limit) + 500); 598 } else { 599 newPrice = Number((newLeft / div) * limit); 600 } 601 const newMonthlyAmount = Number(newPrice); 602 if ((newMonthlyAmount > 100) && (newMonthlyAmount < 1000)) { 603 billSubstr = 3; 604 } else if ((newMonthlyAmount >= 1000) && (newMonthlyAmount < 10000)) { 605 billSubstr = 4; 606 } else if ((newMonthlyAmount >= 10000)) { 607 billSubstr = 5; 608 } 609 const monthlyBill = String(newMonthlyAmount).substr(0,billSubstr).replace('.',''); 610 targetElement.style.left = newLeftStr; 611 jQuery(targetElement).closest( ".sw_form" ).find(".sw_monthly_bill" ).val(monthlyBill); 612 e.touches[0].target.innerText = '$' + monthlyBill; 613 }); 614 targetElement.addEventListener('touchend', function(e) { 615 if (failsafe(e) === -1) { 616 return; 617 } 618 }); 619 targetElement.addEventListener('touchcancel', function(e) { 620 if (failsafe(e) === -1) { 621 return; 622 } 623 }); 624 } 625 jQuery(pathForElements).each(function(index, item) { 626 bindSliderFunctionality(item); 627 }); 628 } 533 629 }); -
solar-wizard-lite/trunk/readme.txt
r2541256 r2542390 4 4 Requires at least: 4.7 5 5 Tested up to: 5.7.2 6 Stable tag: 1.0. 36 Stable tag: 1.0.4 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 83 83 == Changelog == 84 84 85 = 1.0.4 = 86 * Solved issue of amount slider (Mobile view) on monthly billing value slide 87 85 88 = 1.0.3 = 86 89 * Updates in Tabs -
solar-wizard-lite/trunk/solar-wizard-lite.php
r2541249 r2542390 4 4 * Plugin URI: https://solarwizardplugin.com/ 5 5 * Description: Calculate solar estimate and savings. 6 * Version: 1.0. 36 * Version: 1.0.4 7 7 * Requires PHP: 7.2 8 8 * Author: Covert Communication
Note: See TracChangeset
for help on using the changeset viewer.