WordPress.org

Plugin Directory

Changeset 1146122


Ignore:
Timestamp:
04/26/15 12:34:17 (3 years ago)
Author:
gyrus
Message:

1.1.1 release

Location:
developers-custom-fields
Files:
88 added
5 edited

Legend:

Unmodified
Added
Removed
  • developers-custom-fields/trunk/js/slt-cf-gmaps.min.js

    r1142114 r1146122  
    1 // Google Maps script for Developer's Custom Fields 
    2 // Contributed by adriantoll 
    3 // Be careful of center (in this script) / centre (DCF form field IDs) 
    4 /*global google *//*global slt_cf_gmaps */// Set up an array for multiple maps 
    5 function slt_cf_gmap_init(e,t,n,r,i,s,o,u){var a,f,l,c,h,p,d,v;i=i.replace(" ","");a=i.split(",");i=new google.maps.LatLng(a[0],a[1]);o==="hybrid"?o=google.maps.MapTypeId.HYBRID:o==="satellite"?o=google.maps.MapTypeId.SATELLITE:o==="terrain"?o=google.maps.MapTypeId.TERRAIN:o=google.maps.MapTypeId.ROADMAP;f={zoom:s,center:i,mapTypeId:o,scrollwheel:!1};slt_cf_maps[e]=[];slt_cf_maps[e].map=new google.maps.Map(document.getElementById(e),f);slt_cf_maps[e].map._slt_cf_mapname=e;if(n){var m=t==="input"?!0:!1;l=r.split(",");r=new google.maps.LatLng(l[0],l[1]);slt_cf_maps[e].marker=new google.maps.Marker({map:slt_cf_maps[e].map,position:r,draggable:m,animation:google.maps.Animation.DROP});slt_cf_maps[e].marker._slt_cf_mapname=e;google.maps.event.addListener(slt_cf_maps[e].marker,"drag",function(){var e=this.getPosition().toString().slice(1,-1).replace(" ","");document.getElementById(this._slt_cf_mapname+"_marker_latlng").value=e})}if(t==="input"){google.maps.event.addListener(slt_cf_maps[e].map,"bounds_changed",function(){document.getElementById(this._slt_cf_mapname+"_zoom").value=this.getZoom();document.getElementById(this._slt_cf_mapname+"_centre_latlng").value=this.getCenter().toString().slice(1,-1).replace(" ","");document.getElementById(this._slt_cf_mapname+"_bounds_sw").value=this.getBounds().getSouthWest().toString().slice(1,-1).replace(" ","");document.getElementById(this._slt_cf_mapname+"_bounds_ne").value=this.getBounds().getNorthEast().toString().slice(1,-1).replace(" ","")});if(jQuery().autocomplete){c=new google.maps.Geocoder;h=jQuery("#"+e+"_bounds_sw").val().split(",");d=jQuery("#"+e+"_bounds_ne").val().split(",");p=new google.maps.LatLng(h[0],h[1]);v=new google.maps.LatLng(d[0],d[1]);slt_cf_maps[e].map.geocodeBounds=new google.maps.LatLngBounds(p,v);jQuery(document).ready(function(t){t("#"+e).after('<p class="gmap-address"><label for="'+e+'_address">'+slt_cf_gmaps.geocoder_label+':</label> <input type="text" id="'+e+'_address" name="'+e+'_address" value="" class="regular-text" /></p>');t("#"+e+"_address").autocomplete({source:function(n,r){c.geocode({address:n.term,bounds:slt_cf_maps[e].map.getBounds()},function(e,n){n==google.maps.GeocoderStatus.OK?r(t.map(e,function(e){return{label:e.formatted_address,value:e.formatted_address,latitude:e.geometry.location.lat(),longitude:e.geometry.location.lng()}})):console.log("Geocode was not successful for the following reason: "+n)})},select:function(r,i){n&&t("#"+e+"_marker_latlng").val(i.item.latitude+","+i.item.longitude);t("#"+e+"_centre_latlng").val(i.item.latitude+","+i.item.longitude);var s=new google.maps.LatLng(i.item.latitude,i.item.longitude);n&&slt_cf_maps[e].marker.setPosition(s);slt_cf_maps[e].map.panTo(s)}})})}}typeof u!="undefined"&&window[u]&&window[u](slt_cf_maps[e].map)}var slt_cf_maps=[];jQuery(document).ready(function(e){e("div.gmap_input").length&&e("div.gmap_input").each(function(){var t,n;t=e(this).attr("id");e("input.gmap_toggle_display").length&&e("input.gmap_toggle_display").change(function(){e(this).hasClass("yes")?e("#"+t+"_wrapper").slideDown("fast",function(){n=slt_cf_maps[t].map.getCenter();google.maps.event.trigger(slt_cf_maps[t].map,"resize");slt_cf_maps[t].map.setCenter(n)}):e("#"+t+"_wrapper").slideUp()})})}); 
     1var slt_cf_maps=[];function slt_cf_gmap_init(f,g,j,c,b,o,m,n){var i,q,h,e,d,a,l,k;b=b.replace(" ","");i=b.split(",");b=new google.maps.LatLng(i[0],i[1]);if(m==="hybrid"){m=google.maps.MapTypeId.HYBRID}else{if(m==="satellite"){m=google.maps.MapTypeId.SATELLITE}else{if(m==="terrain"){m=google.maps.MapTypeId.TERRAIN}else{m=google.maps.MapTypeId.ROADMAP}}}q={zoom:o,center:b,mapTypeId:m,scrollwheel:false};slt_cf_maps[f]=[];slt_cf_maps[f].map=new google.maps.Map(document.getElementById(f),q);slt_cf_maps[f].map._slt_cf_mapname=f;if(j){var p=(g==="input")?true:false;h=c.split(",");c=new google.maps.LatLng(h[0],h[1]);slt_cf_maps[f].marker=new google.maps.Marker({map:slt_cf_maps[f].map,position:c,draggable:p,animation:google.maps.Animation.DROP});slt_cf_maps[f].marker._slt_cf_mapname=f;google.maps.event.addListener(slt_cf_maps[f].marker,"drag",function(){var r=this.getPosition().toString().slice(1,-1).replace(" ","");document.getElementById(this._slt_cf_mapname+"_marker_latlng").value=r})}if(g==="input"){google.maps.event.addListener(slt_cf_maps[f].map,"bounds_changed",function(){document.getElementById(this._slt_cf_mapname+"_zoom").value=this.getZoom();document.getElementById(this._slt_cf_mapname+"_centre_latlng").value=this.getCenter().toString().slice(1,-1).replace(" ","");document.getElementById(this._slt_cf_mapname+"_bounds_sw").value=this.getBounds().getSouthWest().toString().slice(1,-1).replace(" ","");document.getElementById(this._slt_cf_mapname+"_bounds_ne").value=this.getBounds().getNorthEast().toString().slice(1,-1).replace(" ","")});if(jQuery().autocomplete){e=new google.maps.Geocoder();d=jQuery("#"+f+"_bounds_sw").val().split(",");l=jQuery("#"+f+"_bounds_ne").val().split(",");a=new google.maps.LatLng(d[0],d[1]);k=new google.maps.LatLng(l[0],l[1]);slt_cf_maps[f].map.geocodeBounds=new google.maps.LatLngBounds(a,k);jQuery(document).ready(function(r){r("#"+f).after('<p class="gmap-address"><label for="'+f+'_address">'+slt_cf_gmaps.geocoder_label+':</label> <input type="text" id="'+f+'_address" name="'+f+'_address" value="" class="regular-text" /></p>');r("#"+f+"_address").autocomplete({source:function(t,s){e.geocode({address:t.term,bounds:slt_cf_maps[f].map.getBounds()},function(v,u){if(u==google.maps.GeocoderStatus.OK){s(r.map(v,function(w){return{label:w.formatted_address,value:w.formatted_address,latitude:w.geometry.location.lat(),longitude:w.geometry.location.lng()}}))}else{console.log("Geocode was not successful for the following reason: "+u)}})},select:function(s,u){if(j){r("#"+f+"_marker_latlng").val(u.item.latitude+","+u.item.longitude)}r("#"+f+"_centre_latlng").val(u.item.latitude+","+u.item.longitude);var t=new google.maps.LatLng(u.item.latitude,u.item.longitude);if(j){slt_cf_maps[f].marker.setPosition(t)}slt_cf_maps[f].map.panTo(t)}})})}}if(typeof n!=="undefined"&&window[n]){window[n](slt_cf_maps[f].map)}}jQuery(document).ready(function(a){if(a("div.gmap_input").length){a("div.gmap_input").each(function(){var c,b;c=a(this).attr("id");if(a("input.gmap_toggle_display").length){a("input.gmap_toggle_display").change(function(){if(a(this).hasClass("yes")){a("#"+c+"_wrapper").slideDown("fast",function(){b=slt_cf_maps[c].map.getCenter();google.maps.event.trigger(slt_cf_maps[c].map,"resize");slt_cf_maps[c].map.setCenter(b)})}else{a("#"+c+"_wrapper").slideUp()}})}})}}); 
  • developers-custom-fields/trunk/readme.txt

    r1142114 r1146122  
    55Requires at least: 3.5 
    66Tested up to: 4.2 
    7 Stable tag: 1.1 
     7Stable tag: 1.1.1 
    88 
    99Provides developers with powerful and flexible tools for managing post and user custom fields. 
     
    9292 
    9393== Changelog == 
     94= 1.2 = 
     95* Changed Google maps integration to allow multiple markers (thanks adriantoll!) - please read [the release notes](http://sltaylor.co.uk/blog/developers-custom-fields-1-1/) 
     96 
     97= 1.1.1 = 
     98* Fixed issue with max-width: 100% messing up Google controls 
     99 
    94100= 1.1 = 
    95101* Added `slt_cf_file_select_button_enqueue()`, for using file select button outside this plugin 
  • developers-custom-fields/trunk/slt-cf-lib.php

    r1142114 r1146122  
    734734 
    735735    // Map container 
    736     $output .= '<div id="' . $id . '" class="gmap_' . $type . '" style="width:' . esc_attr( $width ) . 'px;height:' . esc_attr( $height ) . 'px;"></div>' . "\n"; 
     736    $output .= '<style type="text/css">.gmap_output img {max-width:none;}</style><div id="' . $id . '" class="gmap_' . $type . '" style="width:' . esc_attr( $width ) . 'px;height:' . esc_attr( $height ) . 'px;"></div>' . "\n"; 
    737737 
    738738    // Hidden fields? 
  • developers-custom-fields/trunk/slt-cf-version-warnings.json

    r1142114 r1146122  
    11{ 
    2     "1.1.1": "Please note that the way Google map field data is stored has been changed to accomodate multiple markers. The transition should be seamless unless you've done some custom data handling which accesses the value from the postmeta table directly. See <a href='http://sltaylor.co.uk/blog/developers-custom-fields-1-1/'>this post</a> for details." 
     2    "1.2": "Please note that the way Google map field data is stored has been changed to accomodate multiple markers. The transition should be seamless unless you've done some custom data handling which accesses the value from the postmeta table directly. See <a href='http://sltaylor.co.uk/blog/developers-custom-fields-1-1/'>this post</a> for details." 
    33} 
  • developers-custom-fields/trunk/slt-custom-fields.php

    r1142114 r1146122  
    1010Description: Provides theme developers with tools for managing custom fields. 
    1111Author: Steve Taylor 
    12 Version: 1.1 
     12Version: 1.1.1 
    1313Author URI: http://sltaylor.co.uk 
    1414License: GPLv2 
     
    5151define( 'SLT_CF_NO_OPTIONS', __( 'No options to choose from', SLT_CF_TEXT_DOMAIN ) ); 
    5252define( 'SLT_CF_REQUEST_PROTOCOL', isset( $_SERVER[ 'HTTPS' ] ) ? 'https://' : 'http://' ); 
    53 define( 'SLT_CF_VERSION', '1.1' ); 
     53define( 'SLT_CF_VERSION', '1.1.1' ); 
    5454define( 'SLT_CF_PRIMARY_FILE_PATH', plugin_basename( __FILE__ ) ); 
    5555$slt_custom_fields = array(); 
Note: See TracChangeset for help on using the changeset viewer.