From 6e2a0f64d910b6ccb4d09846ea313e3f308fd747 Mon Sep 17 00:00:00 2001 From: Señor X Date: Fri, 5 Apr 2019 03:50:25 -0300 Subject: Moviendo funciones de hora local de weabot.js y weabotxt.js a shobon.js + Delegación --- static/js/shobon.js | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'static/js/shobon.js') diff --git a/static/js/shobon.js b/static/js/shobon.js index 02d3c71..4b56aae 100644 --- a/static/js/shobon.js +++ b/static/js/shobon.js @@ -27,6 +27,13 @@ function shobon() { loadFilters(); } + var shobon_time = localStorage.getItem("shobon_time"); + if(shobon_time != "false") { + if (boardName == "world") week = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"]; + else if (boardName == "2d") week = ["日", "月", "火", "水", "木", "金", "土"]; + else week = ["dom", "lun", "mar", "mie", "jue", "vie", "sab"]; + } + var threadList = document.getElementsByClassName("thread"); for (var i=0; i31535999) return "más de un año"; +} +function localTime(timestamp, id) { + id = id || 0; + var lcl = new Date(timestamp*1000); + lcl = ("0"+lcl.getDate()).slice(-2) + "/" + ("0" + (lcl.getMonth()+1)).slice(-2) + "/" + lcl.getFullYear().toString().slice(-2) + "(" + week[lcl.getDay()] + ")" + ("0"+lcl.getHours()).slice(-2) + ":" + ("0"+lcl.getMinutes()).slice(-2) + ":" + ("0"+lcl.getSeconds()).slice(-2) + if (id) lcl = lcl + " " + id; + return lcl; +} function loadFilters() { var filters = JSON.parse(localStorage.getItem("shobon_filters")); -- cgit v1.2.1-18-gbd029