housekeep: copy static files

we copy static files used by PHP and Python versions into /static

preparation work for the removal of the PHP version

Signed-off-by: moson-mo <mo-son@mailbox.org>
This commit is contained in:
moson-mo 2023-04-22 11:39:00 +02:00
parent 1325c71712
commit 97d0eac303
No known key found for this signature in database
GPG key ID: 4A4760AB4EE15296
27 changed files with 2874 additions and 5 deletions

View file

@ -79,11 +79,7 @@ async def app_startup():
"endpoint is disabled." "endpoint is disabled."
) )
app.mount("/static/css", StaticFiles(directory="web/html/css"), name="static_css") app.mount("/static", StaticFiles(directory="static"), name="static_files")
app.mount("/static/js", StaticFiles(directory="web/html/js"), name="static_js")
app.mount(
"/static/images", StaticFiles(directory="web/html/images"), name="static_images"
)
# Add application routes. # Add application routes.
def add_router(module): def add_router(module):

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

View file

@ -0,0 +1,26 @@
/*
* ARCH GLOBAL NAVBAR
* We're forcing all generic selectors with !important
* to help prevent other stylesheets from interfering.
*/
/* container for the entire bar */
#archnavbar { min-height: 40px !important; padding: 10px 15px !important; background: #333 !important; border-bottom: 5px #08c solid !important; }
#archnavbarlogo { background: url('archlogo.png') no-repeat !important; }
/* move the heading/paragraph text offscreen */
#archnavbarlogo p { margin: 0 !important; padding: 0 !important; text-indent: -9999px !important; }
#archnavbarlogo h1 { margin: 0 !important; padding: 0 !important; text-indent: -9999px !important; }
/* make the link the same size as the logo */
#archnavbarlogo a { display: block !important; height: 40px !important; width: 190px !important; }
/* display the list inline, float it to the right and style it */
[dir="rtl"] #archnavbar ul { text-align: left !important; }
#archnavbar ul { display: block !important; list-style: none !important; margin: 0 !important; padding: 0 !important; font-size: 0px !important; text-align: right !important; }
[dir="rtl"] #archnavbar ul li { padding: 14px 0px 0px 15px !important; }
#archnavbar ul li { display: inline-block !important; font-size: 14px !important; font-family: sans-serif !important; line-height: 14px !important; padding: 14px 15px 0px !important; }
/* style the links */
#archnavbar ul#archnavbarlist li a { color: #999; font-weight: bold !important; text-decoration: none !important; }
#archnavbar ul li a:hover { color: white !important; text-decoration: underline !important; }

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

1255
static/css/archweb.css Normal file

File diff suppressed because it is too large Load diff

292
static/css/aurweb.css Normal file
View file

