syncthingtray/js/ajaxhelper.js

30 lines
32 KiB
JavaScript

/// \brief Makes an AJAX query with basic error handling.
export function queryRoute(method, path, callback)
{
if ((window.location.protocol === 'file:' || window.location.hostname === 'localhost') && path.includes('releases')) {
return callback({responseText: '[{ "url": "https://api.github.com/repos/Martchus/syncthingtray/releases/150394390", "assets_url": "https://api.github.com/repos/Martchus/syncthingtray/releases/150394390/assets", "upload_url": "https://uploads.github.com/repos/Martchus/syncthingtray/releases/150394390/assets{?name,label}", "html_url": "https://github.com/Martchus/syncthingtray/releases/tag/v1.5.2", "id": 150394390, "author": { "login": "Martchus", "id": 10248953, "node_id": "MDQ6VXNlcjEwMjQ4OTUz", "avatar_url": "https://avatars.githubusercontent.com/u/10248953?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Martchus", "html_url": "https://github.com/Martchus", "followers_url": "https://api.github.com/users/Martchus/followers", "following_url": "https://api.github.com/users/Martchus/following{/other_user}", "gists_url": "https://api.github.com/users/Martchus/gists{/gist_id}", "starred_url": "https://api.github.com/users/Martchus/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Martchus/subscriptions", "organizations_url": "https://api.github.com/users/Martchus/orgs", "repos_url": "https://api.github.com/users/Martchus/repos", "events_url": "https://api.github.com/users/Martchus/events{/privacy}", "received_events_url": "https://api.github.com/users/Martchus/received_events", "type": "User", "site_admin": false }, "node_id": "RE_kwDOA_bJvs4I9tYW", "tag_name": "v1.5.2", "target_commitish": "master", "name": "v1.5.2", "draft": false, "prerelease": false, "created_at": "2024-04-09T10:05:52Z", "published_at": "2024-04-09T13:05:48Z", "assets": [ { "url": "https://api.github.com/repos/Martchus/syncthingtray/releases/assets/161136826", "id": 161136826, "node_id": "RA_kwDOA_bJvs4JmsC6", "name": "syncthingctl-1.5.2-i686-w64-mingw32.exe.zip", "label": "", "uploader": { "login": "Martchus", "id": 10248953, "node_id": "MDQ6VXNlcjEwMjQ4OTUz", "avatar_url": "https://avatars.githubusercontent.com/u/10248953?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Martchus", "html_url": "https://github.com/Martchus", "followers_url": "https://api.github.com/users/Martchus/followers", "following_url": "https://api.github.com/users/Martchus/following{/other_user}", "gists_url": "https://api.github.com/users/Martchus/gists{/gist_id}", "starred_url": "https://api.github.com/users/Martchus/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Martchus/subscriptions", "organizations_url": "https://api.github.com/users/Martchus/orgs", "repos_url": "https://api.github.com/users/Martchus/repos", "events_url": "https://api.github.com/users/Martchus/events{/privacy}", "received_events_url": "https://api.github.com/users/Martchus/received_events", "type": "User", "site_admin": false }, "content_type": "application/octet-stream", "state": "uploaded", "size": 13850402, "download_count": 108, "created_at": "2024-04-09T13:25:05Z", "updated_at": "2024-04-09T13:25:17Z", "browser_download_url": "https://github.com/Martchus/syncthingtray/releases/download/v1.5.2/syncthingctl-1.5.2-i686-w64-mingw32.exe.zip" }, { "url": "https://api.github.com/repos/Martchus/syncthingtray/releases/assets/161136839", "id": 161136839, "node_id": "RA_kwDOA_bJvs4JmsDH", "name": "syncthingctl-1.5.2-i686-w64-mingw32.exe.zip.sig", "label": "", "uploader": { "login": "Martchus", "id": 10248953, "node_id": "MDQ6VXNlcjEwMjQ4OTUz", "avatar_url": "https://avatars.githubusercontent.com/u/10248953?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Martchus", "html_url": "https://github.com/Martchus", "followers_url": "https://api.github.com/users/Martchus/followers", "following_url": "https://api.github.com/users/Martchus/following{/other_user}", "gists_url": "https://api.github.com/users/Martchus/gists{/gist_id}", "starred_url": "https://api.github.com/users/Martchus/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Martchus/subscriptions", "organizations_url": "https://api.github.com/users/Martchus/orgs", "repos_url": "https://api.github.com/users/Martchus/repos", "events_url": "https://api.github.com/users/Martchus/events{/privacy}", "received_events_url": "https://api.github.com/users/Martchus/received_events", "type": "User", "site_admin": false }, "content_type": "application/octet-stream", "state": "uploaded", "size": 310, "download_count": 5, "created_at": "2024-04-09T13:25:19Z", "updated_at": "2024-04-09T13:25:19Z", "browser_download_url": "https://github.com/Martchus/syncthingtray/releases/download/v1.5.2/syncthingctl-1.5.2-i686-w64-mingw32.exe.zip.sig" }, { "url": "https://api.github.com/repos/Martchus/syncthingtray/releases/assets/161136877", "id": 161136877, "node_id": "RA_kwDOA_bJvs4JmsDt", "name": "syncthingctl-1.5.2-x86_64-pc-linux-gnu.tar.xz", "label": "", "uploader": { "login": "Martchus", "id": 10248953, "node_id": "MDQ6VXNlcjEwMjQ4OTUz", "avatar_url": "https://avatars.githubusercontent.com/u/10248953?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Martchus", "html_url": "https://github.com/Martchus", "followers_url": "https://api.github.com/users/Martchus/followers", "following_url": "https://api.github.com/users/Martchus/following{/other_user}", "gists_url": "https://api.github.com/users/Martchus/gists{/gist_id}", "starred_url": "https://api.github.com/users/Martchus/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Martchus/subscriptions", "organizations_url": "https://api.github.com/users/Martchus/orgs", "repos_url": "https://api.github.com/users/Martchus/repos", "events_url": "https://api.github.com/users/Martchus/events{/privacy}", "received_events_url": "https://api.github.com/users/Martchus/received_events", "type": "User", "site_admin": false }, "content_type": "application/octet-stream", "state": "uploaded", "size": 10403332, "download_count": 19, "created_at": "2024-04-09T13:25:56Z", "updated_at": "2024-04-09T13:25:58Z", "browser_download_url": "https://github.com/Martchus/syncthingtray/releases/download/v1.5.2/syncthingctl-1.5.2-x86_64-pc-linux-gnu.tar.xz" }, { "url": "https://api.github.com/repos/Martchus/syncthingtray/releases/assets/161136881", "id": 161136881, "node_id": "RA_kwDOA_bJvs4JmsDx", "name": "syncthingctl-1.5.2-x86_64-pc-linux-gnu.tar.xz.sig", "label": "", "uploader": { "login": "Martchus", "id": 10248953, "node_id": "MDQ6VXNlcjEwMjQ4OTUz", "avatar_url": "https://avatars.githubusercontent.com/u/10248953?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Martchus", "html_url": "https://github.com/Martchus", "followers_url": "https://api.github.com/users/Martchus/followers", "following_url": "https://api.github.com/users/Martchus/following{/other_user}", "gists_url": "https://api.github.com/users/Martchus/gists{/gist_id}", "starred_url": "https://api.github.com/users/Martchus/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Martchus/subscriptions", "organizations_url": "https://api.github.com/users/Martchus/orgs", "repos_url": "https://api.github.com/users/Martchus/repos", "events_url": "https://api.github.com/users/Martchus/events{/privacy}", "received_events_url": "https://api.github.com/users/Martchus/received_events", "type": "User", "site_admin": false }, "content_type": "application/octet-stream", "state": "uploaded", "size": 310, "download_count": 4, "created_at": "2024-04-09T13:26:00Z", "updated_at": "2024-04-09T13:26:00Z", "browser_download_url": "https://github.com/Martchus/syncthingtray/releases/download/v1.5.2/syncthingctl-1.5.2-x86_64-pc-linux-gnu.tar.xz.sig" }, { "url": "https://api.github.com/repos/Martchus/syncthingtray/releases/assets/161136862", "id": 161136862, "node_id": "RA_kwDOA_bJvs4JmsDe", "name": "syncthingctl-1.5.2-x86_64-w64-mingw32.exe.zip", "label": "", "uploader": { "login": "Martchus", "id": 10248953, "node_id": "MDQ6VXNlcjEwMjQ4OTUz", "avatar_url": "https://avatars.githubusercontent.com/u/10248953?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Martchus", "html_url": "https://github.com/Martchus", "followers_url": "https://api.github.com/users/Martchus/followers", "following_url": "https://api.github.com/users/Martchus/following{/other_user}", "gists_url": "https://api.github.com/users/Martchus/gists{/gist_id}", "starred_url": "https://api.github.com/users/Martchus/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Martchus/subscriptions", "organizations_url": "https://api.github.com/users/Martchus/orgs", "repos_url": "https://api.github.com/users/Martchus/repos", "events_url": "https://api.github.com/users/Martchus/events{/privacy}", "received_events_url": "https://api.github.com/users/Martchus/received_events", "type": "User", "site_admin": false }, "content_type": "application/octet-stream", "state": "uploaded", "size": 13764933, "download_count": 217, "created_at": "2024-04-09T13:25:40Z", "updated_at": "2024-04-09T13:25:43Z", "browser_download_url": "https://github.com/Martchus/syncthingtray/releases/download/v1.5.2/syncthingctl-1.5.2-x86_64-w64-mingw32.exe.zip" }, { "url": "https://api.github.com/repos/Martchus/syncthingtray/releases/assets/161136865", "id": 161136865, "node_id": "RA_kwDOA_bJvs4JmsDh", "name": "syncthingctl-1.5.2-x86_64-w64-mingw32.exe.zip.sig", "label": "", "uploader": { "login": "Martchus", "id": 10248953, "node_id": "MDQ6VXNlcjEwMjQ4OTUz", "avatar_url": "https://avatars.githubusercontent.com/u/10248953?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Martchus", "html_url": "https://github.com/Martchus", "followers_url": "https://api.github.com/users/Martchus/followers", "following_url": "https://api.github.com/users/Martchus/following{/other_user}", "gists_url": "https://api.github.com/users/Martchus/gists{/gist_id}", "starred_url": "https://api.github.com/users/Martchus/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Martchus/subscriptions", "organizations_url": "https://api.github.com/users/Martchus/orgs", "repos_url": "https://api.github.com/users/Martchus/repos", "events_url": "https://api.github.com/users/Martchus/events{/privacy}", "received_events_url": "https://api.github.com/users/Martchus/received_events", "type": "User", "site_admin": false }, "content_type": "application/octet-stream", "state": "uploaded", "size": 310, "download_count": 15, "created_at": "2024-04-09T13:25:44Z", "updated_at": "2024-04-09T13:25:45Z", "browser_download_url": "https://github.com/Martchus/syncthingtray/releases/download/v1.5.2/syncthingctl-1.5.2-x86_64-w64-mingw32.exe.zip.sig" }, { "url": "https://api.github.com/repos/Martchus/syncthingtray/releases/assets/161136753", "id": 161136753, "node_id": "RA_kwDOA_bJvs4JmsBx", "name": "syncthingctl-qt5-1.5.2-i686-w64-mingw32.exe.zip", "label": "", "uploader": { "login": "Martchus", "id": 10248953, "node_id": "MDQ6VXNlcjEwMjQ4OTUz", "avatar_url": "https://avatars.githubusercontent.com/u/10248953?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Martchus", "html_url": "https://github.com/Martchus", "followers_url": "https://api.github.com/users/Martchus/followers", "following_url": "https://api.github.com/users/Martchus/following{/other_user}", "gists_url": "https://api.github.com/users/Martchus/gists{/gist_id}", "starred_url": "https://api.github.com/users/Martchus/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Martchus/subscriptions", "organizations_url": "https://api.github.com/users/Martchus/orgs", "repos_url": "https://api.github.com/users/Martchus/repos", "events_url": "https://api.github.com/users/Martchus/events{/privacy}", "received_events_url": "https://api.github.com/users/Martchus/received_events", "type": "User", "site_admin": false }, "content_type": "application/octet-stream", "state": "uploaded", "size": 9749916, "download_count": 11, "created_at": "2024-04-09T13:24:29Z", "updated_at": "2024-04-09T13:24:32Z", "browser_download_url": "https://github.com/Martchus/syncthingtray/releases/download/v1.5.2/syncthingctl-qt5-1.5.2-i686-w64-mingw32.exe.zip" }, { "url": "https://api.github.com/repos/Martchus/syncthingtray/releases/assets/161136759", "id": 161136759, "node_id": "RA_kwDOA_bJvs4JmsB3", "name": "syncthingctl-qt5-1.5.2-i686-w64-mingw32.exe.zip.sig", "label": "", "uploader": { "login": "Martchus", "id": 10248953, "node_id": "MDQ6VXNlcjEwMjQ4OTUz", "avatar_url": "https://avatars.githubusercontent.com/u/10248953?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Martchus", "html_url": "https://github.com/Martchus", "followers_url": "https://api.github.com/users/Martchus/followers", "following_url": "https://api.github.com/users/Martchus/following{/other_user}", "gists_url": "https://api.github.com/users/Martchus/gists{/gist_id}", "starred_url": "https://api.github.com/users/Martchus/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Martchus/subscriptions", "organizations_url": "https://api.github.com/users/Martchus/orgs", "repos_url": "https://api.github.com/users/Martchus/repos", "events_url": "https://api.github.com/users/Martchus/events{/privacy}", "received_events_url": "https://api.github.com/users/Martchus/received_events", "type": "User", "site_admin": false }, "content_type": "application/octet-stream", "state": "uploaded", "size": 310, "download_count": 1, "created_at": "2024-04-09T13:24:34Z", "updated_at": "2024-04-09T13:24:34Z", "browser_download_url": "https://github.com/Martchus/syncthingtray/releases/download/v1.5.2/syncthingctl-qt5-1.5.2-i686-w64-mingw32.exe.zip.sig" }, { "url": "https://api.github.com/repos/Martchus/syncthingtray/releases/assets/161136789", "id": 161136789, "node_id": "RA_kwDOA_bJvs4JmsCV", "name": "syncthingctl-qt5-1.5.2-x86_64-w64-mingw32.exe.zip", "label": "", "uploader": { "login": "Martchus", "id": 10248953, "node_id": "MDQ6VXNlcjEwMjQ4OTUz", "avatar_url": "https://avatars.githubusercontent.com/u/10248953?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Martchus", "html_url": "https://github.com/Martchus", "followers_url": "https://api.github.com/users/Martchus/followers", "following_url": "https://api.github.com/users/Martchus/following{/other_user}", "gists_url": "https://api.github.com/users/Martchus/gists{/gist_id}", "starred_url": "https://api.github.com/users/Martchus/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Martchus/subscriptions", "organizations_url": "https://api.github.com/users/Martchus/orgs", "repos_url": "https://api.github.com/users/Martchus/repos", "events_url": "https://api.github.com/users/Martchus/events{/privacy}", "received_events_url": "https://api.github.com/users/Martchus/received_events", "type": "User", "site_admin": false }, "content_type": "application/octet-stream", "state": "uploaded", "size": 9568527, "download_count": 71, "created_at": "2024-04-09T13:24:45Z", "updated_at": "2024-04-09T13:24:47Z", "browser_download_url": "https://github.com/Martchus/syncthingtray/releases/download/v1.5.2/syncthingctl-qt5-1.5.2-x86_64-w64-mingw32.exe.zip" }, { "url": "https://api.github.com/repos/Martchus/syncthingtray/releases/assets/161136792", "id": 161136792, "node_id": "RA_kwDOA_bJvs4JmsCY", "name": "syncthingctl-qt5-1.5.2-x86_64-w64-mingw32.exe.zip.sig", "label": "", "uploader": { "login": "Martchus", "id": 10248953, "node_id": "MDQ6VXNlcjEwMjQ4OTUz", "avatar_url": "https://avatars.githubusercontent.com/u/10248953?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Martchus", "html_url": "https://github.com/Martchus", "followers_url": "https://api.github.com/users/Martchus/followers", "following_url": "https://api.github.com/users/Martchus/following{/other_user}", "gists_url": "https://api.github.com/users/Martchus/gists{/gist_id}", "starred_url": "https://api.github.com/users/Martchus/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Martchus/subscriptions", "organizations_url": "https://api.github.com/users/Martchus/orgs", "repos_url": "https://api.github.com/users/Martchus/repos", "events_url": "https://api.github.com/users/Martchus/events{/privacy}", "received_events_url": "https://api.github.com/users/Martchus/received_events", "type": "User", "site_admin": false }, "content_type": "application/octet-stream", "state": "uploaded", "size": 310, "download_count": 4, "created_at": "2024-04-09T13:24:49Z", "updated_at": "2024-04-09T13:24:49Z", "browser_download_url": "https://github.com/Martchus/syncthingtray/releases/download/v1.5.2/syncthingctl-qt5-1.5.2-x86_64-w64-mingw32.exe.zip.sig" }, { "url": "https://api.github.com/repos/Martchus/syncthingtray/releases/assets/161136842", "id": 161136842, "node_id": "RA_kwDOA_bJvs4JmsDK", "name": "syncthingtray-1.5.2-i686-w64-mingw32.exe.zip", "label": "", "uploader": { "login": "Martchus", "id": 10248953, "node_id": "MDQ6VXNlcjEwMjQ4OTUz", "avatar_url": "https://avatars.githubusercontent.com/u/10248953?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Martchus", "html_url": "https://github.com/Martchus", "followers_url": "https://api.github.com/users/Martchus/followers", "following_url": "https://api.github.com/users/Martchus/following{/other_user}", "gists_url": "https://api.github.com/users/Martchus/gists{/gist_id}", "starred_url": "https://api.github.com/users/Martchus/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Martchus/subscriptions", "organizations_url": "https://api.github.com/users/Martchus/orgs", "repos_url": "https://api.github.com/users/Martchus/repos", "events_url": "https://api.github.com/users/Martchus/events{/privacy}", "received_events_url": "https://api.github.com/users/Martchus/received_events", "type": "User", "site_admin": false }, "content_type": "application/octet-stream", "state": "uploaded", "size": 27204886, "download_count": 105, "created_at": "2024-04-09T13:25:21Z", "updated_at": "2024-04-09T13:25:35Z", "browser_download_url": "https://github.com/Martchus/syncthingtray/releases/download/v1.5.2/syncthingtray-1.5.2-i686-w64-mingw32.exe.zip" }, { "url": "https://api.github.com/repos/Martchus/syncthingtray/releases/assets/161136861", "id": 161136861, "node_id": "RA_kwDOA_bJvs4JmsDd", "name": "syncthingtray-1.5.2-i686-w64-mingw32.exe.zip.sig", "label": "", "uploader": { "login": "Martchus", "id": 10248953, "node_id": "MDQ6VXNlcjEwMjQ4OTUz", "avatar_url": "https://avatars.githubusercontent.com/u/10248953?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Martchus", "html_url": "https://github.com/Martchus", "followers_url": "https://api.github.com/users/Martchus/followers", "following_url": "https://api.github.com/users/Martchus/following{/other_user}", "gists_url": "https://api.github.com/users/Martchus/gists{/gist_id}", "starred_url": "https://api.github.com/users/Martchus/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Martchus/subscriptions", "organizations_url": "https://api.github.com/users/Martchus/orgs", "repos_url": "https://api.github.com/users/Martchus/repos", "events_url": "https://api.github.com/users/Martchus/events{/privacy}", "received_events_url": "https://api.github.com/users/Martchus/received_events", "type": "User", "site_admin": false }, "content_type": "application/octet-stream", "state": "uploaded", "size": 310, "download_count": 1, "created_at": "2024-04-09T13:25:37Z", "updated_at": "2024-04-09T13:25:37Z", "browser_download_url": "https://github.com/Martchus/syncthingtray/releases/download/v1.5.2/syncthingtray-1.5.2-i686-w64-mingw32.exe.zip.sig" }, { "url": "https://api.github.com/repos/Martchus/syncthingtray/releases/assets/161136885", "id": 161136885, "node_id": "RA_kwDOA_bJvs4JmsD1", "name": "syncthingtray-1.5.2-x86_64-pc-linux-gnu.tar.xz", "label": "", "uploader": { "login": "Martchus", "id": 10248953, "node_id": "MDQ6VXNlcjEwMjQ4OTUz", "avatar_url": "https://avatars.githubusercontent.com/u/10248953?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Martchus", "html_url": "https://github.com/Martchus", "followers_url": "https://api.github.com/users/Martchus/followers", "following_url": "https://api.github.com/users/Martchus/following{/other_user}", "gists_url": "https://api.github.com/users/Martchus/gists{/gist_id}", "starred_url": "https://api.github.com/users/Martchus/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Martchus/subscriptions", "organizations_url": "https://api.github.com/users/Martchus/orgs", "repos_url": "https://api.github.com/users/Martchus/repos", "events_url": "https://api.github.com/users/Martchus/events{/privacy}", "received_events_url": "https://api.github.com/users/Martchus/received_events", "type": "User", "site_admin": false }, "content_type": "application/octet-stream", "state": "uploaded", "size": 22288692, "download_count": 35, "created_at": "2024-04-09T13:26:02Z", "updated_at": "2024-04-09T13:26:07Z", "browser_download_url": "https://github.com/Martchus/syncthingtray/releases/download/v1.5.2/syncthingtray-1.5.2-x86_64-pc-linux-gnu.tar.xz" }, { "url": "https://api.github.com/repos/Martchus/syncthingtray/releases/assets/161136895", "id": 161136895, "node_id": "RA_kwDOA_bJvs4JmsD_", "name": "syncthingtray-1.5.2-x86_64-pc-linux-gnu.tar.xz.sig", "label": "", "uploader": { "login": "Martchus", "id": 10248953, "node_id": "MDQ6VXNlcjEwMjQ4OTUz", "avatar_url": "https://avatars.githubusercontent.com/u/10248953?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Martchus", "html_url": "https://github.com/Martchus", "followers_url": "https://api.github.com/users/Martchus/followers", "following_url": "https://api.github.com/users/Martchus/following{/other_user}", "gists_url": "https://api.github.com/users/Martchus/gists{/gist_id}", "starred_url": "https://api.github.com/users/Martchus/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Martchus/subscriptions", "organizations_url": "https://api.github.com/users/Martchus/orgs", "repos_url": "https://api.github.com/users/Martchus/repos", "events_url": "https://api.github.com/users/Martchus/events{/privacy}", "received_events_url": "https://api.github.com/users/Martchus/received_events", "type": "User", "site_admin": false }, "content_type": "application/octet-stream", "state": "uploaded", "size": 310, "download_count": 3, "created_at": "2024-04-09T13:26:09Z", "updated_at": "2024-04-09T13:26:09Z", "browser_download_url": "https://github.com/Martchus/syncthingtray/releases/download/v1.5.2/syncthingtray-1.5.2-x86_64-pc-linux-gnu.tar.xz.sig" }, { "url": "https://api.github.com/repos/Martchus/syncthingtray/releases/assets/161136867", "id": 161136867, "node_id": "RA_kwDOA_bJvs4JmsDj", "name": "syncthingtray-1.5.2-x86_64-w64-mingw32.exe.zip", "label": "", "uploader": { "login": "Martchus", "id": 10248953, "node_id": "MDQ6VXNlcjEwMjQ4OTUz", "avatar_url": "https://avatars.githubusercontent.com/u/10248953?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Martchus", "html_url": "https://github.com/Martchus", "followers_url": "https://api.github.com/users/Martchus/followers", "following_url": "https://api.github.com/users/Martchus/following{/other_user}", "gists_url": "https://api.github.com/users/Martchus/gists{/gist_id}", "starred_url": "https://api.github.com/users/Martchus/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Martchus/subscriptions", "organizations_url": "https://api.github.com/users/Martchus/orgs", "repos_url": "https://api.github.com/users/Martchus/repos", "events_url": "https://api.github.com/users/Martchus/events{/privacy}", "received_events_url": "https://api.github.com/users/Martchus/received_events", "type": "User", "site_admin": false }, "content_type": "application/octet-stream", "state": "uploaded", "size": 27343753, "download_count": 1469, "created_at": "2024-04-09T13:25:46Z", "updated_at": "2024-04-09T13:25:52Z", "browser_download_url": "https://github.com/Martchus/syncthingtray/releases/download/v1.5.2/syncthingtray-1.5.2-x86_64-w64-mingw32.exe.zip" }, { "url": "https://api.github.com/repos/Martchus/syncthingtray/releases/assets/161136875", "id": 161136875, "node_id": "RA_kwDOA_bJvs4JmsDr", "name": "syncthingtray-1.5.2-x86_64-w64-mingw32.exe.zip.sig", "label": "", "uploader": { "login": "Martchus", "id": 10248953, "node_id": "MDQ6VXNlcjEwMjQ4OTUz", "avatar_url": "https://avatars.githubusercontent.com/u/10248953?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Martchus", "html_url": "https://github.com/Martchus", "followers_url": "https://api.github.com/users/Martchus/followers", "following_url": "https://api.github.com/users/Martchus/following{/other_user}", "gists_url": "https://api.github.com/users/Martchus/gists{/gist_id}", "starred_url": "https://api.github.com/users/Martchus/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Martchus/subscriptions", "organizations_url": "https://api.github.com/users/Martchus/orgs", "repos_url": "https://api.github.com/users/Martchus/repos", "events_url": "https://api.github.com/users/Martchus/events{/privacy}", "received_events_url": "https://api.github.com/users/Martchus/received_events", "type": "User", "site_admin": false }, "content_type": "application/octet-stream", "state": "uploaded", "size": 310, "download_count": 11, "created_at": "2024-04-09T13:25:54Z", "updated_at": "2024-04-09T13:25:54Z", "browser_download_url": "https://github.com/Martchus/syncthingtray/releases/download/v1.5.2/syncthingtray-1.5.2-x86_64-w64-mingw32.exe.zip.sig" }, { "url": "https://api.github.com/repos/Martchus/syncthingtray/releases/assets/161136760", "id": 161136760, "node_id": "RA_kwDOA_bJvs4JmsB4", "name": "syncthingtray-qt5-1.5.2-i686-w64-mingw32.exe.zip", "label": "", "uploader": { "login": "Martchus", "id": 10248953, "node_id": "MDQ6VXNlcjEwMjQ4OTUz", "avatar_url": "https://avatars.githubusercontent.com/u/10248953?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Martchus", "html_url": "https://github.com/Martchus", "followers_url": "https://api.github.com/users/Martchus/followers", "following_url": "https://api.github.com/users/Martchus/following{/other_user}", "gists_url": "https://api.github.com/users/Martchus/gists{/gist_id}", "starred_url": "https://api.github.com/users/Martchus/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Martchus/subscriptions", "organizations_url": "https://api.github.com/users/Martchus/orgs", "repos_url": "https://api.github.com/users/Martchus/repos", "events_url": "https://api.github.com/users/Martchus/events{/privacy}", "received_events_url": "https://api.github.com/users/Martchus/received_events", "type": "User", "site_admin": false }, "content_type": "application/octet-stream", "state": "uploaded", "size": 27125311, "download_count": 15, "created_at": "2024-04-09T13:24:36Z", "updated_at": "2024-04-09T13:24:41Z", "browser_download_url": "https://github.com/Martchus/syncthingtray/releases/download/v1.5.2/syncthingtray-qt5-1.5.2-i686-w64-mingw32.exe.zip" }, { "url": "https://api.github.com/repos/Martchus/syncthingtray/releases/assets/161136781", "id": 161136781, "node_id": "RA_kwDOA_bJvs4JmsCN", "name": "syncthingtray-qt5-1.5.2-i686-w64-mingw32.exe.zip.sig", "label": "", "uploader": { "login": "Martchus", "id": 10248953, "node_id": "MDQ6VXNlcjEwMjQ4OTUz", "avatar_url": "https://avatars.githubusercontent.com/u/10248953?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Martchus", "html_url": "https://github.com/Martchus", "followers_url": "https://api.github.com/users/Martchus/followers", "following_url": "https://api.github.com/users/Martchus/following{/other_user}", "gists_url": "https://api.github.com/users/Martchus/gists{/gist_id}", "starred_url": "https://api.github.com/users/Martchus/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Martchus/subscriptions", "organizations_url": "https://api.github.com/users/Martchus/orgs", "repos_url": "https://api.github.com/users/Martchus/repos", "events_url": "https://api.github.com/users/Martchus/events{/privacy}", "received_events_url": "https://api.github.com/users/Martchus/received_events", "type": "User", "site_admin": false }, "content_type": "application/octet-stream", "state": "uploaded", "size": 310, "download_count": 1, "created_at": "2024-04-09T13:24:43Z", "updated_at": "2024-04-09T13:24:43Z", "browser_download_url": "https://github.com/Martchus/syncthingtray/releases/download/v1.5.2/syncthingtray-qt5-1.5.2-i686-w64-mingw32.exe.zip.sig" }, { "url": "https://api.github.com/repos/Martchus/syncthingtray/releases/assets/161136796", "id": 161136796, "node_id": "RA_kwDOA_bJvs4JmsCc", "name": "syncthingtray-qt5-1.5.2-x86_64-w64-mingw32.exe.zip", "label": "", "uploader": { "login": "Martchus", "id": 10248953, "node_id": "MDQ6VXNlcjEwMjQ4OTUz", "avatar_url": "https://avatars.githubusercontent.com/u/10248953?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Martchus", "html_url": "https://github.com/Martchus", "followers_url": "https://api.github.com/users/Martchus/followers", "following_url": "https://api.github.com/users/Martchus/following{/other_user}", "gists_url": "https://api.github.com/users/Martchus/gists{/gist_id}", "starred_url": "https://api.github.com/users/Martchus/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Martchus/subscriptions", "organizations_url": "https://api.github.com/users/Martchus/orgs", "repos_url": "https://api.github.com/users/Martchus/repos", "events_url": "https://api.github.com/users/Martchus/events{/privacy}", "received_events_url": "https://api.github.com/users/Martchus/received_events", "type": "User", "site_admin": false }, "content_type": "application/octet-stream", "state": "uploaded", "size": 26943294, "download_count": 134, "created_at": "2024-04-09T13:24:51Z", "updated_at": "2024-04-09T13:24:57Z", "browser_download_url": "https://github.com/Martchus/syncthingtray/releases/download/v1.5.2/syncthingtray-qt5-1.5.2-x86_64-w64-mingw32.exe.zip" }, { "url": "https://api.github.com/repos/Martchus/syncthingtray/releases/assets/161136811", "id": 161136811, "node_id": "RA_kwDOA_bJvs4JmsCr", "name": "syncthingtray-qt5-1.5.2-x86_64-w64-mingw32.exe.zip.sig", "label": "", "uploader": { "login": "Martchus", "id": 10248953, "node_id": "MDQ6VXNlcjEwMjQ4OTUz", "avatar_url": "https://avatars.githubusercontent.com/u/10248953?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Martchus", "html_url": "https://github.com/Martchus", "followers_url": "https://api.github.com/users/Martchus/followers", "following_url": "https://api.github.com/users/Martchus/following{/other_user}", "gists_url": "https://api.github.com/users/Martchus/gists{/gist_id}", "starred_url": "https://api.github.com/users/Martchus/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Martchus/subscriptions", "organizations_url": "https://api.github.com/users/Martchus/orgs", "repos_url": "https://api.github.com/users/Martchus/repos", "events_url": "https://api.github.com/users/Martchus/events{/privacy}", "received_events_url": "https://api.github.com/users/Martchus/received_events", "type": "User", "site_admin": false }, "content_type": "application/octet-stream", "state": "uploaded", "size": 310, "download_count": 4, "created_at": "2024-04-09T13:25:03Z", "updated_at": "2024-04-09T13:25:03Z", "browser_download_url": "https://github.com/Martchus/syncthingtray/releases/download/v1.5.2/syncthingtray-qt5-1.5.2-x86_64-w64-mingw32.exe.zip.sig" } ], "tarball_url": "https://api.github.com/repos/Martchus/syncthingtray/tarball/v1.5.2", "zipball_url": "https://api.github.com/repos/Martchus/syncthingtray/zipball/v1.5.2", "body": "v1.5.2", "reactions": { "url": "https://api.github.com/repos/Martchus/syncthingtray/releases/150394390/reactions", "total_count": 4, "+1": 0, "-1": 0, "laugh": 0, "hooray": 4, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } }]'}, true);
}
const ajaxRequest = new XMLHttpRequest();
ajaxRequest.onreadystatechange = function() {
if (this.readyState !== 4) {
return;
}
try {
// avoid showing HTML code from gateway
ajaxRequest.responseTextDisplay = ajaxRequest.status >= 500 && ajaxRequest.status < 600
? 'internal server error'
: ajaxRequest.responseText;
return callback(this, ajaxRequest.status === 200);
} catch (e) {
window.alert('Unable to process server response: ' + e);
throw e;
}
};
const args = [method, path, true];
ajaxRequest.open(...args);
ajaxRequest.send();
return ajaxRequest;
}