Plugin Directory

Changeset 1449054


Ignore:
Timestamp:
07/05/2016 08:43:12 AM (10 years ago)
Author:
kodeplusdev
Message:

Fix bugs for live chat, video call anonymous

Location:
kandy
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • kandy/tags/2.5.0/admin/CustomizationEditPage.php

    r1401109 r1449054  
    1111        ?>
    1212        <h3>
    13             <?php _e("Kandy User Assignment", "kandy"); ?>
     13            <?php _e("Kandy Edit Customization", "kandy"); ?>
    1414        </h3>
    1515        <?php
  • kandy/tags/2.5.0/admin/HelpPage.php

    r1448341 r1449054  
    8282        <pre style="box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; padding: 16px 16px 0; border-radius: 3px; word-wrap: normal; word-break: normal; background-color: rgb(247, 247, 247);">
    8383        [kandyVideo
    84         title = <span class="pl-s1" style="box-sizing: border-box; color: rgb(223, 80, 0);"><span class="pl-pds" style="box-sizing: border-box;">&quot;</span>Me<span class="pl-pds" style="box-sizing: border-box;">&quot;</span></span>
     84        title = <span class="pl-s1" style="box-sizing: border-box; color: rgb(223, 80, 0);"><span class="pl-pds" style="box-sizing: border-box;">&quot;</span>You<span class="pl-pds" style="box-sizing: border-box;">&quot;</span></span>
    8585        id = <span class="pl-s1" style="box-sizing: border-box; color: rgb(223, 80, 0);"><span class="pl-pds" style="box-sizing: border-box;">&quot;</span>myVideo<span class="pl-pds" style="box-sizing: border-box;">&quot;</span></span>
    8686        style = <span class="pl-s1" style="box-sizing: border-box; color: rgb(223, 80, 0);"><span class="pl-pds" style="box-sizing: border-box;">&quot;</span>width: 300px; height: 225px;background-color: darkslategray;<span class="pl-pds" style="box-sizing: border-box;">&quot;</span></span>]
     
    260260        <pre style="box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; padding: 16px 16px 0; border-radius: 3px; word-wrap: normal; word-break: normal; background-color: rgb(247, 247, 247);">
    261261        [kandyVideoButton class=<span class="pl-s1" style="box-sizing: border-box; color: rgb(223, 80, 0);"><span class="pl-pds" style="box-sizing: border-box;">&quot;</span>myButtonStype<span class="pl-pds" style="box-sizing: border-box;">&quot;</span></span> callto=<span class="pl-s1" style="box-sizing: border-box; color: rgb(223, 80, 0);"><span class="pl-pds" style="box-sizing: border-box;">&quot;</span>kandy_user_name@domain.com<span class="pl-pds" style="box-sizing: border-box;">&quot;</span></span> anonymous=<span class="pl-s1" style="box-sizing: border-box; color: rgb(223, 80, 0);"><span class="pl-pds" style="box-sizing: border-box;">&quot;</span>true<span class="pl-pds" style="box-sizing: border-box;">&quot;</span></span>]
    262         [kandyVideo title=<span class="pl-s1" style="box-sizing: border-box; color: rgb(223, 80, 0);"><span class="pl-pds" style="box-sizing: border-box;">&quot;</span>Me<span class="pl-pds" style="box-sizing: border-box;">&quot;</span></span> id=<span class="pl-s1" style="box-sizing: border-box; color: rgb(223, 80, 0);"><span class="pl-pds" style="box-sizing: border-box;">&quot;</span>myVideo<span class="pl-pds" style="box-sizing: border-box;">&quot;</span></span> style = <span class="pl-s1" style="box-sizing: border-box; color: rgb(223, 80, 0);"><span class="pl-pds" style="box-sizing: border-box;">&quot;</span>width: 300px;height: 225px;<span class="pl-pds" style="box-sizing: border-box;">&quot;</span></span>]
    263         [kandyVideo title=<span class="pl-s1" style="box-sizing: border-box; color: rgb(223, 80, 0);"><span class="pl-pds" style="box-sizing: border-box;">&quot;</span>Their<span class="pl-pds" style="box-sizing: border-box;">&quot;</span></span> id=<span class="pl-s1" style="box-sizing: border-box; color: rgb(223, 80, 0);"><span class="pl-pds" style="box-sizing: border-box;">&quot;</span>theirVideo<span class="pl-pds" style="box-sizing: border-box;">&quot;</span></span> style = <span class="pl-s1" style="box-sizing: border-box; color: rgb(223, 80, 0);"><span class="pl-pds" style="box-sizing: border-box;">&quot;</span>width:300px;height: 225px;<span class="pl-pds" style="box-sizing: border-box;">&quot;</span></span>]
     262        [kandyVideo title=<span class="pl-s1" style="box-sizing: border-box; color: rgb(223, 80, 0);"><span class="pl-pds" style="box-sizing: border-box;">&quot;</span>You<span class="pl-pds" style="box-sizing: border-box;">&quot;</span></span> id=<span class="pl-s1" style="box-sizing: border-box; color: rgb(223, 80, 0);"><span class="pl-pds" style="box-sizing: border-box;">&quot;</span>myVideo<span class="pl-pds" style="box-sizing: border-box;">&quot;</span></span> style = <span class="pl-s1" style="box-sizing: border-box; color: rgb(223, 80, 0);"><span class="pl-pds" style="box-sizing: border-box;">&quot;</span>width: 300px;height: 225px;<span class="pl-pds" style="box-sizing: border-box;">&quot;</span></span>]
     263        [kandyVideo title=<span class="pl-s1" style="box-sizing: border-box; color: rgb(223, 80, 0);"><span class="pl-pds" style="box-sizing: border-box;">&quot;</span>Them<span class="pl-pds" style="box-sizing: border-box;">&quot;</span></span> id=<span class="pl-s1" style="box-sizing: border-box; color: rgb(223, 80, 0);"><span class="pl-pds" style="box-sizing: border-box;">&quot;</span>theirVideo<span class="pl-pds" style="box-sizing: border-box;">&quot;</span></span> style = <span class="pl-s1" style="box-sizing: border-box; color: rgb(223, 80, 0);"><span class="pl-pds" style="box-sizing: border-box;">&quot;</span>width:300px;height: 225px;<span class="pl-pds" style="box-sizing: border-box;">&quot;</span></span>]
    264264        </pre>
    265265        </div>
  • kandy/tags/2.5.0/api/help.php

    r1401109 r1449054  
    7171    &nbsp; &nbsp; + <strong>Kandy Video</strong><br />
    7272    &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#696969;"> [kandyVideo<br />
    73     &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; title = &quot;Me&quot;<br />
     73    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; title = &quot;You&quot;<br />
    7474    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; id = &quot;myVideo&quot;<br />
    7575    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; style = &quot;width: 300px; height: 225px;background-color: darkslategray;&quot;]<br />
     
    130130    <strong>&nbsp; &nbsp; + Kandy Video Call</strong><br />
    131131    &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#696969;">[kandyVideoButton class="myButtonStyle"][/kandyVideoButton]<br />
    132     &nbsp; &nbsp; &nbsp; &nbsp;[kandyVideo title="Me" id="myVideo" style = "width: 300px; height: 225px;background-color: darkslategray;"] [/kandyVideo]<br />
    133     &nbsp; &nbsp; &nbsp; &nbsp;[kandyVideo title="Their" &nbsp;id="theirVideo" style = "width: 300px; height: 225px;background-color: darkslategray;"][/kandyVideo]</span>
     132    &nbsp; &nbsp; &nbsp; &nbsp;[kandyVideo title="You" id="myVideo" style = "width: 300px; height: 225px;background-color: darkslategray;"] [/kandyVideo]<br />
     133    &nbsp; &nbsp; &nbsp; &nbsp;[kandyVideo title="Them" &nbsp;id="theirVideo" style = "width: 300px; height: 225px;background-color: darkslategray;"][/kandyVideo]</span>
    134134</p>
    135135
  • kandy/tags/2.5.0/css/kandyWordpress.css

    r1410200 r1449054  
     1.entry-header .entry-title {
     2    margin-top: -20px;
     3}
    14div.entry-content .livechats a,
    25div.entry-content .contacts a {
     
    191194.kandyChat .kandyMessages {
    192195    width: 100%;
    193     height: 425px;
     196    height: 437px;
    194197    overflow: auto;
    195198}
     
    705708    width: 75px;
    706709    height: 75px;
    707     border-radius: 5px;
    708710    object-fit: cover;
    709711}
  • kandy/tags/2.5.0/css/kandylivechat.css

    r1410247 r1449054  
    139139    width: 75px;
    140140    height: 75px;
    141     border-radius: 5px;
    142141    object-fit: cover;
    143142    display: block;
  • kandy/tags/2.5.0/js/kandyWordpress.js

    r1410020 r1449054  
    10031003              addExampleBox();
    10041004              get_last_seen_interval(contactListForPresence);
     1005              jQuery('.cd-tabs-navigation > li:first-child > a').trigger('click');
    10051006            } else {
    10061007              get_last_seen_interval();
     
    10261027    var message = inputMessage.val();
    10271028    inputMessage.val('');
    1028     kandy.messaging.sendIm(username, message, function () {
    1029             var newMessage = '<div class="my-message">\
     1029    if (message.trim() != '') {
     1030        kandy.messaging.sendIm(username, message, function () {
     1031                var newMessage = '<div class="my-message">\
    10301032                    <b><span class="imUsername">' + displayName + ':</span></b>\
    10311033                    <span class="imMessage">' + message + '</span>\
    10321034                </div>';
    1033             var messageDiv = jQuery('.kandyChat .kandyMessages[data-user="' + dataHolder + '"]');
    1034             messageDiv.append(newMessage);
    1035             messageDiv.scrollTop(messageDiv[0].scrollHeight);
    1036         },
    1037         function () {
    1038             alert("IM send failed");
    1039         }
    1040     );
     1035                var messageDiv = jQuery('.kandyChat .kandyMessages[data-user="' + dataHolder + '"]');
     1036                messageDiv.append(newMessage);
     1037                messageDiv.scrollTop(messageDiv[0].scrollHeight);
     1038            },
     1039            function () {
     1040                alert("IM send failed");
     1041            }
     1042        );
     1043    }
    10411044};
    10421045
     
    10711074
    10721075            if (msg.contentType === 'text' && msg.message.mimeType == 'text/plain') {
    1073                 newMessage += '<span class="imMessage" style="margin-left: 5px">' + message + '</span>';
     1076                newMessage += '<span class="imMessage" style="margin-left: 5px">' + message.replace(/\\'/g, "'").replace(/\\"/g, '"') + '</span>';
    10741077            } else {
    10751078                var fileUrl = kandy.messaging.buildFileUrl(msg.message.content_uuid);
     
    13341337        if(msgType == 'groupChat'){
    13351338            if(msg.contentType == 'text'){
    1336                 var newMessage = '<div class="their-message">\
     1339                if (msg.message.text.trim() != '') {
     1340                    var newMessage = '<div class="their-message">\
    13371341                            <b><span class="imUsername">' + sender + ':</span></b>\
    13381342                            <span class="imMessage">' + msg.message.text + '</span>\
    13391343                        </div>';
    13401344
    1341                 var messageDiv = jQuery('.kandyChat .kandyMessages[data-group="'+msg.group_id+'"]');
    1342                 messageDiv.append(newMessage);
    1343                 messageDiv.scrollTop(messageDiv[0].scrollHeight);
     1345                    var messageDiv = jQuery('.kandyChat .kandyMessages[data-group="'+msg.group_id+'"]');
     1346                    messageDiv.append(newMessage);
     1347                    messageDiv.scrollTop(messageDiv[0].scrollHeight);
     1348                }
    13441349            }
    13451350
     
    14371442 */
    14381443var kandy_sendGroupIm = function(groupId,msg){
    1439     var username = jQuery("input.kandy_current_username").val();
    1440     kandy.messaging.sendGroupIm(groupId, msg,
    1441         function() {
    1442             var newMessage = '<div class="my-message">\
     1444    if (typeof msg != 'undefined' && msg.trim() != '') {
     1445        var username = jQuery("input.kandy_current_username").val();
     1446        kandy.messaging.sendGroupIm(groupId, msg,
     1447            function() {
     1448                var newMessage = '<div class="my-message">\
    14431449                    <b><span class="imUsername">' + username + ':</span></b>\
    14441450                    <span class="imMessage">' + msg + '</span>\
    14451451                </div>';
    1446             var messageDiv = jQuery('.kandyChat .kandyMessages[data-group="' + groupId + '"]');
    1447             messageDiv.append(newMessage);
    1448             messageDiv.scrollTop(messageDiv[0].scrollHeight);
    1449         },
    1450         function(msg, code) {
    1451             console.log('Error sending Data (' + code + '): ' + msg);
    1452         }
    1453     );
     1452                var messageDiv = jQuery('.kandyChat .kandyMessages[data-group="' + groupId + '"]');
     1453                messageDiv.append(newMessage);
     1454                messageDiv.scrollTop(messageDiv[0].scrollHeight);
     1455            },
     1456            function(msg, code) {
     1457                console.log('Error sending Data (' + code + '): ' + msg);
     1458            }
     1459        );
     1460    }
    14541461};
    14551462/**
  • kandy/tags/2.5.0/js/kandylivechat.js

    r1410020 r1449054  
    6262
    6363var loginSSO = function(userAccessToken, success_callback, failure, password) {
     64    console.log('login SSO ...');
    6465    kandy.loginSSO(userAccessToken, success_callback, failure, password);
    6566};
     
    6970};
    7071var login_success_callback = function (){
    71     console.log('login successful')
     72    console.log('login successful');
    7273    LiveChatUI.changeState("READY");
    7374};
    7475var login_fail_callback = function (){
    75     console.log('login failed')
     76    console.log('login failed');
    7677    LiveChatUI.changeState("UNAVAILABLE");
    7778};
     
    9697        type: 'GET',
    9798        dataType: 'json',
    98         async: false,
    9999        success: function(res){
    100             if(checkAvailable){
     100            if(!checkAvailable){
     101                LiveChatUI.changeState('WAITING');
     102            } else {
    101103                LiveChatUI.changeState('RECONNECTING');
    102104            }
     
    127129                if(!checkAvailable){
    128130                    checkAvailable = setInterval(getKandyUsers, 5000);
     131                } else {
     132                    LiveChatUI.changeState('RECONNECTING');
    129133                }
    130134            }
     
    149153
    150154var sendIM = function(username, message){
    151     kandy.messaging.sendIm(username, message, function () {
    152             var messageBox = jQuery("#messageBox");
    153             messageBox.find("ul").append("<li class='my-message'><span class='username'>Me:</span><span class='imMessage'>"+jQuery("#messageToSend").val()+"</span></li>");
    154             jQuery("#formChat")[0].reset();
    155             messageBox.scrollTop(messageBox[0].scrollHeight);
    156         },
    157         function () {
    158             alert("IM send failed");
    159         }
    160     );
     155    if (message != '') {
     156        kandy.messaging.sendIm(username, message, function () {
     157                var messageBox = jQuery("#messageBox");
     158                messageBox.find("ul").append("<li class='my-message'><span class='username'>You:</span><span class='imMessage'>"+jQuery("#messageToSend").val()+"</span></li>");
     159                jQuery("#formChat")[0].reset();
     160                messageBox.scrollTop(messageBox[0].scrollHeight);
     161            },
     162            function () {
     163                alert("IM send failed");
     164            }
     165        );
     166    }
    161167};
    162168
     
    213219    console.log(message.message.content_name + " sent successfully.");
    214220    var messageBox = jQuery("#messageBox");
    215     var newMessage = "<li class='my-message'><span class='username'>Me: </span>";
     221    var newMessage = "<li class='my-message'><span class='username'>You: </span>";
    216222    var fileUrl = kandy.messaging.buildFileUrl(message.message.content_uuid);
    217223    var html = '';
     
    245251    jQuery(".handle.minimize, #restoreBtn").click(function(){
    246252        jQuery(".liveChat").toggleClass('kandy_hidden');
     253        if (!jQuery(".liveChat").hasClass('kandy_hidden')) {
     254            jQuery("#customerName").focus();
     255        }
    247256    });
    248257
     
    258267            data: form.serialize(),
    259268            type: 'POST',
     269            beforeSend: function (xhr) {
     270                LiveChatUI.changeState('WAITING');
     271            },
    260272            success: function(res){
    261273                res = jQuery.parseJSON(res);
     
    266278                    }
    267279                }else{
    268                     LiveChatUI.changeState('WAITING');
    269280                    getKandyUsers();
    270281                }
     
    276287    jQuery("#formChat").on('submit', function(e){
    277288        e.preventDefault();
    278         sendIM(agent.full_user_id, jQuery("#messageToSend").val());
     289        var message = jQuery("#messageToSend").val().trim();
     290        if (message != '') {
     291            sendIM(agent.full_user_id, message);
     292        }
    279293    });
    280294    //end chat session if user close browser or tab
  • kandy/tags/2.5.0/js/tinymce/KandyVideo.js

    r1401109 r1449054  
    88                    //var posts = prompt("Number of posts", "1");
    99                    //var text = prompt("List Heading", "This is the heading text");
    10                     ed.execCommand('mceInsertContent', false, '[kandyVideoButton class="myButtonStyle"]\n[kandyVideo title="Me" id="myVideo" style = "width: 300px;height: 225px;"][kandyVideo title="Their" id="theirVideo" style = "width:300px;height: 225px;"]');
     10                    ed.execCommand('mceInsertContent', false, '[kandyVideoButton class="myButtonStyle"]\n[kandyVideo title="You" id="myVideo" style = "width: 300px;height: 225px;"][kandyVideo title="Them" id="theirVideo" style = "width:300px;height: 225px;"]');
    1111                }
    1212            });
  • kandy/tags/2.5.0/js/tinymce/KandyVideoAnonymous.js

    r1410020 r1449054  
    88                    //var posts = prompt("Number of posts", "1");
    99                    //var text = prompt("List Heading", "This is the heading text");
    10                     ed.execCommand('mceInsertContent', false, '[kandyVideoButton class="myButtonStyle" callOutButtonText="Call Us" callto="kandy_username@domain.com" anonymous="true"]\n[kandyVideo title="Me" id="myVideo" style = "width: 300px;height: 225px;"][kandyVideo title="Their" id="theirVideo" style = "width:300px;height: 225px;"]');
     10                    ed.execCommand('mceInsertContent', false, '[kandyVideoButton class="myButtonStyle" callOutButtonText="Call Us" callto="kandy_username@domain.com" anonymous="true"]\n[kandyVideo title="You" id="myVideo" style = "width: 300px;height: 225px;"][kandyVideo title="Them" id="theirVideo" style = "width:300px;height: 225px;"]');
    1111                }
    1212            });
  • kandy/tags/2.5.0/kandy-shortcode.php

    r1448341 r1449054  
    12991299                            <div id="messageBox" class="" style="">
    13001300                                <ul>
    1301                                     <li class="their-message"><span class="username">' . $userInfo['agent'] . '</span>: Hi ' . $userInfo['username'] . ', what brings you here?</li>
     1301                                    <li class="their-message"><span class="username">' . $userInfo['agent'] . '</span>: Hello' . (!empty($userInfo['username']) ? (' ' . $userInfo['username']) : '') . ', how may I help you?</li>
    13021302                                </ul>
    13031303                            </div>
  • kandy/tags/2.5.0/readme.md

    r1406157 r1449054  
    3636```sh
    3737[kandyVideo
    38     title = "Me"
     38    title = "You"
    3939    id = "myVideo"
    4040    style = "width: 300px; height: 225px;background-color: darkslategray;"]
     
    127127   ```sh
    128128[kandyVideoButton class="myButtonStyle" callto="user_kandy@domain.com" anonymous="true"]
    129 [kandyVideo title="Me" id="myVideo" style = "width: 300px;height: 225px;"]
    130 [kandyVideo title="Their" id="theirVideo" style = "width:300px;height: 225px;"]
     129[kandyVideo title="You" id="myVideo" style = "width: 300px;height: 225px;"]
     130[kandyVideo title="Them" id="theirVideo" style = "width:300px;height: 225px;"]
    131131```
    132132
  • kandy/trunk/admin/CustomizationEditPage.php

    r1265746 r1449054  
    1111        ?>
    1212        <h3>
    13             <?php _e("Kandy User Assignment", "kandy"); ?>
     13            <?php _e("Kandy Edit Customization", "kandy"); ?>
    1414        </h3>
    1515        <?php
  • kandy/trunk/admin/HelpPage.php

    r1448341 r1449054  
    8282        <pre style="box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; padding: 16px 16px 0; border-radius: 3px; word-wrap: normal; word-break: normal; background-color: rgb(247, 247, 247);">
    8383        [kandyVideo
    84         title = <span class="pl-s1" style="box-sizing: border-box; color: rgb(223, 80, 0);"><span class="pl-pds" style="box-sizing: border-box;">&quot;</span>Me<span class="pl-pds" style="box-sizing: border-box;">&quot;</span></span>
     84        title = <span class="pl-s1" style="box-sizing: border-box; color: rgb(223, 80, 0);"><span class="pl-pds" style="box-sizing: border-box;">&quot;</span>You<span class="pl-pds" style="box-sizing: border-box;">&quot;</span></span>
    8585        id = <span class="pl-s1" style="box-sizing: border-box; color: rgb(223, 80, 0);"><span class="pl-pds" style="box-sizing: border-box;">&quot;</span>myVideo<span class="pl-pds" style="box-sizing: border-box;">&quot;</span></span>
    8686        style = <span class="pl-s1" style="box-sizing: border-box; color: rgb(223, 80, 0);"><span class="pl-pds" style="box-sizing: border-box;">&quot;</span>width: 300px; height: 225px;background-color: darkslategray;<span class="pl-pds" style="box-sizing: border-box;">&quot;</span></span>]
     
    260260        <pre style="box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; padding: 16px 16px 0; border-radius: 3px; word-wrap: normal; word-break: normal; background-color: rgb(247, 247, 247);">
    261261        [kandyVideoButton class=<span class="pl-s1" style="box-sizing: border-box; color: rgb(223, 80, 0);"><span class="pl-pds" style="box-sizing: border-box;">&quot;</span>myButtonStype<span class="pl-pds" style="box-sizing: border-box;">&quot;</span></span> callto=<span class="pl-s1" style="box-sizing: border-box; color: rgb(223, 80, 0);"><span class="pl-pds" style="box-sizing: border-box;">&quot;</span>kandy_user_name@domain.com<span class="pl-pds" style="box-sizing: border-box;">&quot;</span></span> anonymous=<span class="pl-s1" style="box-sizing: border-box; color: rgb(223, 80, 0);"><span class="pl-pds" style="box-sizing: border-box;">&quot;</span>true<span class="pl-pds" style="box-sizing: border-box;">&quot;</span></span>]
    262         [kandyVideo title=<span class="pl-s1" style="box-sizing: border-box; color: rgb(223, 80, 0);"><span class="pl-pds" style="box-sizing: border-box;">&quot;</span>Me<span class="pl-pds" style="box-sizing: border-box;">&quot;</span></span> id=<span class="pl-s1" style="box-sizing: border-box; color: rgb(223, 80, 0);"><span class="pl-pds" style="box-sizing: border-box;">&quot;</span>myVideo<span class="pl-pds" style="box-sizing: border-box;">&quot;</span></span> style = <span class="pl-s1" style="box-sizing: border-box; color: rgb(223, 80, 0);"><span class="pl-pds" style="box-sizing: border-box;">&quot;</span>width: 300px;height: 225px;<span class="pl-pds" style="box-sizing: border-box;">&quot;</span></span>]
    263         [kandyVideo title=<span class="pl-s1" style="box-sizing: border-box; color: rgb(223, 80, 0);"><span class="pl-pds" style="box-sizing: border-box;">&quot;</span>Their<span class="pl-pds" style="box-sizing: border-box;">&quot;</span></span> id=<span class="pl-s1" style="box-sizing: border-box; color: rgb(223, 80, 0);"><span class="pl-pds" style="box-sizing: border-box;">&quot;</span>theirVideo<span class="pl-pds" style="box-sizing: border-box;">&quot;</span></span> style = <span class="pl-s1" style="box-sizing: border-box; color: rgb(223, 80, 0);"><span class="pl-pds" style="box-sizing: border-box;">&quot;</span>width:300px;height: 225px;<span class="pl-pds" style="box-sizing: border-box;">&quot;</span></span>]
     262        [kandyVideo title=<span class="pl-s1" style="box-sizing: border-box; color: rgb(223, 80, 0);"><span class="pl-pds" style="box-sizing: border-box;">&quot;</span>You<span class="pl-pds" style="box-sizing: border-box;">&quot;</span></span> id=<span class="pl-s1" style="box-sizing: border-box; color: rgb(223, 80, 0);"><span class="pl-pds" style="box-sizing: border-box;">&quot;</span>myVideo<span class="pl-pds" style="box-sizing: border-box;">&quot;</span></span> style = <span class="pl-s1" style="box-sizing: border-box; color: rgb(223, 80, 0);"><span class="pl-pds" style="box-sizing: border-box;">&quot;</span>width: 300px;height: 225px;<span class="pl-pds" style="box-sizing: border-box;">&quot;</span></span>]
     263        [kandyVideo title=<span class="pl-s1" style="box-sizing: border-box; color: rgb(223, 80, 0);"><span class="pl-pds" style="box-sizing: border-box;">&quot;</span>Them<span class="pl-pds" style="box-sizing: border-box;">&quot;</span></span> id=<span class="pl-s1" style="box-sizing: border-box; color: rgb(223, 80, 0);"><span class="pl-pds" style="box-sizing: border-box;">&quot;</span>theirVideo<span class="pl-pds" style="box-sizing: border-box;">&quot;</span></span> style = <span class="pl-s1" style="box-sizing: border-box; color: rgb(223, 80, 0);"><span class="pl-pds" style="box-sizing: border-box;">&quot;</span>width:300px;height: 225px;<span class="pl-pds" style="box-sizing: border-box;">&quot;</span></span>]
    264264        </pre>
    265265        </div>
  • kandy/trunk/api/help.php

    r1401109 r1449054  
    7171    &nbsp; &nbsp; + <strong>Kandy Video</strong><br />
    7272    &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#696969;"> [kandyVideo<br />
    73     &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; title = &quot;Me&quot;<br />
     73    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; title = &quot;You&quot;<br />
    7474    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; id = &quot;myVideo&quot;<br />
    7575    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; style = &quot;width: 300px; height: 225px;background-color: darkslategray;&quot;]<br />
     
    130130    <strong>&nbsp; &nbsp; + Kandy Video Call</strong><br />
    131131    &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#696969;">[kandyVideoButton class="myButtonStyle"][/kandyVideoButton]<br />
    132     &nbsp; &nbsp; &nbsp; &nbsp;[kandyVideo title="Me" id="myVideo" style = "width: 300px; height: 225px;background-color: darkslategray;"] [/kandyVideo]<br />
    133     &nbsp; &nbsp; &nbsp; &nbsp;[kandyVideo title="Their" &nbsp;id="theirVideo" style = "width: 300px; height: 225px;background-color: darkslategray;"][/kandyVideo]</span>
     132    &nbsp; &nbsp; &nbsp; &nbsp;[kandyVideo title="You" id="myVideo" style = "width: 300px; height: 225px;background-color: darkslategray;"] [/kandyVideo]<br />
     133    &nbsp; &nbsp; &nbsp; &nbsp;[kandyVideo title="Them" &nbsp;id="theirVideo" style = "width: 300px; height: 225px;background-color: darkslategray;"][/kandyVideo]</span>
    134134</p>
    135135
  • kandy/trunk/css/kandyWordpress.css

    r1410200 r1449054  
     1.entry-header .entry-title {
     2    margin-top: -20px;
     3}
    14div.entry-content .livechats a,
    25div.entry-content .contacts a {
     
    191194.kandyChat .kandyMessages {
    192195    width: 100%;
    193     height: 425px;
     196    height: 437px;
    194197    overflow: auto;
    195198}
     
    705708    width: 75px;
    706709    height: 75px;
    707     border-radius: 5px;
    708710    object-fit: cover;
    709711}
  • kandy/trunk/css/kandylivechat.css

    r1410247 r1449054  
    139139    width: 75px;
    140140    height: 75px;
    141     border-radius: 5px;
    142141    object-fit: cover;
    143142    display: block;
  • kandy/trunk/js/kandyWordpress.js

    r1410020 r1449054  
    10031003              addExampleBox();
    10041004              get_last_seen_interval(contactListForPresence);
     1005              jQuery('.cd-tabs-navigation > li:first-child > a').trigger('click');
    10051006            } else {
    10061007              get_last_seen_interval();
     
    10261027    var message = inputMessage.val();
    10271028    inputMessage.val('');
    1028     kandy.messaging.sendIm(username, message, function () {
    1029             var newMessage = '<div class="my-message">\
     1029    if (message.trim() != '') {
     1030        kandy.messaging.sendIm(username, message, function () {
     1031                var newMessage = '<div class="my-message">\
    10301032                    <b><span class="imUsername">' + displayName + ':</span></b>\
    10311033                    <span class="imMessage">' + message + '</span>\
    10321034                </div>';
    1033             var messageDiv = jQuery('.kandyChat .kandyMessages[data-user="' + dataHolder + '"]');
    1034             messageDiv.append(newMessage);
    1035             messageDiv.scrollTop(messageDiv[0].scrollHeight);
    1036         },
    1037         function () {
    1038             alert("IM send failed");
    1039         }
    1040     );
     1035                var messageDiv = jQuery('.kandyChat .kandyMessages[data-user="' + dataHolder + '"]');
     1036                messageDiv.append(newMessage);
     1037                messageDiv.scrollTop(messageDiv[0].scrollHeight);
     1038            },
     1039            function () {
     1040                alert("IM send failed");
     1041            }
     1042        );
     1043    }
    10411044};
    10421045
     
    10711074
    10721075            if (msg.contentType === 'text' && msg.message.mimeType == 'text/plain') {
    1073                 newMessage += '<span class="imMessage" style="margin-left: 5px">' + message + '</span>';
     1076                newMessage += '<span class="imMessage" style="margin-left: 5px">' + message.replace(/\\'/g, "'").replace(/\\"/g, '"') + '</span>';
    10741077            } else {
    10751078                var fileUrl = kandy.messaging.buildFileUrl(msg.message.content_uuid);
     
    13341337        if(msgType == 'groupChat'){
    13351338            if(msg.contentType == 'text'){
    1336                 var newMessage = '<div class="their-message">\
     1339                if (msg.message.text.trim() != '') {
     1340                    var newMessage = '<div class="their-message">\
    13371341                            <b><span class="imUsername">' + sender + ':</span></b>\
    13381342                            <span class="imMessage">' + msg.message.text + '</span>\
    13391343                        </div>';
    13401344
    1341                 var messageDiv = jQuery('.kandyChat .kandyMessages[data-group="'+msg.group_id+'"]');
    1342                 messageDiv.append(newMessage);
    1343                 messageDiv.scrollTop(messageDiv[0].scrollHeight);
     1345                    var messageDiv = jQuery('.kandyChat .kandyMessages[data-group="'+msg.group_id+'"]');
     1346                    messageDiv.append(newMessage);
     1347                    messageDiv.scrollTop(messageDiv[0].scrollHeight);
     1348                }
    13441349            }
    13451350
     
    14371442 */
    14381443var kandy_sendGroupIm = function(groupId,msg){
    1439     var username = jQuery("input.kandy_current_username").val();
    1440     kandy.messaging.sendGroupIm(groupId, msg,
    1441         function() {
    1442             var newMessage = '<div class="my-message">\
     1444    if (typeof msg != 'undefined' && msg.trim() != '') {
     1445        var username = jQuery("input.kandy_current_username").val();
     1446        kandy.messaging.sendGroupIm(groupId, msg,
     1447            function() {
     1448                var newMessage = '<div class="my-message">\
    14431449                    <b><span class="imUsername">' + username + ':</span></b>\
    14441450                    <span class="imMessage">' + msg + '</span>\
    14451451                </div>';
    1446             var messageDiv = jQuery('.kandyChat .kandyMessages[data-group="' + groupId + '"]');
    1447             messageDiv.append(newMessage);
    1448             messageDiv.scrollTop(messageDiv[0].scrollHeight);
    1449         },
    1450         function(msg, code) {
    1451             console.log('Error sending Data (' + code + '): ' + msg);
    1452         }
    1453     );
     1452                var messageDiv = jQuery('.kandyChat .kandyMessages[data-group="' + groupId + '"]');
     1453                messageDiv.append(newMessage);
     1454                messageDiv.scrollTop(messageDiv[0].scrollHeight);
     1455            },
     1456            function(msg, code) {
     1457                console.log('Error sending Data (' + code + '): ' + msg);
     1458            }
     1459        );
     1460    }
    14541461};
    14551462/**
  • kandy/trunk/js/kandylivechat.js

    r1410020 r1449054  
    6262
    6363var loginSSO = function(userAccessToken, success_callback, failure, password) {
     64    console.log('login SSO ...');
    6465    kandy.loginSSO(userAccessToken, success_callback, failure, password);
    6566};
     
    6970};
    7071var login_success_callback = function (){
    71     console.log('login successful')
     72    console.log('login successful');
    7273    LiveChatUI.changeState("READY");
    7374};
    7475var login_fail_callback = function (){
    75     console.log('login failed')
     76    console.log('login failed');
    7677    LiveChatUI.changeState("UNAVAILABLE");
    7778};
     
    9697        type: 'GET',
    9798        dataType: 'json',
    98         async: false,
    9999        success: function(res){
    100             if(checkAvailable){
     100            if(!checkAvailable){
     101                LiveChatUI.changeState('WAITING');
     102            } else {
    101103                LiveChatUI.changeState('RECONNECTING');
    102104            }
     
    127129                if(!checkAvailable){
    128130                    checkAvailable = setInterval(getKandyUsers, 5000);
     131                } else {
     132                    LiveChatUI.changeState('RECONNECTING');
    129133                }
    130134            }
     
    149153
    150154var sendIM = function(username, message){
    151     kandy.messaging.sendIm(username, message, function () {
    152             var messageBox = jQuery("#messageBox");
    153             messageBox.find("ul").append("<li class='my-message'><span class='username'>Me:</span><span class='imMessage'>"+jQuery("#messageToSend").val()+"</span></li>");
    154             jQuery("#formChat")[0].reset();
    155             messageBox.scrollTop(messageBox[0].scrollHeight);
    156         },
    157         function () {
    158             alert("IM send failed");
    159         }
    160     );
     155    if (message != '') {
     156        kandy.messaging.sendIm(username, message, function () {
     157                var messageBox = jQuery("#messageBox");
     158                messageBox.find("ul").append("<li class='my-message'><span class='username'>You:</span><span class='imMessage'>"+jQuery("#messageToSend").val()+"</span></li>");
     159                jQuery("#formChat")[0].reset();
     160                messageBox.scrollTop(messageBox[0].scrollHeight);
     161            },
     162            function () {
     163                alert("IM send failed");
     164            }
     165        );
     166    }
    161167};
    162168
     
    213219    console.log(message.message.content_name + " sent successfully.");
    214220    var messageBox = jQuery("#messageBox");
    215     var newMessage = "<li class='my-message'><span class='username'>Me: </span>";
     221    var newMessage = "<li class='my-message'><span class='username'>You: </span>";
    216222    var fileUrl = kandy.messaging.buildFileUrl(message.message.content_uuid);
    217223    var html = '';
     
    245251    jQuery(".handle.minimize, #restoreBtn").click(function(){
    246252        jQuery(".liveChat").toggleClass('kandy_hidden');
     253        if (!jQuery(".liveChat").hasClass('kandy_hidden')) {
     254            jQuery("#customerName").focus();
     255        }
    247256    });
    248257
     
    258267            data: form.serialize(),
    259268            type: 'POST',
     269            beforeSend: function (xhr) {
     270                LiveChatUI.changeState('WAITING');
     271            },
    260272            success: function(res){
    261273                res = jQuery.parseJSON(res);
     
    266278                    }
    267279                }else{
    268                     LiveChatUI.changeState('WAITING');
    269280                    getKandyUsers();
    270281                }
     
    276287    jQuery("#formChat").on('submit', function(e){
    277288        e.preventDefault();
    278         sendIM(agent.full_user_id, jQuery("#messageToSend").val());
     289        var message = jQuery("#messageToSend").val().trim();
     290        if (message != '') {
     291            sendIM(agent.full_user_id, message);
     292        }
    279293    });
    280294    //end chat session if user close browser or tab
  • kandy/trunk/js/tinymce/KandyVideo.js

    r1265746 r1449054  
    88                    //var posts = prompt("Number of posts", "1");
    99                    //var text = prompt("List Heading", "This is the heading text");
    10                     ed.execCommand('mceInsertContent', false, '[kandyVideoButton class="myButtonStyle"]\n[kandyVideo title="Me" id="myVideo" style = "width: 300px;height: 225px;"][kandyVideo title="Their" id="theirVideo" style = "width:300px;height: 225px;"]');
     10                    ed.execCommand('mceInsertContent', false, '[kandyVideoButton class="myButtonStyle"]\n[kandyVideo title="You" id="myVideo" style = "width: 300px;height: 225px;"][kandyVideo title="Them" id="theirVideo" style = "width:300px;height: 225px;"]');
    1111                }
    1212            });
  • kandy/trunk/js/tinymce/KandyVideoAnonymous.js

    r1410020 r1449054  
    88                    //var posts = prompt("Number of posts", "1");
    99                    //var text = prompt("List Heading", "This is the heading text");
    10                     ed.execCommand('mceInsertContent', false, '[kandyVideoButton class="myButtonStyle" callOutButtonText="Call Us" callto="kandy_username@domain.com" anonymous="true"]\n[kandyVideo title="Me" id="myVideo" style = "width: 300px;height: 225px;"][kandyVideo title="Their" id="theirVideo" style = "width:300px;height: 225px;"]');
     10                    ed.execCommand('mceInsertContent', false, '[kandyVideoButton class="myButtonStyle" callOutButtonText="Call Us" callto="kandy_username@domain.com" anonymous="true"]\n[kandyVideo title="You" id="myVideo" style = "width: 300px;height: 225px;"][kandyVideo title="Them" id="theirVideo" style = "width:300px;height: 225px;"]');
    1111                }
    1212            });
  • kandy/trunk/kandy-shortcode.php

    r1448341 r1449054  
    12991299                            <div id="messageBox" class="" style="">
    13001300                                <ul>
    1301                                     <li class="their-message"><span class="username">' . $userInfo['agent'] . '</span>: Hi ' . $userInfo['username'] . ', what brings you here?</li>
     1301                                    <li class="their-message"><span class="username">' . $userInfo['agent'] . '</span>: Hello' . (!empty($userInfo['username']) ? (' ' . $userInfo['username']) : '') . ', how may I help you?</li>
    13021302                                </ul>
    13031303                            </div>
  • kandy/trunk/readme.md

    r1406157 r1449054  
    3636```sh
    3737[kandyVideo
    38     title = "Me"
     38    title = "You"
    3939    id = "myVideo"
    4040    style = "width: 300px; height: 225px;background-color: darkslategray;"]
     
    127127   ```sh
    128128[kandyVideoButton class="myButtonStyle" callto="user_kandy@domain.com" anonymous="true"]
    129 [kandyVideo title="Me" id="myVideo" style = "width: 300px;height: 225px;"]
    130 [kandyVideo title="Their" id="theirVideo" style = "width:300px;height: 225px;"]
     129[kandyVideo title="You" id="myVideo" style = "width: 300px;height: 225px;"]
     130[kandyVideo title="Them" id="theirVideo" style = "width:300px;height: 225px;"]
    131131```
    132132
Note: See TracChangeset for help on using the changeset viewer.