@ -0,0 +1,292 @@
/* aurweb-specific customizations to archweb.css */
#archnavbar.anb-aur ul li#anb-aur a {
color: white !important;
}
#archnavbarlogo {
background: url('archnavbar/aurlogo.png') !important;
}
[dir="rtl"] #lang_sub {
float: left;
}
#lang_sub {
float: right;
}
.pkglist-nav .page {
margin: 0 .25em;
}
#pkg-stats td.stat-desc {
white-space: normal;
}
#actionlist form {
margin: 0;
padding: 0;
}
.arch-bio-entry ul {
list-style: none;
padding: 0;
}
#pkg-updates table {
table-layout: fixed;
width:100%;
}
#pkg-updates td.pkg-name {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
[dir="rtl"] #pkg-updates td.pkg-date {
text-align:left;
}
#pkg-updates td.pkg-date {
text-align:right;
}
[dir="rtl"] .keyword:link, .keyword:visited {
float: right;
}
.keyword:link, .keyword:visited {
float: left;
margin: 1px .5ex 1px 0;
padding: 0 1em;
color: white;
background-color: #36a;
border: 1px solid transparent;
border-radius: 2px;
}
.keyword:hover {
cursor: pointer;
}
.keyword:focus {
border: 1px dotted #000;
}
.text-button {
background: transparent;
border: none !important;
margin: 0 !important;
padding: 0 !important;
font: normal 100% sans-serif;
text-decoration: none;
color: #07b;
cursor: pointer;
}
.text-button:hover {
text-decoration: underline;
color: #666;
}
.text-button::-moz-focus-inner {
padding: 0;
border: none;
}
.comment-deleted {
color: #999;
}
.edited {
font-size: 0.9em;
color: #999;
}
[dir="rtl"] .delete-comment-form, .undelete-comment-form, .pin-comment-form, .edit-comment {
float: left;
margin-right: 8px;
}
.delete-comment-form, .undelete-comment-form, .pin-comment-form, .edit-comment {
float: right;
margin-left: 8px;
}
.edit-comment {
height: 11px;
position: relative;
top: 1px;
}
.comment-enable-notifications {
display: inline-block;
margin-left: 1em;
}
.rss-icon, .delete-comment, .undelete-comment, .edit-comment, .pin-comment {
filter: grayscale(100%);
opacity: 0.6;
}
.rss-icon:hover, .delete-comment:hover, .undelete-comment:hover, .edit-comment:hover, .pin-comment:hover {
filter: none;
opacity: 1;
}
[dir="rtl"] .ajax-loader {
float: left;
}
.ajax-loader {
float: right;
position: relative;
top: 4px;
}
.flagged a {
color: inherit;
}
legend {
padding: 1em 0;
}
p.important {
font-weight: bold;
}
span.hover-help {
border-bottom: 1px dotted black;
cursor:help;
}
label.confirmation {
width: auto;
}
#pkgdepslist .broken {
color: red;
font-weight: bold;
}
.package-comments {
margin-top: 1.5em;
}
.comments-header {
display: flex;
justify-content: space-between;
align-items: flex-start;
}
/* arrowed headings */
.comments-header h3 span.text {
display: block;
background: #1794D1;
font-size: 15px;
padding: 2px 10px;
color: white;
}
.comments-header .comments-header-nav {
align-self: flex-end;
}
.comments-footer {
display: flex;
justify-content: flex-end;
}
.comment-header {
clear: both;
font-size: 1em;
margin-top: 1.5em;
border-bottom: 1px dotted #bbb;
}
.comments div {
margin-bottom: 1em;
}
.comments div p {
margin-bottom: 0.5em;
}
.comments .more {
font-weight: normal;
}
.error {
color: red;
}
.article-content > div {
overflow: hidden;
transition: height 1s;
}
.proposal.details {
margin: .33em 0 1em;
}
button[type="submit"],
button[type="reset"] {
padding: 0 0.6em;
}
.results tr td[align="left"] fieldset {
text-align: left;
}
.results tr td[align="right"] fieldset {
text-align: right;
}
input#search-action-submit {
width: 80px;
}
.success {
color: green;
}
/* Styling used to clone <a> styles for a form.link button. */
form.link, form.link button {
display: inline;
font-family: sans-serif;
}
form.link button {
padding: 0 0.5em;
color: #07b;
background: none;
border: none;
font-family: inherit;
font-size: inherit;
}
form.link button:hover {
cursor: pointer;
text-decoration: underline;
}
/* Customize form.link when used inside of a page. */
div.box form.link p {
margin: .33em 0 1em;
}
div.box form.link button {
padding: 0;
}
pre.traceback {
/* https://css-tricks.com/snippets/css/make-pre-text-wrap/ */
white-space: pre-wrap;
word-wrap: break-all;
}
/* By default, tables use 100% width, which we do not always want. */
table.no-width {
width: auto;
}
table.no-width > tbody > tr > td {
padding-right: 2px;
}

866
static/css/cgit.css Normal file
View file

