Changeset 1936759
- Timestamp:
- 09/06/2018 10:07:29 AM (7 years ago)
- Location:
- mapple
- Files:
-
- 3 added
- 9 edited
-
assets/screenshot-2.jpg (modified) (previous)
-
assets/screenshot-3.jpg (modified) (previous)
-
assets/screenshot-4.jpg (added)
-
trunk/README.md (added)
-
trunk/admin/class-mapple-admin.php (modified) (3 diffs)
-
trunk/admin/partials/mapple-admin-field-textarea.php (added)
-
trunk/admin/partials/mapple-admin-page-settings.php (modified) (1 diff)
-
trunk/admin/partials/mapple-admin-settings-section-api.php (modified) (1 diff)
-
trunk/mapple.php (modified) (2 diffs)
-
trunk/public/class-mapple-public.php (modified) (1 diff)
-
trunk/public/js/mapple-public.js (modified) (2 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
mapple/trunk/admin/class-mapple-admin.php
r1933348 r1936759 202 202 203 203 /** 204 * Creates a textarea field 205 * 206 * @param array $args The arguments for the field 207 * @return string The HTML field 208 */ 209 public function field_textarea( $args ) { 210 211 $defaults['class'] = 'widefat'; 212 $defaults['description'] = ''; 213 $defaults['label'] = ''; 214 $defaults['name'] = $this->plugin_name . '-options[' . $args['id'] . ']'; 215 $defaults['placeholder'] = ''; 216 $defaults['value'] = ''; 217 $defaults['rows'] = 6; 218 219 apply_filters( $this->plugin_name . '-field-text-options-defaults', $defaults ); 220 221 $atts = wp_parse_args( $args, $defaults ); 222 223 if ( ! empty( $this->options[$atts['id']] ) ) { 224 225 $atts['value'] = $this->options[$atts['id']]; 226 227 } 228 229 include( plugin_dir_path( __FILE__ ) . 'partials/' . $this->plugin_name . '-admin-field-textarea.php' ); 230 231 } // field_textarea() 232 233 /** 204 234 * Returns an array of options names, fields types, and default values 205 235 * … … 211 241 212 242 $options[] = array( 'gmap-api-key', 'text', '' ); 243 $options[] = array( 'gmap-style-json', 'text', '' ); 213 244 214 245 return $options; … … 230 261 $this->plugin_name . '-api', 231 262 array( 232 'description' => 'Enter your key and save.',263 'description' => esc_html__( 'Enter your key and save.', 'mapple' ), 233 264 'id' => 'gmap-api-key', 234 265 'placeholder' => 'tHiSwIlLbEyOuRkEyToGoOgLeMaPsApI' 266 ) 267 ); 268 269 add_settings_field( 270 'gmap-style-json', 271 apply_filters( $this->plugin_name . 'label-gmap-style-json', esc_html__( 'Google Maps Style JSON', 'mapple' ) ), 272 array( $this, 'field_textarea' ), 273 $this->plugin_name, 274 $this->plugin_name . '-api', 275 array( 276 'description' => esc_html__( 'There is a nice tool https://mapstyle.withgoogle.com/ to create the JSON.', 'mapple' ), 277 'id' => 'gmap-style-json', 278 'placeholder' => esc_html__( 'put your JSON code inside here', 'mapple' ), 279 'rows' => 24, 235 280 ) 236 281 ); -
mapple/trunk/admin/partials/mapple-admin-page-settings.php
r1933348 r1936759 36 36 </ul> 37 37 <p><?php echo __( 'There are a few possible attributes you can provide to your `mapple_clients` shortcode. Here a full example with all possible options:', 'mapple' ); ?></p> 38 <code>[mapple_clients title-name="Name" title-address="Adresse" title-desc="Beschreibung" title-tags="Branche" title-search="Suche" title-search-placeholder="lostippen..." with-tags="true" with-search="true"]</code>38 <code>[mapple_clients title-name="Name" title-address="Adresse" title-desc="Beschreibung" title-tags="Branche" title-search="Suche" title-search-placeholder="lostippen..." title-filter-label="Nach Branche filtern" with-tags="true" with-search="true"]</code> 39 39 <p><?php echo __( 'all `title-` attributes are for customising words', 'mapple' ); ?></p> 40 40 <p><?php echo __( 'all `with-` attributes activate the tags coloumn, and filter when search is also active', 'mapple' ); ?></p> -
mapple/trunk/admin/partials/mapple-admin-settings-section-api.php
r1860209 r1936759 13 13 */ 14 14 15 ?><p></p> 15 // nothing to add here -
mapple/trunk/mapple.php
r1935166 r1936759 17 17 * Plugin URI: https://andrekelling.de/ 18 18 * Description: To show a google map with the locations of your clients. You can output additionally a sorted listing table of all your clients. Just with shortcodes. 19 * Version: 1. 3.019 * Version: 1.4.0 20 20 * Author: André Kelling 21 21 * Author URI: https://andrekelling.de/about … … 36 36 * Rename this for your plugin and update it as you release new versions. 37 37 */ 38 define( 'MAPPLE_VERSION', '1. 3.0' );38 define( 'MAPPLE_VERSION', '1.4.0' ); 39 39 40 40 /** -
mapple/trunk/public/class-mapple-public.php
r1933696 r1936759 99 99 wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/mapple-public.js', array($this->plugin_name.'gmaps'), $this->version, true ); 100 100 101 $dataToBePassed = array(102 'home' => get_stylesheet_directory_uri(),103 'pleaseWaitLabel' => __( 'Please wait...', 'default' )104 );105 wp_localize_script( $this->plugin_name, 'php_vars', $dataToBePassed );106 107 108 101 $options = get_option( $this->plugin_name . '-options' ); 109 102 $apiKey = $options['gmap-api-key']; 103 $styleJSON = $options['gmap-style-json']; 110 104 111 105 if(! empty($apiKey)){ 112 106 wp_enqueue_script($this->plugin_name.'gmaps' , 'https://maps.googleapis.com/maps/api/js?key='.$apiKey, '', $this->version, true ); 107 108 if(! empty($styleJSON)){ 109 $dataToBePassed = array( 110 'styleJSON' => json_decode($styleJSON) 111 ); 112 wp_localize_script( $this->plugin_name, 'mapple_vars', $dataToBePassed ); 113 } 113 114 } 114 115 116 115 } 117 116 -
mapple/trunk/public/js/mapple-public.js
r1935166 r1936759 4 4 5 5 const plugin = {}; 6 6 7 7 const settings = { 8 8 bounds: new google.maps.LatLngBounds(), 9 9 infowindow: new google.maps.InfoWindow(), 10 mapStyle: (typeof(mapple_vars) !== 'undefined') ? mapple_vars.styleJSON : '', 10 11 tableSelector: document.querySelectorAll('.mapple__table')[0], 11 12 tableTagsSelectorClass: 'mapple__tags', … … 35 36 mapTypeControl: false, 36 37 zoomControl: true, 37 panControl: true 38 panControl: true, 39 styles: settings.mapStyle 38 40 }; 39 41 -
mapple/trunk/readme.txt
r1935166 r1936759 5 5 Requires at least: 4.7 6 6 Tested up to: 4.9.5 7 Stable tag: 1. 3.07 Stable tag: 1.4.0 8 8 Requires PHP: 7.0 9 9 License: GPLv3.0 or later … … 19 19 This Plugin does not need jQuery! 20 20 21 The google map is centered shown to all markers added. Markers got little Infowindows with client's name, website and address 21 The google map is centered shown to all markers added. Markers got little Infowindows with client's name, website and address. 22 Map Style customisation is possible. 22 23 23 24 A few notes about technical things: … … 52 53 53 54 1. Output of Map and Table on the Front End. In between some text. You can place your shortcodes around. 54 2. New custom clients Post Type with address autocompletion 55 3. Enable search and filter section for clients in the table 55 2. custom styled Map with open infowindow 56 3. New custom clients Post Type with address autocompletion 57 4. Enable search and filter section for clients in the table 56 58 57 59 == Changelog == 60 61 = 1.4.0 = 62 * enable google maps style customisation 63 * remove unused `php_vars` from wp_localize_script 58 64 59 65 = 1.3.0 =
Note: See TracChangeset
for help on using the changeset viewer.