This is an automated email from the ASF dual-hosted git repository.

gcruz pushed a commit to branch gc/8452
in repository https://gitbox.apache.org/repos/asf/allura.git

commit 0055b6343fb452c4998cff15faef3cee83af8866
Author: Guillermo Cruz <[email protected]>
AuthorDate: Mon Aug 8 18:52:05 2022 -0600

    [#8452] replaced .bind calls with .on
---
 Allura/allura/lib/widgets/resources/js/post.js            |  2 +-
 Allura/allura/lib/widgets/resources/js/sf_markitup.js     |  4 ++--
 Allura/allura/public/nf/js/stats.js                       |  2 +-
 Allura/allura/templates/repo/file.html                    |  4 ++--
 ForgeImporters/forgeimporters/templates/project_base.html | 13 ++++++++-----
 5 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/Allura/allura/lib/widgets/resources/js/post.js 
b/Allura/allura/lib/widgets/resources/js/post.js
index 1da44aa7d..6103944eb 100644
--- a/Allura/allura/lib/widgets/resources/js/post.js
+++ b/Allura/allura/lib/widgets/resources/js/post.js
@@ -157,7 +157,7 @@
                     }
                 });
             });
-            $('.close', popup).bind('click', function() {
+            $('.close', popup).on('click', function() {
                 popup.hide();
             });
         }
diff --git a/Allura/allura/lib/widgets/resources/js/sf_markitup.js 
b/Allura/allura/lib/widgets/resources/js/sf_markitup.js
index d676126af..9e8da5e76 100644
--- a/Allura/allura/lib/widgets/resources/js/sf_markitup.js
+++ b/Allura/allura/lib/widgets/resources/js/sf_markitup.js
@@ -121,7 +121,7 @@ $(window).load(function() {
                   
$('.markdown_syntax_toc_crumb').toggle(!$this_section.is('.md_ex_toc'));
                 };
                 $('.markdown_syntax_toc a', 
$help_contents).click(display_section);
-                $(window).bind('hashchange', display_section); // handle back 
button
+                $(window).on('hashchange', display_section); // handle back 
button
               });
               $help_area.lightbox_me();
             }
@@ -141,7 +141,7 @@ $(window).load(function() {
               return 'Loading...';
             }
 
-            $('.close', $help_area).bind('click', function() {
+            $('.close', $help_area).on('click', function() {
               $help_area.hide();
             });
         });
diff --git a/Allura/allura/public/nf/js/stats.js 
b/Allura/allura/public/nf/js/stats.js
index efbf938a7..fdb59946a 100644
--- a/Allura/allura/public/nf/js/stats.js
+++ b/Allura/allura/public/nf/js/stats.js
@@ -95,7 +95,7 @@ function chartProjectStats(url, params, series, checkEmpty, 
tooltipFormat){
   $(".busy").hide();
 
   var previousPoint = null;
-  holder.bind("plothover", function (event, pos, item) {
+  holder.on("plothover", function (event, pos, item) {
       if (item) {
         if (previousPoint !== item.dataIndex) {
           previousPoint = item.dataIndex;
diff --git a/Allura/allura/templates/repo/file.html 
b/Allura/allura/templates/repo/file.html
index 42f8bb20a..5fbb38b23 100644
--- a/Allura/allura/templates/repo/file.html
+++ b/Allura/allura/templates/repo/file.html
@@ -39,7 +39,7 @@
 {% block extra_js %}
 {{ super() }}
 <script type="text/javascript">(function() {
-  $(window).bind('hashchange', function(e) {
+  $(window).on('hashchange', function(e) {
     var hash = window.location.hash.substring(1);
        if ('originalEvent' in e && 'oldURL' in e.originalEvent) {
       $('#' + e.originalEvent.oldURL.split('#')[1]).css('background-color', 
'transparent');
@@ -51,7 +51,7 @@
 
   var clicks = 0;
   $('.code_block').each(function(index, element) {
-    $(element).bind('click', function() {
+    $(element).on('click', function() {
       // Trick to ignore double and triple clicks
       clicks++;
       if (clicks === 1) {
diff --git a/ForgeImporters/forgeimporters/templates/project_base.html 
b/ForgeImporters/forgeimporters/templates/project_base.html
index 120e8bed5..cbba5d457 100644
--- a/ForgeImporters/forgeimporters/templates/project_base.html
+++ b/ForgeImporters/forgeimporters/templates/project_base.html
@@ -65,17 +65,20 @@
         }
 
         $(function() {
-            $('#project_name').bind('change keyup', suggest_name);
-            $('#project_shortname').bind('change keyup', function(event) {
+            $('#project_name').on('change keyup', suggest_name);
+            $('#project_shortname').on('change keyup', function(event) {
+                console.log('update url!!')
+
+
                 if (event.type == 'keyup') {
                     manual = true;
                 }
                 update_url();
             });
-            $('#project_name').bind('blur', check_names);
-            $('#project_shortname').bind('blur', check_names);
+            $('#project_name').on('blur', check_names);
+            $('#project_shortname').on('blur', check_names);
             if($('#project_url').length === 1) {
-                $('#project_url').bind('blur', check_names);
+                $('#project_url').on('blur', check_names);
             }
         });
     </script>

Reply via email to