##// END OF EJS Templates
Fixed multiple scrollbars in project tree (#15741)....
Fixed multiple scrollbars in project tree (#15741). git-svn-id: http://svn.redmine.org/redmine/trunk@12435 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r12125:2e2e2cfe425c
r12160:bea821166dbe
Show More
application.js
607 lines | 16.9 KiB | application/javascript | JavascriptLexer
Toshi MARUYAMA
remove tailing white spaces from public/javascripts/application.js...
r8711 /* Redmine - project management software
Jean-Philippe Lang
Copyright for 2013 (#12788)....
r10939 Copyright (C) 2006-2013 Jean-Philippe Lang */
Jean-Philippe Lang
Issue list now supports bulk edit/move/delete (#563, #607). For now, issues from different projects can not be bulk edited/moved/deleted at once....
r1116
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 function checkAll(id, checked) {
Jean-Philippe Lang
Projects selection on custom field form (#15136)....
r11995 $('#'+id).find('input[type=checkbox]:enabled').attr('checked', checked);
Jean-Philippe Lang
Added svn:eol-style native property for various files...
r416 }
Jean-Philippe Lang
Adds checkboxes toggle links on permissions report....
r1769 function toggleCheckboxesBySelector(selector) {
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 var all_checked = true;
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 $(selector).each(function(index) {
if (!$(this).is(':checked')) { all_checked = false; }
Eric Davis
Changed the notifications to use a hierarchy UI...
r4108 });
Toshi MARUYAMA
add missing ; at toggleCheckboxesBySelector of application.js (#13811)...
r11500 $(selector).attr('checked', !all_checked);
Eric Davis
Changed the notifications to use a hierarchy UI...
r4108 }
Jean-Philippe Lang
Makes issue update link work without javascript (#1337)....
r1591 function showAndScrollTo(id, focus) {
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 $('#'+id).show();
Toshi MARUYAMA
use ===/!== instead of ==/!= in application.js (#13811)...
r11499 if (focus !== null) {
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 $('#'+focus).focus();
}
$('html, body').animate({scrollTop: $('#'+id).offset().top}, 100);
Jean-Philippe Lang
Makes issue update link work without javascript (#1337)....
r1591 }
Jean-Philippe Lang
Adds group folding on issue list (#2679)....
r2615 function toggleRowGroup(el) {
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 var tr = $(el).parents('tr').first();
var n = tr.next();
tr.toggleClass('open');
while (n.length && !n.hasClass('group')) {
n.toggle();
n = n.next('tr');
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 }
Jean-Philippe Lang
Adds group folding on issue list (#2679)....
r2615 }
Jean-Philippe Lang
Adds links on the issue list to collapse/expang all groups (#7236)....
r5054 function collapseAllRowGroups(el) {
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 var tbody = $(el).parents('tbody').first();
tbody.children('tr').each(function(index) {
if ($(this).hasClass('group')) {
$(this).removeClass('open');
Jean-Philippe Lang
Adds links on the issue list to collapse/expang all groups (#7236)....
r5054 } else {
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 $(this).hide();
Jean-Philippe Lang
Adds links on the issue list to collapse/expang all groups (#7236)....
r5054 }
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 });
Jean-Philippe Lang
Adds links on the issue list to collapse/expang all groups (#7236)....
r5054 }
function expandAllRowGroups(el) {
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 var tbody = $(el).parents('tbody').first();
tbody.children('tr').each(function(index) {
if ($(this).hasClass('group')) {
$(this).addClass('open');
Jean-Philippe Lang
Adds links on the issue list to collapse/expang all groups (#7236)....
r5054 } else {
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 $(this).show();
Jean-Philippe Lang
Adds links on the issue list to collapse/expang all groups (#7236)....
r5054 }
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 });
Jean-Philippe Lang
Adds links on the issue list to collapse/expang all groups (#7236)....
r5054 }
function toggleAllRowGroups(el) {
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 var tr = $(el).parents('tr').first();
if (tr.hasClass('open')) {
Jean-Philippe Lang
Adds links on the issue list to collapse/expang all groups (#7236)....
r5054 collapseAllRowGroups(el);
} else {
expandAllRowGroups(el);
}
}
Jean-Philippe Lang
Makes tickets and timelogs filters collapsible (UI)....
r2777 function toggleFieldset(el) {
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 var fieldset = $(el).parents('fieldset').first();
fieldset.toggleClass('collapsed');
fieldset.children('div').toggle();
Jean-Philippe Lang
Makes tickets and timelogs filters collapsible (UI)....
r2777 }
Jean-Philippe Lang
Allow additional workflow transitions for issue author and assignee (#2732)....
r4775 function hideFieldset(el) {
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 var fieldset = $(el).parents('fieldset').first();
fieldset.toggleClass('collapsed');
fieldset.children('div').hide();
Jean-Philippe Lang
Allow additional workflow transitions for issue author and assignee (#2732)....
r4775 }
Toshi MARUYAMA
code layout clean up application.js...
r11514 function initFilters() {
$('#add_filter_select').change(function() {
Jean-Philippe Lang
Build issue filters using javascript....
r9979 addFilter($(this).val(), '', []);
});
Toshi MARUYAMA
code layout clean up application.js...
r11514 $('#filters-table td.field input[type=checkbox]').each(function() {
Jean-Philippe Lang
Build issue filters using javascript....
r9979 toggleFilter($(this).val());
});
Toshi MARUYAMA
code layout clean up application.js...
r11514 $('#filters-table td.field input[type=checkbox]').live('click', function() {
Jean-Philippe Lang
Build issue filters using javascript....
r9979 toggleFilter($(this).val());
});
Toshi MARUYAMA
code layout clean up application.js...
r11514 $('#filters-table .toggle-multiselect').live('click', function() {
Jean-Philippe Lang
Build issue filters using javascript....
r9979 toggleMultiSelect($(this).siblings('select'));
});
Toshi MARUYAMA
code layout clean up application.js...
r11514 $('#filters-table input[type=text]').live('keypress', function(e) {
Jean-Philippe Lang
Build issue filters using javascript....
r9979 if (e.keyCode == 13) submit_query_form("query_form");
});
}
function addFilter(field, operator, values) {
var fieldId = field.replace('.', '_');
var tr = $('#tr_'+fieldId);
if (tr.length > 0) {
tr.show();
} else {
buildFilterRow(field, operator, values);
}
$('#cb_'+fieldId).attr('checked', true);
toggleFilter(field);
Toshi MARUYAMA
code layout clean up application.js...
r11514 $('#add_filter_select').val('').children('option').each(function() {
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 if ($(this).attr('value') == field) {
$(this).attr('disabled', true);
Jean-Philippe Lang
Moved javascript filters functions to application.js....
r8578 }
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 });
Jean-Philippe Lang
Moved javascript filters functions to application.js....
r8578 }
Jean-Philippe Lang
Build issue filters using javascript....
r9979 function buildFilterRow(field, operator, values) {
var fieldId = field.replace('.', '_');
var filterTable = $("#filters-table");
var filterOptions = availableFilters[field];
Jean-Philippe Lang
Fixed: JS-error while using a global custom query w/ project filter in a project context (#15190)....
r12004 if (!filterOptions) return;
Jean-Philippe Lang
Build issue filters using javascript....
r9979 var operators = operatorByType[filterOptions['type']];
var filterValues = filterOptions['values'];
var i, select;
var tr = $('<tr class="filter">').attr('id', 'tr_'+fieldId).html(
'<td class="field"><input checked="checked" id="cb_'+fieldId+'" name="f[]" value="'+field+'" type="checkbox"><label for="cb_'+fieldId+'"> '+filterOptions['name']+'</label></td>' +
'<td class="operator"><select id="operators_'+fieldId+'" name="op['+field+']"></td>' +
'<td class="values"></td>'
);
filterTable.append(tr);
select = tr.find('td.operator select');
Toshi MARUYAMA
code layout clean up application.js...
r11514 for (i = 0; i < operators.length; i++) {
Jean-Philippe Lang
Escape filter values using .text instead of .html....
r10018 var option = $('<option>').val(operators[i]).text(operatorLabels[operators[i]]);
Toshi MARUYAMA
fix ; position of if(){} at application.js (#13811)...
r11502 if (operators[i] == operator) { option.attr('selected', true); }
Jean-Philippe Lang
Build issue filters using javascript....
r9979 select.append(option);
}
Toshi MARUYAMA
add missing ; in {} at application.js (#13811)...
r11503 select.change(function(){ toggleOperator(field); });
Jean-Philippe Lang
Build issue filters using javascript....
r9979
Toshi MARUYAMA
code layout clean up application.js...
r11514 switch (filterOptions['type']) {
Jean-Philippe Lang
Build issue filters using javascript....
r9979 case "list":
case "list_optional":
case "list_status":
case "list_subprojects":
tr.find('td.values').append(
'<span style="display:none;"><select class="value" id="values_'+fieldId+'_1" name="v['+field+'][]"></select>' +
' <span class="toggle-multiselect">&nbsp;</span></span>'
);
select = tr.find('td.values select');
Toshi MARUYAMA
fix ; position of if(){} at application.js (#13811)...
r11502 if (values.length > 1) { select.attr('multiple', true); }
Toshi MARUYAMA
code layout clean up application.js...
r11514 for (i = 0; i < filterValues.length; i++) {
Jean-Philippe Lang
Build issue filters using javascript....
r9979 var filterValue = filterValues[i];
var option = $('<option>');
if ($.isArray(filterValue)) {
Jean-Philippe Lang
Escape filter values using .text instead of .html....
r10018 option.val(filterValue[1]).text(filterValue[0]);
Toshi MARUYAMA
fix broken issue list filter (#11885)...
r10278 if ($.inArray(filterValue[1], values) > -1) {option.attr('selected', true);}
Jean-Philippe Lang
Build issue filters using javascript....
r9979 } else {
Jean-Philippe Lang
Escape filter values using .text instead of .html....
r10018 option.val(filterValue).text(filterValue);
Toshi MARUYAMA
fix broken issue list filter (#11885)...
r10278 if ($.inArray(filterValue, values) > -1) {option.attr('selected', true);}
Jean-Philippe Lang
Build issue filters using javascript....
r9979 }
select.append(option);
}
break;
case "date":
case "date_past":
tr.find('td.values').append(
Jean-Philippe Lang
Fixed JSON escaping of filters (#11929)....
r10260 '<span style="display:none;"><input type="text" name="v['+field+'][]" id="values_'+fieldId+'_1" size="10" class="value date_value" /></span>' +
' <span style="display:none;"><input type="text" name="v['+field+'][]" id="values_'+fieldId+'_2" size="10" class="value date_value" /></span>' +
' <span style="display:none;"><input type="text" name="v['+field+'][]" id="values_'+fieldId+'" size="3" class="value" /> '+labelDayPlural+'</span>'
Jean-Philippe Lang
Build issue filters using javascript....
r9979 );
$('#values_'+fieldId+'_1').val(values[0]).datepicker(datepickerOptions);
$('#values_'+fieldId+'_2').val(values[1]).datepicker(datepickerOptions);
$('#values_'+fieldId).val(values[0]);
break;
case "string":
case "text":
tr.find('td.values').append(
Jean-Philippe Lang
Fixed JSON escaping of filters (#11929)....
r10260 '<span style="display:none;"><input type="text" name="v['+field+'][]" id="values_'+fieldId+'" size="30" class="value" /></span>'
Jean-Philippe Lang
Build issue filters using javascript....
r9979 );
$('#values_'+fieldId).val(values[0]);
break;
Jean-Philippe Lang
Makes related issues available for display and filtering on the issue list (#3239, #3265)....
r10303 case "relation":
tr.find('td.values').append(
'<span style="display:none;"><input type="text" name="v['+field+'][]" id="values_'+fieldId+'" size="6" class="value" /></span>' +
'<span style="display:none;"><select class="value" name="v['+field+'][]" id="values_'+fieldId+'_1"></select></span>'
);
$('#values_'+fieldId).val(values[0]);
select = tr.find('td.values select');
Toshi MARUYAMA
code layout clean up application.js...
r11514 for (i = 0; i < allProjects.length; i++) {
Jean-Philippe Lang
Makes related issues available for display and filtering on the issue list (#3239, #3265)....
r10303 var filterValue = allProjects[i];
var option = $('<option>');
option.val(filterValue[1]).text(filterValue[0]);
Toshi MARUYAMA
fix ; position of if(){} at application.js (#13811)...
r11502 if (values[0] == filterValue[1]) { option.attr('selected', true); }
Jean-Philippe Lang
Makes related issues available for display and filtering on the issue list (#3239, #3265)....
r10303 select.append(option);
}
Jean-Philippe Lang
Build issue filters using javascript....
r9979 case "integer":
case "float":
tr.find('td.values').append(
Jean-Philippe Lang
Fixed JSON escaping of filters (#11929)....
r10260 '<span style="display:none;"><input type="text" name="v['+field+'][]" id="values_'+fieldId+'_1" size="6" class="value" /></span>' +
' <span style="display:none;"><input type="text" name="v['+field+'][]" id="values_'+fieldId+'_2" size="6" class="value" /></span>'
Jean-Philippe Lang
Build issue filters using javascript....
r9979 );
$('#values_'+fieldId+'_1').val(values[0]);
$('#values_'+fieldId+'_2').val(values[1]);
break;
}
}
function toggleFilter(field) {
var fieldId = field.replace('.', '_');
if ($('#cb_' + fieldId).is(':checked')) {
$("#operators_" + fieldId).show().removeAttr('disabled');
toggleOperator(field);
Jean-Philippe Lang
Moved javascript filters functions to application.js....
r8578 } else {
Jean-Philippe Lang
Build issue filters using javascript....
r9979 $("#operators_" + fieldId).hide().attr('disabled', true);
Jean-Philippe Lang
Moved javascript filters functions to application.js....
r8578 enableValues(field, []);
}
}
function enableValues(field, indexes) {
Jean-Philippe Lang
Build issue filters using javascript....
r9979 var fieldId = field.replace('.', '_');
$('#tr_'+fieldId+' td.values .value').each(function(index) {
Toshi MARUYAMA
fix broken issue list filter (#11885)...
r10278 if ($.inArray(index, indexes) >= 0) {
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 $(this).removeAttr('disabled');
$(this).parents('span').first().show();
Jean-Philippe Lang
Moved javascript filters functions to application.js....
r8578 } else {
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 $(this).val('');
$(this).attr('disabled', true);
$(this).parents('span').first().hide();
Jean-Philippe Lang
Moved javascript filters functions to application.js....
r8578 }
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885
if ($(this).hasClass('group')) {
$(this).addClass('open');
} else {
$(this).show();
}
});
Jean-Philippe Lang
Moved javascript filters functions to application.js....
r8578 }
Jean-Philippe Lang
Build issue filters using javascript....
r9979 function toggleOperator(field) {
var fieldId = field.replace('.', '_');
var operator = $("#operators_" + fieldId);
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 switch (operator.val()) {
Jean-Philippe Lang
Moved javascript filters functions to application.js....
r8578 case "!*":
case "*":
case "t":
Jean-Philippe Lang
Adds TimeEntryQuery for listing time entries....
r10740 case "ld":
Jean-Philippe Lang
Moved javascript filters functions to application.js....
r8578 case "w":
Jean-Philippe Lang
Adds TimeEntryQuery for listing time entries....
r10740 case "lw":
case "l2w":
case "m":
case "lm":
case "y":
Jean-Philippe Lang
Moved javascript filters functions to application.js....
r8578 case "o":
case "c":
enableValues(field, []);
break;
case "><":
enableValues(field, [0,1]);
break;
case "<t+":
case ">t+":
Jean-Philippe Lang
Changes how relative date filters work and adds specific filters for filtering dates in past/next n days (#11426)....
r10546 case "><t+":
Jean-Philippe Lang
Moved javascript filters functions to application.js....
r8578 case "t+":
case ">t-":
case "<t-":
Jean-Philippe Lang
Changes how relative date filters work and adds specific filters for filtering dates in past/next n days (#11426)....
r10546 case "><t-":
Jean-Philippe Lang
Moved javascript filters functions to application.js....
r8578 case "t-":
enableValues(field, [2]);
break;
Jean-Philippe Lang
Makes related issues available for display and filtering on the issue list (#3239, #3265)....
r10303 case "=p":
case "=!p":
Jean-Philippe Lang
Adds no_issue_in_project operator for relations filter (#3265)....
r10348 case "!p":
Jean-Philippe Lang
Makes related issues available for display and filtering on the issue list (#3239, #3265)....
r10303 enableValues(field, [1]);
break;
Jean-Philippe Lang
Moved javascript filters functions to application.js....
r8578 default:
enableValues(field, [0]);
break;
}
}
Jean-Philippe Lang
Build issue filters using javascript....
r9979 function toggleMultiSelect(el) {
if (el.attr('multiple')) {
el.removeAttr('multiple');
Jean-Philippe Lang
List custom fields fielters: multiple select filter wider (#15073)....
r11985 el.attr('size', 1);
Jean-Philippe Lang
Moved javascript filters functions to application.js....
r8578 } else {
Jean-Philippe Lang
Build issue filters using javascript....
r9979 el.attr('multiple', true);
Jean-Philippe Lang
List custom fields fielters: multiple select filter wider (#15073)....
r11985 if (el.children().length > 10)
el.attr('size', 10);
else
el.attr('size', 4);
Jean-Philippe Lang
Moved javascript filters functions to application.js....
r8578 }
}
function submit_query_form(id) {
selectAllOptions("selected_columns");
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 $('#'+id).submit();
Jean-Philippe Lang
Moved javascript filters functions to application.js....
r8578 }
Jean-Baptiste Barth
Update URL when changing tab (#13900)....
r11535 function showTab(name, url) {
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 $('div#content .tab-content').hide();
$('div.tabs a').removeClass('selected');
$('#tab-content-' + name).show();
$('#tab-' + name).addClass('selected');
Jean-Baptiste Barth
Update URL when changing tab (#13900)....
r11535 //replaces current URL with the "href" attribute of the current link
//(only triggered if supported by browser)
if ("replaceState" in window.history) {
window.history.replaceState(null, document.title, url);
}
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 return false;
Jean-Philippe Lang
Added an ajax indicator for all ajax calls. Also removed highlight effects on my page layout edition....
r482 }
Jean-Philippe Lang
Adds buttons to scroll the tabs when they overflow....
r3060 function moveTabRight(el) {
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 var lis = $(el).parents('div.tabs').first().find('ul').children();
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 var tabsWidth = 0;
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 var i = 0;
Toshi MARUYAMA
code layout clean up application.js...
r11514 lis.each(function() {
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 if ($(this).is(':visible')) {
tabsWidth += $(this).width() + 6;
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 }
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 });
if (tabsWidth < $(el).parents('div.tabs').first().width() - 60) { return; }
while (i<lis.length && !lis.eq(i).is(':visible')) { i++; }
lis.eq(i).hide();
Jean-Philippe Lang
Adds buttons to scroll the tabs when they overflow....
r3060 }
function moveTabLeft(el) {
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 var lis = $(el).parents('div.tabs').first().find('ul').children();
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 var i = 0;
Toshi MARUYAMA
code layout clean up application.js...
r11514 while (i < lis.length && !lis.eq(i).is(':visible')) { i++; }
if (i > 0) {
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 lis.eq(i-1).show();
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 }
Jean-Philippe Lang
Adds buttons to scroll the tabs when they overflow....
r3060 }
function displayTabsButtons() {
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 var lis;
var tabsWidth = 0;
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 var el;
$('div.tabs').each(function() {
el = $(this);
lis = el.find('ul').children();
lis.each(function(){
if ($(this).is(':visible')) {
tabsWidth += $(this).width() + 6;
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 }
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 });
if ((tabsWidth < el.width() - 60) && (lis.first().is(':visible'))) {
el.find('div.tabs-buttons').hide();
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 } else {
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 el.find('div.tabs-buttons').show();
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 }
});
Jean-Philippe Lang
Adds buttons to scroll the tabs when they overflow....
r3060 }
Jean-Philippe Lang
Issue relations first commit (not thoroughly tested). 4 kinds of relation are available:...
r503 function setPredecessorFieldsVisibility() {
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 var relationType = $('#relation_relation_type');
if (relationType.val() == "precedes" || relationType.val() == "follows") {
$('#predecessor_fields').show();
} else {
$('#predecessor_fields').hide();
}
Jean-Philippe Lang
Added a link to add a new category when creating or editing an issue....
r642 }
Jean-Philippe Lang
Adds a dialog box for CSV export options (#4742)....
r7754 function showModal(id, width) {
Jean-Philippe Lang
Use JQuery Dialog (#11445)....
r9887 var el = $('#'+id).first();
Toshi MARUYAMA
use ===/!== instead of ==/!= in application.js (#13811)...
r11499 if (el.length === 0 || el.is(':visible')) {return;}
Jean-Philippe Lang
Use JQuery Dialog (#11445)....
r9887 var title = el.find('h3.title').text();
el.dialog({
width: width,
modal: true,
resizable: false,
dialogClass: 'modal',
title: title
});
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 el.find("input[type=text], input[type=submit]").first().focus();
Jean-Philippe Lang
Adds a dialog box for CSV export options (#4742)....
r7754 }
function hideModal(el) {
Jean-Philippe Lang
Displays the full form when creating a version from the issue form so that required custom fields can be filled (#7398)....
r8725 var modal;
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 if (el) {
Jean-Philippe Lang
Use JQuery Dialog (#11445)....
r9887 modal = $(el).parents('.ui-dialog-content');
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 } else {
modal = $('#ajax-modal');
Jean-Philippe Lang
Adds a dialog box for CSV export options (#4742)....
r7754 }
Jean-Philippe Lang
Use JQuery Dialog (#11445)....
r9887 modal.dialog("close");
Jean-Philippe Lang
Adds a dialog box for CSV export options (#4742)....
r7754 }
Jean-Philippe Lang
Adds a helper for preview links....
r9848 function submitPreview(url, form, target) {
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 $.ajax({
url: url,
type: 'post',
data: $('#'+form).serialize(),
success: function(data){
$('#'+target).html(data);
}
Jean-Philippe Lang
Adds a helper for preview links....
r9848 });
}
Jean-Philippe Lang
SCM browser: directories can now be collapsed and re-expanded with no additional request....
r850 function collapseScmEntry(id) {
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 $('.'+id).each(function() {
if ($(this).hasClass('open')) {
collapseScmEntry($(this).attr('id'));
}
$(this).hide();
});
$('#'+id).removeClass('open');
Jean-Philippe Lang
SCM browser: directories can now be collapsed and re-expanded with no additional request....
r850 }
function expandScmEntry(id) {
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 $('.'+id).each(function() {
$(this).show();
if ($(this).hasClass('loaded') && !$(this).hasClass('collapsed')) {
expandScmEntry($(this).attr('id'));
Jean-Philippe Lang
SCM browser: directories can now be collapsed and re-expanded with no additional request....
r850 }
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 });
$('#'+id).addClass('open');
Jean-Philippe Lang
SCM browser: directories can now be collapsed and re-expanded with no additional request....
r850 }
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 function scmEntryClick(id, url) {
Toshi MARUYAMA
fix repository tree can't handle two loading at once (#13348)...
r12044 var el = $('#'+id);
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 if (el.hasClass('open')) {
Jean-Philippe Lang
SCM browser: directories can now be collapsed and re-expanded with no additional request....
r850 collapseScmEntry(id);
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 el.addClass('collapsed');
Jean-Philippe Lang
SCM browser: directories can now be collapsed and re-expanded with no additional request....
r850 return false;
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 } else if (el.hasClass('loaded')) {
Jean-Philippe Lang
SCM browser: directories can now be collapsed and re-expanded with no additional request....
r850 expandScmEntry(id);
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 el.removeClass('collapsed');
Jean-Philippe Lang
SCM browser: directories can now be collapsed and re-expanded with no additional request....
r850 return false;
}
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 if (el.hasClass('loading')) {
Jean-Philippe Lang
SCM browser:...
r855 return false;
}
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 el.addClass('loading');
$.ajax({
url: url,
Toshi MARUYAMA
code layout clean up application.js...
r11514 success: function(data) {
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 el.after(data);
el.addClass('open').addClass('loaded').removeClass('loading');
}
});
Jean-Philippe Lang
SCM browser: directories can now be collapsed and re-expanded with no additional request....
r850 return true;
}
Jean-Philippe Lang
Adds a simple API and a standalone script that can be used to forward emails from a local or remote email server to Redmine (#1110)....
r1570 function randomKey(size) {
Toshi MARUYAMA
application.js: randomKey function optimization (#13826)...
r11511 var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 var key = '';
Toshi MARUYAMA
application.js: randomKey function optimization (#13826)...
r11511 for (var i = 0; i < size; i++) {
key += chars.charAt(Math.floor(Math.random() * chars.length));
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 }
return key;
Jean-Philippe Lang
Adds a simple API and a standalone script that can be used to forward emails from a local or remote email server to Redmine (#1110)....
r1570 }
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 function updateIssueFrom(url) {
Jean-Philippe Lang
AJAX call on the issue form resets data entered during the call (#14621)....
r11936 $('#all_attributes input, #all_attributes textarea, #all_attributes select').each(function(){
$(this).data('valuebeforeupdate', $(this).val());
});
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 $.ajax({
url: url,
type: 'post',
data: $('#issue-form').serialize()
});
Jean-Philippe Lang
Adds subtasking (#443) including:...
r3459 }
Jean-Philippe Lang
AJAX call on the issue form resets data entered during the call (#14621)....
r11936 function replaceIssueFormWith(html){
var replacement = $(html);
$('#all_attributes input, #all_attributes textarea, #all_attributes select').each(function(){
var object_id = $(this).attr('id');
if (object_id && $(this).data('valuebeforeupdate')!=$(this).val()) {
replacement.find('#'+object_id).val($(this).val());
}
});
$('#all_attributes').empty();
$('#all_attributes').prepend(replacement);
}
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 function updateBulkEditFrom(url) {
$.ajax({
url: url,
type: 'post',
data: $('#bulk_edit_form').serialize()
});
Jean-Philippe Lang
Autocomplete issue relations on subject (#3170)....
r4388 }
Jean-Philippe Lang
Auto-populate fields while creating a new user with LDAP (#10286)....
r10850 function observeAutocompleteField(fieldId, url, options) {
Jean-Philippe Lang
Fixed new issue form rendering with IE8....
r10582 $(document).ready(function() {
Jean-Philippe Lang
Auto-populate fields while creating a new user with LDAP (#10286)....
r10850 $('#'+fieldId).autocomplete($.extend({
Jean-Philippe Lang
Fixed new issue form rendering with IE8....
r10582 source: url,
Jean-Philippe Lang
Adds an indicator to all autocomplete/search fields....
r10852 minLength: 2,
search: function(){$('#'+fieldId).addClass('ajax-loading');},
Toshi MARUYAMA
fix JavaScript error on IE7 (#13811)...
r11498 response: function(){$('#'+fieldId).removeClass('ajax-loading');}
Jean-Philippe Lang
Auto-populate fields while creating a new user with LDAP (#10286)....
r10850 }, options));
Jean-Philippe Lang
Adds an indicator to all autocomplete/search fields....
r10852 $('#'+fieldId).addClass('autocomplete');
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 });
}
function observeSearchfield(fieldId, targetId, url) {
$('#'+fieldId).each(function() {
var $this = $(this);
Jean-Philippe Lang
Adds an indicator to all autocomplete/search fields....
r10852 $this.addClass('autocomplete');
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 $this.attr('data-value-was', $this.val());
var check = function() {
var val = $this.val();
if ($this.attr('data-value-was') != val){
$this.attr('data-value-was', val);
Jean-Philippe Lang
Fixed that autocomplete results are not reset after clearing search field (#11909)....
r10317 $.ajax({
url: url,
type: 'get',
data: {q: $this.val()},
Jean-Philippe Lang
Adds pagination to users list when adding project or group members (#9549)....
r10970 success: function(data){ if(targetId) $('#'+targetId).html(data); },
Jean-Philippe Lang
Fixed that autocomplete results are not reset after clearing search field (#11909)....
r10317 beforeSend: function(){ $this.addClass('ajax-loading'); },
complete: function(){ $this.removeClass('ajax-loading'); }
});
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 }
};
var reset = function() {
if (timer) {
clearInterval(timer);
timer = setInterval(check, 300);
}
};
var timer = setInterval(check, 300);
$this.bind('keyup click mousemove', reset);
});
Jean-Philippe Lang
Do not show trackers and issue custom fields on project form when issue tracking is disabled (#7225)....
r4528 }
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 function initMyPageSortable(list, url) {
$('#list-'+list).sortable({
connectWith: '.block-receiver',
tolerance: 'pointer',
update: function(){
$.ajax({
url: url,
type: 'post',
data: {'blocks': $.map($('#list-'+list).children(), function(el){return $(el).attr('id');})}
});
}
});
$("#list-top, #list-left, #list-right").disableSelection();
}
Toshi MARUYAMA
remove tailing white spaces from public/javascripts/application.js...
r8711
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 var warnLeavingUnsavedMessage;
function warnLeavingUnsaved(message) {
warnLeavingUnsavedMessage = message;
Jean-Philippe Lang
Submit handler should be live as well (#14615)....
r11856 $('form').live('submit', function(){
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 $('textarea').removeData('changed');
});
Jean-Philippe Lang
Warn me when leaving a page with unsaved text doesn't work when editing an update note (#14615)....
r11854 $('textarea').live('change', function(){
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 $(this).data('changed', 'changed');
});
window.onbeforeunload = function(){
var warn = false;
$('textarea').blur().each(function(){
if ($(this).data('changed')) {
warn = true;
}
});
if (warn) {return warnLeavingUnsavedMessage;}
};
Toshi MARUYAMA
remove unneeded ; from warnLeavingUnsaved of application.js (#13811)...
r11501 }
Jean-Philippe Lang
Do not show trackers and issue custom fields on project form when issue tracking is disabled (#7225)....
r4528
Etienne Massip
Code cleanup....
r10768 function setupAjaxIndicator() {
$('#ajax-indicator').bind('ajaxSend', function(event, xhr, settings) {
Toshi MARUYAMA
use ===/!== instead of ==/!= in application.js (#13811)...
r11499 if ($('.ajax-loading').length === 0 && settings.contentType != 'application/octet-stream') {
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 $('#ajax-indicator').show();
Jean-Philippe Lang
Added an ajax indicator for all ajax calls. Also removed highlight effects on my page layout edition....
r482 }
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 });
Etienne Massip
Code cleanup....
r10768 $('#ajax-indicator').bind('ajaxStop', function() {
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 $('#ajax-indicator').hide();
});
Etienne Massip
Code cleanup....
r10768 }
Jean-Philippe Lang
Fixed: changing user/roles of project member not possible without javascript (#4852)...
r3369
Eric Davis
Hide the role forms when editing or adding Project members. #5452...
r3670 function hideOnLoad() {
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 $('.hol').hide();
Eric Davis
Hide the role forms when editing or adding Project members. #5452...
r3670 }
Jean-Philippe Lang
Disable submit buttons when submitting a form (#6555)....
r9257 function addFormObserversForDoubleSubmit() {
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 $('form[method=post]').each(function() {
if (!$(this).hasClass('multiple-submit')) {
$(this).submit(function(form_submission) {
if ($(form_submission.target).attr('data-submitted')) {
form_submission.preventDefault();
Jean-Philippe Lang
Fixed that "Create and continue" buttons are broken by r9391 (#10675)....
r9308 } else {
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 $(form_submission.target).attr('data-submitted', true);
Jean-Philippe Lang
Fixed that "Create and continue" buttons are broken by r9391 (#10675)....
r9308 }
Jean-Philippe Lang
Disable submit buttons when submitting a form (#6555)....
r9257 });
Jean-Philippe Lang
Fixed that "Create and continue" buttons are broken by r9391 (#10675)....
r9308 }
Jean-Philippe Lang
Disable submit buttons when submitting a form (#6555)....
r9257 });
}
Jean-Philippe Lang
Merged ajax_upload branch (#3957)....
r10748 function blockEventPropagation(event) {
event.stopPropagation();
event.preventDefault();
}
Jean-Philippe Lang
Merged custom fields format refactoring....
r12125 function toggleDisabledOnChange() {
var checked = $(this).is(':checked');
$($(this).data('disables')).attr('disabled', checked);
$($(this).data('enables')).attr('disabled', !checked);
}
function toggleDisabledInit() {
$('input[data-disables], input[data-enables]').each(toggleDisabledOnChange);
}
$(document).ready(function(){
$('#content').on('change', 'input[data-disables], input[data-enables]', toggleDisabledOnChange);
toggleDisabledInit();
});
Etienne Massip
Code cleanup....
r10768 $(document).ready(setupAjaxIndicator);
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 $(document).ready(hideOnLoad);
$(document).ready(addFormObserversForDoubleSubmit);
Jean-Philippe Lang
Merged custom fields format refactoring....
r12125