summaryrefslogtreecommitdiffstats
path: root/app/views/repositories
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-07-22 13:29:26 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-07-22 13:29:26 +0000
commit6a2ca5e0342751b6d38a1a05ad25b5c0002d6e46 (patch)
treeaf09ea2d29ce61690b656be91fbf82a3009ea1ed /app/views/repositories
parent387836f8aa736eba4dfe0da879ad71bbc19dd224 (diff)
downloadredmine-6a2ca5e0342751b6d38a1a05ad25b5c0002d6e46.tar.gz
redmine-6a2ca5e0342751b6d38a1a05ad25b5c0002d6e46.zip
JQuery in, Prototype/Scriptaculous out (#11445).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10068 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/repositories')
-rw-r--r--app/views/repositories/_dir_list_content.html.erb12
-rw-r--r--app/views/repositories/_related_issues.html.erb1
-rw-r--r--app/views/repositories/_revision_graph.html.erb19
-rw-r--r--app/views/repositories/_revisions.html.erb4
-rw-r--r--app/views/repositories/add_related_issue.js.erb5
-rw-r--r--app/views/repositories/edit.html.erb2
-rw-r--r--app/views/repositories/new.html.erb2
-rw-r--r--app/views/repositories/new.js.erb1
-rw-r--r--app/views/repositories/remove_related_issue.js.erb2
9 files changed, 20 insertions, 28 deletions
diff --git a/app/views/repositories/_dir_list_content.html.erb b/app/views/repositories/_dir_list_content.html.erb
index 8ad228ded..e1eddb0cf 100644
--- a/app/views/repositories/_dir_list_content.html.erb
+++ b/app/views/repositories/_dir_list_content.html.erb
@@ -7,22 +7,14 @@
<td style="padding-left: <%=18 * depth%>px;" class="<%=
@repository.report_last_commit ? "filename" : "filename_no_report" %>";>
<% if entry.is_dir? %>
-<span class="expander" onclick="<%= remote_function(
- :url => {
+<span class="expander" onclick="scmEntryClick('<%= tr_id %>', '<%= escape_javascript(url_for(
:action => 'show',
:id => @project,
:repository_id => @repository.identifier_param,
:path => to_path_param(ent_path),
:rev => @rev,
:depth => (depth + 1),
- :parent_id => tr_id
- },
- :method => :get,
- :update => { :success => tr_id },
- :position => :after,
- :success => "scmEntryLoaded('#{tr_id}')",
- :condition => "scmEntryClick('#{tr_id}')"
- ) %>">&nbsp</span>
+ :parent_id => tr_id)) %>');">&nbsp</span>
<% end %>
<%= link_to h(ent_name),
{:action => (entry.is_dir? ? 'show' : 'changes'), :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(ent_path), :rev => @rev},
diff --git a/app/views/repositories/_related_issues.html.erb b/app/views/repositories/_related_issues.html.erb
index 961e5ad6b..bc843b3ec 100644
--- a/app/views/repositories/_related_issues.html.erb
+++ b/app/views/repositories/_related_issues.html.erb
@@ -29,7 +29,6 @@
:id => @project, :repository_id => @repository.identifier_param,
:rev => @changeset.identifier},
:method => :post,
- :complete => "Form.Element.focus('issue_id');",
:html => {:id => 'new-relation-form', :style => (@issue ? '' : 'display: none;')}) do |f| %>
<%= l(:label_issue) %> #<%= text_field_tag 'issue_id', '', :size => 10 %>
<%= submit_tag l(:button_add) %>
diff --git a/app/views/repositories/_revision_graph.html.erb b/app/views/repositories/_revision_graph.html.erb
index a26682f27..9ab4b1e5a 100644
--- a/app/views/repositories/_revision_graph.html.erb
+++ b/app/views/repositories/_revision_graph.html.erb
@@ -2,17 +2,16 @@
<%= javascript_include_tag 'revision_graph.js' %>
<script type="text/javascript" charset="utf-8">
+function revisionGraphHandler(){
+ drawRevisionGraph(
+ document.getElementById('holder'),
+ <%= commits.to_json.html_safe %>,
+ <%= space %>
+ );
+}
- ['load', 'resize'].each(function(window_event) {
-
- Event.observe(window, window_event, function(){
-
- drawRevisionGraph(
- document.getElementById('holder'),
- <%= commits.to_json.html_safe %>,
- <%= space %>);
- });
- });
+$(document).ready(revisionGraphHandler);
+$(window).resize(revisionGraphHandler);
</script>
<div id="holder" class="revision-graph"></div>
diff --git a/app/views/repositories/_revisions.html.erb b/app/views/repositories/_revisions.html.erb
index 3833e9788..844c06500 100644
--- a/app/views/repositories/_revisions.html.erb
+++ b/app/views/repositories/_revisions.html.erb
@@ -37,8 +37,8 @@ end %>
<%= content_tag(:td, :class => 'id', :style => id_style) do %>
<%= link_to_revision(changeset, @repository) %>
<% end %>
-<td class="checkbox"><%= radio_button_tag('rev', changeset.identifier, (line_num==1), :id => "cb-#{line_num}", :onclick => "$('cbto-#{line_num+1}').checked=true;") if show_diff && (line_num < revisions.size) %></td>
-<td class="checkbox"><%= radio_button_tag('rev_to', changeset.identifier, (line_num==2), :id => "cbto-#{line_num}", :onclick => "if ($('cb-#{line_num}').checked==true) {$('cb-#{line_num-1}').checked=true;}") if show_diff && (line_num > 1) %></td>
+<td class="checkbox"><%= radio_button_tag('rev', changeset.identifier, (line_num==1), :id => "cb-#{line_num}", :onclick => "$('#cbto-#{line_num+1}').attr('checked',true);") if show_diff && (line_num < revisions.size) %></td>
+<td class="checkbox"><%= radio_button_tag('rev_to', changeset.identifier, (line_num==2), :id => "cbto-#{line_num}", :onclick => "if ($('#cb-#{line_num}').attr('checked')) {$('#cb-#{line_num-1}').attr('checked',true);}") if show_diff && (line_num > 1) %></td>
<td class="committed_on"><%= format_time(changeset.committed_on) %></td>
<td class="author"><%= h truncate(changeset.author.to_s, :length => 30) %></td>
<td class="comments"><%= textilizable(truncate_at_line_break(changeset.comments)) %></td>
diff --git a/app/views/repositories/add_related_issue.js.erb b/app/views/repositories/add_related_issue.js.erb
index 66740af7f..bc156ebc2 100644
--- a/app/views/repositories/add_related_issue.js.erb
+++ b/app/views/repositories/add_related_issue.js.erb
@@ -1,6 +1,7 @@
<% if @issue %>
- Element.update('related-issues', '<%= escape_javascript(render :partial => "related_issues") %>');
- Effect.highlight('related-issue-<%= @issue.id %>');
+ $('#related-issues').html('<%= escape_javascript(render :partial => "related_issues") %>');
+ $('#related-issue-<%= @issue.id %>').effect("highlight");
+ $('#issue_id').focus();
<% else %>
alert("<%= escape_javascript(l(:label_issue) + ' ' + l('activerecord.errors.messages.invalid')) %>");
<% end %>
diff --git a/app/views/repositories/edit.html.erb b/app/views/repositories/edit.html.erb
index 9a9443b8a..21926158f 100644
--- a/app/views/repositories/edit.html.erb
+++ b/app/views/repositories/edit.html.erb
@@ -1,5 +1,5 @@
<h2><%= l(:label_repository) %></h2>
-<%= labelled_form_for :repository, @repository, :url => repository_path(@repository), :html => {:method => :put} do |f| %>
+<%= labelled_form_for :repository, @repository, :url => repository_path(@repository), :html => {:method => :put, :id => 'repository-form'} do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %>
<% end %>
diff --git a/app/views/repositories/new.html.erb b/app/views/repositories/new.html.erb
index 9f40c542f..df2b2c6bf 100644
--- a/app/views/repositories/new.html.erb
+++ b/app/views/repositories/new.html.erb
@@ -1,5 +1,5 @@
<h2><%= l(:label_repository_new) %></h2>
-<%= labelled_form_for :repository, @repository, :url => project_repositories_path(@project) do |f| %>
+<%= labelled_form_for :repository, @repository, :url => project_repositories_path(@project), :html => {:id => 'repository-form'} do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %>
<% end %>
diff --git a/app/views/repositories/new.js.erb b/app/views/repositories/new.js.erb
new file mode 100644
index 000000000..d62580b05
--- /dev/null
+++ b/app/views/repositories/new.js.erb
@@ -0,0 +1 @@
+$('#content').html('<%= escape_javascript(render :template => 'repositories/new.html') %>');
diff --git a/app/views/repositories/remove_related_issue.js.erb b/app/views/repositories/remove_related_issue.js.erb
index 6fb62cdee..c4dc0e974 100644
--- a/app/views/repositories/remove_related_issue.js.erb
+++ b/app/views/repositories/remove_related_issue.js.erb
@@ -1 +1 @@
-Element.remove('related-issue-<%= @issue.id %>');
+$('#related-issue-<%= @issue.id %>').remove();