mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-15 07:34:27 -04:00
flip collapse and return to archive buttons
This commit is contained in:
parent
c4e0af84e7
commit
16b6e0b428
2 changed files with 59 additions and 58 deletions
|
@ -116,14 +116,14 @@
|
||||||
<table style="width:100%;height: 90%; overflow-y: scroll;table-layout: fixed">
|
<table style="width:100%;height: 90%; overflow-y: scroll;table-layout: fixed">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th style="width: 120px;">Bookmarked</th>
|
<th style="width: 80px;">Bookmarked</th>
|
||||||
<th style="width: 2vw;">Index</th>
|
<th style="width: 26px;">Info</th>
|
||||||
<th style="width: 43vw;">Saved Pages ($num_links)</th>
|
<th style="width: 26vw;">Saved Links ($num_links)</th>
|
||||||
<th style="width: 50px">PDF</th>
|
<th style="width: 30px">PDF</th>
|
||||||
<th style="width: 60px;font-size:0.8em;">Screenshot</th>
|
<th style="width: 30px;font-size:0.8em;">Screenshot</th>
|
||||||
<th style="width: 50px">DOM</th>
|
<th style="width: 30px">DOM</th>
|
||||||
<th style="width: 50px">A.org</th>
|
<th style="width: 30px">A.org</th>
|
||||||
<th style="width: 100px;whitespace:nowrap;overflow-x:scroll">Original URL</th>
|
<th style="width: 16vw;whitespace:nowrap;overflow-x:scroll">Original URL</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>$rows</tbody>
|
<tbody>$rows</tbody>
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
font-size: calc(16px + 1vw);
|
font-size: calc(16px + 1vw);
|
||||||
}
|
}
|
||||||
.collapse-icon {
|
.collapse-icon {
|
||||||
float: left;
|
float: right;
|
||||||
color: black;
|
color: black;
|
||||||
width: 126px;
|
width: 126px;
|
||||||
font-size: 0.8em;
|
font-size: 0.8em;
|
||||||
|
@ -36,7 +36,7 @@
|
||||||
margin-left: -35px;
|
margin-left: -35px;
|
||||||
}
|
}
|
||||||
.nav-icon img {
|
.nav-icon img {
|
||||||
float: right;
|
float: left;
|
||||||
display: block;
|
display: block;
|
||||||
margin-right: 13px;
|
margin-right: 13px;
|
||||||
color: black;
|
color: black;
|
||||||
|
@ -152,12 +152,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script
|
|
||||||
src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
|
|
||||||
integrity="sha256-k2WSCIexGzOj3Euiig+TlR8gA0EmPjuc79OEeY5L45g="
|
|
||||||
crossorigin="anonymous"></script>
|
|
||||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
|
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
|
||||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
|
@ -269,48 +264,54 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<iframe sandbox="allow-same-origin allow-scripts allow-forms" class="full-page-iframe" src="$wget" name="preview"></iframe>
|
<iframe sandbox="allow-same-origin allow-scripts allow-forms" class="full-page-iframe" src="$wget" name="preview"></iframe>
|
||||||
|
|
||||||
|
<script
|
||||||
|
src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
|
||||||
|
integrity="sha256-k2WSCIexGzOj3Euiig+TlR8gA0EmPjuc79OEeY5L45g="
|
||||||
|
crossorigin="anonymous"></script>
|
||||||
|
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// show selected file in iframe when preview card is clicked
|
||||||
|
jQuery('.card').on('click', function(e) {
|
||||||
|
jQuery('.selected-card').removeClass('selected-card')
|
||||||
|
jQuery(e.target).closest('.card').addClass('selected-card')
|
||||||
|
})
|
||||||
|
jQuery('.card a[target=preview]').on('click', function(e) {
|
||||||
|
if (e.currentTarget.href.endsWith('.pdf')) {
|
||||||
|
jQuery('.full-page-iframe')[0].removeAttribute('sandbox')
|
||||||
|
} else {
|
||||||
|
jQuery('.full-page-iframe')[0].sandbox = "allow-same-origin allow-scripts allow-forms"
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
})
|
||||||
|
|
||||||
|
// un-sandbox iframes showing pdfs (required to display pdf viewer)
|
||||||
|
jQuery('iframe').map(function() {
|
||||||
|
if (this.src.endsWith('.pdf')) {
|
||||||
|
this.removeAttribute('sandbox')
|
||||||
|
this.src = this.src
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// hide header when collapse icon is clicked
|
||||||
|
jQuery('.collapse-icon').on('click', function() {
|
||||||
|
if (jQuery('.collapse-icon').text().includes('▾')) {
|
||||||
|
jQuery('.collapse-icon').text('▸')
|
||||||
|
jQuery('.site-header').hide()
|
||||||
|
jQuery('.full-page-iframe').addClass('iframe-large')
|
||||||
|
} else {
|
||||||
|
jQuery('.collapse-icon').text('▾')
|
||||||
|
jQuery('.site-header').show()
|
||||||
|
jQuery('.full-page-iframe').removeClass('iframe-large')
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
})
|
||||||
|
|
||||||
|
// hide all preview iframes on small screens
|
||||||
|
if (window.innerWidth < 1091) {
|
||||||
|
jQuery('.card a[target=preview]').attr('target', '_self')
|
||||||
|
}
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
<script>
|
|
||||||
// show selected file in iframe when preview card is clicked
|
|
||||||
jQuery('.card').on('click', function(e) {
|
|
||||||
jQuery('.selected-card').removeClass('selected-card')
|
|
||||||
jQuery(e.target).closest('.card').addClass('selected-card')
|
|
||||||
})
|
|
||||||
jQuery('.card a[target=preview]').on('click', function(e) {
|
|
||||||
if (e.currentTarget.href.endsWith('.pdf')) {
|
|
||||||
jQuery('.full-page-iframe')[0].removeAttribute('sandbox')
|
|
||||||
} else {
|
|
||||||
jQuery('.full-page-iframe')[0].sandbox = "allow-same-origin allow-scripts allow-forms"
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
})
|
|
||||||
|
|
||||||
// un-sandbox iframes showing pdfs (required to display pdf viewer)
|
|
||||||
jQuery('iframe').map(function() {
|
|
||||||
if (this.src.endsWith('.pdf')) {
|
|
||||||
this.removeAttribute('sandbox')
|
|
||||||
this.src = this.src
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
// hide header when collapse icon is clicked
|
|
||||||
jQuery('.collapse-icon').on('click', function() {
|
|
||||||
if (jQuery('.collapse-icon').text().includes('▾')) {
|
|
||||||
jQuery('.collapse-icon').text('▸')
|
|
||||||
jQuery('.site-header').hide()
|
|
||||||
jQuery('.full-page-iframe').addClass('iframe-large')
|
|
||||||
} else {
|
|
||||||
jQuery('.collapse-icon').text('▾')
|
|
||||||
jQuery('.site-header').show()
|
|
||||||
jQuery('.full-page-iframe').removeClass('iframe-large')
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
})
|
|
||||||
|
|
||||||
// hide all preview iframes on small screens
|
|
||||||
if (window.innerWidth < 1091) {
|
|
||||||
jQuery('.card a[target=preview]').attr('target', '_self')
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue