This commit is contained in:
James Campos 2011-09-12 22:52:58 -07:00
parent 165da883db
commit b842063d3d
2 changed files with 16 additions and 7 deletions

View File

@ -2056,12 +2056,17 @@
return g.callbacks.push(Time.node);
},
node: function(root) {
var day, hour, min, month, s, time, year, _, _ref;
var day, hour, min, month, node, tc, time, year, _, _ref;
if (root.className === 'inline') {
return;
}
s = $('span[id^=no]', root).previousSibling;
_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];
node = $('span[id]', root).previousSibling;
tc = node.textContent;
if (tc === ' ') {
node = node.previousSibling;
tc = node.textContent;
}
_ref = tc.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;
month -= 1;
hour = g.chanOffset + Number(hour);
@ -2069,7 +2074,7 @@
time = $.el('time', {
textContent: ' ' + Time.funk(Time) + ' '
});
return $.replace(s, time);
return $.replace(node, time);
},
foo: function() {
var code;

View File

@ -1618,9 +1618,13 @@ Time =
g.callbacks.push Time.node
node: (root) ->
return if root.className is 'inline'
s = $('span[id^=no]', root).previousSibling
node = $('span[id]', root).previousSibling
tc = node.textContent
if tc is ' '
node = node.previousSibling
tc = node.textContent
[_, month, day, year, hour, min] =
s.textContent.match /(\d+)\/(\d+)\/(\d+)\(\w+\)(\d+):(\d+)/
tc.match /(\d+)\/(\d+)\/(\d+)\(\w+\)(\d+):(\d+)/
year = "20#{year}"
month -= 1 #months start at 0
hour = g.chanOffset + Number hour
@ -1629,7 +1633,7 @@ Time =
time = $.el 'time',
textContent: ' ' + Time.funk(Time) + ' '
$.replace s, time
$.replace node, time
foo: ->
code = conf['time'].replace /%([A-Za-z])/g, (s, c) ->
if c of Time.formatters