X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=view%2Fjs%2FlinkPreview.js;h=09493eebad3d1e4066e40358bd66390c214e42b4;hb=ed58af25a56fdf35f964e0f45ec1c82102c55e83;hp=f0a5d741aeac1944d5a06961b9cda22ae96167cc;hpb=71a556838571af1207065ebbff86bba93cd4a72a;p=friendica.git
diff --git a/view/js/linkPreview.js b/view/js/linkPreview.js
index f0a5d741ae..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;
@@ -133,20 +132,18 @@
return;
}
- if (trim(text) !== "") {
- if (block === false && urlRegex.test(text)) {
- binurl = bin2hex(text);
- block = true;
+ if (trim(text) !== "" && block === false && urlRegex.test(text)) {
+ binurl = bin2hex(text);
+ block = true;
- isCrawling = true;
- $('#profile-rotator').show();
+ isCrawling = true;
+ $('#profile-rotator').show();
- if (binurl in cache) {
- isCrawling = false;
- processContentData(cache[binurl]);
- } else {
- getContentData(binurl, processContentData);
- }
+ if (binurl in cache) {
+ isCrawling = false;
+ processContentData(cache[binurl]);
+ } else {
+ getContentData(binurl, processContentData);
}
}
};
@@ -232,7 +229,7 @@
if (!isExtern) {
return;
}
- var bbcode = '\n[video]' + json.url + '[/video]\n';
+ var bbcode = '\n[video]' + data.url + '[/video]\n';
addeditortext(bbcode);
};