@ -0,0 +1,866 @@
/*
* ARCH GLOBAL NAVBAR
* We're forcing all generic selectors with !important
* to help prevent other stylesheets from interfering.
*/
/* container for the entire bar */
#archnavbar { height: 40px !important; padding: 10px 15px !important; background: #333 !important; border-bottom: 5px #08c solid !important; }
#archnavbarlogo { float: left !important; margin: 0 !important; padding: 0 !important; height: 40px !important; width: 190px !important; background: url('archnavbar/archlogo.png') no-repeat !important; }
/* move the heading text offscreen */
#archnavbarlogo h1 { margin: 0 !important; padding: 0 !important; text-indent: -9999px !important; }
/* make the link the same size as the logo */
#archnavbarlogo a { display: block !important; height: 40px !important; width: 190px !important; }
/* display the list inline, float it to the right and style it */
#archnavbarlist { display: inline !important; float: right !important; list-style: none !important; margin: 0 !important; padding: 0 !important; }
#archnavbarlist li { float: left !important; font-size: 14px !important; font-family: sans-serif !important; line-height: 45px !important; padding-right: 15px !important; padding-left: 15px !important; }
/* style the links */
#archnavbarlist li a { color: #999; font-weight: bold !important; text-decoration: none !important; }
#archnavbarlist li a:hover { color: white !important; text-decoration: underline !important; }
/* END ARCH GLOBAL NAVBAR */
#footer {
clear: both;
margin: 0;
}
#footer p {
margin: 1em;
}
#archnavbar.anb-aur ul li#anb-aur a {
color: white !important;
}
#archnavbarlogo {
background: url('archnavbar/aurlogo.png') !important;
}
body {
padding: 0;
margin: 0;
font-family: sans-serif;
font-size: 10pt;
color: #333;
background: white;
}
div#cgit a {
color: blue;
text-decoration: none;
}
div#cgit a:hover {
text-decoration: underline;
}
div#cgit table {
border-collapse: collapse;
}
div#cgit table#header {
width: 100%;
margin-bottom: 1em;
}
div#cgit table#header td.logo {
width: 96px;
vertical-align: top;
}
div#cgit table#header td.main {
font-size: 250%;
padding-left: 10px;
white-space: nowrap;
}
div#cgit table#header td.main a {
color: #000;
}
div#cgit table#header td.form {
text-align: right;
vertical-align: bottom;
padding-right: 1em;
padding-bottom: 2px;
white-space: nowrap;
}
div#cgit table#header td.form form,
div#cgit table#header td.form input,
div#cgit table#header td.form select {
font-size: 90%;
}
div#cgit table#header td.sub {
color: #777;
border-top: solid 1px #ccc;
padding-left: 10px;
}
div#cgit table.tabs {
border-bottom: solid 3px #ccc;
border-collapse: collapse;
margin-top: 2em;
margin-bottom: 0px;
width: 100%;
}
div#cgit table.tabs td {
padding: 0px 1em;
vertical-align: bottom;
}
div#cgit table.tabs td a {
padding: 2px 0.75em;
color: #777;
font-size: 110%;
}
div#cgit table.tabs td a.active {
color: #000;
background-color: #ccc;
}
div#cgit table.tabs td.form {
text-align: right;
}
div#cgit table.tabs td.form form {
padding-bottom: 2px;
font-size: 90%;
white-space: nowrap;
}
div#cgit table.tabs td.form input,
div#cgit table.tabs td.form select {
font-size: 90%;
}
div#cgit div.path {
margin: 0px;
padding: 5px 2em 2px 2em;
color: #000;
background-color: #eee;
}
div#cgit div.content {
margin: 0px;
padding: 2em;
border-bottom: solid 3px #ccc;
}
div#cgit table.list {
width: 100%;
border: none;
border-collapse: collapse;
}
div#cgit table.list tr {
background: white;
}
div#cgit table.list tr.logheader {
background: #eee;
}
div#cgit table.list tr:hover {
background: #eee;
}
div#cgit table.list tr.nohover:hover {
background: white;
}
div#cgit table.list th {
font-weight: bold;
/* color: #888;
border-top: dashed 1px #888;
border-bottom: dashed 1px #888;
*/
padding: 0.1em 0.5em 0.05em 0.5em;
vertical-align: baseline;
}
div#cgit table.list td {
border: none;
padding: 0.1em 0.5em 0.1em 0.5em;
}
div#cgit table.list td.commitgraph {
font-family: monospace;
white-space: pre;
}
div#cgit table.list td.commitgraph .column1 {
color: #a00;
}
div#cgit table.list td.commitgraph .column2 {
color: #0a0;
}
div#cgit table.list td.commitgraph .column3 {
color: #aa0;
}
div#cgit table.list td.commitgraph .column4 {
color: #00a;
}
div#cgit table.list td.commitgraph .column5 {
color: #a0a;
}
div#cgit table.list td.commitgraph .column6 {
color: #0aa;
}
div#cgit table.list td.logsubject {
font-family: monospace;
font-weight: bold;
}
div#cgit table.list td.logmsg {
font-family: monospace;
white-space: pre;
padding: 0 0.5em;
}
div#cgit table.list td a {
color: black;
}
div#cgit table.list td a.ls-dir {
font-weight: bold;
color: #00f;
}
div#cgit table.list td a:hover {
color: #00f;
}
div#cgit img {
border: none;
}
div#cgit input#switch-btn {
margin: 2px 0px 0px 0px;
}
div#cgit td#sidebar input.txt {
width: 100%;
margin: 2px 0px 0px 0px;
}
div#cgit table#grid {
margin: 0px;
}
div#cgit td#content {
vertical-align: top;
padding: 1em 2em 1em 1em;
border: none;
}
div#cgit div#summary {
vertical-align: top;
margin-bottom: 1em;
}
div#cgit table#downloads {
float: right;
border-collapse: collapse;
border: solid 1px #777;
margin-left: 0.5em;
margin-bottom: 0.5em;
}
div#cgit table#downloads th {
background-color: #ccc;
}
div#cgit div#blob {
border: solid 1px black;
}
div#cgit div.error {
color: red;
font-weight: bold;
margin: 1em 2em;
}
div#cgit a.ls-blob, div#cgit a.ls-dir, div#cgit a.ls-mod {
font-family: monospace;
}
div#cgit td.ls-size {
text-align: right;
font-family: monospace;
width: 10em;
}
div#cgit td.ls-mode {
font-family: monospace;
width: 10em;
}
div#cgit table.blob {
margin-top: 0.5em;
border-top: solid 1px black;
}
div#cgit table.blob td.lines {
margin: 0; padding: 0 0 0 0.5em;
vertical-align: top;
color: black;
}
div#cgit table.blob td.linenumbers {
margin: 0; padding: 0 0.5em 0 0.5em;
vertical-align: top;
text-align: right;
border-right: 1px solid gray;
}
div#cgit table.blob pre {
padding: 0; margin: 0;
}
div#cgit table.blob a.no, div#cgit table.ssdiff a.no {
color: gray;
text-align: right;
text-decoration: none;
}
div#cgit table.blob a.no a:hover {
color: black;
}
div#cgit table.bin-blob {
margin-top: 0.5em;
border: solid 1px black;
}
div#cgit table.bin-blob th {
font-family: monospace;
white-space: pre;
border: solid 1px #777;
padding: 0.5em 1em;
}
div#cgit table.bin-blob td {
font-family: monospace;
white-space: pre;
border-left: solid 1px #777;
padding: 0em 1em;
}
div#cgit table.nowrap td {
white-space: nowrap;
}
div#cgit table.commit-info {
border-collapse: collapse;
margin-top: 1.5em;
}
div#cgit div.cgit-panel {
float: right;
margin-top: 1.5em;
}
div#cgit div.cgit-panel table {
border-collapse: collapse;
border: solid 1px #aaa;
background-color: #eee;
}
div#cgit div.cgit-panel th {
text-align: center;
}
div#cgit div.cgit-panel td {
padding: 0.25em 0.5em;
}
div#cgit div.cgit-panel td.label {
padding-right: 0.5em;
}
div#cgit div.cgit-panel td.ctrl {
padding-left: 0.5em;
}
div#cgit table.commit-info th {
text-align: left;
font-weight: normal;
padding: 0.1em 1em 0.1em 0.1em;
vertical-align: top;
}
div#cgit table.commit-info td {
font-weight: normal;
padding: 0.1em 1em 0.1em 0.1em;
}
div#cgit div.commit-subject {
font-weight: bold;
font-size: 125%;
margin: 1.5em 0em 0.5em 0em;
padding: 0em;
}
div#cgit div.commit-msg {
white-space: pre;
font-family: monospace;
}
div#cgit div.notes-header {
font-weight: bold;
padding-top: 1.5em;
}
div#cgit div.notes {
white-space: pre;
font-family: monospace;
border: solid 1px #ee9;
background-color: #ffd;
padding: 0.3em 2em 0.3em 1em;
float: left;
}
div#cgit div.notes-footer {
clear: left;
}
div#cgit div.diffstat-header {
font-weight: bold;
padding-top: 1.5em;
}
div#cgit table.diffstat {
border-collapse: collapse;
border: solid 1px #aaa;
background-color: #eee;
}
div#cgit table.diffstat th {
font-weight: normal;
text-align: left;
text-decoration: underline;
padding: 0.1em 1em 0.1em 0.1em;
font-size: 100%;
}
div#cgit table.diffstat td {
padding: 0.2em 0.2em 0.1em 0.1em;
font-size: 100%;
border: none;
}
div#cgit table.diffstat td.mode {
white-space: nowrap;
}
div#cgit table.diffstat td span.modechange {
padding-left: 1em;
color: red;
}
div#cgit table.diffstat td.add a {
color: green;
}
div#cgit table.diffstat td.del a {
color: red;
}
div#cgit table.diffstat td.upd a {
color: blue;
}
div#cgit table.diffstat td.graph {
width: 500px;
vertical-align: middle;
}
div#cgit table.diffstat td.graph table {
border: none;
}
div#cgit table.diffstat td.graph td {
padding: 0px;
border: 0px;
height: 7pt;
}
div#cgit table.diffstat td.graph td.add {
background-color: #5c5;
}
div#cgit table.diffstat td.graph td.rem {
background-color: #c55;
}
div#cgit div.diffstat-summary {
color: #888;
padding-top: 0.5em;
}
div#cgit table.diff {
width: 100%;
}
div#cgit table.diff td {
font-family: monospace;
white-space: pre;
}
div#cgit table.diff td div.head {
font-weight: bold;
margin-top: 1em;
color: black;
}
div#cgit table.diff td div.hunk {
color: #009;
}
div#cgit table.diff td div.add {
color: green;
}
div#cgit table.diff td div.del {
color: red;
}
div#cgit .sha1 {
font-family: monospace;
font-size: 90%;
}
div#cgit .left {
text-align: left;
}
div#cgit .right {
text-align: right;
float: none !important;
width: auto !important;
padding: 0 !important;
}
div#cgit table.list td.reposection {
font-style: italic;
color: #888;
}
div#cgit a.button {
font-size: 80%;
padding: 0em 0.5em;
}
div#cgit a.primary {
font-size: 100%;
}
div#cgit a.secondary {
font-size: 90%;
}
div#cgit td.toplevel-repo {
}
div#cgit table.list td.sublevel-repo {
padding-left: 1.5em;
}
div#cgit ul.pager {
list-style-type: none;
text-align: center;
margin: 1em 0em 0em 0em;
padding: 0;
}
div#cgit ul.pager li {
display: inline-block;
margin: 0.25em 0.5em;
}
div#cgit ul.pager a {
color: #777;
}
div#cgit ul.pager .current {
font-weight: bold;
}
div#cgit span.age-mins {
font-weight: bold;
color: #080;
}
div#cgit span.age-hours {
color: #080;
}
div#cgit span.age-days {
color: #040;
}
div#cgit span.age-weeks {
color: #444;
}
div#cgit span.age-months {
color: #888;
}
div#cgit span.age-years {
color: #bbb;
}
div#cgit div.footer {
margin-top: 0.5em;
text-align: center;
font-size: 80%;
color: #ccc;
}
div#cgit a.branch-deco {
color: #000;
margin: 0px 0.5em;
padding: 0px 0.25em;
background-color: #88ff88;
border: solid 1px #007700;
}
div#cgit a.tag-deco {
color: #000;
margin: 0px 0.5em;
padding: 0px 0.25em;
background-color: #ffff88;
border: solid 1px #777700;
}
div#cgit a.remote-deco {
color: #000;
margin: 0px 0.5em;
padding: 0px 0.25em;
background-color: #ccccff;
border: solid 1px #000077;
}
div#cgit a.deco {
color: #000;
margin: 0px 0.5em;
padding: 0px 0.25em;
background-color: #ff8888;
border: solid 1px #770000;
}
div#cgit div.commit-subject a.branch-deco,
div#cgit div.commit-subject a.tag-deco,
div#cgit div.commit-subject a.remote-deco,
div#cgit div.commit-subject a.deco {
margin-left: 1em;
font-size: 75%;
}
div#cgit table.stats {
border: solid 1px black;
border-collapse: collapse;
}
div#cgit table.stats th {
text-align: left;
padding: 1px 0.5em;
background-color: #eee;
border: solid 1px black;
}
div#cgit table.stats td {
text-align: right;
padding: 1px 0.5em;
border: solid 1px black;
}
div#cgit table.stats td.total {
font-weight: bold;
text-align: left;
}
div#cgit table.stats td.sum {
color: #c00;
font-weight: bold;
/* background-color: #eee; */
}
div#cgit table.stats td.left {
text-align: left;
}
div#cgit table.vgraph {
border-collapse: separate;
border: solid 1px black;
height: 200px;
}
div#cgit table.vgraph th {
background-color: #eee;
font-weight: bold;
border: solid 1px white;
padding: 1px 0.5em;
}
div#cgit table.vgraph td {
vertical-align: bottom;
padding: 0px 10px;
}
div#cgit table.vgraph div.bar {
background-color: #eee;
}
div#cgit table.hgraph {
border: solid 1px black;
width: 800px;
}
div#cgit table.hgraph th {
background-color: #eee;
font-weight: bold;
border: solid 1px black;
padding: 1px 0.5em;
}
div#cgit table.hgraph td {
vertical-align: middle;
padding: 2px 2px;
}
div#cgit table.hgraph div.bar {
background-color: #eee;
height: 1em;
}
div#cgit table.ssdiff {
width: 100%;
}
div#cgit table.ssdiff td {
font-size: 75%;
font-family: monospace;
white-space: pre;
padding: 1px 4px 1px 4px;
border-left: solid 1px #aaa;
border-right: solid 1px #aaa;
}
div#cgit table.ssdiff td.add {
color: black;
background: #cfc;
min-width: 50%;
}
div#cgit table.ssdiff td.add_dark {
color: black;
background: #aca;
min-width: 50%;
}
div#cgit table.ssdiff span.add {
background: #cfc;
font-weight: bold;
}
div#cgit table.ssdiff td.del {
color: black;
background: #fcc;
min-width: 50%;
}
div#cgit table.ssdiff td.del_dark {
color: black;
background: #caa;
min-width: 50%;
}
div#cgit table.ssdiff span.del {
background: #fcc;
font-weight: bold;
}
div#cgit table.ssdiff td.changed {
color: black;
background: #ffc;
min-width: 50%;
}
div#cgit table.ssdiff td.changed_dark {
color: black;
background: #cca;
min-width: 50%;
}
div#cgit table.ssdiff td.lineno {
color: black;
background: #eee;
text-align: right;
width: 3em;
min-width: 3em;
}
div#cgit table.ssdiff td.hunk {
color: black;
background: #ccf;
border-top: solid 1px #aaa;
border-bottom: solid 1px #aaa;
}
div#cgit table.ssdiff td.head {
border-top: solid 1px #aaa;
border-bottom: solid 1px #aaa;
}
div#cgit table.ssdiff td.head div.head {
font-weight: bold;
color: black;
}
div#cgit table.ssdiff td.foot {
border-top: solid 1px #aaa;
border-left: none;
border-right: none;
border-bottom: none;
}
div#cgit table.ssdiff td.space {
border: none;
}
div#cgit table.ssdiff td.space div {
min-height: 3em;
}
/*
* Style definitions generated by highlight 3.14, http://www.andre-simon.de/
* Highlighting theme: Kwrite Editor
*/
div#cgit table.blob .num { color:#b07e00; }
div#cgit table.blob .esc { color:#ff00ff; }
div#cgit table.blob .str { color:#bf0303; }
div#cgit table.blob .pps { color:#818100; }
div#cgit table.blob .slc { color:#838183; font-style:italic; }
div#cgit table.blob .com { color:#838183; font-style:italic; }
div#cgit table.blob .ppc { color:#008200; }
div#cgit table.blob .opt { color:#000000; }
div#cgit table.blob .ipl { color:#0057ae; }
div#cgit table.blob .lin { color:#555555; }
div#cgit table.blob .kwa { color:#000000; font-weight:bold; }
div#cgit table.blob .kwb { color:#0057ae; }
div#cgit table.blob .kwc { color:#000000; font-weight:bold; }
div#cgit table.blob .kwd { color:#010181; }

View file

@ -0,0 +1,26 @@
The icons used in aurweb originate from the Open Iconic project and are
licensed under the following terms:
----
The MIT License (MIT)
Copyright (c) 2014 Waybury
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
----

View file

@ -0,0 +1,3 @@
<svg xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" height="8" width="8" version="1.1" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" viewBox="0 0 8 8">
<path d="m4.5 0c-1.93 0-3.5 1.57-3.5 3.5v0.5h-1l2 2 2-2h-1v-0.5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5c0-1.93-1.57-3.5-3.5-3.5z" transform="translate(0 1)" fill="#36a"/>
</svg>

After

Width:  |  Height:  |  Size: 415 B

View file

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
version="1.1"
id="svg2"
viewBox="0 0 8 8"
height="8"
width="8">
<metadata
id="metadata10">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs8" />
<path
style="fill:#3366aa;fill-opacity:1"
id="path4"
transform="translate(0 1)"
d="M4.5 0c-1.93 0-3.5 1.57-3.5 3.5v.5h-1l2 2 2-2h-1v-.5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5c0-1.93-1.57-3.5-3.5-3.5z" />
</svg>

After

Width:  |  Height:  |  Size: 924 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 723 B

BIN
static/images/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 575 B

View file

@ -0,0 +1,3 @@
<svg xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" height="8" width="8" version="1.1" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" viewBox="0 0 8 8">
<path fill="#36a" d="m6 0l-1 1 2 2 1-1-2-2zm-2 2l-4 4v2h2l4-4-2-2z"/>
</svg>

