diff --git a/usr/library/wiki.js b/usr/library/wiki.js index fb3d94bf..552e297b 100644 --- a/usr/library/wiki.js +++ b/usr/library/wiki.js @@ -126,6 +126,23 @@ function menu() { a.innerText = a.href } } + + var m = document.getElementsByTagName("pre"); + for (var i = 0; i < m.length; i++) { + var line = (m[i].clientHeight-10)/15 + // if (line < 3) { + // continue + // } + console.log(m[i].clientHeight) + var nu = m[i].parentElement.insertBefore(document.createElement("div"), m[i]); + nu.className = "number1" + + for (var j = 1; j <= line; j++) { + console.log(j) + var li = nu.appendChild(document.createElement("div")); + li.appendChild(document.createTextNode(""+j)); + } + } } function query(event) { if (event) { diff --git a/usr/template/common/base.html b/usr/template/common/base.html index 75b7224e..65657491 100644 --- a/usr/template/common/base.html +++ b/usr/template/common/base.html @@ -24,8 +24,9 @@ pre { border:solid 1px green; padding:5px; - border-left:solid 5px green; + border-left:solid 2px green; overflow:scroll; + background-color:#f8f8f8; } code { font-size:13px; diff --git a/usr/template/common/wiki.html b/usr/template/common/wiki.html index d4b3cb0b..e015d278 100644 --- a/usr/template/common/wiki.html +++ b/usr/template/common/wiki.html @@ -146,6 +146,21 @@ .link div { padding-left:10px; } +.number1 { + padding:5px; + float:left; + margin-left:0px; + font-size:13px; + background-color:#f8f8f8; + border: solid 1px green; + +} +.number1 div { + text-align:right; + margin:0; + padding:0; + margin-left:0px; +}