From 47619e9a8940b49907ae2a4d2aed39535550ba2c Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Wed, 15 Mar 2017 16:23:57 -0400 Subject: [PATCH] Remove the weird i other updates include trying to get the second schedule the one that will be in the drop down to work. --- js/front.js | 59 ---------------------------- models/front/apis/schedule.php | 12 ++++-- setup/shortcodes.php | 2 +- views/front/apis/schedule.html | 70 ++++++++++++++++++++++++++++++---- 4 files changed, 72 insertions(+), 71 deletions(-) diff --git a/js/front.js b/js/front.js index dc40786..91b47d5 100644 --- a/js/front.js +++ b/js/front.js @@ -220,14 +220,6 @@ jQuery(document).ready(function($){ return false; } - function myEnter(event) - { - if (typeof event == "undefined") - { - event = window.event; - } - alert(event.value); - } function checkLink() { var toAddress = document.getElementById('toaddress'); @@ -237,25 +229,6 @@ jQuery(document).ready(function($){ } return false; } - function makePopup(url, width, height, overflow) - { - if (width > 640) { width = 640; } - if (height > 480) { height = 480; } - - if (overflow == '' || !/^(scroll|resize|both)$/.test(overflow)) - { - overflow = 'both'; - } - - var win = window.open(url, '', - 'width=' + width + ',height=' + height - + ',scrollbars=' + (/^(scroll|both)$/.test(overflow) ? 'yes' : 'no') - + ',resizable=' + (/^(resize|both)$/.test(overflow) ? 'yes' : 'no') - + ',status=yes,toolbar=yes,menubar=yes,location=yes' - ); - - return win; - } function closeDialog(dialog,gid) { dialog.parentNode.removeChild(dialog); @@ -293,38 +266,6 @@ jQuery(document).ready(function($){ return true; } - - function addLoadListener(fn) - { - if (typeof window.addEventListener != 'undefined') - { - window.addEventListener('load', fn, false); - } - else if (typeof document.addEventListener != 'undefined') - { - document.addEventListener('load', fn, false); - } - else if (typeof window.attachEvent != 'undefined') - { - window.attachEvent('onload', fn); - } - else - { - var oldfn = window.onload; - if (typeof window.onload != 'function') - { - window.onload = fn; - } - else - { - window.onload = function() - { - oldfn(); - fn(); - }; - } - } - } function attachEventListener(target, eventType, functionRef, capture) { if (typeof target.addEventListener != "undefined") diff --git a/models/front/apis/schedule.php b/models/front/apis/schedule.php index 789c26c..f5f838c 100644 --- a/models/front/apis/schedule.php +++ b/models/front/apis/schedule.php @@ -1,4 +1,4 @@ -i$actionData: ' . print_r( $actionData, true ) . ''; $view = 'schedule'; $settings = array(); $content = ''; // Get the schedule from starline $url = get_option( GLM_MEMBERS_APIS_STARLINE_OPTION_NAME ) . 'ferrySchedule.php'; + if ( isset( $actionData['request']['in_dropdown'] ) && $inDropDown = filter_var( $actionData['request']['in_dropdown'], FILTER_VALIDATE_BOOLEAN) ) { + $url .= '?dropdown=1'; + } $curl = curl_init( $url ); curl_setopt( $curl, CURLOPT_RETURNTRANSFER, true ); - curl_setopt( $curl, CURLOPT_USERPWD, 'dev55:Glm15Keep!' ); + curl_setopt( $curl, CURLOPT_USERPWD, 'dev55:Glm15Keep!' ); $content = curl_exec( $curl ); curl_close( $curl ); $templateData = array( - 'content' => $content + 'content' => $content, + 'inDropDown' => $inDropDown, + 'schedulePage' => 'schedule-test-page' ); error_reporting(E_ALL ^ E_NOTICE); diff --git a/setup/shortcodes.php b/setup/shortcodes.php index 392a46a..e5a5961 100644 --- a/setup/shortcodes.php +++ b/setup/shortcodes.php @@ -93,7 +93,7 @@ $glmMembersApisShortcodes = array( 'action' => 'schedule', 'table' => false, 'attributes' => array( - 'template' => false, + 'in_dropdown' => false, ) ), ); diff --git a/views/front/apis/schedule.html b/views/front/apis/schedule.html index 714baac..09815ae 100644 --- a/views/front/apis/schedule.html +++ b/views/front/apis/schedule.html @@ -5,13 +5,67 @@ -- 2.17.1