Damlanur 5 years ago
commit b01b442f80

@ -66,15 +66,26 @@ def filenameforlink(href):
href = urlquote(href) href = urlquote(href)
return href return href
def rewritelinks (html):
t = html5lib.parseFragment(html, treebuilder = "etree", namespaceHTMLElements = False)
# remove links to wiki File: pages def rewriteimglinks(tree, page):
for a in t.findall(".//a[@class='image']"): # select img wrapping a # invoke after img src has been rewritten
href = a.attrib.get('href') # To: remove links to wiki File on all pages
if a.findall(".//img") and 'File:' in href: # ensure a has child: img # but Overview_main_page page where link to publication page is added
a.attrib['href'] = 'javascript:void(0);' # disable href if page.name == 'Overview main page':
for div_parent in tree.findall(".//div[@class='tooltip']"):
anchor_of_img = div_parent.find(".//div/a")
if anchor_of_img.find(".//img") is not None: # <a> needs child <img>
a_tag = div_parent.find(".//p/span/a")
publication_href = a_tag.attrib.get('href')
anchor_of_img.attrib['href'] = publication_href
else:
for a in tree.findall(".//a[@class='image']"): # select img wrapping a
if a.findall(".//img"): # ensure a has child: img
a.attrib['href'] = 'javascript:void(0);' # disable href
return tree
def rewritelinks(html):
t = html5lib.parseFragment(html, treebuilder = "etree", namespaceHTMLElements = False)
for a in t.findall(".//*[@href]"): for a in t.findall(".//*[@href]"):
linkclass = a.attrib.get("class", "") linkclass = a.attrib.get("class", "")
href = a.attrib.get("href") href = a.attrib.get("href")
@ -89,7 +100,7 @@ def rewritelinks (html):
return html return html
def rewriteimgs(html): def rewriteimgs(html, page):
t = html5lib.parseFragment(html, treebuilder = "etree", namespaceHTMLElements = False) t = html5lib.parseFragment(html, treebuilder = "etree", namespaceHTMLElements = False)
# replace images url with local image in ../images # replace images url with local image in ../images
@ -119,6 +130,9 @@ def rewriteimgs(html):
img.attrib['srcset'] = "" # rm srcset value:it prevent imgs displaying img.attrib['srcset'] = "" # rm srcset value:it prevent imgs displaying
img.attrib['width'] = "" img.attrib['width'] = ""
img.attrib['height'] = "" img.attrib['height'] = ""
t = rewriteimglinks(tree=t, page=page)
html = ET.tostring(t, method="html", encoding="unicode") html = ET.tostring(t, method="html", encoding="unicode")
return html return html
@ -126,7 +140,7 @@ def dumppage(p, template, rewrite_images=True):
htmlsrc = site.parse(page=p.name)['text']['*'] htmlsrc = site.parse(page=p.name)['text']['*']
htmlsrc = rewritelinks(htmlsrc) htmlsrc = rewritelinks(htmlsrc)
if rewrite_images: if rewrite_images:
htmlsrc = rewriteimgs(htmlsrc) htmlsrc = rewriteimgs(html=htmlsrc, page=p)
html = template.render(page=p, body=htmlsrc, staticpath='.') html = template.render(page=p, body=htmlsrc, staticpath='.')
with open(os.path.join(args.output, filenameforpage(p)), 'w') as f: with open(os.path.join(args.output, filenameforpage(p)), 'w') as f:
f.write(html) f.write(html)

