allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jetm...@apache.org
Subject [6/9] allura git commit: [#7827] ticket:722 Fix some jquery-migrate warnings
Date Tue, 10 Feb 2015 10:20:46 GMT
[#7827] ticket:722 Fix some jquery-migrate warnings

- Use `prop` instead of `attr` for properties
- Fix our custom combobox plugin


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/5914d94e
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/5914d94e
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/5914d94e

Branch: refs/heads/ib/7827
Commit: 5914d94e929ed694272eb4aef621ad14f9bd0106
Parents: 125b559
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Mon Feb 9 16:00:19 2015 +0200
Committer: Igor Bondarenko <jetmind2@gmail.com>
Committed: Tue Feb 10 09:40:18 2015 +0000

----------------------------------------------------------------------
 Allura/allura/ext/admin/templates/export.html             |  2 +-
 Allura/allura/ext/admin/templates/project_overview.html   | 10 +++++-----
 Allura/allura/lib/widgets/form_fields.py                  |  2 +-
 Allura/allura/lib/widgets/forms.py                        |  8 ++++----
 Allura/allura/lib/widgets/resources/js/combobox.js        |  2 +-
 ForgeShortUrl/forgeshorturl/templates/index.html          |  6 +++---
 .../forgetracker/templates/tracker/admin_fields.html      |  4 ++--
 .../forgetracker/templates/tracker/milestones.html        |  4 ++--
 .../forgetracker/widgets/resources/js/mass-edit.js        |  4 ++--
 .../forgetracker/widgets/resources/js/ticket-list.js      |  2 +-
 ForgeTracker/forgetracker/widgets/ticket_form.py          |  2 +-
 11 files changed, 23 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/5914d94e/Allura/allura/ext/admin/templates/export.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/templates/export.html b/Allura/allura/ext/admin/templates/export.html
index a8081f1..c8b7c2b 100644
--- a/Allura/allura/ext/admin/templates/export.html
+++ b/Allura/allura/ext/admin/templates/export.html
@@ -27,7 +27,7 @@
   <script type="text/javascript">
     $(function() {
       $('#check-all').click(function() {
-        $(':checkbox[name="tools"]').attr('checked', $(this).attr('checked') || null);
+        $(':checkbox[name="tools"]').prop('checked', $(this).prop('checked'));
       });
     });
   </script>

http://git-wip-us.apache.org/repos/asf/allura/blob/5914d94e/Allura/allura/ext/admin/templates/project_overview.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/templates/project_overview.html b/Allura/allura/ext/admin/templates/project_overview.html
index af2aca1..3991241 100644
--- a/Allura/allura/ext/admin/templates/project_overview.html
+++ b/Allura/allura/ext/admin/templates/project_overview.html
@@ -50,10 +50,10 @@
       var $moved_to_url = $('input[name=moved_to_url]');
       var update_url = function(check_cb, url_input){
         if(check_cb.is(':checked')){
-          url_input.attr('disabled', false);
+          url_input.prop('disabled', false);
         }
         else{
-          url_input.attr('disabled', true);
+          url_input.prop('disabled', true);
           url_input.val('');
         }
       };
@@ -92,13 +92,13 @@
             $('#metadata_form').submit();
           }
           else{
-            $removal_original.attr('checked', true);
+            $removal_original.prop('checked', true);
           }
         }
         {% if not allow_project_undelete %}
         else if($(this).val()!=='deleted' && currently_deleted){
           alert('You may not undelete a project that has already been deleted.');
-          $removal_original.attr('checked', true);
+          $removal_original.prop('checked', true);
         }
         {% else %}
         else if($(this).val()!=='deleted' && currently_deleted){
@@ -107,7 +107,7 @@
             $('#metadata_form').submit();
           }
           else{
-            $removal_original.attr('checked', true);
+            $removal_original.prop('checked', true);
           }
         }
         {% endif %}

http://git-wip-us.apache.org/repos/asf/allura/blob/5914d94e/Allura/allura/lib/widgets/form_fields.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/form_fields.py b/Allura/allura/lib/widgets/form_fields.py
index a43014a..7d94e47 100644
--- a/Allura/allura/lib/widgets/form_fields.py
+++ b/Allura/allura/lib/widgets/form_fields.py
@@ -87,7 +87,7 @@ class LabelEdit(ew.InputField):
                       if ((value !== default_value) && (!exists) && value
!== '') {
                           $('input.label_edit').addTag(value);
                       }
