Content deleted Content added
debug Tag: Reverted |
|||
Line 151:
* 08:51, 23 November 2015 (UTC)
*/
parseRegExp: /\d\d:\d\d,
/**
Line 179:
var iter = document.createNodeIterator(root, NodeFilter.SHOW_TEXT, {
acceptNode: function (node) {
// We can’t just check the node’s direct parent, because templates
// like [[Template:Talkback]] and [[Template:Resolved]] may place a
Line 185 ⟶ 184:
var isInProse = proseTags.indexOf(node.parentElement.nodeName) !== -1
|| !$(node).parents(codeTags).length;
var isDateNode = isInProse && LocalComments.parseRegExp.test(node.data);
return isDateNode ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT;
},
Line 197 ⟶ 194:
function wrapTimestamps() {
var prefixNode;
while ((prefixNode = iter.nextNode())) {
var result = LocalComments.parseRegExp.exec(prefixNode.data);
if (!result) continue;
// Split out the timestamp into a separate text node.
var dateNode = prefixNode.splitText(result.index);
Line 216 ⟶ 210:
}
if (!then.isValid()) continue;
then.utcOffset(-LocalComments.utcOffset);
Line 314 ⟶ 307:
mw.loader.using("moment", function () {
wrapTimestamps();
formatTimestamps();
});
});
|