Comparar commits

...

25 Commits

Autor SHA1 Mensagem Data
sualko 01691684b1 build v0.7.0 2014-03-07 12:05:35 +01:00
sualko 2f4d3aea65 Add comments and translations 2014-03-07 11:43:42 +01:00
sualko f1d622897f Add translations 2014-03-07 11:42:48 +01:00
sualko a845a1b9a0 Fix fullscreen for firefox 2014-03-07 11:42:26 +01:00
sualko f6c03beb27 build 0.6.1-alpha3 2014-03-06 17:33:42 +01:00
sualko ee59715b18 implement XEP-0184 2014-03-06 17:27:57 +01:00
sualko fc1970d3bc fix storage check 2014-03-06 13:14:56 +01:00
sualko a3d831af9c reduce initial timeout 2014-03-06 12:34:13 +01:00
sualko ae0c381dec - Fix own avatar
- Add new event loaded.roster.jsxc
2014-03-06 12:27:38 +01:00
sualko 0a117a20fb Fix own avatar on slave 2014-03-06 12:00:17 +01:00
sualko 27a9c25584 Rename chief/sidekick to master/slave 2014-03-06 11:56:48 +01:00
sualko fd3fdcd8f2 minor otr changes 2014-03-06 11:06:28 +01:00
sualko 8387176029 Adjust webrtc error handling 2014-03-05 14:25:23 +01:00
sualko 9bccf83565 Add more debugging for webrtc 2014-03-05 14:24:27 +01:00
sualko d3812e3a15 Add own default avatar 2014-03-05 14:05:41 +01:00
sualko 8cc2a0e6a4 enhance otr error handling 2014-03-05 13:40:27 +01:00
sualko d2dea6d67c build 0.6.1-alpha2 2014-03-04 14:16:42 +01:00
sualko e627a7e51b Add option for default avatar 2014-03-04 14:12:46 +01:00
sualko 07f2389b4e - Add sound for notices
- Add comments
- Fix debug function
2014-03-04 12:59:40 +01:00
sualko fdd0768f38 build 0.6.1-alpha 2014-03-03 17:29:38 +01:00
sualko e1e366ac55 - add mute/unmute option
- mute if status is dnd
2014-03-03 17:27:54 +01:00
sualko 671f874797 Add sound notifications for incoming messages and calls (implements https://github.com/sualko/ojsxc/pull/13) 2014-03-03 15:34:48 +01:00
sualko 3d2753aea1 Add 2 new events (accept/reject) 2014-03-03 15:32:57 +01:00
sualko 59ab53a553 - fix friendship response dialog
- fix shared roster item removel
- update & extend hover info
- handle presence of type unsubscribed
- remove footer if offline
2014-03-03 14:14:19 +01:00
Klaus 1ddcef660c fix #13 2014-03-01 18:43:51 +01:00
11 arquivos alterados com 1352 adições e 468 exclusões
+20 -1
Ver Arquivo
@@ -1,4 +1,23 @@
v0.6.0 / 2014-01-28
v0.7.0 / 2014-03-07
===
- add sound notifications
- add support for custom default avatars
- add support for XEP-0184 (Message Delivery Receipts)
- update & extend hover info
- handle presence of type unsubscribed
- remove roster footer if offline
- enhance otr error handling
- enhance translations
- reduce initial timeout
- fix notices
- fix friendship response dialog
- fix shared roster item removel
- fix debug function
- fix webrtc bug
- fix storage check
- fix firefox fullscreen
v0.6.0 / 2014-02-28
===
- add notice stack (for e.g. friendship requests)
- add option to change presence
+1 -1
Ver Arquivo
@@ -1,6 +1,6 @@
{
"name": "jsxc",
"version": "0.6.0",
"version": "0.7.0",
"description": "Real-time chat app",
"homepage": "http://jsxc.org/",
"license": "MIT",
+589 -208
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+58 -13
Ver Arquivo
@@ -1,5 +1,5 @@
/**
* jsxc v0.6.0 - 2014-02-28
* jsxc v0.7.0 - 2014-03-07
*
* Copyright (c) 2014 Klaus Herberth <klaus@jsxc.org> <br>
* Released under the MIT license
@@ -7,7 +7,7 @@
* Please see http://jsxc.org/
*
* @author Klaus Herberth <klaus@jsxc.org>
* @version 0.6.0
* @version 0.7.0
*/
/* jsxc, Strophe, SDPUtil, getUserMediaWithConstraints, setupRTC, jQuery */
@@ -89,7 +89,7 @@ jsxc.gui.template.videoWindow = '<div class="jsxc_webrtc">\
*/
init: function() {
var self = jsxc.webrtc;
// shortcut
self.conn = jsxc.xmpp.conn;
@@ -122,6 +122,10 @@ jsxc.gui.template.videoWindow = '<div class="jsxc_webrtc">\
$(document).on('iceconnectionstatechange.jingle', $.proxy(self.onIceConnectionStateChanged, self));
$(document).on('nostuncandidates.jingle', $.proxy(self.noStunCandidates, self));
$(document).on('error.jingle', function(ev, sid, error) {
jsxc.error('[JINGLE]', error);
});
if (self.conn.caps) {
$(document).on('caps.strophe', $.proxy(self.onCaps, self));
}
@@ -257,6 +261,8 @@ jsxc.gui.template.videoWindow = '<div class="jsxc_webrtc">\
var status = $('.jsxc_webrtc .jsxc_status');
var duration = (typeof d === 'undefined' || d === null) ? 4000 : d;
jsxc.debug('[Webrtc]', txt);
if (status.html()) {
// attach old messages
txt = status.html() + '<br />' + txt;
@@ -399,11 +405,14 @@ jsxc.gui.template.videoWindow = '<div class="jsxc_webrtc">\
var dialog = jsxc.gui.dialog.open(jsxc.gui.template.get('incomingCall', jsxc.jidToCid(jid)));
dialog.find('.jsxc_accept').click(function() {
$(document).trigger('accept.call.jsxc');
self.reqUserMedia();
});
dialog.find('.jsxc_reject').click(function() {
jsxc.gui.dialog.close();
$(document).trigger('reject.call.jsxc');
sess.sendTerminate('decline');
sess.terminate();
@@ -420,7 +429,7 @@ jsxc.gui.template.videoWindow = '<div class="jsxc_webrtc">\
* @param reason Reason for termination
* @param [text] Optional explanation
*/
onCallTerminated: function(event, sid, reason, text) {
onCallTerminated: function(event, sid, reason, text) {
this.setStatus('call terminated ' + sid + (reason ? (': ' + reason + ' ' + text) : ''));
if (this.localStream) {
@@ -433,7 +442,7 @@ jsxc.gui.template.videoWindow = '<div class="jsxc_webrtc">\
this.conn.jingle.localStream = null;
this.localStream = null;
this.remoteStream = null;
$('#jsxc_windowList > ul').prepend($('#jsxc_dialog .jsxc_chatarea > ul > li').detach());
$(document).off('cleanup.dialog.jsxc');
@@ -581,8 +590,6 @@ jsxc.gui.template.videoWindow = '<div class="jsxc_webrtc">\
return;
}
self.conn.jingle.terminate(null, 'init fail');
$(document).off('cleanup.dialog.jsxc');
setTimeout(function() {
jsxc.gui.showAlert("Sorry, we couldn't establish a connection. Maybe your buddy is offline.");
@@ -592,7 +599,7 @@ jsxc.gui.template.videoWindow = '<div class="jsxc_webrtc">\
self.conn.jingle.initiate(jid, self.conn.jid.toLowerCase());
},
'mediafailure.jingle': function() {
jsxc.gui.dialog.close();
}
});
@@ -713,11 +720,11 @@ jsxc.gui.template.videoWindow = '<div class="jsxc_webrtc">\
var toggleMulti = function(elem, open) {
$('#jsxc_dialog .jsxc_multi > div').not(elem).slideUp();
var opt = {
complete: jsxc.gui.dialog.resize
complete: jsxc.gui.dialog.resize
};
if (open) {
elem.slideDown(opt);
} else {
@@ -726,9 +733,9 @@ jsxc.gui.template.videoWindow = '<div class="jsxc_webrtc">\
};
var win = jsxc.gui.window.open(jsxc.jidToCid(jid));
$('#jsxc_dialog .jsxc_chatarea ul').append(win.detach());
$('#jsxc_dialog .jsxc_hangUp').click(function() {
jsxc.webrtc.hangUp();
});
@@ -791,4 +798,42 @@ jsxc.gui.template.videoWindow = '<div class="jsxc_webrtc">\
$(document).on('attached.jsxc', jsxc.webrtc.init);
}
});
$.extend(jsxc.l10n.en, {
Please_allow_access_to_microphone_and_camera: 'Please allow access to microphone and camera.',
Incoming_call: 'Incoming call',
from: 'from',
Do_you_want_to_accept_the_call_from: 'Do you want to accept the call from',
Reject: 'Reject',
Accept: 'Accept',
hang_up: 'hang up',
snapshot: 'snapshot',
mute_my_audio: 'mute my audio',
pause_my_video: 'pause my video',
fullscreen: 'fullscreen',
Info: 'Info',
Local_IP: 'Local IP',
Remote_IP: 'Remote IP',
Local_Fingerprint: 'Local fingerprint',
Remote_Fingerprint: 'Remote fingerprint',
});
$.extend(jsxc.l10n.de, {
Please_allow_access_to_microphone_and_camera: 'Bitte erlaube den Zugriff auf Kamera und Mikrofon.',
Incoming_call: 'Eingehender Anruf',
from: 'von',
Do_you_want_to_accept_the_call_from: 'Möchtest Du den Anruf annehmen von',
Reject: 'Ablehnen',
Accept: 'Annehmen',
hang_up: 'Auflegen',
snapshot: 'Schnappschuss',
mute_my_audio: 'Mein Ton aus',
pause_my_video: 'Mein Video pausieren',
fullscreen: 'Vollbild',
Info: 'Info',
Local_IP: 'Lokale IP',
Remote_IP: 'Remote IP',
Local_Fingerprint: 'Lokaler Fingerprint',
Remote_Fingerprint: 'Remote Fingerprint',
});
}(jQuery));
+9 -8
Ver Arquivo
@@ -14,15 +14,15 @@
var doc = document.documentElement;
return ('requestFullscreen' in doc) ||
('mozRequestFullscreen' in doc && document.mozFullscreenEnabled) ||
('mozRequestFullScreen' in doc && document.mozFullScreenEnabled) ||
('webkitRequestFullscreen' in doc);
}
function requestFullscreen(elem) {
if (elem.requestFullscreen) {
elem.requestFullscreen();
} else if (elem.mozRequestFullscreen) {
elem.mozRequestFullscreen();
} else if (elem.mozRequestFullScreen) {
elem.mozRequestFullScreen();
} else if (elem.webkitRequestFullscreen) {
elem.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
}
@@ -38,7 +38,7 @@
function cancelFullscreen() {
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.mozCancelFullscreen) {
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.webkitCancelFullScreen) {
document.webkitCancelFullScreen();
@@ -61,16 +61,17 @@
var self = this;
$(self).on('fullscreenerror mozfullscreenerror webkitfullscreenerror msfullscreenerror', function() {
// Chrome trigger event on self, Firefox on document
$(self).add(document).on('fullscreenerror mozfullscreenerror webkitfullscreenerror msfullscreenerror', function() {
$(document).trigger('error.fullscreen');
});
$(self).on('fullscreenchange mozfullscreenchange webkitfullscreenchange msfullscreenchange', function() {
if (fullscreenStatus()){
$(self).add(document).on('fullscreenchange mozfullscreenchange webkitfullscreenchange msfullscreenchange', function() {
if (fullscreenStatus()){
$(document).trigger('enabled.fullscreen');
}else{
$(document).trigger('disabled.fullscreen');
$(self).off('fullscreenchange mozfullscreenchange webkitfullscreenchange msfullscreenchange');
$(self).add(document).off('fullscreenchange mozfullscreenchange webkitfullscreenchange msfullscreenchange');
}
});
+10 -7
Ver Arquivo
@@ -2089,7 +2089,7 @@
})
}
OTR.prototype.io = function (msg) {
OTR.prototype.io = function (msg, uid) {
// buffer
this.outgoing = this.outgoing.concat(msg)
@@ -2099,7 +2099,7 @@
if (!first) {
if (!self.outgoing.length) return
var msg = self.outgoing.shift()
self.trigger('io', [msg])
self.trigger('io', [msg, uid])
}
setTimeout(send, first ? 0 : self.send_interval)
}(true))
@@ -2405,17 +2405,17 @@
this.trigger('status', [CONST.STATUS_SEND_QUERY])
}
OTR.prototype.sendMsg = function (msg) {
OTR.prototype.sendMsg = function (msg, uid) {
if ( this.REQUIRE_ENCRYPTION ||
this.msgstate !== CONST.MSGSTATE_PLAINTEXT
) {
msg = CryptoJS.enc.Utf8.parse(msg)
msg = msg.toString(CryptoJS.enc.Latin1)
}
this._sendMsg(msg)
this._sendMsg(msg, null, uid)
}
OTR.prototype._sendMsg = function (msg, internal) {
OTR.prototype._sendMsg = function (msg, internal, uid) {
if (!internal) { // a user or sm msg
switch (this.msgstate) {
@@ -2440,7 +2440,7 @@
}
}
if (msg) this.io(msg)
if (msg) this.io(msg, uid)
}
OTR.prototype.receiveMsg = function (msg) {
@@ -2463,7 +2463,10 @@
case 'data':
if ( msg.version === CONST.OTR_VERSION_3 &&
this.checkInstanceTags(msg.instance_tags)
) return // ignore
) {
this.error('Unknown instance tag.')
return // ignore
}
msg.msg = this.handleDataMsg(msg)
msg.encrypted = true
break
+7 -3
Ver Arquivo
@@ -119,9 +119,13 @@
return null;
},
hasFeatureByJid: function(jid, feature) {
if (this._jidVerIndex[jid]) {
var length = ($.isArray(feature)) ? feature.length : 1;
for (i = 0; i < length; i++) {
if (this._jidVerIndex[jid] && feature !== null && typeof feature !== 'undefined') {
if(!$.isArray(feature)){
feature = $.makeArray(feature);
};
var i;
for (i = 0; i < feature.length; i++) {
if (this._knownCapabilities[this._jidVerIndex[jid]]['features'].indexOf(feature[i]) < 0)
return false;
}
+586 -205
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+56 -11
Ver Arquivo
@@ -77,7 +77,7 @@ jsxc.gui.template.videoWindow = '<div class="jsxc_webrtc">\
*/
init: function() {
var self = jsxc.webrtc;
// shortcut
self.conn = jsxc.xmpp.conn;
@@ -110,6 +110,10 @@ jsxc.gui.template.videoWindow = '<div class="jsxc_webrtc">\
$(document).on('iceconnectionstatechange.jingle', $.proxy(self.onIceConnectionStateChanged, self));
$(document).on('nostuncandidates.jingle', $.proxy(self.noStunCandidates, self));
$(document).on('error.jingle', function(ev, sid, error) {
jsxc.error('[JINGLE]', error);
});
if (self.conn.caps) {
$(document).on('caps.strophe', $.proxy(self.onCaps, self));
}
@@ -245,6 +249,8 @@ jsxc.gui.template.videoWindow = '<div class="jsxc_webrtc">\
var status = $('.jsxc_webrtc .jsxc_status');
var duration = (typeof d === 'undefined' || d === null) ? 4000 : d;
jsxc.debug('[Webrtc]', txt);
if (status.html()) {
// attach old messages
txt = status.html() + '<br />' + txt;
@@ -387,11 +393,14 @@ jsxc.gui.template.videoWindow = '<div class="jsxc_webrtc">\
var dialog = jsxc.gui.dialog.open(jsxc.gui.template.get('incomingCall', jsxc.jidToCid(jid)));
dialog.find('.jsxc_accept').click(function() {
$(document).trigger('accept.call.jsxc');
self.reqUserMedia();
});
dialog.find('.jsxc_reject').click(function() {
jsxc.gui.dialog.close();
$(document).trigger('reject.call.jsxc');
sess.sendTerminate('decline');
sess.terminate();
@@ -408,7 +417,7 @@ jsxc.gui.template.videoWindow = '<div class="jsxc_webrtc">\
* @param reason Reason for termination
* @param [text] Optional explanation
*/
onCallTerminated: function(event, sid, reason, text) {
onCallTerminated: function(event, sid, reason, text) {
this.setStatus('call terminated ' + sid + (reason ? (': ' + reason + ' ' + text) : ''));
if (this.localStream) {
@@ -421,7 +430,7 @@ jsxc.gui.template.videoWindow = '<div class="jsxc_webrtc">\
this.conn.jingle.localStream = null;
this.localStream = null;
this.remoteStream = null;
$('#jsxc_windowList > ul').prepend($('#jsxc_dialog .jsxc_chatarea > ul > li').detach());
$(document).off('cleanup.dialog.jsxc');
@@ -569,8 +578,6 @@ jsxc.gui.template.videoWindow = '<div class="jsxc_webrtc">\
return;
}
self.conn.jingle.terminate(null, 'init fail');
$(document).off('cleanup.dialog.jsxc');
setTimeout(function() {
jsxc.gui.showAlert("Sorry, we couldn't establish a connection. Maybe your buddy is offline.");
@@ -580,7 +587,7 @@ jsxc.gui.template.videoWindow = '<div class="jsxc_webrtc">\
self.conn.jingle.initiate(jid, self.conn.jid.toLowerCase());
},
'mediafailure.jingle': function() {
jsxc.gui.dialog.close();
}
});
@@ -701,11 +708,11 @@ jsxc.gui.template.videoWindow = '<div class="jsxc_webrtc">\
var toggleMulti = function(elem, open) {
$('#jsxc_dialog .jsxc_multi > div').not(elem).slideUp();
var opt = {
complete: jsxc.gui.dialog.resize
complete: jsxc.gui.dialog.resize
};
if (open) {
elem.slideDown(opt);
} else {
@@ -714,9 +721,9 @@ jsxc.gui.template.videoWindow = '<div class="jsxc_webrtc">\
};
var win = jsxc.gui.window.open(jsxc.jidToCid(jid));
$('#jsxc_dialog .jsxc_chatarea ul').append(win.detach());
$('#jsxc_dialog .jsxc_hangUp').click(function() {
jsxc.webrtc.hangUp();
});
@@ -779,4 +786,42 @@ jsxc.gui.template.videoWindow = '<div class="jsxc_webrtc">\
$(document).on('attached.jsxc', jsxc.webrtc.init);
}
});
$.extend(jsxc.l10n.en, {
Please_allow_access_to_microphone_and_camera: 'Please allow access to microphone and camera.',
Incoming_call: 'Incoming call',
from: 'from',
Do_you_want_to_accept_the_call_from: 'Do you want to accept the call from',
Reject: 'Reject',
Accept: 'Accept',
hang_up: 'hang up',
snapshot: 'snapshot',
mute_my_audio: 'mute my audio',
pause_my_video: 'pause my video',
fullscreen: 'fullscreen',
Info: 'Info',
Local_IP: 'Local IP',
Remote_IP: 'Remote IP',
Local_Fingerprint: 'Local fingerprint',
Remote_Fingerprint: 'Remote fingerprint',
});
$.extend(jsxc.l10n.de, {
Please_allow_access_to_microphone_and_camera: 'Bitte erlaube den Zugriff auf Kamera und Mikrofon.',
Incoming_call: 'Eingehender Anruf',
from: 'von',
Do_you_want_to_accept_the_call_from: 'Möchtest Du den Anruf annehmen von',
Reject: 'Ablehnen',
Accept: 'Annehmen',
hang_up: 'Auflegen',
snapshot: 'Schnappschuss',
mute_my_audio: 'Mein Ton aus',
pause_my_video: 'Mein Video pausieren',
fullscreen: 'Vollbild',
Info: 'Info',
Local_IP: 'Lokale IP',
Remote_IP: 'Remote IP',
Local_Fingerprint: 'Lokaler Fingerprint',
Remote_Fingerprint: 'Remote Fingerprint',
});
}(jQuery));
+9 -8
Ver Arquivo
@@ -14,15 +14,15 @@
var doc = document.documentElement;
return ('requestFullscreen' in doc) ||
('mozRequestFullscreen' in doc && document.mozFullscreenEnabled) ||
('mozRequestFullScreen' in doc && document.mozFullScreenEnabled) ||
('webkitRequestFullscreen' in doc);
}
function requestFullscreen(elem) {
if (elem.requestFullscreen) {
elem.requestFullscreen();
} else if (elem.mozRequestFullscreen) {
elem.mozRequestFullscreen();
} else if (elem.mozRequestFullScreen) {
elem.mozRequestFullScreen();
} else if (elem.webkitRequestFullscreen) {
elem.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
}
@@ -38,7 +38,7 @@
function cancelFullscreen() {
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.mozCancelFullscreen) {
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.webkitCancelFullScreen) {
document.webkitCancelFullScreen();
@@ -61,16 +61,17 @@
var self = this;
$(self).on('fullscreenerror mozfullscreenerror webkitfullscreenerror msfullscreenerror', function() {
// Chrome trigger event on self, Firefox on document
$(self).add(document).on('fullscreenerror mozfullscreenerror webkitfullscreenerror msfullscreenerror', function() {
$(document).trigger('error.fullscreen');
});
$(self).on('fullscreenchange mozfullscreenchange webkitfullscreenchange msfullscreenchange', function() {
if (fullscreenStatus()){
$(self).add(document).on('fullscreenchange mozfullscreenchange webkitfullscreenchange msfullscreenchange', function() {
if (fullscreenStatus()){
$(document).trigger('enabled.fullscreen');
}else{
$(document).trigger('disabled.fullscreen');
$(self).off('fullscreenchange mozfullscreenchange webkitfullscreenchange msfullscreenchange');
$(self).add(document).off('fullscreenchange mozfullscreenchange webkitfullscreenchange msfullscreenchange');
}
});
+7 -3
Ver Arquivo
@@ -119,9 +119,13 @@
return null;
},
hasFeatureByJid: function(jid, feature) {
if (this._jidVerIndex[jid]) {
var length = ($.isArray(feature)) ? feature.length : 1;
for (i = 0; i < length; i++) {
if (this._jidVerIndex[jid] && feature !== null && typeof feature !== 'undefined') {
if(!$.isArray(feature)){
feature = $.makeArray(feature);
};
var i;
for (i = 0; i < feature.length; i++) {
if (this._knownCapabilities[this._jidVerIndex[jid]]['features'].indexOf(feature[i]) < 0)
return false;
}