Plugin Directory

Changeset 2533191


Ignore:
Timestamp:
05/17/2021 06:08:58 PM (5 years ago)
Author:
spapril
Message:

display fixes and embedded calendar shortcode addition

Location:
showpass/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • showpass/trunk/css/showpass-style.css

    r2515969 r2533191  
    5555/* ---- Grid Overrides ---- */
    5656
    57 .showpass-event-card .showpass-event-list .showpass-background-white, .showpass-event-card .showpass-event-layout-list .showpass-background-white{
     57.showpass-event-card .showpass-event-list .showpass-background-white,
     58.showpass-event-card .showpass-event-layout-list .showpass-background-white,
     59.showpass-event-card .showpass-event-grid .showpass-background-white {
    5860  background-color: white;
    5961  color: black;
  • showpass/trunk/js/showpass-custom.js

    r2515969 r2533191  
    100100            showpass.tickets.calendarWidget(id, params);
    101101        });
     102
     103        const embeddedCalendarExists = document.getElementById('showpass-calendar-widget');
     104        if (embeddedCalendarExists) {
     105            let script = document.createElement("script");
     106            script.type = "text/javascript";
     107            script.src = 'https://showpass.com/static/dist/sdk.js';
     108            script.onload = function() {
     109                const id = embeddedCalendarExists.getAttribute('data-org-id');
     110                let params = {
     111                    'theme-primary': $('#option_widget_color').val(),
     112                };
     113                if (embeddedCalendarExists.getAttribute('data-tags')) {
     114                    const tags = {
     115                        tags: embeddedCalendarExists.getAttribute('data-tags')
     116                    };
     117                    params = Object.assign(params, tags);
     118                }
     119                showpass.tickets.mountCalendarWidget(id, params);
     120            };
     121            document.body.appendChild(script);
     122        }
    102123
    103124        $('body').on('click', '.open-product-widget', function(e) {
  • showpass/trunk/showpass-wordpress-plugin-shortcode.php

    r2515969 r2533191  
    959959add_shortcode('showpass_calendar_widget', 'wpshp_calendar_widget');
    960960
     961//[showpass_embed_calendar]
     962function wpshp_embed_calendar($atts, $content = null) {
     963    $organization_id = get_option('option_organization_id');
     964
     965    $tags = isset($atts['tags']) ? $atts['tags']
     966                                 : null;
     967
     968    if ($organization_id) {
     969        return '<div id="showpass-calendar-widget" data-org-id="'.$organization_id.'" data-tags="'.$tags.'"><div>';
     970    } else {
     971        return 'Please add your Showpass Organizer ID to your Wordpress Dashboard.';
     972    }
     973}
     974
     975add_shortcode('showpass_embed_calendar', 'wpshp_embed_calendar');
     976
    961977function showpass_scripts(){
    962978    if (!is_admin()) {
  • showpass/trunk/showpass-wordpress-plugin.php

    r2515969 r2533191  
    55     Description: List events, display event details and products. Use the Showpass purchase widget for on site ticket & product purchases all with easy to use shortcodes. See our git repo here for full documentation. https://github.com/showpass/showpass-wordpress-plugin
    66     Author: Showpass / Up In Code Inc.
    7      Version: 3.6.0
     7     Version: 3.6.1
    88     Author URI: https://www.showpass.com
    99     */
Note: See TracChangeset for help on using the changeset viewer.