Browse Source

css: language selection position is now 'fixed' instead of 'absolute'

added context sensitive help (hover)
css: changed hovered color of buttons to light green
hdf: renamed some elements of the data tree
cgi: language validation fixed
cgi: documentation language setting fixed
cgi: diskinfo rendering fixed
master
lars 16 years ago
parent
commit
2cec33cd2c
  1. 6
      cbox-tree.d/usr/share/cryptobox/templates/config_form.cs
  2. 2
      cbox-tree.d/usr/share/cryptobox/templates/doc.cs
  3. 2
      cbox-tree.d/usr/share/cryptobox/templates/header.cs
  4. 6
      cbox-tree.d/usr/share/cryptobox/templates/init_form.cs
  5. 14
      cbox-tree.d/usr/share/cryptobox/templates/macros.cs
  6. 10
      cbox-tree.d/usr/share/cryptobox/templates/main.cs
  7. 2
      cbox-tree.d/usr/share/doc/cryptobox/html/en/hints/confirm_text.html
  8. 10
      cbox-tree.d/usr/share/doc/cryptobox/html/en/hints/crypto_pw.html
  9. 2
      cbox-tree.d/usr/share/doc/cryptobox/html/en/hints/crypto_pw_repeat.html
  10. 2
      cbox-tree.d/usr/share/doc/cryptobox/html/en/hints/set_ip_address.html
  11. 3
      cbox-tree.d/usr/share/doc/cryptobox/html/en/hints/set_language.html
  12. 3
      cbox-tree.d/usr/share/doc/cryptobox/html/en/hints/set_timeout.html
  13. 45
      cbox-tree.d/var/www/cgi-bin/cryptobox.pl
  14. 117
      cbox-tree.d/var/www/cryptobox.css

6
cbox-tree.d/usr/share/cryptobox/templates/config_form.cs

@ -4,15 +4,15 @@
<form action="<?cs call:getSelfURL('','') ?>" method="post"
enctype="application/x-www-form-urlencoded">
<p><label for="ip"><?cs var:Lang.Text.IPAddress ?></label><br/>
<p><label for="ip"><?cs call:help_popUp(Lang.Text.IPAddress,'set_ip_address') ?></label><br/>
<input type="text" id="ip" size="16" maxsize="15" name="ip"
value="<?cs var:Data.Config.IP ?>" /><p>
<p><label for="timeout"><?cs var:Lang.Text.TimeOut ?></label><br/>
<p><label for="timeout"><?cs call:help_popUp(Lang.Text.TimeOut,'set_timeout') ?></label><br/>
<input type="text" id="timeout" size="5" maxsize="5" name="timeout"
value="<?cs var:Data.Config.TimeOut ?>" /></p>
<p><label for="language"><?cs var:Lang.Text.SelectLanguage ?></label><br/>
<p><label for="language"><?cs call:help_popUp(Lang.Text.SelectLanguage,'set_language') ?></label><br/>
<select name="language">
<?cs each:item = Data.Languages ?>
<option value="<?cs name:item ?>" <?cs if:(name(item) == Data.Config.Language) ?>selected="selected"<?cs /if ?>><?cs var:item ?></option>

2
cbox-tree.d/usr/share/cryptobox/templates/doc.cs

@ -1,5 +1,5 @@
<div id="doc">
<?cs include:DocDir + '/' + DocLang + '/' + Data.Doc.Page + '.html' ?>
<?cs include:Settings.DocDir + '/' + Settings.DocLang + '/' + Data.Doc.Page + '.html' ?>
</div>

2
cbox-tree.d/usr/share/cryptobox/templates/header.cs

@ -29,7 +29,7 @@
<!-- the menu bar is disabled if redirection has been suggested -->
<?cs else ?>
<div id="menu">
<?cs include:TemplateDir + '/nav.cs' ?>
<?cs include:Settings.TemplateDir + '/nav.cs' ?>
</div>
<?cs /if ?>

6
cbox-tree.d/usr/share/cryptobox/templates/init_form.cs

