Setup js calls to work in either https or http
authorSteve Sutton <steve@gaslightmedia.com>
Thu, 19 Jan 2017 17:28:41 +0000 (12:28 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Thu, 19 Jan 2017 17:28:41 +0000 (12:28 -0500)
This will be for making sites fully https.

models/front/events/detail.php
models/front/events/frontAdd.php
views/admin/events/editLocation.html

index e53c546..e4368b9 100644 (file)
@@ -76,7 +76,7 @@ class GlmMembersFront_events_detail extends GlmMembersFront_events_baseAction
         $categories = $this->getCategories();
         wp_register_script(
             'googlemaps-js',
-            'http://maps.googleapis.com/maps/api/js?key=' . $this->config['settings']['google_maps_api_key'],
+            '//maps.googleapis.com/maps/api/js?key=' . $this->config['settings']['google_maps_api_key'],
             null,
             GLM_MEMBERS_EVENTS_PLUGIN_VERSION,
             true
index 6378f7a..1e06f3b 100644 (file)
@@ -65,7 +65,7 @@ class GLmMembersFront_events_frontAdd extends GlmDataEvents
             $part = urlencode($part);
         }
         $addressString = implode( ',', $address);
-        $url = "http://maps.googleapis.com/maps/api/geocode/json?address={$addressString}";
+        $url = "//maps.googleapis.com/maps/api/geocode/json?address={$addressString}";
         $ch = curl_init($url);
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
         $return = json_decode(curl_exec($ch));
@@ -221,7 +221,7 @@ class GLmMembersFront_events_frontAdd extends GlmDataEvents
 
         if( ! wp_script_is( 'jquery-ui', 'enqueued' ) ){
             wp_enqueue_script('jquery-ui-datepicker', false, array('jquery'), false, true);
-            wp_enqueue_style('jquery-style', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css');
+            wp_enqueue_style('jquery-style', '//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css');
 //            wp_enqueue_script('front-js', GLM_MEMBERS_EVENTS_PLUGIN_PATH . '/js/front.js');
         }
         $view = 'frontAdd';
index 2870405..b44d76c 100644 (file)
@@ -1,7 +1,7 @@
 
 <!-- Location -->
 
-<script src="http://maps.googleapis.com/maps/api/js?{if $settings.google_maps_api_key != ''}&key={$settings.google_maps_api_key}{/if}"></script>
+<script src="//maps.googleapis.com/maps/api/js?{if $settings.google_maps_api_key != ''}&key={$settings.google_maps_api_key}{/if}"></script>
 <script type="text/javascript">var enableDraggable = true;</script>
 
 <!-- Add New City Dialog Box -->