1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/base/content/test/social/social_sidebar.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,47 @@ 1.4 +<html> 1.5 + <head> 1.6 + <meta charset="utf-8"> 1.7 + <script> 1.8 + var testwindow; 1.9 + function pingWorker() { 1.10 + var port = navigator.mozSocial.getWorker().port; 1.11 + port.onmessage = function(e) { 1.12 + var topic = e.data.topic; 1.13 + switch (topic) { 1.14 + case "test-flyout-open": 1.15 + navigator.mozSocial.openPanel("social_flyout.html"); 1.16 + break; 1.17 + case "test-flyout-close": 1.18 + navigator.mozSocial.closePanel(); 1.19 + break; 1.20 + case "test-chatbox-open": 1.21 + var url = "social_chat.html"; 1.22 + var data = e.data.data; 1.23 + if (data && data.id) { 1.24 + url = url + "?id="+data.id; 1.25 + } 1.26 + navigator.mozSocial.openChatWindow(url, function(chatwin) { 1.27 + // Note that the following .focus() call should *not* arrange 1.28 + // to steal focus - see browser_social_chatwindowfocus.js 1.29 + if (data && data.stealFocus && chatwin) { 1.30 + chatwin.focus(); 1.31 + } 1.32 + port.postMessage({topic: "chatbox-opened", 1.33 + result: chatwin ? "ok" : "failed"}); 1.34 + }); 1.35 + break; 1.36 + case "test-isVisible": 1.37 + port.postMessage({topic: "test-isVisible-response", 1.38 + result: navigator.mozSocial.isVisible}); 1.39 + break; 1.40 + } 1.41 + } 1.42 + port.postMessage({topic: "sidebar-message", result: "ok"}); 1.43 + } 1.44 + </script> 1.45 + </head> 1.46 + <body onload="pingWorker();"> 1.47 + <p>This is a test social sidebar.</p> 1.48 + <button id="chat-opener" onclick="navigator.mozSocial.openChatWindow('./social_chat.html');"/> 1.49 + </body> 1.50 +</html>