remaking the GUI

This commit is contained in:
Micah Lee 2014-06-08 13:15:39 -04:00
parent 5475038d79
commit 6603f3be39
5 changed files with 63 additions and 57 deletions

View File

@ -54,7 +54,7 @@ def launch_window(webapp_port, onionshare_port):
window = gtk.Window() window = gtk.Window()
window.set_title('OnionShare') window.set_title('OnionShare')
window.resize(550, 300) window.resize(520, 400)
window.set_resizable(False) window.set_resizable(False)
window.connect('destroy', on_destroy) window.connect('destroy', on_destroy)

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -2,15 +2,11 @@ $(function(){
var onionshare = {} var onionshare = {}
function update($msg) { function update($msg) {
var $line = $('<p></p>').append($msg); var $line = $('<li>').append($msg);
$('#output').append($line); $('#log').append($line);
// scroll to bottom // scroll to bottom
$('#output').scrollTop($('#output').height()); $('#log').scrollTop($('#log').height());
}
function linebreak() {
update($('<hr>'));
} }
function copy_to_clipboard() { function copy_to_clipboard() {
@ -54,18 +50,13 @@ $(function(){
onionshare = JSON.parse(data); onionshare = JSON.parse(data);
$('#basename').html(onionshare.basename); $('#basename').html(onionshare.basename);
update(onionshare.strings['sha1_checksum']+": "+onionshare.filehash); //update(onionshare.strings['sha1_checksum']+": "+onionshare.filehash);
linebreak();
update(onionshare.strings['give_this_url']); update(onionshare.strings['give_this_url']);
update($('<strong>').html(onionshare.url)); update($('<strong>').html(onionshare.url));
linebreak();
copy_to_clipboard(); copy_to_clipboard();
$('#copy-button').show(); $('#copy-button').show();
setTimeout(check_for_requests, 1000); setTimeout(check_for_requests, 1000);
$('#loading').hide();
$('#content').show();
} }
}); });

View File

@ -2,41 +2,56 @@ body {
background-color: #ffffff; background-color: #ffffff;
color: #000000; color: #000000;
font-family: arial; font-family: arial;
width: 550px; width: 520px;
height: 300px; height: 400px;
margin: 0 auto;
padding: 0;
}
h1 {
background-color: #222222;
color: #ffffff;
text-align: center;
font-size: 20px;
margin: 0; margin: 0;
padding: 10px;
height: 20px;
}
p {
padding: 0; padding: 0;
margin: 0 0 .5em 0;
} }
#output { #wrapper {
width: 520px;
height: 400px;
}
#metadata {
float: left;
width: 200px;
height: 400px;
padding: 10px; padding: 10px;
}
#metadata #basename {
font-family: sans-serif;
font-size: 18px;
font-weight: bold;
margin: 10px 0;
color: #000000;
text-align: center;
word-wrap: break-word; word-wrap: break-word;
height: 260px; }
ul#log {
float: left;
width: 300px;
height: 400px;
margin: 0;
padding: 0;
list-style: none;
background-color: #e0e0e0;
overflow: auto; overflow: auto;
word-wrap: break-word;
font-family: monospace; font-family: monospace;
} }
ul#log li {
#output .weblog { margin: 0;
padding: 10px;
border-bottom: 1px solid #aaaaaa;
}
ul#log .weblog {
color: #009900; color: #009900;
font-weight: bold; font-weight: bold;
} }
#output .weblog-error { ul#log .weblog-error {
color: #990000; color: #990000;
font-weight: bold; font-weight: bold;
} }
@ -80,11 +95,11 @@ p {
background-color:#ce0100; background-color:#ce0100;
} }
#button-wrapper {
text-align: center;
}
#copy-button { #copy-button {
display: none; display: none;
position: absolute;
right: 20px;
bottom: 10px;
} }
#loading { #loading {
@ -95,9 +110,3 @@ p {
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center center; background-position: center center;
} }
#content {
width: 550px;
height: 300px;
display: none;
}

View File

@ -4,13 +4,19 @@
<link rel="stylesheet" type="text/css" media="all" href="static/style.css" /> <link rel="stylesheet" type="text/css" media="all" href="static/style.css" />
</head> </head>
<body> <body>
<div id="loading"></div> <div id="wrapper">
<div id="content"> <div id="metadata">
<h1><span id="basename"></span></h1> <img src="static/logo.png" />
<div id="output"></div> <p id="basename"></p>
<button class="button" id="copy-button">Copy URL</button>- <p id="filesize"></p>
<p id="filehash"></p>
<div id="button-wrapper">
<button class="button" id="copy-button">Copy URL</button>
</div>
</div> </div>
<ul id="log"></ul>
</div>
<script src="static/jquery-1.11.1.min.js"></script> <script src="static/jquery-1.11.1.min.js"></script>
<script src="static/onionshare.js"></script> <script src="static/onionshare.js"></script>
</body> </body>