Skip to content

Commit

Permalink
feat: add Elastic skin support (#37)
Browse files Browse the repository at this point in the history
* Elastic Skin Support

Elastic Skin Support

* Update composer.json

* Update authres_status.php

Updating Code

* Update composer.json

* CSS & Icon Changes

CSS & Icon Changes

* Icon Update

New Icon

* Update composer.json

* chore: lint

Co-authored-by: Pim <[email protected]>
Co-authored-by: Andrey <[email protected]>
  • Loading branch information
3 people authored Jul 9, 2020
1 parent 6db2cdf commit c556408
Show file tree
Hide file tree
Showing 35 changed files with 479 additions and 8 deletions.
20 changes: 14 additions & 6 deletions authres_status.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public function init()
$this->add_hook('storage_init', array($this, 'storage_init'));
$this->add_hook('messages_list', array($this, 'messages_list'));
$this->add_hook('message_headers_output', array($this, 'message_headers'));
$this->add_hook('template_object_messagesummary', array($this, 'message_summary'));

$dont_override = $rcmail->config->get('dont_override', array());

Expand Down Expand Up @@ -153,7 +154,7 @@ public function preferences_section($args)
{
$args['list']['authres_status'] = array(
'id' => 'authres_status',
'section' => rcube::Q($this->gettext('section_title'))
'section' => rcube_utils::rep_specialchars_output($this->gettext('section_title'))
);

return $args;
Expand Down Expand Up @@ -227,10 +228,9 @@ public function messages_list($p)
}

return $p;
}

public function message_headers($p)
{
}

private function populate_message_headers($p){
/* We only have to check the headers once and this method is executed more than once,
/* so let's cache the result
*/
Expand All @@ -240,13 +240,21 @@ public function message_headers($p)
$show_statuses = (int)rcmail::get_instance()->config->get('show_statuses');
$this->img_status = $this->get_authentication_status($p['headers'], $show_statuses, (int)$_GET["_uid"]);
}
}
public function message_headers($p)
{
$this->populate_message_headers($p);

$p['output']['from']['value'] = $this->img_status . $p['output']['from']['value'];
$p['output']['from']['html'] = true;

return $p;
}


public function message_summary($p){
return array('content' => preg_replace('/(<span>\s*)()(From)/', '$1' . $this->img_status . ' $3', $p['content']));
}

/* See https://tools.ietf.org/html/rfc5451
*/
public function rfc5451_extract_authresheader($headers)
Expand Down
42 changes: 42 additions & 0 deletions skins/autumn-larry/authres_status.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/* Autumn-Larry */

.webkit .messagelist tr > .authres_status
{
width: 20px;
}

.messagelist tr > .authres_status {
width: 20px;
padding: 2px 3px;
text-align: center;
}

.messagelist tr > .authres_status span {
display: inline-block;
vertical-align: middle;
background: url(badge.png) center no-repeat;
}

#sections-table tbody #rcmrowauthres_status td.section {
background-image: url(badge.png);
background-position: 10px 5px;
}

#sections-table tbody #rcmrowauthres_status.selected td.section {
background-image: url(badge2.png);
background-repeat: no-repeat;
background-position: 10px 5px;
}

.authres-status-img {
vertical-align: top;
height: 14px;
width: 14px;
}

.widescreen .authres-status-img {
position: relative;
top: -1px;
height: 12px;
width: 12px;
}
Binary file added skins/autumn-larry/badge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added skins/autumn-larry/badge2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions skins/black-larry/authres_status.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/* Black-Larry */

.webkit .messagelist tr > .authres_status
{
width: 20px;
}

.messagelist tr > .authres_status {
width: 20px;
padding: 2px 3px;
text-align: center;
}

.messagelist tr > .authres_status span {
display: inline-block;
vertical-align: middle;
background: url(badge.png) center no-repeat;
}

#sections-table tbody #rcmrowauthres_status td.section {
background-image: url(badge.png);
background-position: 10px 5px;
}

#sections-table tbody #rcmrowauthres_status.selected td.section {
background-image: url(badge2.png);
background-repeat: no-repeat;
background-position: 10px 5px;
}

.authres-status-img {
vertical-align: top;
height: 14px;
width: 14px;
}

.widescreen .authres-status-img {
position: relative;
top: -1px;
height: 12px;
width: 12px;
}
Binary file added skins/black-larry/badge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added skins/black-larry/badge2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions skins/blue-larry/authres_status.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/* Blue-Larry */

.webkit .messagelist tr > .authres_status
{
width: 20px;
}

.messagelist tr > .authres_status {
width: 20px;
padding: 2px 3px;
text-align: center;
}

.messagelist tr > .authres_status span {
display: inline-block;
vertical-align: middle;
background: url(badge.png) center no-repeat;
}

