├── inc ├── demo-data │ ├── screen-image.jpg │ ├── css │ │ └── demo-import.css │ ├── hus-customizer.dat │ ├── hus-widgets-demo.wie │ └── demo-import.php ├── elementor-widgets │ ├── assets │ │ ├── css │ │ │ ├── elementor-edit.css │ │ │ ├── utility.css │ │ │ ├── owl.carousel.min.css │ │ │ └── magnific-popup.css │ │ ├── fonts │ │ │ └── themify-icon │ │ │ │ └── fonts │ │ │ │ ├── themify.eot │ │ │ │ ├── themify.ttf │ │ │ │ └── themify.woff │ │ └── js │ │ │ ├── jquery.counterup.min.js │ │ │ ├── map-active.js │ │ │ ├── progress-loader-canvas.js │ │ │ ├── jquery.counterup.js │ │ │ ├── imagesLoaded.js │ │ │ ├── barfiller.js │ │ │ ├── waypoints.js │ │ │ ├── hus-companion-main.js │ │ │ └── jquery.youtubebackground.js │ └── widgets │ │ ├── blog.php │ │ ├── certificates.php │ │ ├── contact.php │ │ ├── quotation.php │ │ ├── testimonial.php │ │ ├── hero-section.php │ │ ├── apartments.php │ │ ├── about-area.php │ │ └── facilities.php ├── hus-metabox.php ├── sidebar-widgets │ ├── instagram.php │ ├── blog-widget.php │ ├── newsletter-widget.php │ ├── social-links.php │ ├── about-widget.php │ └── contact-info.php └── instagram-api.php ├── js ├── common.js └── loadmore-ajax.js ├── hus-init.php ├── hus-companion.php └── readme.txt /inc/demo-data/screen-image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColorlibHQ/hus-companion/main/inc/demo-data/screen-image.jpg -------------------------------------------------------------------------------- /inc/elementor-widgets/assets/css/elementor-edit.css: -------------------------------------------------------------------------------- 1 | .elementor-choices-label i { 2 | font-size: 18px !important; 3 | padding: 5px 0; 4 | } -------------------------------------------------------------------------------- /inc/elementor-widgets/assets/fonts/themify-icon/fonts/themify.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColorlibHQ/hus-companion/main/inc/elementor-widgets/assets/fonts/themify-icon/fonts/themify.eot -------------------------------------------------------------------------------- /inc/elementor-widgets/assets/fonts/themify-icon/fonts/themify.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColorlibHQ/hus-companion/main/inc/elementor-widgets/assets/fonts/themify-icon/fonts/themify.ttf -------------------------------------------------------------------------------- /inc/elementor-widgets/assets/fonts/themify-icon/fonts/themify.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColorlibHQ/hus-companion/main/inc/elementor-widgets/assets/fonts/themify-icon/fonts/themify.woff -------------------------------------------------------------------------------- /inc/demo-data/css/demo-import.css: -------------------------------------------------------------------------------- 1 | .ocdi__demo-import-notice:not(:empty) { 2 | background-color: transparent !important; 3 | border-left: 0px !important; 4 | box-shadow: none !important; 5 | padding: 0px !important; 6 | } 7 | .ocdi__demo-import-notice img { 8 | border: 4px solid #dbe3ea; 9 | width: auto; 10 | } 11 | .about-wrap .ocdi__demo-import-notice img { 12 | width: auto; 13 | } 14 | .about-wrap img { 15 | width: auto; 16 | } -------------------------------------------------------------------------------- /js/common.js: -------------------------------------------------------------------------------- 1 | (function ($) { 2 | "use strict"; 3 | /*------------------------------------- 4 | Instagram Photos 5 | -------------------------------------*/ 6 | function cp_instagram_photos() { 7 | $('.cp-instagram-photos').each(function(){ 8 | $.instagramFeed({ 9 | 'username': $(this).data('username'), 10 | 'container': $(this), 11 | 'display_profile': false, 12 | 'display_biography': false, 13 | 'items': $(this).data('items'), 14 | 'margin': 0 15 | }); 16 | console.log( $(this) ); 17 | }); 18 | 19 | } 20 | cp_instagram_photos(); 21 | })(jQuery); -------------------------------------------------------------------------------- /inc/elementor-widgets/assets/css/utility.css: -------------------------------------------------------------------------------- 1 | /* ------------------------- 2 | :: utility Class 3 | ---------------------------- */ 4 | .hus-pt-100 { 5 | padding-top: 100px; 6 | } 7 | .hus-pt-80 { 8 | padding-top: 80px; 9 | } 10 | .hus-pt-70 { 11 | padding-top: 70px; 12 | } 13 | .hus-pt-60 { 14 | padding-top: 60px; 15 | } 16 | .hus-pt-50 { 17 | padding-top: 50px; 18 | } 19 | .hus-pt-30 { 20 | padding-top: 30px; 21 | } 22 | .hus-pb-100 { 23 | padding-bottom: 100px; 24 | } 25 | .hus-pb-80 { 26 | padding-bottom: 80px; 27 | } 28 | .hus-pb-70 { 29 | padding-bottom: 70px; 30 | } 31 | .hus-pb-60 { 32 | padding-bottom: 60px; 33 | } 34 | .hus-pb-50 { 35 | padding-bottom: 50px; 36 | } 37 | .hus-pb-30 { 38 | padding-bottom: 30px; 39 | } 40 | -------------------------------------------------------------------------------- /hus-init.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /inc/elementor-widgets/assets/js/jquery.counterup.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jquery.counterup.js 1.0 3 | * 4 | * Copyright 2013, Benjamin Intal http://gambit.ph @bfintal 5 | * Released under the GPL v2 License 6 | * 7 | * Date: Nov 26, 2013 8 | */(function(e){"use strict";e.fn.counterUp=function(t){var n=e.extend({time:400,delay:10},t);return this.each(function(){var t=e(this),r=n,i=function(){var e=[],n=r.time/r.delay,i=t.text(),s=/[0-9]+,[0-9]+/.test(i);i=i.replace(/,/g,"");var o=/^[0-9]+$/.test(i),u=/^[0-9]+\.[0-9]+$/.test(i),a=u?(i.split(".")[1]||[]).length:0;for(var f=n;f>=1;f--){var l=parseInt(i/n*f);u&&(l=parseFloat(i/n*f).toFixed(a));if(s)while(/(\d+)(\d{3})/.test(l.toString()))l=l.toString().replace(/(\d+)(\d{3})/,"$1,$2");e.unshift(l)}t.data("counterup-nums",e);t.text("0");var c=function(){t.text(t.data("counterup-nums").shift());if(t.data("counterup-nums").length)setTimeout(t.data("counterup-func"),r.delay);else{delete t.data("counterup-nums");t.data("counterup-nums",null);t.data("counterup-func",null)}};t.data("counterup-func",c);setTimeout(t.data("counterup-func"),r.delay)};t.waypoint(i,{offset:"100%",triggerOnce:!0})})}})(jQuery); -------------------------------------------------------------------------------- /inc/elementor-widgets/assets/js/map-active.js: -------------------------------------------------------------------------------- 1 | (function ($) { 2 | 'use strict'; 3 | 4 | var map, 5 | $lat = $('[data-lat]').data('lat'), 6 | $lng = $('[data-lng]').data('lng'), 7 | $address = $('[data-address]').data('address'); 8 | 9 | var latlng = new google.maps.LatLng( parseFloat($lat), parseFloat($lng)); 10 | var stylez = [{ 11 | featureType: "all", 12 | elementType: "all", 13 | stylers: [{ 14 | saturation: -10 15 | }] 16 | }]; 17 | var mapOptions = { 18 | zoom: 15, 19 | center: latlng, 20 | scrollwheel: false, 21 | scaleControl: false, 22 | disableDefaultUI: true, 23 | mapTypeControlOptions: { 24 | mapTypeIds: [google.maps.MapTypeId.ROADMAP, 'gMap'] 25 | } 26 | }; 27 | map = new google.maps.Map(document.getElementById("googleMap"), mapOptions); 28 | var geocoder_map = new google.maps.Geocoder(); 29 | geocoder_map.geocode({ 30 | 'address': $address 31 | }, function (results, status) { 32 | if (status == google.maps.GeocoderStatus.OK) { 33 | map.setCenter(results[0].geometry.location); 34 | var marker = new google.maps.Marker({ 35 | map: map, 36 | position: map.getCenter() 37 | }); 38 | } else { 39 | alert("Geocode was not successful for the following reason: " + status); 40 | } 41 | }); 42 | var mapType = new google.maps.StyledMapType(stylez, { 43 | name: "Grayscale" 44 | }); 45 | map.mapTypes.set('gMap', mapType); 46 | map.setMapTypeId('gMap'); 47 | 48 | })(jQuery); -------------------------------------------------------------------------------- /inc/demo-data/hus-customizer.dat: -------------------------------------------------------------------------------- 1 | a:4:{s:8:"template";s:3:"hus";s:4:"mods";a:24:{i:0;b:0;s:18:"custom_css_post_id";i:-1;s:18:"nav_menu_locations";a:2:{s:12:"primary-menu";i:15;s:15:"important-links";i:14;}s:25:"hus_social_profile_toggle";b:1;s:19:"hus_social_profiles";a:4:{i:0;a:4:{s:17:"social_link_title";s:9:"Facebook ";s:10:"social_url";s:1:"#";s:11:"social_icon";s:14:"fa fa-facebook";s:5:"index";i:0;}i:1;a:4:{s:17:"social_link_title";s:11:"Google Plus";s:10:"social_url";s:1:"#";s:11:"social_icon";s:17:"fa fa-google-plus";s:5:"index";i:1;}i:2;a:4:{s:17:"social_link_title";s:7:"Twitter";s:10:"social_url";s:1:"#";s:11:"social_icon";s:13:"fa fa-twitter";s:5:"index";i:2;}i:3;a:4:{s:17:"social_link_title";s:9:"Instagram";s:10:"social_url";s:1:"#";s:11:"social_icon";s:15:"fa fa-instagram";s:5:"index";i:3;}}s:23:"hus_header_top_btn_text";s:5:"Login";s:22:"hus_header_top_btn_url";s:0:"";s:23:"hus_header_phone_number";s:20:"Call us +001 325 589";s:13:"hus_blog_meta";b:1;s:12:"hus_like_btn";b:1;s:14:"hus_blog_share";b:1;s:24:"hus_footer_widget_toggle";b:1;s:31:"hus_footer_widget_heading_color";s:7:"#ffffff";s:28:"hus_footer_widget_text_color";s:7:"#a3a3a3";s:30:"hus_footer_widget_anchor_color";s:7:"#9e9e9e";s:36:"hus_footer_widget_anchor_hover_color";s:7:"#ffffff";s:19:"hus_header_bg_color";s:7:"#ffffff";s:21:"hus_header_menu_color";s:7:"#131313";s:27:"hus_header_menu_hover_color";s:7:"#808080";s:23:"hus_dropdown_menu_color";s:7:"#131313";s:29:"hus_dropdown_menu_hover_color";s:7:"#808080";s:21:"hus_fof_textone_color";s:7:"#000000";s:21:"hus_fof_texttwo_color";s:7:"#656565";s:16:"hus_fof_bg_color";s:7:"#ffffff";}s:7:"options";a:2:{s:9:"site_icon";s:1:"0";s:23:"nav_menus_created_posts";a:0:{}}s:6:"wp_css";s:0:"";} -------------------------------------------------------------------------------- /js/loadmore-ajax.js: -------------------------------------------------------------------------------- 1 | (function ($) { 2 | 'use strict'; 3 | 4 | // Portfolio load more button Ajax 5 | 6 | var $loadbutton = $('.loadAjax'); 7 | 8 | if ($loadbutton.length) { 9 | 10 | var postNumber = portfolioloadajax.postNumber, 11 | Incr = 0; 12 | // 13 | $loadbutton.on('click', function () { 14 | 15 | 16 | Incr = Incr + parseInt(postNumber); 17 | 18 | var $button = $(this), 19 | $data; 20 | 21 | $data = { 22 | 'action': 'hus_portfolio_ajax', 23 | 'postNumber': postNumber, 24 | 'postIncrNumber': Incr, 25 | 'elsettings': portfolioloadajax.elsettings 26 | }; 27 | 28 | $.ajax({ 29 | 30 | url: portfolioloadajax.action_url, 31 | data: $data, 32 | type: 'POST', 33 | 34 | 35 | success: function (data) { 36 | 37 | $('.hus-portfolio-load').html(data); 38 | 39 | var $container = $('.hus-portfolio'); 40 | 41 | $container.isotope('reloadItems').isotope({ 42 | itemSelector: '.single_gallery_item', 43 | percentPosition: true, 44 | masonry: { 45 | columnWidth: '.single_gallery_item' 46 | } 47 | }); 48 | 49 | var loaditems = parseInt(Incr) + parseInt(postNumber); 50 | 51 | if (portfolioloadajax.totalitems == loaditems) { 52 | $button.hide(); 53 | } 54 | 55 | } 56 | 57 | }); 58 | 59 | return false; 60 | 61 | }); 62 | 63 | 64 | } 65 | 66 | 67 | })(jQuery); -------------------------------------------------------------------------------- /inc/demo-data/hus-widgets-demo.wie: -------------------------------------------------------------------------------- 1 | {"sidebar-1":{"block-2":{"content":""},"block-3":{"content":"
Hus Companion plugin you have to also install the %1$sHus Theme%2$s', 'hus-companion' ), '', '' ); ?>
71 |43 | 44 | 45 |
46 | 47 |48 | 49 | 50 |
51 | 52 |53 | 54 | 55 |
56 | 57 | 58 | esc_html__( 'Show most latest blog post.', 'hus-companion' ), ) 34 | ); 35 | 36 | } 37 | 38 | // This is where the action happens 39 | public function widget( $args, $instance ) { 40 | $title = apply_filters( 'hus_blog_sectiontitle', $instance['sectiontitle'] ); 41 | $postnumber = apply_filters( 'hus_blog_postnumber', $instance['postnumber'] ); 42 | $style = apply_filters( 'hus_blog_style', $instance['style'] ); 43 | 44 | // before and after widget arguments are defined by themes 45 | echo wp_kses_post( $args['before_widget'] ); 46 | if ( ! empty( $title ) ) 47 | echo wp_kses_post( $args['before_title'] . $title . $args['after_title'] ); 48 | 49 | 50 | ?> 51 | 52 |136 | 137 | 138 |
139 |140 | 141 | 142 |
143 |144 | 145 | 146 | 150 |
151 | 152 | access_token = hus_opt( 'hus_igaccess_token' ); 42 | } 43 | 44 | /** 45 | * @param $screen_name string Instagram username 46 | * @param $image_limit int Number of images to retrieve 47 | * @param $image_width int Desired image width to retrieve 48 | * 49 | * @return array|bool Array of tweets or false if method fails 50 | */ 51 | public function get_items( $image_limit, $image_width ) { 52 | 53 | $transient = 'zoom_instagram_is_configured'; 54 | 55 | $response = wp_remote_get( sprintf( 'https://api.instagram.com/v1/users/self/media/recent/?access_token=%s&count=%s', $this->access_token, $image_limit ) ); 56 | 57 | 58 | if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) { 59 | set_transient( $transient, false, MINUTE_IN_SECONDS ); 60 | 61 | return false; 62 | } 63 | 64 | 65 | 66 | $data = json_decode( wp_remote_retrieve_body( $response ) ); 67 | 68 | $result = array(); 69 | $username = ''; 70 | 71 | foreach ( $data->data as $item ) { 72 | 73 | if(empty($username)){ 74 | $username = $item->user->username; 75 | } 76 | 77 | $result[] = array( 78 | 'link' => $item->link, 79 | 'image-url' => $item->images->{ $this->get_best_size( $image_width ) }->url, 80 | 'likes' => $item->likes->count, 81 | 'comments' => $item->comments->count, 82 | 'location' => !empty( $item->location->name ) ? $item->location->name : '' 83 | ); 84 | } 85 | 86 | $result = array('items' => $result, 'username'=> $username ); 87 | set_transient( $transient, $result, 30 * MINUTE_IN_SECONDS ); 88 | 89 | return $result; 90 | } 91 | 92 | /** 93 | * @param $screen_name string Instagram username 94 | * 95 | * @return bool|int Instagram user id or false on error 96 | */ 97 | protected function get_user_id( $screen_name ) { 98 | $user_id_option = 'zoom_instagram_uid_' . $screen_name; 99 | 100 | if ( false !== ( $user_id = get_option( $user_id_option ) ) ) { 101 | return $user_id; 102 | } 103 | 104 | $response = wp_remote_get( sprintf( 'https://api.instagram.com/v1/users/search?q=%s&access_token=%s', $screen_name, $this->access_token ) ); 105 | 106 | if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) { 107 | return false; 108 | } 109 | 110 | $result = json_decode( wp_remote_retrieve_body( $response ) ); 111 | 112 | if ( ! isset( $result->data ) ) { 113 | return false; 114 | } 115 | 116 | $user_id = false; 117 | 118 | foreach ( $result->data as $user ) { 119 | if ( $user->username === $screen_name ) { 120 | $user_id = $user->id; 121 | 122 | break; 123 | } 124 | } 125 | 126 | update_option( $user_id_option, $user_id ); 127 | 128 | return $user_id; 129 | } 130 | 131 | /** 132 | * @param $desired_width int Desired image width in pixels 133 | * 134 | * @return string Image size for Instagram API 135 | */ 136 | protected function get_best_size( $desired_width ) { 137 | $size = 'thumbnail'; 138 | $sizes = array( 139 | 'thumbnail' => 137, 140 | 'low_resolution' => 150, 141 | 'standard_resolution' => 640 142 | ); 143 | 144 | $diff = PHP_INT_MAX; 145 | 146 | foreach ( $sizes as $key => $value ) { 147 | if ( abs( $desired_width - $value ) < $diff ) { 148 | $size = $key; 149 | $diff = abs( $desired_width - $value ); 150 | } 151 | } 152 | 153 | return $size; 154 | } 155 | 156 | /** 157 | * Check if given access token is valid for Instagram Api. 158 | */ 159 | public static function is_access_token_valid( $access_token ) { 160 | $response = wp_remote_get( sprintf( 'https://api.instagram.com/v1/users/self/?access_token=%s', $access_token ) ); 161 | 162 | if ( is_wp_error( $response ) ) { 163 | return $response; 164 | } 165 | 166 | if ( 200 != wp_remote_retrieve_response_code( $response ) ) { 167 | return false; 168 | } 169 | 170 | return true; 171 | } 172 | 173 | public function is_configured() { 174 | $transient = 'zoom_instagram_is_configured'; 175 | 176 | if ( false !== ( $result = get_transient( $transient ) ) ) { 177 | if ( 'yes' === $result ) { 178 | return true; 179 | } 180 | 181 | if ( 'no' === $result ) { 182 | return false; 183 | } 184 | } 185 | 186 | $condition = $this->is_access_token_valid( $this->access_token ); 187 | 188 | if ( true === $condition ) { 189 | set_transient( $transient, 'yes', DAY_IN_SECONDS ); 190 | 191 | return true; 192 | } 193 | 194 | set_transient( $transient, 'no', DAY_IN_SECONDS ); 195 | 196 | return false; 197 | } 198 | 199 | public static function reset_cache() { 200 | delete_transient( 'zoom_instagram_is_configured' ); 201 | } 202 | 203 | public function get_access_token() { 204 | return $this->access_token; 205 | } 206 | 207 | public function set_access_token( $access_token ) { 208 | $this->access_token = $access_token; 209 | } 210 | } 211 | ?> -------------------------------------------------------------------------------- /inc/sidebar-widgets/newsletter-widget.php: -------------------------------------------------------------------------------- 1 | esc_html__( 'Add footer newsletter signup form.', 'hus-companion' ), ) 28 | ); 29 | 30 | } 31 | 32 | // This is where the action happens 33 | public function widget( $args, $instance ) { 34 | 35 | $title = apply_filters( 'widget_title', $instance['title'] ); 36 | $actionurl = apply_filters( 'widget_actionurl', $instance['actionurl'] ); 37 | $desc = apply_filters( 'widget_desc', $instance['desc'] ); 38 | 39 | // before and after widget arguments are defined by themes 40 | echo wp_kses_post( $args['before_widget'] ); 41 | if ( ! empty( $title ) ) 42 | echo wp_kses_post( $args['before_title'] . $title . $args['after_title'] ); 43 | if( $desc ){ 44 | echo ''; 45 | } 46 | ?> 47 |98 | 99 | 100 |
101 | 102 |103 | 104 |
105 | 106 | 107 | 108 |
109 | 110 | 111 |
112 | 113 | start_controls_section( 50 | 'blog_content', 51 | [ 52 | 'label' => __( 'Latest Blog Setting', 'hus-companion' ), 53 | ] 54 | ); 55 | $this->add_control( 56 | 'sec_title', 57 | [ 58 | 'label' => __( 'Section Title', 'hus-companion' ), 59 | 'type' => Controls_Manager::TEXT, 60 | 'label_block' => true, 61 | 'default' => __( 'Our Latest News', 'hus-companion' ) 62 | ] 63 | ); 64 | $this->add_control( 65 | 'post_num', 66 | [ 67 | 'label' => esc_html__( 'Post Item', 'hus-companion' ), 68 | 'type' => Controls_Manager::NUMBER, 69 | 'label_block' => false, 70 | 'default' => absint(3), 71 | 'min' => 1, 72 | 'max' => 6, 73 | ] 74 | ); 75 | $this->add_control( 76 | 'post_order', 77 | [ 78 | 'label' => esc_html__( 'Post Order', 'hus-companion' ), 79 | 'type' => Controls_Manager::SWITCHER, 80 | 'label_block' => false, 81 | 'label_on' => 'ASC', 82 | 'label_off' => 'DESC', 83 | 'default' => 'yes', 84 | 'options' => [ 85 | 'no' => 'ASC', 86 | 'yes' => 'DESC' 87 | ] 88 | ] 89 | ); 90 | 91 | $this->end_controls_section(); // End few words content 92 | 93 | //------------------------------ Style Section ------------------------------ 94 | $this->start_controls_section( 95 | 'style_section', [ 96 | 'label' => __( 'Style Section Heading', 'hus-companion' ), 97 | 'tab' => Controls_Manager::TAB_STYLE, 98 | ] 99 | ); 100 | $this->add_control( 101 | 'section_title_color', [ 102 | 'label' => __( 'Section Title Color', 'hus-companion' ), 103 | 'type' => Controls_Manager::COLOR, 104 | 'selectors' => [ 105 | '{{WRAPPER}} .our_latest_news_area .section_title h3' => 'color: {{VALUE}};', 106 | ], 107 | ] 108 | ); 109 | $this->add_control( 110 | 'highlighted_color', [ 111 | 'label' => __( 'Highlighted Color', 'hus-companion' ), 112 | 'type' => Controls_Manager::COLOR, 113 | 'selectors' => [ 114 | '{{WRAPPER}} .our_latest_news_area .single_news .news_info .date' => 'background: {{VALUE}};', 115 | '{{WRAPPER}} .our_latest_news_area .single_news .news_info .news_meta h3 a:hover' => 'color: {{VALUE}};', 116 | '{{WRAPPER}} .our_latest_news_area .single_news .news_info .news_meta h3:hover' => 'color: {{VALUE}};', 117 | '{{WRAPPER}} .our_latest_news_area .single_news .news_info .news_meta a.read_more:hover' => 'color: {{VALUE}};', 118 | ], 119 | ] 120 | ); 121 | 122 | $this->end_controls_section(); 123 | } 124 | 125 | protected function render() { 126 | $this->load_widget_script(); 127 | $settings = $this->get_settings(); 128 | $sec_title = !empty( $settings['sec_title'] ) ? esc_html($settings['sec_title']) : ''; 129 | $post_num = !empty( $settings['post_num'] ) ? $settings['post_num'] : ''; 130 | $post_order = !empty( $settings['post_order'] ) ? $settings['post_order'] : ''; 131 | $post_order = $post_order == 'yes' ? 'DESC' : 'ASC'; 132 | ?> 133 | 134 | 135 |'.esc_html( $desc ).'
'; 51 | } ?> 52 | 53 | 72 | 73 | 91 |92 | 93 | 94 |
95 |96 | 97 | 98 |
99 |100 | 101 | 102 |
103 |104 | 105 | 106 |
107 |108 | 109 | 110 |
111 |112 | 113 | 114 |
115 |116 | 117 | 118 |
119 | 120 | =0;s={horizontal:{},vertical:{}};f=1;a={};u="waypoints-context-id";p="resize.waypoints";y="scroll.waypoints";v=1;w="waypoints-waypoint-ids";g="waypoint";m="waypoints";o=function(){function t(t){var e=this;this.$element=t;this.element=t[0];this.didResize=false;this.didScroll=false;this.id="context"+f++;this.oldScroll={x:t.scrollLeft(),y:t.scrollTop()};this.waypoints={horizontal:{},vertical:{}};t.data(u,this.id);a[this.id]=this;t.bind(y,function(){var t;if(!(e.didScroll||c)){e.didScroll=true;t=function(){e.doScroll();return e.didScroll=false};return r.setTimeout(t,n[m].settings.scrollThrottle)}});t.bind(p,function(){var t;if(!e.didResize){e.didResize=true;t=function(){n[m]("refresh");return e.didResize=false};return r.setTimeout(t,n[m].settings.resizeThrottle)}})}t.prototype.doScroll=function(){var t,e=this;t={horizontal:{newScroll:this.$element.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.$element.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};if(c&&(!t.vertical.oldScroll||!t.vertical.newScroll)){n[m]("refresh")}n.each(t,function(t,r){var i,o,l;l=[];o=r.newScroll>r.oldScroll;i=o?r.forward:r.backward;n.each(e.waypoints[t],function(t,e){var n,i;if(r.oldScroll<(n=e.offset)&&n<=r.newScroll){return l.push(e)}else if(r.newScroll<(i=e.offset)&&i<=r.oldScroll){return l.push(e)}});l.sort(function(t,e){return t.offset-e.offset});if(!o){l.reverse()}return n.each(l,function(t,e){if(e.options.continuous||t===l.length-1){return e.trigger([i])}})});return this.oldScroll={x:t.horizontal.newScroll,y:t.vertical.newScroll}};t.prototype.refresh=function(){var t,e,r,i=this;r=n.isWindow(this.element);e=this.$element.offset();this.doScroll();t={horizontal:{contextOffset:r?0:e.left,contextScroll:r?0:this.oldScroll.x,contextDimension:this.$element.width(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:r?0:e.top,contextScroll:r?0:this.oldScroll.y,contextDimension:r?n[m]("viewportHeight"):this.$element.height(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};return n.each(t,function(t,e){return n.each(i.waypoints[t],function(t,r){var i,o,l,s,f;i=r.options.offset;l=r.offset;o=n.isWindow(r.element)?0:r.$element.offset()[e.offsetProp];if(n.isFunction(i)){i=i.apply(r.element)}else if(typeof i==="string"){i=parseFloat(i);if(r.options.offset.indexOf("%")>-1){i=Math.ceil(e.contextDimension*i/100)}}r.offset=o-e.contextOffset+e.contextScroll-i;if(r.options.onlyOnScroll&&l!=null||!r.enabled){return}if(l!==null&&l<(s=e.oldScroll)&&s<=r.offset){return r.trigger([e.backward])}else if(l!==null&&l>(f=e.oldScroll)&&f>=r.offset){return r.trigger([e.forward])}else if(l===null&&e.oldScroll>=r.offset){return r.trigger([e.forward])}})})};t.prototype.checkEmpty=function(){if(n.isEmptyObject(this.waypoints.horizontal)&&n.isEmptyObject(this.waypoints.vertical)){this.$element.unbind([p,y].join(" "));return delete a[this.id]}};return t}();l=function(){function t(t,e,r){var i,o;r=n.extend({},n.fn[g].defaults,r);if(r.offset==="bottom-in-view"){r.offset=function(){var t;t=n[m]("viewportHeight");if(!n.isWindow(e.element)){t=e.$element.height()}return t-n(this).outerHeight()}}this.$element=t;this.element=t[0];this.axis=r.horizontal?"horizontal":"vertical";this.callback=r.handler;this.context=e;this.enabled=r.enabled;this.id="waypoints"+v++;this.offset=null;this.options=r;e.waypoints[this.axis][this.id]=this;s[this.axis][this.id]=this;i=(o=t.data(w))!=null?o:[];i.push(this.id);t.data(w,i)}t.prototype.trigger=function(t){if(!this.enabled){return}if(this.callback!=null){this.callback.apply(this.element,t)}if(this.options.triggerOnce){return this.destroy()}};t.prototype.disable=function(){return this.enabled=false};t.prototype.enable=function(){this.context.refresh();return this.enabled=true};t.prototype.destroy=function(){delete s[this.axis][this.id];delete this.context.waypoints[this.axis][this.id];return this.context.checkEmpty()};t.getWaypointsByElement=function(t){var e,r;r=n(t).data(w);if(!r){return[]}e=n.extend({},s.horizontal,s.vertical);return n.map(r,function(t){return e[t]})};return t}();d={init:function(t,e){var r;if(e==null){e={}}if((r=e.handler)==null){e.handler=t}this.each(function(){var t,r,i,s;t=n(this);i=(s=e.context)!=null?s:n.fn[g].defaults.context;if(!n.isWindow(i)){i=t.closest(i)}i=n(i);r=a[i.data(u)];if(!r){r=new o(i)}return new l(t,r,e)});n[m]("refresh");return this},disable:function(){return d._invoke(this,"disable")},enable:function(){return d._invoke(this,"enable")},destroy:function(){return d._invoke(this,"destroy")},prev:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(e>0){return t.push(n[e-1])}})},next:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(e101 | 102 | 103 |
104 | 105 |106 | 107 | 108 |
109 | 110 |111 | 112 |
'.wp_kses_post( nl2br($text) ).'
'; 194 | } 195 | if ( $btn_label ) { 196 | echo ''.esc_html( $btn_label ).''; 197 | } 198 | ?> 199 |'.wp_kses_post($text).'
178 | '; 179 | } 180 | ?> 181 |'.esc_html($exp_label).'
'; 221 | } 222 | ?> 223 |'.esc_html($item1_text).'
'; 254 | } 255 | ?> 256 |'.esc_html($item2_text).'
'; 264 | } 265 | ?> 266 |'.wp_kses_post( $text ).'
'; 280 | } 281 | if ( $anchor_title ) { 282 | echo ''.esc_html( $anchor_title ).''; 283 | } 284 | ?> 285 |202 | 203 | 204 |
205 |206 | 207 |
225 | 226 | 227 |
228 | 229 |230 | 231 |
249 | 250 | 251 |
252 | 253 |254 | 255 |
273 | 274 | 275 |
276 | 277 | 310 | 378 |