@ -4,11 +4,11 @@
<form action="<?cs call:getSelfURL('','') ?>" method="post" enctype="application/x-www-form-urlencoded">
<p class="note"><?cs var:Lang.Text.InitWarning ?></p>
<p><label for="password"><?cs var:Lang.Text.EnterNewPassword ?></label><br/>
<p><label for="password"><?cs call:help_popUp(Lang.Text.EnterNewPassword,"crypto_pw") ?></label><br/>
<input type="password" id="password" name="password" size="20" tabindex="1" maxlength="40" /></p>
<p><label for="password2"><?cs var:Lang.Text.EnterSamePassword ?></label><br/>
<p><label for="password2"><?cs call:help_popUp(Lang.Text.EnterSamePassword,'crypto_pw_repeat') ?></label><br/>
<input type="password" id="password2" name="password2" size="20" tabindex="2" maxlength="40" /></p>
<p><label for="confirm"><?cs var:Lang.Text.ConfirmInitHint ?><br/>
<p><label for="confirm"><?cs call:help_popUp(Lang.Text.ConfirmInitHint,'confirm_text') ?><br/>
<span class="note" id="confirmtext"><?cs var:Lang.Text.ConfirmInit ?></span></label><br/>
<input type="text" id="confirm" name="confirm" size="30" tabindex="3" maxlength="50" /></p>
<button type="submit" name="action" value="init_do" tabindex="4"><?cs var:Lang.Button.DoInit ?></button>

14
cbox-tree.d/usr/share/cryptobox/templates/macros.cs

@ -53,9 +53,8 @@
# e.g.:
# - 'append' is 'weblang=de'
# - 'exclude' is 'weblang'
# BEWARE: there is a bug (?) in clearsilver, that occours, if
# only one of the arguments is set (none or both are fine)
?><?cs set:PostSuffix='' ?><?cs
# BEWARE: both parameters have to be defined!
?><?cs set:PostSuffix='' ?><?cs
set:tmp_concat='?' ?><?cs
each:item = Data.PostData ?><?cs
if:(name(item) != exclude) ?><?cs
@ -68,3 +67,12 @@
var:ScriptName ?><?cs var:PostSuffix ?><?cs
/def ?>
<?cs def:help_popUp(text,filename) ?><?cs #
# show a pop-up information block on the right side of the screen
# usually good for small explanatory texts
?><a class="popup"><?cs
var:text ?><span><?cs
linclude:Settings.DocDir + '/' + Settings.DocLang + '/hints/' + filename + '.html' ?></span></a><?cs
/def ?>

10
cbox-tree.d/usr/share/cryptobox/templates/main.cs

@ -1,14 +1,14 @@
<?cs include:TemplateDir + '/macros.cs' ?>
<?cs include:TemplateDir + '/header.cs' ?>
<?cs include:Settings.TemplateDir + '/macros.cs' ?>
<?cs include:Settings.TemplateDir + '/header.cs' ?>
<!-- this cryptobox template follows: <?cs var:Data.Action ?> -->
<?cs if:Data.Error ?>
<?cs include:TemplateDir + '/error.cs' ?>
<?cs include:Settings.TemplateDir + '/error.cs' ?>
<?cs else ?>
<?cs if:Data.Warning ?><?cs call:warning(Data.Warning) ?><?cs /if ?>
<?cs if:Data.Success ?><?cs call:success(Data.Success) ?><?cs /if ?>
<?cs include:TemplateDir + '/' + Data.Action + '.cs' ?>
<?cs include:Settings.TemplateDir + '/' + Data.Action + '.cs' ?>
<?cs /if ?>
<?cs include:TemplateDir + '/footer.cs' ?>
<?cs include:Settings.TemplateDir + '/footer.cs' ?>

2
cbox-tree.d/usr/share/doc/cryptobox/html/en/hints/confirm_text.html

@ -0,0 +1,2 @@
<h3>Confirmation text</h3>
<p>Type the confirmation text exactly the way, it is said. This confirms, that you know, what you are doing.</p>

10
cbox-tree.d/usr/share/doc/cryptobox/html/en/hints/crypto_pw.html

@ -0,0 +1,10 @@
<h3>Password of encrypted filesystem</h3>
<p>This password is the final protection for your sensible data. You should
choose a complicated password, that fullfills at least the following requirements:</p>
<ul>
<li>more than 20 characters</li>
<li>contain lowercase, uppercase, numbers, special characters</li>
<li>may not be written anywhere in cleartext</li>
</ul>
<p>Do not forget your encryption password! There is no way to recover your data
without it (of course, there should be none).</p>

2
cbox-tree.d/usr/share/doc/cryptobox/html/en/hints/crypto_pw_repeat.html

