Updating with js schedule url
authorSteve Sutton <steve@gaslightmedia.com>
Thu, 7 Mar 2019 15:04:30 +0000 (10:04 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Thu, 7 Mar 2019 15:04:30 +0000 (10:04 -0500)
They change this all the time.

js/app.js
js/custom/pageSetup.js
parts/schedules-dropdown.php
style.css

index cdee5da..8c440ef 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -363,7 +363,7 @@ $(document).ready(function () {
 
     // redirect any clicks on the list items to the appropriate page
     $('.newdd-sched-option').on('click', function() {
-        location.href = "https://www.mackinacferry.com/schedules/?dockId=" + $(this).attr('value') + "&scheduleId=" + $(this).parent().attr('id').slice(-1) + "#edit-divy";
+        location.href = scheduleUrl + "?dockId=" + $(this).attr('value') + "&scheduleId=" + $(this).parent().attr('id').slice(-1) + "#edit-divy";
     });
 });
 
index 10f454d..b4509e1 100644 (file)
@@ -352,7 +352,7 @@ $(document).ready(function () {
 
     // redirect any clicks on the list items to the appropriate page
     $('.newdd-sched-option').on('click', function() {
-        location.href = "https://www.mackinacferry.com/schedules/?dockId=" + $(this).attr('value') + "&scheduleId=" + $(this).parent().attr('id').slice(-1) + "#edit-divy";
+        location.href = scheduleUrl + "?dockId=" + $(this).attr('value') + "&scheduleId=" + $(this).parent().attr('id').slice(-1) + "#edit-divy";
     });
 });
 
index 16fb0ba..723b3ce 100644 (file)
@@ -1,3 +1,11 @@
+<?php
+// Get the options for starline
+$starlineOptions  = unserialize( get_option( GLM_MEMBERS_APIS_STARLINE_OPTION_NAME ) );
+$starlinePageSlug = ( isset( $starlineOptions['pageSlug'] ) ) ? $starlineOptions['pageSlug'] : '';
+?>
+<script>
+var scheduleUrl = '<?php echo get_permalink( $starlinePageSlug );?>';
+</script>
 <ul class="sub-menu dropdown schedules-dropdown">
     <div id="schedules">
         <?php echo do_shortcode('[glm-members-api-schedule in_dropdown="True"]'); ?>
index c62c760..f54ec7d 100644 (file)
--- a/style.css
+++ b/style.css
@@ -3,5 +3,5 @@ Theme Name: StarLine
 Author: Gaslight Media
 Author URI: http://www.gaslightmedia.com
 Description: A theme for Star Line
-Version: 1.0.41
+Version: 1.0.42
 */