Plugin Directory

Changeset 1933575


Ignore:
Timestamp:
08/31/2018 05:33:41 AM (8 years ago)
Author:
fbchville
Message:

Add popup full with espace information

Location:
simple-espace-table
Files:
637 added
3 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • simple-espace-table/trunk/composer.json

    r1905083 r1933575  
    11{
    2     "require": {
    3         "htmlburger/carbon-common": "^1.2",
    4         "htmlburger/carbon-fields": "^2.2",
    5         "htmlburger/carbon-debug": "^1.0",
    6         "htmlburger/carbon-field-number": "^2.2"
    7     }
     2    "require": {
     3        "htmlburger/carbon-common": "^1.2",
     4        "htmlburger/carbon-fields": "^2.2",
     5        "htmlburger/carbon-debug": "^1.0",
     6        "htmlburger/carbon-field-number": "^2.2"
     7    },
     8    "autoload": {
     9        "psr-4": {
     10            "Espace\\": "includes/espace/"
     11        }
     12    }
    813}
  • simple-espace-table/trunk/js/carbon_fields_logic.js

    r1906185 r1933575  
    2727                doPastEventsLogic($this_element);
    2828            } );
     29
     30        formatDates();
    2931    }
    3032
     
    7072        }
    7173    }
     74
     75    function formatDates() {
     76        $('select[name="_crb_espace_popup_date_format"] > option').each(function(index, element) {
     77            const $element = $(element);
     78
     79            $element.text(moment().format($element.val()));
     80
     81            setInterval(function () {
     82                $element.text(moment().format($element.val()));
     83            }, 1000);
     84        });
     85    }
    7286})(jQuery)
  • simple-espace-table/trunk/js/functions.js

    r1910165 r1933575  
    33    var $win = $(window);
    44    var in_table = false;
    5 
    65    var isMobile = false;
    76    if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4))) isMobile = true;
     
    3332                        }
    3433
     34                        // add event to resume scroll
     35                        window.addEventListener('resumeTableScroll', () => {
     36                            window.stopTableScroll = false;
     37                            scrollSpeed = $element.find('table').height() + $element.find('table').position().top;
     38                            autoScroll($element, scrollSpeed);
     39                        });
     40
     41                        // add a window event to stop table scroll
     42                        window.addEventListener('stopTableScroll', () => {
     43                            window.stopTableScroll = true;
     44                           
     45                        });
     46
    3547                        setInterval(function() {
     48                            // stop tableScrolling if popup is opened
     49                            if (window.stopTableScroll) {
     50                                $element.stop();
     51                                $element.clearQueue();
     52                                return;
     53                            }
     54
    3655                            const last_timeout_id = $element.data('last_timeout_over_id');
    3756
     
    5473
    5574                                    $element.stop();
    56 
    57    
    5875
    5976                                    $element.clearQueue();
  • simple-espace-table/trunk/options/post-meta.php

    r1906185 r1933575  
    100100                    ->set_width( 50 ),
    101101                Field::make( 'select', 'column_type', __( 'Choose A Column Option', 'crb' ) )
    102                     ->set_options( \SimpleEspaceTable\SetTable::set_get_column_options_test() ),
     102                    ->set_options( \Espace\SetTable::set_get_column_options_test() ),
    103103                Field::make( 'text', 'column_title', __( 'Title', 'crb' ) )
    104104                    ->set_required( true ),
  • simple-espace-table/trunk/options/theme-options.php

    r1906185 r1933575  
    88        Field::make( 'text', 'crb_table_api_key', __( 'API Key', 'crb' ) )
    99            ->set_help_text( __( 'Set the API key for the tables', 'crb' ) ),
     10    ) )
     11    ->add_tab( __( 'Espace Popup Settings', 'crb' ), array(
     12        Field::make( 'text', 'crb_espace_popup_address', __( 'Event Address', 'crb' ) )
     13            ->set_width( 50 )
     14            ->set_help_text( __( 'If left blank, we will try to get the api location name to create a link for google places' ) ),
     15        Field::make( 'text', 'crb_espace_popup_campus_address', __( 'Campus Address', 'crb' ) )
     16            ->set_width( 50 ),
     17        Field::make( 'text', 'crb_espace_popup_phone', __( 'Event Phone', 'crb' ) ),
     18        Field::make( 'select', 'crb_espace_popup_date_format', __( 'Choose Date Format', 'crb' ) )
     19            ->set_options([
     20                'MMM, ddd D, HH:mm A' => '',
     21                'MMM, ddd D, HH:mm:ss A' => '',
     22                'MMM, ddd DD, HH:mm a' => '',
     23                'MMMM, dddd DD, HH:mm A' => '',
     24                'YYYY, MMM, ddd, D, HH:mm A' => '',
     25                'YYYY, MMM, ddd, D, HH:mm:ss A' => '',
     26            ]),
     27    ) )
     28    ->add_tab( __( 'Espace Section Popup Settings', 'crb' ), array(
     29        Field::make( 'text', 'crb_espace_popup_description_title', __( 'Description Title', 'crb' ) )
     30            ->set_default_value( __('Description', 'crb') )
     31            ->set_width(50),
     32        Field::make( 'text', 'crb_espace_popup_date_and_time_title', __( 'Date And Time Title', 'crb' ) )
     33            ->set_default_value( __('Date And Time', 'crb') )
     34            ->set_width(50),
     35        Field::make( 'text', 'crb_espace_popup_location_title', __( 'Location Title', 'crb' ) )
     36            ->set_default_value( __('Location', 'crb') )
     37            ->set_width(50),
     38        Field::make( 'text', 'crb_espace_popup_event_contact_title', __( 'Event Contact Title', 'crb' ) )
     39            ->set_default_value( __('Event Contact', 'crb') )
     40            ->set_width(50),
     41        Field::make( 'text', 'crb_espace_popup_share_with_friends_title', __( 'Share With Friends Title', 'crb' ) )
     42            ->set_default_value( __('Share With Friends', 'crb') ),
     43        Field::make( 'checkbox', 'crb_espace_popup_hide_title', __( 'Hide Title', 'crb' ) )
     44            ->set_width( 50 ),
     45        Field::make( 'checkbox', 'crb_espace_popup_hide_description', __( 'Hide Description', 'crb' ) )
     46            ->set_width( 50 ),
     47        Field::make( 'checkbox', 'crb_espace_popup_hide_date_and_time', __( 'Hide Date And time', 'crb' ) )
     48            ->set_width( 50 ),
     49        Field::make( 'checkbox', 'crb_espace_popup_hide_location', __( 'Hide Location', 'crb' ) )
     50            ->set_width( 50 ),
     51            Field::make( 'checkbox', 'crb_espace_popup_hide_event_contact', __( 'Hide Contact', 'crb' ) )
     52            ->set_width( 50 ),
     53        Field::make( 'checkbox', 'crb_espace_popup_hide_share_with_friends', __( 'Hide Share', 'crb' ) )
     54            ->set_width( 50 ),
    1055    ) );
  • simple-espace-table/trunk/shortcode_template/tables.php

    r1911383 r1933575  
    1616
    1717// Get Table json Data
    18 $table_data = \SimpleEspaceTable\SetTable::set_get_table_json_data( $table_id );
     18$table_data = \Espace\SetTable::set_get_table_json_data( $table_id );
    1919
    2020$image_url = wp_get_attachment_url( carbon_get_post_meta( $table_id, 'crb_table_image' ) );
     
    2525
    2626$column_options = carbon_get_post_meta( $table_id, 'crb_columns' );
    27 $table_speed_multiplicator = carbon_get_post_meta( $table_id, 'crb_table_speed_multiplicator' );
    28 $table_seconds_pause = carbon_get_post_meta( $table_id, 'crb_table_seconds_pause' );
    29 $column_datas = array();
    30 
    31 
    32 
    33 
    34 if ( empty( $table_speed_multiplicator ) || ! is_numeric( $table_speed_multiplicator ) ) {
    35     $table_speed_multiplicator = 17;
    36 }
    37 
    38 if ( empty( $table_seconds_pause ) || ! is_numeric( $table_seconds_pause ) ) {
    39     $table_seconds_pause = 1;
    40 }
    41 
    42 $table_seconds_pause *= 1000;
    43 
    44 foreach ( $table_data as $table_dat ) {
    45     $column_data = array();
    46     foreach ( $column_options as $column_option ) {
    47         $column_data[ $column_option['column_title'] ] = array(
    48             'column_value' => $table_dat[ $column_option['column_type'] ],
    49             'column_width' => $column_option['column_width'],
    50             'max_words_on_line' => $column_option['max_words_on_line'],
    51             'wrap_text' => $column_option['wrap_text'],
    52             'forward_days_to_hide_date' => $column_option['forward_days_to_hide_date'],
    53             'hide_past_events' => $column_option['hide_past_events'],
    54             'title_font_size' => $column_option['title_font_size'],
    55             'column_font_size' => $column_option['column_font_size'],
    56             'column_type' => $column_option['column_type'],
    57         );
    58     }
    59 
    60     if ( ! empty( $column_data ) ) {
    61         $column_datas[] = $column_data;
    62     }
    63 }
    64 
    65 $column_datas = array_filter( $column_datas );
    6627
    6728
     
    6930$hide_header = carbon_get_post_meta( $table_id, 'crb_hide_header' );
    7031
    71 if ( empty( $column_datas ) ) {
    72     return;
    73 }
    74 
    7532?>
    7633
    77 <div class="section section-table" id="table_id-<?php echo $table_id; ?>">
     34<div class="section section-table" id="table_id-<?php echo $table_id; ?>" v-cloak>
    7835    <div class="table table-events">
    7936        <?php if ( ! $hide_header ) : ?>
     
    10663                    </table>
    10764                </div><!-- /.table__wrapper-head -->
    108 
    109                 <div class="table__wrapper-body" data-table_speed_multiplicator="<?php echo $table_speed_multiplicator; ?>" data-seconds_pause="<?php echo $table_seconds_pause; ?>">
    110                     <table>
    111                         <tbody>
    112                             <?php foreach ( $column_datas as $column_data ) : ?>
    113                                 <?php
    114                                     if ( \SimpleEspaceTable\SetTable::set_has_past_event( $column_data ) ) {
    115                                         continue;
    116                                     }
    117                                 ?>
    118                                 <tr>
    119                                     <?php foreach ( $column_data as $column_title => $column_single_data ) : ?>
    120                                         <?php 
    121                                         $column_value = $column_single_data['column_value'];
    122                                         ?>
    123                                         <td data-title="<?php echo esc_html( $column_title ); ?>" style="width: <?php echo $column_single_data['column_width']; ?>%; font-size: <?php echo $column_single_data['column_font_size'] ?>px;">
    124                                             <?php
    125                                             $max_words_on_line = $column_single_data['max_words_on_line'];
    126 
    127                                             if ( empty( $max_words_on_line ) || ! is_numeric( $max_words_on_line ) ) {
    128                                                 $max_words_on_line = 2;
    129                                             }
    130 
    131                                             if ( ! empty( $column_single_data['forward_days_to_hide_date'] ) ) {
    132                                                 $column_value = \SimpleEspaceTable\SetTable::set_format_time( $column_value, $column_single_data['column_type'], $column_single_data['forward_days_to_hide_date'] );
    133                                             }
    134 
    135                                             if ( $column_single_data['wrap_text'] ) {
    136                                                 echo esc_html( wp_trim_words( $column_value, $max_words_on_line, '' ) );
    137                                             } else {
    138                                                 echo esc_html( $column_value );
    139                                             }
    140                                             ?>
    141                                         </td>           
    142                                     <?php endforeach; ?>
    143                                 </tr>
    144                             <?php endforeach; ?>
    145                         </tbody>
    146                     </table>
    147                 </div><!-- /.table__wrapper-body -->
     65               
     66                <?php
     67                \Espace\FragmentsLoader::loadFragment('table-component.php', true, [
     68                    'table_id' => $table_id,
     69                    'column_options' => $column_options,
     70                    'table_data' => $table_data,
     71                ]);
     72                ?>
    14873            </div><!-- /.table__wrapper -->
    14974        </div><!-- /.table__body -->
  • simple-espace-table/trunk/simple-espace-table-plugin.php

    r1910182 r1933575  
    2626    \Carbon_Fields\Carbon_Fields::boot();
    2727
    28     // Include helpers
    29     include_once( SIMPLE_ESPACE_TABLE_PLUGIN_DIR . '/includes/classes/SetTable.php' );
    30 
    31     \SimpleEspaceTable\SetTable::init_table();
     28    \Espace\SetTable::init_table();
     29    \Espace\AjaxMethods::initMethods();
    3230
    3331    add_action( 'carbon_fields_register_fields', 'crb_register_theme_and_post_meta_options' );
     
    4846
    4947function crb_init_table_styles() {
    50     wp_enqueue_script( 'carbon-table-lodash', SIMPLE_ESPACE_TABLE_PLUGIN_URL . '/js/lodash.4.1.js', array( 'jquery' ), '4.1', true );
     48    wp_enqueue_script( 'carbon-table-js-functions', SIMPLE_ESPACE_TABLE_PLUGIN_URL . '/dist/bundle.js', array(), '1.6.1', true );
    5149
    52     wp_enqueue_script( 'flipclock-functions', SIMPLE_ESPACE_TABLE_PLUGIN_URL . '/js/flipclock.min.js', '1.5.1', true );
    53     wp_enqueue_script( 'carbon-table-js-functions', SIMPLE_ESPACE_TABLE_PLUGIN_URL . '/js/functions.js', array( 'carbon-table-lodash' ), '1.6.1', true );
     50    // add admin url
     51    wp_localize_script( 'carbon-table-js-functions', 'wp_espace_admin_data', [
     52        'admin_url' => admin_url('admin-ajax.php'),
     53    ]);
    5454
    5555    // Style loader
     
    6060
    6161function crb_init_admin_scripts() {
    62     wp_enqueue_script( 'carbon-field-logic-js', SIMPLE_ESPACE_TABLE_PLUGIN_URL . '/js/carbon_fields_logic.js', array( 'jquery' ), '1.1', true );
     62    wp_enqueue_script( 'moment-js', SIMPLE_ESPACE_TABLE_PLUGIN_URL . '/js/external/moment.min.js', array(), '1.1', true );
     63
     64    wp_enqueue_script( 'carbon-field-logic-js', SIMPLE_ESPACE_TABLE_PLUGIN_URL . '/js/carbon_fields_logic.js', array( 'jquery', 'moment-js' ), '1.1', true );
    6365}
    6466add_action( 'admin_enqueue_scripts', 'crb_init_admin_scripts' );
  • simple-espace-table/trunk/styles/style-table.css

    r1906185 r1933575  
    7676    .table-events table td { font-size: 12px; padding: 6px 20px !important; }
    7777}
     78
     79/* ------------------------------------------------------------ *\
     80    Vue modal
     81\* ------------------------------------------------------------ */
     82
     83.modal-mask {
     84    position: fixed;
     85    z-index: 9998;
     86    top: 0;
     87    left: 0;
     88    width: 100%;
     89    height: 100%;
     90    background-color: rgba(0, 0, 0, .5);
     91    display: table;
     92    transition: opacity .3s ease;
     93}
     94
     95.modal-wrapper {
     96    display: table-cell;
     97    vertical-align: middle;
     98}
     99
     100.modal-container {
     101    width: 100%;
     102    max-width: 750px;
     103    margin: 0px auto;
     104    padding: 40px;
     105    background-color: #fff;
     106    border-radius: 2px;
     107    box-shadow: 0 2px 8px rgba(0, 0, 0, .33);
     108    transition: all .3s ease;
     109    font-family: Helvetica, Arial, sans-serif;
     110}
     111
     112.modal-container label {
     113    font-weight: 600;
     114}
     115
     116.modal-container .view-map {
     117    display: inline-block;
     118    vertical-align: middle;
     119    font-size: 12px;
     120    margin-left: 8px;
     121}
     122
     123.modal-container p span {
     124    line-height: 1.8;
     125}
     126
     127.modal-container .location-container p span {
     128    display: block;
     129}
     130
     131.modal-container h4 {
     132    font-size: 16px;
     133    padding-bottom: 0;
     134    margin-top: 30px;
     135    margin-bottom: 4px;
     136}
     137
     138.modal-container p {
     139    font-size: 14px;
     140}
     141
     142.modal-container a {
     143    color: #40B9A1;
     144    font-weight: 500;
     145}
     146
     147.modal-header h2 {
     148    margin-top: 0;
     149    font-size: 27px;
     150}
     151
     152.modal-body {
     153    margin: 20px 0;
     154}
     155
     156.modal-default-button {
     157    float: right;
     158}
     159
     160/*
     161 * The following styles are auto-applied to elements with
     162 * transition="modal" when their visibility is toggled
     163 * by Vue.js.
     164 *
     165 * You can easily play with the modal transition by editing
     166 * these styles.
     167 */
     168
     169.modal-enter {
     170    opacity: 0;
     171}
     172
     173.modal-leave-active {
     174    opacity: 0;
     175}
     176
     177.modal-enter .modal-container,
     178.modal-leave-active .modal-container {
     179    -webkit-transform: scale(1.1);
     180    transform: scale(1.1);
     181}
     182
     183[v-cloak] {
     184    display: none !important;
     185}
     186
     187@media ( max-width: 767px ) {
     188    .modal-container {
     189        max-width: 95vw;
     190        padding: 20px 15px;
     191    }
     192
     193    .modal-header h2 {
     194        font-size: 18px;
     195    }
     196}
  • simple-espace-table/trunk/vendor/composer/autoload_psr4.php

    r1906185 r1933575  
    99    'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),
    1010    'Symfony\\Component\\VarDumper\\' => array($vendorDir . '/symfony/var-dumper'),
     11    'Espace\\' => array($baseDir . '/includes/espace'),
    1112    'Carbon_Fields\\' => array($vendorDir . '/htmlburger/carbon-fields/core'),
    1213    'Carbon_Field_Number\\' => array($vendorDir . '/htmlburger/carbon-field-number/core'),
  • simple-espace-table/trunk/vendor/composer/autoload_static.php

    r1906185 r1933575  
    2121            'Symfony\\Component\\VarDumper\\' => 28,
    2222        ),
     23        'E' =>
     24        array (
     25            'Espace\\' => 7,
     26        ),
    2327        'C' =>
    2428        array (
     
    3640        array (
    3741            0 => __DIR__ . '/..' . '/symfony/var-dumper',
     42        ),
     43        'Espace\\' =>
     44        array (
     45            0 => __DIR__ . '/../..' . '/includes/espace',
    3846        ),
    3947        'Carbon_Fields\\' =>
Note: See TracChangeset for help on using the changeset viewer.