[Web] Improve responsive design (#4171)
Complete styling for mobile devices Signed-off-by: Kristian Feldsam <feldsam@gmail.com>
This commit is contained in:
239
data/web/js/build/013-bootstrap-tabcollapse.js
Normal file
239
data/web/js/build/013-bootstrap-tabcollapse.js
Normal file
@@ -0,0 +1,239 @@
|
||||
!function ($) {
|
||||
|
||||
"use strict";
|
||||
|
||||
// TABCOLLAPSE CLASS DEFINITION
|
||||
// ======================
|
||||
|
||||
var TabCollapse = function (el, options) {
|
||||
this.options = options;
|
||||
this.$tabs = $(el);
|
||||
|
||||
this._accordionVisible = false; //content is attached to tabs at first
|
||||
this._initAccordion();
|
||||
this._checkStateOnResize();
|
||||
|
||||
|
||||
// checkState() has gone to setTimeout for making it possible to attach listeners to
|
||||
// shown-accordion.bs.tabcollapse event on page load.
|
||||
// See https://github.com/flatlogic/bootstrap-tabcollapse/issues/23
|
||||
var that = this;
|
||||
setTimeout(function() {
|
||||
that.checkState();
|
||||
}, 0);
|
||||
};
|
||||
|
||||
TabCollapse.DEFAULTS = {
|
||||
accordionClass: 'visible-xs',
|
||||
tabsClass: 'hidden-xs',
|
||||
accordionTemplate: function(heading, groupId, parentId, active) {
|
||||
return '<div class="panel panel-default">' +
|
||||
' <div class="panel-heading">' +
|
||||
' <h4 class="panel-title">' +
|
||||
' </h4>' +
|
||||
' </div>' +
|
||||
' <div id="' + groupId + '" class="panel-collapse collapse ' + (active ? 'in' : '') + '">' +
|
||||
' <div class="panel-body js-tabcollapse-panel-body">' +
|
||||
' </div>' +
|
||||
' </div>' +
|
||||
'</div>'
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
TabCollapse.prototype.checkState = function(){
|
||||
if (this.$tabs.is(':visible') && this._accordionVisible){
|
||||
this.showTabs();
|
||||
this._accordionVisible = false;
|
||||
} else if (this.$accordion.is(':visible') && !this._accordionVisible){
|
||||
this.showAccordion();
|
||||
this._accordionVisible = true;
|
||||
}
|
||||
};
|
||||
|
||||
TabCollapse.prototype.showTabs = function(){
|
||||
var view = this;
|
||||
this.$tabs.trigger($.Event('show-tabs.bs.tabcollapse'));
|
||||
|
||||
var $panelHeadings = this.$accordion.find('.js-tabcollapse-panel-heading').detach();
|
||||
|
||||
$panelHeadings.each(function() {
|
||||
var $panelHeading = $(this),
|
||||
$parentLi = $panelHeading.data('bs.tabcollapse.parentLi');
|
||||
|
||||
var $oldHeading = view._panelHeadingToTabHeading($panelHeading);
|
||||
|
||||
$parentLi.removeClass('active');
|
||||
if ($parentLi.parent().hasClass('dropdown-menu') && !$parentLi.siblings('li').hasClass('active')) {
|
||||
$parentLi.parent().parent().removeClass('active');
|
||||
}
|
||||
|
||||
if (!$oldHeading.hasClass('collapsed')) {
|
||||
$parentLi.addClass('active');
|
||||
$('.tab-pane').removeClass('active');
|
||||
$($panelHeading.attr('href')).addClass('active');
|
||||
if ($parentLi.parent().hasClass('dropdown-menu')) {
|
||||
$parentLi.parent().parent().addClass('active');
|
||||
}
|
||||
} else {
|
||||
$oldHeading.removeClass('collapsed');
|
||||
}
|
||||
|
||||
$parentLi.append($panelHeading);
|
||||
});
|
||||
|
||||
if (!$('li').hasClass('active')) {
|
||||
$('li').first().addClass('active')
|
||||
}
|
||||
|
||||
var $panelBodies = this.$accordion.find('.js-tabcollapse-panel-body');
|
||||
$panelBodies.each(function(){
|
||||
var $panelBody = $(this),
|
||||
$tabPane = $panelBody.data('bs.tabcollapse.tabpane');
|
||||
$tabPane.append($panelBody.contents().detach());
|
||||
});
|
||||
this.$accordion.html('');
|
||||
|
||||
if(this.options.updateLinks) {
|
||||
var $tabContents = this.getTabContentElement();
|
||||
$tabContents.find('[data-toggle-was="tab"], [data-toggle-was="pill"]').each(function() {
|
||||
var $el = $(this);
|
||||
var href = $el.attr('href').replace(/-collapse$/g, '');
|
||||
$el.attr({
|
||||
'data-toggle': $el.attr('data-toggle-was'),
|
||||
'data-toggle-was': '',
|
||||
'data-parent': '',
|
||||
href: href
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
this.$tabs.trigger($.Event('shown-tabs.bs.tabcollapse'));
|
||||
};
|
||||
|
||||
TabCollapse.prototype.getTabContentElement = function(){
|
||||
var $tabContents = $(this.options.tabContentSelector);
|
||||
if($tabContents.length === 0) {
|
||||
$tabContents = this.$tabs.siblings('.tab-content');
|
||||
}
|
||||
return $tabContents;
|
||||
};
|
||||
|
||||
TabCollapse.prototype.showAccordion = function(){
|
||||
this.$tabs.trigger($.Event('show-accordion.bs.tabcollapse'));
|
||||
|
||||
var $headings = this.$tabs.find('li:not(.dropdown) [data-toggle="tab"], li:not(.dropdown) [data-toggle="pill"]'),
|
||||
view = this;
|
||||
$headings.each(function(){
|
||||
var $heading = $(this),
|
||||
$parentLi = $heading.parent();
|
||||
$heading.data('bs.tabcollapse.parentLi', $parentLi);
|
||||
view.$accordion.append(view._createAccordionGroup(view.$accordion.attr('id'), $heading.detach()));
|
||||
});
|
||||
|
||||
if(this.options.updateLinks) {
|
||||
var parentId = this.$accordion.attr('id');
|
||||
var $selector = this.$accordion.find('.js-tabcollapse-panel-body');
|
||||
$selector.find('[data-toggle="tab"], [data-toggle="pill"]').each(function() {
|
||||
var $el = $(this);
|
||||
var href = $el.attr('href') + '-collapse';
|
||||
$el.attr({
|
||||
'data-toggle-was': $el.attr('data-toggle'),
|
||||
'data-toggle': 'collapse',
|
||||
'data-parent': '#' + parentId,
|
||||
href: href
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
this.$tabs.trigger($.Event('shown-accordion.bs.tabcollapse'));
|
||||
};
|
||||
|
||||
TabCollapse.prototype._panelHeadingToTabHeading = function($heading) {
|
||||
var href = $heading.attr('href').replace(/-collapse$/g, '');
|
||||
$heading.attr({
|
||||
'data-toggle': 'tab',
|
||||
'href': href,
|
||||
'data-parent': ''
|
||||
});
|
||||
return $heading;
|
||||
};
|
||||
|
||||
TabCollapse.prototype._tabHeadingToPanelHeading = function($heading, groupId, parentId, active) {
|
||||
$heading.addClass('js-tabcollapse-panel-heading ' + (active ? '' : 'collapsed'));
|
||||
$heading.attr({
|
||||
'data-toggle': 'collapse',
|
||||
'data-parent': '#' + parentId,
|
||||
'href': '#' + groupId
|
||||
});
|
||||
return $heading;
|
||||
};
|
||||
|
||||
TabCollapse.prototype._checkStateOnResize = function(){
|
||||
var view = this;
|
||||
$(window).resize(function(){
|
||||
clearTimeout(view._resizeTimeout);
|
||||
view._resizeTimeout = setTimeout(function(){
|
||||
view.checkState();
|
||||
}, 100);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
TabCollapse.prototype._initAccordion = function(){
|
||||
var randomString = function() {
|
||||
var result = "",
|
||||
possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||
for( var i=0; i < 5; i++ ) {
|
||||
result += possible.charAt(Math.floor(Math.random() * possible.length));
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
var srcId = this.$tabs.attr('id'),
|
||||
accordionId = (srcId ? srcId : randomString()) + '-accordion';
|
||||
|
||||
this.$accordion = $('<div class="panel-group ' + this.options.accordionClass + '" id="' + accordionId +'"></div>');
|
||||
this.$tabs.after(this.$accordion);
|
||||
this.$tabs.addClass(this.options.tabsClass);
|
||||
this.getTabContentElement().addClass(this.options.tabsClass);
|
||||
};
|
||||
|
||||
TabCollapse.prototype._createAccordionGroup = function(parentId, $heading){
|
||||
var tabSelector = $heading.attr('data-target'),
|
||||
active = $heading.data('bs.tabcollapse.parentLi').is('.active');
|
||||
|
||||
if (!tabSelector) {
|
||||
tabSelector = $heading.attr('href');
|
||||
tabSelector = tabSelector && tabSelector.replace(/.*(?=#[^\s]*$)/, ''); //strip for ie7
|
||||
}
|
||||
|
||||
var $tabPane = $(tabSelector),
|
||||
groupId = $tabPane.attr('id') + '-collapse',
|
||||
$panel = $(this.options.accordionTemplate($heading, groupId, parentId, active));
|
||||
$panel.find('.panel-heading > .panel-title').append(this._tabHeadingToPanelHeading($heading, groupId, parentId, active));
|
||||
$panel.find('.panel-body').append($tabPane.contents().detach())
|
||||
.data('bs.tabcollapse.tabpane', $tabPane);
|
||||
|
||||
return $panel;
|
||||
};
|
||||
|
||||
|
||||
|
||||
// TABCOLLAPSE PLUGIN DEFINITION
|
||||
// =======================
|
||||
|
||||
$.fn.tabCollapse = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this);
|
||||
var data = $this.data('bs.tabcollapse');
|
||||
var options = $.extend({}, TabCollapse.DEFAULTS, $this.data(), typeof option === 'object' && option);
|
||||
|
||||
if (!data) $this.data('bs.tabcollapse', new TabCollapse(this, options));
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.tabCollapse.Constructor = TabCollapse;
|
||||
|
||||
|
||||
}(window.jQuery);
|
@@ -94,6 +94,7 @@ $(document).ready(function() {
|
||||
|
||||
// selectpicker
|
||||
$('select').selectpicker({
|
||||
'styleBase': 'btn btn-xs-lg',
|
||||
'noneSelectedText': lang_footer.nothing_selected
|
||||
});
|
||||
|
||||
@@ -251,4 +252,27 @@ $(document).ready(function() {
|
||||
})
|
||||
});
|
||||
})
|
||||
|
||||
// responsive tabs
|
||||
$('.responsive-tabs').tabCollapse({
|
||||
tabsClass: 'hidden-xs',
|
||||
accordionClass: 'js-tabcollapse-panel-group visible-xs'
|
||||
});
|
||||
$(document).on("shown.bs.collapse shown.bs.tab", function (e) {
|
||||
var target = $(e.target);
|
||||
|
||||
if($(window).width() <= 767) {
|
||||
var offset = target.offset().top - 112;
|
||||
$("html, body").stop().animate({
|
||||
scrollTop: offset
|
||||
}, 300);
|
||||
}
|
||||
|
||||
if(target.hasClass('panel-collapse')){
|
||||
var id = e.target.id.replace(/-collapse$/g, '');
|
||||
if(id){
|
||||
localStorage.setItem('lastTag', '#'+id);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@@ -281,10 +281,10 @@ jQuery(function($){
|
||||
function process_table_data(data, table) {
|
||||
if (table == 'relayhoststable') {
|
||||
$.each(data, function (i, item) {
|
||||
item.action = '<div class="btn-group">' +
|
||||
'<a href="#" data-toggle="modal" data-target="#testTransportModal" data-transport-id="' + encodeURI(item.id) + '" data-transport-type="sender-dependent" class="btn btn-xs btn-default"><i class="bi bi-caret-right-fill"></i> Test</a>' +
|
||||
'<a href="/edit/relayhost/' + encodeURI(item.id) + '" class="btn btn-xs btn-default"><i class="bi bi-pencil-fill"></i> ' + lang.edit + '</a>' +
|
||||
'<a href="#" data-action="delete_selected" data-id="single-rlyhost" data-api-url="delete/relayhost" data-item="' + encodeURI(item.id) + '" class="btn btn-xs btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>' +
|
||||
item.action = '<div class="btn-group footable-actions">' +
|
||||
'<a href="#" data-toggle="modal" data-target="#testTransportModal" data-transport-id="' + encodeURI(item.id) + '" data-transport-type="sender-dependent" class="btn btn-xs btn-xs-third btn-default"><i class="bi bi-caret-right-fill"></i> Test</a>' +
|
||||
'<a href="/edit/relayhost/' + encodeURI(item.id) + '" class="btn btn-xs btn-xs-third btn-default"><i class="bi bi-pencil-fill"></i> ' + lang.edit + '</a>' +
|
||||
'<a href="#" data-action="delete_selected" data-id="single-rlyhost" data-api-url="delete/relayhost" data-item="' + encodeURI(item.id) + '" class="btn btn-xs btn-xs-third btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>' +
|
||||
'</div>';
|
||||
if (item.used_by_mailboxes == '') { item.in_use_by = item.used_by_domains; }
|
||||
else if (item.used_by_domains == '') { item.in_use_by = item.used_by_mailboxes; }
|
||||
@@ -299,10 +299,10 @@ jQuery(function($){
|
||||
if (item.username) {
|
||||
item.username = '<i style="color:#' + intToRGB(hashCode(item.nexthop)) + ';" class="bi bi-square-fill"></i> ' + item.username;
|
||||
}
|
||||
item.action = '<div class="btn-group">' +
|
||||
'<a href="#" data-toggle="modal" data-target="#testTransportModal" data-transport-id="' + encodeURI(item.id) + '" data-transport-type="transport-map" class="btn btn-xs btn-default"><i class="bi bi-caret-right-fill"></i> Test</a>' +
|
||||
'<a href="/edit/transport/' + encodeURI(item.id) + '" class="btn btn-xs btn-default"><i class="bi bi-pencil-fill"></i> ' + lang.edit + '</a>' +
|
||||
'<a href="#" data-action="delete_selected" data-id="single-transport" data-api-url="delete/transport" data-item="' + encodeURI(item.id) + '" class="btn btn-xs btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>' +
|
||||
item.action = '<div class="btn-group footable-actions">' +
|
||||
'<a href="#" data-toggle="modal" data-target="#testTransportModal" data-transport-id="' + encodeURI(item.id) + '" data-transport-type="transport-map" class="btn btn-xs btn-xs-third btn-default"><i class="bi bi-caret-right-fill"></i> Test</a>' +
|
||||
'<a href="/edit/transport/' + encodeURI(item.id) + '" class="btn btn-xs btn-xs-third btn-default"><i class="bi bi-pencil-fill"></i> ' + lang.edit + '</a>' +
|
||||
'<a href="#" data-action="delete_selected" data-id="single-transport" data-api-url="delete/transport" data-item="' + encodeURI(item.id) + '" class="btn btn-xs btn-xs-third btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>' +
|
||||
'</div>';
|
||||
item.chkbox = '<input type="checkbox" data-id="transports" name="multi_select" value="' + item.id + '" />';
|
||||
});
|
||||
@@ -313,22 +313,22 @@ jQuery(function($){
|
||||
return escapeHtml(i);
|
||||
});
|
||||
item.recipients = rcpts.join('<hr style="margin:1px!important">');
|
||||
item.action = '<div class="btn-group">' +
|
||||
item.action = '<div class="btn-group footable-actions">' +
|
||||
'<a href="#" data-toggle="modal" data-target="#showQueuedMsg" data-queue-id="' + encodeURI(item.queue_id) + '" class="btn btn-xs btn-default">' + lang.queue_show_message + '</a>' +
|
||||
'</div>';
|
||||
});
|
||||
} else if (table == 'forwardinghoststable') {
|
||||
$.each(data, function (i, item) {
|
||||
item.action = '<div class="btn-group">' +
|
||||
item.action = '<div class="btn-group footable-actions">' +
|
||||
'<a href="#" data-action="delete_selected" data-id="single-fwdhost" data-api-url="delete/fwdhost" data-item="' + encodeURI(item.host) + '" class="btn btn-xs btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>' +
|
||||
'</div>';
|
||||
item.chkbox = '<input type="checkbox" data-id="fwdhosts" name="multi_select" value="' + item.host + '" />';
|
||||
});
|
||||
} else if (table == 'oauth2clientstable') {
|
||||
$.each(data, function (i, item) {
|
||||
item.action = '<div class="btn-group">' +
|
||||
'<a href="/edit.php?oauth2client=' + encodeURI(item.id) + '" class="btn btn-xs btn-default"><i class="bi bi-pencil-fill"></i> ' + lang.edit + '</a>' +
|
||||
'<a href="#" data-action="delete_selected" data-id="single-oauth2-client" data-api-url="delete/oauth2-client" data-item="' + encodeURI(item.id) + '" class="btn btn-xs btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>' +
|
||||
item.action = '<div class="btn-group footable-actions">' +
|
||||
'<a href="/edit.php?oauth2client=' + encodeURI(item.id) + '" class="btn btn-xs btn-xs-half btn-default"><i class="bi bi-pencil-fill"></i> ' + lang.edit + '</a>' +
|
||||
'<a href="#" data-action="delete_selected" data-id="single-oauth2-client" data-api-url="delete/oauth2-client" data-item="' + encodeURI(item.id) + '" class="btn btn-xs btn-xs-half btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>' +
|
||||
'</div>';
|
||||
item.scope = "profile";
|
||||
item.grant_types = 'refresh_token password authorization_code';
|
||||
@@ -339,10 +339,10 @@ jQuery(function($){
|
||||
item.selected_domains = escapeHtml(item.selected_domains);
|
||||
item.selected_domains = item.selected_domains.toString().replace(/,/g, "<br>");
|
||||
item.chkbox = '<input type="checkbox" data-id="domain_admins" name="multi_select" value="' + item.username + '" />';
|
||||
item.action = '<div class="btn-group">' +
|
||||
'<a href="/edit/domainadmin/' + encodeURI(item.username) + '" class="btn btn-xs btn-default"><i class="bi bi-pencil-fill"></i> ' + lang.edit + '</a>' +
|
||||
'<a href="#" data-action="delete_selected" data-id="single-domain-admin" data-api-url="delete/domain-admin" data-item="' + encodeURI(item.username) + '" class="btn btn-xs btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>' +
|
||||
'<a href="/index.php?duallogin=' + encodeURIComponent(item.username) + '" class="btn btn-xs btn-success"><i class="bi bi-person-fill"></i> Login</a>' +
|
||||
item.action = '<div class="btn-group footable-actions">' +
|
||||
'<a href="/edit/domainadmin/' + encodeURI(item.username) + '" class="btn btn-xs btn-xs-third btn-default"><i class="bi bi-pencil-fill"></i> ' + lang.edit + '</a>' +
|
||||
'<a href="#" data-action="delete_selected" data-id="single-domain-admin" data-api-url="delete/domain-admin" data-item="' + encodeURI(item.username) + '" class="btn btn-xs btn-xs-third btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>' +
|
||||
'<a href="/index.php?duallogin=' + encodeURIComponent(item.username) + '" class="btn btn-xs btn-xs-third btn-success"><i class="bi bi-person-fill"></i> Login</a>' +
|
||||
'</div>';
|
||||
});
|
||||
} else if (table == 'adminstable') {
|
||||
@@ -353,9 +353,9 @@ jQuery(function($){
|
||||
item.usr = item.username;
|
||||
}
|
||||
item.chkbox = '<input type="checkbox" data-id="admins" name="multi_select" value="' + item.username + '" />';
|
||||
item.action = '<div class="btn-group">' +
|
||||
'<a href="/edit/admin/' + encodeURI(item.username) + '" class="btn btn-xs btn-default"><i class="bi bi-pencil-fill"></i> ' + lang.edit + '</a>' +
|
||||
'<a href="#" data-action="delete_selected" data-id="single-admin" data-api-url="delete/admin" data-item="' + encodeURI(item.username) + '" class="btn btn-xs btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>' +
|
||||
item.action = '<div class="btn-group footable-actions">' +
|
||||
'<a href="/edit/admin/' + encodeURI(item.username) + '" class="btn btn-xs btn-xs-half btn-default"><i class="bi bi-pencil-fill"></i> ' + lang.edit + '</a>' +
|
||||
'<a href="#" data-action="delete_selected" data-id="single-admin" data-api-url="delete/admin" data-item="' + encodeURI(item.username) + '" class="btn btn-xs btn-xs-half btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>' +
|
||||
'</div>';
|
||||
});
|
||||
}
|
||||
@@ -481,13 +481,13 @@ jQuery(function($){
|
||||
function add_table_row(table_id, type) {
|
||||
var row = $('<tr />');
|
||||
if (type == "app_link") {
|
||||
cols = '<td><input class="input-sm form-control" data-id="app_links" type="text" name="app" required></td>';
|
||||
cols += '<td><input class="input-sm form-control" data-id="app_links" type="text" name="href" required></td>';
|
||||
cols += '<td><a href="#" role="button" class="btn btn-xs btn-default" type="button">' + lang.remove_row + '</a></td>';
|
||||
cols = '<td><input class="input-sm input-xs-lg form-control" data-id="app_links" type="text" name="app" required></td>';
|
||||
cols += '<td><input class="input-sm input-xs-lg form-control" data-id="app_links" type="text" name="href" required></td>';
|
||||
cols += '<td><a href="#" role="button" class="btn btn-sm btn-xs-lg btn-default" type="button">' + lang.remove_row + '</a></td>';
|
||||
} else if (type == "f2b_regex") {
|
||||
cols = '<td><input style="text-align:center" class="input-sm form-control" data-id="f2b_regex" type="text" value="+" disabled></td>';
|
||||
cols += '<td><input class="input-sm form-control regex-input" data-id="f2b_regex" type="text" name="regex" required></td>';
|
||||
cols += '<td><a href="#" role="button" class="btn btn-xs btn-default" type="button">' + lang.remove_row + '</a></td>';
|
||||
cols = '<td><input style="text-align:center" class="input-sm input-xs-lg form-control" data-id="f2b_regex" type="text" value="+" disabled></td>';
|
||||
cols += '<td><input class="input-sm input-xs-lg form-control regex-input" data-id="f2b_regex" type="text" name="regex" required></td>';
|
||||
cols += '<td><a href="#" role="button" class="btn btn-sm btn-xs-lg btn-default" type="button">' + lang.remove_row + '</a></td>';
|
||||
}
|
||||
row.append(cols);
|
||||
table_id.append(row);
|
||||
|
@@ -287,15 +287,17 @@ jQuery(function($){
|
||||
item.def_quota_for_mbox = humanFileSize(item.def_quota_for_mbox);
|
||||
item.max_quota_for_mbox = humanFileSize(item.max_quota_for_mbox);
|
||||
item.chkbox = '<input type="checkbox" data-id="domain" name="multi_select" value="' + encodeURIComponent(item.domain_name) + '" />';
|
||||
item.action = '<div class="btn-group">';
|
||||
item.action = '<div class="btn-group footable-actions">';
|
||||
if (role == "admin") {
|
||||
item.action += '<a href="/edit/domain/' + encodeURIComponent(item.domain_name) + '" class="btn btn-xs btn-default"><i class="bi bi-pencil-fill"></i> ' + lang.edit + '</a>' +
|
||||
'<a href="#" data-action="delete_selected" data-id="single-domain" data-api-url="delete/domain" data-item="' + encodeURIComponent(item.domain_name) + '" class="btn btn-xs btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>';
|
||||
item.action += '<a href="/edit/domain/' + encodeURIComponent(item.domain_name) + '" class="btn btn-xs btn-xs-third btn-default"><i class="bi bi-pencil-fill"></i> ' + lang.edit + '</a>' +
|
||||
'<a href="#" data-action="delete_selected" data-id="single-domain" data-api-url="delete/domain" data-item="' + encodeURIComponent(item.domain_name) + '" class="btn btn-xs btn-xs-third btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>' +
|
||||
'<a href="#dnsInfoModal" class="btn btn-xs btn-xs-third btn-info" data-toggle="modal" data-domain="' + encodeURIComponent(item.domain_name) + '"><i class="bi bi-globe2"></i> DNS</a></div>';
|
||||
}
|
||||
else {
|
||||
item.action += '<a href="/edit/domain/' + encodeURIComponent(item.domain_name) + '" class="btn btn-xs btn-default"><i class="bi bi-pencil-fill"></i> ' + lang.edit + '</a>';
|
||||
item.action += '<a href="/edit/domain/' + encodeURIComponent(item.domain_name) + '" class="btn btn-xs btn-xs-half btn-default"><i class="bi bi-pencil-fill"></i> ' + lang.edit + '</a>' +
|
||||
'<a href="#dnsInfoModal" class="btn btn-xs btn-xs-half btn-info" data-toggle="modal" data-domain="' + encodeURIComponent(item.domain_name) + '"><i class="bi bi-globe2"></i> DNS</a></div>';
|
||||
}
|
||||
item.action += '<a href="#dnsInfoModal" class="btn btn-xs btn-info" data-toggle="modal" data-domain="' + encodeURIComponent(item.domain_name) + '"><i class="bi bi-globe2"></i> DNS</a></div>';
|
||||
|
||||
if (item.backupmx == 1) {
|
||||
if (item.relay_unknown_only == 1) {
|
||||
item.domain_name = '<div class="label label-info">Relay Non-Local</div> ' + item.domain_name;
|
||||
@@ -441,19 +443,22 @@ jQuery(function($){
|
||||
item.quarantine_category = lang.q_all;
|
||||
}
|
||||
if (acl_data.login_as === 1) {
|
||||
item.action = '<div class="btn-group">' +
|
||||
'<a href="/edit/mailbox/' + encodeURIComponent(item.username) + '" class="btn btn-xs btn-default"><i class="bi bi-pencil-fill"></i> ' + lang.edit + '</a>' +
|
||||
'<a href="#" data-action="delete_selected" data-id="single-mailbox" data-api-url="delete/mailbox" data-item="' + encodeURIComponent(item.username) + '" class="btn btn-xs btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>' +
|
||||
'<a href="/index.php?duallogin=' + encodeURIComponent(item.username) + '" class="login_as btn btn-xs btn-success"><i class="bi bi-person-fill"></i> Login</a>';
|
||||
var btnSize = 'btn-xs-third';
|
||||
if (ALLOW_ADMIN_EMAIL_LOGIN) btnSize = 'btn-xs-quart';
|
||||
|
||||
item.action = '<div class="btn-group footable-actions">' +
|
||||
'<a href="/edit/mailbox/' + encodeURIComponent(item.username) + '" class="btn btn-xs ' + btnSize + ' btn-default"><i class="bi bi-pencil-fill"></i> ' + lang.edit + '</a>' +
|
||||
'<a href="#" data-action="delete_selected" data-id="single-mailbox" data-api-url="delete/mailbox" data-item="' + encodeURIComponent(item.username) + '" class="btn btn-xs ' + btnSize + ' btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>' +
|
||||
'<a href="/index.php?duallogin=' + encodeURIComponent(item.username) + '" class="login_as btn btn-xs ' + btnSize + ' btn-success"><i class="bi bi-person-fill"></i> Login</a>';
|
||||
if (ALLOW_ADMIN_EMAIL_LOGIN) {
|
||||
item.action += '<a href="/sogo-auth.php?login=' + encodeURIComponent(item.username) + '" class="login_as btn btn-xs btn-primary" target="_blank"><i class="bi bi-envelope-fill"></i> SOGo</a>';
|
||||
item.action += '<a href="/sogo-auth.php?login=' + encodeURIComponent(item.username) + '" class="login_as btn btn-xs ' + btnSize + ' btn-primary" target="_blank"><i class="bi bi-envelope-fill"></i> SOGo</a>';
|
||||
}
|
||||
item.action += '</div>';
|
||||
}
|
||||
else {
|
||||
item.action = '<div class="btn-group">' +
|
||||
'<a href="/edit/mailbox/' + encodeURIComponent(item.username) + '" class="btn btn-xs btn-default"><i class="bi bi-pencil-fill"></i> ' + lang.edit + '</a>' +
|
||||
'<a href="#" data-action="delete_selected" data-id="single-mailbox" data-api-url="delete/mailbox" data-item="' + encodeURIComponent(item.username) + '" class="btn btn-xs btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>' +
|
||||
'<a href="/edit/mailbox/' + encodeURIComponent(item.username) + '" class="btn btn-xs btn-xs-half btn-default"><i class="bi bi-pencil-fill"></i> ' + lang.edit + '</a>' +
|
||||
'<a href="#" data-action="delete_selected" data-id="single-mailbox" data-api-url="delete/mailbox" data-item="' + encodeURIComponent(item.username) + '" class="btn btn-xs btn-xs-half btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>' +
|
||||
'</div>';
|
||||
}
|
||||
item.in_use = '<div class="progress">' +
|
||||
@@ -528,9 +533,9 @@ jQuery(function($){
|
||||
} else {
|
||||
item.multiple_bookings = '<span id="active-script" class="label label-danger">' + lang.booking_custom_short + ' (' + item.multiple_bookings + ')</span>';
|
||||
}
|
||||
item.action = '<div class="btn-group">' +
|
||||
'<a href="/edit/resource/' + encodeURIComponent(item.name) + '" class="btn btn-xs btn-default"><i class="bi bi-pencil-fill"></i> ' + lang.edit + '</a>' +
|
||||
'<a href="#" data-action="delete_selected" data-id="single-resource" data-api-url="delete/resource" data-item="' + item.name + '" class="btn btn-xs btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>' +
|
||||
item.action = '<div class="btn-group footable-actions">' +
|
||||
'<a href="/edit/resource/' + encodeURIComponent(item.name) + '" class="btn btn-xs btn-xs-half btn-default"><i class="bi bi-pencil-fill"></i> ' + lang.edit + '</a>' +
|
||||
'<a href="#" data-action="delete_selected" data-id="single-resource" data-api-url="delete/resource" data-item="' + item.name + '" class="btn btn-xs btn-xs-half btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>' +
|
||||
'</div>';
|
||||
item.chkbox = '<input type="checkbox" data-id="resource" name="multi_select" value="' + encodeURIComponent(item.name) + '" />';
|
||||
item.name = escapeHtml(item.name);
|
||||
@@ -594,9 +599,9 @@ jQuery(function($){
|
||||
},
|
||||
success: function (data) {
|
||||
$.each(data, function (i, item) {
|
||||
item.action = '<div class="btn-group">' +
|
||||
'<a href="/edit/bcc/' + item.id + '" class="btn btn-xs btn-default"><i class="bi bi-pencil-fill"></i> ' + lang.edit + '</a>' +
|
||||
'<a href="#" data-action="delete_selected" data-id="single-bcc" data-api-url="delete/bcc" data-item="' + item.id + '" class="btn btn-xs btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>' +
|
||||
item.action = '<div class="btn-group footable-actions">' +
|
||||
'<a href="/edit/bcc/' + item.id + '" class="btn btn-xs btn-xs-half btn-default"><i class="bi bi-pencil-fill"></i> ' + lang.edit + '</a>' +
|
||||
'<a href="#" data-action="delete_selected" data-id="single-bcc" data-api-url="delete/bcc" data-item="' + item.id + '" class="btn btn-xs btn-xs-half btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>' +
|
||||
'</div>';
|
||||
item.chkbox = '<input type="checkbox" data-id="bcc" name="multi_select" value="' + item.id + '" />';
|
||||
item.local_dest = escapeHtml(item.local_dest);
|
||||
@@ -664,9 +669,9 @@ jQuery(function($){
|
||||
$.each(data, function (i, item) {
|
||||
item.recipient_map_old = escapeHtml(item.recipient_map_old);
|
||||
item.recipient_map_new = escapeHtml(item.recipient_map_new);
|
||||
item.action = '<div class="btn-group">' +
|
||||
'<a href="/edit/recipient_map/' + item.id + '" class="btn btn-xs btn-default"><i class="bi bi-pencil-fill"></i> ' + lang.edit + '</a>' +
|
||||
'<a href="#" data-action="delete_selected" data-id="single-recipient_map" data-api-url="delete/recipient_map" data-item="' + item.id + '" class="btn btn-xs btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>' +
|
||||
item.action = '<div class="btn-group footable-actions">' +
|
||||
'<a href="/edit/recipient_map/' + item.id + '" class="btn btn-xs btn-xs-half btn-default"><i class="bi bi-pencil-fill"></i> ' + lang.edit + '</a>' +
|
||||
'<a href="#" data-action="delete_selected" data-id="single-recipient_map" data-api-url="delete/recipient_map" data-item="' + item.id + '" class="btn btn-xs btn-xs-half btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>' +
|
||||
'</div>';
|
||||
item.chkbox = '<input type="checkbox" data-id="recipient_map" name="multi_select" value="' + item.id + '" />';
|
||||
});
|
||||
@@ -734,9 +739,9 @@ jQuery(function($){
|
||||
} else {
|
||||
item.parameters = '<code>' + escapeHtml(item.parameters) + '</code>';
|
||||
}
|
||||
item.action = '<div class="btn-group">' +
|
||||
'<a href="/edit/tls_policy_map/' + item.id + '" class="btn btn-xs btn-default"><i class="bi bi-pencil-fill"></i> ' + lang.edit + '</a>' +
|
||||
'<a href="#" data-action="delete_selected" data-id="single-tls-policy-map" data-api-url="delete/tls-policy-map" data-item="' + item.id + '" class="btn btn-xs btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>' +
|
||||
item.action = '<div class="btn-group footable-actions">' +
|
||||
'<a href="/edit/tls_policy_map/' + item.id + '" class="btn btn-xs btn-xs-half btn-default"><i class="bi bi-pencil-fill"></i> ' + lang.edit + '</a>' +
|
||||
'<a href="#" data-action="delete_selected" data-id="single-tls-policy-map" data-api-url="delete/tls-policy-map" data-item="' + item.id + '" class="btn btn-xs btn-xs-half btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>' +
|
||||
'</div>';
|
||||
item.chkbox = '<input type="checkbox" data-id="tls-policy-map" name="multi_select" value="' + item.id + '" />';
|
||||
});
|
||||
@@ -799,9 +804,9 @@ jQuery(function($){
|
||||
},
|
||||
success: function (data) {
|
||||
$.each(data, function (i, item) {
|
||||
item.action = '<div class="btn-group">' +
|
||||
'<a href="/edit/alias/' + encodeURIComponent(item.id) + '" class="btn btn-xs btn-default"><i class="bi bi-pencil-fill"></i> ' + lang.edit + '</a>' +
|
||||
'<a href="#" data-action="delete_selected" data-id="single-alias" data-api-url="delete/alias" data-item="' + encodeURIComponent(item.id) + '" class="btn btn-xs btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>' +
|
||||
item.action = '<div class="btn-group footable-actions">' +
|
||||
'<a href="/edit/alias/' + encodeURIComponent(item.id) + '" class="btn btn-xs btn-xs-half btn-default"><i class="bi bi-pencil-fill"></i> ' + lang.edit + '</a>' +
|
||||
'<a href="#" data-action="delete_selected" data-id="single-alias" data-api-url="delete/alias" data-item="' + encodeURIComponent(item.id) + '" class="btn btn-xs btn-xs-half btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>' +
|
||||
'</div>';
|
||||
item.chkbox = '<input type="checkbox" data-id="alias" name="multi_select" value="' + encodeURIComponent(item.id) + '" />';
|
||||
item.goto = escapeHtml(item.goto.replace(/,/g, " "));
|
||||
@@ -894,10 +899,10 @@ jQuery(function($){
|
||||
},
|
||||
success: function (data) {
|
||||
$.each(data, function (i, item) {
|
||||
item.action = '<div class="btn-group">' +
|
||||
'<a href="/edit/aliasdomain/' + encodeURIComponent(item.alias_domain) + '" class="btn btn-xs btn-default"><i class="bi bi-pencil-fill"></i> ' + lang.edit + '</a>' +
|
||||
'<a href="#" data-action="delete_selected" data-id="single-alias-domain" data-api-url="delete/alias-domain" data-item="' + encodeURIComponent(item.alias_domain) + '" class="btn btn-xs btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>' +
|
||||
'<a href="#dnsInfoModal" class="btn btn-xs btn-info" data-toggle="modal" data-domain="' + encodeURIComponent(item.alias_domain) + '"><i class="bi bi-question-lg"></i> DNS</a></div>' +
|
||||
item.action = '<div class="btn-group footable-actions">' +
|
||||
'<a href="/edit/aliasdomain/' + encodeURIComponent(item.alias_domain) + '" class="btn btn-xs btn-xs-third btn-default"><i class="bi bi-pencil-fill"></i> ' + lang.edit + '</a>' +
|
||||
'<a href="#" data-action="delete_selected" data-id="single-alias-domain" data-api-url="delete/alias-domain" data-item="' + encodeURIComponent(item.alias_domain) + '" class="btn btn-xs btn-xs-third btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>' +
|
||||
'<a href="#dnsInfoModal" class="btn btn-xs btn-xs-third btn-info" data-toggle="modal" data-domain="' + encodeURIComponent(item.alias_domain) + '"><i class="bi bi-globe2"></i> DNS</a></div>' +
|
||||
'</div>';
|
||||
item.chkbox = '<input type="checkbox" data-id="alias-domain" name="multi_select" value="' + encodeURIComponent(item.alias_domain) + '" />';
|
||||
if(item.parent_is_backupmx == '1') {
|
||||
@@ -974,9 +979,9 @@ jQuery(function($){
|
||||
item.exclude = '<code>' + item.exclude + '</code>';
|
||||
}
|
||||
item.server_w_port = escapeHtml(item.user1) + '@' + item.host1 + ':' + item.port1;
|
||||
item.action = '<div class="btn-group">' +
|
||||
'<a href="/edit/syncjob/' + item.id + '" class="btn btn-xs btn-default"><i class="bi bi-pencil-fill"></i> ' + lang.edit + '</a>' +
|
||||
'<a href="#" data-action="delete_selected" data-id="single-syncjob" data-api-url="delete/syncjob" data-item="' + item.id + '" class="btn btn-xs btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>' +
|
||||
item.action = '<div class="btn-group footable-actions">' +
|
||||
'<a href="/edit/syncjob/' + item.id + '" class="btn btn-xs btn-xs-half btn-default"><i class="bi bi-pencil-fill"></i> ' + lang.edit + '</a>' +
|
||||
'<a href="#" data-action="delete_selected" data-id="single-syncjob" data-api-url="delete/syncjob" data-item="' + item.id + '" class="btn btn-xs btn-xs-half btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>' +
|
||||
'</div>';
|
||||
item.chkbox = '<input type="checkbox" data-id="syncjob" name="multi_select" value="' + item.id + '" />';
|
||||
if (item.is_running == 1) {
|
||||
@@ -1052,9 +1057,9 @@ jQuery(function($){
|
||||
}
|
||||
item.script_data = '<pre style="margin:0px">' + escapeHtml(item.script_data) + '</pre>'
|
||||
item.filter_type = '<div class="label label-default">' + item.filter_type.charAt(0).toUpperCase() + item.filter_type.slice(1).toLowerCase() + '</div>'
|
||||
item.action = '<div class="btn-group">' +
|
||||
'<a href="/edit/filter/' + item.id + '" class="btn btn-xs btn-default"><i class="bi bi-pencil-fill"></i> ' + lang.edit + '</a>' +
|
||||
'<a href="#" data-action="delete_selected" data-id="single-filter" data-api-url="delete/filter" data-item="' + encodeURIComponent(item.id) + '" class="btn btn-xs btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>' +
|
||||
item.action = '<div class="btn-group footable-actions">' +
|
||||
'<a href="/edit/filter/' + item.id + '" class="btn btn-xs btn-xs-half btn-default"><i class="bi bi-pencil-fill"></i> ' + lang.edit + '</a>' +
|
||||
'<a href="#" data-action="delete_selected" data-id="single-filter" data-api-url="delete/filter" data-item="' + encodeURIComponent(item.id) + '" class="btn btn-xs btn-xs-half btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>' +
|
||||
'</div>';
|
||||
item.chkbox = '<input type="checkbox" data-id="filter_item" name="multi_select" value="' + item.id + '" />'
|
||||
});
|
||||
|
@@ -144,7 +144,7 @@ jQuery(function($){
|
||||
success: function (data) {
|
||||
$.each(data, function (i, item) {
|
||||
if (acl_data.spam_alias === 1) {
|
||||
item.action = '<div class="btn-group">' +
|
||||
item.action = '<div class="btn-group footable-actions">' +
|
||||
'<a href="#" data-action="delete_selected" data-id="single-tla" data-api-url="delete/time_limited_alias" data-item="' + encodeURIComponent(item.address) + '" class="btn btn-xs btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>' +
|
||||
'</div>';
|
||||
item.chkbox = '<input type="checkbox" data-id="tla" name="multi_select" value="' + encodeURIComponent(item.address) + '" />';
|
||||
@@ -204,9 +204,9 @@ jQuery(function($){
|
||||
}
|
||||
item.server_w_port = escapeHtml(item.user1 + '@' + item.host1 + ':' + item.port1);
|
||||
if (acl_data.syncjobs === 1) {
|
||||
item.action = '<div class="btn-group">' +
|
||||
'<a href="/edit/syncjob/' + item.id + '" class="btn btn-xs btn-default"><i class="bi bi-pencil-fill"></i> ' + lang.edit + '</a>' +
|
||||
'<a href="#" data-action="delete_selected" data-id="single-syncjob" data-api-url="delete/syncjob" data-item="' + item.id + '" class="btn btn-xs btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>' +
|
||||
item.action = '<div class="btn-group footable-actions">' +
|
||||
'<a href="/edit/syncjob/' + item.id + '" class="btn btn-xs btn-xs-half btn-default"><i class="bi bi-pencil-fill"></i> ' + lang.edit + '</a>' +
|
||||
'<a href="#" data-action="delete_selected" data-id="single-syncjob" data-api-url="delete/syncjob" data-item="' + item.id + '" class="btn btn-xs btn-xs-half btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>' +
|
||||
'</div>';
|
||||
item.chkbox = '<input type="checkbox" data-id="syncjob" name="multi_select" value="' + item.id + '" />';
|
||||
}
|
||||
@@ -258,9 +258,9 @@ jQuery(function($){
|
||||
$.each(data, function (i, item) {
|
||||
item.name = escapeHtml(item.name);
|
||||
if (acl_data.app_passwds === 1) {
|
||||
item.action = '<div class="btn-group">' +
|
||||
'<a href="/edit/app-passwd/' + item.id + '" class="btn btn-xs btn-default"><i class="bi bi-pencil-fill"></i> ' + lang.edit + '</a>' +
|
||||
'<a href="#" data-action="delete_selected" data-id="single-apppasswd" data-api-url="delete/app-passwd" data-item="' + item.id + '" class="btn btn-xs btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>' +
|
||||
item.action = '<div class="btn-group footable-actions">' +
|
||||
'<a href="/edit/app-passwd/' + item.id + '" class="btn btn-xs btn-xs-half btn-default"><i class="bi bi-pencil-fill"></i> ' + lang.edit + '</a>' +
|
||||
'<a href="#" data-action="delete_selected" data-id="single-apppasswd" data-api-url="delete/app-passwd" data-item="' + item.id + '" class="btn btn-xs btn-xs-half btn-danger"><i class="bi bi-trash"></i> ' + lang.remove + '</a>' +
|
||||
'</div>';
|
||||
item.chkbox = '<input type="checkbox" data-id="apppasswd" name="multi_select" value="' + item.id + '" />';
|
||||
}
|
||||
|
Reference in New Issue
Block a user