Author: jjamrich
Date: 2012-01-18 03:41:30 -0500 (Wed, 18 Jan 2012)
New Revision: 23158
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/resources/script/pushHelper.js
Log:
RFPL-982: Rename and update script for push
Rename script to avoid name collision (push.js is named script providing push
functionality, so client library using push should be named differently).
Updated script behavior: value from push even replace previous value (removed behavior
adding new item in list)
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/resources/script/pushHelper.js
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/resources/script/pushHelper.js 2012-01-18
08:41:21 UTC (rev 23157)
+++
modules/tests/metamer/trunk/application/src/main/webapp/resources/script/pushHelper.js 2012-01-18
08:41:30 UTC (rev 23158)
@@ -1,6 +1,6 @@
-function updateList(data) {
+function updateMessage(containerElem, data) {
author = '<span style="font-weight:bold"
class="author">' + data.author + '</span>: ';
message = '<span class="message">' + data.text +
'</span>';
- timestamp = ' <span>[' + data.timestamp + ']</span>';
- jQuery("ul.push-list").append('<li>' + author + message +
timestamp + '</li>');
+ timestamp = ' <span>[' + data.timestamp + ']</span>';
+ jQuery(containerElem).children("div").replaceWith('<div>' +
author + message + timestamp + '</div>');
}
Show replies by date