JavaScript working for subdir

This commit is contained in:
Eric Allen 2010-03-14 16:37:09 -04:00
parent a0d12c95e9
commit 25f0f3dfd9
3 changed files with 8 additions and 7 deletions

View file

@ -21,6 +21,7 @@
var tagNames = <%= tag_names_for_autocomplete %>;
var dateFormat = '<%= date_format_for_date_picker %>';
var weekStart = '<%= current_user.prefs.week_starts %>';
function relative_to_root(path) { return '<%= root_url %>'+path; };
<% end -%>
<% if @prefs.refresh != 0 -%>
setup_auto_refresh(<%= @prefs["refresh"].to_i*60000 %>);

View file

@ -154,9 +154,9 @@ function update_order(event, ui){
url = '';
if(row.hasClass('context'))
url = '/contexts/order';
url = relative_to_root('contexts/order');
else if(row.hasClass('project'))
url = '/projects/order';
url = relative_to_root('projects/order');
else {
console.log("Bad sortable list");
return;
@ -212,7 +212,7 @@ function enable_rich_interaction(){
dropped_todo = $(this).parents('.item-show').get(0).id.split('_')[2];
ui.draggable.hide();
$(this).block({message: null});
$.post('/todos/add_predecessor',
$.post(relative_to_root('todos/add_predecessor'),
{successor: dragged_todo, predecessor: dropped_todo},
null, 'script');
}
@ -404,7 +404,7 @@ $(document).ready(function() {
highlight = function(){
$('div.context span#context_name').effect('highlight', {}, 500);
};
$.post('/contexts/update/'+context_id, {'context[name]': value}, highlight);
$.post(relative_to_root('contexts/update/'+context_id), {'context[name]': value}, highlight);
return(value);
}, {style: 'padding:0px', submit: "OK", cancel: "CANCEL"});
@ -415,7 +415,7 @@ $(document).ready(function() {
highlight = function(){
$('h2#project_name').effect('highlight', {}, 500);
};
$.post('/projects/update/'+project_id, {'project[name]': value, 'update_project_name': 'true'}, highlight, 'script');
$.post(relative_to_root('projects/update/'+project_id), {'project[name]': value, 'update_project_name': 'true'}, highlight, 'script');
return(value);
};

View file

@ -99,8 +99,8 @@ a.to_bottom:hover {background: transparent url(../images/bottom_on.png) no-repea
a.show_notes, a.link_to_notes {background-image: url(../images/notes_off.png); background-repeat: no-repeat; padding: 1px; background-color: transparent;}
a.show_notes:hover, a.link_to_notes:hover {background-image: url(../images/notes_on.png); background-repeat: no-repeat; padding: 1px; background-color: transparent;}
a.show_successors, a.link_to_successors {background-image: url(/images/successor_off.png); background-repeat: no-repeat; padding: 1px; background-color: transparent;}
a.show_successors:hover, a.link_to_successors:hover {background-image: url(/images/successor_on.png); background-repeat: no-repeat; padding: 1px; background-color: transparent;}
a.show_successors, a.link_to_successors {background-image: url(../images/successor_off.png); background-repeat: no-repeat; padding: 1px; background-color: transparent;}
a.show_successors:hover, a.link_to_successors:hover {background-image: url(../images/successor_on.png); background-repeat: no-repeat; padding: 1px; background-color: transparent;}
/* Structural divs */