From f73b7eb569dc6f40ecf8adccf4a42446baf1f97f Mon Sep 17 00:00:00 2001 From: Jonah BrĂ¼chert Date: Thu, 30 Aug 2018 18:17:06 +0200 Subject: Recommend different clients depending on the operating system --- scripts/main.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/main.js b/scripts/main.js index 7f9bc8d..4f2f207 100644 --- a/scripts/main.js +++ b/scripts/main.js @@ -17,8 +17,7 @@ } } - function load_clients() { - var url = "clients.json"; + function load_clients(url) { var request = new XMLHttpRequest(); request.open('GET', url); request.onreadystatechange = function () { @@ -93,7 +92,19 @@ i18n.setLocale('en'); // functionality - load_clients(); + if (navigator.userAgent.indexOf("Android") >= 0) { + load_clients("clients_android.json") + } + else if (navigator.userAgent.indexOf("Linux") >= 0) { + load_clients("clients_desktop.json") + } + else if (navigator.userAgent.indexOf("iPhone") >= 0) { + load_clients("clients_iphone.json") + } + else { + load_clients("clients_desktop.json") + } + window.addEventListener("hashchange", rehash, false); document.getElementById("url_in").addEventListener("focus", function(event) { event.target.select(); -- cgit 1.4.1 From d3618404127829b6904241e2c1d5402881312752 Mon Sep 17 00:00:00 2001 From: Jonah BrĂ¼chert Date: Tue, 12 Mar 2019 17:47:41 +0100 Subject: Rename to XSF platform mapping --- clients_Android.json | 6 ++++++ clients_Linux.json | 5 +++++ clients_android.json | 6 ------ clients_desktop.json | 5 ----- clients_iOS.json | 3 +++ clients_iphone.json | 3 --- scripts/main.js | 8 ++++---- 7 files changed, 18 insertions(+), 18 deletions(-) create mode 100644 clients_Android.json create mode 100644 clients_Linux.json delete mode 100644 clients_android.json delete mode 100644 clients_desktop.json create mode 100644 clients_iOS.json delete mode 100644 clients_iphone.json (limited to 'scripts') diff --git a/clients_Android.json b/clients_Android.json new file mode 100644 index 0000000..6ed6c7e --- /dev/null +++ b/clients_Android.json @@ -0,0 +1,6 @@ +[ + "Conversations - modern and featureful", + "Xabber - focus on user experience and interoperability", + "yaxim - lightweight classic UI", + "Bruno - cute and cuddly (based on yaxim)" +] diff --git a/clients_Linux.json b/clients_Linux.json new file mode 100644 index 0000000..024ac44 --- /dev/null +++ b/clients_Linux.json @@ -0,0 +1,5 @@ +[ + "Dino - modern, clean and GNOME integrated", + "Kaidan - modern, convergent and cross-platform", + "Gajim - full-featured" +] diff --git a/clients_android.json b/clients_android.json deleted file mode 100644 index 6ed6c7e..0000000 --- a/clients_android.json +++ /dev/null @@ -1,6 +0,0 @@ -[ - "Conversations - modern and featureful", - "Xabber - focus on user experience and interoperability", - "yaxim - lightweight classic UI", - "Bruno - cute and cuddly (based on yaxim)" -] diff --git a/clients_desktop.json b/clients_desktop.json deleted file mode 100644 index 024ac44..0000000 --- a/clients_desktop.json +++ /dev/null @@ -1,5 +0,0 @@ -[ - "Dino - modern, clean and GNOME integrated", - "Kaidan - modern, convergent and cross-platform", - "Gajim - full-featured" -] diff --git a/clients_iOS.json b/clients_iOS.json new file mode 100644 index 0000000..63e5a29 --- /dev/null +++ b/clients_iOS.json @@ -0,0 +1,3 @@ +[ + "ChatSecure - Encrypted Messenger for iOS" +] diff --git a/clients_iphone.json b/clients_iphone.json deleted file mode 100644 index 63e5a29..0000000 --- a/clients_iphone.json +++ /dev/null @@ -1,3 +0,0 @@ -[ - "ChatSecure - Encrypted Messenger for iOS" -] diff --git a/scripts/main.js b/scripts/main.js index 4f2f207..cc13762 100644 --- a/scripts/main.js +++ b/scripts/main.js @@ -93,16 +93,16 @@ // functionality if (navigator.userAgent.indexOf("Android") >= 0) { - load_clients("clients_android.json") + load_clients("clients_Android.json") } else if (navigator.userAgent.indexOf("Linux") >= 0) { - load_clients("clients_desktop.json") + load_clients("clients_Linux.json") } else if (navigator.userAgent.indexOf("iPhone") >= 0) { - load_clients("clients_iphone.json") + load_clients("clients_iOS.json") } else { - load_clients("clients_desktop.json") + load_clients("clients_Linux.json") } window.addEventListener("hashchange", rehash, false); -- cgit 1.4.1