[Bps-public-commit] rt-extension-todolist branch master updated. 2b9a33ce279ca5d6ef0f3751fdf4f68c3e9cfc4c

BPS Git Server git at git.bestpractical.com
Fri Jan 28 23:14:50 UTC 2022


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt-extension-todolist".

The branch, master has been updated
       via  2b9a33ce279ca5d6ef0f3751fdf4f68c3e9cfc4c (commit)
       via  6e37a832fccad5708ae0688267040204ad1a0132 (commit)
      from  454b3a49b63b1681b8f7d0586c34f53d84c7c63e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 2b9a33ce279ca5d6ef0f3751fdf4f68c3e9cfc4c
Author: Brian Conry <bconry at bestpractical.com>
Date:   Fri Jan 28 17:12:45 2022 -0600

    Bump to version 0.03

diff --git a/Changes b/Changes
index 715f2ac..4e757c2 100644
--- a/Changes
+++ b/Changes
@@ -2,3 +2,6 @@ Revision history for RT-Extension-TodoList
 
 0.01 [Release Date]
  - Initial version
+
+0.03 
+ - Additional updates for ES5/IE11 compatibility
diff --git a/META.yml b/META.yml
index be2fdbf..369ffd5 100644
--- a/META.yml
+++ b/META.yml
@@ -24,6 +24,6 @@ requires:
 resources:
   license: http://opensource.org/licenses/gpl-license.php
   repository: https://github.com/bestpractical/rt-extension-todolist
-version: '0.02'
+version: '0.03'
 x_module_install_rtx_version: '0.42'
 x_requires_rt: 5.0.0
diff --git a/lib/RT/Extension/TodoList.pm b/lib/RT/Extension/TodoList.pm
index e6ccff9..5b3c364 100644
--- a/lib/RT/Extension/TodoList.pm
+++ b/lib/RT/Extension/TodoList.pm
@@ -2,7 +2,7 @@ use strict;
 use warnings;
 package RT::Extension::TodoList;
 
-our $VERSION = '0.02';
+our $VERSION = '0.03';
 
 RT->AddStyleSheets('rt-extension-todolist.css');
 RT->AddJavaScript('rt-extension-todolist.js');

commit 6e37a832fccad5708ae0688267040204ad1a0132
Author: Brian Conry <bconry at bestpractical.com>
Date:   Fri Jan 28 17:08:58 2022 -0600

    Additional ES5/IE11 compatibility fixes
    
    The previous changes converting to ES5 syntax were incomplete.
    
    The fetch() API is also not present in ES5.

diff --git a/static/js/rt-extension-todolist.js b/static/js/rt-extension-todolist.js
index e2db016..d39d5af 100644
--- a/static/js/rt-extension-todolist.js
+++ b/static/js/rt-extension-todolist.js
@@ -1,18 +1,22 @@
 function UpdateTodoList (Object) {
-    const CustomField = jQuery('#RT-TodoList-Select').val();
-    fetch(RT.Config.WebHomePath + "/Helpers/TodoList?UpdateTodoList=1&ObjectId="+Object+"&CustomField="+CustomField, {
-       credentials: 'include',
-    }).then(response => (response.json()))
-    .then(json => {
-          jQuery('#RT-TodoList').html(json[0].html)
-      })
-      .catch(function (error) {
-        console.log('Request failed', error)
-      });
+    var CustomField = jQuery('#RT-TodoList-Select').val();
+    jQuery.ajax({
+        url: RT.Config.WebHomePath + "/Helpers/TodoList",
+        type: 'GET',
+        datatype: 'json',
+        data: {
+            UpdateTodoList: 1,
+            ObjectId: Object,
+            CustomField: CustomField,
+        },
+        success: function(response) {
+            jQuery('#RT-TodoList').html(response[0].html)
+        }
+    });
 };
 
 function UpdateTodos () {
-    let values = {};
+    var values = {};
     jQuery('#RT-TodoList :checkbox').each(function(){
         if ( jQuery(this).is(":checked") ) {
             values[this.id] = document.querySelectorAll("[for='"+this.id+"']")[0].innerHTML;
@@ -21,9 +25,12 @@ function UpdateTodos () {
         }
     });
     values['UpdateTodo'] = 1;
-    fetch(RT.Config.WebHomePath + "/Helpers/TodoList", {
+    jQuery.ajax({
+        url: RT.Config.WebHomePath + "/Helpers/TodoList",
         method: 'POST',
-        credentials: 'include',
-        body: JSON.stringify(values)
+        data: 'POSTDATA=' + JSON.stringify(values),
+        success: function(response) {
+            //console.error(response);
+        },
     });
 };

-----------------------------------------------------------------------

Summary of changes:
 Changes                            |  3 +++
 META.yml                           |  2 +-
 lib/RT/Extension/TodoList.pm       |  2 +-
 static/js/rt-extension-todolist.js | 35 +++++++++++++++++++++--------------
 4 files changed, 26 insertions(+), 16 deletions(-)


hooks/post-receive
-- 
rt-extension-todolist


More information about the Bps-public-commit mailing list