編集の要約なし |
編集の要約なし |
||
| 10行目: | 10行目: | ||
margin: 1rem 0; | margin: 1rem 0; | ||
} | } | ||
#chart_div .time { | #chart_div .time { | ||
width: 3rem; | width: 3rem; | ||
} | } | ||
#chart_div .pageview { | #chart_div .pageview { | ||
width: 2.5rem; | width: 2.5rem; | ||
} | } | ||
#chart_div td.time { | #chart_div td.time { | ||
text-align: right; | text-align: right; | ||
font-size: 0.8rem; | font-size: 0.8rem; | ||
} | } | ||
#chart_div td.pageview { | #chart_div td.pageview { | ||
text-align: right; | text-align: right; | ||
| 55行目: | 55行目: | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
var period = "daily", | var period = "daily", | ||
orderBy = " | orderBy = "time"; | ||
prepareChart(); | prepareChart(); | ||
| 62行目: | 62行目: | ||
period + | period + | ||
" " + | " " + | ||
(orderBy === " | (orderBy === "time" ? "longest time spent" : "most viewed"); | ||
var url = | var url = | ||
"https://docs.google.com/spreadsheets/d/1niIGejZ1Czrkj07hGDPleVvk9AEBaDtjr55n63GluLw/gviz/tq?sheet=" + | "https://docs.google.com/spreadsheets/d/1niIGejZ1Czrkj07hGDPleVvk9AEBaDtjr55n63GluLw/gviz/tq?sheet=" + | ||
| 87行目: | 87行目: | ||
<thead bgcolor = #1ac779> | <thead bgcolor = #1ac779> | ||
<tr> | <tr> | ||
<th id="header-time" class="time selectable ${orderBy === "time" ? "selected" : ""}">時間</th> | |||
<th id="header-pageview" class="pageview selectable ${orderBy === "pageview" ? "selected" : ""}">PV</th> | <th id="header-pageview" class="pageview selectable ${orderBy === "pageview" ? "selected" : ""}">PV</th> | ||
<th>ページ</th> | <th>ページ</th> | ||
| 98行目: | 97行目: | ||
try { | try { | ||
var title = data.getValue(i, 0).replace(" - 宇宙wiki", ""); | var title = data.getValue(i, 0).replace(" - 宇宙wiki", ""); | ||
var time = Math.round(data.getValue(i, 1) / 60) + "分"; | |||
var pageview = data.getValue(i, 2); | var pageview = data.getValue(i, 2); | ||
var url = "/w/" + encodeTitle(title); | var url = "/w/" + encodeTitle(title); | ||
| 105行目: | 104行目: | ||
html.push(` | html.push(` | ||
<tr> | <tr> | ||
<td class="time">${time}</td> | |||
<td class="pageview">${pageview}</td> | <td class="pageview">${pageview}</td> | ||
<td class="page">${anchor}</td> | <td class="page">${anchor}</td> | ||
| 134行目: | 133行目: | ||
.getElementById("header-time") | .getElementById("header-time") | ||
.addEventListener("click", function () { | .addEventListener("click", function () { | ||
if (orderBy === " | if (orderBy === "time") return; | ||
orderBy = " | orderBy = "time"; | ||
prepareChart(); | prepareChart(); | ||
}); | }); | ||
document | document | ||
.getElementById("header-pageview") | .getElementById("header-pageview") | ||