项目作者: mohan-chinnappan-n

项目描述 :
Sample Marquee Console Footer Component
高级语言:
项目地址: git://github.com/mohan-chinnappan-n/Console-Footer-Component.git


Demo

Demo


This component scrapes the top level items in a feed and scrolls them in a custom Console footer component.

Please note that this is sample code. It must be enhanced and tested to production quality as required if you choose to utilize it.

You can configure the refresh by changing value of rate in ms.

  1. <apex:page showHeader="false">
  2. <style>
  3. body {
  4. padding: 10px;
  5. }
  6. </style>
  7. <style>
  8. .classname {
  9. -moz-box-shadow:inset 0px 1px 0px 0px #bbdaf7;
  10. -webkit-box-shadow:inset 0px 1px 0px 0px #bbdaf7;
  11. box-shadow:inset 0px 1px 0px 0px #bbdaf7;
  12. background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #79bbff), color-stop(1, #378de5) );
  13. background:-moz-linear-gradient( center top, #79bbff 5%, #378de5 100% );
  14. filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#79bbff', endColorstr='#378de5');
  15. background-color:#79bbff;
  16. -webkit-border-top-left-radius:10px;
  17. -moz-border-radius-topleft:10px;
  18. border-top-left-radius:10px;
  19. -webkit-border-top-right-radius:10px;
  20. -moz-border-radius-topright:10px;
  21. border-top-right-radius:10px;
  22. -webkit-border-bottom-right-radius:10px;
  23. -moz-border-radius-bottomright:10px;
  24. border-bottom-right-radius:10px;
  25. -webkit-border-bottom-left-radius:10px;
  26. -moz-border-radius-bottomleft:10px;
  27. border-bottom-left-radius:10px;
  28. text-indent:0;
  29. border:1px solid #84bbf3;
  30. display:inline-block;
  31. color:#ffffff;
  32. font-family:Arial;
  33. font-size:10px;
  34. font-weight:bold;
  35. font-style:normal;
  36. height:30px;
  37. line-height:30px;
  38. width:50px;
  39. text-decoration:none;
  40. text-align:center;
  41. text-shadow:1px 1px 0px #528ecc;
  42. margin-left:10px;
  43. }
  44. .classname:hover {
  45. background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #378de5), color-stop(1, #79bbff) );
  46. background:-moz-linear-gradient( center top, #378de5 5%, #79bbff 100% );
  47. filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#378de5', endColorstr='#79bbff');
  48. background-color:#378de5;
  49. }.classname:active {
  50. position:relative;
  51. top:1px;
  52. }
  53. </style>
  54. <!--
  55. <div style="margin-left:auto; margin-right:auto;width:50%;">
  56. <input type="button" class="classname" onclick="scrollButtonText(); return false;" value="Start" />
  57. <input type="button" class="classname" onclick="setButtonText(); return false;" value="Stop" />
  58. </div>
  59. -->
  60. <apex:includeScript value="/support/console/40.0/integration.js"></apex:includeScript>
  61. <script>
  62. function setButtonText() {
  63. sforce.console.setCustomConsoleComponentButtonText('Alerts');
  64. }
  65. function blinkButtonText() {
  66. sforce.console.blinkCustomConsoleComponentButtonText('Hello World', 3000);
  67. }
  68. </script>
  69. <!-- 003f4000004fV4e is the entity we care about for the feed -->
  70. <chatter:feed entityId="003f4000004fV4e" rendered="true"></chatter:feed>
  71. <!-- <input type="button" onclick="blinkButtonText(); return false;" value="Blink Button Text" /> -->
  72. <script>
  73. function srcUp(url) {
  74. sforce.console.openPrimaryTab(null, url, true);
  75. }
  76. // refresh rate in ms
  77. var rate = 10000;
  78. setInterval(function(){window.location.href = window.location.href;},rate);
  79. function getFeedItemBody() {
  80. var feeds = '';
  81. var elements = document.getElementsByClassName('feeditemtext');
  82. for (var i=0; i<elements.length; i++) {
  83. feeds += elements[i].innerHTML + " ";
  84. }
  85. return feeds;
  86. }
  87. var feedItems = getFeedItemBody();
  88. scrollButtonText();
  89. function scrollButtonText() {
  90. sforce.console.setCustomConsoleComponentButtonText(feedItems, function() {
  91. sforce.console.scrollCustomConsoleComponentButtonText(150, 5, true, function(result){});
  92. });
  93. }
  94. </script>
  95. </apex:page>

Lightning version

Lightning Experience brings you real-time group feeds. No more page refreshes required to see what people are saying at the exact moment they say it. Each new post is briefly highlighted to call it to your attention. This feature is available in Lightning Experience only.

When new posts are added to a live feed, a message appears briefly at the top of the feed .

live feed


Comments Are Now Live!

Lightning Experience brings you real-time comments. No more page refreshes required to see what people are saying about a post at the exact moment they say it. Each new comment is briefly highlighted to call it to your attention. Comments refresh and stay live after you subscribe to them. Subscription is easy; just click in the comment field. This feature is available in Lightning Experience only.

live comments


Step-by-step instructions about how to setup this component in Console

Step-by-step instructions

References

  1. The “Marquee” Console Footer Component

  2. Group Feeds Are Now Live!

  3. Get Started with Console Components

  4. My Notes Console Footer Component

  5. Customize a Console with Custom Components in Salesforce Classic

  6. chatter:feed

  7. Comments Are Now Live!