arjunmat / slack-chat

A support chat feature for your website that integrates with #Slack
GNU General Public License v3.0
137 stars 37 forks source link

Not displaying messages on WebPage #15

Closed surrounded closed 8 years ago

surrounded commented 8 years ago

When a message is submitted from the webpage the message shows up on my slack account, but doesn't display in the message area on the web page.

Isn't working in the demo or in slack-chat integrated into my site.

screen-shot-2016-06-27-at-1 10 03-pm

Here is the code from my site. Demo code is untouched from zip download.

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet" />
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<link href="css/slack-chat.css" rel="stylesheet" />

<div class="message-box" data-uk-tooltip="{animation:true,pos:'top-left'}" title="Need help?">
<a href="javascript:void(0);" class="message-box-icon">
<i class="uk-icon-comment uk-icon-large"></i>
<div class="uk-badge uk-badge-danger uk-slack-message-count"></div>
</a>
</div>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script type="text/javascript" src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js</script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment.min.js"></script>
<script type="text/javascript" src="js/slack-chat.min.js"></script>

<script>
var slackChatOptions = {
apiToken: 'xoxb-54251576438-97qNaEaNVWr8p7FGgJTDdTjM',       //#Slack Auth token. Required. 
channelId: '#helpdesk',      //#Slack channel ID. Required.
user: '<?php echo $loggedInUser->displayname." ".$loggedInUser->lastname; ?>',           //name of the user. Required.
userLink: 'http://localhost:8800/admin_user.php?id=<?php echo $loggedInUser->user_id; ?>',       //link to the user in the application - shown in #Slack
userImg: '',        //image of the user
userId: '<?php echo $loggedInUser->username; ?>',         //id of the user in the application
defaultSysImg: '',         //image to show when the support team replies
defaultSysUser: '',                //Required.   
queryInterval: 3000,
chatBoxHeader: "Need help? Talk to our support team right here",
slackColor: "#36a64f",
messageFetchCount: 100,
botUser: '@support',        //username to post to #Slack. Required.
sendOnEnter: true,
disableIfAway: false,
elementToDisable: null,
heightOffset: 75,
debug: false,
webCache: true,
privateChannel: false,
serverApiGateway: '/server/php/server.php',
useUserDetails: true
}

$('.message-box').slackChat(slackChatOptions);
</script>
arjunmat commented 8 years ago

Are there any errors on the developer console?