add fold marks

This commit is contained in:
Uwe Steinmann 2024-10-31 18:09:19 +01:00
parent 63ba189b3f
commit a7342b600e
2 changed files with 31 additions and 30 deletions

View File

@ -26,9 +26,9 @@ chzn_template_func = function (state) { /* {{{ */
html += '</span>'; html += '</span>';
var $newstate = $(html); var $newstate = $(html);
return $newstate; return $newstate;
}; }; /* }}} */
function escapeHtml(text) { function escapeHtml(text) { /* {{{ */
var map = { var map = {
'&': '&amp;', '&': '&amp;',
'<': '&lt;', '<': '&lt;',
@ -38,7 +38,7 @@ function escapeHtml(text) {
}; };
return text.replace(/[&<>"']/g, function(m) { return map[m]; }); return text.replace(/[&<>"']/g, function(m) { return map[m]; });
} } /* }}} */
/** /**
* Format bytes as human-readable text. * Format bytes as human-readable text.
@ -50,7 +50,7 @@ function escapeHtml(text) {
* *
* @return Formatted string. * @return Formatted string.
*/ */
function formatFileSize(bytes, si=false, dp=1) { function formatFileSize(bytes, si=false, dp=1) { /* {{{ */
const thresh = si ? 1000 : 1024; const thresh = si ? 1000 : 1024;
if (Math.abs(bytes) < thresh) { if (Math.abs(bytes) < thresh) {
@ -70,7 +70,7 @@ function formatFileSize(bytes, si=false, dp=1) {
return bytes.toFixed(dp) + ' ' + units[u]; return bytes.toFixed(dp) + ' ' + units[u];
} } /* }}} */
function treeFolderSelected(formid, nodeid, nodename) { function treeFolderSelected(formid, nodeid, nodename) {
$('#'+formid).val(nodeid); $('#'+formid).val(nodeid);
@ -84,7 +84,7 @@ function treeDocumentSelected(formid, nodeid, nodename) {
$('#docChooser'+formid).modal('hide'); $('#docChooser'+formid).modal('hide');
} }
function initMost() { function initMost() { /* {{{ */
$('.datepicker, #expirationdate, #createstartdate, #createenddate, #expirationstartdate, #expirationenddate') $('.datepicker, #expirationdate, #createstartdate, #createenddate, #expirationstartdate, #expirationenddate')
.datepicker({todayHighlight: true, toggleActive: true}) .datepicker({todayHighlight: true, toggleActive: true})
.on('changeDate', function(ev){ .on('changeDate', function(ev){
@ -309,26 +309,27 @@ function initMost() {
return this return this
} }
}); /* }}} */ }); /* }}} */
} } /* }}} */
$(document).ready( function() { $(document).ready( function() {
/* close popovers when clicking somewhere except in the popover or the /* close popovers when clicking somewhere except in the popover or the
* remove icon * remove icon
*/ */
$('html').on('click', function(e) { $('html').on('click', function(e) { /* {{{ */
if (typeof $(e.target).data('original-title') == 'undefined' && !$(e.target).parents().is('.popover.in') && !$(e.target).is('.fa fa-remove')) { if (typeof $(e.target).data('original-title') == 'undefined' && !$(e.target).parents().is('.popover.in') && !$(e.target).is('.fa fa-remove')) {
$('[data-original-title]').popover('hide'); $('[data-original-title]').popover('hide');
} }
}); }); /* }}} */
$('body').on('hidden', '.modal', function () { $('body').on('hidden', '.modal', function () { /* {{{ */
$(this).removeData('modal'); $(this).removeData('modal');
}); }); /* }}} */
$('body').on('click', '[data-toggle="modal"]', function(ev){
$('body').on('click', '[data-toggle="modal"]', function(ev){ /* {{{ */
/* Also set the title */ /* Also set the title */
if($(this).data("modal-title")) if($(this).data("modal-title"))
$($(this).data("target")+' .modal-header h3').html($(this).data("modal-title")); $($(this).data("target")+' .modal-header h3').html($(this).data("modal-title"));
}); }); /* }}} */
$('body').on('touchstart.dropdown', '.dropdown-menu', function (e) { e.stopPropagation(); }); $('body').on('touchstart.dropdown', '.dropdown-menu', function (e) { e.stopPropagation(); });

View File

@ -26,9 +26,9 @@ chzn_template_func = function (state) { /* {{{ */
html += '</span>'; html += '</span>';
var $newstate = $(html); var $newstate = $(html);
return $newstate; return $newstate;
}; }; /* }}} */
function escapeHtml(text) { function escapeHtml(text) { /* {{{ */
var map = { var map = {
'&': '&amp;', '&': '&amp;',
'<': '&lt;', '<': '&lt;',
@ -38,7 +38,7 @@ function escapeHtml(text) {
}; };
return text.replace(/[&<>"']/g, function(m) { return map[m]; }); return text.replace(/[&<>"']/g, function(m) { return map[m]; });
} } /* }}} */
/** /**
* Format bytes as human-readable text. * Format bytes as human-readable text.
@ -50,7 +50,7 @@ function escapeHtml(text) {
* *
* @return Formatted string. * @return Formatted string.
*/ */
function formatFileSize(bytes, si=false, dp=1) { function formatFileSize(bytes, si=false, dp=1) { /* {{{ */
const thresh = si ? 1000 : 1024; const thresh = si ? 1000 : 1024;
if (Math.abs(bytes) < thresh) { if (Math.abs(bytes) < thresh) {
@ -70,7 +70,7 @@ function formatFileSize(bytes, si=false, dp=1) {
return bytes.toFixed(dp) + ' ' + units[u]; return bytes.toFixed(dp) + ' ' + units[u];
} } /* }}} */
function treeFolderSelected(formid, nodeid, nodename) { function treeFolderSelected(formid, nodeid, nodename) {
$('#'+formid).val(nodeid); $('#'+formid).val(nodeid);
@ -84,7 +84,7 @@ function treeDocumentSelected(formid, nodeid, nodename) {
$('#docChooser'+formid).modal('hide'); $('#docChooser'+formid).modal('hide');
} }
function initMost() { function initMost() { /* {{{ */
$('.datepicker, #expirationdate, #createstartdate, #createenddate, #expirationstartdate, #expirationenddate') $('.datepicker, #expirationdate, #createstartdate, #createenddate, #expirationstartdate, #expirationenddate')
.datepicker({todayHighlight: true, toggleActive: true, autoclose: "true", zIndexOffset: "1040"}) .datepicker({todayHighlight: true, toggleActive: true, autoclose: "true", zIndexOffset: "1040"})
/* /*
@ -321,10 +321,10 @@ function initMost() {
return this return this
} }
}); /* }}} */ }); /* }}} */
} } /* }}} */
$(document).ready( function() { $(document).ready( function() {
$('body').on('click', '.dropdown-menu a.dropdown-toggle', function (e) { $('body').on('click', '.dropdown-menu a.dropdown-toggle', function (e) { /* {{{ */
if (!$(this).next().hasClass('show')) { if (!$(this).next().hasClass('show')) {
$(this).parents('.dropdown-menu').first().find('.show').removeClass("show"); $(this).parents('.dropdown-menu').first().find('.show').removeClass("show");
} }
@ -338,33 +338,33 @@ $(document).ready( function() {
return false; return false;
}); }); /* }}} */
/* close popovers when clicking somewhere except in the popover or the /* close popovers when clicking somewhere except in the popover or the
* remove icon * remove icon
*/ */
$('html').on('click', function(e) { $('html').on('click', function(e) { /* {{{ */
if (typeof $(e.target).data('original-title') == 'undefined' && !$(e.target).parents().is('.popover.in') && !$(e.target).is('.fa fa-remove')) { if (typeof $(e.target).data('original-title') == 'undefined' && !$(e.target).parents().is('.popover.in') && !$(e.target).is('.fa fa-remove')) {
$('[data-original-title]').popover('hide'); $('[data-original-title]').popover('hide');
} }
}); }); /* }}} */
$('body').on('hidden', '.modal', function () { $('body').on('hidden', '.modal', function () { /* {{{ */
$(this).removeData('modal'); $(this).removeData('modal');
}); }); /* }}} */
/* Bootstrap 4 does not support to the remote loading of the modal content /* Bootstrap 4 does not support to the remote loading of the modal content
* anymore. This adds it by using jquery. * anymore. This adds it by using jquery.
*/ */
$('body').on('click', '[data-toggle="modal"]', function(ev){ $('body').on('click', '[data-toggle="modal"]', function(ev){ /* {{{ */
ev.preventDefault(); ev.preventDefault();
$($(this).data("target")+' .modal-body').load($(this).data("remote")); $($(this).data("target")+' .modal-body').load($(this).data("remote"));
/* Also set the title */ /* Also set the title */
if($(this).data("modal-title")) if($(this).data("modal-title"))
$($(this).data("target")+' .modal-header h3').html($(this).data("modal-title")); $($(this).data("target")+' .modal-header h3').html($(this).data("modal-title"));
}); }); /* }}} */
$('body').on('click', '.show-hide-password a', function(ev){ $('body').on('click', '.show-hide-password a', function(ev) { /* {{{ */
ev.preventDefault(); ev.preventDefault();
// console.log($(this).closest('input')); // console.log($(this).closest('input'));
// console.log($(ev.target).parent().parent().children('input')); // console.log($(ev.target).parent().parent().children('input'));
@ -377,7 +377,7 @@ $(document).ready( function() {
$('.show-hide-password i').removeClass( "fa-eye-slash" ); $('.show-hide-password i').removeClass( "fa-eye-slash" );
$('.show-hide-password i').addClass( "fa-eye" ); $('.show-hide-password i').addClass( "fa-eye" );
} }
}); }); /* }}} */
// $('body').on('touchstart.dropdown', '.dropdown-menu', function (e) { e.stopPropagation(); }); // $('body').on('touchstart.dropdown', '.dropdown-menu', function (e) { e.stopPropagation(); });