explicit Time.node

This commit is contained in:
James Campos 2011-06-16 11:40:14 -07:00
parent fcff8bc70a
commit 34c37c719a
2 changed files with 30 additions and 29 deletions

View File

@ -1705,22 +1705,23 @@
Time = { Time = {
init: function() { init: function() {
Time.foo(); Time.foo();
return g.callbacks.push(function(root) { return g.callbacks.push(Time.node);
var day, hour, min, month, s, time, year, _, _ref; },
if (root.className === 'inline') { node: function(root) {
return; var day, hour, min, month, s, time, year, _, _ref;
} if (root.className === 'inline') {
s = $('span[id^=no]', root).previousSibling; return;
_ref = s.textContent.match(/(\d+)\/(\d+)\/(\d+)\(\w+\)(\d+):(\d+)/), _ = _ref[0], month = _ref[1], day = _ref[2], year = _ref[3], hour = _ref[4], min = _ref[5]; }
year = "20" + year; s = $('span[id^=no]', root).previousSibling;
month -= 1; _ref = s.textContent.match(/(\d+)\/(\d+)\/(\d+)\(\w+\)(\d+):(\d+)/), _ = _ref[0], month = _ref[1], day = _ref[2], year = _ref[3], hour = _ref[4], min = _ref[5];
hour = g.chanOffset + Number(hour); year = "20" + year;
Time.date = new Date(year, month, day, hour, min); month -= 1;
time = $.el('time', { hour = g.chanOffset + Number(hour);
textContent: ' ' + Time.funk(Time) + ' ' Time.date = new Date(year, month, day, hour, min);
}); time = $.el('time', {
return $.replace(s, time); textContent: ' ' + Time.funk(Time) + ' '
}); });
return $.replace(s, time);
}, },
foo: function() { foo: function() {
var code; var code;

View File

@ -1364,21 +1364,21 @@ sauce =
Time = Time =
init: -> init: ->
Time.foo() Time.foo()
g.callbacks.push (root) -> g.callbacks.push Time.node
return if root.className is 'inline' node: (root) ->
s = $('span[id^=no]', root).previousSibling return if root.className is 'inline'
[_, month, day, year, hour, min] = s = $('span[id^=no]', root).previousSibling
s.textContent.match /(\d+)\/(\d+)\/(\d+)\(\w+\)(\d+):(\d+)/ [_, month, day, year, hour, min] =
year = "20#{year}" s.textContent.match /(\d+)\/(\d+)\/(\d+)\(\w+\)(\d+):(\d+)/
month -= 1 #months start at 0 year = "20#{year}"
hour = g.chanOffset + Number hour month -= 1 #months start at 0
Time.date = new Date year, month, day, hour, min hour = g.chanOffset + Number hour
#XXX /b/ will have seconds cut off Time.date = new Date year, month, day, hour, min
#XXX /b/ will have seconds cut off
time = $.el 'time',
textContent: ' ' + Time.funk(Time) + ' '
$.replace s, time
time = $.el 'time',
textContent: ' ' + Time.funk(Time) + ' '
$.replace s, time
foo: -> foo: ->
code = $.config('time').replace /%([A-Za-z])/g, (s, c) -> code = $.config('time').replace /%([A-Za-z])/g, (s, c) ->
switch c switch c