Created
February 13, 2015 00:24
-
-
Save mneil/044bf07cc4fa9b237ac7 to your computer and use it in GitHub Desktop.
Muut modify display time for FF and Chrome
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(){ | |
MutationObserver = window.MutationObserver || window.WebKitMutationObserver; | |
function time(target){ | |
target.innerHTML = target.time; | |
} | |
moot("format", function(body, post) { | |
var $ = jQuery; | |
var $post = $(body).parents('.m-post')[0]; | |
var t = $(".m-time", $post)[0]; | |
//alternatively you can manipulate post.time into a datetime you want | |
t.time = $(".m-tooltip", $post).text(); | |
new MutationObserver(function(mutations) { | |
time(mutations[0].target); | |
}).observe(t, { | |
subtree: true, | |
attributes: true | |
}); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment