1
0
mirror of https://github.com/lxsang/antd-web-apps synced 2024-11-20 02:18:20 +01:00

minor fixes

This commit is contained in:
lxsang 2018-10-19 11:20:56 +02:00
parent 1681bb6fc1
commit 9e1dc0f3dd
9 changed files with 55 additions and 18 deletions

View File

@ -5,8 +5,8 @@
-- some global variables -- some global variables
DIR_SEP = "/" DIR_SEP = "/"
WWW_ROOT = __ROOT__.."/apps" WWW_ROOT = __ROOT__.."/apps"
if HEADER.host then if HEADER.Host then
HTTP_ROOT= "https://"..HEADER.host HTTP_ROOT= "https://"..HEADER.Host
else else
HTTP_ROOT = "https://apps.lxsang.me" HTTP_ROOT = "https://apps.lxsang.me"
end end

View File

@ -5,8 +5,8 @@
-- some global variables -- some global variables
DIR_SEP = "/" DIR_SEP = "/"
WWW_ROOT = __ROOT__.."/blog" WWW_ROOT = __ROOT__.."/blog"
if HEADER.host then if HEADER.Host then
HTTP_ROOT= "https://"..HEADER.host HTTP_ROOT= "https://"..HEADER.Host
else else
HTTP_ROOT = "https://blog.lxsang.me" HTTP_ROOT = "https://blog.lxsang.me"
end end
@ -18,7 +18,7 @@ MODEL_ROOT = BASE_FRW.."blog.models"
-- file path: path/to/file -- file path: path/to/file
VIEW_ROOT = WWW_ROOT..DIR_SEP.."views" VIEW_ROOT = WWW_ROOT..DIR_SEP.."views"
LOG_ROOT = WWW_ROOT..DIR_SEP.."logs" LOG_ROOT = WWW_ROOT..DIR_SEP.."logs"
POST_LIMIT = 2 POST_LIMIT = 10
-- require needed library -- require needed library
require(BASE_FRW.."silk.api") require(BASE_FRW.."silk.api")

View File

@ -5,8 +5,8 @@
-- some global variables -- some global variables
DIR_SEP = "/" DIR_SEP = "/"
WWW_ROOT = __ROOT__.."/get" WWW_ROOT = __ROOT__.."/get"
if HEADER.host then if HEADER.Host then
HTTP_ROOT= "https://"..HEADER.host HTTP_ROOT= "https://"..HEADER.Host
else else
HTTP_ROOT = "https://get.makeand.run" HTTP_ROOT = "https://get.makeand.run"
end end

View File

@ -5,8 +5,8 @@
-- some global variables -- some global variables
DIR_SEP = "/" DIR_SEP = "/"
WWW_ROOT = __ROOT__.."/info" WWW_ROOT = __ROOT__.."/info"
if HEADER.host then if HEADER.Host then
HTTP_ROOT= "https://"..HEADER.host HTTP_ROOT= "https://"..HEADER.Host
else else
HTTP_ROOT = "https://info.lxsang.me" HTTP_ROOT = "https://info.lxsang.me"
end end

View File

