Redmine 4.1.7

This commit is contained in:
Manuel Cillero 2023-07-07 08:08:27 +02:00
parent 55458d3479
commit 3ca3c37487
103 changed files with 2426 additions and 431 deletions

View file

@ -8,6 +8,12 @@ $.ajaxPrefilter(function (s) {
}
});
function sanitizeHTML(string) {
var temp = document.createElement('span');
temp.textContent = string;
return temp.innerHTML;
}
function checkAll(id, checked) {
$('#'+id).find('input[type=checkbox]:enabled').prop('checked', checked);
}
@ -371,15 +377,29 @@ function showIssueHistory(journal, url) {
switch(journal) {
case 'notes':
tab_content.find('.journal').show();
tab_content.find('.journal:not(.has-notes)').hide();
tab_content.find('.journal.has-notes').show();
tab_content.find('.journal .wiki').show();
tab_content.find('.journal .contextual .journal-actions').show();
// always show thumbnails in notes tab
var thumbnails = tab_content.find('.journal .thumbnails');
thumbnails.show();
// show journals without notes, but with thumbnails
thumbnails.parents('.journal').show();
break;
case 'properties':
tab_content.find('.journal.has-notes').hide();
tab_content.find('.journal:not(.has-notes)').show();
tab_content.find('.journal').show();
tab_content.find('.journal:not(.has-details)').hide();
tab_content.find('.journal .wiki').hide();
tab_content.find('.journal .thumbnails').hide();
tab_content.find('.journal .contextual .journal-actions').hide();
break;
default:
tab_content.find('.journal').show();
tab_content.find('.journal .wiki').show();
tab_content.find('.journal .thumbnails').show();
tab_content.find('.journal .contextual .journal-actions').show();
}
return false;
@ -933,7 +953,7 @@ $(document).ready(function(){
$('#history .tabs').on('click', 'a', function(e){
var tab = $(e.target).attr('id').replace('tab-','');
document.cookie = 'history_last_tab=' + tab
document.cookie = 'history_last_tab=' + tab + '; SameSite=Lax'
});
});
@ -997,15 +1017,15 @@ function setupAttachmentDetail() {
$(function () {
$('[title]').tooltip({
show: {
delay: 400
},
position: {
my: "center bottom-5",
at: "center top"
}
});
$("[title]:not(.no-tooltip)").tooltip({
show: {
delay: 400
},
position: {
my: "center bottom-5",
at: "center top"
}
});
});
function inlineAutoComplete(element) {
@ -1048,6 +1068,9 @@ function inlineAutoComplete(element) {
requireLeadingSpace: true,
selectTemplate: function (issue) {
return '#' + issue.original.id;
},
menuItemTemplate: function (issue) {
return sanitizeHTML(issue.original.label);
}
});

View file

@ -257,13 +257,12 @@ function copyImageFromClipboard(e) {
if (!$(e.target).hasClass('wiki-edit')) { return; }
var clipboardData = e.clipboardData || e.originalEvent.clipboardData
if (!clipboardData) { return; }
if (clipboardData.types.some(function(t){ return /^text/.test(t); })) { return; }
if (clipboardData.types.some(function(t){ return /^text\/plain$/.test(t); })) { return; }
var items = clipboardData.items
for (var i = 0 ; i < items.length ; i++) {
var item = items[i];
if (item.type.indexOf("image") != -1) {
var blob = item.getAsFile();
var files = clipboardData.files
for (var i = 0 ; i < files.length ; i++) {
var file = files[i];
if (file.type.indexOf("image") != -1) {
var date = new Date();
var filename = 'clipboard-'
+ date.getFullYear()
@ -272,9 +271,8 @@ function copyImageFromClipboard(e) {
+ ('0'+date.getHours()).slice(-2)
+ ('0'+date.getMinutes()).slice(-2)
+ '-' + randomKey(5).toLocaleLowerCase()
+ '.' + blob.name.split('.').pop();
var file = new Blob([blob], {type: blob.type});
file.name = filename;
+ '.' + file.name.split('.').pop();
var inputEl = $('input:file.filedrop').first()
handleFileDropEvent.target = e.target;
addFile(inputEl, file, true);

View file

@ -46,6 +46,7 @@ function contextMenuClick(event) {
} else {
if (event.ctrlKey || event.metaKey) {
contextMenuToggleSelection(tr);
contextMenuClearDocumentSelection();
} else if (event.shiftKey) {
lastSelected = contextMenuLastSelected();
if (lastSelected.length) {
@ -53,6 +54,7 @@ function contextMenuClick(event) {
$('.hascontextmenu').each(function(){
if (toggling || $(this).is(tr)) {
contextMenuAddSelection($(this));
contextMenuClearDocumentSelection();
}
if ($(this).is(tr) || $(this).is(lastSelected)) {
toggling = !toggling;
@ -191,7 +193,6 @@ function contextMenuToggleSelection(tr) {
function contextMenuAddSelection(tr) {
tr.addClass('context-menu-selection');
contextMenuCheckSelectionBox(tr, true);
contextMenuClearDocumentSelection();
}
function contextMenuRemoveSelection(tr) {

View file

@ -253,13 +253,16 @@ ganttEntryClick = function(e){
subject.nextAll('div').each(function(_, element){
var el = $(element);
var json = el.data('collapse-expand');
var number_of_rows = el.data('number-of-rows');
var el_task_bars = '#gantt_area form > div[data-collapse-expand="' + json.obj_id + '"][data-number-of-rows="' + number_of_rows + '"]';
var el_selected_columns = 'td.gantt_selected_column div[data-collapse-expand="' + json.obj_id + '"][data-number-of-rows="' + number_of_rows + '"]';
if(out_of_hierarchy || parseInt(el.css('left')) <= subject_left){
out_of_hierarchy = true;
if(target_shown == null) return false;
var new_top_val = parseInt(el.css('top')) + total_height * (target_shown ? -1 : 1);
el.css('top', new_top_val);
$('#gantt_area form > div[data-collapse-expand="' + json.obj_id + '"], td.gantt_selected_column div[data-collapse-expand="' + json.obj_id + '"]').each(function(_, el){
$([el_task_bars, el_selected_columns].join()).each(function(_, el){
$(el).css('top', new_top_val);
});
return true;
@ -272,15 +275,14 @@ ganttEntryClick = function(e){
total_height = 0;
}
if(is_shown == target_shown){
$('#gantt_area form > div[data-collapse-expand="' + json.obj_id + '"]').each(function(_, task) {
$(el_task_bars).each(function(_, task) {
var el_task = $(task);
if(!is_shown)
el_task.css('top', target_top + total_height);
if(!el_task.hasClass('tooltip'))
el_task.toggle(!is_shown);
});
$('td.gantt_selected_column div[data-collapse-expand="' + json.obj_id + '"]'
).each(function (_, attr) {
$(el_selected_columns).each(function (_, attr) {
var el_attr = $(attr);
if (!is_shown)
el_attr.css('top', target_top + total_height);

File diff suppressed because one or more lines are too long

View file

@ -338,7 +338,7 @@ jsToolBar.prototype = {
} else if (typeof(this.textarea["setSelectionRange"]) != "undefined") {
this.textarea.value = this.textarea.value.substring(0, start) + subst +
this.textarea.value.substring(end);
if (sel) {
if (sel || (!prefix && start === end)) {
this.textarea.setSelectionRange(start + subst.length, start + subst.length);
} else {
this.textarea.setSelectionRange(start + prefix.length, start + prefix.length);