-                      $('input[type=submit]', this).attr('disabled', 'disabled');
+                      $('input[type=submit]', this).prop('disabled', true);
                   }
                 }, 1);
             });

http://git-wip-us.apache.org/repos/asf/allura/blob/5914d94e/Allura/allura/lib/widgets/forms.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/forms.py b/Allura/allura/lib/widgets/forms.py
index 6f23e40..27fd242 100644
--- a/Allura/allura/lib/widgets/forms.py
+++ b/Allura/allura/lib/widgets/forms.py
@@ -891,12 +891,12 @@ table.table_class select.add_opt {width: 5em; margin:0; padding: 0;}
                 var inp_name = cb_name.substr(0, cb_name.length-4);
                 var inp_el = $('div[class="'+inp_name+'-inp"]');
 
-                if ($(this).attr('checked')) {
+                if ($(this).prop('checked')) {
                   inp_el.hide();
                 }
 
                 $(element).click(function(e) {
-                  if ($(this).attr('checked')) {
+                  if ($(this).prop('checked')) {
                     inp_el.hide();
                   } else {
                     inp_el.show();
@@ -1003,11 +1003,11 @@ class NeighborhoodAddProjectForm(ForgeForm):
                     }
                 });
                 $scms.change(function(){
-                    if ( $(this).attr('checked') ) {
+                    if ( $(this).prop('checked') ) {
                         var on = this;
                         $scms.each(function(){
                             if ( this !== on ) {
-                                $(this).removeAttr('checked');
+                                $(this).prop('checked', false);
                             }
                         });
                     }

http://git-wip-us.apache.org/repos/asf/allura/blob/5914d94e/Allura/allura/lib/widgets/resources/js/combobox.js
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/resources/js/combobox.js b/Allura/allura/lib/widgets/resources/js/combobox.js
index 60e1b9a..b36c3df 100644
--- a/Allura/allura/lib/widgets/resources/js/combobox.js
+++ b/Allura/allura/lib/widgets/resources/js/combobox.js
@@ -131,7 +131,7 @@
                 }
               });
 
-      input.data('autocomplete')._renderItem = function(ul, item) {
+      input.autocomplete('instance')._renderItem = function(ul, item) {
         return $('<li>')
           .data('item.autocomplete', item)
           .append('<a>' + item.label + '</a>')

http://git-wip-us.apache.org/repos/asf/allura/blob/5914d94e/ForgeShortUrl/forgeshorturl/templates/index.html
----------------------------------------------------------------------
diff --git a/ForgeShortUrl/forgeshorturl/templates/index.html b/ForgeShortUrl/forgeshorturl/templates/index.html
index c0607f3..e370812 100644
--- a/ForgeShortUrl/forgeshorturl/templates/index.html
+++ b/ForgeShortUrl/forgeshorturl/templates/index.html
@@ -75,13 +75,13 @@
                   modal.find('#short-url-form-title').show();
                   modal.find('#short-url-form-action-label').text('Update');
                   modal.find('input[name="update"]').val('True');
-                  modal.find('input[name="short_url"]').val('{{ su.short_name }}').attr('readonly',
true).trigger('keyup');
+                  modal.find('input[name="short_url"]').val('{{ su.short_name }}').prop('readonly',
true).trigger('keyup');
                   modal.find('input[name="full_url"]').val('{{ su.full_url }}');
                   modal.find('textarea[name="description"]').val('{{su.description|replace("\n",
"\\n")|replace("\r", "\\r")}}');
                   if ('{{ su.private }}' == 'True') {
-                    modal.find('input[name="private"]').attr('checked', 'checked');
+                    modal.find('input[name="private"]').prop('checked', true);
                   } else {
-                    modal.find('input[name="private"]').removeAttr('checked');
+                    modal.find('input[name="private"]').prop('checked', false);
                   }
                   return false;
                 });

