Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9125627
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
14 KB
Subscribers
None
View Options
diff --git a/swh/web/static/css/style.css b/swh/web/static/css/style.css
index 7b10ac82..fd18c46d 100644
--- a/swh/web/static/css/style.css
+++ b/swh/web/static/css/style.css
@@ -1,505 +1,511 @@
/*
version: 0.1
date: 21/09/15
author: swh
email: swh
website: softwareheritage.org
version history: /style.css
*/
@import url(https://fonts.googleapis.com/css?family=Alegreya:400,400italic,700,700italic);
@import url(https://fonts.googleapis.com/css?family=Alegreya+Sans:400,400italic,500,500italic,700,700italic,100,300,100italic,300italic);
html {
height: 100%;
}
body {
font-family: 'Alegreya Sans', sans-serif;
font-size: 1.7rem;
line-height: 1.5;
color: rgba(0, 0, 0, 0.55);
padding-bottom: 120px;
min-height: 100%;
margin: 0;
position: relative;
}
.heading {
font-family: 'Alegreya', serif;
}
.shell, .text {
font-size: 0.7em;
}
.logo img {
max-height: 40px;
}
.logo .navbar-brand {
padding: 5px;
}
.logo .sitename {
padding: 15px 5px;
}
.jumbotron {
padding: 0;
background-color: rgba(0, 0, 0, 0);
position: fixed;
top: 0;
width: 100%;
z-index: 10;
}
#swh-navbar-collapse {
border-top-style: none;
border-left-style: none;
border-right-style: none;
border-bottom: 5px solid;
border-image: linear-gradient(to right, rgb(226, 0, 38) 0%, rgb(254, 205, 27) 100%) 1 1 1 1;
width: 100%;
padding: 5px;
}
.nav-horizontal {
float: right;
}
h3[id], h4[id], a[id] { /* avoid in-page links covered by navbar */
padding-top: 80px;
margin-top: -70px;
}
h1, h2, h3, h4 {
margin: 0;
color: #e20026;
padding-bottom: 10px;
}
h1 { font-size: 1.8em; }
h2 { font-size: 1.2em; }
h3 { font-size: 1.1em; }
a {
color: rgba(0, 0, 0, 0.75);
border-bottom-style: dotted;
border-bottom-width: 1px;
border-bottom-color: rgb(91, 94, 111);
}
a:hover {
color: black;
}
ul.dropdown-menu a,
.navbar-header a,
ul.navbar-nav a { /* No decoration on links in dropdown menu */
border-bottom-style: none;
color: #323232;
font-weight: 700;
}
.navbar-header a:hover,
ul.navbar-nav a:hover {
color: #8f8f8f;
}
.sitename .first-word, .sitename .second-word {
color: rgba(0, 0, 0, 0.75);
font-weight: normal;
font-size: 1.8rem;
}
.sitename .first-word {
font-family: 'Alegreya Sans', sans-serif;
}
.sitename .second-word {
font-family: 'Alegreya', serif;
}
ul.dropdown-menu > li,
ul.dropdown-menu > li > ul > li { /* No decoration on bullet points in dropdown menu */
list-style-type: none;
}
.page {
margin: 2em auto;
width: 35em;
border: 5px solid #ccc;
padding: 0.8em;
background: white;
}
.entries {
list-style: none;
margin: 0;
padding: 0;
}
.entries li {
margin: 0.8em 1.2em;
}
.entries li h2 {
margin-left: -1em;
}
.add-entry {
font-size: 0.9em;
border-bottom: 1px solid #ccc;
}
.add-entry dl {
font-weight: bold;
}
.metanav {
text-align: right;
font-size: 0.8em;
padding: 0.3em;
margin-bottom: 1em;
background: #fafafa;
}
.flash {
background: #cee5F5;
padding: 0.5em;
border: 1px solid #aacbe2;
}
.error {
background: #f0d6d6;
padding: 0.5em;
}
.file-found {
color: #23BA49;
}
.file-notfound {
color: #FF4747;
}
/* Bootstrap custom styling to correctly render multiple
* form-controls in an input-group:
* github.com/twbs/bootstrap/issues/12732 */
.input-group-field {
display: table-cell;
vertical-align: middle;
border-radius:4px;
min-width:1%;
white-space: nowrap;
}
.input-group-field .form-control {
border-radius: inherit !important;
}
.input-group-field:not(:first-child):not(:last-child) {
border-radius:0;
}
.input-group-field:not(:first-child):not(:last-child) .form-control {
border-left-width: 0;
border-right-width: 0;
}
.input-group-field:last-child {
border-top-left-radius:0;
border-bottom-left-radius:0;
}
.input-group > span:not(:last-child) > button {
border-radius: 0;
}
.multi-input-group > .input-group-btn {
vertical-align: bottom;
padding: 0;
}
.dataTables_filter {
margin-top: 15px;
}
.dataTables_filter input {
width: 70%;
float: right;
}
tr.api-doc-route-upcoming > td, tr.api-doc-route-upcoming > td > a {
font-size: 90%;
}
tr.api-doc-route-deprecated > td, tr.api-doc-route-deprecated > td > a {
color: red;
}
#back-to-top {
display: initial;
position: fixed;
bottom: 30px;
right: 30px;
z-index: 10;
}
#back-to-top a img {
display: block;
width: 32px;
height: 32px;
background-size: 32px 32px;
text-indent: -999px;
overflow: hidden;
}
.table > thead > tr > th {
border-bottom: 1px solid #e20026;
}
.table > tbody > tr > td {
border-style: none;
}
pre {
background-color: #f5f5f5;
}
.dataTables_wrapper {
position: static;
}
/* breadcrumbs */
.bread-crumbs{
display: inline-block;
overflow: hidden;
color: rgba(0, 0, 0, 0.55);
}
bread-crumbs ul {
list-style-type: none;
}
.bread-crumbs li {
float: left;
list-style-type: none;
}
.bread-crumbs a {
color: rgba(0, 0, 0, 0.75);
border-bottom-style: none;
}
.bread-crumbs a:hover {
color: rgba(0, 0, 0, 0.85);
text-decoration: underline;
}
.title-small .bread-crumbs{
margin: -30px 0 25px;
}
#footer {
background-color: #262626;
color: hsl(0, 0%, 100%);
font-size: 1.2rem;
text-align: center;
padding-top: 20px;
padding-bottom: 20px;
position: absolute;
bottom: 0;
left: 0;
right: 0;
}
#footer a,
#footer a:visited {
color: hsl(0, 0%, 100%);
}
#footer a:hover {
text-decoration: underline;
}
.highlightjs pre {
background-color: transparent;
border-radius: 0px;
border-color: transparent;
}
.hljs {
background-color: transparent;
white-space: pre;
}
.scrollable-menu {
max-height: 180px;
overflow-x: hidden;
}
.swh-browse-top-navigation {
border-bottom: 1px solid #ddd;
min-height: 42px;
padding: 4px 5px 0px 5px;
}
.swh-browse-bread-crumbs {
font-size: inherit;
vertical-align: text-top;
margin-bottom: 1px;
}
.swh-browse-bread-crumbs li:nth-child(n+2)::before {
content: "";
display: inline-block;
margin: 0 2px;
}
.swh-metadata-table-row {
border-top: 1px solid #ddd !important;
}
/* for block of numbers */
td.hljs-ln-numbers {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
text-align: center;
color: #ccc;
border-right: 1px solid #CCC;
vertical-align: top;
padding-right: 5px;
/* your custom style here */
}
/* for block of code */
td.hljs-ln-code {
padding-left: 10px;
}
.btn-swh {
color: #6C6C6C;
background-color: #EAEAEA;
border-color: #ddd;
background-image: linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);
background-repeat: repeat-x;
outline: none;
}
.btn-swh:hover,
.btn-swh:focus,
.btn-swh:active,
.btn-swh.active,
.open .dropdown-toggle.btn-swh {
background-color: #e6ebf1;
background-image: linear-gradient(to bottom,#f1f1f1 0,#e6e6e6 100%);
border-color: rgb(197, 197, 197);
}
.btn-swh.disabled,
.btn-swh[disabled],
fieldset[disabled] .btn-swh,
.btn-swh.disabled:hover,
.btn-swh[disabled]:hover,
fieldset[disabled] .btn-swh:hover,
.btn-swh.disabled:focus,
.btn-swh[disabled]:focus,
fieldset[disabled] .btn-swh:focus,
.btn-swh.disabled:active,
.btn-swh[disabled]:active,
fieldset[disabled] .btn-swh:active,
.btn-swh.disabled.active,
.btn-swh[disabled].active,
fieldset[disabled] .btn-swh.active {
background-color: #EAEAEA;
border-color: #EAEAEA;
}
.btn-swh .badge {
color: #EAEAEA;
background-color: #6C6C6C;
}
.swh-http-error {
margin: 0 auto;
text-align: center;
}
.swh-http-error-head {
color: #2d353c;
font-size: 30px;
}
.swh-http-error-code {
bottom: 60%;
color: #2d353c;
font-size: 96px;
line-height: 80px;
margin-bottom: 10px!important;
}
.swh-http-error-desc {
font-size: 12px;
color: #647788;
text-align: center;
}
.swh-http-error-desc pre {
display: inline-block;
text-align: left;
max-width: 800px;
white-space: pre-wrap;
}
.swh-table {
border-bottom: none !important;
}
.swh-counter {
font-size: 150%;
}
.swh-loading {
display : none;
}
.swh-loading.show {
display:inline-block;
position: fixed;
background: white;
border: 1px solid black;
top: 50%;
left: 50%;
margin: -50px 0px 0px -50px;
text-align: center;
z-index:100;
}
.swh-readme a {
outline: none;
border: none;
}
.swh-readme table {
border-collapse: collapse;
}
.swh-readme table,
.swh-readme table th,
.swh-readme table td {
padding: 6px 13px;
border: 1px solid #dfe2e5;
}
.swh-readme table tr:nth-child(even) {
background-color: #f2f2f2;
}
.swh-web-app-link:hover {
background-color: #efeff2;
}
.swh-web-app-link a {
text-decoration: none;
outline: none;
border: none;
}
.pager a {
outline: none;
+}
+
+.swh-content {
+ background-image: none;
+ border: none;
+ background-color: white;
}
\ No newline at end of file
diff --git a/swh/web/templates/content.html b/swh/web/templates/content.html
index ce138d99..48f9be72 100644
--- a/swh/web/templates/content.html
+++ b/swh/web/templates/content.html
@@ -1,133 +1,133 @@
{% extends "browse.html" %}
{% load static %}
{% block header %}
<script src="{% static 'js/highlightjs/dist/highlight.pack.js' %}"></script>
<script src="{% static 'js/highlightjs-line-numbers/dist/highlightjs-line-numbers.min.js' %}"></script>
<script>
// empty hljs language definition
function no_highlight(hljs) {
return {}
}
// just a trick to get line numbers working when no highlight
// has to be performed
hljs.registerLanguage('nohighlight-swh', no_highlight);
// keep track of the first highlighted line
var first_hl_line = null;
// highlighting color
var line_hl_color = 'rgb(193, 255, 193)';
// function to highlight a line
function highlight_line(i) {
var line_td = $('div[data-line-number="' + i + '"]').parent().parent();
line_td.css('background-color', line_hl_color);
return line_td;
}
- function removeHash () {
+ function remove_hash () {
history.pushState("", document.title, window.location.pathname + window.location.search);
}
// function to reset highlighting
function reset_highlighted_lines() {
first_hl_line = null;
$('tr').css('background-color', 'inherit');
}
- function scrollToLine(lineDomElt) {
+ function scroll_to_line(lineDomElt) {
$('html, body').animate({
scrollTop: $(lineDomElt).offset().top - 70
}, 500);
}
// function to highlight lines based on a url fragment
// in the form '#Lx' or '#Lx-Ly'
function parse_url_fragment_for_lines_to_highlight() {
var lines = [];
var lines_regexp = new RegExp(/L(\d+)/g);
var line = lines_regexp.exec(window.location.hash);
while (line) {
lines.push(parseInt(line[1]));
line = lines_regexp.exec(window.location.hash);
}
reset_highlighted_lines();
if (lines.length == 1) {
first_hl_line = parseInt(lines[0]);
- scrollToLine(highlight_line(lines[0]));
+ scroll_to_line(highlight_line(lines[0]));
} else if (lines[0] < lines[lines.length - 1]) {
first_hl_line = parseInt(lines[0]);
- scrollToLine(highlight_line(lines[0]));
+ scroll_to_line(highlight_line(lines[0]));
for (var i = lines[0]+1; i <= lines[lines.length - 1]; ++i) {
highlight_line(i);
}
}
}
$(document).ready(function() {
// highlight code and add line numbers
$('code').each(function(i, block) {
hljs.highlightBlock(block);
hljs.lineNumbersBlock(block);
});
// click handler to dynamically highlight line(s)
// when the user clicks on a line number (lines range
// can also be highlighted while holding the shift key)
$('body').click(function(evt) {
if (evt.target.classList.contains('hljs-ln-n')) {
var line = parseInt($(evt.target).data('line-number'));
if (evt.shiftKey && first_hl_line && line > first_hl_line) {
var first_line = first_hl_line;
reset_highlighted_lines();
for (var i = first_line; i <= line; ++i) {
highlight_line(i);
}
first_hl_line = first_line;
window.location.hash = '#L' + first_line + "-L" + line;
} else {
reset_highlighted_lines();
highlight_line(line);
window.location.hash = '#L' + line;
- scrollToLine(evt.target);
+ scroll_to_line(evt.target);
}
} else {
reset_highlighted_lines();
- removeHash();
+ remove_hash();
}
});
// update lines highlighting when the url fragment changes
$(window).on('hashchange', function() {
parse_url_fragment_for_lines_to_highlight();
});
// highlight lines specified by an url fragment
parse_url_fragment_for_lines_to_highlight();
});
</script>
<link rel="stylesheet" href="{% static 'css/highlightjs/github.css' %}">
{% endblock %}
{% block swh-browse-main-panel-content %}
{% include "includes/top-navigation.html" %}
-<div class="well well-sm" style="margin-bottom: 0px">
+<div class="well well-sm swh-content" style="margin-bottom: 0px">
{% if "inode/x-empty" == mimetype %}
<i>File is empty</i>
{% elif "text/" in mimetype %}
<div class="highlightjs">
<pre>
<code class="{{ language }}">{{ content }}</code>
</pre>
</div>
{% elif "image/" in mimetype and content %}
<img src="data:{{ mimetype }};base64,{{ content }}"/>
{% else %}
Content with mime type {{ mimetype }} can not be displayed
{% endif %}
</div>
{% endblock %}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Jun 21, 9:08 PM (4 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3351178
Attached To
rDWAPPS Web applications
Event Timeline
Log In to Comment