mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Added wonky date selector, unused so far
This commit is contained in:
@ -289,6 +289,26 @@ def module_filterselection(keys,time=True,delimit=False):
|
|||||||
keystr = "?" + urllib.parse.urlencode(retainkeys)
|
keystr = "?" + urllib.parse.urlencode(retainkeys)
|
||||||
|
|
||||||
|
|
||||||
|
# wonky selector for precise date range
|
||||||
|
|
||||||
|
# fromdate = start_of_scrobbling()
|
||||||
|
# todate = end_of_scrobbling()
|
||||||
|
# if keys.get("since") is not None: fromdate = keys.get("since")
|
||||||
|
# if keys.get("to") is not None: todate = keys.get("to")
|
||||||
|
# if keys.get("in") is not None: fromdate, todate = keys.get("in"), keys.get("in")
|
||||||
|
# fromdate = time_fix(fromdate)
|
||||||
|
# todate = time_fix(todate)
|
||||||
|
# fromdate, todate = time_pad(fromdate,todate,full=True)
|
||||||
|
# fromdate = [str(e) if e>9 else "0" + str(e) for e in fromdate]
|
||||||
|
# todate = [str(e) if e>9 else "0" + str(e) for e in todate]
|
||||||
|
#
|
||||||
|
# html += "<div>"
|
||||||
|
# html += "from <input id='dateselect_from' onchange='datechange()' type='date' value='" + "-".join(fromdate) + "'/> "
|
||||||
|
# html += "to <input id='dateselect_to' onchange='datechange()' type='date' value='" + "-".join(todate) + "'/>"
|
||||||
|
# html += "</div>"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
html += "<div>"
|
html += "<div>"
|
||||||
if keys.get("since") == "today" or keys.get("in") == "today":
|
if keys.get("since") == "today" or keys.get("in") == "today":
|
||||||
html += "<span class='stat_selector' style='opacity:0.5;'>Today</span>"
|
html += "<span class='stat_selector' style='opacity:0.5;'>Today</span>"
|
||||||
@ -333,7 +353,7 @@ def module_filterselection(keys,time=True,delimit=False):
|
|||||||
html += "<a href='" + keystr + "&step=day'><span class='stat_selector'>Daily</span></a>"
|
html += "<a href='" + keystr + "&step=day'><span class='stat_selector'>Daily</span></a>"
|
||||||
html += " | "
|
html += " | "
|
||||||
|
|
||||||
if keys.get("step") == "month":
|
if keys.get("step") == "month" or keys.get("step") is None:
|
||||||
html += "<span class='stat_selector' style='opacity:0.5;'>Monthly</span>"
|
html += "<span class='stat_selector' style='opacity:0.5;'>Monthly</span>"
|
||||||
else:
|
else:
|
||||||
html += "<a href='" + keystr + "&step=month'><span class='stat_selector'>Monthly</span></a>"
|
html += "<a href='" + keystr + "&step=month'><span class='stat_selector'>Monthly</span></a>"
|
||||||
|
1
images/.gitignore
vendored
1
images/.gitignore
vendored
@ -4,4 +4,3 @@ cached/
|
|||||||
*.jpeg
|
*.jpeg
|
||||||
*.png
|
*.png
|
||||||
*.gif
|
*.gif
|
||||||
!default.jpg
|
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 6.8 KiB |
135
malojatime.py
135
malojatime.py
@ -9,8 +9,16 @@ def register_scrobbletime(timestamp):
|
|||||||
global FIRST_SCROBBLE
|
global FIRST_SCROBBLE
|
||||||
if timestamp < FIRST_SCROBBLE:
|
if timestamp < FIRST_SCROBBLE:
|
||||||
FIRST_SCROBBLE = int(timestamp)
|
FIRST_SCROBBLE = int(timestamp)
|
||||||
|
|
||||||
|
|
||||||
|
def start_of_scrobbling():
|
||||||
|
global FIRST_SCROBBLE
|
||||||
|
f = datetime.datetime.utcfromtimestamp(FIRST_SCROBBLE)
|
||||||
|
return [f.year]
|
||||||
|
|
||||||
|
def end_of_scrobbling():
|
||||||
|
global FIRST_SCROBBLE
|
||||||
|
f = datetime.datetime.now()
|
||||||
|
return [f.year]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -22,15 +30,15 @@ def time_fix(t):
|
|||||||
tod = datetime.datetime.utcnow()
|
tod = datetime.datetime.utcnow()
|
||||||
months = ["january","february","march","april","may","june","july","august","september","october","november","december"]
|
months = ["january","february","march","april","may","june","july","august","september","october","november","december"]
|
||||||
weekdays = ["sunday","monday","tuesday","wednesday","thursday","friday","saturday"]
|
weekdays = ["sunday","monday","tuesday","wednesday","thursday","friday","saturday"]
|
||||||
|
|
||||||
if t.lower() in ["today","day"]:
|
if t.lower() in ["today","day"]:
|
||||||
t = [tod.year,tod.month,tod.day]
|
t = [tod.year,tod.month,tod.day]
|
||||||
elif t.lower() == "month":
|
elif t.lower() == "month":
|
||||||
t = [tod.year,tod.month]
|
t = [tod.year,tod.month]
|
||||||
elif t.lower() == "year":
|
elif t.lower() == "year":
|
||||||
t = [tod.year]
|
t = [tod.year]
|
||||||
|
|
||||||
|
|
||||||
elif t.lower() in months:
|
elif t.lower() in months:
|
||||||
#diff = (tod.month - months.index(t.lower()) - 1)
|
#diff = (tod.month - months.index(t.lower()) - 1)
|
||||||
month = months.index(t.lower()) + 1
|
month = months.index(t.lower()) + 1
|
||||||
@ -44,30 +52,30 @@ def time_fix(t):
|
|||||||
|
|
||||||
if isinstance(t,str): t = t.split("/")
|
if isinstance(t,str): t = t.split("/")
|
||||||
#if isinstance(t,tuple): t = list(t)
|
#if isinstance(t,tuple): t = list(t)
|
||||||
|
|
||||||
t = [int(p) for p in t]
|
t = [int(p) for p in t]
|
||||||
|
|
||||||
return t[:3]
|
return t[:3]
|
||||||
|
|
||||||
# makes times the same precision level
|
# makes times the same precision level
|
||||||
def time_pad(f,t):
|
def time_pad(f,t,full=False):
|
||||||
f,t = time_fix(f), time_fix(t)
|
f,t = time_fix(f), time_fix(t)
|
||||||
while len(f) < len(t):
|
while (len(f) < len(t)) or (full and len(f) < 3):
|
||||||
if len(f) == 1: f.append(1)
|
if len(f) == 1: f.append(1)
|
||||||
elif len(f) == 2: f.append(1)
|
elif len(f) == 2: f.append(1)
|
||||||
while len(f) > len(t):
|
while (len(f) > len(t)) or (full and len(t) < 3):
|
||||||
if len(t) == 1: t.append(12)
|
if len(t) == 1: t.append(12)
|
||||||
elif len(t) == 2: t.append(monthrange(*t)[1])
|
elif len(t) == 2: t.append(monthrange(*t)[1])
|
||||||
|
|
||||||
return (f,t)
|
return (f,t)
|
||||||
|
|
||||||
|
|
||||||
def time_desc(t,short=False):
|
def time_desc(t,short=False):
|
||||||
if isinstance(t,int):
|
if isinstance(t,int):
|
||||||
if short:
|
if short:
|
||||||
now = datetime.datetime.now(tz=datetime.timezone.utc)
|
now = datetime.datetime.now(tz=datetime.timezone.utc)
|
||||||
difference = int(now.timestamp() - t)
|
difference = int(now.timestamp() - t)
|
||||||
|
|
||||||
if difference < 10: return "just now"
|
if difference < 10: return "just now"
|
||||||
if difference < 60: return str(difference) + " seconds ago"
|
if difference < 60: return str(difference) + " seconds ago"
|
||||||
difference = int(difference/60)
|
difference = int(difference/60)
|
||||||
@ -80,18 +88,18 @@ def time_desc(t,short=False):
|
|||||||
if difference < 31: return str(difference) + " days ago" if difference>1 else str(difference) + " day ago"
|
if difference < 31: return str(difference) + " days ago" if difference>1 else str(difference) + " day ago"
|
||||||
#if difference < 300 and tim.year == now.year: return tim.strftime("%B")
|
#if difference < 300 and tim.year == now.year: return tim.strftime("%B")
|
||||||
#if difference < 300: return tim.strftime("%B %Y")
|
#if difference < 300: return tim.strftime("%B %Y")
|
||||||
|
|
||||||
return timeobject.strftime("%d. %B %Y")
|
return timeobject.strftime("%d. %B %Y")
|
||||||
else:
|
else:
|
||||||
timeobject = datetime.datetime.utcfromtimestamp(t)
|
timeobject = datetime.datetime.utcfromtimestamp(t)
|
||||||
return timeobject.strftime("%d. %b %Y %I:%M %p")
|
return timeobject.strftime("%d. %b %Y %I:%M %p")
|
||||||
|
|
||||||
else:
|
else:
|
||||||
t = time_fix(t)
|
t = time_fix(t)
|
||||||
date = [1970,1,1]
|
date = [1970,1,1]
|
||||||
date[:len(t)] = t
|
date[:len(t)] = t
|
||||||
timeobject = datetime.datetime(date[0],date[1],date[2],tzinfo=datetime.timezone.utc)
|
timeobject = datetime.datetime(date[0],date[1],date[2],tzinfo=datetime.timezone.utc)
|
||||||
|
|
||||||
nowdate = [1970,1,1]
|
nowdate = [1970,1,1]
|
||||||
nowobject = datetime.datetime.now(tz=datetime.timezone.utc)
|
nowobject = datetime.datetime.now(tz=datetime.timezone.utc)
|
||||||
nowdate[:len(t)] = [nowobject.year, nowobject.month, nowobject.day][:len(t)]
|
nowdate[:len(t)] = [nowobject.year, nowobject.month, nowobject.day][:len(t)]
|
||||||
@ -103,12 +111,12 @@ def time_desc(t,short=False):
|
|||||||
if diff == 1: return "Yesterday"
|
if diff == 1: return "Yesterday"
|
||||||
if diff < 7: return timeobject.strftime("%A")
|
if diff < 7: return timeobject.strftime("%A")
|
||||||
#elif len(t) == 2:
|
#elif len(t) == 2:
|
||||||
|
|
||||||
|
|
||||||
if len(t) == 3: return timeobject.strftime("%d. %B %Y")
|
if len(t) == 3: return timeobject.strftime("%d. %B %Y")
|
||||||
if len(t) == 2: return timeobject.strftime("%B %Y")
|
if len(t) == 2: return timeobject.strftime("%B %Y")
|
||||||
if len(t) == 1: return timeobject.strftime("%Y")
|
if len(t) == 1: return timeobject.strftime("%Y")
|
||||||
|
|
||||||
def range_desc(since=None,to=None,within=None,short=False):
|
def range_desc(since=None,to=None,within=None,short=False):
|
||||||
|
|
||||||
# the 'short' var we pass down to some of the time_desc calls is a different one than the one here
|
# the 'short' var we pass down to some of the time_desc calls is a different one than the one here
|
||||||
@ -124,10 +132,10 @@ def range_desc(since=None,to=None,within=None,short=False):
|
|||||||
sincestr = ""
|
sincestr = ""
|
||||||
if to is None:
|
if to is None:
|
||||||
tostr = ""
|
tostr = ""
|
||||||
|
|
||||||
if isinstance(since,int) and to is None:
|
if isinstance(since,int) and to is None:
|
||||||
sincestr = "since " + time_desc(since)
|
sincestr = "since " + time_desc(since)
|
||||||
shortsincestr = sincestr
|
shortsincestr = sincestr
|
||||||
elif isinstance(to,int) and since is None:
|
elif isinstance(to,int) and since is None:
|
||||||
tostr = "up until " + time_desc(to)
|
tostr = "up until " + time_desc(to)
|
||||||
elif isinstance(since,int) and not isinstance(to,int):
|
elif isinstance(since,int) and not isinstance(to,int):
|
||||||
@ -153,50 +161,50 @@ def range_desc(since=None,to=None,within=None,short=False):
|
|||||||
shortsincestr = time_desc(since,short=True)
|
shortsincestr = time_desc(since,short=True)
|
||||||
tostr = ""
|
tostr = ""
|
||||||
elif _week(since,to):
|
elif _week(since,to):
|
||||||
|
|
||||||
sincestr = "in " + _week(since,to)
|
sincestr = "in " + _week(since,to)
|
||||||
shortsincestr = _week(since,to)
|
shortsincestr = _week(since,to)
|
||||||
tostr = ""
|
tostr = ""
|
||||||
else:
|
else:
|
||||||
fparts = time_desc(since).split(" ")
|
fparts = time_desc(since).split(" ")
|
||||||
tparts = time_desc(to).split(" ")
|
tparts = time_desc(to).split(" ")
|
||||||
|
|
||||||
fparts.reverse()
|
fparts.reverse()
|
||||||
tparts.reverse()
|
tparts.reverse()
|
||||||
|
|
||||||
fparts = fparts[len(commonprefix([fparts,tparts])):]
|
fparts = fparts[len(commonprefix([fparts,tparts])):]
|
||||||
|
|
||||||
fparts.reverse()
|
fparts.reverse()
|
||||||
tparts.reverse()
|
tparts.reverse()
|
||||||
|
|
||||||
sincestr = "from " + " ".join(fparts)
|
sincestr = "from " + " ".join(fparts)
|
||||||
shortsincestr = " ".join(fparts)
|
shortsincestr = " ".join(fparts)
|
||||||
tostr = "to " + " ".join(tparts)
|
tostr = "to " + " ".join(tparts)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if since is not None:
|
if since is not None:
|
||||||
sincestr = "since " + time_desc(since)
|
sincestr = "since " + time_desc(since)
|
||||||
shortsincestr = sincestr
|
shortsincestr = sincestr
|
||||||
if to is not None:
|
if to is not None:
|
||||||
tostr = "up until " + time_desc(to)
|
tostr = "up until " + time_desc(to)
|
||||||
|
|
||||||
if short: return shortsincestr + " " + tostr
|
if short: return shortsincestr + " " + tostr
|
||||||
else: return sincestr + " " + tostr
|
else: return sincestr + " " + tostr
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def time_stamps(since=None,to=None,within=None):
|
def time_stamps(since=None,to=None,within=None):
|
||||||
|
|
||||||
|
|
||||||
if within is not None:
|
if within is not None:
|
||||||
since = within
|
since = within
|
||||||
to = within
|
to = within
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (since==None): stamp1 = FIRST_SCROBBLE
|
if (since==None): stamp1 = FIRST_SCROBBLE
|
||||||
else:
|
else:
|
||||||
since = time_fix(since)
|
since = time_fix(since)
|
||||||
@ -211,42 +219,42 @@ def time_stamps(since=None,to=None,within=None):
|
|||||||
date = [1970,1,1]
|
date = [1970,1,1]
|
||||||
date[:len(to)] = to
|
date[:len(to)] = to
|
||||||
stamp2 = int(datetime.datetime(date[0],date[1],date[2],tzinfo=datetime.timezone.utc).timestamp())
|
stamp2 = int(datetime.datetime(date[0],date[1],date[2],tzinfo=datetime.timezone.utc).timestamp())
|
||||||
|
|
||||||
|
|
||||||
return (stamp1,stamp2)
|
return (stamp1,stamp2)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def delimit_desc(step="month",stepn=1,trail=1):
|
def delimit_desc(step="month",stepn=1,trail=1):
|
||||||
txt = ""
|
txt = ""
|
||||||
if stepn is not 1: txt += _num(stepn) + "-"
|
if stepn is not 1: txt += _num(stepn) + "-"
|
||||||
txt += {"year":"Yearly","month":"Monthly","day":"Daily"}[step.lower()]
|
txt += {"year":"Yearly","month":"Monthly","day":"Daily"}[step.lower()]
|
||||||
#if trail is not 1: txt += " " + _num(trail) + "-Trailing"
|
#if trail is not 1: txt += " " + _num(trail) + "-Trailing"
|
||||||
if trail is not 1: txt += " Trailing" #we don't need all the info in the title
|
if trail is not 1: txt += " Trailing" #we don't need all the info in the title
|
||||||
|
|
||||||
return txt
|
return txt
|
||||||
|
|
||||||
|
|
||||||
def _week(since,to):
|
def _week(since,to):
|
||||||
if len(since) != 3 or len(to) != 3: return False
|
if len(since) != 3 or len(to) != 3: return False
|
||||||
dt_since, dt_to = datetime.datetime(*since,tzinfo=datetime.timezone.utc), datetime.datetime(*to,tzinfo=datetime.timezone.utc)
|
dt_since, dt_to = datetime.datetime(*since,tzinfo=datetime.timezone.utc), datetime.datetime(*to,tzinfo=datetime.timezone.utc)
|
||||||
if (dt_to - dt_since).days != 6: return False
|
if (dt_to - dt_since).days != 6: return False
|
||||||
if dt_since.weekday() != 6: return False
|
if dt_since.weekday() != 6: return False
|
||||||
|
|
||||||
c = dt_to.isocalendar()[:2]
|
c = dt_to.isocalendar()[:2]
|
||||||
return str("Week " + str(c[1]) + " " + str(c[0]))
|
return str("Week " + str(c[1]) + " " + str(c[0]))
|
||||||
|
|
||||||
def _num(i):
|
def _num(i):
|
||||||
names = ["Zero","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven","Twelve"]
|
names = ["Zero","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven","Twelve"]
|
||||||
if i < len(names): return names[i]
|
if i < len(names): return names[i]
|
||||||
else: return str(i)
|
else: return str(i)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def ranges(since=None,to=None,within=None,step="month",stepn=1,trail=1,max_=None):
|
def ranges(since=None,to=None,within=None,step="month",stepn=1,trail=1,max_=None):
|
||||||
|
|
||||||
(firstincluded,lastincluded) = time_stamps(since=since,to=to,within=within)
|
(firstincluded,lastincluded) = time_stamps(since=since,to=to,within=within)
|
||||||
@ -256,7 +264,7 @@ def ranges(since=None,to=None,within=None,step="month",stepn=1,trail=1,max_=None
|
|||||||
d_start = _get_next(d_start,step,stepn) # first range should end right after the first active scrobbling week / month / whatever relevant step
|
d_start = _get_next(d_start,step,stepn) # first range should end right after the first active scrobbling week / month / whatever relevant step
|
||||||
d_start = _get_next(d_start,step,stepn * trail * -1) # go one range back to begin
|
d_start = _get_next(d_start,step,stepn * trail * -1) # go one range back to begin
|
||||||
|
|
||||||
|
|
||||||
i = 0
|
i = 0
|
||||||
d_current = d_start
|
d_current = d_start
|
||||||
while not _is_past(d_current,d_end) and (max_ is None or i < max_):
|
while not _is_past(d_current,d_end) and (max_ is None or i < max_):
|
||||||
@ -282,7 +290,7 @@ def _get_start_of(timestamp,unit):
|
|||||||
d = datetime.timedelta(days=change)
|
d = datetime.timedelta(days=change)
|
||||||
newdate = date - d
|
newdate = date - d
|
||||||
return [newdate.year,newdate.month,newdate.day]
|
return [newdate.year,newdate.month,newdate.day]
|
||||||
|
|
||||||
def _get_next(time,unit="auto",step=1):
|
def _get_next(time,unit="auto",step=1):
|
||||||
result = time[:]
|
result = time[:]
|
||||||
if unit == "auto":
|
if unit == "auto":
|
||||||
@ -313,7 +321,7 @@ def _get_next(time,unit="auto",step=1):
|
|||||||
#eugh
|
#eugh
|
||||||
elif unit == "week":
|
elif unit == "week":
|
||||||
return _get_next(time,"day",step * 7)
|
return _get_next(time,"day",step * 7)
|
||||||
|
|
||||||
# like _get_next(), but gets the last INCLUDED day / month whatever
|
# like _get_next(), but gets the last INCLUDED day / month whatever
|
||||||
def _get_end(time,unit="auto",step=1):
|
def _get_end(time,unit="auto",step=1):
|
||||||
if step == 1:
|
if step == 1:
|
||||||
@ -324,9 +332,9 @@ def _get_end(time,unit="auto",step=1):
|
|||||||
exc = _get_next(time,unit,step)
|
exc = _get_next(time,unit,step)
|
||||||
inc = _get_next(exc,"auto",-1)
|
inc = _get_next(exc,"auto",-1)
|
||||||
return inc
|
return inc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _is_past(date,limit):
|
def _is_past(date,limit):
|
||||||
date_, limit_ = date[:], limit[:]
|
date_, limit_ = date[:], limit[:]
|
||||||
while len(date_) != 3: date_.append(1)
|
while len(date_) != 3: date_.append(1)
|
||||||
@ -336,4 +344,3 @@ def _is_past(date,limit):
|
|||||||
if not date_[1] == limit_[1]:
|
if not date_[1] == limit_[1]:
|
||||||
return date_[1] > limit_[1]
|
return date_[1] > limit_[1]
|
||||||
return (date_[2] > limit_[2])
|
return (date_[2] > limit_[2])
|
||||||
|
|
||||||
|
@ -84,6 +84,7 @@ replacetitle FEMALE PRESIDENT(여자 대통령) Female President
|
|||||||
# Mamamoo
|
# Mamamoo
|
||||||
replaceartist Hwa Sa Hwasa
|
replaceartist Hwa Sa Hwasa
|
||||||
replaceartist MAMAMOO Mamamoo
|
replaceartist MAMAMOO Mamamoo
|
||||||
|
replacetitle Egotistic(너나 해) Egotistic
|
||||||
|
|
||||||
# Hello Venus
|
# Hello Venus
|
||||||
replaceartist Hello/Venus Hello Venus
|
replaceartist Hello/Venus Hello Venus
|
||||||
|
Can't render this file because it has a wrong number of fields in line 5.
|
@ -26,6 +26,16 @@ a:hover {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
input[type="date"] {
|
||||||
|
background-color:inherit;
|
||||||
|
color:inherit;
|
||||||
|
outline: none;
|
||||||
|
border:0px;
|
||||||
|
font-family: inherit;
|
||||||
|
font-size: inherit;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Header (unused)
|
Header (unused)
|
||||||
**/
|
**/
|
||||||
|
43
website/javascript/datechange.js
Normal file
43
website/javascript/datechange.js
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
function datechange() {
|
||||||
|
|
||||||
|
since = document.getElementById("dateselect_from").value;
|
||||||
|
to = document.getElementById("dateselect_to").value;
|
||||||
|
|
||||||
|
since = since.split("-").join("/")
|
||||||
|
to = to.split("-").join("/")
|
||||||
|
|
||||||
|
//url = window.location.href
|
||||||
|
//var url = document.createElement("a")
|
||||||
|
//url.href = window.location.href
|
||||||
|
//console.log(url.search)
|
||||||
|
|
||||||
|
keys = window.location.search.substring(1).split("&")
|
||||||
|
|
||||||
|
|
||||||
|
var keydict = {};
|
||||||
|
for (var i=0;i<keys.length;i++) {
|
||||||
|
kv = keys[i].split("=");
|
||||||
|
key = kv[0]
|
||||||
|
value = kv[1]
|
||||||
|
keydict[key] = value
|
||||||
|
}
|
||||||
|
|
||||||
|
delete keydict["in"]
|
||||||
|
keydict["since"] = since
|
||||||
|
keydict["to"] = to
|
||||||
|
|
||||||
|
console.log(keydict)
|
||||||
|
|
||||||
|
keys = []
|
||||||
|
Object.keys(keydict).forEach(function(key) {
|
||||||
|
keys.push(key + "=" + keydict[key])
|
||||||
|
});
|
||||||
|
console.log(keys)
|
||||||
|
|
||||||
|
window.location.href = window.location.protocol
|
||||||
|
+ "//" + window.location.hostname
|
||||||
|
+ ":" + window.location.port
|
||||||
|
+ window.location.pathname
|
||||||
|
+ "?" + keys.join("&");
|
||||||
|
|
||||||
|
}
|
@ -4,6 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<title>Maloja - Top Artists</title>
|
<title>Maloja - Top Artists</title>
|
||||||
|
<script src="javascript/datechange.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
@ -26,6 +26,9 @@ def instructions(keys):
|
|||||||
pushresources = [{"file":imgurl,"type":"image"}] if imgurl.startswith("/") else []
|
pushresources = [{"file":imgurl,"type":"image"}] if imgurl.startswith("/") else []
|
||||||
|
|
||||||
|
|
||||||
replace = {"KEY_TOPARTIST_IMAGEURL":imgurl,"KEY_ARTISTLIST":html_charts,"KEY_RANGE":limitstring,"KEY_FILTERSELECTOR":html_filterselector}
|
replace = {"KEY_TOPARTIST_IMAGEURL":imgurl,
|
||||||
|
"KEY_ARTISTLIST":html_charts,
|
||||||
|
"KEY_RANGE":limitstring,
|
||||||
|
"KEY_FILTERSELECTOR":html_filterselector}
|
||||||
|
|
||||||
return (replace,pushresources)
|
return (replace,pushresources)
|
||||||
|
Reference in New Issue
Block a user