Compare commits

...

10 Commits
398 ... 407

Author SHA1 Message Date
George Politis
d9f7b8b6cc Adds a comment about how FF handles the video.src attribute. 2015-03-05 11:26:44 +01:00
George Politis
05bbfda5bb Adds support for FF/multistream. 2015-03-04 21:33:06 +01:00
paweldomas
e465b3ed90 Removes unnecessary error dialog when desktop sharing is started before the conference. 2015-03-04 13:58:07 +01:00
hristoterezov
1825f47ef2 Adds translation support for placeholder attributes. 2015-03-04 12:59:52 +02:00
ibauersachs
169d613ac4 Commit from translate.jitsi.org by user ibauersachs.: 135 of 135 strings translated (0 fuzzy). 2015-03-04 09:37:19 +00:00
Ingo Bauersachs
3dac5eeff5 Fix punctuation spacing 2015-03-04 10:27:44 +01:00
hristoterezov
f79651f806 Merge branch 'translation' 2015-03-04 11:06:02 +02:00
hristoterezov
6048d0a325 Fixes the html attributes for translation options. 2015-02-27 20:05:32 +02:00
hristoterezov
6f12446c99 Fixes translation of plurals. 2015-02-27 19:58:05 +02:00
hristoterezov
af682f8727 Changes the configuration of translation module to retrieve the resources synchronous. Removes the default values. 2015-02-26 17:35:35 +02:00
22 changed files with 18310 additions and 17321 deletions

View File

@@ -19,7 +19,7 @@
<script src="libs/popover.js?v=1"></script><!-- bootstrap tooltip lib -->
<script src="libs/toastr.js?v=1"></script><!-- notifications lib -->
<script src="interface_config.js?v=5"></script>
<script src="libs/app.bundle.js?v=23"></script>
<script src="libs/app.bundle.js?v=28"></script>
<script src="analytics.js?v=1"></script><!-- google analytics plugin -->
<link rel="stylesheet" href="css/font.css?v=6"/>
<link rel="stylesheet" href="css/toastr.css?v=1">

View File

@@ -1 +1,5 @@
{}
{
"en": "Englisch",
"bg": "Bulgarisch",
"de": "Deutsch"
}

View File

@@ -43,11 +43,11 @@
"toolbar": {
"mute": "Stummschaltung aktivieren / deaktivieren",
"videomute": "Kamera starten / stoppen",
"authenticate": "",
"authenticate": "Anmelden",
"record": "Aufnehmen",
"lock": "Raum sperren / entsperren",
"invite": "Andere einladen",
"chat": "",
"chat": "Chat öffnen / schliessen",
"prezi": "Prezi freigeben",
"etherpad": "Geteiltes Dokument",
"sharescreen": "Bildschirm freigeben",
@@ -91,14 +91,14 @@
"less": "Weniger anzeigen",
"more": "Mehr anzeigen",
"address": "Adresse:",
"remoteports": "Entfernte Ports:",
"localports": "Lokale Ports:",
"remoteport": "Entfernter Port:",
"remoteport_plural": "Entfernte Ports:",
"localport": "Lokaler Port:",
"localport_plural": "Lokale Ports:",
"localaddress": "Lokale Adresse:",
"localaddresses": "Lokale Adressen:",
"localaddress_plural": "Lokale Adressen:",
"remoteaddress": "Entfernte Adresse:",
"remoteaddresses": "Entfernte Adressen:",
"remoteaddress_plural": "Entfernte Adressen:",
"transport": "Protokoll:",
"bandwidth": "Geschätzte Bandbreite:",
"na": "Verbindungsdaten erneut anzeigen wenn die Konferenz begonnen hat"
@@ -148,6 +148,8 @@
"AuthMsg": "Für die Erstellung des Raums ist eine Authentifizierung erforderlich. <br/><b>__room__</b><br/>Sie können sich entweder anmelden oder warten bis jemand anderes die Authentifizierung vornimmt.",
"Authenticate": "Anmelden",
"Cancel": "Abbrechen",
"logoutTitle": "Abmelden",
"logoutQuestion": "Sind Sie sicher dass Sie sich abmelden und die Konferenz verlassen möchten?",
"sessTerminated": "Sitzung beendet",
"hungUp": "Anruf beendet",
"joinAgain": "Erneut beitreten",
@@ -165,6 +167,11 @@
"settings2": "Teilnehmer treten stummgeschaltet bei",
"settings3": "Nickname erforderlich<br/><br/>Setzen Sie ein Passwort um den Raum zu sperren:",
"yourPassword": "Ihr Passwort",
"Back": "Zurück"
"Back": "Zurück",
"serviceUnavailable": "Dienst nicht verfügbar",
"gracefulShutdown": "Der Dienst steht momentan wegen Wartungsarbeiten nicht zur Verfügung. Bitte versuchen Sie es später noch einmal.",
"Yes": "Ja",
"reservationError": "Fehler im Reservationssystem",
"reservationErrorMsg": "Fehler, Nummer: __code__, Nachricht: __msg__"
}
}

View File

