##// END OF EJS Templates
Reverts r16051 and r16050 for now (#15361)....
Reverts r16051 and r16050 for now (#15361). git-svn-id: http://svn.redmine.org/redmine/trunk@16052 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r15670:49fcec80b7eb
r15670:49fcec80b7eb
Show More
application.js
852 lines | 23.9 KiB | application/javascript | JavascriptLexer
Toshi MARUYAMA
remove tailing white spaces from public/javascripts/application.js...
r8711 /* Redmine - project management software
Jean-Philippe Lang
Updates copyright for 2016....
r14856 Copyright (C) 2006-2016 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) {
Toshi MARUYAMA
Backport r13313 from rails-4.1 to trunk....
r13045 $('#'+id).find('input[type=checkbox]:enabled').prop('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
Backport r13313 from rails-4.1 to trunk....
r13045 $(selector).prop('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 }
Jean-Philippe Lang
Moved select_list_move.js content to application.js....
r13236 // columns selection
function moveOptions(theSelFrom, theSelTo) {
$(theSelFrom).find('option:selected').detach().prop("selected", false).appendTo($(theSelTo));
}
function moveOptionUp(theSel) {
$(theSel).find('option:selected').each(function(){
$(this).prev(':not(:selected)').detach().insertAfter($(this));
});
}
function moveOptionTop(theSel) {
$(theSel).find('option:selected').detach().prependTo($(theSel));
}
function moveOptionDown(theSel) {
$($(theSel).find('option:selected').get().reverse()).each(function(){
$(this).next(':not(:selected)').detach().insertBefore($(this));
});
}
function moveOptionBottom(theSel) {
$(theSel).find('option:selected').detach().appendTo($(theSel));
}
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
Backport r13315 from rails-4.1 to trunk....
r13044 $('#filters-table').on('click', 'td.field input[type=checkbox]', function() {
Jean-Philippe Lang
Build issue filters using javascript....
r9979 toggleFilter($(this).val());
});
Toshi MARUYAMA
Backport r13315 from rails-4.1 to trunk....
r13044 $('#filters-table').on('click', '.toggle-multiselect', function() {
Jean-Philippe Lang
Build issue filters using javascript....
r9979 toggleMultiSelect($(this).siblings('select'));
});
Toshi MARUYAMA
Backport r13315 from rails-4.1 to trunk....
r13044 $('#filters-table').on('keypress', 'input[type=text]', function(e) {
Jean-Philippe Lang
Removed submit_query_form function....
r13235 if (e.keyCode == 13) $(this).closest('form').submit();
Jean-Philippe Lang
Build issue filters using javascript....
r9979 });
}
function addFilter(field, operator, values) {
var fieldId = field.replace('.', '_');
var tr = $('#tr_'+fieldId);
if (tr.length > 0) {
tr.show();
} else {
buildFilterRow(field, operator, values);
}
Toshi MARUYAMA
Backport r13313 from rails-4.1 to trunk....
r13045 $('#cb_'+fieldId).prop('checked', true);
Jean-Philippe Lang
Build issue filters using javascript....
r9979 toggleFilter(field);
Jean-Philippe Lang
Group filters in the filter select list (#13849)....
r13280 $('#add_filter_select').val('').find('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
Group versions by status in issue filters (#10412)....
r15219 if (filterValue.length == 3) {
var optgroup = select.find('optgroup').filter(function(){return $(this).attr('label') == filterValue[2]});
if (!optgroup.length) {optgroup = $('<optgroup>').attr('label', filterValue[2]);}
option = optgroup.append(option);
}
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
Use HTML5 date input fields instead of text fields with jquery ui date pickers (#19468)....
r14993 '<span style="display:none;"><input type="date" name="v['+field+'][]" id="values_'+fieldId+'_1" size="10" class="value date_value" /></span>' +
' <span style="display:none;"><input type="date" name="v['+field+'][]" id="values_'+fieldId+'_2" size="10" class="value date_value" /></span>' +
Jean-Philippe Lang
Fixed JSON escaping of filters (#11929)....
r10260 ' <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 );
Jean-Philippe Lang
Use HTML5 date input fields instead of text fields with jquery ui date pickers (#19468)....
r14993 $('#values_'+fieldId+'_1').val(values[0]).datepickerFallback(datepickerOptions);
$('#values_'+fieldId+'_2').val(values[1]).datepickerFallback(datepickerOptions);
Jean-Philippe Lang
Build issue filters using javascript....
r9979 $('#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
Missing break (#18734)....
r13468 break;
Jean-Philippe Lang
Build issue filters using javascript....
r9979 case "integer":
case "float":
Jean-Philippe Lang
Adds issue filters on parent/subtasks (#6118)....
r13922 case "tree":
Jean-Philippe Lang
Build issue filters using javascript....
r9979 tr.find('td.values').append(
Jean-Philippe Lang
Filter by issue id (#4806)....
r14989 '<span style="display:none;"><input type="text" name="v['+field+'][]" id="values_'+fieldId+'_1" size="14" class="value" /></span>' +
' <span style="display:none;"><input type="text" name="v['+field+'][]" id="values_'+fieldId+'_2" size="14" 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":
Jean-Philippe Lang
Ability to filter issues blocked by any/no open issues (#16621)....
r14427 case "*o":
case "!o":
Jean-Philippe Lang
Moved javascript filters functions to application.js....
r8578 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 }
}
Jean-Baptiste Barth
Update URL when changing tab (#13900)....
r11535 function showTab(name, url) {
Jean-Philippe Lang
Fix mulitple tab navigation highlighting and content hiding (#20906)....
r14346 $('#tab-content-' + name).parent().find('.tab-content').hide();
$('#tab-content-' + name).parent().find('div.tabs a').removeClass('selected');
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 $('#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();
Jean-Philippe Lang
Tab-buttons: add some user-feedback (#20632)....
r14867 var bw = $(el).parents('div.tabs-buttons').outerWidth(true);
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')) {
Jean-Philippe Lang
Tab-buttons: add some user-feedback (#20632)....
r14867 tabsWidth += $(this).outerWidth(true);
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 }
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 });
Jean-Philippe Lang
Tab-buttons: add some user-feedback (#20632)....
r14867 if (tabsWidth < $(el).parents('div.tabs').first().width() - bw) { return; }
$(el).siblings('.tab-left').removeClass('disabled');
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 while (i<lis.length && !lis.eq(i).is(':visible')) { i++; }
Jean-Philippe Lang
Tab-buttons: add some user-feedback (#20632)....
r14867 var w = lis.eq(i).width();
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 lis.eq(i).hide();
Jean-Philippe Lang
Tab-buttons: add some user-feedback (#20632)....
r14867 if (tabsWidth - w < $(el).parents('div.tabs').first().width() - bw) {
$(el).addClass('disabled');
}
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();
Jean-Philippe Lang
Tab-buttons: add some user-feedback (#20632)....
r14867 $(el).siblings('.tab-right').removeClass('disabled');
}
if (i <= 1) {
$(el).addClass('disabled');
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;
Jean-Philippe Lang
Fix for multiple tabs on the same page (#20271)....
r14242 var tabsWidth;
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 var el;
Jean-Philippe Lang
Tab-buttons: add some user-feedback (#20632)....
r14867 var numHidden;
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 $('div.tabs').each(function() {
el = $(this);
lis = el.find('ul').children();
Jean-Philippe Lang
Fix for multiple tabs on the same page (#20271)....
r14242 tabsWidth = 0;
Jean-Philippe Lang
Tab-buttons: add some user-feedback (#20632)....
r14867 numHidden = 0;
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 lis.each(function(){
if ($(this).is(':visible')) {
Jean-Philippe Lang
Tab-buttons: add some user-feedback (#20632)....
r14867 tabsWidth += $(this).outerWidth(true);
} else {
numHidden++;
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 }
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 });
Jean-Philippe Lang
Tab-buttons: add some user-feedback (#20632)....
r14867 var bw = $(el).parents('div.tabs-buttons').outerWidth(true);
Jean-Philippe Lang
Tab buttons appear on pages that have no tabs (#23751)....
r15471 if ((tabsWidth < el.width() - bw) && (lis.length === 0 || lis.first().is(':visible'))) {
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 el.find('div.tabs-buttons').hide();
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 } else {
Jean-Philippe Lang
Tab-buttons: add some user-feedback (#20632)....
r14867 el.find('div.tabs-buttons').show().children('button.tab-left').toggleClass('disabled', numHidden == 0);
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
Add support for multiple email addresses per user (#4244)....
r13504 function showModal(id, width, title) {
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
Add support for multiple email addresses per user (#4244)....
r13504 if (!title) title = el.find('h3.title').text();
Jean-Philippe Lang
Fixed the sudo dialog when called from a dialog, eg. email addresses (#19851)....
r13957 // moves existing modals behind the transparent background
$(".modal").zIndex(99);
Jean-Philippe Lang
Use JQuery Dialog (#11445)....
r9887 el.dialog({
width: width,
modal: true,
resizable: false,
dialogClass: 'modal',
title: title
Jean-Philippe Lang
Fixed r14339 for when closing the dialog by using the upper-right cross (#19851)....
r13958 }).on('dialogclose', function(){
$(".modal").zIndex(101);
Jean-Philippe Lang
Use JQuery Dialog (#11445)....
r9887 });
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
Set default project version after selecting a different project on the new issue form (#1828)....
r14406 function updateIssueFrom(url, el) {
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
Set default project version after selecting a different project on the new issue form (#1828)....
r14406 if (el) {
$("#form_update_triggered_by").val($(el).attr('id'));
}
Jean-Philippe Lang
Make the updateIssueFrom(url) function return the XMLHttpRequest object (#20180)....
r13990 return $.ajax({
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 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,
Jean-Philippe Lang
Add collision option to autocomplete initialization (#22296)....
r14919 position: {collision: "flipfit"},
Jean-Philippe Lang
Adds an indicator to all autocomplete/search fields....
r10852 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
Replaces project jump select with custom dropdown (#23310)....
r15612 $(document).ready(function(){
$(".drdn .autocomplete").val('');
$(".drdn-trigger").click(function(e){
var drdn = $(this).closest(".drdn");
if (drdn.hasClass("expanded")) {
drdn.removeClass("expanded");
} else {
$(".drdn").removeClass("expanded");
drdn.addClass("expanded");
if (!isMobile()) {
drdn.find(".autocomplete").focus();
}
e.stopPropagation();
}
});
$(document).click(function(e){
if ($(e.target).closest(".drdn").length < 1) {
$(".drdn.expanded").removeClass("expanded");
}
});
observeSearchfield('projects-quick-search', null, $('#projects-quick-search').data('automcomplete-url'));
$(".drdn-content").keydown(function(event){
var items = $(this).find(".drdn-items");
var focused = items.find("a:focus");
switch (event.which) {
case 40: //down
if (focused.length > 0) {
focused.nextAll("a").first().focus();;
} else {
items.find("a").first().focus();;
}
event.preventDefault();
break;
case 38: //up
if (focused.length > 0) {
var prev = focused.prevAll("a");
if (prev.length > 0) {
prev.first().focus();
} else {
$(this).find(".autocomplete").focus();
}
event.preventDefault();
}
break;
case 35: //end
if (focused.length > 0) {
focused.nextAll("a").last().focus();
event.preventDefault();
}
break;
case 36: //home
if (focused.length > 0) {
focused.prevAll("a").last().focus();
event.preventDefault();
}
break;
}
});
});
Jean-Philippe Lang
Merged datepicker.js into application.js....
r13370 function beforeShowDatePicker(input, inst) {
var default_date = null;
switch ($(input).attr("id")) {
case "issue_start_date" :
if ($("#issue_due_date").size() > 0) {
default_date = $("#issue_due_date").val();
}
break;
case "issue_due_date" :
if ($("#issue_start_date").size() > 0) {
Jean-Philippe Lang
Don't set default due date in the past (#21488)....
r14587 var start_date = $("#issue_start_date").val();
if (start_date != "") {
start_date = new Date(Date.parse(start_date));
if (start_date > new Date()) {
default_date = $("#issue_start_date").val();
}
}
Jean-Philippe Lang
Merged datepicker.js into application.js....
r13370 }
break;
}
Jean-Philippe Lang
Use HTML5 date input fields instead of text fields with jquery ui date pickers (#19468)....
r14993 $(input).datepickerFallback("option", "defaultDate", default_date);
Jean-Philippe Lang
Merged datepicker.js into application.js....
r13370 }
Jean-Philippe Lang
Lists can be reordered with drag and drop (#12909)....
r14954 (function($){
$.fn.positionedItems = function(sortableOptions, options){
var settings = $.extend({
firstPosition: 1
}, options );
return this.sortable($.extend({
Jean-Philippe Lang
Allow only vertical reorderingin sortable lists (#24062)....
r15614 axis: 'y',
Jean-Philippe Lang
Lists can be reordered with drag and drop (#12909)....
r14954 handle: ".sort-handle",
helper: function(event, ui){
Jean-Philippe Lang
Forum list can be reordered with drag and drop (#12909)....
r14955 ui.children('td').each(function(){
Jean-Philippe Lang
Lists can be reordered with drag and drop (#12909)....
r14954 $(this).width($(this).width());
});
return ui;
},
update: function(event, ui) {
var sortable = $(this);
Jean-Philippe Lang
Adds an ajax indicator on the sort handle (#12909)....
r14959 var handle = ui.item.find(".sort-handle").addClass("ajax-loading");
var url = handle.data("reorder-url");
var param = handle.data("reorder-param");
Jean-Philippe Lang
Lists can be reordered with drag and drop (#12909)....
r14954 var data = {};
data[param] = {position: ui.item.index() + settings['firstPosition']};
$.ajax({
url: url,
type: 'put',
dataType: 'script',
data: data,
Jean-Philippe Lang
Reverts r16051 and r16050 for now (#15361)....
r15670 success: function(data){
sortable.children(":even").removeClass("even").addClass("odd");
sortable.children(":odd").removeClass("odd").addClass("even");
},
Jean-Philippe Lang
Lists can be reordered with drag and drop (#12909)....
r14954 error: function(jqXHR, textStatus, errorThrown){
alert(jqXHR.status);
sortable.sortable("cancel");
Jean-Philippe Lang
Adds an ajax indicator on the sort handle (#12909)....
r14959 },
complete: function(jqXHR, textStatus, errorThrown){
handle.removeClass("ajax-loading");
Jean-Philippe Lang
Lists can be reordered with drag and drop (#12909)....
r14954 }
});
},
}, sortableOptions));
}
}( jQuery ));
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;
Toshi MARUYAMA
Backport r13315 from rails-4.1 to trunk....
r13044 $(document).on('submit', 'form', function(){
Jean-Philippe Lang
JQuery in, Prototype/Scriptaculous out (#11445)....
r9885 $('textarea').removeData('changed');
});
Toshi MARUYAMA
Backport r13315 from rails-4.1 to trunk....
r13044 $(document).on('change', 'textarea', 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() {
Toshi MARUYAMA
Backport r13313 from rails-4.1 to trunk....
r13045 $(document).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 });
Toshi MARUYAMA
Backport r13313 from rails-4.1 to trunk....
r13045 $(document).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
Jean-Philippe Lang
Tab left/right buttons for project menu (#20632)....
r14685 function setupTabs() {
if($('.tabs').length > 0) {
displayTabsButtons();
$(window).resize(displayTabsButtons);
}
}
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
Focus first text field automatically (#13134)....
r12395 function defaultFocus(){
Jean-Philippe Lang
Don't focus first input when URL contains a hash (#17757)....
r14014 if (($('#content :focus').length == 0) && (window.location.hash == '')) {
Jean-Philippe Lang
Focus first text field automatically (#13134)....
r12395 $('#content input[type=text], #content textarea').first().focus();
}
}
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);
Jean-Philippe Lang
Hide options when permission is not given....
r15086 $($(this).data('shows')).toggle(checked);
Jean-Philippe Lang
Merged custom fields format refactoring....
r12125 }
function toggleDisabledInit() {
Jean-Philippe Lang
Hide options when permission is not given....
r15086 $('input[data-disables], input[data-enables], input[data-shows]').each(toggleDisabledOnChange);
Jean-Philippe Lang
Merged custom fields format refactoring....
r12125 }
Jean-Philippe Lang
Use HTML5 date input fields instead of text fields with jquery ui date pickers (#19468)....
r14993
Jean-Philippe Lang
Keep the "new object" drop down open when the + sign was clicked (#15880)....
r15122 function toggleNewObjectDropdown() {
var dropdown = $('#new-object + ul.menu-children');
if(dropdown.hasClass('visible')){
dropdown.removeClass('visible');
}else{
dropdown.addClass('visible');
}
}
Jean-Philippe Lang
Use HTML5 date input fields instead of text fields with jquery ui date pickers (#19468)....
r14993 (function ( $ ) {
// detect if native date input is supported
var nativeDateInputSupported = true;
var input = document.createElement('input');
input.setAttribute('type','date');
if (input.type === 'text') {
nativeDateInputSupported = false;
}
var notADateValue = 'not-a-date';
input.setAttribute('value', notADateValue);
if (input.value === notADateValue) {
nativeDateInputSupported = false;
}
$.fn.datepickerFallback = function( options ) {
if (nativeDateInputSupported) {
return this;
} else {
return this.datepicker( options );
}
};
}( jQuery ));
Jean-Philippe Lang
Merged custom fields format refactoring....
r12125 $(document).ready(function(){
Jean-Philippe Lang
Hide options when permission is not given....
r15086 $('#content').on('change', 'input[data-disables], input[data-enables], input[data-shows]', toggleDisabledOnChange);
Jean-Philippe Lang
Merged custom fields format refactoring....
r12125 toggleDisabledInit();
});
Jean-Philippe Lang
Keep anchor (i.e. to a specific issue note) throughout login (#21110)....
r14385 function keepAnchorOnSignIn(form){
var hash = decodeURIComponent(self.document.location.hash);
if (hash) {
if (hash.indexOf("#") === -1) {
hash = "#" + hash;
}
form.action = form.action + hash;
}
return true;
}
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
Focus first text field automatically (#13134)....
r12395 $(document).ready(defaultFocus);
Jean-Philippe Lang
Tab left/right buttons for project menu (#20632)....
r14685 $(document).ready(setupTabs);