Migrate to bootstrap 4 and fontawesome 5
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
3acde1749b
commit
1aa968299a
5 changed files with 438 additions and 183 deletions
3
Makefile
3
Makefile
|
@ -1,5 +1,6 @@
|
||||||
generate: l10n
|
generate: l10n
|
||||||
coffee -c frontend/application.coffee
|
docker run --rm -ti -v $(CURDIR):$(CURDIR) -w $(CURDIR) node \
|
||||||
|
bash -c "npm install -g coffeescript && coffee -c frontend/application.coffee && chown -R $(shell id -u) frontend"
|
||||||
go generate
|
go generate
|
||||||
|
|
||||||
l10n:
|
l10n:
|
||||||
|
|
416
assets.go
416
assets.go
File diff suppressed because one or more lines are too long
|
@ -29,11 +29,11 @@ hashLoad = () ->
|
||||||
if hash.length == 0
|
if hash.length == 0
|
||||||
return
|
return
|
||||||
|
|
||||||
$('#panelNewSecret').hide()
|
$('#cardNewSecret').hide()
|
||||||
$('#panelSecretURL').hide()
|
$('#cardSecretURL').hide()
|
||||||
$('#notfound').hide()
|
$('#notfound').hide()
|
||||||
$('#somethingwrong').hide()
|
$('#somethingwrong').hide()
|
||||||
$('#panelReadSecretPre').show()
|
$('#cardReadSecretPre').show()
|
||||||
|
|
||||||
requestSecret = () ->
|
requestSecret = () ->
|
||||||
hash = window.location.hash
|
hash = window.location.hash
|
||||||
|
@ -67,12 +67,12 @@ secretCreated = (data) ->
|
||||||
secretHash = "#{secretHash}|#{securePassword}"
|
secretHash = "#{secretHash}|#{securePassword}"
|
||||||
url = "#{location.href.split('#')[0]}##{secretHash}"
|
url = "#{location.href.split('#')[0]}##{secretHash}"
|
||||||
|
|
||||||
$('#panelNewSecret').hide()
|
$('#cardNewSecret').hide()
|
||||||
$('#panelReadSecretPre').hide()
|
$('#cardReadSecretPre').hide()
|
||||||
$('#panelSecretURL').show()
|
$('#cardSecretURL').show()
|
||||||
$('#panelSecretURL').find('input').val url
|
$('#cardSecretURL').find('input').val url
|
||||||
$('#panelSecretURL').find('input').focus()
|
$('#cardSecretURL').find('input').focus()
|
||||||
$('#panelSecretURL').find('input').select()
|
$('#cardSecretURL').find('input').select()
|
||||||
|
|
||||||
securePassword = null
|
securePassword = null
|
||||||
|
|
||||||
|
@ -81,13 +81,13 @@ showData = (data) ->
|
||||||
if securePassword != null
|
if securePassword != null
|
||||||
secret = GibberishAES.dec(secret, securePassword)
|
secret = GibberishAES.dec(secret, securePassword)
|
||||||
|
|
||||||
$('#panelNewSecret').hide()
|
$('#cardNewSecret').hide()
|
||||||
$('#panelSecretURL').hide()
|
$('#cardSecretURL').hide()
|
||||||
$('#notfound').hide()
|
$('#notfound').hide()
|
||||||
$('#somethingwrong').hide()
|
$('#somethingwrong').hide()
|
||||||
$('#panelReadSecretPre').hide()
|
$('#cardReadSecretPre').hide()
|
||||||
$('#panelReadSecret').show()
|
$('#cardReadSecret').show()
|
||||||
$('#panelReadSecret').find('textarea').val secret
|
$('#cardReadSecret').find('textarea').val secret
|
||||||
|
|
||||||
somethingWrong = () ->
|
somethingWrong = () ->
|
||||||
$('#somethingwrong').show()
|
$('#somethingwrong').show()
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Generated by CoffeeScript 1.12.4
|
// Generated by CoffeeScript 2.3.0
|
||||||
(function() {
|
(function() {
|
||||||
var createSecret, dataNotFound, hashLoad, initBinds, newSecret, requestSecret, secretCreated, securePassword, showData, somethingWrong;
|
var createSecret, dataNotFound, hashLoad, initBinds, newSecret, requestSecret, secretCreated, securePassword, showData, somethingWrong;
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@
|
||||||
400: somethingWrong,
|
400: somethingWrong,
|
||||||
500: somethingWrong,
|
500: somethingWrong,
|
||||||
404: function() {
|
404: function() {
|
||||||
|
// Mock for interface testing
|
||||||
return secretCreated({
|
return secretCreated({
|
||||||
secret_id: 'foobar'
|
secret_id: 'foobar'
|
||||||
});
|
});
|
||||||
|
@ -38,11 +39,11 @@
|
||||||
if (hash.length === 0) {
|
if (hash.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$('#panelNewSecret').hide();
|
$('#cardNewSecret').hide();
|
||||||
$('#panelSecretURL').hide();
|
$('#cardSecretURL').hide();
|
||||||
$('#notfound').hide();
|
$('#notfound').hide();
|
||||||
$('#somethingwrong').hide();
|
$('#somethingwrong').hide();
|
||||||
return $('#panelReadSecretPre').show();
|
return $('#cardReadSecretPre').show();
|
||||||
};
|
};
|
||||||
|
|
||||||
requestSecret = function() {
|
requestSecret = function() {
|
||||||
|
@ -55,7 +56,7 @@
|
||||||
securePassword = parts[1];
|
securePassword = parts[1];
|
||||||
}
|
}
|
||||||
id = hash.substring(1);
|
id = hash.substring(1);
|
||||||
return $.ajax("api/get/" + id, {
|
return $.ajax(`api/get/${id}`, {
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
statusCode: {
|
statusCode: {
|
||||||
404: dataNotFound,
|
404: dataNotFound,
|
||||||
|
@ -80,15 +81,15 @@
|
||||||
var secretHash, url;
|
var secretHash, url;
|
||||||
secretHash = data.secret_id;
|
secretHash = data.secret_id;
|
||||||
if (securePassword !== null) {
|
if (securePassword !== null) {
|
||||||
secretHash = secretHash + "|" + securePassword;
|
secretHash = `${secretHash}|${securePassword}`;
|
||||||
}
|
}
|
||||||
url = (location.href.split('#')[0]) + "#" + secretHash;
|
url = `${(location.href.split('#')[0])}#${secretHash}`;
|
||||||
$('#panelNewSecret').hide();
|
$('#cardNewSecret').hide();
|
||||||
$('#panelReadSecretPre').hide();
|
$('#cardReadSecretPre').hide();
|
||||||
$('#panelSecretURL').show();
|
$('#cardSecretURL').show();
|
||||||
$('#panelSecretURL').find('input').val(url);
|
$('#cardSecretURL').find('input').val(url);
|
||||||
$('#panelSecretURL').find('input').focus();
|
$('#cardSecretURL').find('input').focus();
|
||||||
$('#panelSecretURL').find('input').select();
|
$('#cardSecretURL').find('input').select();
|
||||||
return securePassword = null;
|
return securePassword = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -98,13 +99,13 @@
|
||||||
if (securePassword !== null) {
|
if (securePassword !== null) {
|
||||||
secret = GibberishAES.dec(secret, securePassword);
|
secret = GibberishAES.dec(secret, securePassword);
|
||||||
}
|
}
|
||||||
$('#panelNewSecret').hide();
|
$('#cardNewSecret').hide();
|
||||||
$('#panelSecretURL').hide();
|
$('#cardSecretURL').hide();
|
||||||
$('#notfound').hide();
|
$('#notfound').hide();
|
||||||
$('#somethingwrong').hide();
|
$('#somethingwrong').hide();
|
||||||
$('#panelReadSecretPre').hide();
|
$('#cardReadSecretPre').hide();
|
||||||
$('#panelReadSecret').show();
|
$('#cardReadSecret').show();
|
||||||
return $('#panelReadSecret').find('textarea').val(secret);
|
return $('#cardReadSecret').find('textarea').val(secret);
|
||||||
};
|
};
|
||||||
|
|
||||||
somethingWrong = function() {
|
somethingWrong = function() {
|
||||||
|
|
|
@ -1,70 +1,52 @@
|
||||||
<!DOCTYPE html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
|
<!-- Required meta tags -->
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
|
|
||||||
<title>OTS - One Time Secrets</title>
|
|
||||||
|
|
||||||
<!-- Bootstrap -->
|
<!-- Bootstrap -->
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css"
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0/css/bootstrap.min.css"
|
||||||
integrity="sha256-r1WijW/SNMgOwk5LDk7QRHr6oVYYbYWMw/1kOXfYJfg=" crossorigin="anonymous" />
|
integrity="sha256-LA89z+k9fjgMKQ/kq4OO2Mrf8VltYml/VES+Rg0fh20=" crossorigin="anonymous" />
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/4.1.1/flatly/bootstrap.min.css"
|
||||||
integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
|
integrity="sha256-Aq7aBPqZwiUM2fHchlRaVD7RFsEBto+K77fvREGjnHU=" crossorigin="anonymous" />
|
||||||
|
|
||||||
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
|
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.12/css/all.css"
|
||||||
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
|
integrity="sha384-G0fIWCsCzJIMAVNQPfjH08cyYaUtMwjJwqiRKxxE/rx96Uroj1BtIQ6MLJuheaO9" crossorigin="anonymous">
|
||||||
<!--[if lt IE 9]>
|
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"
|
<title>OTS - One Time Secrets</title>
|
||||||
integrity="sha256-3Jy/GbSLrg0o9y5Z5n1uw0qxZECH7C6OQpVBgNFYa0g=" crossorigin="anonymous"></script>
|
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js"
|
|
||||||
integrity="sha256-g6iAfvZp+nDQ2TdTR/VVKJf3bGro4ub5fvWSWVRi2NE=" crossorigin="anonymous"></script>
|
|
||||||
<![endif]-->
|
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
#somethingwrong, #notfound, #panelReadSecret, #panelSecretURL, #panelReadSecretPre {
|
#somethingwrong, #notfound, #cardReadSecret, #cardSecretURL, #cardReadSecretPre { display: none; }
|
||||||
display: none;
|
.footer { color: #2f2f2f; font-size: 0.9em; text-align: center; }
|
||||||
}
|
|
||||||
.footer {
|
|
||||||
font-size: 0.9em;
|
|
||||||
text-align: center;
|
|
||||||
color: #2f2f2f;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<nav class="navbar navbar-default">
|
|
||||||
<div class="container-fluid">
|
|
||||||
<!-- Brand and toggle get grouped for better mobile display -->
|
|
||||||
<div class="navbar-header">
|
|
||||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
|
|
||||||
<span class="sr-only">Toggle navigation</span>
|
|
||||||
<span class="icon-bar"></span>
|
|
||||||
<span class="icon-bar"></span>
|
|
||||||
<span class="icon-bar"></span>
|
|
||||||
</button>
|
|
||||||
<a class="navbar-brand" href="#">OTS - One Time Secrets</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Collect the nav links, forms, and other content for toggling -->
|
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
|
||||||
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
|
<a class="navbar-brand" href="#"><i class="fas fa-user-secret"></i> OTS - One Time Secrets</a>
|
||||||
<ul class="nav navbar-nav navbar-right">
|
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
<li><a href="#" id="newSecret"><i class="fa fa-plus"></i> {{T "btn-new-secret"}}</a></li>
|
<span class="navbar-toggler-icon"></span>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||||
|
<ul class="navbar-nav ml-auto">
|
||||||
|
<li class="nav-item"></li>
|
||||||
|
<li class="nav-item"><a href="#" id="newSecret"><i class="fas fa-plus"></i> {{T "btn-new-secret"}}</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div><!-- /.navbar-collapse -->
|
</div>
|
||||||
</div><!-- /.container-fluid -->
|
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<div class="container">
|
<div class="container mt-4">
|
||||||
<div class="row">
|
<div class="row justify-content-center">
|
||||||
<div class="col-md-8 col-md-push-2">
|
<div class="col-md-8">
|
||||||
<div class="alert alert-danger" role="alert" id="notfound">
|
<div class="alert alert-danger" role="alert" id="notfound">
|
||||||
<i class="fa fa-question-circle" aria-hidden="true"></i>
|
<i class="fas fa-question-circle" aria-hidden="true"></i>
|
||||||
{{T "alert-secret-not-found"}}
|
{{T "alert-secret-not-found"}}
|
||||||
</div>
|
</div>
|
||||||
<div class="alert alert-danger" role="alert" id="somethingwrong">
|
<div class="alert alert-danger" role="alert" id="somethingwrong">
|
||||||
<i class="fa fa-question-circle" aria-hidden="true"></i>
|
<i class="fas fa-question-circle" aria-hidden="true"></i>
|
||||||
{{T "alert-something-went-wrong"}}
|
{{T "alert-something-went-wrong"}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -73,11 +55,11 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
|
|
||||||
<div class="panel panel-primary" id="panelNewSecret">
|
<div class="card border-primary" id="cardNewSecret">
|
||||||
<div class="panel-heading">
|
<div class="card-header bg-primary text-white">
|
||||||
<h3 class="panel-title">{{T "title-new-secret"}}</h3>
|
{{T "title-new-secret"}}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="card-body">
|
||||||
<form id="formCreateSecret">
|
<form id="formCreateSecret">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="secret">{{T "label-secret-data"}}</label>
|
<label for="secret">{{T "label-secret-data"}}</label>
|
||||||
|
@ -88,11 +70,11 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="panel panel-success" id="panelSecretURL">
|
<div class="card border-success" id="cardSecretURL">
|
||||||
<div class="panel-heading">
|
<div class="card-header bg-success text-white">
|
||||||
<h3 class="panel-title">{{T "title-secret-created"}}</h3>
|
{{T "title-secret-created"}}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="card-body">
|
||||||
<p>
|
<p>
|
||||||
{{T "text-pre-url"}}
|
{{T "text-pre-url"}}
|
||||||
</p>
|
</p>
|
||||||
|
@ -105,11 +87,11 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="panel panel-primary" id="panelReadSecretPre">
|
<div class="card border-primary" id="cardReadSecretPre">
|
||||||
<div class="panel-heading">
|
<div class="card-header bg-primary text-white">
|
||||||
<h3 class="panel-title">{{T "title-reading-secret"}}</h3>
|
{{T "title-reading-secret"}}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="card-body">
|
||||||
<p>
|
<p>
|
||||||
{{T "text-pre-reveal-hint"}}
|
{{T "text-pre-reveal-hint"}}
|
||||||
</p>
|
</p>
|
||||||
|
@ -120,11 +102,11 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="panel panel-primary" id="panelReadSecret">
|
<div class="card border-primary" id="cardReadSecret">
|
||||||
<div class="panel-heading">
|
<div class="card-header bg-primary text-white">
|
||||||
<h3 class="panel-title">{{T "title-reading-secret"}}</h3>
|
{{T "title-reading-secret"}}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="card-body">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<textarea class="form-control" rows="5" readonly></textarea>
|
<textarea class="form-control" rows="5" readonly></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
@ -138,19 +120,20 @@
|
||||||
</div> <!-- /.col-md-12 -->
|
</div> <!-- /.col-md-12 -->
|
||||||
</div> <!-- /.row -->
|
</div> <!-- /.row -->
|
||||||
|
|
||||||
<div class="row">
|
<div class="row mt-5">
|
||||||
<div class="col-md-12 footer">
|
<div class="col-md-12 footer">
|
||||||
{{T "text-powered-by"}} <a href="https://github.com/Luzifer/ots"><i class="fa fa-github"></i> Luzifer/OTS</a> {{.version}}
|
{{T "text-powered-by"}} <a href="https://github.com/Luzifer/ots"><i class="fab fa-github"></i> Luzifer/OTS</a> {{.version}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js"
|
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
|
||||||
integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.1/popper.min.js"
|
||||||
<!-- Include all compiled plugins (below), or include individual files as needed -->
|
integrity="sha256-ST2MecrXrJaAsqmfpk9XRQITlDoyMmUtgKBEndDisSc=" crossorigin="anonymous"></script>
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js"
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0/js/bootstrap.min.js"
|
||||||
integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
|
integrity="sha256-5+02zu5UULQkO7w1GIr6vftCgMfFdZcAHeDtFnKZsBs=" crossorigin="anonymous"></script>
|
||||||
|
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/gibberish-aes/1.0.0/gibberish-aes.min.js"
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/gibberish-aes/1.0.0/gibberish-aes.min.js"
|
||||||
integrity="sha256-H9B/XRDijNiF3agVjtiz1ILVi3csEdGz9YBg5TjWouM=" crossorigin="anonymous"></script>
|
integrity="sha256-H9B/XRDijNiF3agVjtiz1ILVi3csEdGz9YBg5TjWouM=" crossorigin="anonymous"></script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue