Plugin Directory

Changeset 2451062


Ignore:
Timestamp:
01/06/2021 07:49:08 AM (5 years ago)
Author:
intelchip
Message:

Bugfixes & Feature update

  • jQuery dependency bugfix
  • NEW: Introduced visibility toggle for markers
Location:
osm-map-elementor/trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • osm-map-elementor/trunk/README.md

    r2424027 r2451062  
    2323   
    2424      <img src="https://raw.githubusercontent.com/flopperj/osm-map-elementor/master/assets/screenshot-5.jpg" width="500" height="auto" />
     25         
     26##  Changelog
     27[LATEST CHANGES](https://github.com/flopperj/osm-map-elementor/wiki/Changelog)
     28
    2529## Licence
    2630[GNU GENERAL PUBLIC LICENSE](https://raw.githubusercontent.com/flopperj/osm-map-elementor/master/LICENSE.txt)
  • osm-map-elementor/trunk/constants.php

    r2377533 r2451062  
    11<?php
    22define('OSM_MAP_SLUG', 'osm-map-elementor');
     3define('OSM_MAP_VERSION', '1.0.5');
  • osm-map-elementor/trunk/osm-map-elementor.php

    r2424027 r2451062  
    55 * Author:          ACT Innovate, James Arama, Alex Hooten
    66 * Author URI:      https://github.com/flopperj/elementor-osm-map
    7  * Version:         1.0.4
     7 * Version:         1.0.5
    88 */
    99
  • osm-map-elementor/trunk/osm-map.php

    r2424088 r2451062  
    2424
    2525    public static $slug = OSM_MAP_SLUG;
     26    public static $ver = OSM_MAP_VERSION;
    2627
    2728    /**
     
    209210                'input_type' => 'url',
    210211                'placeholder' => __('https://your-link.com', self::$slug),
     212            ]
     213        );
     214
     215        $repeater->add_control(
     216            'marker_visible',
     217            [
     218                'label' => __('Show Marker', self::$slug),
     219                'type' => \Elementor\Controls_Manager::SWITCHER,
     220                'label_on' => __('Show', self::$slug),
     221                'label_off' => __('Hide', self::$slug),
     222                'return_value' => 'yes',
     223                'default' => 'yes',
    211224            ]
    212225        );
     
    12921305        $coords = [];
    12931306        foreach ($markers as $marker) {
     1307
     1308            // hide markers that have been toggled off
     1309            if (isset($marker['marker_visible']) && empty($marker['marker_visible'])) {
     1310                continue;
     1311            }
     1312
    12941313            $loc = explode(',', $marker['marker_coords']);
    12951314            if (!empty($loc) && sizeof($loc) == 2) {
     
    15581577    {
    15591578        // grab global settings
    1560         $widget_settings = get_option('osm_widget');
     1579        $widget_settings = get_option('osm_widget', []);
    15611580
    15621581        $styles = [
     
    15671586
    15681587        // load fontawesome
    1569         if (!array_key_exists('enable_fontawesome', $widget_settings) || !empty($widget_settings['enable_fontawesome'])) {
     1588        if (!empty($widget_settings) && !array_key_exists('enable_fontawesome', $widget_settings) || !empty($widget_settings['enable_fontawesome'])) {
    15701589            $styles['font-awesome-free'] = plugins_url('/osm-map-elementor/assets/fontawesome-free-5.15.1/css/all.min.css');
    15711590        }
     
    15761595        }
    15771596
     1597        // queue jquery
     1598        add_action('wp_enqueue_scripts', function () {
     1599            wp_enqueue_script('jquery');
     1600        });
     1601
    15781602        // queue admin js
    15791603        if (is_admin()) {
    1580 
    15811604
    15821605            // queue google maps key if provided
     
    15861609            ];
    15871610
    1588             $dependencies = [];
     1611            $dependencies = ['jquery'];
    15891612            foreach ($admin_scripts as $handle => $path) {
    1590                 wp_register_script($handle, $path, $dependencies, '1.0', false);
     1613                wp_register_script($handle, $path, $dependencies, self::$ver, false);
    15911614                wp_enqueue_script($handle);
    15921615                $dependencies[] = $handle;
     
    16441667
    16451668    /**
    1646      * Prints out data for debugging
    1647      * @param $data
     1669     * Prints out debug information about given variable.
     1670     *
     1671     * @param boolean $var Variable to show debug information for.
     1672     * @param boolean $showHtml If set to true, the method prints the debug data in a screen-friendly way.
     1673     * @param boolean $showFrom If set to true, the method prints from where the function was called.
    16481674     */
    1649     private function __debug($data)
     1675    public function __debug($var = false, $showHtml = false, $showFrom = true)
    16501676    {
    1651         echo "<pre>";
    1652         print_r($data);
    1653         echo "</pre>";
     1677        if ($showFrom) {
     1678            $calledFrom = debug_backtrace();
     1679            echo '<strong>' . substr($calledFrom[0]['file'], 1) . '</strong>';
     1680            echo ' (line <strong>' . $calledFrom[0]['line'] . '</strong>)';
     1681        }
     1682        echo "\n<pre class=\"fi-debug\">\n";
     1683
     1684        $var = print_r($var, true);
     1685        if ($showHtml) {
     1686            $var = str_replace('<', '&lt;', str_replace('>', '&gt;', $var));
     1687        }
     1688        echo $var . "\n</pre>\n";
    16541689    }
    16551690}
  • osm-map-elementor/trunk/readme.txt

    r2424088 r2451062  
    11=== OSM Map Widget for Elementor ===
    22Plugin Name: OSM Map Widget for Elementor
    3 Version: 1.0.4
     3Version: 1.0.5
    44Author: ACT Innovate, James Arama, Alex Hooten
    55Author URI: https://github.com/flopperj/osm-map-elementor
    66Tags: elementor, elementor widget, map widget, open street map, addons
    77Requires at least: 5.0
    8 Tested up to: 5.5.1
     8Tested up to: 5.6
    99Requires PHP: 5.6
    1010Stable tag: 1.0.4
Note: See TracChangeset for help on using the changeset viewer.