After

Width:  |  Height:  |  Size: 313 B

55
static/images/pencil.svg Normal file
View file

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="8"
height="8"
viewBox="0 0 8 8"
id="svg2"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="pencil-arch.svg">
<metadata
id="metadata10">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs8" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="659"
inkscape:window-height="480"
id="namedview6"
showgrid="false"
inkscape:zoom="29.5"
inkscape:cx="4"
inkscape:cy="4"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="0"
inkscape:current-layer="svg2" />
<path
d="M6 0l-1 1 2 2 1-1-2-2zm-2 2l-4 4v2h2l4-4-2-2z"
id="path4"
style="fill:#3366aa;fill-opacity:1" />
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="8" height="8" viewBox="0 0 8 8"><path style="fill:#3366aa;fill-opacity:1" d="M1.34 0a.5.5 0 0 0 .16 1h.5v2h-1c-.55 0-1 .45-1 1h3v3l.44 1 .56-1v-3h3c0-.55-.45-1-1-1h-1v-2h.5a.5.5 0 1 0 0-1h-4a.5.5 0 0 0-.09 0 .5.5 0 0 0-.06 0z" /></svg>

After

Width:  |  Height:  |  Size: 283 B

3
static/images/pin.svg Normal file
View file

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="8" height="8" viewBox="0 0 8 8">
<path style="fill:#3366aa;fill-opacity:1" d="M1.34 0a.5.5 0 0 0 .16 1h.5v2h-1c-.55 0-1 .45-1 1h3v3l.44 1 .56-1v-3h3c0-.55-.45-1-1-1h-1v-2h.5a.5.5 0 1 0 0-1h-4a.5.5 0 0 0-.09 0 .5.5 0 0 0-.06 0z" />
</svg>

