Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: avoid tag <a> was clicked on the white space #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/addons/folder.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 3 additions & 7 deletions src/addons/folder.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ sysPath = require "path"
fs =require "fs"

list = (klass, links, pathname) ->
("<a class='#{klass}' href='#{sysPath.join pathname, link}'>#{link}</a>" for link in links).join("\n")
("<div><a class='#{klass}' href='#{sysPath.join pathname, link}'>#{link}</a></div>" for link in links).join("\n")

weinre = (inspect) ->
if(inspect)
Expand Down Expand Up @@ -55,7 +55,7 @@ toHTML = (files, folders, pathname ,options) ->
</div>
<script src="/puer/js/folder.js"></script>
</body>
</html>
</html>
"""

module.exports = (app, options) ->
Expand All @@ -80,9 +80,5 @@ module.exports = (app, options) ->
body = toHTML(files, folders, pathname, options)
res.setHeader "Content-Type", "text/html"
# not charlength but bytelength
res.setHeader "Content-Length", Buffer.byteLength body
res.setHeader "Content-Length", Buffer.byteLength body
res.send body




26 changes: 14 additions & 12 deletions vendor/css/folder.css
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
/* reset */
/* reset */
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td{margin:0;padding:0;}
table{border-collapse:collapse;border-spacing:0;}
caption,th{text-align:left;}
fieldset,img,a img,iframe,html,body{border:0;}
li{list-style:none;}
address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}
h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}
[hidefocus]{outline:0;}
body{word-wrap:break-word;font:18/normal "微软雅黑",arial,simsun;color:#333;background:#fff;}
h1,h2,h3,h4,h5,h6,em,strong,b{font-weight:bold;}
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td{margin:0;padding:0;}
table{border-collapse:collapse;border-spacing:0;}
caption,th{text-align:left;}
fieldset,img,a img,iframe,html,body{border:0;}
li{list-style:none;}
address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}
h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}
[hidefocus]{outline:0;}
body{word-wrap:break-word;font:18/normal "微软雅黑",arial,simsun;color:#333;background:#fff;}
h1,h2,h3,h4,h5,h6,em,strong,b{font-weight:bold;}
a,button{cursor:pointer;text-decoration: none;}
a:hover{color:#888;text-decoration: underline;}
a:hover{color:#888;text-decoration: underline;}
a:visited{color: #888;}


.g-doc {padding: 20px 40px 0px 20px;}
.g-doc {padding: 20px 40px 20px 20px;}
a {margin-bottom: 5px;}
a {display:block;padding-left: 20px;}
a.file {display:inline-block}
a.folder {display:inline-block}
h2 {border-bottom:3px dotted #ccc;font-size: 36px;margin-bottom: 10px;}

.prevpath {background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAmlJREFUeNpsU0toU0EUPfPysx/tTxuDH9SCWhUDooIbd7oRUUTMouqi2iIoCO6lceHWhegy4EJFinWjrlQUpVm0IIoFpVDEIthm0dpikpf3ZuZ6Z94nrXhhMjM3c8895977BBHB2PznK8WPtDgyWH5q77cPH8PpdXuhpQT4ifR9u5sfJb1bmw6VivahATDrxcRZ2njfoaMv+2j7mLDn93MPiNRMvGbL18L9IpF8h9/TN+EYkMffSiOXJ5+hkD+PdqcLpICWHOHc2CC+LEyA/K+cKQMnlQHJX8wqYG3MAJy88Wa4OLDvEqAEOpJd0LxHIMdHBziowSwVlF8D6QaicK01krw/JynwcKoEwZczewroTvZirlKJs5CqQ5CG8pb57FnJUA0LYCXMX5fibd+p8LWDDemcPZbzQyjvH+Ki1TlIciElA7ghwLKV4kRZstt2sANWRjYTAGzuP2hXZFpJ/GsxgGJ0ox1aoFWsDXyyxqCs26+ydmagFN/rRjymJ1898bzGzmQE0HCZpmk5A0RFIv8Pn0WYPsiu6t/Rsj6PauVTwffTSzGAGZhUG2F06hEc9ibS7OPMNp6ErYFlKavo7MkhmTqCxZ/jwzGA9Hx82H2BZSw1NTN9Gx8ycHkajU/7M+jInsDC7DiaEmo1bNl1AMr9ASFgqVu9MCTIzoGUimXVAnnaN0PdBBDCCYbEtMk6wkpQwIG0sn0PQIUF4GsTwLSIFKNqF6DVrQq+IWVrQDxAYQC/1SsYOI4pOxKZrfifiUSbDUisif7XlpGIPufXd/uvdvZm760M0no1FZcnrzUdjw7au3vu/BVgAFLXeuTxhTXVAAAAAElFTkSuQmCC ") left top no-repeat}
Expand Down