On Wed, 2019-06-19 at 17:22 +0200, Martin Kletzander wrote:
[...]
+ docLoc = document.location;
+ if (docLoc.protocol != "file:" ||
+ docLoc.origin != "null" ||
+ docLoc.host !== "" ||
+ docLoc.hostname !== "") {
+ fetchRSS()
+ }
This probably doesn't need to be this complicated, just the check
against .protocol is probably okay. If we need more flexibility we
can just add it later.
[...]
+function fetchRSS() {
+ cb = "jsonpRSSFeedCallback"
+ window["jsonpRSSFeedCallback"] = function (data) {
You should be reusing cb here :)
[...]
+ dateOpts = { day: 'numeric', month: 'short',
year: 'numeric'}
You're using both single and double quotes... Please stick with a
single style, more specifically the latter which is already used
consistently throughout the file.
[...]
+ script.src = "https://feedrapp.herokuapp.com/"
+ script.src += `?q=http%3A%2F%2Fplanet.virt-tools.org%2Fatom.xml&callback=${cb}`
You didn't turn this into a clear URL :) That's alright, if it can
be done at all you might very well fix it up later.
With the above addressed,
Reviewed-by: Andrea Bolognani <abologna(a)redhat.com>
--
Andrea Bolognani / Red Hat / Virtualization