From 6d33f0327931994cacfd48b89cd3cd84ad271547 Mon Sep 17 00:00:00 2001
From: seb1k <64972483+seb1k@users.noreply.github.com>
Date: Thu, 13 Jun 2024 23:17:39 +0200
Subject: [PATCH] Add files via upload
---
styles/styles.min.css | 32 ++++++--
templates/login.html | 18 +----
templates/message.html | 1 +
ui.min.js | 175 +++++++++++++++++++++++++++++++++++------
4 files changed, 181 insertions(+), 45 deletions(-)
diff --git a/styles/styles.min.css b/styles/styles.min.css
index 483c011..d8387c3 100644
--- a/styles/styles.min.css
+++ b/styles/styles.min.css
@@ -315,9 +315,9 @@ animation: spin 1.5s linear infinite;
.button-calendar:before { content: "\f073" !important;}
-.backicon:before { content: "\f053";}
+.backicon:before {content: "\f053";}
-.iconrefresh:before { content: "\f021";}
+.iconrefresh:before {content: "\f021";}
.sendicon:before{content: "\f1d8";}
@@ -334,6 +334,25 @@ animation: spin 1.5s linear infinite;
.selecticon:before{content: "\f00c";}
+.divscale_default:before{content: "\f31e";color:#e2e2e2;font-size:16px !important;padding-left:5px;}
+
+html.layout-small .divscale_default{
+transform: scale(1.4);
+}
+
+.divscale_default{
+width:24px;
+height:24px;
+background-color:#424242;
+position:absolute;
+top:10px;
+left:10px;
+border-radius:5px;
+cursor:pointer
+}
+.divscale_default:hover{
+background-color:#888;
+}
#folderlist-content .sidebar-menu{
color: var(--font);
@@ -514,6 +533,7 @@ body {
left: 0 !important;
}
+#divscale_default:before,
#filtersetslist td.name:before,
#filterslist td.name:before,
#identities-table td.mail:before,
@@ -4214,7 +4234,7 @@ table.fixedcopy {
}
.messagelist td.subject span {
- line-height: 1.7em;
+ line-height: 24px;
}
@@ -4223,7 +4243,7 @@ padding-right: 20px;
}
.messagelist td.subject span.size {
-padding-right: 15px;
+margin-right: 15px;
}
@@ -6730,6 +6750,7 @@ body.task-error-login #layout #layout-content > .header{
#message-header .header-content {
min-height: 4rem;
flex: 1;
+ max-width: 200px;
}
@@ -7102,8 +7123,7 @@ html.dark-mode .listing tbody td a {
html.dark-mode .listing li,
-html.dark-mode .listing li ul,
-html.dark-mode .listing tbody td {
+html.dark-mode .listing li ul {
border-bottom-color: #2c373a;
}
diff --git a/templates/login.html b/templates/login.html
index 3525cb3..70d3501 100644
--- a/templates/login.html
+++ b/templates/login.html
@@ -21,20 +21,4 @@
-
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/templates/message.html b/templates/message.html
index d8cc9f1..909599c 100644
--- a/templates/message.html
+++ b/templates/message.html
@@ -91,6 +91,7 @@
diff --git a/ui.min.js b/ui.min.js
index d29973d..82783bb 100644
--- a/ui.min.js
+++ b/ui.min.js
@@ -14,9 +14,9 @@
- log = function() { return Function.prototype.bind.call(console.log, console);}();
- warn = function() { return Function.prototype.bind.call(console.warn, console);}();
- error = function() { return Function.prototype.bind.call(console.error, console);}();
+log = function() { return Function.prototype.bind.call(console.log, console);}();
+warn = function() { return Function.prototype.bind.call(console.warn, console);}();
+error = function() { return Function.prototype.bind.call(console.error, console);}();
@@ -712,7 +712,7 @@ if(rcmail.env.action=="preview")
}
}
})
- // .addEventListener('managesieve.insertrow', function(o) { bootstrap_style(o.obj); })
+ .addEventListener('managesieve.insertrow', function(o) { bootstrap_style_elastic2022(o.obj); })
.addEventListener('add-recipient', function() { phone_confirmation('recipientsadded'); });
rcmail.init_pagejumper('.pagenav > input');
@@ -741,6 +741,14 @@ if(rcmail.env.action=="preview")
status_callback();
}
*/
+
+ if($('a.button.enigma').length) //enigma plugin
+ {
+ $('a.button.enigma').remove()
+ $('#enigmamenu div.form-group').each(function() {
+ $('#compose-options').prepend(this)
+ });
+ }
}
// In compose/preview window we do not provide "Back" button, instead
@@ -770,6 +778,33 @@ if(rcmail.env.action=="preview")
// bootstrap_style(p.container);
// });
}
+ else if (rcmail.env.task == 'login') {
+
+ if($('#ifplcontainer')) // plugin persistent login
+ setTimeout(function() {
+
+ ifplcontainer.remove() // remove ugly previous one
+ // and recreate it
+ var html = `
+
+
+ Username
+
+
+
+
+ ` + rcmail.gettext('ifpl_rememberme', 'persistent_login') + `
+
+
+
+
+ ` + rcmail.gettext('ifpl_rememberme_hint', 'persistent_login') + `
+
+ `
+ $('#login-form table tbody').append(html);
+ })
+ }
+
rcmail.set_env({
thread_padding: '1.5rem',
@@ -913,7 +948,7 @@ if(rcmail.env.action=="preview")
if (context != document) {
$(supported_controls, context).addClass('form-control');
- $('[type=checkbox]', $('.propform', context)).addClass('form-check-input');
+// $('[type=checkbox]', $('.propform', context)).addClass('form-check-input');
}
// The same for some other checkboxes
@@ -934,6 +969,46 @@ if(rcmail.env.action=="preview")
$(this).addClass('box' + cl);
$('a', this).addClass('btn btn-primary btn-sm');
});
+
+ $('td.rowbuttons > a', context).addClass('btn');
+
+ // Make tables prettier
+ $('table:not(.table,.compact-table,.propform,.listing,.ui-datepicker-calendar)', context)
+ .filter(function() {
+ // exclude direct propform children and external content
+ return !$(this).parent().is('.propform')
+ && !$(this).parents('#message-header,.message-htmlpart,.message-partheaders,.boxinformation,.raw-tables').length;
+ })
+ .each(function() {
+ // TODO: Consider implementing automatic setting of table-responsive on window resize
+ var table = $(this).addClass('table');
+ table.parent().addClass('table-responsive-sm');
+ table.find('thead').addClass('thead-default');
+ });
+
+ // Make logon form prettier
+ if (rcmail.env.task == 'login' && context == document) {
+ $('#rcmloginsubmit').addClass('btn-lg text-uppercase w-100');
+ $('#rcmloginoauth').addClass('btn btn-secondary btn-lg w-100');
+ $('#login-form table tr').each(function() {
+ var input = $('input,select', this),
+ label = $('label', this),
+ icon_name = input.data('icon'),
+ icon = $('').attr('class', 'input-group-text icon ' + input.attr('name').replace('_', ''));
+
+ if (icon_name) {
+ icon.addClass(icon_name);
+ }
+
+ $(this).addClass('form-group row');
+ label.parent().css('display', 'none');
+ input.addClass(input.is('select') ? 'custom-select' : 'form-control')
+ .attr('placeholder', label.text())
+ .before($('').append(icon))
+ .parent().addClass('input-group input-group-lg');
+ });
+ }
+
}
function bootstrap_style(context)
@@ -2056,14 +2131,6 @@ if(rcmail.env.action=="preview")
screen_resize_headers();
- //for phone : back to normal
- //document.querySelector("meta[name=viewport]").setAttribute('content', 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0');
- var is_firefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
- if(is_firefox)
- document.querySelector("meta[name=viewport]").setAttribute('content', 'width=device-width, initial-scale=0.999, user-scalable=0');
- else
- document.querySelector("meta[name=viewport]").setAttribute('content', 'width=device-width, initial-scale=1, user-scalable=0');
-
};
function hide_content()
@@ -2120,8 +2187,6 @@ if(rcmail.env.action=="preview")
*/
function message_displayed(p)
{
- //for phone : permit zoom
- document.querySelector("meta[name=viewport]").setAttribute('content', 'width=device-width');
if (p.type == 'loading' && $('.iframe-loader:visible').length) {
// hide original message object, we don't need two "loaders"
@@ -4555,6 +4620,57 @@ if(UI.get_screen_mode()=="small" && document.getElementById("messagelist-content
instructionsReleaseToRefresh:' '
});
}
+
+if(document.getElementById("messagelist-content"))
+ {
+ document.getElementById("messagelist-content").addEventListener("wheel", (e) => {
+ scroll_mailbymail(e)
+ })
+ new ResizeObserver(resizemessagelist).observe(document.getElementById("messagelist-content"))
+ }
+
+
+function resizemessagelist()
+{
+if(!document.getElementById("messagelist-content"))return // not loaded yet
+var d=document.getElementById("messagelist-content")
+var h = d.offsetHeight
+if(!d.querySelector('.message'))return // not loaded yet
+var trsize = d.querySelector('.message').offsetHeight
+
+d.style.paddingBottom=h%trsize+"px"
+}
+
+
+function scroll_mailbymail(e)
+{
+ e.preventDefault();
+ e.stopPropagation();
+ var mlc=document.getElementById("messagelist-content")
+ var scrollTop=mlc.scrollTop
+
+ //find first shown tr
+ var trs=messagelist.querySelectorAll('tr')
+ for(var i=1;i15 && e.deltaY>0) i--;
+
+ if(e.deltaY>0)
+ i++
+ else
+ i--
+
+ if(i<0)i=0;
+ if(i>=trs.length)i=trs.length;
+
+ mlc.scrollTop=trs[i].offsetTop
+
+}
+
+
+
function refresh_mail_anim()
{
@@ -4919,7 +5035,6 @@ function colors_from_txt(txt)
if(!txt) return "AAA";
var lst_cols="DF71AE D45345 9877D5 6EB9C2 A47563 E1843B 62BF78 5196D5 EACF47";
-//var lst_cols="F44336 E91E63 9C27B0 673AB7 3F51B5 2196F3 03A9F4 00BCD4 009688 4CAF50 8BC34A CDDC39 FFEB3B FFC107 FF9800 FF5722 795548 607D8B";
var tab = lst_cols.split(' ');
var n = 0;
@@ -5050,27 +5165,31 @@ function autoscale_message_reset()
if(!use_autoscale) return;
delete document.body.dataset.originalscrollWidth
+
+
var divms = document.querySelector("#messagebody").style
divms.width=""
divms.height = ""
divms.transform=""
divms.transformOrigin="";
+if($('#divscale_default').data("scale")=="no") // ask for no more autoscale
+ return
setTimeout(function() { autoscale_message() }, 0);
-
}
function autoscale_message()
{
-
-
-
var scroolmod = window.innerWidth-$(document).width()
if(scroolmod >= 0) // no, scrollbar, it fit
- return
+ {
+ $('#divscale_default').css('display','none')
+ return
+ }
+$('#divscale_default').css('display','inline-block')
var s = document.body.scrollWidth
var divms = document.querySelector("#messagebody").style
@@ -5100,6 +5219,17 @@ var ratio = w/ow
divms.height = h * ratio +"px"
divms.transform="scale("+ratio+")"
divms.transformOrigin="0 0";
+
+
+
+}
+
+function scale_default(){
+$('#divscale_default').css('display','none')
+$('#divscale_default').data("scale","no")
+
+
+autoscale_message_reset()
}
go_PWA()
@@ -5177,4 +5307,5 @@ function plugin_switchIdent_addCbElastic2022($sw) {
}
return false;
-}
\ No newline at end of file
+}
+