Commit fe18edec authored by Stavros Sachtouris's avatar Stavros Sachtouris Committed by Giorgos Korfiatis

Improve GUI look'n'feel and clean unused code

parent 20b13007
......@@ -18,51 +18,38 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<html>
<head>
<title>About Agkyra</title>
<link rel="stylesheet" href="static/stylesheets/normalize.css" />
<link rel="stylesheet" href="static/stylesheets/main.css" />
<script src="static/js/jquery.js"></script>
<script src="static/js/common.js"></script>
<style>
.box {
margin: 0 auto;
width: 90%;
height: 256px;
overflow: auto;
background: #e0e0e0;
}
</style>
</head>
<body>
<div class="row home js-main">
<img src="static/images/logo.png" style="width: 64px; height: 64px;" />
<h3>Agkyra... it syncs</h3>
<div class="wrapper home">
<header>
<img src="static/images/logo.png" class="logo" alt="agkyra"/>
<h1>Agkyra... it syncs</h1>
</header>
<p><b>Agkyra</b> is a minimal syncing client for Pithos+.<br/>It syncs a Pithos+ container with a local folder.</p>
<p class="disclaimer">Developed and supported by the Okeanos/Synnefo development team of GRNET<br/><b>contact: okeanos-dev@grnet.gr</b></p>
<h3 class="disclaimer">Copyright 2015 Greek Research and Technology Network<br/>Licensed under:</h3>
<embed class="box" src="COPYING" />
<embed class="licence" src="COPYING" />
</div>
<footer class="footer js-footer">
<nav class="row">
<p class="disclaimer">The project is co-financed by Greece and the European Union</p>
<ul class="logos">
<li id="eu">
<a href="#" title="European Union">European Union</a>
</li>
<li id="dg">
<a href="#" title="Digital Greece">Digital Greece</a>
</li>
<li id="nsrf">
<a href="#" title="NSRF">NSRF</a>
</li>
<li id="grnet">
<a href="#" title="GRNet">GRNet</a>
</li>
</ul>
</nav>
<footer class="footer">
<p class="disclaimer">The project is co-financed by Greece and the European Union</p>
<ul class="logos">
<li id="eu">
<a href="#" title="European Union"><img src="static/images/eu.png" /></a>
</li>
<li id="dg">
<a href="#" title="Digital Greece"><img src="static/images/dg.png" /></a>
</li>
<li id="nsrf">
<a href="#" title="NSRF"><img src="static/images/nsrf.png" /></a>
</li>
<li id="grnet">
<a href="#" title="GRNet"><img src="static/images/grnet.png" /></a>
</li>
</ul>
</footer>
</body>
......
<!DOCTYPE html>
<!-- Copyright (C) 2015 GRNET S.A.
<!--
Copyright (C) 2015 GRNET S.A.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -12,11 +13,11 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. -->
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<html>
<head>
<title>User Settings</title>
<link rel="stylesheet" href="static/stylesheets/normalize.css" />
<link rel="stylesheet" href="static/stylesheets/main.css" />
<script src="static/js/jquery.js"></script>
<script src="settings.js"></script>
......@@ -39,12 +40,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. -->
fs.readFileSync(exclude, encoding='utf-8'));
} catch (err) {console.log(err);}
});
function update_exclude(new_content) {
if (exclude) fs.writeFile(exclude, new_content);
}
function extract_credentials(cookie) {
var credentials = cookie.value.split('%7C');
var uuid = credentials[0];
......@@ -54,7 +52,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. -->
$('#token').trigger('change');
//set_setting('token', $(this).val())
}
function remove_cookies(win, url) {
var removed_at_least_one = false
win.cookies.getAll({url: url}, function(cookies) {
......@@ -65,7 +62,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. -->
});
return removed_at_least_one;
}
var gui = require('nw.gui');
var cred_win = null;
var logout_win = null;
......@@ -74,15 +70,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. -->
function get_credentials() {
var cookie_name = '_pithos2_a';
var lurl = get_account_ui() + '/logout?next=' + get_pithos_ui()
show_creds = false;
$('#get_creds').hide();
got_cookie = false;
cred_win = gui.Window.open(lurl, {
focus: true, width: 820, height: 580, toolbar: false
});
cred_win.cookies.onChanged.addListener(function(info) {
if (info.cookie.name === cookie_name) {
console.log('Succesfully logged in');
......@@ -93,7 +86,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. -->
cred_win.on('loaded', function() {
if (got_cookie) cred_win.close();
});
cred_win.on('closed', function() {
logout_win = gui.Window.open(
get_account_ui() + '/logout',
......@@ -106,7 +98,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. -->
});
});
}
window.setInterval(function() {
// Refresh get_creds visibility, until refresh_endpoints
// changes are in effect
......@@ -117,96 +108,86 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. -->
</script>
</head>
<body>
<div class="row js-main">
<div class="wrapper">
<header>
<h2>&nbsp;<img src="static/images/about.png" style="width: 16; height: 16;"/>&nbsp;User Settings</h2>
<h2><img src="static/images/about.png"/> User Settings</h2>
</header>
<form>
<div class="row">
<div class="small-8 columns">
<fieldset>
<legend>Cloud</legend>
<div class="row error">
<div class="small-3 columns">
<label for="cloud-url" class="right inline">Cloud URL</label>
</div>
<div class="small-9 columns">
<input type="text" id="cloud-url" placeholder="Authentication URL"
onchange="set_setting('url', $(this).val()); refresh_endpoints($(this).val());">
<small class="error" style="visibility: hidden">Invalid entry</small>
</div>
</div>
<div class="row error">
<div class="small-3 columns">
<label for="token" class="right inline">User token</label>
</div>
<div class="small-9 columns">
<input type="text" id="token" placeholder="User token"
onchange="set_setting('token', $(this).val())">
<small class="error" style="visibility: hidden">Invalid entry</small>
</div>
</div>
<div class="clearfix">
<a id="get_creds"
class="button right" style="display: none;"
onclick="get_credentials();">Login to get credentials</a>
</div>
</fieldset>
<fieldset>
<legend>What to sync</legend>
<div class="row">
<div class="small-3 columns">
<label for="container" class="right inline">Remote container</label>
</div>
<div class="small-9 columns">
<input type="text" id="container" placeholder="Pithos+ container"
onchange="set_setting('container', $(this).val())">
</div>
</div>
<div class="row">
<div class="small-3 columns">
<label for="directory" class="right inline">Local directory</label>
</div>
<div class="small-9 columns" id="directory">
No dir chosen</div>
</div>
<div class="row">
<div class="small-3 columns">Change it:</div>
<div class="small-9 columns">
<!-- TODO: change the label of this field -->
<input type="file" nwdirectory
onchange="
$('#directory').html($(this).val());
set_setting('directory', $(this).val());
" />
</div>
</div>
<div class="row">
<div class="small-3 columns">
<label for="" class="right inline">Exclude these items from syncing</label>
</div>
<div class="small-9 columns">
<textarea id="exclude"
onchange="update_exclude($(this).val())">
</textarea>
</div>
</div>
</fieldset>
<!--<div class="clearfix">
<a id="sync_button" class="button right"
onclick="window.close();">OK</a>
</div> -->
<fieldset>
<legend>Cloud</legend>
<div class="clearfix error">
<div class="small-3 columns">
<label for="cloud-url" class="right inline">Cloud URL</label>
</div>
<div class="small-9 columns">
<input type="text" id="cloud-url" placeholder="Authentication URL"
onchange="set_setting('url', $(this).val()); refresh_endpoints($(this).val());">
<small>Invalid entry</small>
</div>
</div>
<!--<div class="small-4 columns">
<p class="panel">I have no idea what will happen if I put my credentials there...<br>My space could be used to explain what is going on here.</p>
</div>-->
<div class="clearfix">
<div class="small-3 columns">
<label for="token" class="right inline">User token</label>
</div>
<div class="small-9 columns">
<input type="text" id="token" placeholder="User token"
onchange="set_setting('token', $(this).val())">
<small>Invalid entry</small>
</div>
</div>
<div class="clearfix">
<a id="get_creds"
class="button right" style="display: none;"
onclick="get_credentials();">Login to get credentials</a>
</div>
</fieldset>
<fieldset>
<legend>What to sync</legend>
<div class="row clearfix">
<div class="small-3 columns">
<label for="container" class="right inline">Remote container</label>
</div>
<div class="small-9 columns">
<input type="text" id="container" placeholder="Pithos+ container"
onchange="set_setting('container', $(this).val())">
</div>
</div>
<div class="row clearfix">
<div class="small-3 columns">
<label for="directory" class="right inline">Local directory</label>
</div>
<div class="small-9 columns" id="directory">
No dir chosen</div>
</div>
<div class="row clearfix">
<div class="small-3 columns"><label class="right inline">Change it:</label></div>
<div class="small-9 columns">
<!-- TODO: change the label of this field -->
<input type="file" nwdirectory
onchange="
$('#directory').html($(this).val());
set_setting('directory', $(this).val());
" />
</div>
</div>
<div class="row">
<div class="small-3 columns">
<label for="exclude" class="right inline">Exclude these items from syncing</label>
</div>
<div class="small-9 columns">
<textarea id="exclude"
onchange="update_exclude($(this).val())">
</textarea>
</div>
</div>
</fieldset>
<div class="clearfix">
<a id="sync_button" class="button right"
onclick="window.close();">OK</a>
</div>
</form>
</div>
......
This diff is collapsed.
/*! normalize.css v3.0.2 | MIT License | git.io/normalize */
/**
* 1. Set default font family to sans-serif.
* 2. Prevent iOS text size adjust after orientation change, without disabling
* user zoom.
*/
/* line 9, ../sass/normalize.scss */
html {
font-family: sans-serif;
/* 1 */
-ms-text-size-adjust: 100%;
/* 2 */
-webkit-text-size-adjust: 100%;
/* 2 */
}
/**
* Remove default margin.
*/
/* line 19, ../sass/normalize.scss */
body {
margin: 0;
}
/* HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined for any HTML5 element in IE 8/9.
* Correct `block` display not defined for `details` or `summary` in IE 10/11
* and Firefox.
* Correct `block` display not defined for `main` in IE 11.
*/
/* line 33, ../sass/normalize.scss */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
menu,
nav,
section,
summary {
display: block;
}
/**
* 1. Correct `inline-block` display not defined in IE 8/9.
* 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.
*/
/* line 54, ../sass/normalize.scss */
audio,
canvas,
progress,
video {
display: inline-block;
/* 1 */
vertical-align: baseline;
/* 2 */
}
/**
* Prevent modern browsers from displaying `audio` without controls.
* Remove excess height in iOS 5 devices.
*/
/* line 67, ../sass/normalize.scss */
audio:not([controls]) {
display: none;
height: 0;
}
/**
* Address `[hidden]` styling not present in IE 8/9/10.
* Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22.
*/
/* line 77, ../sass/normalize.scss */
[hidden],
template {
display: none;
}
/* Links
========================================================================== */
/**
* Remove the gray background color from active links in IE 10.
*/
/* line 89, ../sass/normalize.scss */
a {
background-color: transparent;
}
/**
* Improve readability when focused and also mouse hovered in all browsers.
*/
/* line 97, ../sass/normalize.scss */
a:active,
a:hover {
outline: 0;
}
/* Text-level semantics
========================================================================== */
/**
* Address styling not present in IE 8/9/10/11, Safari, and Chrome.
*/
/* line 109, ../sass/normalize.scss */
abbr[title] {
border-bottom: 1px dotted;
}
/**
* Address style set to `bolder` in Firefox 4+, Safari, and Chrome.
*/
/* line 117, ../sass/normalize.scss */
b,
strong {
font-weight: bold;
}
/**
* Address styling not present in Safari and Chrome.
*/
/* line 126, ../sass/normalize.scss */
dfn {
font-style: italic;
}
/**
* Address variable `h1` font-size and margin within `section` and `article`
* contexts in Firefox 4+, Safari, and Chrome.
*/
/* line 135, ../sass/normalize.scss */
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/**
* Address styling not present in IE 8/9.
*/
/* line 144, ../sass/normalize.scss */
mark {
background: #ff0;
color: #000;
}
/**
* Address inconsistent and variable font size in all browsers.
*/
/* line 153, ../sass/normalize.scss */
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` affecting `line-height` in all browsers.
*/
/* line 161, ../sass/normalize.scss */
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
/* line 169, ../sass/normalize.scss */
sup {
top: -0.5em;
}
/* line 173, ../sass/normalize.scss */
sub {
bottom: -0.25em;
}
/* Embedded content
========================================================================== */
/**
* Remove border when inside `a` element in IE 8/9/10.
*/
/* line 184, ../sass/normalize.scss */
img {
border: 0;
}
/**
* Correct overflow not hidden in IE 9/10/11.
*/
/* line 192, ../sass/normalize.scss */
svg:not(:root) {
overflow: hidden;
}
/* Grouping content
========================================================================== */
/**
* Address margin not present in IE 8/9 and Safari.
*/
/* line 203, ../sass/normalize.scss */
figure {
margin: 1em 40px;
}
/**
* Address differences between Firefox and other browsers.
*/
/* line 211, ../sass/normalize.scss */
hr {
-moz-box-sizing: content-box;
box-sizing: content-box;
height: 0;
}
/**
* Contain overflow in all browsers.
*/
/* line 221, ../sass/normalize.scss */
pre {
overflow: auto;
}
/**
* Address odd `em`-unit font size rendering in all browsers.
*/
/* line 229, ../sass/normalize.scss */
code,
kbd,
pre,
samp {
font-family: monospace, monospace;
font-size: 1em;
}
/* Forms
========================================================================== */
/**
* Known limitation: by default, Chrome and Safari on OS X allow very limited
* styling of `select`, unless a `border` property is set.
*/
/**
* 1. Correct color not being inherited.
* Known issue: affects color of disabled elements.
* 2. Correct font properties not being inherited.
* 3. Address margins set differently in Firefox 4+, Safari, and Chrome.
*/
/* line 252, ../sass/normalize.scss */
button,
input,
optgroup,
select,
textarea {
color: inherit;
/* 1 */
font: inherit;
/* 2 */
margin: 0;
/* 3 */
}
/**
* Address `overflow` set to `hidden` in IE 8/9/10/11.
*/
/* line 266, ../sass/normalize.scss */
button {
overflow: visible;
}
/**
* Address inconsistent `text-transform` inheritance for `button` and `select`.
* All other form control elements do not inherit `text-transform` values.
* Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.
* Correct `select` style inheritance in Firefox.
*/
/* line 277, ../sass/normalize.scss */
button,
select {
text-transform: none;
}
/**
* 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
* and `video` controls.
* 2. Correct inability to style clickable `input` types in iOS.
* 3. Improve usability and consistency of cursor style between image-type
* `input` and others.
*/
/* line 290, ../sass/normalize.scss */
button,
html input[type="button"],
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button;
/* 2 */
cursor: pointer;
/* 3 */
}
/**
* Re-set default cursor for disabled elements.
*/
/* line 302, ../sass/normalize.scss */
button[disabled],
html input[disabled] {
cursor: default;
}
/**
* Remove inner padding and border in Firefox 4+.
*/
/* line 311, ../sass/normalize.scss */
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
/**
* Address Firefox 4+ setting `line-height` on `input` using `!important` in
* the UA stylesheet.
*/
/* line 322, ../sass/normalize.scss */
input {