#sections-table tbody #rcmrowauthres_status td.section {
background-image: url(badge2.png);
background-position: 10px 5px;
}

#sections-table tbody #rcmrowauthres_status.selected td.section {
background-image: url(badge.png);
background-repeat: no-repeat;
background-position: 10px 5px;
}

.authres-status-img {
vertical-align: top;
height: 14px;
width: 14px;
}

.widescreen .authres-status-img {
position: relative;
top: -1px;
height: 12px;
width: 12px;
}
Binary file added skins/blue-larry/badge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added skins/blue-larry/badge2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions skins/elastic/authres_status.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
.listing.iconized tr.authres_status>td.section:before {
content: "\f3ed"
}

.webkit .messagelist tr > .authres_status
{
width: 20px;
}

.messagelist tr > .authres_status {
width: 20px;
padding: 2px 3px;
text-align: center;
}

.messagelist tr > .authres_status span {
display: inline-block;
vertical-align: middle;
background: url(badge.png) center no-repeat;
}

#sections-table tbody #rcmrowauthres_status td.section {
background-image: url(badge.png);
background-repeat: no-repeat;
background-position: 10px 5px;
}

.authres-status-img {
}

.widescreen .authres-status-img {
position: relative;
top: -1px;
height: 12px;
width: 12px;
}
42 changes: 42 additions & 0 deletions skins/green-larry/authres_status.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/* Green-Larry */

.webkit .messagelist tr > .authres_status
{
width: 20px;
}

.messagelist tr > .authres_status {
width: 20px;
padding: 2px 3px;
text-align: center;
}

.messagelist tr > .authres_status span {
display: inline-block;
vertical-align: middle;
background: url(badge.png) center no-repeat;
}

#sections-table tbody #rcmrowauthres_status td.section {
background-image: url(badge.png);
background-position: 10px 5px;
}

#sections-table tbody #rcmrowauthres_status.selected td.section {
background-image: url(badge2.png);
background-repeat: no-repeat;
background-position: 10px 5px;
}

.authres-status-img {
vertical-align: top;
height: 14px;
width: 14px;
}

.widescreen .authres-status-img {
position: relative;
top: -1px;
height: 12px;
width: 12px;
}
Binary file added skins/green-larry/badge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added skins/green-larry/badge2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions skins/grey-larry/authres_status.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/* grey-larry */

.webkit .messagelist tr > .authres_status
{
width: 20px;
}

.messagelist tr > .authres_status {
width: 20px;
padding: 2px 3px;
text-align: center;
}

.messagelist tr > .authres_status span {
display: inline-block;
vertical-align: middle;
background: url(badge.png) center no-repeat;
}

#sections-table tbody #rcmrowauthres_status td.section {
background-image: url(badge.png);
background-position: 10px 5px;
}

#sections-table tbody #rcmrowauthres_status.selected td.section {
background-image: url(badge2.png);
background-repeat: no-repeat;
background-position: 10px 5px;
}

.authres-status-img {
vertical-align: top;
height: 14px;
width: 14px;
}

.widescreen .authres-status-img {
position: relative;
top: -1px;
height: 12px;
width: 12px;
}
Binary file added skins/grey-larry/badge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added skins/grey-larry/badge2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 9 additions & 2 deletions skins/larry/authres_status.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* Larry */

.webkit .messagelist tr > .authres_status
{
Expand All @@ -17,8 +18,14 @@
}

#sections-table tbody #rcmrowauthres_status td.section {
background-image: url(badge.png);
background-position: 10px 5px;
background-image: url(badge.png);
background-position: 10px 5px;
}

#sections-table tbody #rcmrowauthres_status.selected td.section {
background-image: url(badge2.png);
background-repeat: no-repeat;
background-position: 10px 5px;
}

.authres-status-img {
Expand Down
Binary file modified skins/larry/badge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added skins/larry/badge2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions skins/pink-larry/authres_status.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/* Pink-Larry */

.webkit .messagelist tr > .authres_status
{
width: 20px;
}

.messagelist tr > .authres_status {
width: 20px;
padding: 2px 3px;
text-align: center;
}

.messagelist tr > .authres_status span {
display: inline-block;
vertical-align: middle;
background: url(badge.png) center no-repeat;
}

#sections-table tbody #rcmrowauthres_status td.section {
background-image: url(badge.png);
background-position: 10px 5px;
}

#sections-table tbody #rcmrowauthres_status.selected td.section {
background-image: url(badge2.png);
background-repeat: no-repeat;
background-position: 10px 5px;
}

.authres-status-img {
vertical-align: top;
height: 14px;
width: 14px;
}

.widescreen .authres-status-img {
position: relative;
top: -1px;
height: 12px;
width: 12px;
}
Binary file added skins/pink-larry/badge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added skins/pink-larry/badge2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit c556408

Please sign in to comment.