Comparar commits
30 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| d6da5c217e | |||
| 26af2b97c4 | |||
| 47ec163d10 | |||
| 9871b696ee | |||
| 9eb372e155 | |||
| 01691684b1 | |||
| 2f4d3aea65 | |||
| f1d622897f | |||
| a845a1b9a0 | |||
| f6c03beb27 | |||
| ee59715b18 | |||
| fc1970d3bc | |||
| a3d831af9c | |||
| ae0c381dec | |||
| 0a117a20fb | |||
| 27a9c25584 | |||
| fd3fdcd8f2 | |||
| 8387176029 | |||
| 9bccf83565 | |||
| d3812e3a15 | |||
| 8cc2a0e6a4 | |||
| d2dea6d67c | |||
| e627a7e51b | |||
| 07f2389b4e | |||
| fdd0768f38 | |||
| e1e366ac55 | |||
| 671f874797 | |||
| 3d2753aea1 | |||
| 59ab53a553 | |||
| 1ddcef660c |
+25
-1
@@ -1,4 +1,28 @@
|
||||
v0.6.0 / 2014-01-28
|
||||
v0.7.1 / 2014-03-18
|
||||
===
|
||||
- fix emoticons
|
||||
- fix unique message id
|
||||
|
||||
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
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "jsxc",
|
||||
"version": "0.6.0",
|
||||
"version": "0.7.1",
|
||||
"description": "Real-time chat app",
|
||||
"homepage": "http://jsxc.org/",
|
||||
"license": "MIT",
|
||||
|
||||
+590
-209
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+58
-13
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* jsxc v0.6.0 - 2014-02-28
|
||||
* jsxc v0.7.1 - 2014-03-18
|
||||
*
|
||||
* 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.1
|
||||
*/
|
||||
|
||||
/* 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));
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
+587
-206
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+56
-11
@@ -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));
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário