Plugin Directory

Changeset 2264875


Ignore:
Timestamp:
03/21/2020 07:40:13 AM (5 years ago)
Author:
magicplugins
Message:

Adding first version of my plugin

Location:
magic-conversation-for-gravity-forms/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • magic-conversation-for-gravity-forms/trunk/assets/css/sideform.css

    r2239122 r2264875  
    157157        line-height: 40px;
    158158        text-align: right;
     159    }
     160
     161    .mcfgfp-pin-team-close-ex {
     162        right: 0px;
     163        top: 0px;
     164        color: #777;
     165        text-align: center;
     166        z-index: 1;
    159167    }
    160168   
     
    238246
    239247#mcfgfp-pin-container .mcfgfp-pin-header-buttons-close {
    240     background-image: url("img/close.png");
     248    /*background-image: url("img/close.png");*/
    241249    background-repeat: no-repeat;
    242250    background-size: 14px 14px;
     
    250258@media not all, (min--moz-device-pixel-ratio: 1.3), not all, (min-resolution: 1.3dppx) {
    251259    #mcfgfp-pin-container .mcfgfp-pin-header-buttons-close {
    252         background-image: url("img/[email protected]");
     260        /*background-image: url("img/[email protected]");*/
    253261    }
    254262}
     
    292300
    293301#mcfgfp-pin-container .mcfgfp-pin-conversation-background-1 {
    294     background-image: url("img/background-1.png");
     302    /*background-image: url("img/background-1.png");*/
    295303    background-repeat: repeat;
    296304    background-size: 417px 417px;
     
    308316@media not all, (min--moz-device-pixel-ratio: 1.3), not all, (min-resolution: 1.3dppx) {
    309317    #mcfgfp-pin-container .mcfgfp-pin-conversation-background-1 {
    310         background-image: url("img/[email protected]");
     318        /*background-image: url("img/[email protected]");*/
    311319    }
    312320}
  • magic-conversation-for-gravity-forms/trunk/assets/html/sideform-bak.html

    r1592967 r2264875  
    114114
    115115        #intercom-container .intercom-header-buttons-close {
    116             background-image: url("img/close.png");
     116            /*background-image: url("img/close.png");*/
    117117            background-repeat: no-repeat;
    118118            background-size: 14px 14px;
     
    126126        @media not all, (min--moz-device-pixel-ratio: 1.3), not all, (min-resolution: 1.3dppx) {
    127127            #intercom-container .intercom-header-buttons-close {
    128                 background-image: url("img/[email protected]");
     128                /*background-image: url("img/[email protected]");*/
    129129            }
    130130        }
  • magic-conversation-for-gravity-forms/trunk/assets/js/v3/magic-conversation.js

    r2259507 r2264875  
    2727        var newHeight = $('.mcfgfp-pin-conversation-body-profile').height();
    2828        // console.log('mcfgf_fix_top newHeight', newHeight);
     29        if(!newHeight) {
     30            newHeight = 0;
     31        }
    2932        $('.mcfgfp-pin-conversation-body-parts').css('top', newHeight+'px');
    3033    }
     
    9497
    9598            //side form
    96             $('#mcfgfp-pin-container .mcfgfp-pin-btn, .mcfgfp-say-hi-body, .mcfgfp-launcher-badge, #mcfgfp-pin-container  .mcfgfp-pin-team-close').on('click', function(){
     99            $('#mcfgfp-pin-container .mcfgfp-pin-btn, .mcfgfp-say-hi-card, .mcfgfp-say-hi-body, .mcfgfp-launcher-badge, #mcfgfp-pin-container  .mcfgfp-pin-team-close').on('click', function(){
    97100                // console.log('_loadConversationForm 1', inited);
    98101                $('.mcfgfp-notifications-dismiss-button').trigger('click');
     
    198201        if(mcfgf_settings_basics.conversation_header_background_color) {
    199202            mcfgf_css_ex += '.mcfgfp-pin-conversation-body-profile { background-color: '+mcfgf_settings_basics.conversation_header_background_color+' !important;}'+"\r\n";
     203        }
     204
     205        if(mcfgf_settings_basics.conversation_header_font_color) {
     206            mcfgf_css_ex += '#mcfgf-pin-container .mcfgf-pin-team-profile-full-response-delay, #mcfgf-pin-container .mcfgf-pin-team-profile-full-team-name { color: '+mcfgf_settings_basics.conversation_header_font_color+' !important;}'+"\r\n";
     207        }
     208
     209        if(mcfgf_settings_basics.conversation_notification_background_color) {
     210            mcfgf_css_ex += '.mcfgfp-say-hi-card { background-color: '+mcfgf_settings_basics.conversation_notification_background_color+' !important;}'+"\r\n";
     211           
     212            mcfgf_css_ex += '#mcfgfp-pin-container .mcfgfp-say-hi-card::after { border-color: transparent transparent '+mcfgf_settings_basics.conversation_notification_background_color+' !important;}'+"\r\n";
     213        }
     214
     215        if(mcfgf_settings_basics.conversation_notification_font_color) {
     216            mcfgf_css_ex += '.mcfgfp-say-hi-card .mcfgfp-say-hi-title-name, .mcfgfp-say-hi-card .mcfgfp-say-hi-body, .mcfgfp-say-hi-card .mcfgfp-say-hi-body span { color: '+mcfgf_settings_basics.conversation_notification_font_color+' !important;}'+"\r\n";
    200217        }
    201218
  • magic-conversation-for-gravity-forms/trunk/help.php

    r1592967 r2264875  
    2525    $url_base = Settings_MagicConversationForGravityForms::$base_url;
    2626    ?>
    27         <div class="wrap"><h1>Magic Conversation For Gravity Forms Pro Help</h1></div>
     27        <style>
     28            pre.mcfgf_code {
     29              /*! background: #eee; */
     30            /*! background-image: -webkit-linear-gradient(#eee 50%,#e0e0e0 50%); */
     31            /*! background-image: -moz-linear-gradient(#eee 50%,#e0e0e0 50%); */
     32            /*! background-image: -ms-linear-gradient(#eee 50%,#e0e0e0 50%); */
     33            /*! background-image: -o-linear-gradient(#eee 50%,#e0e0e0 50%); */
     34            background-image: linear-gradient(#fff 50%,#fcfcfc 50%);
     35            background-position: 0 0;
     36            background-repeat: repeat;
     37            background-size: 4.5em 4.5em;
     38            color: #555;
     39            font-family: monospace, serif;
     40            /*font-size: 16px;*/
     41            line-height: 2.25em;
     42            margin: 1em 0em;
     43            overflow: auto;
     44            padding: 0 1.25em;
     45            max-width:100%;
     46            white-space: pre-wrap;       /* css-3 */
     47             white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
     48             white-space: -pre-wrap;      /* Opera 4-6 */
     49             white-space: -o-pre-wrap;    /* Opera 7 */
     50             word-wrap: break-word;       /* Internet Explorer 5.5+ */
     51            }
     52        </style>
     53        <div class="wrap"><h1>Magic Conversation For Gravity Forms Help</h1></div>
    2854        <p>Please review the plugin documentation and frequently asked questions (FAQ) first. If you still can't find the answer <a target="_blank" href="<?php echo $url_base; ?>/contact/" target="_blank">open a support ticket</a> and we will be happy to answer your questions and assist you with any problems. Please note: If you have not purchased a license from us, you will not have access to these help resources.</p>
     55
     56
     57        <h3>Quick Start</h3>
     58
     59        <p>Show a Conversation Button on the Home page or the entire website:</p>
     60
     61        <p><pre class="mcfgf_code">Settings -> Conversation Form -> Choose a form</pre></p>
     62
     63        <p>Embed a conversation into a post/page with a short code:</p>
     64
     65        <p><pre class="mcfgf_code">[magic-conversation id="1" width="100%" height="395px"]</pre></p>
     66
     67        <p>Add a Floating Conversation Button to a specific page with a short code:</p>
     68
     69        <p><pre class="mcfgf_code">[magic-conversation-button id="1"]</pre></p>
     70
     71        <p>Trigger a conversation with a link:</p>
     72
     73        <p><pre class="mcfgf_code">&lt;a href="/open-magic-conversation?form_id=1"&gt;Open Conversation&lt;/a&gt;</pre></p>
     74
     75        <p>Trigger a conversation with JavaScript code:</p>
     76
     77        <p><pre class="mcfgf_code">window.mcfgf_open_magic_conversation("/open-magic-conversation?form_id=1");</pre></p>
     78
    2979        <h3>Documentation</h3>
    3080        <ul>
  • magic-conversation-for-gravity-forms/trunk/main.php

    r2259507 r2264875  
    16231623              }
    16241624            }
    1625             if(window.mcfgf_global) {
    1626                 window.mcfgf_global.form_id = '.$form_id.';
    1627             }
    1628             console.log("__mcb_domReady 001");
     1625            if(window.mcfgf_global && window.mcfgf_global.form_id) {
     1626                window.mcfgf_global.form_id = false;
     1627            }
    16291628            __mcb_domReady(function() {
    16301629                console.log("__mcb_domReady 002");
  • magic-conversation-for-gravity-forms/trunk/plugin-index.php

    r2262953 r2264875  
    22/*
    33 * Plugin Name: Magic Conversation For Gravity Forms
    4  * Version: 3.0.68
     4 * Version: 3.0.69
    55 * Description: Turn your Gravity Forms into Conversation Form
    66 * Author: Magic Conversation
     
    1515
    1616if ( ! defined( 'ABSPATH' ) ) exit;
    17 define('MCFGFP_VER', '3.0.68.406');
     17define('MCFGFP_VER', '3.0.69.417');
    1818$mcfgfBaseDir = dirname(__FILE__);
    1919
  • magic-conversation-for-gravity-forms/trunk/readme.txt

    r2262953 r2264875  
    55Requires at least: 3.2
    66Tested up to: 5.2
    7 Stable tag: 3.0.68
     7Stable tag: 3.0.69
    88Stable tag: trunk
    99License: GPLv2 or later
     
    117117
    118118== Changelog ==
     119
     120Version v3.0.69
     121    Added Quick Start guide to Help page.
     122    Added welcome message tooltip background and font color support.
     123    Added support of configure and show merge tags in welcome message.
     124    Added support of configure and show merge tags in conversation header.
     125    Moved welcome message and conversation header content configuration to Forms -> Edit -> Settings -> Conversaton.
     126    Fixed issue on open conversation when user clicks welcome message.
     127    Fixed issue on hide conversation header when user disabled conversation header
     128    Fixed issue on hide welcome message when user disabled welcome message
    119129
    120130Version v3.0.68
  • magic-conversation-for-gravity-forms/trunk/settings.php

    r2261111 r2264875  
    334334                    'name'        => 'h2_conversation_button',
    335335                    'desc'        => __( '', 'mcfgf' ),
    336                     'label'       => __( '<h4>Global Conversation Button</h4>', 'mcfgf' ),
     336                    'label'       => __( '<h4>Floating Conversation Button</h4>', 'mcfgf' ),
    337337                    'type'        => 'html'
    338338                ),
     
    347347                    'label' => __( 'Home Page Only', 'mcfgf' ),
    348348                    'desc'  => __( 'Show the global conversation button on home page only.', 'mcfgf' ),
    349                     'type'  => 'checkbox'
    350                 ),
    351                 array(
    352                     'name'  => 'enable_notification_message',
    353                     'label' => __( 'Notification with welcome message', 'mcfgf' ),
    354                     'desc'  => __( 'Show a notification welcome message on top of global conversation button.', 'mcfgf' ),
    355349                    'type'  => 'checkbox'
    356350                ),
     
    434428                    )
    435429                ),
     430                // Global Conversation Tooltip
     431                array(
     432                    'name'        => 'h2_conversation_notification',
     433                    'desc'        => __( '', 'mcfgf' ),
     434                    'label'       => __( '<h4>Conversation Welcome Message</h4>', 'mcfgf' ),
     435                    'type'        => 'html'
     436                ),
     437                array(
     438                    'name'  => 'enable_notification_message',
     439                    'label' => __( 'Welcome Tooltip Message', 'mcfgf' ),
     440                    'desc'  => __( 'Show a welcome tooltip on top of global conversation button.', 'mcfgf' ),
     441                    'type'  => 'checkbox'
     442                ),
     443                array(
     444                    'name'    => 'conversation_notification_background_color',
     445                    'label'   => __( 'Background Color', 'mcfgf' ),
     446                    'desc'    => __( 'Background color for welcome tooltip message', 'mcfgf' ),
     447                    'type'    => 'color',
     448                    'default' => ''
     449                ),
     450                array(
     451                    'name'    => 'conversation_notification_font_color',
     452                    'label'   => __( 'Text Color', 'mcfgf' ),
     453                    'desc'    => __( 'Text color for welcome tooltip message', 'mcfgf' ),
     454                    'type'    => 'color',
     455                    'default' => ''
     456                ),
     457                // Global Conversation Header
    436458                array(
    437459                    'name'        => 'h2_conversation_header',
     
    446468                    'type'  => 'checkbox'
    447469                ),
    448                 array(
    449                     'name'              => 'conversation_header_title',
    450                     'label'             => __( 'Title for Conversation Header', 'mcfgf' ),
    451                     // 'desc'              => __( 'Default: Type your answer here', 'mcfgf' ),
    452                     'placeholder'       => __( 'Please enter a title', 'mcfgf' ),
    453                     'type'              => 'text',
    454                     'default'           => 'Conversation Title',
    455                     'sanitize_callback' => 'sanitize_text_field'
    456                 ),
    457                 array(
    458                     'name'              => 'conversation_header_sub_title',
    459                     'label'             => __( 'Sub Title for Conversation Header', 'mcfgf' ),
    460                     // 'desc'              => __( 'Default: Type your answer here', 'mcfgf' ),
    461                     'placeholder'       => __( 'Please enter a sub title', 'mcfgf' ),
    462                     'type'              => 'text',
    463                     'default'           => 'Conversation Sub Title',
    464                     'sanitize_callback' => 'sanitize_text_field'
    465                 ),
     470                // array(
     471                //     'name'              => 'conversation_header_title',
     472                //     'label'             => __( 'Title for Conversation Header', 'mcfgf' ),
     473                //     // 'desc'              => __( 'Default: Type your answer here', 'mcfgf' ),
     474                //     'placeholder'       => __( 'Please enter a title', 'mcfgf' ),
     475                //     'type'              => 'text',
     476                //     'default'           => 'Conversation Title',
     477                //     'sanitize_callback' => 'sanitize_text_field'
     478                // ),
     479                // array(
     480                //     'name'              => 'conversation_header_sub_title',
     481                //     'label'             => __( 'Sub Title for Conversation Header', 'mcfgf' ),
     482                //     // 'desc'              => __( 'Default: Type your answer here', 'mcfgf' ),
     483                //     'placeholder'       => __( 'Please enter a sub title', 'mcfgf' ),
     484                //     'type'              => 'text',
     485                //     'default'           => 'Conversation Sub Title',
     486                //     'sanitize_callback' => 'sanitize_text_field'
     487                // ),
    466488                // array(
    467489                //     'name'              => 'conversation_header_username',
  • magic-conversation-for-gravity-forms/trunk/sideform.php

    r2116024 r2264875  
    5454    }
    5555
     56    public function parseMergeTags($form, $text = false) {
     57        if(!empty($text)) {
     58            $text = GFCommon::replace_variables( $text, $form, false, false, false );
     59        }
     60        return $text;
     61    }
     62
    5663    public function showSideFormButtonV3($form_id, $avatar_robot, $showGlobalButton = false) {
    5764        global $mcfgf_settings_basics;
    5865        unset($_POST);
    5966        $form = GFAPI::get_form($form_id);
     67
     68        $welcom_message_title = $this->parseMergeTags($form, isset($form['gf_conversation']['conversation_welcome_message_title']) ? $form['gf_conversation']['conversation_welcome_message_title'] : (isset($mcfgf_settings_basics['conversation_tooltip_title']) ? $mcfgf_settings_basics['conversation_tooltip_title'] : false));
     69       
     70       
     71
     72        $welcom_message_sub_title = $this->parseMergeTags($form, isset($form['gf_conversation']['conversation_welcome_message_sub_title']) ? $form['gf_conversation']['conversation_welcome_message_sub_title'] : (isset($mcfgf_settings_basics['conversation_tooltip_sub_title']) ? $mcfgf_settings_basics['conversation_tooltip_sub_title'] : false));
     73
     74        $header_title = $this->parseMergeTags($form, isset($form['gf_conversation']['conversation_header_title']) ? $form['gf_conversation']['conversation_header_title'] : (isset($form['title']) ? $form['title'] : false));
     75
     76        $header_sub_title = $this->parseMergeTags($form, isset($form['gf_conversation']['conversation_header_sub_title']) ? $form['gf_conversation']['conversation_header_sub_title'] : (isset($form['description']) ? $form['description'] : false));
     77
    6078        $url_base = Settings_MagicConversationForGravityForms::$base_url;
    6179
     
    6381        $mcfgf_is_free = mcfgf_is_free();
    6482        $enable_notification_message = isset($mcfgf_settings_basics['enable_notification_message']) && $mcfgf_settings_basics['enable_notification_message']=='on';
     83
     84        $enable_conversation_header = isset($mcfgf_settings_basics['enable_conversation_header']) && $mcfgf_settings_basics['enable_conversation_header']=='on';
     85
    6586        $ajax_url = admin_url( 'admin-ajax.php' );
    6687        $ver = MCFGFP_VER;
     
    98119                    <div class="mcfgfp-pin-btn-close"><?php echo $ex_button_image_close; ?></div>
    99120                </div>
    100                 <?php if ($enable_notification_message): ?>
     121               
    101122                    <div data-reactroot="" class="mcfgfp-notifications">
     123                        <?php if ($enable_notification_message && ($welcom_message_title || $welcom_message_sub_title)): ?>
    102124                        <button class="mcfgfp-notifications-dismiss-button">Clear<span class="mcfgfp-notifications-dismiss-button-icon"></span></button>
     125                        <?php endif ?>
    103126                        <div class="mcfgfp-notification">
    104127                            <div class="mcfgfp-say-hi">
     128                                <?php if ($enable_notification_message && ($welcom_message_title || $welcom_message_sub_title)): ?>
    105129                                <div class="mcfgfp-say-hi-card">
     130                                    <?php if($welcom_message_title): ?>
    106131                                    <div class="mcfgfp-say-hi-title">
    107132                                        <div class="mcfgfp-say-hi-title-name-from">
    108                                             <span class="mcfgfp-say-hi-title-name"><?php echo $mcfgf_settings_basics['conversation_header_title']; ?></span>
    109                                         </div>
    110                                     </div>
    111                                     <div class="mcfgfp-say-hi-body"><span><?php echo $mcfgf_settings_basics['conversation_header_welcome_message']; ?></span></div>
    112                                 </div>
     133                                            <span class="mcfgfp-say-hi-title-name"><?php echo $welcom_message_title; ?></span>
     134                                        </div>
     135                                    </div>
     136                                    <?php endif; ?>
     137                                    <?php if($welcom_message_sub_title): ?>
     138                                    <div class="mcfgfp-say-hi-body"><span><?php echo $welcom_message_sub_title; ?></span></div>
     139                                    <?php endif; ?>
     140                                </div>
     141                                <?php endif ?>
    113142                                <div data-reactroot="" class="mcfgfp-launcher-badge"><img src="<?php echo $avatar_robot; ?>" /></div>
    114143                            </div>
     
    117146
    118147                    </div>
    119                 <?php endif ?>
     148               
    120149            </div>
    121150            <?php endif; ?>
     
    135164                                </div>
    136165                                <div class="mcfgfp-pin-conversation-body mcfgfp-pin-conversation-body-snapped" style="transform: translateY(0px); bottom: 0px;">
     166                                    <?php if($enable_conversation_header): ?>
    137167                                    <div class="mcfgfp-pin-conversation-body-profile">
    138168                                        <div class="mcfgfp-pin-conversation-profile mcfgfp-pin-conversation-profile-expanded">
     
    142172                                                    </div>
    143173                                                    <div class="mcfgfp-pin-team-profile-full-team-name">
    144                                                         <?php echo $form['title']; ?>
     174                                                        <?php echo $header_title; ?>
    145175                                                        <?php //echo $mcfgf_settings_basics['conversation_header_title']; ?>
    146176                                                    </div>
     177                                                    <?php if($header_sub_title): ?>
    147178                                                    <div class="mcfgfp-pin-team-profile-full-response-delay">
    148                                                         <?php echo $form['description']; ?>
     179                                                        <?php echo $header_sub_title; ?>
    149180                                                        <?php // echo $mcfgf_settings_basics['conversation_header_sub_title']; ?>
    150181                                                    </div>
     182                                                    <?php endif;?>
    151183                                                    <div class="mcfgfp-pin-team-profile-full-avatar-container" style="display: none">
    152184                                                        <div class="mcfgfp-pin-team-profile-full-avatar mcfgfp-pin-index-0">
     
    165197                                        </div>
    166198                                    </div>
     199                                    <?php else: ?>
     200                                        <div class="iconfont icon-close mcfgfp-pin-team-close mcfgfp-pin-team-close-ex">
     201                                                    </div>
     202                                    <?php endif; ?>
    167203                                    <div class="mcfgfp-pin-conversation-body-parts" style="top: 195px; bottom: 0px;">
    168204                                        <div class="mcfgfp-pin-conversation-body-parts-wrapper">
     
    252288                                                    </div>
    253289                                                    <div class="mcfgfp-pin-team-profile-full-team-name">
    254                                                         <?php echo $mcfgf_settings_basics['conversation_header_title']; ?>
     290                                                        <?php echo $mcfgf_settings_basics['conversation_tooltip_title']; ?>
    255291                                                    </div>
    256292                                                    <div class="mcfgfp-pin-team-profile-full-response-delay">
    257                                                         <?php echo $mcfgf_settings_basics['conversation_header_sub_title']; ?>
     293                                                        <?php echo $mcfgf_settings_basics['conversation_tooltip_sub_title']; ?>
    258294                                                    </div>
    259295                                                    <div class="mcfgfp-pin-team-profile-full-avatar-container">
  • magic-conversation-for-gravity-forms/trunk/yakker-gravityforms/class-gfyakkeraddon.php

    r2261111 r2264875  
    331331                    ),
    332332                    array(
     333                        'label'             => esc_html__( 'Welcome Message Title', 'yakkeraddon' ),
     334                        'type'              => 'text',
     335                        'name'              => 'conversation_welcome_message_title',
     336                        'tooltip'           => esc_html__( 'The welcome message tooltip title displayed on top of conversation button.', 'yakkeraddon' ),
     337                        'class'             => 'medium merge-tag-support mt-position-right',
     338                        'default_value' => 'Hello',
     339                        //'feedback_callback' => array( $this, 'is_valid_setting' ),
     340                    ),
     341                    array(
     342                        'label'             => esc_html__( 'Welcome Message Sub-Title', 'yakkeraddon' ),
     343                        'type'              => 'text',
     344                        'name'              => 'conversation_welcome_message_sub_title',
     345                        'tooltip'           => esc_html__( 'The welcome message tooltip sub title displayed on top of conversation button.', 'yakkeraddon' ),
     346                        'class'             => 'medium merge-tag-support mt-position-right',
     347                        'default_value' => 'I\'m Magic Conversation.',
     348                        //'feedback_callback' => array( $this, 'is_valid_setting' ),
     349                    ),
     350                    array(
     351                        'label'             => esc_html__( 'Conversation Header Title', 'yakkeraddon' ),
     352                        'type'              => 'text',
     353                        'name'              => 'conversation_header_title',
     354                        'tooltip'           => esc_html__( 'The title of conversation header displayed on top of conversation opened by click conversation button.', 'yakkeraddon' ),
     355                        'class'             => 'medium merge-tag-support mt-position-right',
     356                        'default_value' => 'Hello',
     357                        //'feedback_callback' => array( $this, 'is_valid_setting' ),
     358                    ),
     359                    array(
     360                        'label'             => esc_html__( 'Conversation Header Sub-Title', 'yakkeraddon' ),
     361                        'type'              => 'text',
     362                        'name'              => 'conversation_header_sub_title',
     363                        'tooltip'           => esc_html__( 'The sub title of conversation header displayed on top of conversation opened by click conversation button.', 'yakkeraddon' ),
     364                        'class'             => 'medium merge-tag-support mt-position-right',
     365                        'default_value' => 'I\'m Magic Conversation.',
     366                        //'feedback_callback' => array( $this, 'is_valid_setting' ),
     367                    ),
     368                    array(
    333369                        'label'             => esc_html__( 'Display Name For Robot', 'yakkeraddon' ),
    334370                        'type'              => 'text',
Note: See TracChangeset for help on using the changeset viewer.