After

Width:  |  Height:  |  Size: 287 B

3
static/images/rss.svg Normal file
View file

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="8" height="8" viewBox="0 0 8 8">
<path style="fill:#3366aa;fill-opacity:1" d="M0 0v2c3.33 0 6 2.67 6 6h2c0-4.41-3.59-8-8-8zm0 3v2c1.67 0 3 1.33 3 3h2c0-2.75-2.25-5-5-5zm0 3v2h2c0-1.11-.9-2-2-2z" />
</svg>

After

Width:  |  Height:  |  Size: 254 B

View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="8" height="8" viewBox="0 0 8 8"><path style="fill:#3366aa;fill-opacity:1" d="M1.34 0a.5.5 0 0 0 .16 1h.5v2h-1c-.55 0-1 .45-1 1h3v3l.44 1 .56-1v-3h3c0-.55-.45-1-1-1h-1v-2h.5a.5.5 0 1 0 0-1h-4a.5.5 0 0 0-.09 0 .5.5 0 0 0-.06 0z" /><path style="fill:#3366aa;fill-opacity:1" d="m6.4 0l1 1-6.4 6.8-1-1z" /></svg>

After

Width:  |  Height:  |  Size: 355 B

4
static/images/unpin.svg Normal file
View file

@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" width="8" height="8" viewBox="0 0 8 8">
<path style="fill:#3366aa;fill-opacity:1" d="M1.34 0a.5.5 0 0 0 .16 1h.5v2h-1c-.55 0-1 .45-1 1h3v3l.44 1 .56-1v-3h3c0-.55-.45-1-1-1h-1v-2h.5a.5.5 0 1 0 0-1h-4a.5.5 0 0 0-.09 0 .5.5 0 0 0-.06 0z" />
<path style="fill:#3366aa;fill-opacity:1" d="m6.4 0l1 1 -6.4 6.8 -1 -1z" />
</svg>

