Advertisement
Guest User

pasted

a guest
Dec 6th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.35 KB | None | 0 0
  1. <link type="text/css" rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600|Lato:400,700">
  2. <style type="text/css">
  3. .chat-widget {
  4. border: 1px solid #bfb0a7;
  5. bottom: 0;
  6. box-shadow: 0 0 3px 1px rgba(0, 0, 0, 0.2);
  7. height: 0;
  8. max-height: 400px;
  9. max-width: 97.5%;
  10. position: fixed;
  11. right: 1.5%;
  12. transition: all 0.5s ease 0s;
  13. width: 100%;
  14. z-index: 10;
  15. }
  16. @media print {
  17. .chat-widget {
  18. display: none;
  19. }
  20. }
  21. @media (min-width: 31.25em) {
  22. .chat-widget {
  23. max-width: 500px;
  24. }
  25. }
  26. .chat-widget-closed {
  27. height: 36px;
  28. }
  29. .chat-widget-opened {
  30. height: 100%;
  31. max-height: 400px;
  32. }
  33. .chat-widget-button {
  34. background: #fff none repeat scroll 0 0;
  35. border: 0 none;
  36. font-size: 100%;
  37. height: 36px;
  38. outline: 0 none;
  39. padding: 0 1em;
  40. text-align: left;
  41. width: 100%;
  42. }
  43. .chat-widget-button:active, .chat-widget-button:hover {
  44. background-color: #e6e0dc;
  45. cursor: pointer;
  46. }
  47. .chat-button-label {
  48. display: inline-block;
  49. padding-top: 2px;
  50. }
  51. .chat-button-label::before {
  52. background-color: #00a66e;
  53. border-radius: 50%;
  54. color: #594a41;
  55. content: " ";
  56. display: inline-block;
  57. height: 1em;
  58. margin-right: 0.5em;
  59. position: relative;
  60. top: 2px;
  61. width: 1em;
  62. }
  63. .chat-widget-button button, button.chat-widget-button {
  64. background: #8ee5ee none repeat scroll 0 0;
  65. color: #594a41;
  66. margin: 0;
  67. }
  68. .chat-widget iframe {
  69. border: medium none;
  70. height: 100%;
  71. max-height: 362px;
  72. width: 100%;
  73. }
  74. .chat-button-control {
  75. color: #888;
  76. float: right;
  77. font-size: 140%;
  78. font-style: normal;
  79. font-weight: 400;
  80. }
  81. </style>
  82.  
  83. <div id="chat-widget" class="chat-widget chat-widget-closed">
  84. <button id="chat-button" data-ga-label="Chat widget" data-ga-action="Click" data-ga-category="Interface" class="chat-widget-button track tracking">
  85. <span class="chat-button-label">Have a Question?</span><span class="chat-button-control">+</span>
  86. </button>
  87.  
  88. <iframe id="library-chat-widget" src="https://us.refchatter.net/chat/umtest@chat.refchatter.net?skin=1439"></iframe>
  89. </div>
  90.  
  91. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  92.  
  93. <script type="text/javascript">
  94. $( document ).ready(function() {
  95. var presence_url = 'https://us.refchatter.net/presence/jid/umtest/chat.refchatter.net/js';
  96.  
  97. var chat_status = function(){
  98. $.getScript(presence_url, function(){
  99. if (jabber_resources[0].show === 'available' || jabber_resources[0].show === 'chat') {
  100. $('#chat-widget').addClass('chat-widget-closed');
  101. }
  102. else {
  103. $('#chat-widget').removeClass('chat-widget-closed');
  104. }
  105. });
  106. };
  107.  
  108. chat_status();
  109. });
  110.  
  111. $('#chat-button').click(function() {
  112. $(this).parent().toggleClass('chat-widget-opened chat-widget-closed');
  113. });
  114. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement