Backport r13313 from rails-4.1 to trunk.

Upgrade to JQuery 1.11.1

git-svn-id: http://svn.redmine.org/redmine/trunk@13408 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA
2014-09-14 14:17:52 +00:00
parent 0b8645007f
commit cc688bb1b1
31 changed files with 52 additions and 40 deletions

View File

@@ -1,7 +1,7 @@
source 'https://rubygems.org' source 'https://rubygems.org'
gem "rails", "3.2.19" gem "rails", "3.2.19"
gem "jquery-rails", "~> 2.0.2" gem "jquery-rails", "~> 3.1.1"
gem "coderay", "~> 1.1.0" gem "coderay", "~> 1.1.0"
gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby] gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby]
gem "builder", ">= 3.0.4" gem "builder", ">= 3.0.4"

View File

@@ -1295,7 +1295,7 @@ module ApplicationHelper
# Returns the javascript tags that are included in the html layout head # Returns the javascript tags that are included in the html layout head
def javascript_heads def javascript_heads
tags = javascript_include_tag('jquery-1.8.3-ui-1.9.2-ujs-2.0.3', 'application') tags = javascript_include_tag('jquery-1.11.1-ui-1.11.0-ujs-3.1.1', 'application')
unless User.current.pref.warn_on_leaving_unsaved == '0' unless User.current.pref.warn_on_leaving_unsaved == '0'
tags << "\n".html_safe + javascript_tag("$(window).load(function(){ warnLeavingUnsaved('#{escape_javascript l(:text_warn_on_leaving_unsaved)}'); });") tags << "\n".html_safe + javascript_tag("$(window).load(function(){ warnLeavingUnsaved('#{escape_javascript l(:text_warn_on_leaving_unsaved)}'); });")
end end

View File

