]> git.mxchange.org Git - friendica.git/commitdiff
attachment preview: add destroy method to linkPreview.js
authorrabuzarus <rabuzarus@t-online.de>
Sat, 2 Feb 2019 01:27:41 +0000 (02:27 +0100)
committerrabuzarus <rabuzarus@t-online.de>
Sat, 2 Feb 2019 01:27:41 +0000 (02:27 +0100)
view/js/linkPreview.js

index cbb5e48da3fe801024975f99c443c555d45b087d..afbb453de816e2576a57870d3abb2ec322082b92 100644 (file)
                        });\r
                };\r
 \r
+               var destroy = function() {\r
+                       $('#' + selector).unbind();\r
+                       $('#preview_' + selector).remove();\r
+                       binurl;\r
+                       block = false;\r
+                       blockTitle = false;\r
+                       blockDescription = false;\r
+                       cache = {};\r
+                       images = "";\r
+                       isExtern = false;\r
+                       photoNumber = 0;\r
+                       firstPosted = false;\r
+                       isActive = false;\r
+                       isCrawling = false;\r
+                       selector = "";\r
+               };\r
+\r
                var trim = function(str) {\r
                        return str.replace(/^\s+|\s+$/g, "");\r
                };\r
 \r
                return {\r
                        // make crawlText() accessable from the outside.\r
-                       crawlText: function (text) {\r
+                       crawlText: function(text) {\r
                                crawlText(text);\r
+                       },\r
+                       destroy: function() {\r
+                               destroy();\r
                        }\r
                };\r
        };\r