##// END OF EJS Templates
Merged r9390 from trunk....
Merged r9390 from trunk. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.4-stable@9400 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r8754:bd2581e7c958
r9266:8fefb7c05bb9
Show More
application.js
523 lines | 13.2 KiB | application/javascript | JavascriptLexer
Toshi MARUYAMA
remove tailing white spaces from public/javascripts/application.js...
r8711 /* Redmine - project management software
Copyright (C) 2006-2012 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
Added svn:eol-style native property for various files...
r416 function checkAll (id, checked) {
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 var els = Element.descendants(id);
for (var i = 0; i < els.length; i++) {
Jean-Philippe Lang
Fixed: Check All / Uncheck All in Email Settings doesn't work (#1180)....
r1414 if (els[i].disabled==false) {
els[i].checked = checked;
Jean-Philippe Lang
Added svn:eol-style native property for various files...
r416 }
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 }
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 boxes = $$(selector);
var all_checked = true;
for (i = 0; i < boxes.length; i++) { if (boxes[i].checked == false) { all_checked = false; } }
for (i = 0; i < boxes.length; i++) { boxes[i].checked = !all_checked; }
Jean-Philippe Lang
Adds checkboxes toggle links on permissions report....
r1769 }
Eric Davis
Changed the notifications to use a hierarchy UI...
r4108 function setCheckboxesBySelector(checked, selector) {
var boxes = $$(selector);
boxes.each(function(ele) {
ele.checked = checked;
});
}
Jean-Philippe Lang
Makes issue update link work without javascript (#1337)....
r1591 function showAndScrollTo(id, focus) {
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 Element.show(id);
if (focus!=null) { Form.Element.focus(focus); }
Element.scrollTo(id);
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) {
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 var tr = Element.up(el, 'tr');
var n = Element.next(tr);
tr.toggleClassName('open');
while (n != undefined && !n.hasClassName('group')) {
Element.toggle(n);
n = Element.next(n);
}
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) {
var tbody = Element.up(el, 'tbody');
tbody.childElements('tr').each(function(tr) {
if (tr.hasClassName('group')) {
tr.removeClassName('open');
} else {
tr.hide();
}
})
}
function expandAllRowGroups(el) {
var tbody = Element.up(el, 'tbody');
tbody.childElements('tr').each(function(tr) {
if (tr.hasClassName('group')) {
tr.addClassName('open');
} else {
tr.show();
}
})
}
function toggleAllRowGroups(el) {
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 var tr = Element.up(el, 'tr');
Jean-Philippe Lang
Adds links on the issue list to collapse/expang all groups (#7236)....
r5054 if (tr.hasClassName('open')) {
collapseAllRowGroups(el);
} else {
expandAllRowGroups(el);
}
}
Jean-Philippe Lang
Makes tickets and timelogs filters collapsible (UI)....
r2777 function toggleFieldset(el) {
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 var fieldset = Element.up(el, 'fieldset');
fieldset.toggleClassName('collapsed');
Effect.toggle(fieldset.down('div'), 'slide', {duration:0.2});
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) {
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 var fieldset = Element.up(el, 'fieldset');
fieldset.toggleClassName('collapsed');
fieldset.down('div').hide();
Jean-Philippe Lang
Allow additional workflow transitions for issue author and assignee (#2732)....
r4775 }
Jean-Philippe Lang
Moved javascript filters functions to application.js....
r8578 function add_filter() {
select = $('add_filter_select');
field = select.value
Element.show('tr_' + field);
check_box = $('cb_' + field);
check_box.checked = true;
toggle_filter(field);
select.selectedIndex = 0;
for (i=0; i<select.options.length; i++) {
if (select.options[i].value == field) {
select.options[i].disabled = true;
}
}
}
function toggle_filter(field) {
check_box = $('cb_' + field);
if (check_box.checked) {
Element.show("operators_" + field);
Form.Element.enable("operators_" + field);
toggle_operator(field);
} else {
Element.hide("operators_" + field);
Form.Element.disable("operators_" + field);
enableValues(field, []);
}
}
function enableValues(field, indexes) {
var f = $$(".values_" + field);
for(var i=0;i<f.length;i++) {
if (indexes.include(i)) {
Form.Element.enable(f[i]);
f[i].up('span').show();
} else {
f[i].value = '';
Form.Element.disable(f[i]);
f[i].up('span').hide();
}
}
if (indexes.length > 0) {
Element.show("div_values_" + field);
} else {
Element.hide("div_values_" + field);
}
}
function toggle_operator(field) {
operator = $("operators_" + field);
switch (operator.value) {
case "!*":
case "*":
case "t":
case "w":
case "o":
case "c":
enableValues(field, []);
break;
case "><":
enableValues(field, [0,1]);
break;
case "<t+":
case ">t+":
case "t+":
case ">t-":
case "<t-":
case "t-":
enableValues(field, [2]);
break;
default:
enableValues(field, [0]);
break;
}
}
function toggle_multi_select(el) {
var select = $(el);
if (select.multiple == true) {
select.multiple = false;
} else {
select.multiple = true;
}
}
function submit_query_form(id) {
selectAllOptions("selected_columns");
$(id).submit();
}
function apply_filters_observer() {
$$("#query_form input[type=text]").invoke("observe", "keypress", function(e){
if(e.keyCode == Event.KEY_RETURN) {
submit_query_form("query_form");
}
});
}
Jean-Philippe Lang
Adds an optional description to attachments....
r1166 var fileFieldCount = 1;
Jean-Philippe Lang
Added svn:eol-style native property for various files...
r416 function addFileField() {
Jean-Philippe Lang
Simplifies javascript for adding a new file....
r6091 var fields = $('attachments_fields');
Jean-Philippe Lang
Adds a button to remove a file upload before submission (#5670)....
r6092 if (fields.childElements().length >= 10) return false;
fileFieldCount++;
Jean-Philippe Lang
Fixed: Can't attach more than 1 file on IE 6 and 7 (#10115)....
r8660 var s = new Element('span');
Jean-Philippe Lang
Simplifies javascript for adding a new file....
r6091 s.update(fields.down('span').innerHTML);
s.down('input.file').name = "attachments[" + fileFieldCount + "][file]";
s.down('input.description').name = "attachments[" + fileFieldCount + "][description]";
fields.appendChild(s);
Jean-Philippe Lang
Added svn:eol-style native property for various files...
r416 }
Jean-Philippe Lang
Adds a button to remove a file upload before submission (#5670)....
r6092 function removeFileField(el) {
var fields = $('attachments_fields');
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 var s = Element.up(el, 'span');
if (fields.childElements().length > 1) {
s.remove();
} else {
s.update(s.innerHTML);
}
Jean-Philippe Lang
Adds a button to remove a file upload before submission (#5670)....
r6092 }
Jean-Philippe Lang
Check attachment size when the user selects a file (#9667)....
r7806 function checkFileSize(el, maxSize, message) {
var files = el.files;
if (files) {
for (var i=0; i<files.length; i++) {
if (files[i].size > maxSize) {
alert(message);
el.value = "";
}
}
}
}
Jean-Philippe Lang
Added svn:eol-style native property for various files...
r416 function showTab(name) {
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 var f = $$('div#content .tab-content');
for(var i=0; i<f.length; i++){
Element.hide(f[i]);
}
var f = $$('div.tabs a');
for(var i=0; i<f.length; i++){
Element.removeClassName(f[i], "selected");
}
Element.show('tab-content-' + name);
Element.addClassName('tab-' + name, "selected");
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) {
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 var lis = Element.up(el, 'div.tabs').down('ul').childElements();
var tabsWidth = 0;
var i;
for (i=0; i<lis.length; i++) {
if (lis[i].visible()) {
tabsWidth += lis[i].getWidth() + 6;
}
}
if (tabsWidth < Element.up(el, 'div.tabs').getWidth() - 60) {
return;
}
i=0;
while (i<lis.length && !lis[i].visible()) {
i++;
}
lis[i].hide();
Jean-Philippe Lang
Adds buttons to scroll the tabs when they overflow....
r3060 }
function moveTabLeft(el) {
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 var lis = Element.up(el, 'div.tabs').down('ul').childElements();
var i = 0;
while (i<lis.length && !lis[i].visible()) {
i++;
}
if (i>0) {
lis[i-1].show();
}
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;
var i;
$$('div.tabs').each(function(el) {
lis = el.down('ul').childElements();
for (i=0; i<lis.length; i++) {
if (lis[i].visible()) {
tabsWidth += lis[i].getWidth() + 6;
}
}
if ((tabsWidth < el.getWidth() - 60) && (lis[0].visible())) {
el.down('div.tabs-buttons').hide();
} else {
el.down('div.tabs-buttons').show();
}
});
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() {
relationType = $('relation_relation_type');
Jean-Philippe Lang
Adds 'follows' relation (#1432)....
r3076 if (relationType && (relationType.value == "precedes" || relationType.value == "follows")) {
Jean-Philippe Lang
Issue relations first commit (not thoroughly tested). 4 kinds of relation are available:...
r503 Element.show('predecessor_fields');
} else {
Element.hide('predecessor_fields');
}
}
Jean-Philippe Lang
Added a link to add a new category when creating or editing an issue....
r642 function promptToRemote(text, param, url) {
value = prompt(text + ':');
if (value) {
Jean-Philippe Lang
Fixed: encoding problem when adding non-ASCII issue category in the new issue page (#1286)....
r1428 new Ajax.Request(url + '?' + param + '=' + encodeURIComponent(value), {asynchronous:true, evalScripts:true});
Jean-Philippe Lang
Added a link to add a new category when creating or editing an issue....
r642 return false;
}
}
Jean-Philippe Lang
Adds a dialog box for CSV export options (#4742)....
r7754 function showModal(id, width) {
el = $(id);
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 if (el == undefined || el.visible()) {return;}
Jean-Philippe Lang
Adds a dialog box for CSV export options (#4742)....
r7754 var h = $$('body')[0].getHeight();
var d = document.createElement("div");
d.id = 'modalbg';
$('main').appendChild(d);
$('modalbg').setStyle({ width: '100%', height: h + 'px' });
$('modalbg').show();
var pageWidth = document.viewport.getWidth();
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 if (width) {
el.setStyle({'width': width});
Jean-Philippe Lang
Check if width parameter is present....
r8474 }
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 el.setStyle({'left': (((pageWidth - el.getWidth())/2 *100) / pageWidth) + '%'});
Jean-Philippe Lang
Adds a dialog box for CSV export options (#4742)....
r7754 el.addClassName('modal');
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 el.show();
Jean-Philippe Lang
Adds a dialog box for CSV export options (#4742)....
r7754
Jean-Philippe Lang
Focus the first text input or submit button when showing a modal box....
r8753 if (el.down("input[type=text]")) {
el.down("input[type=text]").focus();
} else if (el.down("input[type=submit]")) {
el.down("input[type=submit]").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;
if (el) {
modal = Element.up(el, 'div.modal');
} else {
modal = $('ajax-modal');
}
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 if (modal) {
modal.hide();
}
var bg = $('modalbg');
if (bg) {
bg.remove();
Jean-Philippe Lang
Adds a dialog box for CSV export options (#4742)....
r7754 }
}
Jean-Philippe Lang
SCM browser: directories can now be collapsed and re-expanded with no additional request....
r850 function collapseScmEntry(id) {
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 var els = document.getElementsByClassName(id, 'browser');
for (var i = 0; i < els.length; i++) {
if (els[i].hasClassName('open')) {
collapseScmEntry(els[i].id);
}
Element.hide(els[i]);
}
$(id).removeClassName('open');
Jean-Philippe Lang
SCM browser: directories can now be collapsed and re-expanded with no additional request....
r850 }
function expandScmEntry(id) {
var els = document.getElementsByClassName(id, 'browser');
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 for (var i = 0; i < els.length; i++) {
Jean-Philippe Lang
SCM browser: directories can now be collapsed and re-expanded with no additional request....
r850 Element.show(els[i]);
Jean-Philippe Lang
SCM browser:...
r855 if (els[i].hasClassName('loaded') && !els[i].hasClassName('collapsed')) {
expandScmEntry(els[i].id);
}
Jean-Philippe Lang
SCM browser: directories can now be collapsed and re-expanded with no additional request....
r850 }
$(id).addClassName('open');
}
function scmEntryClick(id) {
el = $(id);
if (el.hasClassName('open')) {
collapseScmEntry(id);
Jean-Philippe Lang
SCM browser:...
r855 el.addClassName('collapsed');
Jean-Philippe Lang
SCM browser: directories can now be collapsed and re-expanded with no additional request....
r850 return false;
} else if (el.hasClassName('loaded')) {
expandScmEntry(id);
Jean-Philippe Lang
SCM browser:...
r855 el.removeClassName('collapsed');
Jean-Philippe Lang
SCM browser: directories can now be collapsed and re-expanded with no additional request....
r850 return false;
}
Jean-Philippe Lang
SCM browser:...
r855 if (el.hasClassName('loading')) {
return false;
}
el.addClassName('loading');
Jean-Philippe Lang
SCM browser: directories can now be collapsed and re-expanded with no additional request....
r850 return true;
}
function scmEntryLoaded(id) {
Element.addClassName(id, 'open');
Element.addClassName(id, 'loaded');
Jean-Philippe Lang
SCM browser:...
r855 Element.removeClassName(id, 'loading');
Jean-Philippe Lang
SCM browser: directories can now be collapsed and re-expanded with no additional request....
r850 }
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
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 var chars = new Array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z');
var key = '';
for (i = 0; i < size; i++) {
key += chars[Math.floor(Math.random() * chars.length)];
}
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
Adds subtasking (#443) including:...
r3459 function observeParentIssueField(url) {
new Ajax.Autocompleter('issue_parent_issue_id',
'parent_issue_candidates',
url,
{ minChars: 3,
frequency: 0.5,
paramName: 'q',
Jean-Philippe Lang
Changes auto_complete calls to GET requests....
r8010 method: 'get',
Jean-Philippe Lang
Adds subtasking (#443) including:...
r3459 updateElement: function(value) {
document.getElementById('issue_parent_issue_id').value = value.id;
}});
}
Jean-Philippe Lang
Autocomplete issue relations on subject (#3170)....
r4388 function observeRelatedIssueField(url) {
new Ajax.Autocompleter('relation_issue_to_id',
'related_issue_candidates',
url,
{ minChars: 3,
frequency: 0.5,
paramName: 'q',
Jean-Philippe Lang
Changes auto_complete calls to GET requests....
r8010 method: 'get',
Jean-Philippe Lang
Autocomplete issue relations on subject (#3170)....
r4388 updateElement: function(value) {
document.getElementById('relation_issue_to_id').value = value.id;
},
parameters: 'scope=all'
});
}
Jean-Philippe Lang
Do not show trackers and issue custom fields on project form when issue tracking is disabled (#7225)....
r4528 function setVisible(id, visible) {
var el = $(id);
if (el) {if (visible) {el.show();} else {el.hide();}}
}
function observeProjectModules() {
var f = function() {
/* Hides trackers and issues custom fields on the new project form when issue_tracking module is disabled */
var c = ($('project_enabled_module_names_issue_tracking').checked == true);
setVisible('project_trackers', c);
setVisible('project_issue_custom_fields', c);
};
Toshi MARUYAMA
remove tailing white spaces from public/javascripts/application.js...
r8711
Jean-Philippe Lang
Do not show trackers and issue custom fields on project form when issue tracking is disabled (#7225)....
r4528 Event.observe(window, 'load', f);
Event.observe('project_enabled_module_names_issue_tracking', 'change', f);
}
Jean-Philippe Lang
Warning on leaving a page with unsaved content in textarea (#2910)....
r4780 /*
* Class used to warn user when leaving a page with unsaved textarea
* Author: mathias.fischer@berlinonline.de
*/
var WarnLeavingUnsaved = Class.create({
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 observedForms: false,
observedElements: false,
changedForms: false,
message: null,
Toshi MARUYAMA
remove tailing white spaces from public/javascripts/application.js...
r8711
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 initialize: function(message){
this.observedForms = $$('form');
this.observedElements = $$('textarea');
this.message = message;
Toshi MARUYAMA
remove tailing white spaces from public/javascripts/application.js...
r8711
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 this.observedElements.each(this.observeChange.bind(this));
this.observedForms.each(this.submitAction.bind(this));
Toshi MARUYAMA
remove tailing white spaces from public/javascripts/application.js...
r8711
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 window.onbeforeunload = this.unload.bind(this);
},
Toshi MARUYAMA
remove tailing white spaces from public/javascripts/application.js...
r8711
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 unload: function(){
this.observedElements.each(function(el) {el.blur();})
if(this.changedForms)
Jean-Philippe Lang
Warning on leaving a page with unsaved content in textarea (#2910)....
r4780 return this.message;
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 },
Toshi MARUYAMA
remove tailing white spaces from public/javascripts/application.js...
r8711
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 setChanged: function(){
Jean-Philippe Lang
Warning on leaving a page with unsaved content in textarea (#2910)....
r4780 this.changedForms = true;
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 },
Toshi MARUYAMA
remove tailing white spaces from public/javascripts/application.js...
r8711
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 setUnchanged: function(){
Jean-Philippe Lang
Warning on leaving a page with unsaved content in textarea (#2910)....
r4780 this.changedForms = false;
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 },
Toshi MARUYAMA
remove tailing white spaces from public/javascripts/application.js...
r8711
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 observeChange: function(element){
Jean-Philippe Lang
Warning on leaving a page with unsaved content in textarea (#2910)....
r4780 element.observe('change',this.setChanged.bindAsEventListener(this));
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 },
Toshi MARUYAMA
remove tailing white spaces from public/javascripts/application.js...
r8711
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 submitAction: function(element){
Jean-Philippe Lang
Warning on leaving a page with unsaved content in textarea (#2910)....
r4780 element.observe('submit',this.setUnchanged.bindAsEventListener(this));
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 }
Jean-Philippe Lang
Warning on leaving a page with unsaved content in textarea (#2910)....
r4780 });
Jean-Philippe Lang
Do not show trackers and issue custom fields on project form when issue tracking is disabled (#7225)....
r4528
Toshi MARUYAMA
remove tailing white spaces from public/javascripts/application.js...
r8711 /*
Jean-Philippe Lang
Send the CSRF token with Ajax requests (#7843)....
r5014 * 1 - registers a callback which copies the csrf token into the
Toshi MARUYAMA
remove tailing white spaces from public/javascripts/application.js...
r8711 * X-CSRF-Token header with each ajax request. Necessary to
Jean-Philippe Lang
Send the CSRF token with Ajax requests (#7843)....
r5014 * work with rails applications which have fixed
* CVE-2011-0447
* 2 - shows and hides ajax indicator
*/
Jean-Philippe Lang
Added an ajax indicator for all ajax calls. Also removed highlight effects on my page layout edition....
r482 Ajax.Responders.register({
Jean-Philippe Lang
Send the CSRF token with Ajax requests (#7843)....
r5014 onCreate: function(request){
var csrf_meta_tag = $$('meta[name=csrf-token]')[0];
if (csrf_meta_tag) {
var header = 'X-CSRF-Token',
token = csrf_meta_tag.readAttribute('content');
if (!request.options.requestHeaders) {
request.options.requestHeaders = {};
}
request.options.requestHeaders[header] = token;
}
Jean-Philippe Lang
Restyles user search fields and ajax indicator....
r8754 if ($('ajax-indicator') && Ajax.activeRequestCount > 0 && $$('input.ajax-loading').size() == 0) {
Jean-Philippe Lang
Added an ajax indicator for all ajax calls. Also removed highlight effects on my page layout edition....
r482 Element.show('ajax-indicator');
}
},
onComplete: function(){
if ($('ajax-indicator') && Ajax.activeRequestCount == 0) {
Element.hide('ajax-indicator');
}
}
});
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
Fixed: changing user/roles of project member not possible without javascript (#4852)...
r3369 $$('.hol').each(function(el) {
Toshi MARUYAMA
replace tabs to spaces and fix indents public/javascripts/application.js...
r8710 el.hide();
});
Eric Davis
Hide the role forms when editing or adding Project members. #5452...
r3670 }
Event.observe(window, 'load', hideOnLoad);