@@ -185,7 +185,7 @@
<%= javascript_tag do %> <%= javascript_tag do %>
$(window).load(function(){ $(window).load(function(){
$(document).on('change', 'input[data-disables]', function(){ $(document).on('change', 'input[data-disables]', function(){
if ($(this).attr('checked')){ if ($(this).prop('checked')){
$($(this).data('disables')).attr('disabled', true).val(''); $($(this).data('disables')).attr('disabled', true).val('');
} else { } else {
$($(this).data('disables')).attr('disabled', false); $($(this).data('disables')).attr('disabled', false);

View File

@@ -3,7 +3,7 @@ $('#issue_notes').val("<%= raw escape_javascript(@content) %>");
# when quoting a private journal, check the private checkbox # when quoting a private journal, check the private checkbox
if @journal && @journal.private_notes? if @journal && @journal.private_notes?
%> %>
$('#issue_private_notes').attr('checked', true); $('#issue_private_notes').prop('checked', true);
<% end %> <% end %>
showAndScrollTo("update", "notes"); showAndScrollTo("update", "notes");

View File

@@ -7,7 +7,7 @@
<meta name="keywords" content="issue,bug,tracker" /> <meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %> <%= csrf_meta_tag %>
<%= favicon %> <%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', :media => 'all' %> <%= stylesheet_link_tag 'jquery/jquery-ui-1.11.0', 'application', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %> <%= javascript_heads %>
<%= heads_for_theme %> <%= heads_for_theme %>

View File

@@ -92,7 +92,7 @@
<%= javascript_tag do %> <%= javascript_tag do %>
$(document).ready(function() { $(document).ready(function() {
$('#project_enabled_module_names_issue_tracking').on('change', function(){ $('#project_enabled_module_names_issue_tracking').on('change', function(){
if ($(this).attr('checked')){ if ($(this).prop('checked')){
$('#project_trackers, #project_issue_custom_fields').show(); $('#project_trackers, #project_issue_custom_fields').show();
} else { } else {
$('#project_trackers, #project_issue_custom_fields').hide(); $('#project_trackers, #project_issue_custom_fields').hide();

View File

@@ -37,8 +37,8 @@ end %>
<%= content_tag(:td, :class => 'id', :style => id_style) do %> <%= content_tag(:td, :class => 'id', :style => id_style) do %>
<%= link_to_revision(changeset, @repository) %> <%= link_to_revision(changeset, @repository) %>
<% end %> <% end %>
<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', changeset.identifier, (line_num==1), :id => "cb-#{line_num}", :onclick => "$('#cbto-#{line_num+1}').prop('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="checkbox"><%= radio_button_tag('rev_to', changeset.identifier, (line_num==2), :id => "cbto-#{line_num}", :onclick => "if ($('#cb-#{line_num}').prop('checked')) {$('#cb-#{line_num-1}').prop('checked',true);}") if show_diff && (line_num > 1) %></td>
<td class="committed_on"><%= format_time(changeset.committed_on) %></td> <td class="committed_on"><%= format_time(changeset.committed_on) %></td>
<td class="author"><%= changeset.author.to_s.truncate(30) %></td> <td class="author"><%= changeset.author.to_s.truncate(30) %></td>
<td class="comments"><%= textilizable(truncate_at_line_break(changeset.comments)) %></td> <td class="comments"><%= textilizable(truncate_at_line_break(changeset.comments)) %></td>

View File

@@ -56,8 +56,8 @@
<%= javascript_tag do %> <%= javascript_tag do %>
$("#search-types a").click(function(e){ $("#search-types a").click(function(e){
e.preventDefault(); e.preventDefault();
$("#search-types input[type=checkbox]").attr('checked', false); $("#search-types input[type=checkbox]").prop('checked', false);
$(this).siblings("input[type=checkbox]").attr('checked', true); $(this).siblings("input[type=checkbox]").prop('checked', true);
if ($("#search-input").val() != "") { if ($("#search-input").val() != "") {
$("#search-form").submit(); $("#search-form").submit();
} }

View File

@@ -12,7 +12,7 @@
<label><%= radio_button_tag 'todo', 'reassign', false %> <%= l(:text_wiki_page_reassign_children) %></label>: <label><%= radio_button_tag 'todo', 'reassign', false %> <%= l(:text_wiki_page_reassign_children) %></label>:
<%= label_tag "reassign_to_id", l(:description_wiki_subpages_reassign), :class => "hidden-for-sighted" %> <%= label_tag "reassign_to_id", l(:description_wiki_subpages_reassign), :class => "hidden-for-sighted" %>
<%= select_tag 'reassign_to_id', wiki_page_options_for_select(@reassignable_to), <%= select_tag 'reassign_to_id', wiki_page_options_for_select(@reassignable_to),
:onclick => "$('#todo_reassign').attr('checked', true);" %> :onclick => "$('#todo_reassign').prop('checked', true);" %>
<% end %> <% end %>
</p> </p>
</div> </div>

View File

@@ -21,7 +21,7 @@
<% @versions.each do |ver| %> <% @versions.each do |ver| %>
<tr class="wiki-page-version <%= cycle("odd", "even") %>"> <tr class="wiki-page-version <%= cycle("odd", "even") %>">
<td class="id"><%= link_to h(ver.version), :action => 'show', :id => @page.title, :project_id => @page.project, :version => ver.version %></td> <td class="id"><%= link_to h(ver.version), :action => 'show', :id => @page.title, :project_id => @page.project, :version => ver.version %></td>
<td class="checkbox"><%= radio_button_tag('version', ver.version, (line_num==1), :id => "cb-#{line_num}", :onclick => "$('#cbto-#{line_num+1}').attr('checked', true);") if show_diff && (line_num < @versions.size) %></td> <td class="checkbox"><%= radio_button_tag('version', ver.version, (line_num==1), :id => "cb-#{line_num}", :onclick => "$('#cbto-#{line_num+1}').prop('checked', true);") if show_diff && (line_num < @versions.size) %></td>
<td class="checkbox"><%= radio_button_tag('version_from', ver.version, (line_num==2), :id => "cbto-#{line_num}") if show_diff && (line_num > 1) %></td> <td class="checkbox"><%= radio_button_tag('version_from', ver.version, (line_num==2), :id => "cbto-#{line_num}") if show_diff && (line_num > 1) %></td>
<td class="updated_on"><%= format_time(ver.updated_on) %></td> <td class="updated_on"><%= format_time(ver.updated_on) %></td>
<td class="author"><%= link_to_user ver.author %></td> <td class="author"><%= link_to_user ver.author %></td>

View File

@@ -2,7 +2,7 @@
Copyright (C) 2006-2014 Jean-Philippe Lang */ Copyright (C) 2006-2014 Jean-Philippe Lang */
function checkAll(id, checked) { function checkAll(id, checked) {
$('#'+id).find('input[type=checkbox]:enabled').attr('checked', checked); $('#'+id).find('input[type=checkbox]:enabled').prop('checked', checked);
} }
function toggleCheckboxesBySelector(selector) { function toggleCheckboxesBySelector(selector) {
@@ -10,7 +10,7 @@ function toggleCheckboxesBySelector(selector) {
$(selector).each(function(index) { $(selector).each(function(index) {
if (!$(this).is(':checked')) { all_checked = false; } if (!$(this).is(':checked')) { all_checked = false; }
}); });
$(selector).attr('checked', !all_checked); $(selector).prop('checked', !all_checked);
} }
function showAndScrollTo(id, focus) { function showAndScrollTo(id, focus) {
@@ -100,7 +100,7 @@ function addFilter(field, operator, values) {
} else { } else {
buildFilterRow(field, operator, values); buildFilterRow(field, operator, values);
} }
$('#cb_'+fieldId).attr('checked', true); $('#cb_'+fieldId).prop('checked', true);
toggleFilter(field); toggleFilter(field);
$('#add_filter_select').val('').children('option').each(function() { $('#add_filter_select').val('').children('option').each(function() {
if ($(this).attr('value') == field) { if ($(this).attr('value') == field) {
@@ -555,12 +555,12 @@ function warnLeavingUnsaved(message) {
} }
function setupAjaxIndicator() { function setupAjaxIndicator() {
$('#ajax-indicator').bind('ajaxSend', function(event, xhr, settings) { $(document).bind('ajaxSend', function(event, xhr, settings) {
if ($('.ajax-loading').length === 0 && settings.contentType != 'application/octet-stream') { if ($('.ajax-loading').length === 0 && settings.contentType != 'application/octet-stream') {
$('#ajax-indicator').show(); $('#ajax-indicator').show();
} }
}); });
$('#ajax-indicator').bind('ajaxStop', function() { $(document).bind('ajaxStop', function() {
$('#ajax-indicator').hide(); $('#ajax-indicator').hide();
}); });
} }

View File

@@ -31,7 +31,7 @@ function contextMenuClick(event) {
// a row was clicked, check if the click was on checkbox // a row was clicked, check if the click was on checkbox
if (target.is('input')) { if (target.is('input')) {
// a checkbox may be clicked // a checkbox may be clicked
if (target.attr('checked')) { if (target.prop('checked')) {
tr.addClass('context-menu-selection'); tr.addClass('context-menu-selection');
} else { } else {
tr.removeClass('context-menu-selection'); tr.removeClass('context-menu-selection');
@@ -180,7 +180,7 @@ function contextMenuIsSelected(tr) {
} }
function contextMenuCheckSelectionBox(tr, checked) { function contextMenuCheckSelectionBox(tr, checked) {
tr.find('input[type=checkbox]').attr('checked', checked); tr.find('input[type=checkbox]').prop('checked', checked);
} }
function contextMenuClearDocumentSelection() { function contextMenuClearDocumentSelection() {
@@ -207,13 +207,13 @@ function contextMenuInit(url) {
function toggleIssuesSelection(el) { function toggleIssuesSelection(el) {
var boxes = $(el).parents('form').find('input[type=checkbox]'); var boxes = $(el).parents('form').find('input[type=checkbox]');
var all_checked = true; var all_checked = true;
boxes.each(function(){ if (!$(this).attr('checked')) { all_checked = false; } }); boxes.each(function(){ if (!$(this).prop('checked')) { all_checked = false; } });
boxes.each(function(){ boxes.each(function(){
if (all_checked) { if (all_checked) {
$(this).removeAttr('checked'); $(this).removeAttr('checked');
$(this).parents('tr').removeClass('context-menu-selection'); $(this).parents('tr').removeClass('context-menu-selection');
} else if (!$(this).attr('checked')) { } else if (!$(this).prop('checked')) {
$(this).attr('checked', true); $(this).prop('checked', true);
$(this).parents('tr').addClass('context-menu-selection'); $(this).parents('tr').addClass('context-menu-selection');
} }
}); });

View File

@@ -165,8 +165,8 @@ function drawGanttHandler() {
else else
draw_gantt = Raphael(folder); draw_gantt = Raphael(folder);
setDrawArea(); setDrawArea();
if ($("#draw_progress_line").attr('checked')) if ($("#draw_progress_line").prop('checked'))
drawGanttProgressLines(); drawGanttProgressLines();
if ($("#draw_relations").attr('checked')) if ($("#draw_relations").prop('checked'))
drawRelations(); drawRelations();
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 260 B

After

Width:  |  Height:  |  Size: 418 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 251 B

After

Width:  |  Height:  |  Size: 312 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 178 B

After

Width:  |  Height:  |  Size: 205 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 113 B

After

Width:  |  Height:  |  Size: 345 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 B

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 B

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 B

After

Width:  |  Height:  |  Size: 278 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 B

After

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long