Squashed commit of the following: commit 708932504ff4b5cc219fdc0f021e750296214f03 Author: Dan Mosedale <dmose@meer.net> Remove debugging console spew commit 93f3dbb5c0f1470cc21234ab2c765702e5307137 Author: Dan Mosedale <dmose@meer.net> Date: Mon Jun 8 10:36:36 2015 -0700 Fix bad sizing of ConversationToolbar Examples commit 7a4458a763ebfe2341414dea766fc3e982cc6d92 Author: Mark Banner <standard8@mozilla.com> Date: Mon Jun 8 11:34:28 2015 +0100 Fix data channel setup to not send the signal back to the same client commit d78dd64de2681545f874fc75615f601c2678ebca Author: Mark Banner <standard8@mozilla.com> Date: Mon Jun 8 10:01:40 2015 +0100 Remove the box-shadow for local desktop elements, per bug 1112021 - fix the ongoing conversation window display commit 44c8176226ed5e0313fd70e781e0876ac22ba7cb Author: Dan Mosedale <dmose@meer.net> Date: Fri Jun 5 14:08:35 2015 -0700 Add jsdoc for makeActiveRoomStore commit 665ad8cfd05c8f061278b3f2096d57f0a30477cb Author: Dan Mosedale <dmose@meer.net> Date: Fri Jun 5 14:03:55 2015 -0700 Cleaner way to skip a test so it shows up as pending commit d97005a8d590cd70b14738605438da5d467fb6bc Author: Dan Mosedale <dmose@meer.net> Date: Fri Jun 5 14:00:34 2015 -0700 More jsdoc/XXX cleanup commit db3e6a5fd717961bd2b88b881211e2515e42117a Author: Dan Mosedale <dmose@meer.net> Date: Fri Jun 5 13:35:15 2015 -0700 Rename _onRemoteSessionSubscribed to _setupDataChannelIfNeeded commit 557f2e143b1942b4cbc02e5fd21047a556a20f71 Author: Dan Mosedale <dmose@meer.net> Date: Fri Jun 5 13:32:53 2015 -0700 Handle and/or remove various XXX and YYY comments commit 1e25b6d7d3a2916f3d52a40172fae64e12fa33e6 Author: Mark Banner <standard8@mozilla.com> Date: Fri Jun 5 18:08:40 2015 +0100 Backout data channel disabling commit 617e73d43bf7a129f1098b37a26dab358011ebb2 Author: Mark Banner <standard8@mozilla.com> Date: Fri Jun 5 17:58:26 2015 +0100 Fix some more review comments commit efb3a11b2ff6c667690af015c607c04e9a9b21b9 Author: Mark Banner <standard8@mozilla.com> Date: Fri Jun 5 13:34:32 2015 +0100 Make joining a room with screenshare work reasonably well, until we can refactor the layout not to depend so much on element sizes/locations commit fe1033fb7b16c13175d2ae4e65e28d7cd0465628 Author: Mark Banner <standard8@mozilla.com> Date: Fri Jun 5 12:20:32 2015 +0100 Fix a strange quirk at 640px - @media min-width and max-width both match 640px (they are inclusive) commit ee0e76759accb76e817dfec678a70d073e45d2ba Author: Mark Banner <standard8@mozilla.com> Date: Fri Jun 5 12:03:06 2015 +0100 Add some jsdoc comments and fix review nits commit 5086f27cd252d517afaaa74529336d58078d0d2b Author: Mark Banner <standard8@mozilla.com> Date: Fri Jun 5 11:27:24 2015 +0100 Tidy up comments wrt mute in the otSdkDriver commit 02a9e3c0724059af1db50ec930744756f90968aa Author: Dan Mosedale <dmose@meer.net> Date: Thu Jun 4 16:09:25 2015 -0700 Remove LocalVideoDisabled action for now commit 835012ecc4685d2538ce8de2bf03c04fc841d691 Author: Dan Mosedale <dmose@meer.net> Date: Thu Jun 4 16:04:50 2015 -0700 Fix commentary and remove extraneous string commit a0daab47c321ed13f2c0693b80070892717b7134 Author: Dan Mosedale <dmose@meer.net> Date: Thu Jun 4 16:00:58 2015 -0700 Fix punctuation nit commit d1c777ee4e049992e4759cfb2a756195d73e0db3 Author: Dan Mosedale <dmose@meer.net> Date: Thu Jun 4 16:00:07 2015 -0700 Remove duplicate setting of store state commit e812494f3037810a3c7d08ca848e3bef8b5685f8 Author: Dan Mosedale <dmose@meer.net> Date: Thu Jun 4 15:48:41 2015 -0700 Indentation fix commit b28f3d09e94769986674a9e38efc5e9605895e65 Author: Dan Mosedale <dmose@meer.net> Date: Thu Jun 4 15:35:13 2015 -0700 Add jsdoc with basic explanation of the React Frame component commit 04e140aa878889d7966bc09886ec56a71fc40e1c Author: Dan Mosedale <dmose@meer.net> Date: Thu Jun 4 15:25:14 2015 -0700 Fix indentation issues commit 7376a564d953a2e9846762919b8c89eed1b290d7 Author: Dan Mosedale <dmose@meer.net> Date: Thu Jun 4 15:20:33 2015 -0700 Remove obsolete comment commit a9d37c27f82bb6dbb853353bdb6a0336a19e67b1 Author: Dan Mosedale <dmose@meer.net> Date: Thu Jun 4 14:16:11 2015 -0700 Revert sdk.js logging changes commit c6b2d58c87779d61deaf79f7e3dc7adf40688217 Author: Dan Mosedale <dmose@meer.net> Date: Thu Jun 4 14:05:16 2015 -0700 Add tests for StandaloneRoomView changes commit ca14a76837c81d2579a2e83f5e7ff6bc50ecd479 Author: Mark Banner <standard8@mozilla.com> Date: Thu Jun 4 19:03:24 2015 +0100 Remove remaining OT_ rules. commit 90aa8ab45adebed4ec62e07a5a06c9cacf3810c5 Author: Mark Banner <standard8@mozilla.com> Date: Thu Jun 4 15:47:30 2015 +0100 Add tests for DesktopRoomConversationView commit a16601bfb2cc2bec10ad60939dbfc911681fcea6 Author: Mark Banner <standard8@mozilla.com> Date: Thu Jun 4 15:19:07 2015 +0100 Add tests for the activeRoomStore commit 8dd6f5ae82f991222c87b0dd1bd8830b37ef4d7d Author: Mark Banner <standard8@mozilla.com> Date: Thu Jun 4 14:49:10 2015 +0100 Add tests for OngoingConversationView commit 56b00a3ee26a45379e530d3182c96a6829ecdb54 Author: Dan Mosedale <dmose@meer.net> Date: Wed Jun 3 15:35:07 2015 -0700 Add tests for conversationStore.js and fix some possible leakage commit 338e1d67811c773bbb051e5886eeda7e6eaa8421 Author: Dan Mosedale <dmose@meer.net> Date: Wed Jun 3 14:07:00 2015 -0700 Remove obsolete setupStreamElements params commit 16af6c3b282ce1f144724f18e6c6ad31c01a6ad3 Author: Dan Mosedale <dmose@meer.net> Date: Wed Jun 3 11:12:28 2015 -0700 Fix functional tests for new DOM structure commit 5c97758e82c5a31d213a406ff8b63cefe307634f Author: Mark Banner <standard8@mozilla.com> Date: Wed Jun 3 17:44:24 2015 +0100 Fix ui-showcase detection of errors commit a421af9d48e66ab1c0f0b5da7d89122ed41d6a40 Author: Mark Banner <standard8@mozilla.com> Date: Wed Jun 3 13:49:57 2015 +0100 Fix the location of the local video when remote video is muted or not being shown. commit a095d9b3f9cdf418184428d13f954cb623932e4a Author: Mark Banner <standard8@mozilla.com> Date: Wed Jun 3 13:05:01 2015 +0100 Switch UI-Showcase to use a slightly bigger size for the current standalone views to properly reflect what desktop displays commit 9a83958eebc788656c8d2002b5ea00b47be1bf53 Author: Mark Banner <standard8@mozilla.com> Date: Wed Jun 3 12:16:01 2015 +0100 Remove the now unnecessary getLocal/Remote/ScreenShareElement functions commit 4ecde728f92333b3203ffec2436c5e76cdb25a4e Author: Mark Banner <standard8@mozilla.com> Date: Wed Jun 3 12:00:02 2015 +0100 Fix screenshare video element size. commit f44e57aa02a59960a7d4d7cfdf22bf952110b1cb Author: Mark Banner <standard8@mozilla.com> Date: Wed Jun 3 11:53:58 2015 +0100 Add mirror transform back to the local video commit 87bb79f0c665bee2736af1c75868e973698fb21d Author: Dan Mosedale <dmose@meer.net> Date: Tue Jun 2 15:12:28 2015 -0700 otSdkDriver element cleanup and automated tests commit 699f7c05a9b5be7e1790d60f33a1444331e1399e Author: Mark Banner <standard8@mozilla.com> Date: Tue Jun 2 18:09:42 2015 +0100 WIP Move media element handling to a shared view to reduce code duplication. commit d8d8a5435134f1003f6e290fe4b4f838208d42f2 Author: Dan Mosedale <dmose@meer.net> Date: Sun May 31 17:58:52 2015 -0700 WIP port remaining screenshare magic to view commit 01446056a5f2459f787b7e6fbe0a74fd979ac651 Author: Dan Mosedale <dmose@meer.net> Date: Fri May 29 11:42:52 2015 -0700 WIP fix desktop facemuting by porting most video magic from driver to view commit 41c3efed44e3216eb4563b311442c3694167b877 Author: Dan Mosedale <dmose@meer.net> Date: Thu May 28 15:59:38 2015 -0700 WIP standalone facemute refactor, part2; needs tests & cleanup commit fdd027e900951b61da30746c569d18ab61a4737b Author: Dan Mosedale <dmose@meer.net> Date: Thu May 28 13:31:30 2015 -0700 Renamed to this.mockPublisherEl for consistency commit a9d351d8e06719d63d4f200c00d9ae335019b0f8 Author: Dan Mosedale <dmose@meer.net> Date: Thu May 28 13:28:40 2015 -0700 Renamed .screen-share__video to .screen-share-video commit 14f5bc59afb6c90a857ddfee391a4c71d7bbdf3b Author: Dan Mosedale <dmose@meer.net> Date: Thu May 28 13:24:57 2015 -0700 Rename .remote__video to .remote-video commit 17e61b1c111c600c3703eff9c15b320279687313 Author: Dan Mosedale <dmose@meer.net> Date: Thu May 28 13:14:03 2015 -0700 WIP standalone room views refactor for facemuting; semi-broken commit 59447a60ae45c332c1f1fb452ce762da01cafbb5 Author: Dan Mosedale <dmose@meer.net> Date: Thu May 28 13:09:22 2015 -0700 Fix more merge bustage & spelling commit 82d1d0d87c525ffe2b962d0ef7f543ade06d0376 Author: Dan Mosedale <dmose@meer.net> Date: Thu May 28 09:17:57 2015 -0700 Fix eslint nits commit f743e602e0a19f7fcff6b0622fe12f87b43efa84 Author: Dan Mosedale <dmose@meer.net> Date: Thu May 28 09:11:21 2015 -0700 Rename remote__video element id to remote-video commit b69d686b7812dfa7d631989b64ffae1e305c6c06 Author: Dan Mosedale <dmose@meer.net> Date: Wed May 27 13:34:40 2015 -0700 Fix merge error by switching ready to FramedExample commit d8c9846ddac0967adb10793b561895a7aef085c4 Author: Dan Mosedale <dmose@meer.net> Date: Thu May 14 11:23:21 2015 -0700 WIP Add direct call video mute showcase views + impl facemute commit 9dbf5f5f403d088b14f68935577093e2e96409a2 Author: Dan Mosedale <dmose@meer.net> Date: Thu May 7 10:52:55 2015 -0700 Remove soon-to-be-unsupported standalone call URL views commit d2bf428dc6ce56b878e21525525a62b9254bbdeb Author: Dan Mosedale <dmose@meer.net> Date: Thu May 7 10:51:39 2015 -0700 Switch desktop conversation with local face mute to FramedExample commit 48c825d6cc916f0d9384db42252a86246c313a49 Author: Dan Mosedale <dmose@meer.net> Date: Thu May 7 10:09:19 2015 -0700 Switch large OngoingConversationWindow to FramedExample commit f72aefc7cca1014f1accdafc2bc21f29c1b0bac9 Author: Dan Mosedale <dmose@meer.net> Date: Tue May 5 16:30:48 2015 -0700 Get OngoingCallView and first showcase use working commit fb31b510738f7badf9094c600ede92f18df10763 Author: Dan Mosedale <dmose@meer.net> Date: Tue May 5 16:17:24 2015 -0700 Switch last 4 standalone views to FramedExample commit 7815eaadd157f6d210ad9bd43bbbbba114995a51 Author: Dan Mosedale <dmose@meer.net> Date: Mon May 4 14:56:02 2015 -0700 Switch DesktopRoomConversationViews over to FramedExample commit 3a70e38e78cce4afc34d934526b0eff2aefc1ea2 Author: Dan Mosedale <dmose@meer.net> Date: Wed Apr 29 16:36:33 2015 -0700 Bulletproof forcedUpdate some more commit 75b5f8c56848983bac313d3c8ee166e3f25026ef Author: Dan Mosedale <dmose@meer.net> Date: Mon May 11 14:09:17 2015 -0700 Workaround ui-showcase race by waiting longer commit d67c6b113c88f0e8543fe8fe2d9c174c74ad6942 Author: Dan Mosedale <dmose@meer.net> Date: Wed Apr 29 16:30:44 2015 -0700 Better error-handling in react-frame-component commit 61e644f0bd0db8e65963a603d94d76cdc96c1bd6 Author: Dan Mosedale <dmose@meer.net> Date: Wed Apr 29 12:34:17 2015 -0700 Convert standalone joined room to FramedExample commit b40db913af5059869898a6db2873f0493037f1cd Author: Dan Mosedale <dmose@meer.net> Date: Wed Apr 29 12:22:14 2015 -0700 Fix grey video letter/pillarboxing regression commit 451b9a73552d7158f68d4217368d4cc06c47c7ab Author: Dan Mosedale <dmose@meer.net> Date: Tue Apr 28 13:54:12 2015 -0700 Tweak makeActiveRoomStore to take options object and require roomState; adjust clients commit adc8e96ed5266b79496d029238cf570dab20f28a Author: Dan Mosedale <dmose@meer.net> Date: Tue Apr 28 12:43:32 2015 -0700 Make StandAloneRoomView (ready) FramedExample commit 0a5a47c6bc709ad0eb93b2517e6905babe404fb0 Author: Dan Mosedale <dmose@meer.net> Date: Tue Apr 28 11:17:19 2015 -0700 Refactor activeRoomStore updating in showcase commit e315b311e51dabb747ba3a298b1573f3eaa0ebff Author: Dan Mosedale <dmose@meer.net> Date: Tue Apr 28 11:15:08 2015 -0700 Add matchMedia hack to activeRoomStore for showcase use commit 9049d32791cb32c53fd3cfcf91e96f02e6b26cf8 Author: Dan Mosedale <dmose@meer.net> Date: Mon Apr 27 16:36:46 2015 -0700 Make Frame pass iframe contentWindow to onContentsRendered commit 302912ffcfc01548b713d829bc1025957b75a52d Author: Dan Mosedale <dmose@meer.net> Date: Mon Apr 27 16:10:32 2015 -0700 Get rid of unnecessary showcase-specific rules commit 9014e1d58607c59d70ef3bab415a747ce5366985 Author: Dan Mosedale <dmose@meer.net> Date: Mon Apr 27 11:37:45 2015 -0700 Resize showcase posters to 640x480 for easy verification commit 6298d044bf00c88566e9bf79ecd184715cf71b7d Author: Dan Mosedale <dmose@meer.net> Date: Wed Apr 8 13:54:48 2015 -0700 Switch screensharing view to FramedExample, clean up sizing. commit ca7cb3930b91b1ff1531c0fc7772ff8ef88bf3a4 Author: Dan Mosedale <dmose@meer.net> Date: Fri Apr 3 15:18:21 2015 -0700 Switch screensharing over; add (WIP) showcase view commit 218e9071357c0c7c8d2f8f0a2c2c93c40409122e Author: Dan Mosedale <dmose@meer.net> Date: Mon Mar 30 15:25:55 2015 -0700 Stop trying to adjust styles on an SDK-provided div we no longer have commit 3c274303caa4ad49abfbee95e74b17242e1e099b Author: Dan Mosedale <dmose@meer.net> Date: Mon Mar 30 15:24:24 2015 -0700 Switch StandaloneRoomView w/people to iframe; ditch unneeded CSS commit 1b661d08d29d6b47849ff3b2616310fba71b518a Author: Dan Mosedale <dmose@meer.net> Date: Thu Mar 26 12:12:33 2015 -0700 Give StandaloneRoomView posterUrl args for ui-showcase commit d0ab0ee2798516d06d5bac2f9b383f9842c8e7e3 Author: Dan Mosedale <dmose@meer.net> Date: Wed Mar 25 15:08:55 2015 -0700 Do basic CSS fixup to changed structure commit 02e71d9352d42d1ebde386fe559288e3a9bd1335 Author: Dan Mosedale <dmose@meer.net> Date: Fri Mar 20 07:13:44 2015 -0700 Get local & remote cameras working; fix tests
947 lines
39 KiB
JavaScript
947 lines
39 KiB
JavaScript
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||
|
||
/* global Frame:false uncaughtError:true */
|
||
|
||
(function() {
|
||
"use strict";
|
||
|
||
// Stop the default init functions running to avoid conflicts.
|
||
document.removeEventListener("DOMContentLoaded", loop.panel.init);
|
||
document.removeEventListener("DOMContentLoaded", loop.conversation.init);
|
||
|
||
// 1. Desktop components
|
||
// 1.1 Panel
|
||
var PanelView = loop.panel.PanelView;
|
||
var SignInRequestView = loop.panel.SignInRequestView;
|
||
// 1.2. Conversation Window
|
||
var AcceptCallView = loop.conversationViews.AcceptCallView;
|
||
var DesktopPendingConversationView = loop.conversationViews.PendingConversationView;
|
||
var OngoingConversationView = loop.conversationViews.OngoingConversationView;
|
||
var CallFailedView = loop.conversationViews.CallFailedView;
|
||
var DesktopRoomConversationView = loop.roomViews.DesktopRoomConversationView;
|
||
|
||
// 2. Standalone webapp
|
||
var HomeView = loop.webapp.HomeView;
|
||
var UnsupportedBrowserView = loop.webapp.UnsupportedBrowserView;
|
||
var UnsupportedDeviceView = loop.webapp.UnsupportedDeviceView;
|
||
var StandaloneRoomView = loop.standaloneRoomViews.StandaloneRoomView;
|
||
|
||
// 3. Shared components
|
||
var ConversationToolbar = loop.shared.views.ConversationToolbar;
|
||
var FeedbackView = loop.shared.views.FeedbackView;
|
||
|
||
// Store constants
|
||
var ROOM_STATES = loop.store.ROOM_STATES;
|
||
var FEEDBACK_STATES = loop.store.FEEDBACK_STATES;
|
||
var CALL_TYPES = loop.shared.utils.CALL_TYPES;
|
||
|
||
// Local helpers
|
||
function returnTrue() {
|
||
return true;
|
||
}
|
||
|
||
function returnFalse() {
|
||
return false;
|
||
}
|
||
|
||
function noop(){}
|
||
|
||
// We save the visibility change listeners so that we can fake an event
|
||
// to the panel once we've loaded all the views.
|
||
var visibilityListeners = [];
|
||
var rootObject = window;
|
||
|
||
rootObject.document.addEventListener = function(eventName, func) {
|
||
if (eventName === "visibilitychange") {
|
||
visibilityListeners.push(func);
|
||
}
|
||
window.addEventListener(eventName, func);
|
||
};
|
||
|
||
rootObject.document.removeEventListener = function(eventName, func) {
|
||
if (eventName === "visibilitychange") {
|
||
var index = visibilityListeners.indexOf(func);
|
||
visibilityListeners.splice(index, 1);
|
||
}
|
||
window.removeEventListener(eventName, func);
|
||
};
|
||
|
||
loop.shared.mixins.setRootObject(rootObject);
|
||
|
||
var dispatcher = new loop.Dispatcher();
|
||
|
||
// Feedback API client configured to send data to the stage input server,
|
||
// which is available at https://input.allizom.org
|
||
var stageFeedbackApiClient = new loop.FeedbackAPIClient(
|
||
"https://input.allizom.org/api/v1/feedback", {
|
||
product: "Loop"
|
||
}
|
||
);
|
||
|
||
var mockSDK = _.extend({
|
||
sendTextChatMessage: function(message) {
|
||
dispatcher.dispatch(new loop.shared.actions.ReceivedTextChatMessage({
|
||
message: message
|
||
}));
|
||
}
|
||
}, Backbone.Events);
|
||
|
||
/**
|
||
* Every view that uses an activeRoomStore needs its own; if they shared
|
||
* an active store, they'd interfere with each other.
|
||
*
|
||
* @param options
|
||
* @returns {loop.store.ActiveRoomStore}
|
||
*/
|
||
function makeActiveRoomStore(options) {
|
||
var dispatcher = new loop.Dispatcher();
|
||
|
||
var store = new loop.store.ActiveRoomStore(dispatcher, {
|
||
mozLoop: navigator.mozLoop,
|
||
sdkDriver: mockSDK
|
||
});
|
||
|
||
if (!("remoteVideoEnabled" in options)) {
|
||
options.remoteVideoEnabled = true;
|
||
}
|
||
|
||
if (!("mediaConnected" in options)) {
|
||
options.mediaConnected = true;
|
||
}
|
||
|
||
store.setStoreState({
|
||
mediaConnected: options.mediaConnected,
|
||
remoteVideoEnabled: options.remoteVideoEnabled,
|
||
roomName: "A Very Long Conversation Name",
|
||
roomState: options.roomState,
|
||
used: !!options.roomUsed,
|
||
videoMuted: !!options.videoMuted
|
||
});
|
||
|
||
store.forcedUpdate = function forcedUpdate(contentWindow) {
|
||
|
||
// Since this is called by setTimeout, we don't want to lose any
|
||
// exceptions if there's a problem and we need to debug, so...
|
||
try {
|
||
// the dimensions here are taken from the poster images that we're
|
||
// using, since they give the <video> elements their initial intrinsic
|
||
// size. This ensures that the right aspect ratios are calculated.
|
||
// These are forced to 640x480, because it makes it visually easy to
|
||
// validate that the showcase looks like the real app on a chine
|
||
// (eg MacBook Pro) where that is the default camera resolution.
|
||
var newStoreState = {
|
||
localVideoDimensions: {
|
||
camera: {height: 480, orientation: 0, width: 640}
|
||
},
|
||
mediaConnected: options.mediaConnected,
|
||
receivingScreenShare: !!options.receivingScreenShare,
|
||
remoteVideoDimensions: {
|
||
camera: {height: 480, orientation: 0, width: 640}
|
||
},
|
||
remoteVideoEnabled: options.remoteVideoEnabled,
|
||
matchMedia: contentWindow.matchMedia.bind(contentWindow),
|
||
roomState: options.roomState,
|
||
videoMuted: !!options.videoMuted
|
||
};
|
||
|
||
if (options.receivingScreenShare) {
|
||
// Note that the image we're using had to be scaled a bit, and
|
||
// it still ended up a bit narrower than the live thing that
|
||
// WebRTC sends; presumably a different scaling algorithm.
|
||
// For showcase purposes, this shouldn't matter much, as the sizes
|
||
// of things being shared will be fairly arbitrary.
|
||
newStoreState.remoteVideoDimensions.screen =
|
||
{height: 456, orientation: 0, width: 641};
|
||
}
|
||
|
||
store.setStoreState(newStoreState);
|
||
} catch (ex) {
|
||
console.error("exception in forcedUpdate:", ex);
|
||
}
|
||
};
|
||
|
||
return store;
|
||
}
|
||
|
||
var activeRoomStore = makeActiveRoomStore({
|
||
roomState: ROOM_STATES.HAS_PARTICIPANTS
|
||
});
|
||
|
||
var joinedRoomStore = makeActiveRoomStore({
|
||
mediaConnected: false,
|
||
roomState: ROOM_STATES.JOINED,
|
||
remoteVideoEnabled: false
|
||
});
|
||
|
||
var readyRoomStore = makeActiveRoomStore({
|
||
mediaConnected: false,
|
||
roomState: ROOM_STATES.READY
|
||
});
|
||
|
||
var updatingActiveRoomStore = makeActiveRoomStore({
|
||
roomState: ROOM_STATES.HAS_PARTICIPANTS
|
||
});
|
||
|
||
var localFaceMuteRoomStore = makeActiveRoomStore({
|
||
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
||
videoMuted: true
|
||
});
|
||
|
||
var remoteFaceMuteRoomStore = makeActiveRoomStore({
|
||
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
||
remoteVideoEnabled: false,
|
||
mediaConnected: true
|
||
});
|
||
|
||
var updatingSharingRoomStore = makeActiveRoomStore({
|
||
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
||
receivingScreenShare: true
|
||
});
|
||
|
||
var fullActiveRoomStore = makeActiveRoomStore({
|
||
roomState: ROOM_STATES.FULL
|
||
});
|
||
|
||
var failedRoomStore = makeActiveRoomStore({
|
||
roomState: ROOM_STATES.FAILED
|
||
});
|
||
|
||
var endedRoomStore = makeActiveRoomStore({
|
||
roomState: ROOM_STATES.ENDED,
|
||
roomUsed: true
|
||
});
|
||
|
||
var roomStore = new loop.store.RoomStore(dispatcher, {
|
||
mozLoop: navigator.mozLoop
|
||
});
|
||
|
||
var desktopLocalFaceMuteActiveRoomStore = makeActiveRoomStore({
|
||
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
||
videoMuted: true
|
||
});
|
||
var desktopLocalFaceMuteRoomStore = new loop.store.RoomStore(dispatcher, {
|
||
mozLoop: navigator.mozLoop,
|
||
activeRoomStore: desktopLocalFaceMuteActiveRoomStore
|
||
});
|
||
|
||
var desktopRemoteFaceMuteActiveRoomStore = makeActiveRoomStore({
|
||
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
||
remoteVideoEnabled: false,
|
||
mediaConnected: true
|
||
});
|
||
var desktopRemoteFaceMuteRoomStore = new loop.store.RoomStore(dispatcher, {
|
||
mozLoop: navigator.mozLoop,
|
||
activeRoomStore: desktopRemoteFaceMuteActiveRoomStore
|
||
});
|
||
|
||
var feedbackStore = new loop.store.FeedbackStore(dispatcher, {
|
||
feedbackClient: stageFeedbackApiClient
|
||
});
|
||
var conversationStore = new loop.store.ConversationStore(dispatcher, {
|
||
client: {},
|
||
mozLoop: navigator.mozLoop,
|
||
sdkDriver: mockSDK
|
||
});
|
||
var textChatStore = new loop.store.TextChatStore(dispatcher, {
|
||
sdkDriver: mockSDK
|
||
});
|
||
|
||
textChatStore.setStoreState({
|
||
// XXX Disabled until we start sorting out some of the layouts.
|
||
textChatEnabled: false
|
||
});
|
||
|
||
loop.store.StoreMixin.register({
|
||
conversationStore: conversationStore,
|
||
feedbackStore: feedbackStore,
|
||
textChatStore: textChatStore
|
||
});
|
||
|
||
// Local mocks
|
||
|
||
var mockMozLoopRooms = _.extend({}, navigator.mozLoop);
|
||
|
||
var mockContact = {
|
||
name: ["Mr Smith"],
|
||
email: [{
|
||
value: "smith@invalid.com"
|
||
}]
|
||
};
|
||
|
||
var mockClient = {
|
||
requestCallUrlInfo: noop
|
||
};
|
||
|
||
var mockConversationModel = new loop.shared.models.ConversationModel({
|
||
callerId: "Mrs Jones",
|
||
urlCreationDate: (new Date() / 1000).toString()
|
||
}, {
|
||
sdk: mockSDK
|
||
});
|
||
mockConversationModel.startSession = noop;
|
||
|
||
var mockWebSocket = new loop.CallConnectionWebSocket({
|
||
url: "fake",
|
||
callId: "fakeId",
|
||
websocketToken: "fakeToken"
|
||
});
|
||
|
||
var notifications = new loop.shared.models.NotificationCollection();
|
||
var errNotifications = new loop.shared.models.NotificationCollection();
|
||
errNotifications.add({
|
||
level: "error",
|
||
message: "Could Not Authenticate",
|
||
details: "Did you change your password?",
|
||
detailsButtonLabel: "Retry"
|
||
});
|
||
|
||
var SVGIcon = React.createClass({displayName: "SVGIcon",
|
||
render: function() {
|
||
var sizeUnit = this.props.size.split("x")[0] + "px";
|
||
return (
|
||
React.createElement("span", {className: "svg-icon", style: {
|
||
"backgroundImage": "url(../content/shared/img/icons-" + this.props.size +
|
||
".svg#" + this.props.shapeId + ")",
|
||
"backgroundSize": sizeUnit + " " + sizeUnit
|
||
}})
|
||
);
|
||
}
|
||
});
|
||
|
||
var SVGIcons = React.createClass({displayName: "SVGIcons",
|
||
shapes: {
|
||
"10x10": ["close", "close-active", "close-disabled", "dropdown",
|
||
"dropdown-white", "dropdown-active", "dropdown-disabled", "edit",
|
||
"edit-active", "edit-disabled", "expand", "expand-active", "expand-disabled",
|
||
"minimize", "minimize-active", "minimize-disabled"
|
||
],
|
||
"14x14": ["audio", "audio-active", "audio-disabled", "facemute",
|
||
"facemute-active", "facemute-disabled", "hangup", "hangup-active",
|
||
"hangup-disabled", "incoming", "incoming-active", "incoming-disabled",
|
||
"link", "link-active", "link-disabled", "mute", "mute-active",
|
||
"mute-disabled", "pause", "pause-active", "pause-disabled", "video",
|
||
"video-white", "video-active", "video-disabled", "volume", "volume-active",
|
||
"volume-disabled"
|
||
],
|
||
"16x16": ["add", "add-hover", "add-active", "audio", "audio-hover", "audio-active",
|
||
"block", "block-red", "block-hover", "block-active", "contacts", "contacts-hover",
|
||
"contacts-active", "copy", "checkmark", "delete", "google", "google-hover",
|
||
"google-active", "history", "history-hover", "history-active", "leave",
|
||
"precall", "precall-hover", "precall-active", "screen-white", "screenmute-white",
|
||
"settings", "settings-hover", "settings-active", "share-darkgrey", "tag",
|
||
"tag-hover", "tag-active", "trash", "unblock", "unblock-hover", "unblock-active",
|
||
"video", "video-hover", "video-active", "tour"
|
||
]
|
||
},
|
||
|
||
render: function() {
|
||
var icons = this.shapes[this.props.size].map(function(shapeId, i) {
|
||
return (
|
||
React.createElement("li", {key: this.props.size + "-" + i, className: "svg-icon-entry"},
|
||
React.createElement("p", null, React.createElement(SVGIcon, {shapeId: shapeId, size: this.props.size})),
|
||
React.createElement("p", null, shapeId)
|
||
)
|
||
);
|
||
}, this);
|
||
return (
|
||
React.createElement("ul", {className: "svg-icon-list"}, icons)
|
||
);
|
||
}
|
||
});
|
||
|
||
var FramedExample = React.createClass({displayName: "FramedExample",
|
||
propTypes: {
|
||
width: React.PropTypes.number,
|
||
height: React.PropTypes.number,
|
||
onContentsRendered: React.PropTypes.func
|
||
},
|
||
|
||
makeId: function(prefix) {
|
||
return (prefix || "") + this.props.summary.toLowerCase().replace(/\s/g, "-");
|
||
},
|
||
|
||
render: function() {
|
||
var cx = React.addons.classSet;
|
||
return (
|
||
React.createElement("div", {className: "example"},
|
||
React.createElement("h3", {id: this.makeId()},
|
||
this.props.summary,
|
||
React.createElement("a", {href: this.makeId("#")}, " ¶")
|
||
),
|
||
React.createElement("div", {className: cx({comp: true, dashed: this.props.dashed}),
|
||
style: this.props.style},
|
||
React.createElement(Frame, {width: this.props.width, height: this.props.height,
|
||
onContentsRendered: this.props.onContentsRendered},
|
||
this.props.children
|
||
)
|
||
)
|
||
)
|
||
);
|
||
}
|
||
});
|
||
|
||
var Example = React.createClass({displayName: "Example",
|
||
makeId: function(prefix) {
|
||
return (prefix || "") + this.props.summary.toLowerCase().replace(/\s/g, "-");
|
||
},
|
||
|
||
render: function() {
|
||
var cx = React.addons.classSet;
|
||
return (
|
||
React.createElement("div", {className: "example"},
|
||
React.createElement("h3", {id: this.makeId()},
|
||
this.props.summary,
|
||
React.createElement("a", {href: this.makeId("#")}, " ¶")
|
||
),
|
||
React.createElement("div", {className: cx({comp: true, dashed: this.props.dashed}),
|
||
style: this.props.style},
|
||
this.props.children
|
||
)
|
||
)
|
||
);
|
||
}
|
||
});
|
||
|
||
var Section = React.createClass({displayName: "Section",
|
||
render: function() {
|
||
return (
|
||
React.createElement("section", {id: this.props.name, className: this.props.className},
|
||
React.createElement("h1", null, this.props.name),
|
||
this.props.children
|
||
)
|
||
);
|
||
}
|
||
});
|
||
|
||
var ShowCase = React.createClass({displayName: "ShowCase",
|
||
render: function() {
|
||
return (
|
||
React.createElement("div", {className: "showcase"},
|
||
React.createElement("header", null,
|
||
React.createElement("h1", null, "Loop UI Components Showcase"),
|
||
React.createElement("nav", {className: "showcase-menu"},
|
||
React.Children.map(this.props.children, function(section) {
|
||
return (
|
||
React.createElement("a", {className: "btn btn-info", href: "#" + section.props.name},
|
||
section.props.name
|
||
)
|
||
);
|
||
})
|
||
)
|
||
),
|
||
this.props.children
|
||
)
|
||
);
|
||
}
|
||
});
|
||
|
||
var App = React.createClass({displayName: "App",
|
||
|
||
render: function() {
|
||
return (
|
||
React.createElement(ShowCase, null,
|
||
React.createElement(Section, {name: "PanelView"},
|
||
React.createElement("p", {className: "note"},
|
||
React.createElement("strong", null, "Note:"), " 332px wide."
|
||
),
|
||
React.createElement(Example, {summary: "Re-sign-in view", dashed: "true", style: {width: "332px"}},
|
||
React.createElement(SignInRequestView, {mozLoop: mockMozLoopRooms})
|
||
),
|
||
React.createElement(Example, {summary: "Room list tab", dashed: "true", style: {width: "332px"}},
|
||
React.createElement(PanelView, {client: mockClient, notifications: notifications,
|
||
userProfile: {email: "test@example.com"},
|
||
mozLoop: mockMozLoopRooms,
|
||
dispatcher: dispatcher,
|
||
roomStore: roomStore,
|
||
selectedTab: "rooms"})
|
||
),
|
||
React.createElement(Example, {summary: "Contact list tab", dashed: "true", style: {width: "332px"}},
|
||
React.createElement(PanelView, {client: mockClient, notifications: notifications,
|
||
userProfile: {email: "test@example.com"},
|
||
mozLoop: mockMozLoopRooms,
|
||
dispatcher: dispatcher,
|
||
roomStore: roomStore,
|
||
selectedTab: "contacts"})
|
||
),
|
||
React.createElement(Example, {summary: "Error Notification", dashed: "true", style: {width: "332px"}},
|
||
React.createElement(PanelView, {client: mockClient, notifications: errNotifications,
|
||
mozLoop: navigator.mozLoop,
|
||
dispatcher: dispatcher,
|
||
roomStore: roomStore})
|
||
),
|
||
React.createElement(Example, {summary: "Error Notification - authenticated", dashed: "true", style: {width: "332px"}},
|
||
React.createElement(PanelView, {client: mockClient, notifications: errNotifications,
|
||
userProfile: {email: "test@example.com"},
|
||
mozLoop: navigator.mozLoop,
|
||
dispatcher: dispatcher,
|
||
roomStore: roomStore})
|
||
),
|
||
React.createElement(Example, {summary: "Contact import success", dashed: "true", style: {width: "332px"}},
|
||
React.createElement(PanelView, {notifications: new loop.shared.models.NotificationCollection([{level: "success", message: "Import success"}]),
|
||
userProfile: {email: "test@example.com"},
|
||
mozLoop: mockMozLoopRooms,
|
||
dispatcher: dispatcher,
|
||
roomStore: roomStore,
|
||
selectedTab: "contacts"})
|
||
),
|
||
React.createElement(Example, {summary: "Contact import error", dashed: "true", style: {width: "332px"}},
|
||
React.createElement(PanelView, {notifications: new loop.shared.models.NotificationCollection([{level: "error", message: "Import error"}]),
|
||
userProfile: {email: "test@example.com"},
|
||
mozLoop: mockMozLoopRooms,
|
||
dispatcher: dispatcher,
|
||
roomStore: roomStore,
|
||
selectedTab: "contacts"})
|
||
)
|
||
),
|
||
|
||
React.createElement(Section, {name: "AcceptCallView"},
|
||
React.createElement(Example, {summary: "Default / incoming video call", dashed: "true", style: {width: "300px", height: "272px"}},
|
||
React.createElement("div", {className: "fx-embedded"},
|
||
React.createElement(AcceptCallView, {callType: CALL_TYPES.AUDIO_VIDEO,
|
||
callerId: "Mr Smith",
|
||
dispatcher: dispatcher,
|
||
mozLoop: mockMozLoopRooms})
|
||
)
|
||
),
|
||
|
||
React.createElement(Example, {summary: "Default / incoming audio only call", dashed: "true", style: {width: "300px", height: "272px"}},
|
||
React.createElement("div", {className: "fx-embedded"},
|
||
React.createElement(AcceptCallView, {callType: CALL_TYPES.AUDIO_ONLY,
|
||
callerId: "Mr Smith",
|
||
dispatcher: dispatcher,
|
||
mozLoop: mockMozLoopRooms})
|
||
)
|
||
)
|
||
),
|
||
|
||
React.createElement(Section, {name: "AcceptCallView-ActiveState"},
|
||
React.createElement(Example, {summary: "Default", dashed: "true", style: {width: "300px", height: "272px"}},
|
||
React.createElement("div", {className: "fx-embedded"},
|
||
React.createElement(AcceptCallView, {callType: CALL_TYPES.AUDIO_VIDEO,
|
||
callerId: "Mr Smith",
|
||
dispatcher: dispatcher,
|
||
mozLoop: mockMozLoopRooms,
|
||
showMenu: true})
|
||
)
|
||
)
|
||
),
|
||
|
||
React.createElement(Section, {name: "ConversationToolbar"},
|
||
React.createElement("h2", null, "Desktop Conversation Window"),
|
||
React.createElement("div", {className: "fx-embedded override-position"},
|
||
React.createElement(Example, {summary: "Default", style: {width: "300px", height: "26px"}},
|
||
React.createElement(ConversationToolbar, {video: {enabled: true},
|
||
audio: {enabled: true},
|
||
hangup: noop,
|
||
publishStream: noop})
|
||
),
|
||
React.createElement(Example, {summary: "Video muted", style: {width: "300px", height: "26px"}},
|
||
React.createElement(ConversationToolbar, {video: {enabled: false},
|
||
audio: {enabled: true},
|
||
hangup: noop,
|
||
publishStream: noop})
|
||
),
|
||
React.createElement(Example, {summary: "Audio muted", style: {width: "300px", height: "26px"}},
|
||
React.createElement(ConversationToolbar, {video: {enabled: true},
|
||
audio: {enabled: false},
|
||
hangup: noop,
|
||
publishStream: noop})
|
||
)
|
||
),
|
||
|
||
React.createElement("h2", null, "Standalone"),
|
||
React.createElement("div", {className: "standalone override-position"},
|
||
React.createElement(Example, {summary: "Default"},
|
||
React.createElement(ConversationToolbar, {video: {enabled: true},
|
||
audio: {enabled: true},
|
||
hangup: noop,
|
||
publishStream: noop})
|
||
),
|
||
React.createElement(Example, {summary: "Video muted"},
|
||
React.createElement(ConversationToolbar, {video: {enabled: false},
|
||
audio: {enabled: true},
|
||
hangup: noop,
|
||
publishStream: noop})
|
||
),
|
||
React.createElement(Example, {summary: "Audio muted"},
|
||
React.createElement(ConversationToolbar, {video: {enabled: true},
|
||
audio: {enabled: false},
|
||
hangup: noop,
|
||
publishStream: noop})
|
||
)
|
||
)
|
||
),
|
||
|
||
React.createElement(Section, {name: "PendingConversationView (Desktop)"},
|
||
React.createElement(Example, {summary: "Connecting", dashed: "true",
|
||
style: {width: "300px", height: "272px"}},
|
||
React.createElement("div", {className: "fx-embedded"},
|
||
React.createElement(DesktopPendingConversationView, {callState: "gather",
|
||
contact: mockContact,
|
||
dispatcher: dispatcher})
|
||
)
|
||
)
|
||
),
|
||
|
||
React.createElement(Section, {name: "CallFailedView"},
|
||
React.createElement(Example, {summary: "Call Failed - Incoming", dashed: "true",
|
||
style: {width: "300px", height: "272px"}},
|
||
React.createElement("div", {className: "fx-embedded"},
|
||
React.createElement(CallFailedView, {dispatcher: dispatcher,
|
||
outgoing: false,
|
||
store: conversationStore})
|
||
)
|
||
),
|
||
React.createElement(Example, {summary: "Call Failed - Outgoing", dashed: "true",
|
||
style: {width: "300px", height: "272px"}},
|
||
React.createElement("div", {className: "fx-embedded"},
|
||
React.createElement(CallFailedView, {dispatcher: dispatcher,
|
||
outgoing: true,
|
||
store: conversationStore})
|
||
)
|
||
),
|
||
React.createElement(Example, {summary: "Call Failed — with call URL error", dashed: "true",
|
||
style: {width: "300px", height: "272px"}},
|
||
React.createElement("div", {className: "fx-embedded"},
|
||
React.createElement(CallFailedView, {dispatcher: dispatcher, emailLinkError: true,
|
||
outgoing: true,
|
||
store: conversationStore})
|
||
)
|
||
)
|
||
),
|
||
|
||
React.createElement(Section, {name: "OngoingConversationView"},
|
||
React.createElement(FramedExample, {width: 298, height: 254,
|
||
summary: "Desktop ongoing conversation window"},
|
||
React.createElement("div", {className: "fx-embedded"},
|
||
React.createElement(OngoingConversationView, {
|
||
dispatcher: dispatcher,
|
||
video: {enabled: true},
|
||
audio: {enabled: true},
|
||
localPosterUrl: "sample-img/video-screen-local.png",
|
||
remotePosterUrl: "sample-img/video-screen-remote.png",
|
||
remoteVideoEnabled: true,
|
||
mediaConnected: true})
|
||
)
|
||
),
|
||
|
||
React.createElement(FramedExample, {width: 800, height: 600,
|
||
summary: "Desktop ongoing conversation window large"},
|
||
React.createElement("div", {className: "fx-embedded"},
|
||
React.createElement(OngoingConversationView, {
|
||
dispatcher: dispatcher,
|
||
video: {enabled: true},
|
||
audio: {enabled: true},
|
||
localPosterUrl: "sample-img/video-screen-local.png",
|
||
remotePosterUrl: "sample-img/video-screen-remote.png",
|
||
remoteVideoEnabled: true,
|
||
mediaConnected: true})
|
||
)
|
||
),
|
||
|
||
React.createElement(FramedExample, {width: 298, height: 254,
|
||
summary: "Desktop ongoing conversation window - local face mute"},
|
||
React.createElement("div", {className: "fx-embedded"},
|
||
React.createElement(OngoingConversationView, {
|
||
dispatcher: dispatcher,
|
||
video: {enabled: false},
|
||
audio: {enabled: true},
|
||
remoteVideoEnabled: true,
|
||
remotePosterUrl: "sample-img/video-screen-remote.png",
|
||
mediaConnected: true})
|
||
)
|
||
),
|
||
|
||
React.createElement(FramedExample, {width: 298, height: 254,
|
||
summary: "Desktop ongoing conversation window - remote face mute"},
|
||
React.createElement("div", {className: "fx-embedded"},
|
||
React.createElement(OngoingConversationView, {
|
||
dispatcher: dispatcher,
|
||
video: {enabled: true},
|
||
audio: {enabled: true},
|
||
remoteVideoEnabled: false,
|
||
localPosterUrl: "sample-img/video-screen-local.png",
|
||
mediaConnected: true})
|
||
)
|
||
)
|
||
|
||
),
|
||
|
||
React.createElement(Section, {name: "FeedbackView"},
|
||
React.createElement("p", {className: "note"},
|
||
React.createElement("strong", null, "Note:"), " For the useable demo, you can access submitted data at ",
|
||
React.createElement("a", {href: "https://input.allizom.org/"}, "input.allizom.org"), "."
|
||
),
|
||
React.createElement(Example, {summary: "Default (useable demo)", dashed: "true", style: {width: "300px", height: "272px"}},
|
||
React.createElement(FeedbackView, {feedbackStore: feedbackStore})
|
||
),
|
||
React.createElement(Example, {summary: "Detailed form", dashed: "true", style: {width: "300px", height: "272px"}},
|
||
React.createElement(FeedbackView, {feedbackStore: feedbackStore, feedbackState: FEEDBACK_STATES.DETAILS})
|
||
),
|
||
React.createElement(Example, {summary: "Thank you!", dashed: "true", style: {width: "300px", height: "272px"}},
|
||
React.createElement(FeedbackView, {feedbackStore: feedbackStore, feedbackState: FEEDBACK_STATES.SENT})
|
||
)
|
||
),
|
||
|
||
React.createElement(Section, {name: "AlertMessages"},
|
||
React.createElement(Example, {summary: "Various alerts"},
|
||
React.createElement("div", {className: "alert alert-warning"},
|
||
React.createElement("button", {className: "close"}),
|
||
React.createElement("p", {className: "message"},
|
||
"The person you were calling has ended the conversation."
|
||
)
|
||
),
|
||
React.createElement("br", null),
|
||
React.createElement("div", {className: "alert alert-error"},
|
||
React.createElement("button", {className: "close"}),
|
||
React.createElement("p", {className: "message"},
|
||
"The person you were calling has ended the conversation."
|
||
)
|
||
)
|
||
)
|
||
),
|
||
|
||
React.createElement(Section, {name: "UnsupportedBrowserView"},
|
||
React.createElement(Example, {summary: "Standalone Unsupported Browser"},
|
||
React.createElement("div", {className: "standalone"},
|
||
React.createElement(UnsupportedBrowserView, {isFirefox: false})
|
||
)
|
||
)
|
||
),
|
||
|
||
React.createElement(Section, {name: "UnsupportedDeviceView"},
|
||
React.createElement(Example, {summary: "Standalone Unsupported Device"},
|
||
React.createElement("div", {className: "standalone"},
|
||
React.createElement(UnsupportedDeviceView, {platform: "ios"})
|
||
)
|
||
)
|
||
),
|
||
|
||
React.createElement(Section, {name: "DesktopRoomConversationView"},
|
||
React.createElement(FramedExample, {width: 298, height: 254,
|
||
summary: "Desktop room conversation (invitation)"},
|
||
React.createElement("div", {className: "fx-embedded"},
|
||
React.createElement(DesktopRoomConversationView, {
|
||
roomStore: roomStore,
|
||
dispatcher: dispatcher,
|
||
mozLoop: navigator.mozLoop,
|
||
localPosterUrl: "sample-img/video-screen-local.png",
|
||
roomState: ROOM_STATES.INIT})
|
||
)
|
||
),
|
||
|
||
React.createElement(FramedExample, {width: 298, height: 254,
|
||
summary: "Desktop room conversation"},
|
||
React.createElement("div", {className: "fx-embedded"},
|
||
React.createElement(DesktopRoomConversationView, {
|
||
roomStore: roomStore,
|
||
dispatcher: dispatcher,
|
||
mozLoop: navigator.mozLoop,
|
||
localPosterUrl: "sample-img/video-screen-local.png",
|
||
remotePosterUrl: "sample-img/video-screen-remote.png",
|
||
roomState: ROOM_STATES.HAS_PARTICIPANTS})
|
||
)
|
||
),
|
||
|
||
React.createElement(FramedExample, {width: 298, height: 254,
|
||
summary: "Desktop room conversation local face-mute"},
|
||
React.createElement("div", {className: "fx-embedded"},
|
||
React.createElement(DesktopRoomConversationView, {
|
||
roomStore: desktopLocalFaceMuteRoomStore,
|
||
dispatcher: dispatcher,
|
||
mozLoop: navigator.mozLoop,
|
||
remotePosterUrl: "sample-img/video-screen-remote.png"})
|
||
)
|
||
),
|
||
|
||
React.createElement(FramedExample, {width: 298, height: 254,
|
||
summary: "Desktop room conversation remote face-mute"},
|
||
React.createElement("div", {className: "fx-embedded"},
|
||
React.createElement(DesktopRoomConversationView, {
|
||
roomStore: desktopRemoteFaceMuteRoomStore,
|
||
dispatcher: dispatcher,
|
||
mozLoop: navigator.mozLoop,
|
||
localPosterUrl: "sample-img/video-screen-local.png"})
|
||
)
|
||
)
|
||
),
|
||
|
||
React.createElement(Section, {name: "StandaloneRoomView"},
|
||
React.createElement(FramedExample, {width: 644, height: 483,
|
||
summary: "Standalone room conversation (ready)"},
|
||
React.createElement("div", {className: "standalone"},
|
||
React.createElement(StandaloneRoomView, {
|
||
dispatcher: dispatcher,
|
||
activeRoomStore: readyRoomStore,
|
||
roomState: ROOM_STATES.READY,
|
||
isFirefox: true})
|
||
)
|
||
),
|
||
|
||
React.createElement(FramedExample, {width: 644, height: 483,
|
||
summary: "Standalone room conversation (joined)",
|
||
onContentsRendered: joinedRoomStore.forcedUpdate},
|
||
React.createElement("div", {className: "standalone"},
|
||
React.createElement(StandaloneRoomView, {
|
||
dispatcher: dispatcher,
|
||
activeRoomStore: joinedRoomStore,
|
||
localPosterUrl: "sample-img/video-screen-local.png",
|
||
isFirefox: true})
|
||
)
|
||
),
|
||
|
||
React.createElement(FramedExample, {width: 644, height: 483,
|
||
onContentsRendered: updatingActiveRoomStore.forcedUpdate,
|
||
summary: "Standalone room conversation (has-participants, 644x483)"},
|
||
React.createElement("div", {className: "standalone"},
|
||
React.createElement(StandaloneRoomView, {
|
||
dispatcher: dispatcher,
|
||
activeRoomStore: updatingActiveRoomStore,
|
||
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
||
isFirefox: true,
|
||
localPosterUrl: "sample-img/video-screen-local.png",
|
||
remotePosterUrl: "sample-img/video-screen-remote.png"})
|
||
)
|
||
),
|
||
|
||
React.createElement(FramedExample, {width: 644, height: 483,
|
||
onContentsRendered: localFaceMuteRoomStore.forcedUpdate,
|
||
summary: "Standalone room conversation (local face mute, has-participants, 644x483)"},
|
||
React.createElement("div", {className: "standalone"},
|
||
React.createElement(StandaloneRoomView, {
|
||
dispatcher: dispatcher,
|
||
activeRoomStore: localFaceMuteRoomStore,
|
||
isFirefox: true,
|
||
localPosterUrl: "sample-img/video-screen-local.png",
|
||
remotePosterUrl: "sample-img/video-screen-remote.png"})
|
||
)
|
||
),
|
||
|
||
React.createElement(FramedExample, {width: 644, height: 483,
|
||
onContentsRendered: remoteFaceMuteRoomStore.forcedUpdate,
|
||
summary: "Standalone room conversation (remote face mute, has-participants, 644x483)"},
|
||
React.createElement("div", {className: "standalone"},
|
||
React.createElement(StandaloneRoomView, {
|
||
dispatcher: dispatcher,
|
||
activeRoomStore: remoteFaceMuteRoomStore,
|
||
isFirefox: true,
|
||
localPosterUrl: "sample-img/video-screen-local.png",
|
||
remotePosterUrl: "sample-img/video-screen-remote.png"})
|
||
)
|
||
),
|
||
|
||
React.createElement(FramedExample, {width: 800, height: 660,
|
||
onContentsRendered: updatingSharingRoomStore.forcedUpdate,
|
||
summary: "Standalone room convo (has-participants, receivingScreenShare, 800x660)"},
|
||
React.createElement("div", {className: "standalone"},
|
||
React.createElement(StandaloneRoomView, {
|
||
dispatcher: dispatcher,
|
||
activeRoomStore: updatingSharingRoomStore,
|
||
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
||
isFirefox: true,
|
||
localPosterUrl: "sample-img/video-screen-local.png",
|
||
remotePosterUrl: "sample-img/video-screen-remote.png",
|
||
screenSharePosterUrl: "sample-img/video-screen-terminal.png"}
|
||
)
|
||
)
|
||
),
|
||
|
||
React.createElement(FramedExample, {width: 644, height: 483,
|
||
summary: "Standalone room conversation (full - FFx user)"},
|
||
React.createElement("div", {className: "standalone"},
|
||
React.createElement(StandaloneRoomView, {
|
||
dispatcher: dispatcher,
|
||
activeRoomStore: fullActiveRoomStore,
|
||
isFirefox: true})
|
||
)
|
||
),
|
||
|
||
React.createElement(FramedExample, {width: 644, height: 483,
|
||
summary: "Standalone room conversation (full - non FFx user)"},
|
||
React.createElement("div", {className: "standalone"},
|
||
React.createElement(StandaloneRoomView, {
|
||
dispatcher: dispatcher,
|
||
activeRoomStore: fullActiveRoomStore,
|
||
isFirefox: false})
|
||
)
|
||
),
|
||
|
||
React.createElement(FramedExample, {width: 644, height: 483,
|
||
summary: "Standalone room conversation (feedback)"},
|
||
React.createElement("div", {className: "standalone"},
|
||
React.createElement(StandaloneRoomView, {
|
||
dispatcher: dispatcher,
|
||
activeRoomStore: endedRoomStore,
|
||
feedbackStore: feedbackStore,
|
||
isFirefox: false})
|
||
)
|
||
),
|
||
|
||
React.createElement(FramedExample, {width: 644, height: 483,
|
||
summary: "Standalone room conversation (failed)"},
|
||
React.createElement("div", {className: "standalone"},
|
||
React.createElement(StandaloneRoomView, {
|
||
dispatcher: dispatcher,
|
||
activeRoomStore: failedRoomStore,
|
||
isFirefox: false})
|
||
)
|
||
)
|
||
),
|
||
|
||
React.createElement(Section, {name: "SVG icons preview", className: "svg-icons"},
|
||
React.createElement(Example, {summary: "10x10"},
|
||
React.createElement(SVGIcons, {size: "10x10"})
|
||
),
|
||
React.createElement(Example, {summary: "14x14"},
|
||
React.createElement(SVGIcons, {size: "14x14"})
|
||
),
|
||
React.createElement(Example, {summary: "16x16"},
|
||
React.createElement(SVGIcons, {size: "16x16"})
|
||
)
|
||
)
|
||
|
||
)
|
||
);
|
||
}
|
||
});
|
||
|
||
window.addEventListener("DOMContentLoaded", function() {
|
||
try {
|
||
React.renderComponent(React.createElement(App, null), document.getElementById("main"));
|
||
|
||
for (var listener of visibilityListeners) {
|
||
listener({target: {hidden: false}});
|
||
}
|
||
} catch(err) {
|
||
console.error(err);
|
||
uncaughtError = err;
|
||
}
|
||
|
||
// Wait until all the FramedExamples have been fully loaded.
|
||
setTimeout(function waitForQueuedFrames() {
|
||
if (window.queuedFrames.length != 0) {
|
||
setTimeout(waitForQueuedFrames, 500);
|
||
return;
|
||
}
|
||
// Put the title back, in case views changed it.
|
||
document.title = "Loop UI Components Showcase";
|
||
|
||
// This simulates the mocha layout for errors which means we can run
|
||
// this alongside our other unit tests but use the same harness.
|
||
if (uncaughtError) {
|
||
$("#results").append("<div class='failures'><em>1</em></div>");
|
||
$("#results").append("<li class='test fail'>" +
|
||
"<h2>Errors rendering UI-Showcase</h2>" +
|
||
"<pre class='error'>" + uncaughtError + "\n" + uncaughtError.stack + "</pre>" +
|
||
"</li>");
|
||
} else {
|
||
$("#results").append("<div class='failures'><em>0</em></div>");
|
||
}
|
||
$("#results").append("<p id='complete'>Complete.</p>");
|
||
}, 1000);
|
||
});
|
||
|
||
})();
|