After

Width:  |  Height:  |  Size: 365 B

3
static/images/x.min.svg Normal file
View file

@ -0,0 +1,3 @@
<svg xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 8 8" height="8" width="8" version="1.1" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/">
<path fill="#36a" d="m1.41 0l-1.41 1.41 0.72 0.72 1.78 1.81-1.78 1.78-0.72 0.69 1.41 1.44 0.72-0.72 1.81-1.81 1.78 1.81 0.69 0.72 1.44-1.44-0.72-0.69-1.81-1.78 1.81-1.81 0.72-0.72-1.44-1.41-0.69 0.72-1.78 1.78-1.81-1.78-0.72-0.72z"/>
</svg>

After

Width:  |  Height:  |  Size: 477 B

31
static/images/x.svg Normal file
View file

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
version="1.1"
id="svg2"
viewBox="0 0 8 8"
height="8"
width="8">
<metadata
id="metadata10">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs8" />
<path
style="fill:#3366aa;fill-opacity:1"
id="path4"
d="M1.41 0l-1.41 1.41.72.72 1.78 1.81-1.78 1.78-.72.69 1.41 1.44.72-.72 1.81-1.81 1.78 1.81.69.72 1.44-1.44-.72-.69-1.81-1.78 1.81-1.81.72-.72-1.44-1.41-.69.72-1.78 1.78-1.81-1.78-.72-.72z" />
</svg>

After

Width:  |  Height:  |  Size: 959 B

61
static/js/comment-edit.js Normal file
View file

@ -0,0 +1,61 @@
function add_busy_indicator(sibling) {
const img = document.createElement('img');
img.src = "/static/images/ajax-loader.gif";
img.classList.add('ajax-loader');
img.style.height = 11;
img.style.width = 16;
img.alt = "Busy…";
sibling.insertAdjacentElement('afterend', img);
}
function remove_busy_indicator(sibling) {
const elem = sibling.nextElementSibling;
elem.parentNode.removeChild(elem);
}
function getParentsUntil(elem, className) {
// Limit to 10 depth
for ( ; elem && elem !== document; elem = elem.parentNode) {
if (elem.matches(className)) {
break;
}
}
return elem;
}
function handleEditCommentClick(event, pkgbasename) {
event.preventDefault();
const parent_element = getParentsUntil(event.target, '.comment-header');
const parent_id = parent_element.id;
const comment_id = parent_id.substr(parent_id.indexOf('-') + 1);
// The div class="article-content" which contains the comment
const edit_form = parent_element.nextElementSibling;
const url = "/pkgbase/" + pkgbasename + "/comments/" + comment_id + "/form?";
add_busy_indicator(event.target);
fetch(url + new URLSearchParams({ next: window.location.pathname }), {
method: 'GET',
credentials: 'same-origin'
})
.then(function(response) {
if (!response.ok) {
throw Error(response.statusText);
}
return response.json();
})
.then(function(data) {
remove_busy_indicator(event.target);
edit_form.innerHTML = data.form;
edit_form.querySelector('textarea').focus();
})
.catch(function(error) {
remove_busy_indicator(event.target);
console.error(error);
});
return false;
}

9
static/js/copy.js Normal file
View file

@ -0,0 +1,9 @@
document.addEventListener('DOMContentLoaded', function() {
let elements = document.querySelectorAll('.copy');
elements.forEach(function(el) {
el.addEventListener('click', function(e) {
e.preventDefault();
navigator.clipboard.writeText(e.target.text);
});
});
});

View file