@ -30,6 +30,12 @@
/*color: #414339;*/ /*color: #414339;*/
} }
.layout div.container{
display: none;
}
.layout div.container_active{
display: block;
}
.layoutprint{ .layoutprint{
max-width:960px; max-width:960px;
font-family: "Ubuntu"; font-family: "Ubuntu";
@ -39,7 +45,9 @@
flex-direction: row-reverse; flex-direction: row-reverse;
color: #414339; color: #414339;
} }
.layoutprint div.container{
display: block;
}
h1 { h1 {
font-size: 25px; font-size: 25px;
text-align: center; text-align: center;
@ -93,12 +101,21 @@ h1 .cv{
color:#878887; color:#878887;
} }
.container h1{ .container h1, .container_active h1, .container_footer h1{
font-size:20px; font-size:20px;
text-align: left; text-align: left;
color:#3170B2; color:#3170B2;
border-bottom: 1px solid #3170B2; border-bottom: 1px solid #3170B2;
} }
.toc_active {
font-weight: bold;
}
.cv-toc ul li.toc_active a{
/*border-bottom: 1px dashed #878887;*/
color:#3170B2;
}
a{ a{
text-decoration: none; text-decoration: none;
color:#3170B2; color:#3170B2;

View File

@ -1,12 +1,13 @@
<?lua <?lua
if not data then return end if not data then return end
local active = "_active"
for k,v in pairs(data) do for k,v in pairs(data) do
if v.children then if v.children then
?> ?>
<div class="container" id =<?='"toc'..v.id..'"'?>> <div class="container<?=active?>" id =<?='"toc'..v.id..'"'?>>
<h1><?=v.name:gsub("^%d+%.","")?></h1> <h1><?=v.name:gsub("^%d+%.","")?></h1>
<?lua <?lua
active = ''
for l,child in pairs(v.children) do for l,child in pairs(v.children) do
?> ?>
<div class="sub-container"> <div class="sub-container">
@ -50,9 +51,10 @@
<?lua <?lua
else else
?> ?>
<div class="container" id =<?='"toc'..v.id..'"'?>> <div class="container<?=active?>" id =<?='"toc'..v.id..'"'?>>
<h1><?=v.name?></h1> <h1><?=v.name?></h1>
<?lua <?lua
active = ''
if v.sections then if v.sections then
for m, entry in pairs(v.sections) do for m, entry in pairs(v.sections) do
?> ?>

View File

@ -11,6 +11,22 @@
<?lua <?lua
end end
?> ?>
<script>
var switchTab = function(id, e)
{
var els = document.getElementsByClassName("container_active");
var tab = document.getElementById(id)
var tactiv = document.getElementsByClassName("toc_active");
if(els.length == 0) return;
if(!tab) return;
if(tactiv.length == 0) return;
els[0].className = "container";
tab.className = "container_active";
tactiv[0].className = "";
e.parentElement.className = "toc_active";
console.log('switch to ', id, e);
}
</script>
<title>Porfolio</title> <title>Porfolio</title>
</head> </head>
<body> <body>
@ -31,7 +47,7 @@
__main__:render() __main__:render()
end end
?> ?>
<div class = "container"> <div class = "container_footer">
<h1 style="margin:0;"></h1> <h1 style="margin:0;"></h1>
<p style="text-align:right; padding:0; margin:0;color:#878887;">Powered by antd server, (C) 2017-2018 Xuan Sang LE</p> <p style="text-align:right; padding:0; margin:0;color:#878887;">Powered by antd server, (C) 2017-2018 Xuan Sang LE</p>
</div> </div>

View File

@ -5,10 +5,12 @@
<div class = "cv-toc"> <div class = "cv-toc">
<ul> <ul>
<?lua <?lua
local active = "toc_active"
for k, v in pairs(data) do for k, v in pairs(data) do
?> ?>
<li><a href=<?='"#toc'..v[2]..'"'?>><?=v[1]?></a></li> <li class="<?=active?>"><a href=<?='"#toc'..v[2]..'"'?> onclick='switchTab("toc<?=v[2]?>", this)' ><?=v[1]?></a></li>
<?lua <?lua
active = ''
end end
?> ?>
</ul> </ul>

View File

@ -5,8 +5,8 @@
-- some global variables -- some global variables
DIR_SEP = "/" DIR_SEP = "/"
WWW_ROOT = __ROOT__.."/os" WWW_ROOT = __ROOT__.."/os"
if HEADER.host then if HEADER.Host then
HTTP_ROOT= "https://"..HEADER.host HTTP_ROOT= "https://"..HEADER.Host
else else
HTTP_ROOT = "https://os.lxsang.me" HTTP_ROOT = "https://os.lxsang.me"
end end