Bug 1000237 Standalone UI for link clickers needs "call being processed" visual notification. r=nperriault
This commit is contained in:
@@ -135,6 +135,7 @@ p {
|
||||
background-color: #f0ad4e;
|
||||
}
|
||||
|
||||
.btn-cancel,
|
||||
.btn-error,
|
||||
.btn-hangup,
|
||||
.btn-error + .btn-chevron {
|
||||
@@ -142,6 +143,7 @@ p {
|
||||
border: 1px solid #d74345;
|
||||
}
|
||||
|
||||
.btn-cancel:hover,
|
||||
.btn-error:hover,
|
||||
.btn-hangup:hover,
|
||||
.btn-error + .btn-chevron:hover {
|
||||
@@ -149,6 +151,7 @@ p {
|
||||
border: 1px solid #c53436;
|
||||
}
|
||||
|
||||
.btn-cancel:active,
|
||||
.btn-error:active,
|
||||
.btn-hangup:active,
|
||||
.btn-error + .btn-chevron:active {
|
||||
|
||||
@@ -51,18 +51,6 @@ loop.shared.models = (function(l10n) {
|
||||
*/
|
||||
session: undefined,
|
||||
|
||||
/**
|
||||
* Pending call timeout value.
|
||||
* @type {Number}
|
||||
*/
|
||||
pendingCallTimeout: undefined,
|
||||
|
||||
/**
|
||||
* Pending call timer.
|
||||
* @type {Number}
|
||||
*/
|
||||
_pendingCallTimer: undefined,
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
@@ -71,10 +59,6 @@ loop.shared.models = (function(l10n) {
|
||||
* Required:
|
||||
* - {OT} sdk: OT SDK object.
|
||||
*
|
||||
* Optional:
|
||||
* - {Number} pendingCallTimeout: Pending call timeout in milliseconds
|
||||
* (default: 20000).
|
||||
*
|
||||
* @param {Object} attributes Attributes object.
|
||||
* @param {Object} options Options object.
|
||||
*/
|
||||
@@ -84,10 +68,6 @@ loop.shared.models = (function(l10n) {
|
||||
throw new Error("missing required sdk");
|
||||
}
|
||||
this.sdk = options.sdk;
|
||||
this.pendingCallTimeout = options.pendingCallTimeout || 20000;
|
||||
|
||||
// Ensure that any pending call timer is cleared on disconnect/error
|
||||
this.on("session:ended session:error", this._clearPendingCallTimer, this);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -112,20 +92,6 @@ loop.shared.models = (function(l10n) {
|
||||
* server for the outgoing call.
|
||||
*/
|
||||
outgoing: function(sessionData) {
|
||||
this._clearPendingCallTimer();
|
||||
|
||||
// Outgoing call has never reached destination, closing - see bug 1020448
|
||||
function handleOutgoingCallTimeout() {
|
||||
/*jshint validthis:true */
|
||||
if (!this.get("ongoing")) {
|
||||
this.trigger("timeout").endSession();
|
||||
}
|
||||
}
|
||||
|
||||
// Setup pending call timeout.
|
||||
this._pendingCallTimer = setTimeout(
|
||||
handleOutgoingCallTimeout.bind(this), this.pendingCallTimeout);
|
||||
|
||||
this.setOutgoingSessionData(sessionData);
|
||||
this.trigger("call:outgoing");
|
||||
},
|
||||
@@ -278,15 +244,6 @@ loop.shared.models = (function(l10n) {
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Clears current pending call timer, if any.
|
||||
*/
|
||||
_clearPendingCallTimer: function() {
|
||||
if (this._pendingCallTimer) {
|
||||
clearTimeout(this._pendingCallTimer);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Manages connection status
|
||||
* triggers apropriate event for connection error/success
|
||||
|
||||
@@ -148,6 +148,18 @@ loop.CallConnectionWebSocket = (function() {
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Notifies the server that the outgoing call is cancelled by the
|
||||
* user.
|
||||
*/
|
||||
cancel: function() {
|
||||
this._send({
|
||||
messageType: "action",
|
||||
event: "terminate",
|
||||
reason: "cancel"
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Sends data on the websocket.
|
||||
*
|
||||
@@ -206,6 +218,7 @@ loop.CallConnectionWebSocket = (function() {
|
||||
this._completeConnection();
|
||||
break;
|
||||
case "progress":
|
||||
this.trigger("progress:" + msg.state);
|
||||
this.trigger("progress", msg);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user