From 716c462665775f4cf6b15cd93968dc56f65d45d1 Mon Sep 17 00:00:00 2001 From: Alireza Heidari Date: Sun, 23 Jan 2022 17:49:35 +0330 Subject: [PATCH 1/9] Remove and unload `jquery.complexify` package --- client/gulpfile.js | 1 - client/package.json | 1 - client/src/libs/jquery.custom.js | 1 - client/yarn.lock | 5 ----- 4 files changed, 8 deletions(-) diff --git a/client/gulpfile.js b/client/gulpfile.js index 23fbd0ac9f32..c71fa66555cb 100644 --- a/client/gulpfile.js +++ b/client/gulpfile.js @@ -51,7 +51,6 @@ const paths = { backbone: ["backbone.js", "backbone.js"], "@galaxyproject/bootstrap-tour": ["build/js/bootstrap-tour.js", "bootstrap-tour.js"], jquery: ["dist/jquery.js", "jquery/jquery.js"], - "jquery.complexify": ["jquery.complexify.js", "jquery/jquery.complexify.js"], "jquery.cookie": ["jquery.cookie.js", "jquery/jquery.cookie.js"], "jquery-migrate": ["dist/jquery-migrate.js", "jquery/jquery.migrate.js"], "jquery-mousewheel": ["jquery.mousewheel.js", "jquery/jquery.mousewheel.js"], diff --git a/client/package.json b/client/package.json index cc6ee21dc588..ee9fbdac265f 100644 --- a/client/package.json +++ b/client/package.json @@ -53,7 +53,6 @@ "jquery-migrate": "~1.4", "jquery-mousewheel": "^3.1.13", "jquery-ui": "^1.12.1", - "jquery.complexify": "^0.5.2", "jquery.cookie": "^1.4.1", "jspdf": "^2.4.0", "linkifyjs": "^2.1.9", diff --git a/client/src/libs/jquery.custom.js b/client/src/libs/jquery.custom.js index c83378b837ae..a380d912a6dd 100644 --- a/client/src/libs/jquery.custom.js +++ b/client/src/libs/jquery.custom.js @@ -20,7 +20,6 @@ require("imports-loader?imports=default|jqueryVendor|jQuery!libs/farbtastic"); //require("imports-loader?imports=default|jquery|jqueryVendor,define=>false!jquery.cookie"); require("imports-loader?imports=default|jqueryVendor|jQuery!libs/jquery/jquery.dynatree"); require("imports-loader?imports=default|jqueryVendor|jQuery!libs/jquery/jquery.wymeditor"); -require("imports-loader?imports=default|jqueryVendor|jQuery!jquery.complexify"); require("imports-loader?imports=default|jqueryVendor|jQuery!jquery-migrate"); // require("imports-loader?jQuery=jqueryVendor!../ui/autocom_tagging"); diff --git a/client/yarn.lock b/client/yarn.lock index 1cf547d83acc..dafc5026bcd7 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -7509,11 +7509,6 @@ jquery-ui@^1.12.1: dependencies: jquery ">=1.8.0 <4.0.0" -jquery.complexify@^0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/jquery.complexify/-/jquery.complexify-0.5.2.tgz#8c8834ca08cee9476f1d975128d49526adcc4ae9" - integrity sha1-jIg0ygjO6UdvHZdRKNSVJq3MSuk= - jquery.cookie@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/jquery.cookie/-/jquery.cookie-1.4.1.tgz#d63dce209eab691fe63316db08ca9e47e0f9385b" From ca47d97cb594750353a44f2a71180b1791d6d0ac Mon Sep 17 00:00:00 2001 From: Alireza Heidari Date: Sun, 23 Jan 2022 17:50:35 +0330 Subject: [PATCH 2/9] Replace check password strength in toolshed change_password --- .../tool_shed/user/change_password.mako | 32 +++++++++++++------ 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/lib/tool_shed/webapp/templates/webapps/tool_shed/user/change_password.mako b/lib/tool_shed/webapp/templates/webapps/tool_shed/user/change_password.mako index e0c34d858649..9d658525e971 100644 --- a/lib/tool_shed/webapp/templates/webapps/tool_shed/user/change_password.mako +++ b/lib/tool_shed/webapp/templates/webapps/tool_shed/user/change_password.mako @@ -1,14 +1,4 @@ <%inherit file="/base.mako"/> -
@@ -40,3 +30,25 @@ $(function() {
+ + \ No newline at end of file From a232e2edfe18b50c116c2de4073f3dba6a573112 Mon Sep 17 00:00:00 2001 From: Alireza Heidari Date: Sun, 23 Jan 2022 17:50:54 +0330 Subject: [PATCH 3/9] Replace check password strength in toolshed register --- .../webapps/tool_shed/user/register.mako | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/lib/tool_shed/webapp/templates/webapps/tool_shed/user/register.mako b/lib/tool_shed/webapp/templates/webapps/tool_shed/user/register.mako index f4acac17e6ba..04229760e08a 100644 --- a/lib/tool_shed/webapp/templates/webapps/tool_shed/user/register.mako +++ b/lib/tool_shed/webapp/templates/webapps/tool_shed/user/register.mako @@ -77,13 +77,25 @@ $(".errormessage").html(message); } - $("[name='password']").complexify({'minimumChars':6}, function(valid, complexity){ - var progressBar = $('.progress-bar'); - var color = valid ? 'lightgreen' : 'red'; - - progressBar.css('background-color', color); - progressBar.css({'width': complexity + '%'}); - }); + var pwInput = document.getElementById('password_input'); + pwInput.onkeyup = function() { + var pw = pwInput.value; + var progress_bar = document.getElementById('password_strength'); + + var strongPasswordRegex = new RegExp("^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%\^&\*])(?=.{8,})"); + var mediumPasswordRegex = new RegExp("^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})"); + + if (strongPasswordRegex.test(pw)) { + progress_bar.style.backgroundColor = 'lightgreen'; + progress_bar.style.width = '100%'; + } else if (mediumPasswordRegex.test(pw)) { + progress_bar.style.backgroundColor = 'orange'; + progress_bar.style.width = '60%'; + } else { + progress_bar.style.backgroundColor = 'red'; + progress_bar.style.width = '30%'; + } + }; $('#registration').bind('submit', function(e) { $('#send').attr('disabled', 'disabled'); @@ -131,7 +143,7 @@
-
+
Strength
From e48b5d30a3344dacef5148924200e4a8f44c6dfe Mon Sep 17 00:00:00 2001 From: Alireza Heidari Date: Sun, 23 Jan 2022 20:18:58 +0330 Subject: [PATCH 4/9] Update change_password.mako --- .../templates/webapps/tool_shed/user/change_password.mako | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tool_shed/webapp/templates/webapps/tool_shed/user/change_password.mako b/lib/tool_shed/webapp/templates/webapps/tool_shed/user/change_password.mako index 9d658525e971..dd5130eb5128 100644 --- a/lib/tool_shed/webapp/templates/webapps/tool_shed/user/change_password.mako +++ b/lib/tool_shed/webapp/templates/webapps/tool_shed/user/change_password.mako @@ -14,10 +14,10 @@ %endif
- +
-
+
Strength
From ad3fd44655b11f6d3d2395086668d194303610b3 Mon Sep 17 00:00:00 2001 From: Alireza Heidari Date: Sun, 23 Jan 2022 17:49:35 +0330 Subject: [PATCH 5/9] Remove and unload `jquery.complexify` package --- client/gulpfile.js | 1 - client/package.json | 1 - client/src/libs/jquery.custom.js | 1 - client/yarn.lock | 5 ----- 4 files changed, 8 deletions(-) diff --git a/client/gulpfile.js b/client/gulpfile.js index 23fbd0ac9f32..c71fa66555cb 100644 --- a/client/gulpfile.js +++ b/client/gulpfile.js @@ -51,7 +51,6 @@ const paths = { backbone: ["backbone.js", "backbone.js"], "@galaxyproject/bootstrap-tour": ["build/js/bootstrap-tour.js", "bootstrap-tour.js"], jquery: ["dist/jquery.js", "jquery/jquery.js"], - "jquery.complexify": ["jquery.complexify.js", "jquery/jquery.complexify.js"], "jquery.cookie": ["jquery.cookie.js", "jquery/jquery.cookie.js"], "jquery-migrate": ["dist/jquery-migrate.js", "jquery/jquery.migrate.js"], "jquery-mousewheel": ["jquery.mousewheel.js", "jquery/jquery.mousewheel.js"], diff --git a/client/package.json b/client/package.json index 2e4f8a263c9f..829af155c110 100644 --- a/client/package.json +++ b/client/package.json @@ -53,7 +53,6 @@ "jquery-migrate": "~1.4", "jquery-mousewheel": "^3.1.13", "jquery-ui": "^1.12.1", - "jquery.complexify": "^0.5.2", "jquery.cookie": "^1.4.1", "jspdf": "^2.4.0", "linkifyjs": "^2.1.9", diff --git a/client/src/libs/jquery.custom.js b/client/src/libs/jquery.custom.js index c83378b837ae..a380d912a6dd 100644 --- a/client/src/libs/jquery.custom.js +++ b/client/src/libs/jquery.custom.js @@ -20,7 +20,6 @@ require("imports-loader?imports=default|jqueryVendor|jQuery!libs/farbtastic"); //require("imports-loader?imports=default|jquery|jqueryVendor,define=>false!jquery.cookie"); require("imports-loader?imports=default|jqueryVendor|jQuery!libs/jquery/jquery.dynatree"); require("imports-loader?imports=default|jqueryVendor|jQuery!libs/jquery/jquery.wymeditor"); -require("imports-loader?imports=default|jqueryVendor|jQuery!jquery.complexify"); require("imports-loader?imports=default|jqueryVendor|jQuery!jquery-migrate"); // require("imports-loader?jQuery=jqueryVendor!../ui/autocom_tagging"); diff --git a/client/yarn.lock b/client/yarn.lock index a18c9f3cd147..af3aa159e4e8 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -7509,11 +7509,6 @@ jquery-ui@^1.12.1: dependencies: jquery ">=1.8.0 <4.0.0" -jquery.complexify@^0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/jquery.complexify/-/jquery.complexify-0.5.2.tgz#8c8834ca08cee9476f1d975128d49526adcc4ae9" - integrity sha1-jIg0ygjO6UdvHZdRKNSVJq3MSuk= - jquery.cookie@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/jquery.cookie/-/jquery.cookie-1.4.1.tgz#d63dce209eab691fe63316db08ca9e47e0f9385b" From 04ed8f123cd243c520fbd1f27edc9221773b7fdf Mon Sep 17 00:00:00 2001 From: Alireza Heidari Date: Sun, 23 Jan 2022 17:50:35 +0330 Subject: [PATCH 6/9] Replace check password strength in toolshed change_password --- .../tool_shed/user/change_password.mako | 32 +++++++++++++------ 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/lib/tool_shed/webapp/templates/webapps/tool_shed/user/change_password.mako b/lib/tool_shed/webapp/templates/webapps/tool_shed/user/change_password.mako index e0c34d858649..9d658525e971 100644 --- a/lib/tool_shed/webapp/templates/webapps/tool_shed/user/change_password.mako +++ b/lib/tool_shed/webapp/templates/webapps/tool_shed/user/change_password.mako @@ -1,14 +1,4 @@ <%inherit file="/base.mako"/> -
@@ -40,3 +30,25 @@ $(function() {
+ + \ No newline at end of file From c41b890a198f7df36599e82d8521add8640a8b40 Mon Sep 17 00:00:00 2001 From: Alireza Heidari Date: Sun, 23 Jan 2022 17:50:54 +0330 Subject: [PATCH 7/9] Replace check password strength in toolshed register --- .../webapps/tool_shed/user/register.mako | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/lib/tool_shed/webapp/templates/webapps/tool_shed/user/register.mako b/lib/tool_shed/webapp/templates/webapps/tool_shed/user/register.mako index f4acac17e6ba..04229760e08a 100644 --- a/lib/tool_shed/webapp/templates/webapps/tool_shed/user/register.mako +++ b/lib/tool_shed/webapp/templates/webapps/tool_shed/user/register.mako @@ -77,13 +77,25 @@ $(".errormessage").html(message); } - $("[name='password']").complexify({'minimumChars':6}, function(valid, complexity){ - var progressBar = $('.progress-bar'); - var color = valid ? 'lightgreen' : 'red'; - - progressBar.css('background-color', color); - progressBar.css({'width': complexity + '%'}); - }); + var pwInput = document.getElementById('password_input'); + pwInput.onkeyup = function() { + var pw = pwInput.value; + var progress_bar = document.getElementById('password_strength'); + + var strongPasswordRegex = new RegExp("^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%\^&\*])(?=.{8,})"); + var mediumPasswordRegex = new RegExp("^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})"); + + if (strongPasswordRegex.test(pw)) { + progress_bar.style.backgroundColor = 'lightgreen'; + progress_bar.style.width = '100%'; + } else if (mediumPasswordRegex.test(pw)) { + progress_bar.style.backgroundColor = 'orange'; + progress_bar.style.width = '60%'; + } else { + progress_bar.style.backgroundColor = 'red'; + progress_bar.style.width = '30%'; + } + }; $('#registration').bind('submit', function(e) { $('#send').attr('disabled', 'disabled'); @@ -131,7 +143,7 @@
-
+
Strength
From 98d2a34acc1efd7019a6b8ab429f6691d6dee0c8 Mon Sep 17 00:00:00 2001 From: Alireza Heidari Date: Sun, 23 Jan 2022 20:18:58 +0330 Subject: [PATCH 8/9] Update change_password.mako --- .../templates/webapps/tool_shed/user/change_password.mako | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tool_shed/webapp/templates/webapps/tool_shed/user/change_password.mako b/lib/tool_shed/webapp/templates/webapps/tool_shed/user/change_password.mako index 9d658525e971..dd5130eb5128 100644 --- a/lib/tool_shed/webapp/templates/webapps/tool_shed/user/change_password.mako +++ b/lib/tool_shed/webapp/templates/webapps/tool_shed/user/change_password.mako @@ -14,10 +14,10 @@ %endif
- +
-
+
Strength
From f23f5d9cc7c1a3e27104e5599b10362e3276273b Mon Sep 17 00:00:00 2001 From: Alireza Heidari Date: Tue, 25 Jan 2022 02:49:03 +0330 Subject: [PATCH 9/9] Remove toolshed `password strength` from `register` and `change password` --- .../tool_shed/user/change_password.mako | 29 +------------------ .../webapps/tool_shed/user/register.mako | 25 ---------------- 2 files changed, 1 insertion(+), 53 deletions(-) diff --git a/lib/tool_shed/webapp/templates/webapps/tool_shed/user/change_password.mako b/lib/tool_shed/webapp/templates/webapps/tool_shed/user/change_password.mako index dd5130eb5128..342a942fc6ca 100644 --- a/lib/tool_shed/webapp/templates/webapps/tool_shed/user/change_password.mako +++ b/lib/tool_shed/webapp/templates/webapps/tool_shed/user/change_password.mako @@ -14,12 +14,7 @@ %endif
- -
-
-
- Strength -
+
@@ -30,25 +25,3 @@
- - \ No newline at end of file diff --git a/lib/tool_shed/webapp/templates/webapps/tool_shed/user/register.mako b/lib/tool_shed/webapp/templates/webapps/tool_shed/user/register.mako index 04229760e08a..e6e4fd01a870 100644 --- a/lib/tool_shed/webapp/templates/webapps/tool_shed/user/register.mako +++ b/lib/tool_shed/webapp/templates/webapps/tool_shed/user/register.mako @@ -77,26 +77,6 @@ $(".errormessage").html(message); } - var pwInput = document.getElementById('password_input'); - pwInput.onkeyup = function() { - var pw = pwInput.value; - var progress_bar = document.getElementById('password_strength'); - - var strongPasswordRegex = new RegExp("^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%\^&\*])(?=.{8,})"); - var mediumPasswordRegex = new RegExp("^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})"); - - if (strongPasswordRegex.test(pw)) { - progress_bar.style.backgroundColor = 'lightgreen'; - progress_bar.style.width = '100%'; - } else if (mediumPasswordRegex.test(pw)) { - progress_bar.style.backgroundColor = 'orange'; - progress_bar.style.width = '60%'; - } else { - progress_bar.style.backgroundColor = 'red'; - progress_bar.style.width = '30%'; - } - }; - $('#registration').bind('submit', function(e) { $('#send').attr('disabled', 'disabled'); @@ -142,11 +122,6 @@
-
-
- Strength -
-