airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject [25/50] [abbrv] airavata-php-gateway git commit: made sorting case-agnostic
Date Wed, 27 Jul 2016 17:05:33 GMT
made sorting case-agnostic


Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/04785723
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/04785723
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/04785723

Branch: refs/heads/develop
Commit: 047857230e1fef7f0760d1061cfe7425730a43e1
Parents: e6a7336
Author: Jeff Kinnison <jeffdkinnison@gmail.com>
Authored: Wed Jul 13 12:47:21 2016 -0400
Committer: Jeff Kinnison <jeffdkinnison@gmail.com>
Committed: Wed Jul 13 12:47:21 2016 -0400

----------------------------------------------------------------------
 public/js/sharing/sharing_utils.js | 52 ++++++++++++++++++---------------
 1 file changed, 28 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/04785723/public/js/sharing/sharing_utils.js
----------------------------------------------------------------------
diff --git a/public/js/sharing/sharing_utils.js b/public/js/sharing/sharing_utils.js
index 464d332..22bc138 100644
--- a/public/js/sharing/sharing_utils.js
+++ b/public/js/sharing/sharing_utils.js
@@ -103,13 +103,13 @@ var changeShareState = function($target) {
 }
 
 var usernameComparator = function(a, b) {
-   var $a, $b;
-   $a = $(a).data();
-   $b = $(b).data();
+   var username_a, username_b;
+   username_a = $(a).data().username.toLowerCase();
+   username_b = $(b).data().username.toLowerCase();
 
-   if ($a.username < $b.username) {
+   if (username_a < username_b) {
        return -1;
-   } else if ($a.username > $b.username) {
+   } else if (username_a > username_b) {
        return 1;
    } else {
        return 0;
@@ -117,18 +117,20 @@ var usernameComparator = function(a, b) {
 }
 
 var firstLastComparator = function(a, b) {
-   var $a, $b;
-   $a = $(a).data();
-   $b = $(b).data();
+   var firstname_a, firstname_b, lastname_a, lastname_b;
+   firstname_a = $(a).data().firstname.toLowerCase();
+   firstname_b = $(b).data().firstname.toLowerCase();
+   lastname_a = $(a).data().lastname.toLowerCase();
+   lastname_b = $(b).data().lastname.toLowerCase();
 
-   if ($a.firstname < $b.firstname) {
+   if (firstname_a < firstname_b) {
        return -1;
-   } else if ($a.firstname > $b.firstname) {
+   } else if (firstname_a > firstname_b) {
        return 1;
    } else {
-       if ($a.lastname < $b.lastname) {
+       if (lastname_a < lastname_b) {
            return -1;
-       } else if ($a.lastname > $b.lastname) {
+       } else if (lastname_a > lastname_b) {
            return 1;
        } else {
            return 0;
@@ -137,18 +139,20 @@ var firstLastComparator = function(a, b) {
 }
 
 var lastFirstComparator = function(a, b) {
-   var $a, $b;
-   $a = $(a).data();
-   $b = $(b).data();
+  var firstname_a, firstname_b, lastname_a, lastname_b;
+  firstname_a = $(a).data().firstname.toLowerCase();
+  firstname_b = $(b).data().firstname.toLowerCase();
+  lastname_a = $(a).data().lastname.toLowerCase();
+  lastname_b = $(b).data().lastname.toLowerCase();
 
-   if ($a.lastname < $b.lastname) {
+   if (lastname_a < lastname_b) {
        return -1;
-   } else if ($a.lastname > $b.lastname) {
+   } else if (lastname_a > lastname_b) {
        return 1;
    } else {
-       if ($a.firstname < $b.firstname) {
+       if (firstname_a < firstname_b) {
            return -1;
-       } else if ($a.firstname > $b.firstname) {
+       } else if (firstname_a > firstname_b) {
            return 1;
        } else {
            return 0;
@@ -157,13 +161,13 @@ var lastFirstComparator = function(a, b) {
 }
 
 var emailComparator = function(a, b) {
-   var $a, $b;
-   $a = $(a).data();
-   $b = $(b).data();
+   var email_a, email_b;
+   email_a = $(a).data().email.toLowerCase();
+   email_b = $(b).data().email.toLowerCase();
 
-   if ($a.email < $b.email) {
+   if (email_a < email_b) {
        return -1;
-   } else if ($a.email > $b.email) {
+   } else if (email_a > email_b) {
        return 1;
    } else {
        return 0;


Mime
View raw message