You are seeing the fallback version of this page.
diff --git a/build/static/js/main.js b/build/static/js/main.js
index 2d1d92d..1242656 100644
--- a/build/static/js/main.js
+++ b/build/static/js/main.js
@@ -40,7 +40,9 @@
q("#watch-on-youtube").href = "https://www.youtube.com" + destinationPath
- qa("[data-loading-message]").forEach(e => e.textContent = e.getAttribute("data-loading-message"))
+ for (const e of qa("[data-loading-message]")) {
+ e.textContent = e.getAttribute("data-loading-message")
+ }
request("https://instances.invidio.us/instances.json?sort_by=type,health",
/** @param {[string, {monitor: any, flag: string, region: string, stats: any, type: string, uri: string}][]} root */ (err, root) => {
@@ -71,6 +73,9 @@
])
)
})
- qa(".loading").forEach(e => e.remove())
+
+ for (const e of qa(".loading")) {
+ e.remove()
+ }
})
})()
diff --git a/build/static/js/main.min.js b/build/static/js/main.min.js
index 03eb814..b9ef6cb 100644
--- a/build/static/js/main.min.js
+++ b/build/static/js/main.min.js
@@ -1,2 +1,2 @@
-"use strict";function _createForOfIteratorHelper(o,allowArrayLike){var it;if(typeof Symbol==="undefined"||o[Symbol.iterator]==null){if(Array.isArray(o)||(it=_unsupportedIterableToArray(o))||allowArrayLike&&o&&typeof o.length==="number"){if(it)o=it;var i=0;var F=function F(){};return{s:F,n:function n(){if(i>=o.length)return{done:true};return{done:false,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var normalCompletion=true,didErr=false,err;return{s:function s(){it=o[Symbol.iterator]()},n:function n(){var step=it.next();normalCompletion=step.done;return step},e:function e(_e2){didErr=true;err=_e2},f:function f(){try{if(!normalCompletion&&it.return!=null)it.return()}finally{if(didErr)throw err}}}}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i1&&arguments[1]!==undefined?arguments[1]:{};var children=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];var e=document.createElement(tag);for(var _i=0,_Object$keys=Object.keys(properties);_i<_Object$keys.length;_i++){var key=_Object$keys[_i];e[key]=properties[key]}var _iterator=_createForOfIteratorHelper(children),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var child=_step.value;e.appendChild(child)}}catch(err){_iterator.e(err)}finally{_iterator.f()}return e}function shuffle(array){for(var i=0;i0}).sort(function(a,b){return b.health-a.health}).forEach(function(entry){var target=entry.details.uri.replace(/\/*$/,"")+destinationPath;var healthUnknown=entry.healthKnown?"":"health-unknown ";var health=entry.healthKnown?entry.health.toFixed(0):"(unknown)";q("#instances-tbody").appendChild(createElement("tr",{},[createElement("td",{textContent:entry.name}),createElement("td",{className:"column-center "+healthUnknown,textContent:health}),createElement("td",{className:"column-center"},[createElement("a",{href:target,textContent:"Go \u2192"})])]))});qa(".loading").forEach(function(e){return e.remove()})})})();
+"use strict";function _createForOfIteratorHelper(o,allowArrayLike){var it;if(typeof Symbol==="undefined"||o[Symbol.iterator]==null){if(Array.isArray(o)||(it=_unsupportedIterableToArray(o))||allowArrayLike&&o&&typeof o.length==="number"){if(it)o=it;var i=0;var F=function F(){};return{s:F,n:function n(){if(i>=o.length)return{done:true};return{done:false,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var normalCompletion=true,didErr=false,err;return{s:function s(){it=o[Symbol.iterator]()},n:function n(){var step=it.next();normalCompletion=step.done;return step},e:function e(_e2){didErr=true;err=_e2},f:function f(){try{if(!normalCompletion&&it.return!=null)it.return()}finally{if(didErr)throw err}}}}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i1&&arguments[1]!==undefined?arguments[1]:{};var children=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];var e=document.createElement(tag);for(var _i=0,_Object$keys=Object.keys(properties);_i<_Object$keys.length;_i++){var key=_Object$keys[_i];e[key]=properties[key]}var _iterator=_createForOfIteratorHelper(children),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var child=_step.value;e.appendChild(child)}}catch(err){_iterator.e(err)}finally{_iterator.f()}return e}function shuffle(array){for(var i=0;i0}).sort(function(a,b){return b.health-a.health}).forEach(function(entry){var target=entry.details.uri.replace(/\/*$/,"")+destinationPath;var healthUnknown=entry.healthKnown?"":"health-unknown ";var health=entry.healthKnown?entry.health.toFixed(0):"(unknown)";q("#instances-tbody").appendChild(createElement("tr",{},[createElement("td",{textContent:entry.name}),createElement("td",{className:"column-center "+healthUnknown,textContent:health}),createElement("td",{className:"column-center"},[createElement("a",{href:target,textContent:"Go \u2192"})])]))});var _iterator3=_createForOfIteratorHelper(qa(".loading")),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var e=_step3.value;e.remove()}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}})})();
//# sourceMappingURL=/static/js/main.min.js.map
\ No newline at end of file
diff --git a/build/static/js/main.min.js.map b/build/static/js/main.min.js.map
index fabe234..bd97c47 100644
--- a/build/static/js/main.min.js.map
+++ b/build/static/js/main.min.js.map
@@ -1 +1 @@
-{"version":3,"sources":["unknown"],"names":["q","s","document","querySelector","qa","querySelectorAll","createElement","tag","properties","children","e","Object","keys","key","child","appendChild","shuffle","array","i","length","j","Math","floor","random","request","url","callback","xhr","XMLHttpRequest","addEventListener","readyState","status","JSON","parse","response","open","send","destinationPath","window","location","href","slice","origin","forEach","textContent","getAttribute","err","root","map","entry","healthKnown","monitor","name","details","health","dailyRatios","ratio","filter","type","sort","a","b","target","uri","replace","healthUnknown","toFixed","className","remove"],"mappings":"AAAA,a,21CAEA,CAAC,CAAC,UAAM,CACP,GAAMA,CAAAA,CAAC,CAAG,QAAJA,CAAAA,CAAI,CAAAC,CAAC,QAAIC,CAAAA,QAAQ,CAACC,aAAT,CAAuBF,CAAvB,CAAJ,CAAX,CACA,GAAMG,CAAAA,EAAE,CAAG,QAALA,CAAAA,EAAK,CAAAH,CAAC,QAAIC,CAAAA,QAAQ,CAACG,gBAAT,CAA0BJ,CAA1B,CAAJ,CAAZ,CAEA,QAASK,CAAAA,aAAT,CAAuBC,GAAvB,CAA4D,IAAhCC,CAAAA,UAAgC,2DAAnB,EAAmB,IAAfC,CAAAA,QAAe,2DAAJ,EAAI,CAC3D,GAAMC,CAAAA,CAAC,CAAGR,QAAQ,CAACI,aAAT,CAAuBC,GAAvB,CAAV,CACA,0BAAkBI,MAAM,CAACC,IAAP,CAAYJ,UAAZ,CAAlB,6BAA2C,CAAtC,GAAMK,CAAAA,GAAG,iBAAT,CACJH,CAAC,CAACG,GAAD,CAAD,CAASL,UAAU,CAACK,GAAD,CACnB,CAJ0D,yCAKvCJ,QALuC,YAK3D,+CAA8B,IAAnBK,CAAAA,KAAmB,aAC7BJ,CAAC,CAACK,WAAF,CAAcD,KAAd,CACA,CAP0D,mDAQ3D,MAAOJ,CAAAA,CACP,CAED,QAASM,CAAAA,OAAT,CAAiBC,KAAjB,CAAwB,CACvB,IAAK,GAAIC,CAAAA,CAAC,CAAG,CAAb,CAAgBA,CAAC,CAAGD,KAAK,CAACE,MAA1B,CAAkCD,CAAC,EAAnC,CAAuC,CACtC,GAAIE,CAAAA,CAAC,CAAGC,IAAI,CAACC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C,IAAD,CAAO,CAAC6D,SAAS,CAAE,iBAAiBF,aAA7B,CAA4CrB,WAAW,CAAEU,MAAzD,CAAP,CAFU,CAGvBhD,aAAa,CAAC,IAAD,CAAO,CAAC6D,SAAS,CAAE,eAAZ,CAAP,CAAqC,CACjD7D,aAAa,CAAC,GAAD,CAAM,CAACkC,IAAI,CAAEsB,MAAP,CAAelB,WAAW,CAAE,WAA5B,CAAN,CADoC,CAArC,CAHU,CAAX,CADd,CASA,CAzBD,EA0BAxC,EAAE,CAAC,UAAD,CAAF,CAAeuC,OAAf,CAAuB,SAAAjC,CAAC,QAAIA,CAAAA,CAAC,CAAC0D,MAAF,EAAJ,CAAxB,CACA,CA9BM,CA+BP,CAzEA","sourcesContent":["\"use strict\";\n\n;(() => {\n\tconst q = s => document.querySelector(s)\n\tconst qa = s => document.querySelectorAll(s)\n\n\tfunction createElement(tag, properties = {}, children = []) {\n\t\tconst e = document.createElement(tag)\n\t\tfor (const key of Object.keys(properties)) {\n\t\t\te[key] = properties[key]\n\t\t}\n\t\tfor (const child of children) {\n\t\t\te.appendChild(child)\n\t\t}\n\t\treturn e\n\t}\n\n\tfunction shuffle(array) {\n\t\tfor (let i = 0; i < array.length; i++) {\n\t\t\tlet j = Math.floor(Math.random() * (array.length-i)) + i\n\t\t\t;[array[i], array[j]] = [array[j], array[i]]\n\t\t}\n\t\treturn array\n\t}\n\n\tfunction request(url, callback) {\n\t\tconst xhr = new XMLHttpRequest()\n\t\txhr.addEventListener(\"readystatechange\", () => {\n\t\t\tif (xhr.readyState === 4) {\n\t\t\t\tif (xhr.status === 200) {\n\t\t\t\t\tcallback(null, JSON.parse(xhr.response))\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t\txhr.open(\"GET\", url)\n\t\txhr.send()\n\t}\n\n\tconst destinationPath = window.location.href.slice(window.location.origin.length)\n\n\tq(\"#watch-on-youtube\").href = \"https://www.youtube.com\" + destinationPath\n\n\tqa(\"[data-loading-message]\").forEach(e => e.textContent = e.getAttribute(\"data-loading-message\"))\n\n\trequest(\"https://instances.invidio.us/instances.json?sort_by=type,health\",\n\t/** @param {[string, {monitor: any, flag: string, region: string, stats: any, type: string, uri: string}][]} root */ (err, root) => {\n\t\tshuffle(root)\n\t\troot.map(entry => {\n\t\t\tconst healthKnown = !!entry[1].monitor\n\t\t\treturn {\n\t\t\t\tname: entry[0],\n\t\t\t\tdetails: entry[1],\n\t\t\t\thealth: +(healthKnown ? entry[1].monitor.dailyRatios[0].ratio : 95),\n\t\t\t\thealthKnown\n\t\t\t}\n\t\t}).filter(entry => {\n\t\t\treturn entry.details.type === \"https\" && entry.health > 0\n\t\t}).sort((a, b) => {\n\t\t\treturn b.health - a.health\n\t\t}).forEach(entry => {\n\t\t\tlet target = entry.details.uri.replace(/\\/*$/, \"\") + destinationPath\n\t\t\tconst healthUnknown = entry.healthKnown ? \"\" : \"health-unknown \"\n\t\t\tconst health = entry.healthKnown ? entry.health.toFixed(0) : \"(unknown)\"\n\t\t\tq(\"#instances-tbody\").appendChild(\n\t\t\t\tcreateElement(\"tr\", {}, [\n\t\t\t\t\tcreateElement(\"td\", {textContent: entry.name}),\n\t\t\t\t\tcreateElement(\"td\", {className: \"column-center \"+healthUnknown, textContent: health}),\n\t\t\t\t\tcreateElement(\"td\", {className: \"column-center\"}, [\n\t\t\t\t\t\tcreateElement(\"a\", {href: target, textContent: \"Go →\"})\n\t\t\t\t\t])\n\t\t\t\t])\n\t\t\t)\n\t\t})\n\t\tqa(\".loading\").forEach(e => e.remove())\n\t})\n})()\n"]}
\ No newline at end of file
+{"version":3,"sources":["unknown"],"names":["q","s","document","querySelector","qa","querySelectorAll","createElement","tag","properties","children","e","Object","keys","key","child","appendChild","shuffle","array","i","length","j","Math","floor","random","request","url","callback","xhr","XMLHttpRequest","addEventListener","readyState","status","JSON","parse","response","open","send","destinationPath","window","location","href","slice","origin","textContent","getAttribute","err","root","map","entry","healthKnown","monitor","name","details","health","dailyRatios","ratio","filter","type","sort","a","b","forEach","target","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C,GAAD,CAAM,CAACkC,IAAI,CAAEsB,MAAP,CAAenB,WAAW,CAAE,WAA5B,CAAN,CADoC,CAArC,CAHU,CAAX,CADd,CASA,CAzBD,EAFmI,0CA6BnHvC,EAAE,CAAC,UAAD,CA7BiH,aA6BnI,kDAAgC,IAArBM,CAAAA,CAAqB,cAC/BA,CAAC,CAAC0D,MAAF,EACA,CA/BkI,qDAgCnI,CAjCM,CAkCP,CA9EA","sourcesContent":["\"use strict\";\n\n;(() => {\n\tconst q = s => document.querySelector(s)\n\tconst qa = s => document.querySelectorAll(s)\n\n\tfunction createElement(tag, properties = {}, children = []) {\n\t\tconst e = document.createElement(tag)\n\t\tfor (const key of Object.keys(properties)) {\n\t\t\te[key] = properties[key]\n\t\t}\n\t\tfor (const child of children) {\n\t\t\te.appendChild(child)\n\t\t}\n\t\treturn e\n\t}\n\n\tfunction shuffle(array) {\n\t\tfor (let i = 0; i < array.length; i++) {\n\t\t\tlet j = Math.floor(Math.random() * (array.length-i)) + i\n\t\t\t;[array[i], array[j]] = [array[j], array[i]]\n\t\t}\n\t\treturn array\n\t}\n\n\tfunction request(url, callback) {\n\t\tconst xhr = new XMLHttpRequest()\n\t\txhr.addEventListener(\"readystatechange\", () => {\n\t\t\tif (xhr.readyState === 4) {\n\t\t\t\tif (xhr.status === 200) {\n\t\t\t\t\tcallback(null, JSON.parse(xhr.response))\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t\txhr.open(\"GET\", url)\n\t\txhr.send()\n\t}\n\n\tconst destinationPath = window.location.href.slice(window.location.origin.length)\n\n\tq(\"#watch-on-youtube\").href = \"https://www.youtube.com\" + destinationPath\n\n\tfor (const e of qa(\"[data-loading-message]\")) {\n\t\te.textContent = e.getAttribute(\"data-loading-message\")\n\t}\n\n\trequest(\"https://instances.invidio.us/instances.json?sort_by=type,health\",\n\t/** @param {[string, {monitor: any, flag: string, region: string, stats: any, type: string, uri: string}][]} root */ (err, root) => {\n\t\tshuffle(root)\n\t\troot.map(entry => {\n\t\t\tconst healthKnown = !!entry[1].monitor\n\t\t\treturn {\n\t\t\t\tname: entry[0],\n\t\t\t\tdetails: entry[1],\n\t\t\t\thealth: +(healthKnown ? entry[1].monitor.dailyRatios[0].ratio : 95),\n\t\t\t\thealthKnown\n\t\t\t}\n\t\t}).filter(entry => {\n\t\t\treturn entry.details.type === \"https\" && entry.health > 0\n\t\t}).sort((a, b) => {\n\t\t\treturn b.health - a.health\n\t\t}).forEach(entry => {\n\t\t\tlet target = entry.details.uri.replace(/\\/*$/, \"\") + destinationPath\n\t\t\tconst healthUnknown = entry.healthKnown ? \"\" : \"health-unknown \"\n\t\t\tconst health = entry.healthKnown ? entry.health.toFixed(0) : \"(unknown)\"\n\t\t\tq(\"#instances-tbody\").appendChild(\n\t\t\t\tcreateElement(\"tr\", {}, [\n\t\t\t\t\tcreateElement(\"td\", {textContent: entry.name}),\n\t\t\t\t\tcreateElement(\"td\", {className: \"column-center \"+healthUnknown, textContent: health}),\n\t\t\t\t\tcreateElement(\"td\", {className: \"column-center\"}, [\n\t\t\t\t\t\tcreateElement(\"a\", {href: target, textContent: \"Go →\"})\n\t\t\t\t\t])\n\t\t\t\t])\n\t\t\t)\n\t\t})\n\n\t\tfor (const e of qa(\".loading\")) {\n\t\t\te.remove()\n\t\t}\n\t})\n})()\n"]}
\ No newline at end of file
diff --git a/src/main.js b/src/main.js
index 2d1d92d..1242656 100644
--- a/src/main.js
+++ b/src/main.js
@@ -40,7 +40,9 @@
q("#watch-on-youtube").href = "https://www.youtube.com" + destinationPath
- qa("[data-loading-message]").forEach(e => e.textContent = e.getAttribute("data-loading-message"))
+ for (const e of qa("[data-loading-message]")) {
+ e.textContent = e.getAttribute("data-loading-message")
+ }
request("https://instances.invidio.us/instances.json?sort_by=type,health",
/** @param {[string, {monitor: any, flag: string, region: string, stats: any, type: string, uri: string}][]} root */ (err, root) => {
@@ -71,6 +73,9 @@
])
)
})
- qa(".loading").forEach(e => e.remove())
+
+ for (const e of qa(".loading")) {
+ e.remove()
+ }
})
})()