http://git-wip-us.apache.org/repos/asf/allura/blob/5914d94e/ForgeTracker/forgetracker/templates/tracker/admin_fields.html
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/templates/tracker/admin_fields.html b/ForgeTracker/forgetracker/templates/tracker/admin_fields.html
index 1d09e3c..33f05a7 100644
--- a/ForgeTracker/forgetracker/templates/tracker/admin_fields.html
+++ b/ForgeTracker/forgetracker/templates/tracker/admin_fields.html
@@ -66,8 +66,8 @@
             // page can contain more that one milestone field,
             // so we should touch only radio buttons corresponding to given field
             var parent_table = $(this).closest('table');
-            $(":radio.default-milestone", parent_table).attr("checked", false);
-            $(this).attr("checked", true);
+            $(":radio.default-milestone", parent_table).prop("checked", false);
+            $(this).prop("checked", true);
         });
     });
 </script>

http://git-wip-us.apache.org/repos/asf/allura/blob/5914d94e/ForgeTracker/forgetracker/templates/tracker/milestones.html
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/templates/tracker/milestones.html b/ForgeTracker/forgetracker/templates/tracker/milestones.html
index 3dc748c..a5e6db9 100644
--- a/ForgeTracker/forgetracker/templates/tracker/milestones.html
+++ b/ForgeTracker/forgetracker/templates/tracker/milestones.html
@@ -139,8 +139,8 @@
         return false;
       });
       $(':radio.default-milestone').click(function(){
-          $(':radio.default-milestone').attr("checked", false);
-          $(this).attr("checked", true);
+          $(':radio.default-milestone').prop("checked", false);
+          $(this).prop("checked", true);
       });
       $('a.cancel_edit').click(function(){
         $('td.view', $form).show();

http://git-wip-us.apache.org/repos/asf/allura/blob/5914d94e/ForgeTracker/forgetracker/widgets/resources/js/mass-edit.js
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/widgets/resources/js/mass-edit.js b/ForgeTracker/forgetracker/widgets/resources/js/mass-edit.js
index 798473d..35d91aa 100644
--- a/ForgeTracker/forgetracker/widgets/resources/js/mass-edit.js
+++ b/ForgeTracker/forgetracker/widgets/resources/js/mass-edit.js
@@ -29,10 +29,10 @@ $(function(){
     $('#assigned_to').val('');
     $('#select_all').click(function(){
         if(this.checked){
-            $('tbody.ticket-list input[type=checkbox]').attr('checked', 'checked');
+            $('tbody.ticket-list input[type=checkbox]').prop('checked', true);
         }
         else{
-            $('tbody.ticket-list input[type=checkbox]').removeAttr('checked');
+            $('tbody.ticket-list input[type=checkbox]').prop('checked', false);
         }
     });
     $form.submit(function(){

http://git-wip-us.apache.org/repos/asf/allura/blob/5914d94e/ForgeTracker/forgetracker/widgets/resources/js/ticket-list.js
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/widgets/resources/js/ticket-list.js b/ForgeTracker/forgetracker/widgets/resources/js/ticket-list.js
index 138270c..9221389 100644
--- a/ForgeTracker/forgetracker/widgets/resources/js/ticket-list.js
+++ b/ForgeTracker/forgetracker/widgets/resources/js/ticket-list.js
@@ -21,7 +21,7 @@
 
     function ico_active() {
       $('.ticket-filter').each(function() {
-        if ($(this).find('select option').attr('selected')) {
+        if ($(this).find('select option').prop('selected')) {
           $(this).parent().css('color', 'green');
         } else {
           $(this).parent().css('color', '');

http://git-wip-us.apache.org/repos/asf/allura/blob/5914d94e/ForgeTracker/forgetracker/widgets/ticket_form.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/widgets/ticket_form.py b/ForgeTracker/forgetracker/widgets/ticket_form.py
index 0ac3973..d107aeb 100644
--- a/ForgeTracker/forgetracker/widgets/ticket_form.py
+++ b/ForgeTracker/forgetracker/widgets/ticket_form.py
@@ -160,7 +160,7 @@ class TicketForm(GenericTicketForm):
                 evt.preventDefault();
             });
             $('form').submit(function() {
-                $('input[type=submit]', this).attr('disabled', 'disabled');
+                $('input[type=submit]', this).prop('disabled', true);
             });
             $('div.reply.discussion-post a.markdown_preview').click(function(){
                 var arrow = $(this).closest('.discussion-post').find('span.arw');


Mime
View raw message