@ -0,0 +1,2 @@
<h3>Repeat the crypto password</h3>
<p>This ensures, that you do not mistype your password.</p>

2
cbox-tree.d/usr/share/doc/cryptobox/html/en/hints/set_ip_address.html

@ -0,0 +1,2 @@
<h3>Change the network address (IP)</h3>
<p>Maybe you will have to reconfigure the network address of your local computer, too.</p>

3
cbox-tree.d/usr/share/doc/cryptobox/html/en/hints/set_language.html

@ -0,0 +1,3 @@
<h3>Change the default language</h3>
<p>This will set the default language of the web interface of this CryptoBox. Every user may change this temporarily
by selecting a language of choice in the upper right corner of the screen.</p>

3
cbox-tree.d/usr/share/doc/cryptobox/html/en/hints/set_timeout.html

@ -0,0 +1,3 @@
<h3>Change the idle timeout</h3>
<p>This value specifies, when the encrypted filesystem will be automatically unmounted.
The last access of the encrypted data starts this timer.</p>

45
cbox-tree.d/var/www/cgi-bin/cryptobox.pl

@ -36,10 +36,10 @@ sub load_hdf()
my $fname = "$TEMPLATE_DIR/main.cs";
die ("Template directory is invalid ($fname not found)!") unless (-e "$fname");
$hdf->setValue("TemplateDir","$TEMPLATE_DIR");
$hdf->setValue("Settings.TemplateDir","$TEMPLATE_DIR");
die ("Documentation directory ($DOC_DIR) not found!") unless (-d "$DOC_DIR");
$hdf->setValue("DocDir","$DOC_DIR");
$hdf->setValue("Settings.DocDir","$DOC_DIR");
# if it was requested as directory index (link from index.html), we should
# set a real script name - otherwise links with a query string will break
@ -224,16 +224,30 @@ sub validate_timeout()
}
# check for a valid interface language
sub validate_language()
{
my $language = shift;
# check for non-alphanumeric character
return 0 if ($language =~ /\W/);
return 0 if ($language eq "");
return 0 if ( ! -e "$LANGUAGE_DIR/$language" . '.hdf');
return 1;
}
# check for a valid documentation language
sub validate_doc_language()
{
my $language = shift;
# check for non-alphanumeric character
return 0 if ($language =~ /\W/);
return 0 if ($language eq "");
return 0 if ( ! -e "$DOC_DIR/$language" . '.hdf');
return 1;
}
################### main #########################
my $query = new CGI;
@ -251,22 +265,25 @@ if ($query->param('weblang')) {
&load_language_data($pagedata, "$weblang");
# add the setting to every link
$pagedata->setValue('Data.PostData.weblang', "$weblang");
# select documentation
if (-e "$DOC_DIR/$weblang") {
# selected web interface language
$pagedata->setValue('Data.DocLang', "$weblang");
} elseif (-e "$DOC_DIR/$LANGUAGE") {
# default CryptoBox language
$pagedata->setValue('Data.DocLang', "$LANGUAGE");
} else {
# default hardcoded language (english)
$pagedata->setValue('Data.DocLang', "en");
}
} else {
$pagedata->setValue('Data.Warning', 'InvalidLanguage');
}
}
########## select documentation language ##########
if ($query->param('weblang') && &validate_doc_language($query->param('weblang'))) {
# selected web interface language
$pagedata->setValue('Settings.DocLang', "$query->param('weblang')");
} elsif (&validate_doc_language($LANGUAGE)) {
# configured CryptoBox language
$pagedata->setValue('Settings.DocLang', "$LANGUAGE");
} else {
# default hardcoded language (english)
$pagedata->setValue('Settings.DocLang', "en");
}
# first: check for ssl!
if ( ! &check_ssl()) {
$pagedata->setValue('Data.Error', 'NoSSL');
@ -479,7 +496,7 @@ $pagedata->setValue('Data.Status.Mounted', &check_mounted() ? 1 : 0);
my $output = &get_current_ip();
$pagedata->setValue('Data.Status.IP', "$output");
($output = `$CB_SCRIPT diskinfo 2>&1`) =~ s#\Z#<br/>#;
$output = `$CB_SCRIPT diskinfo 2>&1 | sed 's#\$#<br/>#'`;
$pagedata->setValue('Data.PartitionInfo',"$output");
# preset config settings for clearsilver

117
cbox-tree.d/var/www/cryptobox.css

@ -7,7 +7,7 @@ body {
margin: 0;
padding: 0;
font-family: verdana, lucida, arial, helvetica, sans-serif;
}
}
#main {
background: none;
@ -15,7 +15,7 @@ body {
padding: 0px;
margin-left: auto;
margin-right: auto;
}
}
#main h1, h2, h3 {
font-family: sans-serif, arial;
@ -25,19 +25,19 @@ body {
font-variant: small-caps;
padding: 0 1em;
text-align: left;
}
}
#main h1 {
font-size: 2em;
}
}
#main h2 {
font-size: 1.5em;
}
}
#main h3 {
font-size: 1.2em;
}
}
#head {
width: 600px;
@ -48,14 +48,14 @@ body {
background-position: top right;
background-attachment: scroll;
background-repeat: no-repeat;
}
}
#content {
margin: 0;
padding: 0;
width: 600px;
font-size: 0.9em;
}
}
#content a {
line-height: 1.2em;
@ -63,11 +63,11 @@ body {
text-decoration: none;
font-weight: bold;
font-size: 0.9em;
}
}
#content a:hover {
text-decoration: underline;
}
}
#content a:visited {
color: #acacac;
@ -77,57 +77,57 @@ body {
font-size: 0.9em;
padding: 0 1em;
text-align: justify;
}
}
#menu {
text-align: center;
border-top: 1px solid #5e5e5e;
border-bottom: 1px solid #5e5e5e;
background-color: #ACE149;
}
text-align: center;
border-top: 1px solid #5e5e5e;
border-bottom: 1px solid #5e5e5e;
background-color: #ACE149;
}
#menu a:link, #menu a:visited {
color: #5e5e5e;
margin: 5px;
text-decoration: none;
border: none;
padding: 4px;
font-size: 0.8em;
}
color: #5e5e5e;
margin: 5px;
text-decoration: none;
border: none;
padding: 4px;
font-size: 0.8em;
}
#menu a:hover {
color: #8e8e8e;
}
color: #8e8e8e;
}
#words {
width: 565px;
padding: 1.1em 0em 1.1em 1.1em;
margin-top: 0;
}
}
#words h1{
font-size: 1.8em;
}
}
#words h2{
font-size: 1.4em;
}
}
#words ol, #words ul {
font-size: 0.9em;
}
}
#words ol li {
padding: 0 1em;
line-height: 1.7em;
}
}
#words ul li {
padding: 0 1em;
line-height: 1.7em;
list-style: none;
background: url(/cryptobox-img/list.gif) center left no-repeat;
}
}
#footer {
clear: both;
@ -137,7 +137,7 @@ body {
background-color: #ACE149;
font-size: 0.8em;
color: #5e5e5e;
}
}
#footer a:link, #footer a:visited {
color: white;
@ -146,11 +146,11 @@ body {
border: none;
padding: 4px;
color: #5e5e5e;
}
}
#footer a:hover {
text-decoration: underline;
}
}
#confirmtext span {
color: red;
@ -252,7 +252,7 @@ button {
}
button:hover {
background-color: #fff;
background-color: #D0F0A0;
border: 1px solid #ACE149;
color: #5e5e5e;
font-size: 0.8em;
@ -271,7 +271,7 @@ button:hover {
/* ------------=-=-=- language selection -=-=-=------------- */
#lang {
position: absolute;
position: fixed;
float: right;
right: 5px;
top: 5px;
@ -317,7 +317,46 @@ button:hover {
/* ------------=-=-=- special things -=-=-=------------- */
#partition_info p {
margin-left:10%;
margin-right:10%;
font-family:monospace
margin-left: 10%;
margin-right: 10%;
font-family: monospace
}
#words a.popup {
line-height: inherit;
color: inherit;
text-decoration: inherit;
font-weight: inherit;
font-size: inherit;
}
#words a.popup:hover {
text-decoration: inherit;
}
#words a.popup span {
display: none;
position: fixed;
bottom: 10px;
left: 9%;
width: 80%;
background: #f0f0f0;
padding: 10px;
border-color: #e0e0e0;
border-width: 2px;
border-style: solid;
margin: 0;
}
#words a.popup:hover span {
display: inline;
}
#words a.popup span p {
text-align: left;
}
#words a.popup span h3 {
color: #909090;
margin-top: 0px;
}

Loading…
Cancel
Save