@ -0,0 +1,6 @@
document.addEventListener('DOMContentLoaded', function() {
const input = document.getElementById('pkgsearch-field');
const form = document.getElementById('pkgsearch-form');
const type = 'suggest';
typeahead.init(type, input, form);
});

View file

@ -0,0 +1,6 @@
document.addEventListener('DOMContentLoaded', function() {
const input = document.getElementById('merge_into');
const form = document.getElementById('merge-form');
const type = "suggest-pkgbase";
typeahead.init(type, input, form, false);
});

View file

@ -0,0 +1,36 @@
function showHideMergeSection() {
const elem = document.getElementById('id_type');
const merge_section = document.getElementById('merge_section');
if (elem.value == 'merge') {
merge_section.style.display = '';
} else {
merge_section.style.display = 'none';
}
}
function showHideRequestHints() {
document.getElementById('deletion_hint').style.display = 'none';
document.getElementById('merge_hint').style.display = 'none';
document.getElementById('orphan_hint').style.display = 'none';
const elem = document.getElementById('id_type');
document.getElementById(elem.value + '_hint').style.display = '';
}
document.addEventListener('DOMContentLoaded', function() {
showHideMergeSection();
showHideRequestHints();
const input = document.getElementById('id_merge_into');
const form = document.getElementById('request-form');
const type = "suggest-pkgbase";
typeahead.init(type, input, form, false);
});
// Bind the change event here, otherwise we have to inline javascript,
// which angers CSP (Content Security Policy).
document.getElementById("id_type").addEventListener("change", function() {
showHideMergeSection();
showHideRequestHints();
});

151
static/js/typeahead.js Normal file
View file

@ -0,0 +1,151 @@
"use strict";
const typeahead = (function() {
var input;
var form;
var suggest_type;
var list;
var submit = true;
function resetResults() {
if (!list) return;
list.style.display = "none";
list.innerHTML = "";
}
function getCompleteList() {
if (!list) {
list = document.createElement("UL");
list.setAttribute("class", "pkgsearch-typeahead");
form.appendChild(list);
setListLocation();
}
return list;
}
function onListClick(e) {
let target = e.target;
while (!target.getAttribute('data-value')) {
target = target.parentNode;
}
input.value = target.getAttribute('data-value');
if (submit) {
form.submit();
}
}
function setListLocation() {
if (!list) return;
const rects = input.getClientRects()[0];
list.style.top = (rects.top + rects.height) + "px";
list.style.left = rects.left + "px";
}
function loadData(letter, data) {
const pkgs = data.slice(0, 10); // Show maximum of 10 results
resetResults();
if (pkgs.length === 0) {
return;
}
const ul = getCompleteList();
ul.style.display = "block";
const fragment = document.createDocumentFragment();
for (let i = 0; i < pkgs.length; i++) {
const item = document.createElement("li");
const text = pkgs[i].replace(letter, '<b>' + letter + '</b>');
item.innerHTML = '<a href="#">' + text + '</a>';
item.setAttribute('data-value', pkgs[i]);
fragment.appendChild(item);
}
ul.appendChild(fragment);
ul.addEventListener('click', onListClick);
}
function fetchData(letter) {
const url = '/rpc?v=5&type=' + suggest_type + '&arg=' + letter;
fetch(url).then(function(response) {
return response.json();
}).then(function(data) {
loadData(letter, data);
});
}
function onInputClick() {
if (input.value === "") {
resetResults();
return;
}
fetchData(input.value);
}
function onKeyDown(e) {
if (!list) return;
const elem = document.querySelector(".pkgsearch-typeahead li.active");
switch(e.keyCode) {
case 13: // enter
if (!submit) {
return;
}
if (elem) {
input.value = elem.getAttribute('data-value');
form.submit();
} else {
form.submit();
}
e.preventDefault();
break;
case 38: // up
if (elem && elem.previousElementSibling) {
elem.className = "";
elem.previousElementSibling.className = "active";
}
e.preventDefault();
break;
case 40: // down
if (elem && elem.nextElementSibling) {
elem.className = "";
elem.nextElementSibling.className = "active";
} else if (!elem && list.childElementCount !== 0) {
list.children[0].className = "active";
}
e.preventDefault();
break;
}
}
// debounce https://davidwalsh.name/javascript-debounce-function
function debounce(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
var later = function() {
timeout = null;
if (!immediate) func.apply(context, args);
};
var callNow = immediate && !timeout;
clearTimeout(timeout);
timeout = setTimeout(later, wait);
if (callNow) func.apply(context, args);
};
}
return {
init: function(type, inputfield, formfield, submitdata = true) {
suggest_type = type;
input = inputfield;
form = formfield;
submit = submitdata;
input.addEventListener("input", onInputClick);
input.addEventListener("keydown", onKeyDown);
window.addEventListener('resize', debounce(setListLocation, 150));
document.addEventListener("click", resetResults);
}
}
}());