From 5f3be824fa31537611e96a3747bc5409e6609f38 Mon Sep 17 00:00:00 2001 From: Thibault Duplessis Date: Sun, 23 Sep 2012 14:41:58 +0200 Subject: [PATCH] add opera to supported browsers, help user activating web sockets --- public/browser.html | 15 +++++++++------ public/javascripts/ctrl.js | 7 ++++++- public/opera-websocket.html | 9 +++++++++ todo | 4 ---- 4 files changed, 24 insertions(+), 11 deletions(-) create mode 100644 public/opera-websocket.html diff --git a/public/browser.html b/public/browser.html index 2f14d34f2d..99d593bd68 100644 --- a/public/browser.html +++ b/public/browser.html @@ -6,23 +6,26 @@
Warning!
-
+
Your browser cannot run Lichess!
- We're sorry, but your browser does not support WebSockets.
- In order to play, we recommend using the latest version of Firefox, Chrome or Safari. + Sorry, but your browser does not support WebSockets.
+ We recommend using the latest version of Firefox, Chrome, Safari or Opera.
- Get Firefox + Get Firefox
- Get Google Chrome + Get Google Chrome
- Get Safari + Get Safari +
+
+ Get Opera
diff --git a/public/javascripts/ctrl.js b/public/javascripts/ctrl.js index b1dc1f3bb5..5c97e301af 100644 --- a/public/javascripts/ctrl.js +++ b/public/javascripts/ctrl.js @@ -46,7 +46,12 @@ lichess.socketDefaults.options.debug = !lichess.onProduction; $(function() { if (!$.websocket.available) { - $.ajax('/assets/browser.html', { success: function(html) { $('body').prepend(html); } }); + if (window.opera) { + var inUrFaceUrl = '/assets/opera-websocket.html'; + } else { + var inUrFaceUrl = '/assets/browser.html'; + } + $.ajax(inUrFaceUrl, { success: function(html) { $('body').prepend(html); } }); } // Start game diff --git a/public/opera-websocket.html b/public/opera-websocket.html new file mode 100644 index 0000000000..ddc1f0b00b --- /dev/null +++ b/public/opera-websocket.html @@ -0,0 +1,9 @@ +
+
+

Thank you for using Opera! Now you need to enable WebSockets:

+
+

1. Go to opera:config#Enable%20WebSockets.

+

2. Tick the checkbox “Enable WebSockets” under User Prefs.

+

3. Click Save button and restart Opera.

+
+
diff --git a/todo b/todo index b003634627..74bd2005f6 100644 --- a/todo +++ b/todo @@ -34,15 +34,11 @@ possible timeout bug http://en.lichess.org/forum/lichess-feedback/possible-timeo add elo titles (like 2300+ = FM) tournament replace game->tour redirect with big link tournament berserker = half time, double points -add opera to supported browsers -detected opera but no websockets = help message chat icons (k) (K) blind accessible -home anon replace chat with mini boards make hand and finisher actors to avoid racing conditions tournament monitor all hub members should use userIds rather than usernames -add opera to list of supported browsers (with websocket trick) tournament ties tournament detect leavers and withdraw them (started) (also use force resign) -> or show current tournament on every page, with (join) and (redraw) buttons