@ -9,25 +9,36 @@ display: block;
justify-content: center*/ justify-content: center*/
color:#371F10; color:#371F10;
margin-left:200px; margin-left:200px;
margin-bottom: 100px;
} }
.projtext{ .projtext{
width: 85%; width: 80%;
display: block; display: block;
text-align: justify;
} }
h1{ h1{
display: block; font-size:50px;
width:50%; display: block;
width:65%;
text-align: left;
background-color: transparent;
right:auto;
position: relative;
padding: 0px;
top:0%;
z-index: 0;
margin:0px;
margin-top: 50px;
} }
h2{ h2{
display: block; font-size:23px;
width:70%; display: block;
text-align: justify; width:65%;
text-align: justify;
} }
.pagelink{ .pagelink{

@ -7,12 +7,12 @@ body {
position: fixed; position: fixed;
display: inline; display: inline;
left:0px; left:0px;
width:20px; /* width:20px;
height:20px; height:20px;*/
padding:10px; padding: 0px 5px 0px 5px;
background-color: white; background-color: white;
z-index: 10; z-index: 10;
font-size: 18px; font-size: 30px;
text-align: center; text-align: center;
border-top-style: solid; border-top-style: solid;
border-right-style: solid; border-right-style: solid;

@ -132,7 +132,7 @@ display: inline-block;
margin-top:-10px; margin-top:-10px;
/*vertical-align: top;*/ /*vertical-align: top;*/
line-height: 1.3; line-height: 1.3;
word-wrap:break-word word-wrap: break-word;
} }
.tooltip:hover .tooltiptext { .tooltip:hover .tooltiptext {
@ -293,3 +293,5 @@ margin-left: 40px;
height: 2px; height: 2px;
background-color: #0BEFEB; background-color: #0BEFEB;
} }
a.image {cursor: pointer!important;} /* KEEP THIS: show imgs as link in Overview */

@ -1,151 +1,115 @@
#top {
padding-top: 20px;
padding-left: 50px;
}
body { body {
background-color: #F4EBE8; background-color: #F4EBE8;
font-family: Roboto Mono; font-family: Roboto Mono;
font-size:11.5px; font-size:14px;
} }
/* Page title */
h1 { h1 {
position: fixed; position: fixed;
right:0%; right:0%;
top:3%; top:5%;
text-align: right; text-align: right;
background-color: #0BEFEB; background-color: #0BEFEB;
padding: 15px 85px 15px 30px; padding: 3px 35px 3px 10px;
z-index: 10;
color: #371F10;
font-size: 28px;
opacity: 0.7;
}
/*
h1 {
position: fixed;
right:0%;
top:3%;
text-align: right;
background-color: transparent;
padding: 10px 30px 30px 20px;
z-index: 10; z-index: 10;
color: black; color: black;
font-size: 28px; font-size: 28px;
border: 1px solid blue; opacity: 0.7;
border-right: none; color: #371F10;
} }
*/
/* Organizations list */
.collapsible{ .collapsible{
padding-left: 70px; padding-left: 70px;
line-height: 0%; line-height: 1;
color: #371F10; color: #371F10;
} }
.active, .collapsible:hover { .active, .collapsible:hover {
color: red; color: blue;
cursor: pointer; cursor: pointer;
} }
.active, .collapsible:after { .active, .collapsible:after {
padding-top: 10px; padding-top: 10px;
color: #054646;
padding-left: 85px; padding-left: 85px;
color: #371F10;
font-weight: bold;
} }
/* Droped-down publication links */
.content { .content {
max-height: 0; max-height: 0;
overflow: hidden; overflow: hidden;
transition: max-height 0.2s ease-out; transition: max-height 0.2s ease-out;
padding-left: 50px; padding-left: 50px;
background-color: #86a2a2; background-color: #371F10;
position: relative; position: relative;
line-height: 30px; line-height: 30px;
margin-left: 85px; margin-left: 85px;
color: white;
font-size: 14px;
} }
.up { .content a {
position: fixed; color:white;
font-weight: bolder; text-decoration: none;
bottom: 0%;
right: 15.1%;
background-color: blue;
z-index: 10;
padding: 10px;
border: none;
} }
.down { .content a:hover {
position: fixed; color: blue;
font-weight: bolder; cursor: pointer;
bottom: 0%;
right: 12.8%;
background-color: blue;
z-index: 10;
padding: 10px;
border: none;
} }
.top { /* Scroll column */
.scrollcolumn {
position: fixed; position: fixed;
font-weight: bolder; display: inline;
bottom: 0%; top:35%;
right: 17.3%; right:0%;
background-color: blue; width: 60px;
outline: none;
z-index: 10; z-index: 10;
padding: 10px; text-align: center;
border: none;
} }
.bottom { /* Scroll buttons */
position: fixed; .scrl {
font-weight: bolder; background-color: white;
bottom: 0%; cursor: pointer;
right: 10%; border:none;
background-color: blue; font-size: 15px;
z-index: 10; margin-top: 10px;
padding: 10px; height: 60px;
border: none; width: 60px;
} }
.indexlink { .scrl:hover {
position: fixed; background-color: #0BEFEB;
text-decoration: none;
font-size: 40px;
bottom: 0%;
right: 0%;
background-color: transparent;
border: none;
border-right-color: transparent;
z-index: 10;
padding: 0px 20px 10px 10px;
border: none;
} }
.timeline { /* Scroll button title */
position: fixed; .scbt {
font-size: 20px; visibility: hidden;
bottom: 0%; width: 120px;
right: 3%; background-color: black;
background-color: transparent; color: #fff;
border: none; text-align: center;
border-right-color: transparent; border-radius: 6px;
padding: 5px 0;
font-size: 15px;
right: 50px;
z-index: 10; z-index: 10;
padding: 0px 30px 20px 10px; position: absolute;
border: none;
}
.timeline a {
text-decoration: none;
}
.indexlink a {
text-decoration: none;
} }
#top { .scrl:hover > .scbt {
padding-top: 42px; visibility: visible;
}
.up:hover, .down:hover, .top:hover, .bottom:hover {
cursor: pointer;
color: white;
} }