@@ -90,20 +90,20 @@
"connectionindicator":
{
"bitrate": "Bitrate:",
"packetloss": "Packet loss: ",
"packetloss": "Packet loss:",
"resolution": "Resolution:",
"less": "Show less",
"more": "Show more",
"address": "Address:",
"remoteports": "Remote ports:",
"localports": "Local ports:",
"remoteport_plural": "Remote ports:",
"localport_plural": "Local ports:",
"remoteport": "Remote port:",
"localport": "Local port:",
"localaddress": "Local address: ",
"localaddresses": "Local addresses: ",
"remoteaddress": "Remote address: ",
"remoteaddresses": "Remote addresses: ",
"transport": "Transport: ",
"localaddress": "Local address:",
"localaddress_plural": "Local addresses:",
"remoteaddress": "Remote address:",
"remoteaddress_plural": "Remote addresses:",
"transport": "Transport:",
"bandwidth": "Estimated bandwidth:",
"na": "Come back here for connection information once the conference starts"
},
@@ -154,7 +154,7 @@
"Authenticate": "Authenticate",
"Cancel": "Cancel",
"logoutTitle" : "Logout",
"logoutQuestion" : "Are you sure you want to logout and stop the conference ?",
"logoutQuestion" : "Are you sure you want to logout and stop the conference?",
"sessTerminated": "Session Terminated",
"hungUp": "You hung up the call",
"joinAgain": "Join again",
@@ -175,6 +175,13 @@
"yourPassword": "your password",
"Back": "Back",
"serviceUnavailable": "Service unavailable",
"gracefulShutdown": "Our service is currently down for maintenance. Please try again later."
"gracefulShutdown": "Our service is currently down for maintenance. Please try again later.",
"Yes": "Yes",
"reservationError": "Reservation system error",
"reservationErrorMsg": "Error code: __code__, message: __msg__",
"password": "password",
"userPassword": "user password",
"token": "token"
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -33,13 +33,6 @@ function MediaStream(data, sid, ssrc, browser) {
MediaStreamType.VIDEO_TYPE : MediaStreamType.AUDIO_TYPE;
this.videoType = null;
this.muted = false;
if(browser == RTCBrowserType.RTC_BROWSER_FIREFOX)
{
if (!this.getVideoTracks)
this.getVideoTracks = function () { return []; };
if (!this.getAudioTracks)
this.getAudioTracks = function () { return []; };
}
}

View File

@@ -136,6 +136,13 @@ function RTCUtils(RTCService)
this.getUserMedia = navigator.mozGetUserMedia.bind(navigator);
this.pc_constraints = {};
this.attachMediaStream = function (element, stream) {
// srcObject is being standardized and FF will eventually
// support that unprefixed. FF also supports the
// "element.src = URL.createObjectURL(...)" combo, but that
// will be deprecated in favour of srcObject.
//
// https://groups.google.com/forum/#!topic/mozilla.dev.media/pKOiioXonJg
// https://github.com/webrtc/samples/issues/302
element[0].mozSrcObject = stream;
element[0].play();
};
@@ -317,10 +324,8 @@ RTCUtils.prototype.errorCallback = function (error) {
function (error) {
console.error('failed to obtain audio/video stream - stop',
error);
APP.UI.messageHandler.showError("dialog.error", "Error",
"dialog.failedpermissions",
"Failed to obtain permissions to use the local microphone " +
"and/or camera.");
APP.UI.messageHandler.showError("dialog.error",
"dialog.failedpermissions");
}
);
}
@@ -357,4 +362,4 @@ RTCUtils.prototype.handleLocalStream = function(stream)
module.exports = RTCUtils;
module.exports = RTCUtils;

View File

