This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Translate our messages into expand directives. | |
var messageDirectives = $.map(ajaxResult, formatMessage); | |
// Replace the dashboard placeholder with a newly cloned | |
// DOM node copied from #message-template and expanded | |
// with our messages. | |
$("#dashboard .placeholder"). | |
replaceWith( | |
$("#messages-template"). | |
expand(messageDirectives)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Translate our messages into expand directives. | |
var messageDirectives = $.map(ajaxResult, formatMessage); | |
// Replace the dashboard placeholder with a newly cloned | |
// DOM node copied from #message-template and expanded | |
// with our messages. | |
$("#dashboard .placeholder"). | |
replaceWith( | |
$("#messages-template"). | |
expand(messageDirectives)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="dashboard"> | |
<ul class="messages"> | |
<li class="status-good"><span class="text">John recieved your message.</span></li> | |
<li class="status-bad"><span class="text">Your password is about to expire</span></li> | |
</ul> | |
</div> | |
<div id="sidebar"> | |
<div class="latest-message status-good"> | |
<h2>Latest News</h2> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script id="messages-template" type="text/html"> | |
<ul class="messages"> | |
<li><span class="text"> </span></li> | |
</ul> | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Translate our messages into expand directives. | |
var messageDirectives = $.map(ajaxResult, formatMessage); | |
// Replace the dashboard placeholder with a newly cloned | |
// DOM node copied from #message-template and expanded | |
// with our messages. | |
$("#dashboard .placeholder"). | |
replaceWith( | |
$("#messages-template"). | |
expand(messageDirectives)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function formatMessage(m) { | |
return $.extend({ "addClass()": "status-"+m.value }, m); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ajaxResult = [ | |
{text: "John recieved your message.", value: "good"}, | |
{text: "Your password is about to expire", value: "bad"}, | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="dashboard"> | |
<div class="placeholder">Loading data...</div> | |
</div> | |
<div id="sidebar"> | |
<div class="latest-message"> | |
<h2>Latest News</h2> | |
<p class="text"> | |
Loading data... | |
</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var $body = $(document.body); | |
var loadDataSets = function () { $body.trigger("allDataSetsArrived"); }; | |
if (EmployerGroupReporting.PredefinedDataSets) { | |
loadDataSets = _(EmployerGroupReporting.PredefinedDataSets). | |
reduceRight(function (rest, dataSet) { | |
return function () { | |
EmployerGroupReporting.DataSets[dataSet.Id] = dataSet; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'redis' | |
module MyRedis | |
class Type | |
def self.inherited(subklass) | |
subklass.const_set :ALIASES, {} | |
end | |
def initialize(db,key) |