@ -2,15 +2,16 @@ body {
background-color: #F4EBE8; background-color: #F4EBE8;
font-family: Roboto Mono; font-family: Roboto Mono;
} }
.grid-container { .grid-container {
display: grid; display: grid;
grid-template-columns: repeat(4, 1fr); grid-template-columns: repeat(4, 1fr);
grid-gap: 10px; grid-gap: 10px;
position: absolute; position: absolute;
top: 25%; top: 25%;
width: 82%; width: 82%;
height: auto; height: auto;
right: 8%; right: 8%;
text-align: : center; text-align: : center;
z-index: 5; z-index: 5;
@ -26,7 +27,6 @@ body {
position: relative; position: relative;
max-width: 100%; max-width: 100%;
max-height: 100%; max-height: 100%;
} }
@ -53,12 +53,13 @@ h1 {
right:0%; right:0%;
top:5%; top:5%;
text-align: right; text-align: right;
background-color: #0BEFEB; background-color: rgba(11,239,235,0.7);
padding: 3px 35px 3px 10px; padding: 3px 35px 3px 10px;
z-index: 10; z-index: 10;
color: black; color: black;
font-size: 28px; font-size: 27px;
opacity: 0.7; color: #371F10;
max-width: 90%;
} }
h2{ h2{
@ -66,18 +67,18 @@ h2{
right: 0%; right: 0%;
top: 15%; top: 15%;
text-align: left; text-align: left;
background-color: #0BEFEB; background-color: rgba(11,239,235,0.7);
/*color: black;*/
padding: 3px 35px 3px 10px; padding: 3px 35px 3px 10px;
z-index: 10; z-index: 10;
font-size: 20px; font-size: 20px;
opacity: 0.7; opacity: 0.7;
color: #371F10;
} }
.viewnav { .viewnav {
position: fixed; position: fixed;
bottom:0%; bottom: 0%;
left:0%; left: 0%;
background-color: transparent; background-color: transparent;
width: 10%; width: 10%;
z-index: 10; z-index: 10;
@ -86,7 +87,7 @@ h2{
.collapsible2 { .collapsible2 {
background-color: transparent; background-color: transparent;
color: black; color: red;
cursor: pointer; cursor: pointer;
padding: 0px; padding: 0px;
width: 100%; width: 100%;
@ -221,23 +222,10 @@ a.content:link {
color:white; color:white;
} }
/*.metadata_links {
display: inline-block;
width: 100%;
position: absolute;
right: 0%;
padding: 10px;
text-align: left;
background-color: blue;
font-size: 18px;
}*/
.metadata_organization { .metadata_organization {
font-size: 14px; font-size: 14px;
} }
.fbtn { .fbtn {
font-style: italic; font-style: italic;
} }
@ -245,7 +233,7 @@ a.content:link {
.smw-template-furtherresults { .smw-template-furtherresults {
display: none; display: none;
} }
/*
.orglink { .orglink {
position: fixed; position: fixed;
top: 30%; top: 30%;
@ -266,7 +254,7 @@ a.content:link {
padding: 5px 0; padding: 5px 0;
font-size: 15px; font-size: 15px;
/* Position the tooltip */
position: absolute; position: absolute;
left: 50px; left: 50px;
z-index: 10; z-index: 10;
@ -296,7 +284,7 @@ a.content:link {
padding: 5px 0; padding: 5px 0;
font-size: 15px; font-size: 15px;
/* Position the tooltip */
position: absolute; position: absolute;
left: 50px; left: 50px;
z-index: 10; z-index: 10;
@ -326,7 +314,7 @@ a.content:link {
padding: 5px 0; padding: 5px 0;
font-size: 15px; font-size: 15px;
/* Position the tooltip */
position: absolute; position: absolute;
left: 50px; left: 50px;
z-index: 10; z-index: 10;
@ -336,3 +324,4 @@ a.content:link {
visibility: visible; visibility: visible;
} }
*/

@ -10,13 +10,15 @@
<title>{{ page.name }}</title> <title>{{ page.name }}</title>
</head> </head>
<body> <body>
<h1>&#9636; &nbsp; {{ page.name }}</h1> <h1>&#9636; {{ page.name }}</h1>
<button onclick="scrollWin(0,5000)" class="down" title="Down">&#8991;</button>
<button onclick="scrollWin(0,-5000)" class="up" title="Up">&#8988;</button>
<button onclick="scrollToTop()" class="top" title="Top">&#9140;</button>
<button onclick="scrollToBottom()" class="bottom" title="Bottom">&#9141;</button>
<div class="scrollcolumn">
<button onclick="scrollWin(0,-5000)" class="up scrl">&#8988;<span class="scbt">Up</span></button>
<button onclick="scrollWin(0,5000)" class="down scrl">&#8991;<span class="scbt">Down</span></button>
<button onclick="scrollToTop()" class="top scrl">&#9140;<span class="scbt">Top</span></button>
<button onclick="scrollToBottom()" class="bottom scrl">&#9141;<span class="scbt">Bottom</span></button>
</div>
<div id="body">{{ body|safe }}</div> <div id="body">{{ body|safe }}</div>
<script> <script>

@ -14,11 +14,11 @@
<h1>{{ page.name }} &#8629;</h1> <h1>{{ page.name }} &#8629;</h1>
<div class="viewnav"> <div class="viewnav">
<div class="collapsible2 viewbtn">&#8632;</div> <div class="collapsible2 viewbtn">&#10063;</div>
<div class="content2"> <div class="content2">
<!-- <div class="header" id="myHeader"> --> <!-- <div class="header" id="myHeader"> -->
<p><button class="btn" onclick="myFunction()">100%</button></p> <p><button class="btn" onclick="myFunction()">&#9607;</button></p>
<p><button class="btn" onclick="myFunction2()">overview</button></p> <p><button class="btn" onclick="myFunction2()">&#9619;</button></p>
</div> </div>
</div> </div>
<div> <div>

Loading…
Cancel
Save