From 088eb3391e303c514138d136865a0f6f77fb562b Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Fri, 11 Oct 2019 15:27:05 -0400 Subject: [PATCH] Move urlRegex JS constant to main.js --- view/js/linkPreview.js | 1 - view/js/main.js | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/view/js/linkPreview.js b/view/js/linkPreview.js index c018563848..09493eebad 100644 --- a/view/js/linkPreview.js +++ b/view/js/linkPreview.js @@ -52,7 +52,6 @@
\
'; var text; - var urlRegex = /^(?:https?\:\/\/|\s)[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})(?:\/+[a-z0-9_.\:\;-]*)*(?:\?[\&\%\|\+a-z0-9_=,\.\:\;-]*)?(?:[\&\%\|\+&a-z0-9_=,\:\;\.-]*)(?:[\!\#\/\&\%\|\+a-z0-9_=,\:\;\.-]*)}*$/i; var binurl; var block = false; var blockTitle = false; diff --git a/view/js/main.js b/view/js/main.js index e2cee43d54..7e84a08d87 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -86,6 +86,8 @@ var last_popup_menu = null; var last_popup_button = null; var lockLoadContent = false; +const urlRegex = /^(?:https?:\/\/|\s)[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})(?:\/+[a-z0-9_.:;-]*)*(?:\?[&%|+a-z0-9_=,.:;-]*)?(?:[&%|+&a-z0-9_=,:;.-]*)(?:[!#\/&%|+a-z0-9_=,:;.-]*)}*$/i; + $(function() { $.ajaxSetup({cache: false}); -- 2.39.5