Initial Elastic skin support for Enigma

pull/6040/head
Aleksander Machniak 7 years ago
parent fb02d4a747
commit cdd616744a

@ -44,8 +44,6 @@ window.rcmail && rcmail.addEventListener('init', function(evt) {
return false;
}
});
$('input[type="button"]:first').focus();
}
}
}

@ -121,7 +121,7 @@ class enigma_ui
}
$skin_path = $this->enigma->local_skin_path();
$this->enigma->include_stylesheet("$skin_path/enigma.css");
$this->enigma->include_stylesheet("$skin_path/enigma.css", true);
$this->css_loaded = true;
}
@ -604,30 +604,26 @@ class enigma_ui
$search = new html_inputfield(array('type' => 'text', 'name' => '_search',
'id' => 'rcmimportsearch', 'size' => 30));
$upload_button = new html_inputfield(array(
'type' => 'button',
'value' => $this->rc->gettext('import'),
'class' => 'button',
$upload_button = new html_button(array(
'class' => 'button import',
'onclick' => "return rcmail.command('plugin.enigma-import','',this,event)",
));
$search_button = new html_inputfield(array(
'type' => 'button',
'value' => $this->rc->gettext('search'),
'class' => 'button',
$search_button = new html_button(array(
'class' => 'button search',
'onclick' => "return rcmail.command('plugin.enigma-import-search','',this,event)",
));
$upload_form = html::div(null,
rcube::Q($this->enigma->gettext('keyimporttext'), 'show')
. html::br() . html::br() . $upload->show()
. html::br() . html::br() . $upload_button->show()
. html::br() . html::br() . $upload_button->show($this->rc->gettext('import'))
);
$search_form = html::div(null,
rcube::Q($this->enigma->gettext('keyimportsearchtext'), 'show')
. html::br() . html::br() . $search->show()
. html::br() . html::br() . $search_button->show()
. html::br() . html::br() . $search_button->show($this->rc->gettext('search'))
);
$form = html::tag('fieldset', '', html::tag('legend', null, $this->enigma->gettext('keyimportlabel')) . $upload_form)
@ -783,59 +779,78 @@ class enigma_ui
private function compose_ui()
{
$this->add_css();
$this->rc->output->add_label('enigma.sendunencrypted');
// Options menu button
$this->enigma->add_button(array(
'type' => 'link',
'command' => 'plugin.enigma',
'onclick' => "rcmail.command('menu-open', 'enigmamenu', event.target, event)",
'class' => 'button enigma',
'title' => 'encryptionoptions',
'label' => 'encryption',
'domain' => $this->enigma->ID,
'width' => 32,
'height' => 32,
'aria-owns' => 'enigmamenu',
'aria-haspopup' => 'true',
'aria-expanded' => 'false',
), 'toolbar');
// Elastic skin (or a skin based on it)
if (array_key_exists('elastic', (array) $this->rc->output->skins)) {
$this->enigma->api->add_content($this->compose_ui_options(), 'composeoptions');
}
// other skins
else {
// Options menu button
$this->enigma->add_button(array(
'type' => 'link',
'command' => 'plugin.enigma',
'onclick' => "rcmail.command('menu-open', 'enigmamenu', event.target, event)",
'class' => 'button enigma',
'title' => 'encryptionoptions',
'label' => 'encryption',
'domain' => $this->enigma->ID,
'width' => 32,
'height' => 32,
'aria-owns' => 'enigmamenu',
'aria-haspopup' => 'true',
'aria-expanded' => 'false',
), 'toolbar');
// Options menu contents
$this->rc->output->add_footer($this->compose_ui_options(true));
}
}
/**
* Init compose UI (add task button and the menu)
*/
private function compose_ui_options($wrap = false)
{
$locks = (array) $this->rc->config->get('enigma_options_lock');
$menu = new html_table(array('cols' => 2));
$chbox = new html_checkbox(array('value' => 1));
$menu->add(null, html::label(array('for' => 'enigmasignopt'),
rcube::Q($this->enigma->gettext('signmsg'))));
$menu->add(null, $chbox->show($this->rc->config->get('enigma_sign_all') ? 1 : 0,
array(
'name' => '_enigma_sign',
'id' => 'enigmasignopt',
'disabled' => in_array('sign', $locks),
)));
$menu->add(null, html::label(array('for' => 'enigmaencryptopt'),
rcube::Q($this->enigma->gettext('encryptmsg'))));
$menu->add(null, $chbox->show($this->rc->config->get('enigma_encrypt_all') ? 1 : 0,
array(
'name' => '_enigma_encrypt',
'id' => 'enigmaencryptopt',
'disabled' => in_array('encrypt', $locks),
)));
$menu->add(null, html::label(array('for' => 'enigmaattachpubkeyopt'),
rcube::Q($this->enigma->gettext('attachpubkeymsg'))));
$menu->add(null, $chbox->show($this->rc->config->get('enigma_attach_pubkey') ? 1 : 0,
array(
'name' => '_enigma_attachpubkey',
'id' => 'enigmaattachpubkeyopt',
'disabled' => in_array('pubkey', $locks),
)));
$menu = html::div(array('id' => 'enigmamenu', 'class' => 'popupmenu'), $menu->show());
// Options menu contents
$this->rc->output->add_footer($menu);
$this->rc->output->add_label('enigma.sendunencrypted');
$out = html::div('form-group form-check row',
html::label(array('for' => 'enigmasignopt', 'class' => 'col-form-label col-6'),
rcube::Q($this->enigma->gettext('signmsg')))
. html::div('form-check col-6',
$chbox->show($this->rc->config->get('enigma_sign_all') ? 1 : 0, array(
'name' => '_enigma_sign',
'id' => 'enigmasignopt',
'disabled' => in_array('sign', $locks),
))));
$out .= html::div('form-group form-check row',
html::label(array('for' => 'enigmaencryptopt', 'class' => 'col-form-label col-6'),
rcube::Q($this->enigma->gettext('encryptmsg')))
. html::div('form-check col-6',
$chbox->show($this->rc->config->get('enigma_encrypt_all') ? 1 : 0, array(
'name' => '_enigma_encrypt',
'id' => 'enigmaencryptopt',
'disabled' => in_array('encrypt', $locks),
))));
$out .= html::div('form-group form-check row',
html::label(array('for' => 'enigmaattachpubkeyopt', 'class' => 'col-form-label col-6'),
rcube::Q($this->enigma->gettext('attachpubkeymsg')))
. html::div('form-check col-6',
$chbox->show($this->rc->config->get('enigma_attach_pubkey') ? 1 : 0, array(
'name' => '_enigma_attachpubkey',
'id' => 'enigmaattachpubkeyopt',
'disabled' => in_array('pubkey', $locks),
))));
if (!$wrap) {
return $out;
}
return html::div(array('id' => 'enigmamenu', 'class' => 'popupmenu'), $out);
}
/**

@ -73,6 +73,26 @@ p.enigmaattachment a
background: url(enigma.png) 0 0 no-repeat;
}
#enigmamenu div.row {
display: table-row;
}
#enigmamenu div.row > label {
display: table-cell;
width: 99%;
padding: 3px;
}
#enigmamenu div.row > div {
display: table-cell;
width: 1%;
padding: 3px;
}
#enigmamenu input {
vertical-align: middle;
}
/***** Keys/Certs Management *****/
#mainscreen.enigma

@ -0,0 +1,13 @@
<roundcube:include file="includes/layout.html" />
<h1 class="voice"><roundcube:label name="enigma.createkeys" /></h1>
<div class="formcontent">
<roundcube:object name="keyform" class="propform" textarearows="6" />
</div>
<div class="formbuttons">
<roundcube:button command="plugin.enigma-key-save" class="primary button save" label="save" />
</div>
<roundcube:include file="includes/footer.html" />

@ -0,0 +1,9 @@
<roundcube:include file="includes/layout.html" />
<h1 class="voice"><roundcube:label name="enigma.importkeys" /></h1>
<div class="formcontent">
<roundcube:object name="importform" class="propform" />
</div>
<roundcube:include file="includes/footer.html" />

@ -0,0 +1,9 @@
<roundcube:include file="includes/layout.html" />
<h1 class="voice"><roundcube:label name="keyname" part="name" /></h1>
<div class="formcontent">
<roundcube:object name="keydata" class="propform" />
</div>
<roundcube:include file="includes/footer.html" />

@ -0,0 +1,79 @@
<roundcube:include file="includes/layout.html" />
<roundcube:include file="includes/menu.html" />
<roundcube:include file="includes/settings-menu.html" />
<h1 class="voice"><roundcube:label name="settings" /> : <roundcube:label name="enigma.enigmakeys" /></h1>
<!-- keys list -->
<div class="list listbox selected" aria-labelledby="aria-label-enigmakeyslist">
<div class="header">
<a class="button icon menu-button" href="#menu"><span class="inner"><roundcube:label name="menu" /></span></a>
<a class="button icon back-sidebar-button" href="#sidebar"><span class="inner"><roundcube:label name="settings" /></span></a>
<span id="aria-label-enigmakeyslist" class="header-title"><roundcube:label name="enigma.enigmakeys" /></span>
<roundcube:object name="searchform" id="keysearch" wrapper="searchbar toolbar"
label="keysearchform" buttontitle="findkeys" ariatag="h2" />
<a class="button icon toolbar-menu-button" href="#list-menu"><span class="inner"><roundcube:label name="menu" /></span></a>
</div>
<div class="pagenav toolbar" role="toolbar">
<roundcube:button command="firstpage" type="link"
class="button firstpage disabled" classAct="button firstpage"
title="firstpage" label="first" innerclass="inner" />
<roundcube:button command="previouspage" type="link"
class="button prevpage disabled" classAct="button prevpage"
title="previouspage" label="previous" innerclass="inner" />
<span class="pagenav-text" aria-live="polite" aria-relevant="text">
<roundcube:object name="countdisplay" />
</span>
<roundcube:endif />
<roundcube:button command="nextpage" type="link"
class="button nextpage disabled" classAct="button nextpage"
title="nextpage" label="next" innerclass="inner" />
<roundcube:button command="lastpage" type="link"
class="button lastpage disabled" classAct="button lastpage"
title="lastpage" label="last" innerclass="inner" />
</div>
<div class="scroller">
<roundcube:object name="keyslist" id="keys-table" class="listing" role="listbox" noheader="true" data-list="keyslist" />
</div>
</div>
<!-- key info frame -->
<div class="content" role="main">
<h2 id="aria-label-toolbar" class="voice"><roundcube:label name="arialabeltoolbar" /></h2>
<div class="header" role="toolbar" aria-labelledby="aria-label-toolbar">
<a class="button icon back-list-button" href="#back"><span class="inner"><roundcube:label name="back" /></span></a>
<span class="header-title"></span>
<!-- toolbar -->
<div id="folderstoolbar" class="toolbar">
<roundcube:button command="plugin.enigma-key-create" type="link"
class="button create disabled" classAct="button create"
label="create" title="enigma.createkeys" innerClass="inner" />
<roundcube:button command="plugin.enigma-key-delete" type="link"
class="button delete disabled" classAct="button delete"
label="delete" title="enigma.keyremove" innerClass="inner" />
<span class="spacer"></span>
<roundcube:button command="plugin.enigma-key-import" type="link"
class="button import disabled" classAct="button import"
label="import" title="enigma.importkeys" innerClass="inner" />
<span class="dropbutton">
<roundcube:button command="plugin.enigma-key-export" type="link"
class="button export disabled" classAct="button export"
label="export" title="enigma.exportkeys" innerclass="inner" />
<a href="#export" class="button dropdown" data-popup="export-menu">
<span class="inner"><roundcube:label name="enigma.arialabelkeyexportoptions" /></span>
</a>
</span>
</div>
</div>
<roundcube:object name="keyframe" id="keyframe" src="/watermark.html" />
</div>
<div id="export-menu" class="popupmenu">
<h3 id="aria-label-exportmenu" class="voice"><roundcube:label name="enigma.arialabelkeyexportoptions" /></h3>
<ul class="toolbarmenu listing" role="menu" aria-labelledby="aria-label-export-menu">
<roundcube:button type="link-menuitem" command="plugin.enigma-key-export" label="exportall" prop="sub" class="export all" classAct="export all active" />
<roundcube:button type="link-menuitem" command="plugin.enigma-key-export-selected" label="exportsel" prop="sub" class="export selection" classAct="export selection active" />
</ul>
</div>
<roundcube:include file="includes/footer.html" />

@ -73,6 +73,21 @@ p.enigmaattachment a {
padding: 2px 5px;
}
#enigmamenu div.row {
display: table-row;
}
#enigmamenu div.row > label {
display: table-cell;
width: 99%;
padding: 3px;
}
#enigmamenu div.row > div {
display: table-cell;
width: 1%;
padding: 3px;
}
/***** Keys/Certs Management *****/

Loading…
Cancel
Save