@@ -137,16 +137,18 @@ function registerListeners() {
APP.xmpp.addListener(XMPPEvents.DISPOSE_CONFERENCE, onDisposeConference);
APP.xmpp.addListener(XMPPEvents.GRACEFUL_SHUTDOWN, function () {
messageHandler.openMessageDialog(
'dialog.serviceUnavailable', 'Service unavailable',
'dialog.gracefulShutdown',
'Our service is currently down for maintenance.' +
' Please try again later.'
'dialog.serviceUnavailable',
'dialog.gracefulShutdown'
);
});
APP.xmpp.addListener(XMPPEvents.RESERVATION_ERROR, function (code, msg) {
var title = APP.translation.generateTranslatonHTML(
"dialog.reservationError");
var message = APP.translation.generateTranslatonHTML(
"dialog.reservationErrorMsg", {code: code, msg: msg});
messageHandler.openDialog(
'Reservation system error',
'Error code: ' + code + ', message: ' + msg,
title,
message,
true, {},
function (event, value, message, formVals)
{
@@ -155,14 +157,15 @@ function registerListeners() {
);
});
APP.xmpp.addListener(XMPPEvents.KICKED, function () {
messageHandler.openMessageDialog("dialog.sessTerminated", "Session Terminated",
"dialog.kickMessage", "Ouch! You have been kicked out of the meet!");
messageHandler.openMessageDialog("dialog.sessTerminated",
"dialog.kickMessage");
});
APP.xmpp.addListener(XMPPEvents.MUC_DESTROYED, function (reason) {
//FIXME: use Session Terminated from translation, but
// 'reason' text comes from XMPP packet and is not translated
var title = APP.translation.generateTranslatonHTML("dialog.sessTerminated");
messageHandler.openDialog(
"Session Terminated", reason, true, {},
title, reason, true, {},
function (event, value, message, formVals)
{
return false;
@@ -170,9 +173,8 @@ function registerListeners() {
);
});
APP.xmpp.addListener(XMPPEvents.BRIDGE_DOWN, function () {
messageHandler.showError("dialog.error","Error",
"dialog.bridgeUnavailable",
"Jitsi Videobridge is currently unavailable. Please try again later!");
messageHandler.showError("dialog.error",
"dialog.bridgeUnavailable");
});
APP.xmpp.addListener(XMPPEvents.USER_ID_CHANGED, function (from, id) {
Avatar.setUserAvatar(from, id);
@@ -417,9 +419,9 @@ function onMucLeft(jid) {
console.log('left.muc', jid);
var displayName = $('#participant_' + Strophe.getResourceFromJid(jid) +
'>.displayname').html();
messageHandler.notify(displayName,'notify.somebody', "Somebody",
messageHandler.notify(displayName,'notify.somebody',
'disconnected',
'notify.disconnected', "disconnected");
'notify.disconnected');
// Need to call this with a slight delay, otherwise the element couldn't be
// found for some reason.
// XXX(gp) it works fine without the timeout for me (with Chrome 38).
@@ -450,8 +452,7 @@ function onLocalRoleChange(jid, info, pres, isModerator)
if (isModerator) {
Authentication.closeAuthenticationWindow();
messageHandler.notify(null, "notify.me",
'Me', 'connected', "notify.moderator",
'Moderator rights granted !');
'connected', "notify.moderator");
}
}
@@ -475,9 +476,12 @@ function onPasswordReqiured(callback) {
Toolbar.lockLockButton();
var message = '<h2 data-i18n="dialog.passwordRequired">';
message += APP.translation.translateString(
"dialog.passwordRequired", null, "Password required");
"dialog.passwordRequired");
message += '</h2>' +
'<input id="lockKey" type="text" placeholder="password" autofocus>';
'<input id="lockKey" type="text" data-i18n=' +
'"[placeholder]dialog.password" placeholder="' +
APP.translation.translateString("dialog.password") +
'" autofocus>';
messageHandler.openTwoButtonDialog(null, null, null, message,
true,
@@ -498,9 +502,9 @@ function onPasswordReqiured(callback) {
);
}
function onMucEntered(jid, id, displayName) {
messageHandler.notify(displayName,'notify.somebody', "Somebody",
messageHandler.notify(displayName,'notify.somebody',
'connected',
'notify.connected', "connected");
'notify.connected');
// Add Peer's container
VideoLayout.ensurePeerContainerExists(jid,id);
@@ -516,9 +520,7 @@ function onMucRoleChanged(role, displayName) {
if (role === 'moderator') {
var messageKey, messageOptions = {};
var lDisplayName = displayName;
if (!lDisplayName) {
lDisplayName = 'Somebody';
if (!displayName) {
messageKey = "notify.grantedToUnknown";
}
else
@@ -527,9 +529,8 @@ function onMucRoleChanged(role, displayName) {
messageOptions = {to: displayName};
}
messageHandler.notify(
displayName,'notify.somebody', "Somebody",
displayName,'notify.somebody',
'connected', messageKey,
'Moderator rights granted to ' + lDisplayName + '!',
messageOptions);
}
}
@@ -641,12 +642,13 @@ UI.showLoginPopup = function(callback)
console.log('password is required');
var message = '<h2 data-i18n="dialog.passwordRequired">';
message += APP.translation.translateString(
"dialog.passwordRequired", null, "Password required");
"dialog.passwordRequired");
message += '</h2>' +
'<input id="passwordrequired.username" type="text" ' +
'placeholder="user@domain.net" autofocus>' +
'<input id="passwordrequired.password" ' +
'type="password" placeholder="user password">';
'type="password" data-i18n="[placeholder]dialog.userPassword"' +
' placeholder="user password">';
UI.messageHandler.openTwoButtonDialog(null, null, null, message,
true,
"dialog.Ok",

View File

@@ -16,16 +16,11 @@ var Authentication = {
// extract room name from 'room@muc.server.net'
var room = roomName.substr(0, roomName.indexOf('@'));
var title = APP.translation.generateTranslatonHTML("dialog.Stop",
"Stop");
var defMsg = 'Authentication is required to create room:<br/><b>' +
room +
'</b></br> You can either authenticate to create the room or ' +
'just wait for someone else to do so.';
var title = APP.translation.generateTranslatonHTML("dialog.Stop");
var msg = APP.translation.generateTranslatonHTML("dialog.AuthMsg",
defMsg, {room: room});
{room: room});
var button = APP.translation.generateTranslatonHTML(
"dialog.Authenticate", "Authenticate");
"dialog.Authenticate");
var buttons = {};
buttons.authenticate = {title: button, value: "authNow"};

View File

@@ -34,8 +34,9 @@ var Prezi = {
var myprezi = APP.xmpp.getPrezi();
if (myprezi) {
messageHandler.openTwoButtonDialog("dialog.removePreziTitle",
"Remove Prezi", "dialog.removePreziMsg",
"Are you sure you would like to remove your Prezi?",
null,
"dialog.removePreziMsg",
null,
false,
"dialog.Remove",
function(e,v,m,f) {
@@ -47,9 +48,8 @@ var Prezi = {
}
else if (preziPlayer != null) {
messageHandler.openTwoButtonDialog("dialog.sharePreziTitle",
"Share a Prezi", "dialog.sharePreziMsg",
"Another participant is already sharing a Prezi." +
"This conference allows only one Prezi at a time.",
null, "dialog.sharePreziMsg",
null,
false,
"dialog.Ok",
function(e,v,m,f) {
@@ -59,20 +59,20 @@ var Prezi = {
}
else {
var html = APP.translation.generateTranslatonHTML(
"dialog.sharePreziTitle", "Share a Prezi");
"dialog.sharePreziTitle");
var cancelButton = APP.translation.generateTranslatonHTML(
"dialog.Cancel", "Cancel");
"dialog.Cancel");
var shareButton = APP.translation.generateTranslatonHTML(
"dialog.Share", "Share");
"dialog.Share");
var backButton = APP.translation.generateTranslatonHTML(
"dialog.Back", "Back");
"dialog.Back");
var buttons = {};
var buttons1 = {};
buttons1.button1 = buttons.button1 = {title: cancelButton, value: false};
buttons.button2 = {title: shareButton, value: true};
buttons1.button2 = {title: backButton, value: true};
var linkError = APP.translation.generateTranslatonHTML(
"dialog.preziLinkError", "Please provide a correct prezi link.")
"dialog.preziLinkError");
var openPreziState = {
state0: {
html: '<h2>' + html + '</h2>' +

View File

@@ -27,6 +27,7 @@ var SettingsMenu = {
init: function () {
$("#updateSettings").before(generateLanguagesSelectBox());
APP.translation.translateElement($("#languages_selectbox"));
$('#settingsmenu>input').keyup(function(event){
if(event.keyCode === 13) {//enter
SettingsMenu.update();

View File

@@ -66,10 +66,12 @@ var buttonHandlers =
"toolbar_button_logout": function () {
// Ask for confirmation
messageHandler.openTwoButtonDialog(
"dialog.logoutTitle", "Logout",
"dialog.logoutTitle",
null,
"dialog.logoutQuestion",
"Are you sure you want to logout and stop the conference ?",
false, "Yes",
null,
false,
"dialog.Yes",
function (evt, yes) {
if (yes) {
APP.xmpp.logout(function (url) {
@@ -97,11 +99,11 @@ function hangup() {
}
var title = APP.translation.generateTranslatonHTML(
"dialog.sessTerminated", "Session Terminated");
"dialog.sessTerminated");
var msg = APP.translation.generateTranslatonHTML(
"dialog.hungUp","You hung up the call");
"dialog.hungUp");
var button = APP.translation.generateTranslatonHTML(
"dialog.joinAgain", "Join again");
"dialog.joinAgain");
var buttons = {};
buttons.joinAgain = {title: button, value: true};
@@ -125,11 +127,13 @@ function hangup() {
function toggleRecording() {
APP.xmpp.toggleRecording(function (callback) {
var msg = APP.translation.generateTranslatonHTML(
"dialog.recordingToken", "Enter recording token");
"dialog.recordingToken");
var token = APP.translation.translateString("dialog.token");
APP.UI.messageHandler.openTwoButtonDialog(null, null, null,
'<h2>' + msg + '</h2>' +
'<input id="recordingToken" type="text" ' +
'placeholder="token" autofocus>',
' data-i18n="[placeholder]dialog.token" ' +
'placeholder="' + token + '" autofocus>',
false,
"dialog.Save",
function (e, v, m, f) {
@@ -172,16 +176,13 @@ function lockRoom(lock) {
}
}, function (err) {
console.warn('setting password failed', err);
messageHandler.showError("dialog.lockTitle", 'Lock failed',
"dialog.lockMessage",
'Failed to lock conference.',
err);
messageHandler.showError("dialog.lockTitle",
"dialog.lockMessage");
Toolbar.setSharedKey('');
}, function () {
console.warn('room passwords not supported');
messageHandler.showError("dialog.warning", 'Warning',
"dialog.passwordNotSupported",
'Room passwords are currently not supported.');
messageHandler.showError("dialog.warning",
"dialog.passwordNotSupported");
Toolbar.setSharedKey('');
});
};
@@ -233,7 +234,7 @@ function callSipButtonClicked()
= config.defaultSipNumber ? config.defaultSipNumber : '';
var sipMsg = APP.translation.generateTranslatonHTML(
"dialog.sipMsg", "Enter SIP number");
"dialog.sipMsg");
messageHandler.openTwoButtonDialog(null, null, null,
'<h2>' + sipMsg + '</h2>' +
'<input id="sipNumber" type="text"' +
@@ -318,10 +319,7 @@ var Toolbar = (function (my) {
}, url);
if (!authenticationWindow) {
messageHandler.openMessageDialog(
null, null, "dialog.popupError",
"Your browser is blocking popup windows from this site." +
" Please enable popups in your browser security settings" +
" and try again.");
null, "dialog.popupError");
}
});
}
@@ -359,26 +357,16 @@ var Toolbar = (function (my) {
// Only the focus is able to set a shared key.
if (!APP.xmpp.isModerator()) {
if (sharedKey) {
messageHandler.openMessageDialog(null, null,
"dialog.passwordError",
"This conversation is currently protected by" +
" a password. Only the owner of the conference" +
" could set a password.",
false,
"Password");
messageHandler.openMessageDialog(null,
"dialog.passwordError");
} else {
messageHandler.openMessageDialog(null, null, "dialog.passwordError2",
"This conversation isn't currently protected by" +
" a password. Only the owner of the conference" +
" could set a password.",
false,
"Password");
messageHandler.openMessageDialog(null, "dialog.passwordError2");
}
} else {
if (sharedKey) {
messageHandler.openTwoButtonDialog(null, null,
"dialog.passwordCheck",
"Are you sure you would like to remove your password?",
null,
false,
"dialog.Remove",
function (e, v) {
@@ -389,12 +377,13 @@ var Toolbar = (function (my) {
});
} else {
var msg = APP.translation.generateTranslatonHTML(
"dialog.passwordMsg", "Set a password to lock your room");
"dialog.passwordMsg");
var yourPassword = APP.translation.translateString(
"dialog.yourPassword", null, "your password");
"dialog.yourPassword");
messageHandler.openTwoButtonDialog(null, null, null,
'<h2>' + msg + '</h2>' +
'<input id="lockKey" type="text"' +
' data-i18n="[placeholder]dialog.yourPassword" ' +
'placeholder="' + yourPassword + '" autofocus>',
false,
"dialog.Save",
@@ -427,7 +416,7 @@ var Toolbar = (function (my) {
inviteLink = encodeURI(roomUrl);
}
messageHandler.openTwoButtonDialog("dialog.shareLink",
"Share this link with everyone you want to invite", null,
null, null,
'<input id="inviteLinkRef" type="text" value="' +
inviteLink + '" onclick="this.select();" readonly>',
false,
@@ -455,15 +444,14 @@ var Toolbar = (function (my) {
*/
my.openSettingsDialog = function () {
var settings1 = APP.translation.generateTranslatonHTML(
"dialog.settings1", "Configure your conference");
"dialog.settings1");
var settings2 = APP.translation.generateTranslatonHTML(
"dialog.settings2", "Participants join muted");
"dialog.settings2");
var settings3 = APP.translation.generateTranslatonHTML(
"dialog.settings3", "Require nicknames<br/><br/>" +
"Set a password to lock your room:");
"dialog.settings3");
var yourPassword = APP.translation.translateString(
"dialog.yourPassword", null, "your password");
"dialog.yourPassword");
messageHandler.openTwoButtonDialog(null,
'<h2>' + settings1 + '</h2>' +

View File

@@ -7,16 +7,13 @@ var messageHandler = (function(my) {
* @param titleString the title of the message
* @param messageString the text of the message
*/
my.openMessageDialog = function(titleKey, titleString,
messageKey, messageString) {
my.openMessageDialog = function(titleKey, messageKey) {
var title = null;
if(titleKey)
{
title = APP.translation.generateTranslatonHTML(titleKey,
titleString);
title = APP.translation.generateTranslatonHTML(titleKey);
}
var message = APP.translation.generateTranslatonHTML(messageKey,
messageString);
var message = APP.translation.generateTranslatonHTML(messageKey);
$.prompt(message,
{
title: title,
@@ -43,16 +40,15 @@ var messageHandler = (function(my) {
var leftButton = APP.translation.generateTranslatonHTML(leftButtonKey);
var buttons = {};
buttons.button1 = {title: leftButton, value: true};
var cancelButton = APP.translation.generateTranslatonHTML("dialog.Cancel",
"Cancel");
var cancelButton = APP.translation.generateTranslatonHTML("dialog.Cancel");
buttons.button2 = {title: cancelButton, value: false};
var message = msgString, title = titleString;
if(titleKey)
{
title = APP.translation.generateTranslatonHTML(titleKey, titleString);
title = APP.translation.generateTranslatonHTML(titleKey);
}
if(msgKey) {
message = APP.translation.generateTranslatonHTML(msgKey, msgString);
message = APP.translation.generateTranslatonHTML(msgKey);
}
$.prompt(message, {
title: title,
@@ -76,7 +72,7 @@ var messageHandler = (function(my) {
* @param submitFunction function to be called on submit
* @param loadedFunction function to be called after the prompt is fully loaded
*/
my.openDialog = function (titleString, msgString, persistent, buttons,
my.openDialog = function (titleString, msgString, persistent, buttons,
submitFunction, loadedFunction) {
var args = {
title: titleString,
@@ -152,9 +148,8 @@ var messageHandler = (function(my) {
* @param msgString the text of the message
* @param error the error that is being reported
*/
my.openReportDialog = function(titleKey, titleString, msgKey,
msgString, error) {
my.openMessageDialog(titleKey, titleString, msgKey, msgString);
my.openReportDialog = function(titleKey, msgKey, error) {
my.openMessageDialog(titleKey, msgKey);
console.log(error);
//FIXME send the error to the server
};
@@ -164,22 +159,20 @@ var messageHandler = (function(my) {
* @param title the title of the message
* @param message the text of the messafe
*/
my.showError = function(titleKey, title, msgKey, message) {
my.showError = function(titleKey, msgKey) {
if(!titleKey) {
title = "Oops!";
titleKey = "dialog.oops";
}
if(!msgKey)
{
message = "There was some kind of error";
msgKey = "dialog.defaultError";
}
messageHandler.openMessageDialog(titleKey, title, msgKey, message);
messageHandler.openMessageDialog(titleKey, msgKey);
};
my.notify = function(displayName, displayNameKey, displayNameDefault,
cls, messageKey, messageDefault, messageArguments) {
my.notify = function(displayName, displayNameKey,
cls, messageKey, messageArguments) {
var displayNameSpan = '<span class="nickname" ';
if(displayName)
{
@@ -188,22 +181,17 @@ var messageHandler = (function(my) {
else
{
displayNameSpan += "data-i18n='" + displayNameKey +
"'>" + APP.translation.translateString(displayNameKey, null,
{defaultValue: displayNameDefault});
"'>" + APP.translation.translateString(displayNameKey);
}
displayNameSpan += "</span>";
var lMessageArguments = messageArguments;
if(!messageArguments)
lMessageArguments = {};
lMessageArguments.defaultValue = messageDefault;
toastr.info(
displayNameSpan + '<br>' +
'<span class=' + cls + ' data-i18n="' + messageKey + '"' +
(messageArguments?
" i18n-options='" + JSON.stringify(messageArguments) + "'"
" data-i18n-options='" + JSON.stringify(messageArguments) + "'"
: "") + ">" +
APP.translation.translateString(messageKey, null,
lMessageArguments) +
APP.translation.translateString(messageKey,
messageArguments) +
'</span>');
};

View File

@@ -229,47 +229,43 @@ ConnectionIndicator.prototype.generateText = function () {
}
var local_address_key = "connectionindicator." +
(data.localIP.length > 1? "localaddresses" : "localaddress");
var remote_address_key = "connectionindicator." +
(data.remoteIP.length > 1? "remoteaddresses" : "remoteaddress");
var local_address_key = "connectionindicator.localaddress";
var remote_address_key = "connectionindicator.remoteaddress";
var localTransport =
"<tr><td><span class='jitsipopover_blue' data-i18n='" +
local_address_key +"'>" +
translate(local_address_key) + "</span></td><td> " +
local_address_key +"' data-i18n-options='" +
JSON.stringify({count: data.localIP.length}) + "'>" +
translate(local_address_key, {count: data.localIP.length}) +
"</span></td><td> " +
ConnectionIndicator.getStringFromArray(data.localIP) +
"</td></tr>";
transport =
"<tr><td><span class='jitsipopover_blue' data-i18n='" +
remote_address_key + "'>" +
translate(remote_address_key) + "</span></td><td> " +
remote_address_key + "' data-i18n-options='" +
JSON.stringify({count: data.remoteIP.length}) + "'>" +
translate(remote_address_key,
{count: data.remoteIP.length}) +
"</span></td><td> " +
ConnectionIndicator.getStringFromArray(data.remoteIP) +
"</td></tr>";
var key_remote = "connectionindicator.",
key_local = "connectionindicator.";
if(this.transport.length > 1)
{
key_remote += "remoteports";
key_local += "localports";
}
else
{
key_remote += "remoteport";
key_local += "localport";
}
var key_remote = "connectionindicator.remoteport",
key_local = "connectionindicator.localport";
transport += "<tr>" +
"<td>" +
"<span class='jitsipopover_blue' data-i18n='" + key_remote +
"'>" +
translate(key_remote) + "</span></td><td>";
"' data-i18n-options='" +
JSON.stringify({count: this.transport.length}) + "'>" +
translate(key_remote, {count: this.transport.length}) +
"</span></td><td>";
localTransport += "<tr>" +
"<td>" +
"<span class='jitsipopover_blue' data-i18n='" + key_local +
"'>" +
translate(key_local) + "</span></td><td>";
"' data-i18n-options='" +
JSON.stringify({count: this.transport.length}) + "'>" +
translate(key_local, {count: this.transport.length}) +
"</span></td><td>";
transport +=
ConnectionIndicator.getStringFromArray(data.remotePort);

View File

@@ -92,9 +92,8 @@ function isUpdateRequired(minVersion, extVersion)
catch (e)
{
console.error("Failed to parse extension version", e);
APP.UI.messageHandler.showError("dialog.error", 'Error',
"dialod.detectext",
'Error when trying to detect desktopsharing extension.');
APP.UI.messageHandler.showError("dialog.error",
"dialog.detectext");
return true;
}
}
@@ -175,9 +174,8 @@ function obtainScreenFromExtension(streamCallback, failCallback) {
function (arg) {
console.log("Failed to install the extension", arg);
failCallback(arg);
APP.UI.messageHandler.showError("dialog.error", 'Error',
"dialog.failtoinstall",
'Failed to install desktop sharing extension');
APP.UI.messageHandler.showError("dialog.error",
"dialog.failtoinstall");
}
);
}

View File

@@ -2,8 +2,6 @@ var i18n = require("i18next-client");
var languages = require("../../service/translation/languages");
var Settings = require("../settings/Settings");
var DEFAULT_LANG = languages.EN;
var initialized = false;
var waitingForInit = [];
i18n.addPostProcessor("resolveAppName", function(value, key, options) {
return value.replace("__app__", interfaceConfig.APP_NAME);
@@ -15,7 +13,6 @@ var defaultOptions = {
detectLngQS: "lang",
useCookie: false,
fallbackLng: DEFAULT_LANG,
shortcutFunction: 'defaultValue',
load: "unspecific",
resGetPath: 'lang/__ns__-__lng__.json',
ns: {
@@ -26,14 +23,15 @@ var defaultOptions = {
fallbackOnNull: true,
fallbackOnEmpty: true,
useDataAttrOptions: true,
defaultValueFromContent: false,
app: interfaceConfig.APP_NAME,
getAsync: true,
getAsync: false,
defaultValueFromContent: false,
customLoad: function(lng, ns, options, done) {
var resPath = "lang/__ns__-__lng__.json";
if(lng === languages.EN)
resPath = "lang/__ns__.json";
var url = i18n.functions.applyReplacement(resPath, { lng: lng, ns: ns });
initialized = false;
i18n.functions.ajax({
url: url,
success: function(data, status, xhr) {
@@ -67,14 +65,7 @@ var defaultOptions = {
function initCompleted(t)
{
initialized = true;
$("[data-i18n]").i18n();
for(var i = 0; i < waitingForInit.length; i++)
{
var obj = waitingForInit[i];
obj.callback(i18n.t(obj.key));
}
waitingForInit = [];
}
function checkForParameter() {
@@ -92,7 +83,6 @@ function checkForParameter() {
module.exports = {
init: function (lang) {
initialized = false;
var options = defaultOptions;
@@ -113,21 +103,10 @@ module.exports = {
i18n.init(options, initCompleted);
},
translateString: function (key, cb, options) {
if(!cb)
return i18n.t(key, options);
if(initialized)
{
cb(i18n.t(key, options));
}
else
{
waitingForInit.push({"callback": cb, "key": key});
}
translateString: function (key, options) {
return i18n.t(key, options);
},
setLanguage: function (lang) {
initialized = false;
if(!lang)
lang = DEFAULT_LANG;
i18n.setLng(lang, defaultOptions, initCompleted);
@@ -138,20 +117,14 @@ module.exports = {
translateElement: function (selector) {
selector.i18n();
},
generateTranslatonHTML: function (key, defaultString, options) {
generateTranslatonHTML: function (key, options) {
var str = "<span data-i18n=\"" + key + "\"";
if(options)
{
str += " data-i18n-options=\"" + JSON.stringify(options) + "\"";
}
str += ">";
if(!options)
options = {};
if(defaultString)
{
options.defaultValue = defaultString;
}
str += this.translateString(key, null, options);
str += this.translateString(key, options);
str += "</span>";
return str;

View File

@@ -736,7 +736,7 @@ JingleSession.prototype.addSource = function (elem, fromJid) {
$(elem).each(function (idx, content) {
var name = $(content).attr('name');
var lines = '';
tmp = $(content).find('ssrc-group[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]').each(function() {
$(content).find('ssrc-group[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]').each(function() {
var semantics = this.getAttribute('semantics');
var ssrcs = $(this).find('>source').map(function () {
return this.getAttribute('ssrc');
@@ -746,7 +746,7 @@ JingleSession.prototype.addSource = function (elem, fromJid) {
lines += 'a=ssrc-group:' + semantics + ' ' + ssrcs.join(' ') + '\r\n';
}
});
tmp = $(content).find('source[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]'); // can handle both >source and >description>source
var tmp = $(content).find('source[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]'); // can handle both >source and >description>source
tmp.each(function () {
var ssrc = $(this).attr('ssrc');
if(mySdp.containsSSRC(ssrc)){
@@ -801,7 +801,7 @@ JingleSession.prototype.removeSource = function (elem, fromJid) {
$(elem).each(function (idx, content) {
var name = $(content).attr('name');
var lines = '';
tmp = $(content).find('ssrc-group[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]').each(function() {
$(content).find('ssrc-group[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]').each(function() {
var semantics = this.getAttribute('semantics');
var ssrcs = $(this).find('>source').map(function () {
return this.getAttribute('ssrc');
@@ -811,7 +811,7 @@ JingleSession.prototype.removeSource = function (elem, fromJid) {
lines += 'a=ssrc-group:' + semantics + ' ' + ssrcs.join(' ') + '\r\n';
}
});
tmp = $(content).find('source[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]'); // can handle both >source and >description>source
var tmp = $(content).find('source[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]'); // can handle both >source and >description>source
tmp.each(function () {
var ssrc = $(this).attr('ssrc');
// This should never happen, but can be useful for bug detection
@@ -1226,9 +1226,8 @@ JingleSession.onJingleFatalError = function (session, error)
{
this.service.sessionTerminated = true;
this.connection.emuc.doLeave();
APP.UI.messageHandler.showError("dialog.sorry", "Sorry",
"dialog.internalError",
"Internal application error[setRemoteDescription]");
APP.UI.messageHandler.showError("dialog.sorry",
"dialog.internalError");
}
JingleSession.prototype.setLocalDescription = function () {
@@ -1311,7 +1310,7 @@ function sendKeyframe(pc) {
}
JingleSession.prototype.remoteStreamAdded = function (data) {
JingleSession.prototype.remoteStreamAdded = function (data, times) {
var self = this;
var thessrc;
var ssrc2jid = this.connection.emuc.ssrc2jid;
@@ -1340,12 +1339,24 @@ JingleSession.prototype.remoteStreamAdded = function (data) {
// presence to arrive.
if (!ssrc2jid[thessrc]) {
// TODO(gp) limit wait duration to 1 sec.
setTimeout(function(d) {
return function() {
self.remoteStreamAdded(d);
}
}(data), 250);
if (typeof times === 'undefined')
{
times = 0;
}
if (times > 10)
{
console.warning('Waiting for jid timed out', thessrc);
}
else
{
setTimeout(function(d) {
return function() {
self.remoteStreamAdded(d, times++);
}
}(data), 250);
}
return;
}
@@ -1357,27 +1368,6 @@ JingleSession.prototype.remoteStreamAdded = function (data) {
}
}
//TODO: this code should be removed when firefox implement multistream support
if(APP.RTC.getBrowserType() == RTCBrowserType.RTC_BROWSER_FIREFOX)
{
if((JingleSession.notReceivedSSRCs.length == 0) ||
!ssrc2jid[JingleSession.notReceivedSSRCs[JingleSession.notReceivedSSRCs.length - 1]])
{
// TODO(gp) limit wait duration to 1 sec.
setTimeout(function(d) {
return function() {
self.remoteStreamAdded(d);
}
}(data), 250);
return;
}
thessrc = JingleSession.notReceivedSSRCs.pop();
if (ssrc2jid[thessrc]) {
data.peerjid = ssrc2jid[thessrc];
}
}
APP.RTC.createRemoteStream(data, this.sid, thessrc);
var isVideo = data.stream.getVideoTracks().length > 0;

View File

@@ -6,6 +6,8 @@ function TraceablePeerConnection(ice_config, constraints) {
this.stats = {};
this.statsinterval = null;
this.maxstats = 0; // limit to 300 values, i.e. 5 minutes; set to 0 to disable
var Interop = require('sdp-interop').Interop;
this.interop = new Interop();
// override as desired
this.trace = function (what, info) {
@@ -98,19 +100,39 @@ function TraceablePeerConnection(ice_config, constraints) {
};
dumpSDP = function(description) {
if (typeof description === 'undefined' || description == null) {
return '';
}
return 'type: ' + description.type + '\r\n' + description.sdp;
}
};
if (TraceablePeerConnection.prototype.__defineGetter__ !== undefined) {
TraceablePeerConnection.prototype.__defineGetter__('signalingState', function() { return this.peerconnection.signalingState; });
TraceablePeerConnection.prototype.__defineGetter__('iceConnectionState', function() { return this.peerconnection.iceConnectionState; });
TraceablePeerConnection.prototype.__defineGetter__('localDescription', function() {
var publicLocalDescription = APP.simulcast.reverseTransformLocalDescription(this.peerconnection.localDescription);
return publicLocalDescription;
this.trace('getLocalDescription::preTransform (Plan A)', dumpSDP(this.peerconnection.localDescription));
// if we're running on FF, transform to Plan B first.
var desc = this.peerconnection.localDescription;
if (navigator.mozGetUserMedia) {
desc = this.interop.toPlanB(desc);
} else {
desc = APP.simulcast.reverseTransformLocalDescription(this.peerconnection.localDescription);
}
this.trace('getLocalDescription::postTransform (Plan B)', dumpSDP(desc));
return desc;
});
TraceablePeerConnection.prototype.__defineGetter__('remoteDescription', function() {
var publicRemoteDescription = APP.simulcast.reverseTransformRemoteDescription(this.peerconnection.remoteDescription);
return publicRemoteDescription;
this.trace('getRemoteDescription::preTransform (Plan A)', dumpSDP(this.peerconnection.remoteDescription));
// if we're running on FF, transform to Plan B first.
var desc = this.peerconnection.remoteDescription;
if (navigator.mozGetUserMedia) {
desc = this.interop.toPlanB(desc);
} else {
desc = APP.simulcast.reverseTransformRemoteDescription(this.peerconnection.remoteDescription);
}
this.trace('getRemoteDescription::postTransform (Plan B)', dumpSDP(desc));
return desc;
});
}
@@ -148,9 +170,15 @@ TraceablePeerConnection.prototype.createDataChannel = function (label, opts) {
};
TraceablePeerConnection.prototype.setLocalDescription = function (description, successCallback, failureCallback) {
this.trace('setLocalDescription::preTransform (Plan B)', dumpSDP(description));
// if we're running on FF, transform to Plan A first.
if (navigator.mozGetUserMedia) {
description = this.interop.toPlanA(description);
} else {
description = APP.simulcast.transformLocalDescription(description);
}
this.trace('setLocalDescription::postTransform (Plan A)', dumpSDP(description));
var self = this;
description = APP.simulcast.transformLocalDescription(description);
this.trace('setLocalDescription', dumpSDP(description));
this.peerconnection.setLocalDescription(description,
function () {
self.trace('setLocalDescriptionOnSuccess');
@@ -169,9 +197,16 @@ TraceablePeerConnection.prototype.setLocalDescription = function (description, s
};
TraceablePeerConnection.prototype.setRemoteDescription = function (description, successCallback, failureCallback) {
this.trace('setRemoteDescription::preTransform (Plan B)', dumpSDP(description));
// if we're running on FF, transform to Plan A first.
if (navigator.mozGetUserMedia) {
description = this.interop.toPlanA(description);
}
else {
description = APP.simulcast.transformRemoteDescription(description);
}
this.trace('setRemoteDescription::postTransform (Plan A)', dumpSDP(description));
var self = this;
description = APP.simulcast.transformRemoteDescription(description);
this.trace('setRemoteDescription', dumpSDP(description));
this.peerconnection.setRemoteDescription(description,
function () {
self.trace('setRemoteDescriptionOnSuccess');
@@ -203,7 +238,12 @@ TraceablePeerConnection.prototype.createOffer = function (successCallback, failu
this.trace('createOffer', JSON.stringify(constraints, null, ' '));
this.peerconnection.createOffer(
function (offer) {
self.trace('createOfferOnSuccess', dumpSDP(offer));
self.trace('createOfferOnSuccess::preTransform (Plan A)', dumpSDP(offer));
// if we're running on FF, transform to Plan B first.
if (navigator.mozGetUserMedia) {
offer = self.interop.toPlanB(offer);
}
self.trace('createOfferOnSuccess::postTransform (Plan B)', dumpSDP(offer));
successCallback(offer);
},
function(err) {
@@ -219,8 +259,14 @@ TraceablePeerConnection.prototype.createAnswer = function (successCallback, fail
this.trace('createAnswer', JSON.stringify(constraints, null, ' '));
this.peerconnection.createAnswer(
function (answer) {
answer = APP.simulcast.transformAnswer(answer);
self.trace('createAnswerOnSuccess', dumpSDP(answer));
self.trace('createAnswerOnSuccess::preTransfom (Plan A)', dumpSDP(answer));
// if we're running on FF, transform to Plan A first.
if (navigator.mozGetUserMedia) {
answer = self.interop.toPlanB(answer);
} else {
answer = APP.simulcast.transformAnswer(answer);
}
self.trace('createAnswerOnSuccess::postTransfom (Plan B)', dumpSDP(answer));
successCallback(answer);
},
function(err) {

View File

@@ -324,9 +324,7 @@ var Moderator = {
if (!invalidSession) {
APP.UI.messageHandler.notify(
null, "notify.focus",
'Conference focus', 'disconnected', "notify.focusFail",
focusComponent + " not available - retry in " +
retrySec + " sec",
'disconnected', "notify.focusFail",
{component: focusComponent, ms: retrySec});
}
// Reset response timeout

View File

@@ -285,26 +285,18 @@ module.exports = function(XMPP, eventEmitter) {
// We're either missing Jicofo/Prosody config for anonymous
// domains or something is wrong.
// XMPP.promptLogin();
APP.UI.messageHandler.openReportDialog(null, null,
"dialog.joinError",
'Oops ! We couldn`t join the conference.' +
' There might be some problem with security' +
' configuration. Please contact service' +
' administrator.', pres);
APP.UI.messageHandler.openReportDialog(null,
"dialog.joinError", pres);
} else {
console.warn('onPresError ', pres);
APP.UI.messageHandler.openReportDialog(null, null,
APP.UI.messageHandler.openReportDialog(null,
"dialog.connectError",
'Oops! Something went wrong and we couldn`t ' +
'connect to the conference.',
pres);
}
} else {
console.warn('onPresError ', pres);
APP.UI.messageHandler.openReportDialog(null, null,
APP.UI.messageHandler.openReportDialog(null,
"dialog.connectError",
'Oops! Something went wrong and we couldn`t ' +
'connect to the conference.',
pres);
}
return true;

View File

@@ -251,9 +251,7 @@ var XMPP = {
connection.jingle.activecall.switchStreams(stream, oldStream, callback);
} else {
// We are done immediately
console.error("No conference handler");
APP.UI.messageHandler.showError("dialog.error", 'Error',
"dialog.unableToSwitch", 'Unable to switch video stream.');
console.warn("No conference handler or conference not started yet");
callback();
}
},
@@ -315,9 +313,7 @@ var XMPP = {
function (error) {
console.log('mute SLD error');
APP.UI.messageHandler.showError("dialog.error",
'Error', "dialog.SLDFailure",
'Oops! Something went wrong and we failed to ' +
'mute! (SLD Failure)');
"dialog.SLDFailure");
}
);
},
@@ -329,10 +325,8 @@ var XMPP = {
},
function (error) {
console.log('muteVideo SRD error');
APP.UI.messageHandler.showError("dialog.error", 'Error',
"dialog.SRDFailure",
'Oops! Something went wrong and we failed to stop video!' +
'(SRD Failure)');
APP.UI.messageHandler.showError("dialog.error",
"dialog.SRDFailure");
}
);

View File

@@ -17,7 +17,8 @@
"dependencies": {
"events": "*",
"pako": "*",
"i18next-client": "*"
"i18next-client": "*",
"sdp-interop": "https://github.com/jitsi/sdp-interop/tarball/master"
},
"devDependencies": {
},