Comparar commits
52 Commits
v3.0.0-beta2
...
v3.0.1
| Autor | SHA1 | Data | |
|---|---|---|---|
| a586e92af4 | |||
| 016cda5cf9 | |||
| cd74019c5e | |||
| 78ceced805 | |||
| 7dbe862fbe | |||
| b5848be9bc | |||
| 1c6e49cb37 | |||
| ce7bcad702 | |||
| 459dfc5961 | |||
| ab45a58e1d | |||
| 41b4072935 | |||
| 5129741e99 | |||
| 61d89fa0f2 | |||
| 5b9090ff09 | |||
| 7130759486 | |||
| e8562e3a4f | |||
| 09eebc6b89 | |||
| b7cfadea3c | |||
| 4beceb4cc8 | |||
| a650d269a9 | |||
| 0a02a1a336 | |||
| 65e2c5eb0b | |||
| cff6858ea6 | |||
| 596e445bdc | |||
| 0624a3c296 | |||
| 11277ee3da | |||
| 8fe228aaeb | |||
| e2eff654a3 | |||
| 9095b9f257 | |||
| 64fe5b04da | |||
| 712b5b67dd | |||
| b9f99d6b2d | |||
| af51a0a89a | |||
| 6fe2d802fd | |||
| a02f29b6f1 | |||
| 2a9cde4829 | |||
| 9764b6c67d | |||
| 2bc4b39087 | |||
| c49914a39a | |||
| 3a29d2a96c | |||
| e8881744a7 | |||
| 515bde12be | |||
| c2295e6b02 | |||
| 06e1968140 | |||
| a7f5c90d76 | |||
| d556d74011 | |||
| 91f8c5a2f1 | |||
| 53067ae9b6 | |||
| 0a75b8e121 | |||
| c3a84c88e0 | |||
| ec5b9a80f2 | |||
| 629395fb1b |
@@ -1,3 +1,71 @@
|
||||
v3.0.1 / 2016-10-28
|
||||
===
|
||||
### Enhancements
|
||||
- add room configuration in master tab
|
||||
- improve muc multi tab support
|
||||
- update/add languages: zh, pt, hu, pl, en, pt
|
||||
- use user preferred browser languages
|
||||
- remove inline styles
|
||||
|
||||
### Bug fixes
|
||||
- fix multi-tab support
|
||||
- fix uncaught type error on login
|
||||
- fix second call issue
|
||||
- fix option retrieval
|
||||
- fix auto-accept
|
||||
- fix the answer to anything
|
||||
- fix boolean muc configurations
|
||||
|
||||
### Developer changes
|
||||
- allow selector for options.logoutElement
|
||||
- attach also with parameters from options.xmpp
|
||||
|
||||
v3.0.0 / 2016-03-11
|
||||
===
|
||||
### New features
|
||||
- responsive material-like design
|
||||
- refactoring settings dialog
|
||||
- over 1600 emoticons from emojione
|
||||
- support mobile devices
|
||||
- new video call interface
|
||||
- status usable for daltonian
|
||||
- use css for animations
|
||||
- file transfer via webrtc
|
||||
- previews
|
||||
- show progress
|
||||
- use local date and time format
|
||||
- add no-video-call-possible icon
|
||||
- add disabled otr icon
|
||||
- add padlock icon to message
|
||||
- display line breaks in chat messages
|
||||
- hide avatar for connected messages (muc)
|
||||
- auto approve incoming contact request (if contact is already in our roster)
|
||||
|
||||
### Bug fixes
|
||||
- use crendential when performing turn credential ajax crossdomain call
|
||||
- update favico.js
|
||||
- update strophe.js
|
||||
- update strophe.jinglejs
|
||||
- improve otr verification
|
||||
- update locales
|
||||
- reset unread counter on logout
|
||||
- fix blank video
|
||||
- fix hang up video call
|
||||
- fix debug information
|
||||
- fix muc message without id
|
||||
- fix type error in jingle error
|
||||
|
||||
### Developer changes
|
||||
- remove "develop" branch and use instead "master" branch
|
||||
- Makefile for setup developer environment
|
||||
- remove loginTimeout option
|
||||
- add new jsxc.start function to start chat with password or sid/rid
|
||||
- add new option loginForm.ifFound (deprecates loginForm.attachIfFound)
|
||||
- add named dialogs
|
||||
- new message object
|
||||
- remove outdated stuff
|
||||
- merge jsxc.webrtc.css into jsxc.css
|
||||
|
||||
v2.1.5 / 2015-11-17
|
||||
===
|
||||
- Reset TURN credentials on login
|
||||
|
||||
+15
-1
@@ -176,6 +176,20 @@ module.exports = function(grunt) {
|
||||
}
|
||||
},
|
||||
search: {
|
||||
bower: {
|
||||
files: {
|
||||
src: ['bower.json']
|
||||
},
|
||||
options: {
|
||||
searchString: "<%= app.version %>",
|
||||
logFormat: 'console',
|
||||
onComplete: function(m) {
|
||||
if (m.numMatches === 0) {
|
||||
grunt.fail.fatal('No entry in bower.json for current version found.');
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
console: {
|
||||
files: {
|
||||
src: ['src/*.js']
|
||||
@@ -372,7 +386,7 @@ module.exports = function(grunt) {
|
||||
grunt.registerTask('build:prerelease', 'Build a new pre-release', function() {
|
||||
grunt.config.set('target', 'build');
|
||||
|
||||
grunt.task.run(['search:console', 'build', 'usebanner', 'replace:version', 'replace:libraries', 'replace:todo', 'uglify', 'compress']);
|
||||
grunt.task.run(['search:console', 'search:bower', 'build', 'usebanner', 'replace:version', 'replace:libraries', 'replace:todo', 'uglify', 'compress']);
|
||||
});
|
||||
|
||||
grunt.registerTask('build:release', 'Build a new release', function() {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "jsxc",
|
||||
"version": "3.0.0-beta1",
|
||||
"version": "3.0.1-beta2",
|
||||
"homepage": "https://www.jsxc.org",
|
||||
"authors": [
|
||||
"sualko <klaus@jsxc.org>"
|
||||
|
||||
+331
-8
@@ -255,12 +255,10 @@
|
||||
cursor: progress; }
|
||||
|
||||
.mfp-zoom-out-cur, .mfp-zoom-out-cur .mfp-image-holder .mfp-close {
|
||||
cursor: -webkit-zoom-out;
|
||||
cursor: zoom-out; }
|
||||
|
||||
.mfp-zoom {
|
||||
cursor: pointer;
|
||||
cursor: -webkit-zoom-in;
|
||||
cursor: zoom-in; }
|
||||
|
||||
.mfp-auto-cursor .mfp-content {
|
||||
@@ -2630,6 +2628,8 @@ fieldset[disabled] #jsxc_webrtc .checkbox label {
|
||||
|
||||
#jsxc_dialog .progress, #jsxc_webrtc .progress {
|
||||
margin-bottom: 0px; }
|
||||
#jsxc_dialog .progress .progress-bar, #jsxc_webrtc .progress .progress-bar {
|
||||
width: 100%; }
|
||||
|
||||
.mfp-bg {
|
||||
z-index: 9000; }
|
||||
@@ -3719,6 +3719,15 @@ li[data-type="groupchat"] .jsxc_video {
|
||||
.jsxc_center {
|
||||
text-align: center; }
|
||||
|
||||
.jsxc_hidden {
|
||||
display: none; }
|
||||
|
||||
.jsxc_clear {
|
||||
clear: both; }
|
||||
|
||||
.jsxc_uppercase {
|
||||
text-transform: uppercase; }
|
||||
|
||||
.jsxc_sep {
|
||||
border-top: 1px solid #000; }
|
||||
|
||||
@@ -3734,6 +3743,7 @@ li[data-type="groupchat"] .jsxc_video {
|
||||
#jsxc_dialog {
|
||||
padding: 20px;
|
||||
min-width: 320px;
|
||||
max-width: 100%;
|
||||
display: inline-block;
|
||||
text-align: left;
|
||||
position: relative;
|
||||
@@ -3956,12 +3966,27 @@ img.jsxc_vCard {
|
||||
.jsxc_btn {
|
||||
width: auto;
|
||||
min-width: 25px;
|
||||
padding: 5px;
|
||||
background-color: rgba(240, 240, 240, 0.9);
|
||||
font-weight: bold;
|
||||
color: #555;
|
||||
border: 1px solid rgba(190, 190, 190, 0.9);
|
||||
cursor: pointer; }
|
||||
display: inline-block;
|
||||
padding: 6px 12px;
|
||||
margin: 0px 2px;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
line-height: 1.42857143;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
vertical-align: middle;
|
||||
cursor: pointer;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
background-image: none;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 4px; }
|
||||
.jsxc_btn.jsxc_btn-default {
|
||||
border-color: #ccc;
|
||||
color: #555;
|
||||
background-color: rgba(240, 240, 240, 0.9); }
|
||||
.jsxc_btn.jsxc_btn-primary {
|
||||
color: #fff;
|
||||
background-color: #337ab7;
|
||||
@@ -4076,3 +4101,301 @@ img.jsxc_vCard {
|
||||
@media (min-width: 768px) {
|
||||
.jsxc_more {
|
||||
width: 25px; } }
|
||||
|
||||
.jsxc_remotevideo, .jsxc_noRemoteVideo {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 9000;
|
||||
background-color: #999999; }
|
||||
|
||||
#jsxc_webrtc {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
z-index: 9999;
|
||||
background-color: black; }
|
||||
#jsxc_webrtc .jsxc_status {
|
||||
z-index: 9999;
|
||||
border-radius: 20px;
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 30px;
|
||||
left: 50%;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
color: #fff;
|
||||
padding: 15px;
|
||||
font-weight: bold;
|
||||
text-align: center; }
|
||||
#jsxc_webrtc .slimScrollDiv {
|
||||
opacity: 1 !important; }
|
||||
#jsxc_webrtc li .jsxc_name {
|
||||
cursor: auto; }
|
||||
#jsxc_webrtc li .jsxc_name:hover {
|
||||
color: #bbb; }
|
||||
|
||||
.jsxc_videoContainer {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0px;
|
||||
bottom: 0px;
|
||||
background-color: #999999; }
|
||||
.jsxc_videoContainer video {
|
||||
display: none; }
|
||||
.jsxc_videoContainer .jsxc_noRemoteVideo {
|
||||
display: none; }
|
||||
@media (min-width: 768px) {
|
||||
.jsxc_videoContainer {
|
||||
right: 250px; }
|
||||
.jsxc_videoContainer .jsxc_controlbar {
|
||||
opacity: 0; }
|
||||
.jsxc_videoContainer:hover .jsxc_controlbar {
|
||||
opacity: 1.0; } }
|
||||
|
||||
.jsxc_noRemoteVideo p {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
width: 100%;
|
||||
z-index: 100; }
|
||||
|
||||
.jsxc_noRemoteVideo > div {
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
margin-top: -100px;
|
||||
left: 50%;
|
||||
margin-left: -100px; }
|
||||
.jsxc_noRemoteVideo > div > div {
|
||||
background-color: #4d4d4d; }
|
||||
.jsxc_noRemoteVideo > div > div:first-child {
|
||||
width: 50%;
|
||||
height: 50%;
|
||||
border-radius: 50%;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
margin-left: -25%;
|
||||
top: 10%; }
|
||||
.jsxc_noRemoteVideo > div > div:last-child {
|
||||
position: absolute;
|
||||
bottom: -50%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%; }
|
||||
|
||||
.jsxc_localvideo {
|
||||
width: 160px;
|
||||
height: 120px;
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
bottom: 10px;
|
||||
z-index: 9990;
|
||||
background-color: #000;
|
||||
cursor: pointer; }
|
||||
|
||||
div:full-screen {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #000; }
|
||||
div:full-screen.jsxc_localvideo {
|
||||
border: 1px solid #fff; }
|
||||
|
||||
div:-webkit-full-screen {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #000; }
|
||||
|
||||
div:-moz-full-screen {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #000; }
|
||||
|
||||
div:-ms-fullscreen {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #000; }
|
||||
|
||||
div:fullscreen {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #000; }
|
||||
div:-webkit-full-screen.jsxc_localvideo {
|
||||
border: 1px solid #fff; }
|
||||
div:-moz-full-screen.jsxc_localvideo {
|
||||
border: 1px solid #fff; }
|
||||
div:-ms-fullscreen.jsxc_localvideo {
|
||||
border: 1px solid #fff; }
|
||||
div:fullscreen.jsxc_localvideo {
|
||||
border: 1px solid #fff; }
|
||||
|
||||
div.jsxc_video {
|
||||
background-image: url('../img/camera_icon_white.svg');
|
||||
background-repeat: no-repeat;
|
||||
background-position: center center;
|
||||
background-size: 15px 15px;
|
||||
opacity: 0.4; }
|
||||
div.jsxc_video.jsxc_disabled {
|
||||
background-image: url('../img/camera_disabled_icon_white.svg'); }
|
||||
div.jsxc_video:not(.jsxc_disabled):hover {
|
||||
opacity: 1.0; }
|
||||
|
||||
.jsxc_controlbar {
|
||||
position: absolute;
|
||||
top: 50px;
|
||||
left: 0;
|
||||
right: 0px;
|
||||
text-align: center;
|
||||
z-index: 9090;
|
||||
-webkit-transition: 1s opacity;
|
||||
transition: 1s opacity;
|
||||
opacity: 0; }
|
||||
@media (min-width: 768px) {
|
||||
.jsxc_controlbar {
|
||||
bottom: 5%;
|
||||
top: initial; } }
|
||||
.jsxc_controlbar.jsxc_visible {
|
||||
opacity: 1.0; }
|
||||
.jsxc_controlbar > div {
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
height: 44px;
|
||||
border-radius: 22px;
|
||||
padding: 0px 5px;
|
||||
display: inline-block; }
|
||||
.jsxc_controlbar .jsxc_videoControl {
|
||||
height: 44px;
|
||||
width: 44px;
|
||||
margin: 0 5px;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 90%;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
opacity: 0.8; }
|
||||
.jsxc_controlbar .jsxc_videoControl:hover {
|
||||
opacity: 1.0; }
|
||||
.jsxc_controlbar .jsxc_hangUp {
|
||||
background-image: url('../img/hang_up_red.svg'); }
|
||||
.jsxc_controlbar .jsxc_fullscreen {
|
||||
background-image: url('../img/fullscreen_white.svg'); }
|
||||
.jsxc_controlbar .jsxc_showchat {
|
||||
float: right; }
|
||||
|
||||
.jsxc_multi > div {
|
||||
display: none; }
|
||||
|
||||
.jsxc_snapshotbar {
|
||||
width: 100%;
|
||||
display: none; }
|
||||
.jsxc_snapshotbar img {
|
||||
height: 50px; }
|
||||
|
||||
.jsxc_buttongroup {
|
||||
display: inline; }
|
||||
.jsxc_buttongroup button:first-child {
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
margin-right: 0; }
|
||||
.jsxc_buttongroup button:last-child {
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
margin-left: 0; }
|
||||
|
||||
.jsxc_chatarea {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
width: 250px;
|
||||
background-color: whitesmoke;
|
||||
display: none; }
|
||||
@media (min-width: 768px) {
|
||||
.jsxc_chatarea {
|
||||
display: block; } }
|
||||
.jsxc_chatarea .jsxc_settings {
|
||||
display: none !important; }
|
||||
.jsxc_chatarea .jsxc_close {
|
||||
display: none !important; }
|
||||
.jsxc_chatarea .jsxc_video {
|
||||
display: none !important; }
|
||||
.jsxc_chatarea .jsxc_window {
|
||||
bottom: 0;
|
||||
box-shadow: none; }
|
||||
.jsxc_chatarea > ul {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
list-style: none;
|
||||
padding: 0; }
|
||||
|
||||
.bubblingG {
|
||||
text-align: center;
|
||||
width: 129px;
|
||||
height: 80px;
|
||||
position: absolute;
|
||||
top: 40%;
|
||||
left: 50%;
|
||||
margin-left: -64px; }
|
||||
.bubblingG span {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin: 40px auto;
|
||||
background: #000;
|
||||
border-radius: 81px;
|
||||
-webkit-animation: bubblingG 1.3s infinite alternate;
|
||||
animation: bubblingG 1.3s infinite alternate; }
|
||||
|
||||
#bubblingG_1 {
|
||||
-webkit-animation-delay: 0s;
|
||||
animation-delay: 0s; }
|
||||
|
||||
#bubblingG_2 {
|
||||
-webkit-animation-delay: 0.39s;
|
||||
animation-delay: 0.39s; }
|
||||
|
||||
#bubblingG_3 {
|
||||
-webkit-animation-delay: 0.78s;
|
||||
animation-delay: 0.78s; }
|
||||
|
||||
@-webkit-keyframes bubblingG {
|
||||
0% {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
background-color: #000;
|
||||
-webkit-transform: translateY(0);
|
||||
transform: translateY(0); }
|
||||
100% {
|
||||
width: 39px;
|
||||
height: 39px;
|
||||
background-color: #fff;
|
||||
-webkit-transform: translateY(-34px);
|
||||
transform: translateY(-34px); } }
|
||||
|
||||
@keyframes bubblingG {
|
||||
0% {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
background-color: #000;
|
||||
-webkit-transform: translateY(0);
|
||||
transform: translateY(0); }
|
||||
100% {
|
||||
width: 39px;
|
||||
height: 39px;
|
||||
background-color: #fff;
|
||||
-webkit-transform: translateY(-34px);
|
||||
transform: translateY(-34px); } }
|
||||
|
||||
.jsxc_fullscreen.jsxc_localvideo {
|
||||
border: 1px solid #fff; }
|
||||
|
||||
.jsxc_videoSuitable .jsxc_name {
|
||||
font-style: italic; }
|
||||
|
||||
@@ -1,286 +0,0 @@
|
||||
.jsxc_remotevideo, .jsxc_noRemoteVideo {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 9000;
|
||||
background-color: #999999; }
|
||||
|
||||
#jsxc_webrtc {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
z-index: 9999;
|
||||
background-color: black; }
|
||||
#jsxc_webrtc .jsxc_status {
|
||||
z-index: 9999;
|
||||
border-radius: 20px;
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 30px;
|
||||
left: 50%;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
color: #fff;
|
||||
padding: 15px;
|
||||
font-weight: bold;
|
||||
text-align: center; }
|
||||
#jsxc_webrtc .slimScrollDiv {
|
||||
opacity: 1 !important; }
|
||||
#jsxc_webrtc li .jsxc_name {
|
||||
cursor: auto; }
|
||||
#jsxc_webrtc li .jsxc_name:hover {
|
||||
color: #bbb; }
|
||||
|
||||
.jsxc_videoContainer {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0px;
|
||||
bottom: 0px;
|
||||
background-color: #999999; }
|
||||
.jsxc_videoContainer video {
|
||||
display: none; }
|
||||
.jsxc_videoContainer .jsxc_noRemoteVideo {
|
||||
display: none; }
|
||||
@media (min-width: 768px) {
|
||||
.jsxc_videoContainer {
|
||||
right: 250px; }
|
||||
.jsxc_videoContainer .jsxc_controlbar {
|
||||
opacity: 0;
|
||||
-webkit-transition: 1s opacity;
|
||||
transition: 1s opacity; }
|
||||
.jsxc_videoContainer:hover .jsxc_controlbar {
|
||||
opacity: 1.0; } }
|
||||
|
||||
.jsxc_noRemoteVideo p {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
width: 100%;
|
||||
z-index: 100; }
|
||||
|
||||
.jsxc_noRemoteVideo > div {
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
margin-top: -100px;
|
||||
left: 50%;
|
||||
margin-left: -100px; }
|
||||
.jsxc_noRemoteVideo > div > div {
|
||||
background-color: #4d4d4d; }
|
||||
.jsxc_noRemoteVideo > div > div:first-child {
|
||||
width: 50%;
|
||||
height: 50%;
|
||||
border-radius: 50%;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
margin-left: -25%;
|
||||
top: 10%; }
|
||||
.jsxc_noRemoteVideo > div > div:last-child {
|
||||
position: absolute;
|
||||
bottom: -50%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%; }
|
||||
|
||||
.jsxc_localvideo {
|
||||
width: 160px;
|
||||
height: 120px;
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
bottom: 10px;
|
||||
z-index: 9990;
|
||||
background-color: #000;
|
||||
cursor: pointer; }
|
||||
|
||||
div:full-screen {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #000; }
|
||||
div:full-screen.jsxc_localvideo {
|
||||
border: 1px solid #fff; }
|
||||
|
||||
div:-webkit-full-screen {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #000; }
|
||||
|
||||
div:-moz-full-screen {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #000; }
|
||||
|
||||
div:-ms-fullscreen {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #000; }
|
||||
|
||||
div:fullscreen {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #000; }
|
||||
div:-webkit-full-screen.jsxc_localvideo {
|
||||
border: 1px solid #fff; }
|
||||
div:-moz-full-screen.jsxc_localvideo {
|
||||
border: 1px solid #fff; }
|
||||
div:-ms-fullscreen.jsxc_localvideo {
|
||||
border: 1px solid #fff; }
|
||||
div:fullscreen.jsxc_localvideo {
|
||||
border: 1px solid #fff; }
|
||||
|
||||
div.jsxc_video {
|
||||
background-image: url('../img/camera_icon_white.svg');
|
||||
background-repeat: no-repeat;
|
||||
background-position: center center;
|
||||
background-size: 15px 15px;
|
||||
opacity: 0.4; }
|
||||
div.jsxc_video.jsxc_disabled {
|
||||
background-image: url('../img/camera_disabled_icon_white.svg'); }
|
||||
div.jsxc_video:not(.jsxc_disabled):hover {
|
||||
opacity: 1.0; }
|
||||
|
||||
.jsxc_controlbar {
|
||||
position: absolute;
|
||||
top: 50px;
|
||||
left: 0;
|
||||
right: 0px;
|
||||
text-align: center;
|
||||
z-index: 9090; }
|
||||
.jsxc_controlbar > div {
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
height: 44px;
|
||||
border-radius: 22px;
|
||||
padding: 5px;
|
||||
display: inline-block; }
|
||||
.jsxc_controlbar .jsxc_videoControl {
|
||||
height: 44px;
|
||||
width: 44px;
|
||||
margin: 0 5px;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 90%;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
opacity: 0.8; }
|
||||
.jsxc_controlbar .jsxc_videoControl:hover {
|
||||
opacity: 1.0; }
|
||||
.jsxc_controlbar .jsxc_hangUp {
|
||||
background-image: url('../img/hang_up_red.svg'); }
|
||||
.jsxc_controlbar .jsxc_fullscreen {
|
||||
background-image: url('../img/fullscreen_white.svg'); }
|
||||
.jsxc_controlbar .jsxc_showchat {
|
||||
float: right; }
|
||||
|
||||
.jsxc_multi > div {
|
||||
display: none; }
|
||||
|
||||
.jsxc_snapshotbar {
|
||||
width: 100%;
|
||||
display: none; }
|
||||
.jsxc_snapshotbar img {
|
||||
height: 50px; }
|
||||
|
||||
.jsxc_buttongroup {
|
||||
display: inline; }
|
||||
.jsxc_buttongroup button:first-child {
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
margin-right: 0; }
|
||||
.jsxc_buttongroup button:last-child {
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
margin-left: 0; }
|
||||
|
||||
.jsxc_chatarea {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
width: 250px;
|
||||
background-color: whitesmoke; }
|
||||
.jsxc_chatarea .jsxc_settings {
|
||||
display: none !important; }
|
||||
.jsxc_chatarea .jsxc_close {
|
||||
display: none !important; }
|
||||
.jsxc_chatarea .jsxc_video {
|
||||
display: none !important; }
|
||||
.jsxc_chatarea .jsxc_window {
|
||||
bottom: 0;
|
||||
box-shadow: none; }
|
||||
.jsxc_chatarea > ul {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
list-style: none;
|
||||
padding: 0; }
|
||||
|
||||
.bubblingG {
|
||||
text-align: center;
|
||||
width: 129px;
|
||||
height: 80px;
|
||||
position: absolute;
|
||||
top: 40%;
|
||||
left: 50%;
|
||||
margin-left: -64px; }
|
||||
.bubblingG span {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin: 40px auto;
|
||||
background: #000;
|
||||
border-radius: 81px;
|
||||
-webkit-animation: bubblingG 1.3s infinite alternate;
|
||||
animation: bubblingG 1.3s infinite alternate; }
|
||||
|
||||
#bubblingG_1 {
|
||||
-webkit-animation-delay: 0s;
|
||||
animation-delay: 0s; }
|
||||
|
||||
#bubblingG_2 {
|
||||
-webkit-animation-delay: 0.39s;
|
||||
animation-delay: 0.39s; }
|
||||
|
||||
#bubblingG_3 {
|
||||
-webkit-animation-delay: 0.78s;
|
||||
animation-delay: 0.78s; }
|
||||
|
||||
@-webkit-keyframes bubblingG {
|
||||
0% {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
background-color: #000;
|
||||
-webkit-transform: translateY(0);
|
||||
transform: translateY(0); }
|
||||
100% {
|
||||
width: 39px;
|
||||
height: 39px;
|
||||
background-color: #fff;
|
||||
-webkit-transform: translateY(-34px);
|
||||
transform: translateY(-34px); } }
|
||||
|
||||
@keyframes bubblingG {
|
||||
0% {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
background-color: #000;
|
||||
-webkit-transform: translateY(0);
|
||||
transform: translateY(0); }
|
||||
100% {
|
||||
width: 39px;
|
||||
height: 39px;
|
||||
background-color: #fff;
|
||||
-webkit-transform: translateY(-34px);
|
||||
transform: translateY(-34px); } }
|
||||
|
||||
.jsxc_fullscreen.jsxc_localvideo {
|
||||
border: 1px solid #fff; }
|
||||
|
||||
.jsxc_videoSuitable .jsxc_name {
|
||||
font-style: italic; }
|
||||
+507
-303
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
externo
+8
-8
Diff do arquivo suprimido porque uma ou mais linhas são muito longas
Diff do arquivo suprimido porque uma ou mais linhas são muito longas
Diff do arquivo suprimido porque uma ou mais linhas são muito longas
externo
+107
-28
Diff do arquivo suprimido porque uma ou mais linhas são muito longas
Diff do arquivo suprimido porque uma ou mais linhas são muito longas
Diff do arquivo suprimido porque uma ou mais linhas são muito longas
Arquivo binário não exibido.
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
|
Depois Largura: | Altura: | Tamanho: 116 KiB |
Arquivo binário não exibido.
Arquivo binário não exibido.
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
|
Depois Largura: | Altura: | Tamanho: 118 KiB |
Arquivo binário não exibido.
Arquivo binário não exibido.
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
|
Depois Largura: | Altura: | Tamanho: 120 KiB |
Arquivo binário não exibido.
Arquivo binário não exibido.
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
|
Depois Largura: | Altura: | Tamanho: 114 KiB |
Arquivo binário não exibido.
Arquivo binário não exibido.
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
|
Depois Largura: | Altura: | Tamanho: 120 KiB |
Arquivo binário não exibido.
Arquivo binário não exibido.
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
|
Depois Largura: | Altura: | Tamanho: 117 KiB |
Arquivo binário não exibido.
+285
-171
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>JSDoc: Global</title>
|
||||
|
||||
|
||||
<script src="scripts/prettify/prettify.js"> </script>
|
||||
<script src="scripts/prettify/lang-css.js"> </script>
|
||||
<!--[if lt IE 9]>
|
||||
@@ -16,128 +16,217 @@
|
||||
<body>
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<h1 class="page-title">Global</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
|
||||
|
||||
<header>
|
||||
<h2>
|
||||
|
||||
</h2>
|
||||
<h2></h2>
|
||||
|
||||
|
||||
</header>
|
||||
</header>
|
||||
|
||||
<article>
|
||||
<div class="container-overview">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="subsection-title">Type Definitions</h3>
|
||||
|
||||
<dl>
|
||||
|
||||
<dt>
|
||||
<h4 class="name" id="getUsers-cb"><span class="type-signature"></span>getUsers-cb<span class="signature">(list)</span><span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
<div class="description">
|
||||
Processes user list.
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Parameters:</h5>
|
||||
|
||||
|
||||
<h3 class="subsection-title">Type Definitions</h3>
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="direction">direction</h4>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">
|
||||
Message direction can be incoming, outgoing or system.
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<h5>Type:</h5>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<span class="param-type"><a href="jsxc.Message.html#.IN">jsxc.Message.IN</a></span>
|
||||
|
|
||||
|
||||
<span class="param-type"><a href="jsxc.Message.html#.OUT">jsxc.Message.OUT</a></span>
|
||||
|
|
||||
|
||||
<span class="param-type"><a href="jsxc.Message.html#.SYS">jsxc.Message.SYS</a></span>
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="jsxc.lib.Message.js.html">jsxc.lib.Message.js</a>, <a href="jsxc.lib.Message.js.html#line236">line 236</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="getUsers-cb"><span class="type-signature"></span>getUsers-cb<span class="signature">(list)</span><span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">
|
||||
Processes user list.
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Parameters:</h5>
|
||||
|
||||
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<th>Name</th>
|
||||
|
||||
|
||||
<th>Type</th>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<th class="last">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<th>Name</th>
|
||||
|
||||
|
||||
<th>Type</th>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<th class="last">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>list</code></td>
|
||||
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
@@ -146,115 +235,129 @@
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last">List of users, key: username, value: alias</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="jsxc.lib.options.js.html">jsxc.lib.options.js</a>, <a href="jsxc.lib.options.js.html#line187">line 187</a>
|
||||
<a href="jsxc.lib.options.js.html">jsxc.lib.options.js</a>, <a href="jsxc.lib.options.js.html#line214">line 214</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt>
|
||||
<h4 class="name" id="loadSettingsCallback"><span class="type-signature"></span>loadSettingsCallback<span class="signature">(settings)</span><span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
<div class="description">
|
||||
This callback processes all settings.
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="loadSettingsCallback"><span class="type-signature"></span>loadSettingsCallback<span class="signature">(settings)</span><span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">
|
||||
This callback processes all settings.
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Parameters:</h5>
|
||||
|
||||
|
||||
|
||||
<h5>Parameters:</h5>
|
||||
|
||||
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<th>Name</th>
|
||||
|
||||
|
||||
<th>Type</th>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<th class="last">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<th>Name</th>
|
||||
|
||||
|
||||
<th>Type</th>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<th class="last">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>settings</code></td>
|
||||
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
@@ -263,74 +366,85 @@
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last">could be every jsxc option</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="jsxc.lib.options.js.html">jsxc.lib.options.js</a>, <a href="jsxc.lib.options.js.html#line154">line 154</a>
|
||||
<a href="jsxc.lib.options.js.html">jsxc.lib.options.js</a>, <a href="jsxc.lib.options.js.html#line181">line 181</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
|
||||
</section>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
@@ -338,13 +452,13 @@
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Index</a></h2><h3>Namespaces</h3><ul><li><a href="jsxc.html">jsxc</a></li><li><a href="jsxc.gui.html">gui</a></li><li><a href="jsxc.gui.dialog.html">dialog</a></li><li><a href="jsxc.gui.queryActions.html">queryActions</a></li><li><a href="jsxc.gui.roster.html">roster</a></li><li><a href="jsxc.gui.window.html">window</a></li><li><a href="jsxc.muc.html">muc</a></li><li><a href="jsxc.notification.html">notification</a></li><li><a href="jsxc.options.html">options</a></li><li><a href="jsxc.otr.html">otr</a></li><li><a href="jsxc.storage.html">storage</a></li><li><a href="jsxc.webrtc.html">webrtc</a></li><li><a href="jsxc.xmpp.html">xmpp</a></li><li><a href="jsxc.xmpp.bookmarks.html">bookmarks</a></li><li><a href="jsxc.xmpp.carbons.html">carbons</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="jsxc.Message.html">Message</a></li></ul><h3>Namespaces</h3><ul><li><a href="jsxc.html">jsxc</a></li><li><a href="jsxc.gui.html">gui</a></li><li><a href="jsxc.gui.dialog.html">dialog</a></li><li><a href="jsxc.gui.queryActions.html">queryActions</a></li><li><a href="jsxc.gui.roster.html">roster</a></li><li><a href="jsxc.gui.window.html">window</a></li><li><a href="jsxc.muc.html">muc</a></li><li><a href="jsxc.notification.html">notification</a></li><li><a href="jsxc.options.html">options</a></li><li><a href="jsxc.otr.html">otr</a></li><li><a href="jsxc.storage.html">storage</a></li><li><a href="jsxc.tab.html">tab</a></li><li><a href="jsxc.webrtc.html">webrtc</a></li><li><a href="jsxc.xmpp.html">xmpp</a></li><li><a href="jsxc.xmpp.bookmarks.html">bookmarks</a></li><li><a href="jsxc.xmpp.carbons.html">carbons</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
</nav>
|
||||
|
||||
<br clear="both">
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Tue Nov 17 2015 17:01:04 GMT+0100 (CET)
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.2</a> on Fri Oct 28 2016 13:29:05 GMT+0200 (CEST)
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
+10
-8
@@ -2,8 +2,8 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>JSDoc: Index</title>
|
||||
|
||||
<title>JSDoc: Home</title>
|
||||
|
||||
<script src="scripts/prettify/prettify.js"> </script>
|
||||
<script src="scripts/prettify/lang-css.js"> </script>
|
||||
<!--[if lt IE 9]>
|
||||
@@ -16,10 +16,11 @@
|
||||
<body>
|
||||
|
||||
<div id="main">
|
||||
|
||||
<h1 class="page-title">Home</h1>
|
||||
|
||||
|
||||
<h1 class="page-title">Index</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -35,6 +36,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -48,13 +50,13 @@
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Index</a></h2><h3>Namespaces</h3><ul><li><a href="jsxc.html">jsxc</a></li><li><a href="jsxc.gui.html">gui</a></li><li><a href="jsxc.gui.dialog.html">dialog</a></li><li><a href="jsxc.gui.queryActions.html">queryActions</a></li><li><a href="jsxc.gui.roster.html">roster</a></li><li><a href="jsxc.gui.window.html">window</a></li><li><a href="jsxc.muc.html">muc</a></li><li><a href="jsxc.notification.html">notification</a></li><li><a href="jsxc.options.html">options</a></li><li><a href="jsxc.otr.html">otr</a></li><li><a href="jsxc.storage.html">storage</a></li><li><a href="jsxc.webrtc.html">webrtc</a></li><li><a href="jsxc.xmpp.html">xmpp</a></li><li><a href="jsxc.xmpp.bookmarks.html">bookmarks</a></li><li><a href="jsxc.xmpp.carbons.html">carbons</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="jsxc.Message.html">Message</a></li></ul><h3>Namespaces</h3><ul><li><a href="jsxc.html">jsxc</a></li><li><a href="jsxc.gui.html">gui</a></li><li><a href="jsxc.gui.dialog.html">dialog</a></li><li><a href="jsxc.gui.queryActions.html">queryActions</a></li><li><a href="jsxc.gui.roster.html">roster</a></li><li><a href="jsxc.gui.window.html">window</a></li><li><a href="jsxc.muc.html">muc</a></li><li><a href="jsxc.notification.html">notification</a></li><li><a href="jsxc.options.html">options</a></li><li><a href="jsxc.otr.html">otr</a></li><li><a href="jsxc.storage.html">storage</a></li><li><a href="jsxc.tab.html">tab</a></li><li><a href="jsxc.webrtc.html">webrtc</a></li><li><a href="jsxc.xmpp.html">xmpp</a></li><li><a href="jsxc.xmpp.bookmarks.html">bookmarks</a></li><li><a href="jsxc.xmpp.carbons.html">carbons</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
</nav>
|
||||
|
||||
<br clear="both">
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Tue Nov 17 2015 17:01:04 GMT+0100 (CET)
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.2</a> on Fri Oct 28 2016 13:29:05 GMT+0200 (CEST)
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+397
-286
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>JSDoc: Namespace: dialog</title>
|
||||
|
||||
|
||||
<script src="scripts/prettify/prettify.js"> </script>
|
||||
<script src="scripts/prettify/lang-css.js"> </script>
|
||||
<!--[if lt IE 9]>
|
||||
@@ -16,206 +16,291 @@
|
||||
<body>
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<h1 class="page-title">Namespace: dialog</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
|
||||
|
||||
<header>
|
||||
<h2>
|
||||
<span class="ancestors"><a href="jsxc.html">jsxc</a><a href="jsxc.gui.html">.gui</a>.</span>
|
||||
|
||||
dialog
|
||||
</h2>
|
||||
<h2>
|
||||
<span class="ancestors"><a href="jsxc.html">jsxc</a><a href="jsxc.gui.html">.gui</a>.</span>dialog</h2>
|
||||
|
||||
|
||||
</header>
|
||||
</header>
|
||||
|
||||
<article>
|
||||
<div class="container-overview">
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">Wrapper for dialog</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="jsxc.lib.gui.js.html">jsxc.lib.gui.js</a>, <a href="jsxc.lib.gui.js.html#line1765">line 1765</a>
|
||||
<a href="jsxc.lib.gui.js.html">jsxc.lib.gui.js</a>, <a href="jsxc.lib.gui.js.html#line1890">line 1890</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="subsection-title">Methods</h3>
|
||||
|
||||
<dl>
|
||||
|
||||
<dt>
|
||||
<h4 class="name" id="close"><span class="type-signature"><static> </span>close<span class="signature">()</span><span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
<div class="description">
|
||||
Close current dialog.
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="jsxc.lib.gui.js.html">jsxc.lib.gui.js</a>, <a href="jsxc.lib.gui.js.html#line1843">line 1843</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
<dt>
|
||||
<h4 class="name" id="open"><span class="type-signature"><static> </span>open<span class="signature">(data, <span class="optional">o</span>)</span><span class="type-signature"> → {jQuery}</span></h4>
|
||||
|
||||
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
<div class="description">
|
||||
Open a Dialog.
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id=".close"><span class="type-signature">(static) </span>close<span class="signature">(name<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">
|
||||
If no name is provided every dialog will be closed,
|
||||
otherwise only dialog with given name is closed.
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Parameters:</h5>
|
||||
|
||||
|
||||
|
||||
<h5>Parameters:</h5>
|
||||
|
||||
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<th>Name</th>
|
||||
|
||||
|
||||
<th>Type</th>
|
||||
|
||||
|
||||
<th>Argument</th>
|
||||
|
||||
|
||||
|
||||
|
||||
<th class="last">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<th>Name</th>
|
||||
|
||||
|
||||
<th>Type</th>
|
||||
|
||||
|
||||
<th>Attributes</th>
|
||||
|
||||
|
||||
|
||||
|
||||
<th class="last">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>name</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">string</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
<td class="attributes">
|
||||
|
||||
<optional><br>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last">Close only dialog with the given name</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="jsxc.lib.gui.js.html">jsxc.lib.gui.js</a>, <a href="jsxc.lib.gui.js.html#line1975">line 1975</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id=".open"><span class="type-signature">(static) </span>open<span class="signature">(data, o<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {jQuery}</span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">
|
||||
Open a Dialog.
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Parameters:</h5>
|
||||
|
||||
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<th>Name</th>
|
||||
|
||||
|
||||
<th>Type</th>
|
||||
|
||||
|
||||
<th>Attributes</th>
|
||||
|
||||
|
||||
|
||||
|
||||
<th class="last">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>data</code></td>
|
||||
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
@@ -224,29 +309,29 @@
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
<td class="attributes">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last">Data of the dialog</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>o</code></td>
|
||||
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
@@ -255,52 +340,52 @@
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
<td class="attributes">
|
||||
|
||||
<optional><br>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last">Options for the dialog
|
||||
<h6>Properties</h6>
|
||||
|
||||
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<th>Name</th>
|
||||
|
||||
|
||||
<th>Type</th>
|
||||
|
||||
|
||||
<th>Argument</th>
|
||||
|
||||
|
||||
|
||||
|
||||
<th class="last">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<th>Name</th>
|
||||
|
||||
|
||||
<th>Type</th>
|
||||
|
||||
|
||||
<th>Attributes</th>
|
||||
|
||||
|
||||
|
||||
|
||||
<th class="last">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>noClose</code></td>
|
||||
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
@@ -309,82 +394,95 @@
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
<td class="attributes">
|
||||
|
||||
<optional><br>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last">If true, hide all default close options</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="jsxc.lib.gui.js.html">jsxc.lib.gui.js</a>, <a href="jsxc.lib.gui.js.html#line1780">line 1780</a>
|
||||
<a href="jsxc.lib.gui.js.html">jsxc.lib.gui.js</a>, <a href="jsxc.lib.gui.js.html#line1905">line 1905</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Returns:</h5>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Returns:</h5>
|
||||
|
||||
|
||||
<div class="param-desc">
|
||||
Dialog object
|
||||
</div>
|
||||
@@ -392,70 +490,72 @@
|
||||
|
||||
|
||||
<dl>
|
||||
<dt>
|
||||
Type
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<dt>
|
||||
Type
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<span class="param-type">jQuery</span>
|
||||
|
||||
|
||||
</dd>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt>
|
||||
<h4 class="name" id="resize"><span class="type-signature"><static> </span>resize<span class="signature">(options)</span><span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
<div class="description">
|
||||
Resizes current dialog.
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id=".resize"><span class="type-signature">(static) </span>resize<span class="signature">(options)</span><span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">
|
||||
Resizes current dialog.
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Parameters:</h5>
|
||||
|
||||
|
||||
|
||||
<h5>Parameters:</h5>
|
||||
|
||||
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<th>Name</th>
|
||||
|
||||
|
||||
<th>Type</th>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<th class="last">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<th>Name</th>
|
||||
|
||||
|
||||
<th>Type</th>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<th class="last">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>options</code></td>
|
||||
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
@@ -464,76 +564,87 @@
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last">e.g. width and height</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="jsxc.lib.gui.js.html">jsxc.lib.gui.js</a>, <a href="jsxc.lib.gui.js.html#line1854">line 1854</a>
|
||||
<a href="jsxc.lib.gui.js.html">jsxc.lib.gui.js</a>, <a href="jsxc.lib.gui.js.html#line1990">line 1990</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
|
||||
</section>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
@@ -541,13 +652,13 @@
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Index</a></h2><h3>Namespaces</h3><ul><li><a href="jsxc.html">jsxc</a></li><li><a href="jsxc.gui.html">gui</a></li><li><a href="jsxc.gui.dialog.html">dialog</a></li><li><a href="jsxc.gui.queryActions.html">queryActions</a></li><li><a href="jsxc.gui.roster.html">roster</a></li><li><a href="jsxc.gui.window.html">window</a></li><li><a href="jsxc.muc.html">muc</a></li><li><a href="jsxc.notification.html">notification</a></li><li><a href="jsxc.options.html">options</a></li><li><a href="jsxc.otr.html">otr</a></li><li><a href="jsxc.storage.html">storage</a></li><li><a href="jsxc.webrtc.html">webrtc</a></li><li><a href="jsxc.xmpp.html">xmpp</a></li><li><a href="jsxc.xmpp.bookmarks.html">bookmarks</a></li><li><a href="jsxc.xmpp.carbons.html">carbons</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="jsxc.Message.html">Message</a></li></ul><h3>Namespaces</h3><ul><li><a href="jsxc.html">jsxc</a></li><li><a href="jsxc.gui.html">gui</a></li><li><a href="jsxc.gui.dialog.html">dialog</a></li><li><a href="jsxc.gui.queryActions.html">queryActions</a></li><li><a href="jsxc.gui.roster.html">roster</a></li><li><a href="jsxc.gui.window.html">window</a></li><li><a href="jsxc.muc.html">muc</a></li><li><a href="jsxc.notification.html">notification</a></li><li><a href="jsxc.options.html">options</a></li><li><a href="jsxc.otr.html">otr</a></li><li><a href="jsxc.storage.html">storage</a></li><li><a href="jsxc.tab.html">tab</a></li><li><a href="jsxc.webrtc.html">webrtc</a></li><li><a href="jsxc.xmpp.html">xmpp</a></li><li><a href="jsxc.xmpp.bookmarks.html">bookmarks</a></li><li><a href="jsxc.xmpp.carbons.html">carbons</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
</nav>
|
||||
|
||||
<br clear="both">
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Tue Nov 17 2015 17:01:04 GMT+0100 (CET)
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.2</a> on Fri Oct 28 2016 13:29:05 GMT+0200 (CEST)
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
+2635
-2068
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+320
-248
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>JSDoc: Namespace: queryActions</title>
|
||||
|
||||
|
||||
<script src="scripts/prettify/prettify.js"> </script>
|
||||
<script src="scripts/prettify/lang-css.js"> </script>
|
||||
<!--[if lt IE 9]>
|
||||
@@ -16,441 +16,513 @@
|
||||
<body>
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<h1 class="page-title">Namespace: queryActions</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
|
||||
|
||||
<header>
|
||||
<h2>
|
||||
<span class="ancestors"><a href="jsxc.html">jsxc</a><a href="jsxc.gui.html">.gui</a>.</span>
|
||||
|
||||
queryActions
|
||||
</h2>
|
||||
<h2>
|
||||
<span class="ancestors"><a href="jsxc.html">jsxc</a><a href="jsxc.gui.html">.gui</a>.</span>queryActions</h2>
|
||||
|
||||
|
||||
</header>
|
||||
</header>
|
||||
|
||||
<article>
|
||||
<div class="container-overview">
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">Different uri query actions as defined in XEP-0147.</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="jsxc.lib.gui.js.html">jsxc.lib.gui.js</a>, <a href="jsxc.lib.gui.js.html#line36">line 36</a>
|
||||
<a href="jsxc.lib.gui.js.html">jsxc.lib.gui.js</a>, <a href="jsxc.lib.gui.js.html#line51">line 51</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="subsection-title">Methods</h3>
|
||||
|
||||
<dl>
|
||||
|
||||
<dt>
|
||||
<h4 class="name" id="join"><span class="type-signature"><static> </span>join<span class="signature">()</span><span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
<div class="description">
|
||||
xmpp:JID?join[;password=TEXT]
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="jsxc.lib.gui.js.html">jsxc.lib.gui.js</a>, <a href="jsxc.lib.gui.js.html#line71">line 71</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
<dt>
|
||||
<h4 class="name" id="message"><span class="type-signature"><static> </span>message<span class="signature">()</span><span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
<div class="description">
|
||||
xmpp:JID?message[;body=TEXT]
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id=".join"><span class="type-signature">(static) </span>join<span class="signature">()</span><span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">
|
||||
xmpp:JID?join[;password=TEXT]
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="jsxc.lib.gui.js.html">jsxc.lib.gui.js</a>, <a href="jsxc.lib.gui.js.html#line43">line 43</a>
|
||||
<a href="jsxc.lib.gui.js.html">jsxc.lib.gui.js</a>, <a href="jsxc.lib.gui.js.html#line86">line 86</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt>
|
||||
<h4 class="name" id="remove"><span class="type-signature"><static> </span>remove<span class="signature">()</span><span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
<div class="description">
|
||||
xmpp:JID?remove
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id=".message"><span class="type-signature">(static) </span>message<span class="signature">()</span><span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">
|
||||
xmpp:JID?message[;body=TEXT]
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="jsxc.lib.gui.js.html">jsxc.lib.gui.js</a>, <a href="jsxc.lib.gui.js.html#line52">line 52</a>
|
||||
<a href="jsxc.lib.gui.js.html">jsxc.lib.gui.js</a>, <a href="jsxc.lib.gui.js.html#line58">line 58</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt>
|
||||
<h4 class="name" id="subscribe"><span class="type-signature"><static> </span>subscribe<span class="signature">()</span><span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
<div class="description">
|
||||
xmpp:JID?subscribe[;name=NAME]
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id=".remove"><span class="type-signature">(static) </span>remove<span class="signature">()</span><span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">
|
||||
xmpp:JID?remove
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="jsxc.lib.gui.js.html">jsxc.lib.gui.js</a>, <a href="jsxc.lib.gui.js.html#line57">line 57</a>
|
||||
<a href="jsxc.lib.gui.js.html">jsxc.lib.gui.js</a>, <a href="jsxc.lib.gui.js.html#line67">line 67</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt>
|
||||
<h4 class="name" id="vcard"><span class="type-signature"><static> </span>vcard<span class="signature">()</span><span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
<div class="description">
|
||||
xmpp:JID?vcard
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id=".subscribe"><span class="type-signature">(static) </span>subscribe<span class="signature">()</span><span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">
|
||||
xmpp:JID?subscribe[;name=NAME]
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="jsxc.lib.gui.js.html">jsxc.lib.gui.js</a>, <a href="jsxc.lib.gui.js.html#line66">line 66</a>
|
||||
<a href="jsxc.lib.gui.js.html">jsxc.lib.gui.js</a>, <a href="jsxc.lib.gui.js.html#line72">line 72</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id=".vcard"><span class="type-signature">(static) </span>vcard<span class="signature">()</span><span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">
|
||||
xmpp:JID?vcard
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="jsxc.lib.gui.js.html">jsxc.lib.gui.js</a>, <a href="jsxc.lib.gui.js.html#line81">line 81</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
|
||||
</section>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
@@ -458,13 +530,13 @@
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Index</a></h2><h3>Namespaces</h3><ul><li><a href="jsxc.html">jsxc</a></li><li><a href="jsxc.gui.html">gui</a></li><li><a href="jsxc.gui.dialog.html">dialog</a></li><li><a href="jsxc.gui.queryActions.html">queryActions</a></li><li><a href="jsxc.gui.roster.html">roster</a></li><li><a href="jsxc.gui.window.html">window</a></li><li><a href="jsxc.muc.html">muc</a></li><li><a href="jsxc.notification.html">notification</a></li><li><a href="jsxc.options.html">options</a></li><li><a href="jsxc.otr.html">otr</a></li><li><a href="jsxc.storage.html">storage</a></li><li><a href="jsxc.webrtc.html">webrtc</a></li><li><a href="jsxc.xmpp.html">xmpp</a></li><li><a href="jsxc.xmpp.bookmarks.html">bookmarks</a></li><li><a href="jsxc.xmpp.carbons.html">carbons</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="jsxc.Message.html">Message</a></li></ul><h3>Namespaces</h3><ul><li><a href="jsxc.html">jsxc</a></li><li><a href="jsxc.gui.html">gui</a></li><li><a href="jsxc.gui.dialog.html">dialog</a></li><li><a href="jsxc.gui.queryActions.html">queryActions</a></li><li><a href="jsxc.gui.roster.html">roster</a></li><li><a href="jsxc.gui.window.html">window</a></li><li><a href="jsxc.muc.html">muc</a></li><li><a href="jsxc.notification.html">notification</a></li><li><a href="jsxc.options.html">options</a></li><li><a href="jsxc.otr.html">otr</a></li><li><a href="jsxc.storage.html">storage</a></li><li><a href="jsxc.tab.html">tab</a></li><li><a href="jsxc.webrtc.html">webrtc</a></li><li><a href="jsxc.xmpp.html">xmpp</a></li><li><a href="jsxc.xmpp.bookmarks.html">bookmarks</a></li><li><a href="jsxc.xmpp.carbons.html">carbons</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
</nav>
|
||||
|
||||
<br clear="both">
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Tue Nov 17 2015 17:01:04 GMT+0100 (CET)
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.2</a> on Fri Oct 28 2016 13:29:05 GMT+0200 (CEST)
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
+1038
-864
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+2355
-1443
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+2895
-2392
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
@@ -0,0 +1,312 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>JSDoc: Source: jsxc.lib.Message.js</title>
|
||||
|
||||
<script src="scripts/prettify/prettify.js"> </script>
|
||||
<script src="scripts/prettify/lang-css.js"> </script>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<![endif]-->
|
||||
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
||||
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="main">
|
||||
|
||||
<h1 class="page-title">Source: jsxc.lib.Message.js</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<article>
|
||||
<pre class="prettyprint source linenums"><code>/**
|
||||
* Load message object with given uid.
|
||||
*
|
||||
* @class Message
|
||||
* @memberOf jsxc
|
||||
* @param {string} uid Unified identifier from message object
|
||||
*/
|
||||
/**
|
||||
* Create new message object.
|
||||
*
|
||||
* @class Message
|
||||
* @memberOf jsxc
|
||||
* @param {object} args New message properties
|
||||
* @param {string} args.bid
|
||||
* @param {direction} args.direction
|
||||
* @param {string} args.msg
|
||||
* @param {boolean} args.encrypted
|
||||
* @param {boolean} args.forwarded
|
||||
* @param {boolean} args.sender
|
||||
* @param {integer} args.stamp
|
||||
* @param {object} args.attachment Attached data
|
||||
* @param {string} args.attachment.name File name
|
||||
* @param {string} args.attachment.size File size
|
||||
* @param {string} args.attachment.type File type
|
||||
* @param {string} args.attachment.data File data
|
||||
*/
|
||||
|
||||
jsxc.Message = function() {
|
||||
|
||||
/** @member {string} */
|
||||
this._uid = null;
|
||||
|
||||
/** @member {boolean} */
|
||||
this._received = false;
|
||||
|
||||
/** @member {boolean} */
|
||||
this.encrypted = false;
|
||||
|
||||
/** @member {boolean} */
|
||||
this.forwarded = false;
|
||||
|
||||
/** @member {integer} */
|
||||
this.stamp = new Date().getTime();
|
||||
|
||||
if (typeof arguments[0] === 'string' && arguments[0].length > 0 && arguments.length === 1) {
|
||||
this._uid = arguments[0];
|
||||
|
||||
this.load(this._uid);
|
||||
} else if (typeof arguments[0] === 'object' && arguments[0] !== null) {
|
||||
$.extend(this, arguments[0]);
|
||||
}
|
||||
|
||||
if (!this._uid) {
|
||||
this._uid = new Date().getTime() + ':msg';
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Load message properties.
|
||||
*
|
||||
* @memberof jsxc.Message
|
||||
* @param {string} uid
|
||||
*/
|
||||
jsxc.Message.prototype.load = function(uid) {
|
||||
var data = jsxc.storage.getUserItem('msg', uid);
|
||||
|
||||
if (!data) {
|
||||
jsxc.debug('Could not load message with uid ' + uid);
|
||||
}
|
||||
|
||||
$.extend(this, data);
|
||||
};
|
||||
|
||||
/**
|
||||
* Save message properties and create thumbnail.
|
||||
*
|
||||
* @memberOf jsxc.Message
|
||||
* @return {Message} this object
|
||||
*/
|
||||
jsxc.Message.prototype.save = function() {
|
||||
var history;
|
||||
|
||||
if (this.bid) {
|
||||
history = jsxc.storage.getUserItem('history', this.bid) || [];
|
||||
|
||||
if (history.indexOf(this._uid) < 0) {
|
||||
if (history.length > jsxc.options.get('numberOfMsg')) {
|
||||
jsxc.Message.delete(history.pop());
|
||||
}
|
||||
} else {
|
||||
history = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (Image && this.attachment && this.attachment.type.match(/^image\//i) && this.attachment.data) {
|
||||
var sHeight, sWidth, sx, sy;
|
||||
var dHeight = 100,
|
||||
dWidth = 100;
|
||||
var canvas = $("<canvas>").get(0);
|
||||
|
||||
canvas.width = dWidth;
|
||||
canvas.height = dHeight;
|
||||
|
||||
var ctx = canvas.getContext("2d");
|
||||
var img = new Image();
|
||||
|
||||
img.src = this.attachment.data;
|
||||
|
||||
if (img.height > img.width) {
|
||||
sHeight = img.width;
|
||||
sWidth = img.width;
|
||||
sx = 0;
|
||||
sy = (img.height - img.width) / 2;
|
||||
} else {
|
||||
sHeight = img.height;
|
||||
sWidth = img.height;
|
||||
sx = (img.width - img.height) / 2;
|
||||
sy = 0;
|
||||
}
|
||||
|
||||
ctx.drawImage(img, sx, sy, sWidth, sHeight, 0, 0, dWidth, dHeight);
|
||||
|
||||
this.attachment.thumbnail = canvas.toDataURL();
|
||||
|
||||
if (this.direction === 'out') {
|
||||
// save storage
|
||||
this.attachment.data = null;
|
||||
}
|
||||
}
|
||||
|
||||
var data;
|
||||
|
||||
if (this.attachment && this.attachment.size > jsxc.options.maxStorableSize && this.direction === 'in') {
|
||||
jsxc.debug('Attachment to large to store');
|
||||
|
||||
data = this.attachment.data;
|
||||
this.attachment.data = null;
|
||||
this.attachment.persistent = false;
|
||||
|
||||
//@TODO inform user
|
||||
}
|
||||
|
||||
jsxc.storage.setUserItem('msg', this._uid, this);
|
||||
|
||||
if (history) {
|
||||
history.unshift(this._uid);
|
||||
|
||||
jsxc.storage.setUserItem('history', this.bid, history);
|
||||
}
|
||||
|
||||
if (data && this.attachment) {
|
||||
this.attachment.data = data;
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Remove object from storage.
|
||||
*
|
||||
* @memberOf jsxc.Message
|
||||
*/
|
||||
jsxc.Message.prototype.delete = function() {
|
||||
jsxc.Message.delete(this._uid);
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns object as jquery object.
|
||||
*
|
||||
* @memberOf jsxc.Message
|
||||
* @return {jQuery} Representation in DOM
|
||||
*/
|
||||
jsxc.Message.prototype.getDOM = function() {
|
||||
return jsxc.Message.getDOM(this._uid);
|
||||
};
|
||||
|
||||
/**
|
||||
* Mark message as received.
|
||||
*
|
||||
* @memberOf jsxc.Message
|
||||
*/
|
||||
jsxc.Message.prototype.received = function() {
|
||||
this._received = true;
|
||||
this.save();
|
||||
|
||||
this.getDOM().addClass('jsxc_received');
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns true if the message was already received.
|
||||
*
|
||||
* @memberOf jsxc.Message
|
||||
* @return {boolean} true means received
|
||||
*/
|
||||
jsxc.Message.prototype.isReceived = function() {
|
||||
return this._received;
|
||||
};
|
||||
|
||||
/**
|
||||
* Remove message with uid.
|
||||
*
|
||||
* @memberOf jsxc.Message
|
||||
* @static
|
||||
* @param {string} uid message uid
|
||||
*/
|
||||
jsxc.Message.delete = function(uid) {
|
||||
var data = jsxc.storage.getUserItem('msg', uid);
|
||||
|
||||
if (data) {
|
||||
jsxc.storage.removeUserItem('msg', uid);
|
||||
|
||||
if (data.bid) {
|
||||
var history = jsxc.storage.getUserItem('history', data.bid) || [];
|
||||
|
||||
history = $.grep(history, function(el) {
|
||||
return el !== uid;
|
||||
});
|
||||
|
||||
jsxc.storage.setUserItem('history', data.bid);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns message object as jquery object.
|
||||
*
|
||||
* @memberOf jsxc.Message
|
||||
* @static
|
||||
* @param {string} uid message uid
|
||||
* @return {jQuery} jQuery representation in DOM
|
||||
*/
|
||||
jsxc.Message.getDOM = function(uid) {
|
||||
return $('#' + uid.replace(/:/g, '-'));
|
||||
};
|
||||
|
||||
/**
|
||||
* Message direction can be incoming, outgoing or system.
|
||||
*
|
||||
* @typedef {(jsxc.Message.IN|jsxc.Message.OUT|jsxc.Message.SYS)} direction
|
||||
*/
|
||||
|
||||
/**
|
||||
* @constant
|
||||
* @type {string}
|
||||
* @default
|
||||
*/
|
||||
jsxc.Message.IN = 'in';
|
||||
|
||||
/**
|
||||
* @constant
|
||||
* @type {string}
|
||||
* @default
|
||||
*/
|
||||
jsxc.Message.OUT = 'out';
|
||||
|
||||
/**
|
||||
* @constant
|
||||
* @type {string}
|
||||
* @default
|
||||
*/
|
||||
jsxc.Message.SYS = 'sys';
|
||||
</code></pre>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="jsxc.Message.html">Message</a></li></ul><h3>Namespaces</h3><ul><li><a href="jsxc.html">jsxc</a></li><li><a href="jsxc.gui.html">gui</a></li><li><a href="jsxc.gui.dialog.html">dialog</a></li><li><a href="jsxc.gui.queryActions.html">queryActions</a></li><li><a href="jsxc.gui.roster.html">roster</a></li><li><a href="jsxc.gui.window.html">window</a></li><li><a href="jsxc.muc.html">muc</a></li><li><a href="jsxc.notification.html">notification</a></li><li><a href="jsxc.options.html">options</a></li><li><a href="jsxc.otr.html">otr</a></li><li><a href="jsxc.storage.html">storage</a></li><li><a href="jsxc.tab.html">tab</a></li><li><a href="jsxc.webrtc.html">webrtc</a></li><li><a href="jsxc.xmpp.html">xmpp</a></li><li><a href="jsxc.xmpp.bookmarks.html">bookmarks</a></li><li><a href="jsxc.xmpp.carbons.html">carbons</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
</nav>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.2</a> on Fri Oct 28 2016 13:29:05 GMT+0200 (CEST)
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
<script src="scripts/linenumber.js"> </script>
|
||||
</body>
|
||||
</html>
|
||||
+929
-319
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+219
-145
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>JSDoc: Source: jsxc.lib.js</title>
|
||||
|
||||
|
||||
<script src="scripts/prettify/prettify.js"> </script>
|
||||
<script src="scripts/prettify/lang-css.js"> </script>
|
||||
<!--[if lt IE 9]>
|
||||
@@ -16,18 +16,19 @@
|
||||
<body>
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<h1 class="page-title">Source: jsxc.lib.js</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<article>
|
||||
<pre class="prettyprint source"><code>/**
|
||||
<pre class="prettyprint source linenums"><code>/**
|
||||
* JavaScript Xmpp Chat namespace
|
||||
*
|
||||
*
|
||||
* @namespace jsxc
|
||||
*/
|
||||
jsxc = {
|
||||
@@ -41,7 +42,7 @@ jsxc = {
|
||||
role_allocation: false,
|
||||
|
||||
/** Timeout for keepalive */
|
||||
to: null,
|
||||
to: [],
|
||||
|
||||
/** Timeout after normal keepalive starts */
|
||||
toBusy: null,
|
||||
@@ -53,10 +54,10 @@ jsxc = {
|
||||
toNotificationDelay: 500,
|
||||
|
||||
/** Interval for keep-alive */
|
||||
keepalive: null,
|
||||
keepaliveInterval: null,
|
||||
|
||||
/** True if last activity was up to 10 min ago */
|
||||
restore: false,
|
||||
/** True if jid, sid and rid was used to connect */
|
||||
reconnect: false,
|
||||
|
||||
/** True if restore is complete */
|
||||
restoreCompleted: false,
|
||||
@@ -97,45 +98,49 @@ jsxc = {
|
||||
NOTICE: 'Ping1.mp3'
|
||||
},
|
||||
REGEX: {
|
||||
JID: new RegExp('\\b[^"&\'\\/:<>@\\s]+@[\\w-_.]+\\b', 'ig'),
|
||||
URL: new RegExp(/((?:https?:\/\/|www\.|([\w\-]+\.[a-zA-Z]{2,3})(?=\b))(?:(?:[\-A-Za-z0-9+&@#\/%?=~_|!:,.;]*\([\-A-Za-z0-9+&@#\/%?=~_|!:,.;]*\)([\-A-Za-z0-9+&@#\/%?=~_|!:,.;]*[\-A-Za-z0-9+&@#\/%=~_|])?)|(?:[\-A-Za-z0-9+&@#\/%?=~_|!:,.;]*[\-A-Za-z0-9+&@#\/%=~_|]))?)/gi)
|
||||
JID: new RegExp('\\b[^"&\'\\/:<>@\\s]+@[\\w-_.]+\\b', 'ig'),
|
||||
URL: new RegExp(/(https?:\/\/|www\.)[^\s<>'"]+/gi)
|
||||
},
|
||||
NS: {
|
||||
CARBONS: 'urn:xmpp:carbons:2',
|
||||
FORWARD: 'urn:xmpp:forward:0'
|
||||
}
|
||||
},
|
||||
HIDDEN: 'hidden',
|
||||
SHOWN: 'shown'
|
||||
},
|
||||
|
||||
/**
|
||||
* Parse a unix timestamp and return a formatted time string
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc
|
||||
* @param {Object} unixtime
|
||||
* @returns time of day and/or date
|
||||
*/
|
||||
getFormattedTime: function(unixtime) {
|
||||
var msgDate = new Date(parseInt(unixtime));
|
||||
var date = ('0' + msgDate.getDate()).slice(-2);
|
||||
var day = ('0' + msgDate.getDate()).slice(-2);
|
||||
var month = ('0' + (msgDate.getMonth() + 1)).slice(-2);
|
||||
var year = msgDate.getFullYear();
|
||||
var hours = ('0' + msgDate.getHours()).slice(-2);
|
||||
var minutes = ('0' + msgDate.getMinutes()).slice(-2);
|
||||
var dateNow = new Date(),
|
||||
time = hours + ':' + minutes;
|
||||
var dateNow = new Date();
|
||||
|
||||
var date = (typeof msgDate.toLocaleDateString === 'function') ? msgDate.toLocaleDateString() : day + '.' + month + '.' + year;
|
||||
var time = (typeof msgDate.toLocaleTimeString === 'function') ? msgDate.toLocaleTimeString() : hours + ':' + minutes;
|
||||
|
||||
// compare dates only
|
||||
dateNow.setHours(0, 0, 0, 0);
|
||||
msgDate.setHours(0, 0, 0, 0);
|
||||
|
||||
if (dateNow.getTime() !== msgDate.getTime()) {
|
||||
return date + '.' + month + '.' + year + ' ' + time;
|
||||
return date + ' ' + time;
|
||||
}
|
||||
return time;
|
||||
},
|
||||
|
||||
/**
|
||||
* Write debug message to console and to log.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc
|
||||
* @param {String} msg Debug message
|
||||
* @param {Object} data
|
||||
@@ -164,16 +169,16 @@ jsxc = {
|
||||
}
|
||||
}
|
||||
|
||||
jsxc.log = jsxc.log + msg + ': ' + d + '\n';
|
||||
jsxc.log = jsxc.log + '$ ' + msg + ': ' + d + '\n';
|
||||
} else {
|
||||
console.log(msg);
|
||||
jsxc.log = jsxc.log + msg + '\n';
|
||||
jsxc.log = jsxc.log + '$ ' + msg + '\n';
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Write warn message.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc
|
||||
* @param {String} msg Warn message
|
||||
* @param {Object} data
|
||||
@@ -184,7 +189,7 @@ jsxc = {
|
||||
|
||||
/**
|
||||
* Write error message.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc
|
||||
* @param {String} msg Error message
|
||||
* @param {Object} data
|
||||
@@ -197,13 +202,28 @@ jsxc = {
|
||||
log: '',
|
||||
|
||||
/**
|
||||
* Starts the action
|
||||
*
|
||||
* This function initializes important core functions and event handlers.
|
||||
* Afterwards it performs the following actions in the given order:
|
||||
*
|
||||
* <ol>
|
||||
* <li>If (loginForm.ifFound = 'force' and form was found) or (jid or rid or
|
||||
* sid was not found) intercept form, and listen for credentials.</li>
|
||||
* <li>Attach with jid, rid and sid from storage, if no form was found or
|
||||
* loginForm.ifFound = 'attach'</li>
|
||||
* <li>Attach with jid, rid and sid from options.xmpp, if no form was found or
|
||||
* loginForm.ifFound = 'attach'</li>
|
||||
* </ol>
|
||||
*
|
||||
* @memberOf jsxc
|
||||
* @param {object} options
|
||||
* @param {object} options See {@link jsxc.options}
|
||||
*/
|
||||
init: function(options) {
|
||||
|
||||
if (options && options.loginForm && typeof options.loginForm.attachIfFound === 'boolean' && !options.loginForm.ifFound) {
|
||||
// translate deprated option attachIfFound found to new ifFound
|
||||
options.loginForm.ifFound = (options.loginForm.attachIfFound) ? 'attach' : 'pause';
|
||||
}
|
||||
|
||||
if (options) {
|
||||
// override default options
|
||||
$.extend(true, jsxc.options, options);
|
||||
@@ -217,19 +237,23 @@ jsxc = {
|
||||
|
||||
/**
|
||||
* Getter method for options. Saved options will override default one.
|
||||
*
|
||||
*
|
||||
* @param {string} key option key
|
||||
* @returns default or saved option value
|
||||
*/
|
||||
jsxc.options.get = function(key) {
|
||||
var local = jsxc.storage.getUserItem('options') || {};
|
||||
if (jsxc.bid) {
|
||||
var local = jsxc.storage.getUserItem('options') || {};
|
||||
|
||||
return local[key] || jsxc.options[key];
|
||||
return (typeof local[key] !== 'undefined') ? local[key] : jsxc.options[key];
|
||||
}
|
||||
|
||||
return jsxc.options[key];
|
||||
};
|
||||
|
||||
/**
|
||||
* Setter method for options. Will write into localstorage.
|
||||
*
|
||||
*
|
||||
* @param {string} key option key
|
||||
* @param {object} value option value
|
||||
*/
|
||||
@@ -246,7 +270,9 @@ jsxc = {
|
||||
var lang;
|
||||
if (jsxc.storage.getItem('lang') !== null) {
|
||||
lang = jsxc.storage.getItem('lang');
|
||||
} else if (jsxc.options.autoLang && navigator.language) {
|
||||
} else if (jsxc.options.autoLang && navigator.languages && navigator.languages.length > 0) {
|
||||
lang = navigator.languages[0].substr(0, 2);
|
||||
} else if (jsxc.options.autoLang && navigator.language) {
|
||||
lang = navigator.language.substr(0, 2);
|
||||
} else {
|
||||
lang = jsxc.options.defaultLang;
|
||||
@@ -260,6 +286,7 @@ jsxc = {
|
||||
// use localStorage and set expiration to a day
|
||||
useLocalStorage: true,
|
||||
localStorageExpirationTime: 60 * 60 * 24 * 1000,
|
||||
debug: jsxc.storage.getItem('debug') === true
|
||||
});
|
||||
|
||||
if (jsxc.storage.getItem('debug') === true) {
|
||||
@@ -269,27 +296,14 @@ jsxc = {
|
||||
// Register event listener for the storage event
|
||||
window.addEventListener('storage', jsxc.storage.onStorage, false);
|
||||
|
||||
var lastActivity = jsxc.storage.getItem('lastActivity') || 0;
|
||||
$(document).on('attached.jsxc', jsxc.registerLogout);
|
||||
|
||||
if ((new Date()).getTime() - lastActivity < jsxc.options.loginTimeout) {
|
||||
jsxc.restore = true;
|
||||
}
|
||||
|
||||
$(document).on('connectionReady.jsxc', function() {
|
||||
// Looking for logout element
|
||||
if (jsxc.options.logoutElement !== null && jsxc.options.logoutElement.length > 0) {
|
||||
var logout = function() {
|
||||
jsxc.options.logoutElement = $(this);
|
||||
jsxc.triggeredFromLogout = true;
|
||||
return jsxc.xmpp.logout();
|
||||
};
|
||||
|
||||
jsxc.options.logoutElement.off('click', null, logout).one('click', logout);
|
||||
}
|
||||
});
|
||||
var isStorageAttachParameters = jsxc.storage.getItem('rid') && jsxc.storage.getItem('sid') && jsxc.storage.getItem('jid');
|
||||
var isOptionsAttachParameters = jsxc.options.xmpp.rid && jsxc.options.xmpp.sid && jsxc.options.xmpp.jid;
|
||||
var isForceLoginForm = jsxc.options.loginForm && jsxc.options.loginForm.ifFound === 'force' && jsxc.isLoginForm();
|
||||
|
||||
// Check if we have to establish a new connection
|
||||
if (!jsxc.storage.getItem('rid') || !jsxc.storage.getItem('sid') || !jsxc.restore) {
|
||||
if ((!isStorageAttachParameters && !isOptionsAttachParameters) || isForceLoginForm) {
|
||||
|
||||
// clean up rid and sid
|
||||
jsxc.storage.removeItem('rid');
|
||||
@@ -333,13 +347,13 @@ jsxc = {
|
||||
jsxc.prepareLogin(function(settings) {
|
||||
if (settings !== false) {
|
||||
// settings.xmpp.onlogin is deprecated since v2.1.0
|
||||
var enabled = (settings.loginForm && settings.loginForm.enable) || (settings.xmpp && settings.xmpp.onlogin);
|
||||
var enabled = (settings.loginForm && settings.loginForm.enable) || (settings.xmpp && settings.xmpp.onlogin);
|
||||
enabled = enabled === "true" || enabled === true;
|
||||
|
||||
if (enabled) {
|
||||
jsxc.options.loginForm.triggered = true;
|
||||
|
||||
jsxc.xmpp.login();
|
||||
jsxc.xmpp.login(jsxc.options.xmpp.jid, jsxc.options.xmpp.password);
|
||||
}
|
||||
} else {
|
||||
jsxc.submitLoginForm();
|
||||
@@ -350,15 +364,11 @@ jsxc = {
|
||||
return false;
|
||||
});
|
||||
|
||||
} else if (!jsxc.isLoginForm() || (jsxc.options.loginForm && jsxc.options.loginForm.attachIfFound)) {
|
||||
} else if (!jsxc.isLoginForm() || (jsxc.options.loginForm && jsxc.options.loginForm.ifFound === 'attach')) {
|
||||
|
||||
// Restore old connection
|
||||
|
||||
jsxc.bid = jsxc.jidToBid(jsxc.storage.getItem('jid'));
|
||||
|
||||
jsxc.gui.init();
|
||||
|
||||
if (typeof(jsxc.storage.getItem('alive')) === 'undefined' || !jsxc.restore) {
|
||||
if (typeof jsxc.storage.getItem('alive') === 'undefined') {
|
||||
jsxc.onMaster();
|
||||
} else {
|
||||
jsxc.checkMaster();
|
||||
@@ -366,6 +376,75 @@ jsxc = {
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Attach to previous session if jid, sid and rid are available
|
||||
* in storage or options (default behaviour also for {@link jsxc.init}).
|
||||
*
|
||||
* @memberOf jsxc
|
||||
*/
|
||||
/**
|
||||
* Start new chat session with given jid and password.
|
||||
*
|
||||
* @memberOf jsxc
|
||||
* @param {string} jid Jabber Id
|
||||
* @param {string} password Jabber password
|
||||
*/
|
||||
/**
|
||||
* Attach to new chat session with jid, sid and rid.
|
||||
*
|
||||
* @memberOf jsxc
|
||||
* @param {string} jid Jabber Id
|
||||
* @param {string} sid Session Id
|
||||
* @param {string} rid Request Id
|
||||
*/
|
||||
start: function() {
|
||||
var args = arguments;
|
||||
|
||||
if (jsxc.role_allocation && !jsxc.master) {
|
||||
jsxc.debug('There is an other master tab');
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (jsxc.xmpp.conn && jsxc.xmpp.connected) {
|
||||
jsxc.debug('We are already connected');
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (args.length === 3) {
|
||||
$(document).one('attached.jsxc', function() {
|
||||
// save rid after first attachment
|
||||
jsxc.xmpp.onRidChange(jsxc.xmpp.conn._proto.rid);
|
||||
|
||||
jsxc.onMaster();
|
||||
});
|
||||
}
|
||||
|
||||
jsxc.checkMaster(function() {
|
||||
jsxc.xmpp.login.apply(this, args);
|
||||
});
|
||||
},
|
||||
|
||||
registerLogout: function() {
|
||||
// Looking for logout element
|
||||
if (jsxc.options.logoutElement !== null && $(jsxc.options.logoutElement).length > 0) {
|
||||
var logout = function(ev) {
|
||||
ev.stopPropagation();
|
||||
ev.preventDefault();
|
||||
|
||||
jsxc.options.logoutElement = $(this);
|
||||
jsxc.triggeredFromLogout = true;
|
||||
|
||||
jsxc.xmpp.logout();
|
||||
};
|
||||
|
||||
jsxc.options.logoutElement = $(jsxc.options.logoutElement);
|
||||
|
||||
jsxc.options.logoutElement.off('click', null, logout).one('click', logout);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns true if login form is found.
|
||||
*
|
||||
@@ -373,12 +452,12 @@ jsxc = {
|
||||
* @returns {boolean} True if login form was found.
|
||||
*/
|
||||
isLoginForm: function() {
|
||||
return jsxc.options.loginForm.form && jsxc.el_exists(jsxc.options.loginForm.form) && jsxc.el_exists(jsxc.options.loginForm.jid) && jsxc.el_exists(jsxc.options.loginForm.pass);
|
||||
return jsxc.options.loginForm.form && jsxc.el_exists(jsxc.options.loginForm.form) && jsxc.el_exists(jsxc.options.loginForm.jid) && jsxc.el_exists(jsxc.options.loginForm.pass);
|
||||
},
|
||||
|
||||
/**
|
||||
* Load settings and prepare jid.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc
|
||||
* @param {string} username
|
||||
* @param {string} password
|
||||
@@ -392,7 +471,7 @@ jsxc = {
|
||||
username = username || $(jsxc.options.loginForm.jid).val();
|
||||
password = password || $(jsxc.options.loginForm.pass).val();
|
||||
|
||||
if (!jsxc.triggeredFromBox && (jsxc.options.loginForm.onConnecting === 'dialog' || typeof jsxc.options.loginForm.onConnecting === 'undefined')) {
|
||||
if (!jsxc.triggeredFromBox && (jsxc.options.loginForm.onConnecting === 'dialog' || typeof jsxc.options.loginForm.onConnecting === 'undefined')) {
|
||||
jsxc.gui.showWaitAlert($.t('Logging_in'));
|
||||
}
|
||||
|
||||
@@ -413,7 +492,7 @@ jsxc = {
|
||||
|
||||
/**
|
||||
* Process xmpp settings and save loaded settings.
|
||||
*
|
||||
*
|
||||
* @private
|
||||
* @memberOf jsxc
|
||||
* @param {string} username
|
||||
@@ -490,11 +569,18 @@ jsxc = {
|
||||
jsxc.debug('I am the slave.');
|
||||
|
||||
jsxc.role_allocation = true;
|
||||
jsxc.bid = jsxc.jidToBid(jsxc.storage.getItem('jid'));
|
||||
|
||||
jsxc.gui.init();
|
||||
$('#jsxc_roster').removeClass('jsxc_noConnection');
|
||||
|
||||
jsxc.restoreRoster();
|
||||
jsxc.restoreWindows();
|
||||
jsxc.restoreCompleted = true;
|
||||
|
||||
jsxc.registerLogout();
|
||||
jsxc.gui.updateAvatar($('#jsxc_roster > .jsxc_bottom'), jsxc.jidToBid(jsxc.storage.getItem('jid')), 'own');
|
||||
|
||||
$(document).trigger('restoreCompleted.jsxc');
|
||||
},
|
||||
|
||||
@@ -509,92 +595,76 @@ jsxc = {
|
||||
// Init local storage
|
||||
jsxc.storage.setItem('alive', 0);
|
||||
jsxc.storage.setItem('alive_busy', 0);
|
||||
if (!jsxc.storage.getUserItem('windowlist')) {
|
||||
jsxc.storage.setUserItem('windowlist', []);
|
||||
}
|
||||
|
||||
// Sending keepalive signal
|
||||
jsxc.startKeepAlive();
|
||||
|
||||
if (jsxc.options.get('otr').enable) {
|
||||
// create or load DSA key and call _onMaster
|
||||
jsxc.otr.createDSA();
|
||||
} else {
|
||||
jsxc._onMaster();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Second half of the onMaster routine
|
||||
*/
|
||||
_onMaster: function() {
|
||||
|
||||
// create otr objects, if we lost the master
|
||||
if (jsxc.role_allocation) {
|
||||
$.each(jsxc.storage.getUserItem('windowlist'), function(index, val) {
|
||||
jsxc.otr.create(val);
|
||||
});
|
||||
}
|
||||
|
||||
jsxc.role_allocation = true;
|
||||
|
||||
if (jsxc.restore && !jsxc.restoreCompleted) {
|
||||
jsxc.restoreRoster();
|
||||
jsxc.restoreWindows();
|
||||
jsxc.restoreCompleted = true;
|
||||
|
||||
$(document).trigger('restoreCompleted.jsxc');
|
||||
}
|
||||
|
||||
// Prepare notifications
|
||||
if (jsxc.restore) {
|
||||
var noti = jsxc.storage.getUserItem('notification');
|
||||
noti = (typeof noti === 'number') ? noti : 2;
|
||||
if (jsxc.options.notification && noti > 0 && jsxc.notification.hasSupport()) {
|
||||
if (jsxc.notification.hasPermission()) {
|
||||
jsxc.notification.init();
|
||||
} else {
|
||||
jsxc.notification.prepareRequest();
|
||||
}
|
||||
} else {
|
||||
// No support => disable
|
||||
jsxc.options.notification = false;
|
||||
}
|
||||
}
|
||||
|
||||
$(document).on('connectionReady.jsxc', function() {
|
||||
jsxc.gui.updateAvatar($('#jsxc_avatar'), jsxc.jidToBid(jsxc.storage.getItem('jid')), 'own');
|
||||
});
|
||||
|
||||
jsxc.xmpp.login();
|
||||
},
|
||||
|
||||
/**
|
||||
* Checks if there is a master
|
||||
*
|
||||
* @param {function} [cb] Called if no master was found.
|
||||
*/
|
||||
checkMaster: function() {
|
||||
checkMaster: function(cb) {
|
||||
jsxc.debug('check master');
|
||||
|
||||
jsxc.to = window.setTimeout(jsxc.onMaster, 1000);
|
||||
jsxc.storage.ink('alive');
|
||||
cb = (cb && typeof cb === 'function') ? cb : jsxc.onMaster;
|
||||
|
||||
if (typeof jsxc.storage.getItem('alive') === 'undefined') {
|
||||
cb.call();
|
||||
} else {
|
||||
jsxc.to.push(window.setTimeout(cb, 1000));
|
||||
jsxc.keepAlive('slave');
|
||||
}
|
||||
},
|
||||
|
||||
masterActions: function() {
|
||||
|
||||
if (!jsxc.xmpp.conn || !jsxc.xmpp.conn.authenticated) {
|
||||
return;
|
||||
}
|
||||
|
||||
//prepare notifications
|
||||
var noti = jsxc.storage.getUserItem('notification');
|
||||
noti = (typeof noti === 'number') ? noti : 2;
|
||||
if (jsxc.options.notification && noti > 0 && jsxc.notification.hasSupport()) {
|
||||
if (jsxc.notification.hasPermission()) {
|
||||
jsxc.notification.init();
|
||||
} else {
|
||||
jsxc.notification.prepareRequest();
|
||||
}
|
||||
} else {
|
||||
// No support => disable
|
||||
jsxc.options.notification = false;
|
||||
}
|
||||
|
||||
if (jsxc.options.get('otr').enable) {
|
||||
// create or load DSA key
|
||||
jsxc.otr.createDSA();
|
||||
}
|
||||
|
||||
jsxc.gui.updateAvatar($('#jsxc_roster > .jsxc_bottom'), jsxc.jidToBid(jsxc.storage.getItem('jid')), 'own');
|
||||
},
|
||||
|
||||
/**
|
||||
* Start sending keep-alive signal
|
||||
*/
|
||||
startKeepAlive: function() {
|
||||
jsxc.keepalive = window.setInterval(jsxc.keepAlive, jsxc.options.timeout - 1000);
|
||||
jsxc.keepaliveInterval = window.setInterval(jsxc.keepAlive, jsxc.options.timeout - 1000);
|
||||
},
|
||||
|
||||
/**
|
||||
* Sends the keep-alive signal to signal that the master is still there.
|
||||
*/
|
||||
keepAlive: function() {
|
||||
jsxc.storage.ink('alive');
|
||||
keepAlive: function(role) {
|
||||
var next = parseInt(jsxc.storage.getItem('alive')) + 1;
|
||||
role = role || 'master';
|
||||
|
||||
if (jsxc.role_allocation) {
|
||||
jsxc.storage.setItem('lastActivity', (new Date()).getTime());
|
||||
}
|
||||
jsxc.storage.setItem('alive', next + ':' + role);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -606,8 +676,8 @@ jsxc = {
|
||||
window.clearTimeout(jsxc.toBusy);
|
||||
}
|
||||
|
||||
if (jsxc.keepalive) {
|
||||
window.clearInterval(jsxc.keepalive);
|
||||
if (jsxc.keepaliveInterval) {
|
||||
window.clearInterval(jsxc.keepaliveInterval);
|
||||
}
|
||||
|
||||
jsxc.storage.ink('alive_busy');
|
||||
@@ -616,7 +686,7 @@ jsxc = {
|
||||
|
||||
/**
|
||||
* Generates a random integer number between 0 and max
|
||||
*
|
||||
*
|
||||
* @param {Integer} max
|
||||
* @return {Integer} random integer between 0 and max
|
||||
*/
|
||||
@@ -626,7 +696,7 @@ jsxc = {
|
||||
|
||||
/**
|
||||
* Checks if there is a element with the given selector
|
||||
*
|
||||
*
|
||||
* @param {String} selector jQuery selector
|
||||
* @return {Boolean}
|
||||
*/
|
||||
@@ -636,7 +706,7 @@ jsxc = {
|
||||
|
||||
/**
|
||||
* Creates a CSS compatible string from a JID
|
||||
*
|
||||
*
|
||||
* @param {type} jid Valid Jabber ID
|
||||
* @returns {String} css Compatible string
|
||||
*/
|
||||
@@ -650,7 +720,7 @@ jsxc = {
|
||||
|
||||
/**
|
||||
* Create comparable bar jid.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc
|
||||
* @param jid
|
||||
* @returns comparable bar jid
|
||||
@@ -692,22 +762,22 @@ jsxc = {
|
||||
}
|
||||
|
||||
$.each(windows, function(index, bid) {
|
||||
var window = jsxc.storage.getUserItem('window', bid);
|
||||
var win = jsxc.storage.getUserItem('window', bid);
|
||||
|
||||
if (!window) {
|
||||
if (!win) {
|
||||
jsxc.debug('Associated window-element is missing: ' + bid);
|
||||
return true;
|
||||
}
|
||||
|
||||
jsxc.gui.window.init(bid);
|
||||
|
||||
if (!window.minimize) {
|
||||
if (!win.minimize) {
|
||||
jsxc.gui.window.show(bid);
|
||||
} else {
|
||||
jsxc.gui.window.hide(bid);
|
||||
}
|
||||
|
||||
jsxc.gui.window.setText(bid, window.text);
|
||||
jsxc.gui.window.setText(bid, win.text);
|
||||
});
|
||||
},
|
||||
|
||||
@@ -715,7 +785,7 @@ jsxc = {
|
||||
* This method submits the specified login form.
|
||||
*/
|
||||
submitLoginForm: function() {
|
||||
var form = jsxc.options.loginForm.form.off('submit');
|
||||
var form = $(jsxc.options.loginForm.form).off('submit');
|
||||
|
||||
// Attach original events
|
||||
var submits = form.data('submits') || [];
|
||||
@@ -734,13 +804,13 @@ jsxc = {
|
||||
* Escapes some characters to HTML character
|
||||
*/
|
||||
escapeHTML: function(text) {
|
||||
text = text.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
||||
return text.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
||||
text = text.replace(/&amp;/g, '&').replace(/&lt;/g, '<').replace(/&gt;/g, '>');
|
||||
return text.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
|
||||
},
|
||||
|
||||
/**
|
||||
* Removes all html tags.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc
|
||||
* @param text
|
||||
* @returns stripped text
|
||||
@@ -751,7 +821,7 @@ jsxc = {
|
||||
|
||||
/**
|
||||
* Executes only one of the given events
|
||||
*
|
||||
*
|
||||
* @param {string} obj.key event name
|
||||
* @param {function} obj.value function to execute
|
||||
* @returns {string} namespace of all events
|
||||
@@ -773,7 +843,7 @@ jsxc = {
|
||||
|
||||
/**
|
||||
* Checks if tab is hidden.
|
||||
*
|
||||
*
|
||||
* @returns {boolean} True if tab is hidden
|
||||
*/
|
||||
isHidden: function() {
|
||||
@@ -790,9 +860,9 @@ jsxc = {
|
||||
}
|
||||
|
||||
// handle multiple tabs
|
||||
if (hidden && jsxc.master) {
|
||||
if (hidden && jsxc.master) {
|
||||
jsxc.storage.ink('hidden', 0);
|
||||
} else if (!hidden && !jsxc.master) {
|
||||
} else if (!hidden && !jsxc.master) {
|
||||
jsxc.storage.ink('hidden');
|
||||
}
|
||||
|
||||
@@ -811,9 +881,9 @@ jsxc = {
|
||||
focus = document.hasFocus();
|
||||
}
|
||||
|
||||
if (!focus && jsxc.master) {
|
||||
if (!focus && jsxc.master) {
|
||||
jsxc.storage.ink('focus', 0);
|
||||
} else if (focus && !jsxc.master) {
|
||||
} else if (focus && !jsxc.master) {
|
||||
jsxc.storage.ink('focus');
|
||||
}
|
||||
|
||||
@@ -822,7 +892,7 @@ jsxc = {
|
||||
|
||||
/**
|
||||
* Executes the given function in jsxc namespace.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc
|
||||
* @param {string} fnName Function name
|
||||
* @param {array} fnParams Function parameters
|
||||
@@ -843,7 +913,7 @@ jsxc = {
|
||||
|
||||
/**
|
||||
* Hash string into 32-bit signed integer.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc
|
||||
* @param {string} str input string
|
||||
* @returns {integer} 32-bit signed integer
|
||||
@@ -862,6 +932,10 @@ jsxc = {
|
||||
}
|
||||
|
||||
return hash;
|
||||
},
|
||||
|
||||
isExtraSmallDevice: function() {
|
||||
return $(window).width() < 500;
|
||||
}
|
||||
};
|
||||
</code></pre>
|
||||
@@ -874,13 +948,13 @@ jsxc = {
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Index</a></h2><h3>Namespaces</h3><ul><li><a href="jsxc.html">jsxc</a></li><li><a href="jsxc.gui.html">gui</a></li><li><a href="jsxc.gui.dialog.html">dialog</a></li><li><a href="jsxc.gui.queryActions.html">queryActions</a></li><li><a href="jsxc.gui.roster.html">roster</a></li><li><a href="jsxc.gui.window.html">window</a></li><li><a href="jsxc.muc.html">muc</a></li><li><a href="jsxc.notification.html">notification</a></li><li><a href="jsxc.options.html">options</a></li><li><a href="jsxc.otr.html">otr</a></li><li><a href="jsxc.storage.html">storage</a></li><li><a href="jsxc.webrtc.html">webrtc</a></li><li><a href="jsxc.xmpp.html">xmpp</a></li><li><a href="jsxc.xmpp.bookmarks.html">bookmarks</a></li><li><a href="jsxc.xmpp.carbons.html">carbons</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="jsxc.Message.html">Message</a></li></ul><h3>Namespaces</h3><ul><li><a href="jsxc.html">jsxc</a></li><li><a href="jsxc.gui.html">gui</a></li><li><a href="jsxc.gui.dialog.html">dialog</a></li><li><a href="jsxc.gui.queryActions.html">queryActions</a></li><li><a href="jsxc.gui.roster.html">roster</a></li><li><a href="jsxc.gui.window.html">window</a></li><li><a href="jsxc.muc.html">muc</a></li><li><a href="jsxc.notification.html">notification</a></li><li><a href="jsxc.options.html">options</a></li><li><a href="jsxc.otr.html">otr</a></li><li><a href="jsxc.storage.html">storage</a></li><li><a href="jsxc.tab.html">tab</a></li><li><a href="jsxc.webrtc.html">webrtc</a></li><li><a href="jsxc.xmpp.html">xmpp</a></li><li><a href="jsxc.xmpp.bookmarks.html">bookmarks</a></li><li><a href="jsxc.xmpp.carbons.html">carbons</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
</nav>
|
||||
|
||||
<br clear="both">
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Tue Nov 17 2015 17:01:04 GMT+0100 (CET)
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.2</a> on Fri Oct 28 2016 13:29:05 GMT+0200 (CEST)
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
+280
-134
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>JSDoc: Source: jsxc.lib.muc.js</title>
|
||||
|
||||
|
||||
<script src="scripts/prettify/prettify.js"> </script>
|
||||
<script src="scripts/prettify/lang-css.js"> </script>
|
||||
<!--[if lt IE 9]>
|
||||
@@ -16,18 +16,19 @@
|
||||
<body>
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<h1 class="page-title">Source: jsxc.lib.muc.js</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<article>
|
||||
<pre class="prettyprint source"><code>/**
|
||||
<pre class="prettyprint source linenums"><code>/**
|
||||
* Implements Multi-User Chat (XEP-0045).
|
||||
*
|
||||
*
|
||||
* @namespace jsxc.muc
|
||||
*/
|
||||
jsxc.muc = {
|
||||
@@ -63,7 +64,7 @@ jsxc.muc = {
|
||||
|
||||
/**
|
||||
* Initialize muc plugin.
|
||||
*
|
||||
*
|
||||
* @private
|
||||
* @memberof jsxc.muc
|
||||
* @param {object} o Options
|
||||
@@ -77,7 +78,7 @@ jsxc.muc = {
|
||||
if (!options || typeof options.server !== 'string') {
|
||||
jsxc.debug('Discover muc service');
|
||||
|
||||
// prosody does not response, if we send query before initial presence was send
|
||||
// prosody does not respond, if we send query before initial presence was sent
|
||||
setTimeout(function() {
|
||||
self.conn.disco.items(Strophe.getDomainFromJid(self.conn.jid), null, function(items) {
|
||||
$(items).find('item').each(function() {
|
||||
@@ -88,7 +89,7 @@ jsxc.muc = {
|
||||
var mucFeature = $(info).find('feature[var="' + Strophe.NS.MUC + '"]');
|
||||
var mucIdentity = $(info).find('identity[category="conference"][type="text"]');
|
||||
|
||||
if (mucFeature.length > 0 && mucIdentity.length > 0) {
|
||||
if (mucFeature.length > 0 && mucIdentity.length > 0) {
|
||||
jsxc.debug('muc service found', jid);
|
||||
|
||||
jsxc.options.set('muc', {
|
||||
@@ -126,20 +127,20 @@ jsxc.muc = {
|
||||
|
||||
/**
|
||||
* Add entry to menu.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.muc
|
||||
*/
|
||||
initMenu: function() {
|
||||
var li = $('<li>').attr('class', 'jsxc_joinChat').text($.t('Join_chat'));
|
||||
var li = $('<li>').attr('class', 'jsxc_joinChat jsxc_groupcontacticon').text($.t('Join_chat'));
|
||||
|
||||
li.click(jsxc.muc.showJoinChat);
|
||||
|
||||
$('#jsxc_menu ul').append(li);
|
||||
$('#jsxc_menu ul .jsxc_about').before(li);
|
||||
},
|
||||
|
||||
/**
|
||||
* Open join dialog.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.muc
|
||||
* @param {string} [r] - room jid
|
||||
* @param {string} [p] - room password
|
||||
@@ -274,7 +275,7 @@ jsxc.muc = {
|
||||
var nickname = $('#jsxc_nickname').val() || Strophe.getNodeFromJid(self.conn.jid);
|
||||
var password = $('#jsxc_password').val() || null;
|
||||
|
||||
if (!room || !room.match(/^[^"&\'\/:<>@\s]+$/i)) {
|
||||
if (!room || !room.match(/^[^"&\'\/:<>@\s]+$/i)) {
|
||||
$('#jsxc_room').addClass('jsxc_invalid').keyup(function() {
|
||||
if ($(this).val()) {
|
||||
$(this).removeClass('jsxc_invalid');
|
||||
@@ -307,6 +308,10 @@ jsxc.muc = {
|
||||
var bookmark = $("#jsxc_bookmark").prop("checked");
|
||||
var autojoin = $('#jsxc_autojoin').prop('checked');
|
||||
|
||||
// clean up
|
||||
jsxc.gui.window.clear(room);
|
||||
jsxc.storage.setUserItem('member', room, {});
|
||||
|
||||
self.join(room, nickname, password, roomName, subject, bookmark, autojoin);
|
||||
|
||||
return false;
|
||||
@@ -324,7 +329,7 @@ jsxc.muc = {
|
||||
$(stanza).find('feature').each(function() {
|
||||
var feature = $(this).attr('var');
|
||||
|
||||
if (feature !== '' && i18n.exists(feature)) {
|
||||
if (feature !== '' && i18n.exists(feature)) {
|
||||
var tr = $('<tr>');
|
||||
$('<td>').text($.t(feature + '.keyword')).appendTo(tr);
|
||||
$('<td>').text($.t(feature + '.description')).appendTo(tr);
|
||||
@@ -378,7 +383,7 @@ jsxc.muc = {
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
/**
|
||||
* Request and show room configuration.
|
||||
*
|
||||
* @memberOf jsxc.muc
|
||||
@@ -413,10 +418,15 @@ jsxc.muc = {
|
||||
var dialog = jsxc.gui.dialog.open(jsxc.muc.helper.formToHTML(config));
|
||||
var form = dialog.find('form');
|
||||
|
||||
// work around Strophe.x behaviour
|
||||
form.find('[type="checkbox"]').change(function(){
|
||||
$(this).val(this.checked ? 1 : 0);
|
||||
});
|
||||
|
||||
var submit = $('<button>');
|
||||
submit.addClass('btn btn-primary');
|
||||
submit.attr('type', 'submit');
|
||||
submit.text($.t('Join'));
|
||||
submit.text($.t('Save'));
|
||||
|
||||
var cancel = $('<button>');
|
||||
cancel.addClass('btn btn-default');
|
||||
@@ -459,7 +469,7 @@ jsxc.muc = {
|
||||
|
||||
/**
|
||||
* Join the given room.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.muc
|
||||
* @param {string} room Room jid
|
||||
* @param {string} nickname Desired nickname
|
||||
@@ -492,11 +502,16 @@ jsxc.muc = {
|
||||
|
||||
/**
|
||||
* Leave given room.
|
||||
*
|
||||
* @memberOf jsxc.muc
|
||||
*
|
||||
* @memberOf jsxc.muc
|
||||
* @param {string} room Room jid
|
||||
*/
|
||||
leave: function(room) {
|
||||
if (!jsxc.master) {
|
||||
jsxc.tab.execMaster('muc.leave', room);
|
||||
return;
|
||||
}
|
||||
|
||||
var self = jsxc.muc;
|
||||
var own = jsxc.storage.getUserItem('ownNicknames') || {};
|
||||
var data = jsxc.storage.getUserItem('buddy', room) || {};
|
||||
@@ -512,7 +527,7 @@ jsxc.muc = {
|
||||
|
||||
/**
|
||||
* Clean up after we exited a room.
|
||||
*
|
||||
*
|
||||
* @private
|
||||
* @memberOf jsxc.muc
|
||||
* @param {string} room Room jid
|
||||
@@ -540,18 +555,27 @@ jsxc.muc = {
|
||||
|
||||
/**
|
||||
* Destroy the given room.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.muc
|
||||
* @param {string} room Room jid
|
||||
* @param {function} handler_cb Function to handle the successful destruction
|
||||
* @param {function} error_cb Function to handle an error
|
||||
*/
|
||||
destroy: function(room, handler_cb, error_cb) {
|
||||
if (!jsxc.master) {
|
||||
jsxc.tab.execMaster('muc.destroy', room);
|
||||
return;
|
||||
}
|
||||
|
||||
var self = jsxc.muc;
|
||||
var roomdata = jsxc.storage.getUserItem('buddy', room);
|
||||
|
||||
jsxc.storage.updateUserItem('buddy', room, 'state', self.CONST.ROOMSTATE.AWAIT_DESTRUCTION);
|
||||
jsxc.gui.window.postMessage(room, 'sys', $.t('This_room_will_be_closed'));
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: room,
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: $.t('This_room_will_be_closed')
|
||||
});
|
||||
|
||||
var iq = $iq({
|
||||
to: room,
|
||||
@@ -568,8 +592,8 @@ jsxc.muc = {
|
||||
},
|
||||
|
||||
/**
|
||||
* Close the given room.
|
||||
*
|
||||
* Close the given room.
|
||||
*
|
||||
* @memberOf jsxc.muc
|
||||
* @param room Room jid
|
||||
*/
|
||||
@@ -592,14 +616,16 @@ jsxc.muc = {
|
||||
self.onExited(room);
|
||||
}
|
||||
|
||||
roomdata.state = self.CONST.ROOMSTATE.DESTROYED;
|
||||
if (jsxc.storage.getUserItem('budy', room)) {
|
||||
roomdata.state = self.CONST.ROOMSTATE.DESTROYED;
|
||||
|
||||
jsxc.storage.setUserItem('buddy', room, roomdata);
|
||||
jsxc.storage.setUserItem('buddy', room, roomdata);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Init group chat window.
|
||||
*
|
||||
*
|
||||
* @private
|
||||
* @memberOf jsxc.muc
|
||||
* @param event Event
|
||||
@@ -607,17 +633,18 @@ jsxc.muc = {
|
||||
*/
|
||||
initWindow: function(event, win) {
|
||||
var self = jsxc.muc;
|
||||
var data = win.data();
|
||||
var bid = jsxc.jidToBid(data.jid);
|
||||
var roomdata = jsxc.storage.getUserItem('buddy', bid);
|
||||
|
||||
if (!jsxc.xmpp.conn) {
|
||||
$(document).one('connectionReady.jsxc', function() {
|
||||
if (!jsxc.xmpp.conn && jsxc.master) {
|
||||
$(document).one('attached.jsxc', function() {
|
||||
self.initWindow(null, win);
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
var data = win.data();
|
||||
var bid = jsxc.jidToBid(data.jid);
|
||||
var roomdata = jsxc.storage.getUserItem('buddy', bid);
|
||||
|
||||
if (roomdata.type !== 'groupchat') {
|
||||
return;
|
||||
}
|
||||
@@ -628,7 +655,7 @@ jsxc.muc = {
|
||||
var ownNickname = own[bid];
|
||||
var mlIcon = $('<div class="jsxc_members"></div>');
|
||||
|
||||
win.find('.jsxc_tools > .jsxc_transfer').after(mlIcon);
|
||||
win.find('.jsxc_tools > .jsxc_settings').after(mlIcon);
|
||||
|
||||
var ml = $('<div class="jsxc_memberlist"><ul></ul></div>');
|
||||
win.find('.jsxc_fade').prepend(ml);
|
||||
@@ -697,13 +724,7 @@ jsxc.muc = {
|
||||
jsxc.muc.scrollMemberListBy(bid, 0);
|
||||
});
|
||||
|
||||
// update emoticon button
|
||||
setTimeout(function() {
|
||||
var top = win.find('.jsxc_emoticons').position().top + win.find('.slimScrollDiv').position().top;
|
||||
win.find('.jsxc_emoticons').css('top', top + 'px');
|
||||
}, 400);
|
||||
|
||||
var destroy = $('<li>');
|
||||
var destroy = $('<a>');
|
||||
destroy.text($.t('Destroy'));
|
||||
destroy.addClass('jsxc_destroy');
|
||||
destroy.hide();
|
||||
@@ -711,7 +732,19 @@ jsxc.muc = {
|
||||
self.destroy(bid);
|
||||
});
|
||||
|
||||
win.find('.jsxc_settings ul').append(destroy);
|
||||
win.find('.jsxc_settings ul').append($('<li>').append(destroy));
|
||||
|
||||
var configure = $('<a>');
|
||||
configure.text($.t('Configure'));
|
||||
configure.addClass('jsxc_configure');
|
||||
configure.hide();
|
||||
configure.click(function() {
|
||||
self.showRoomConfiguration(bid);
|
||||
});
|
||||
|
||||
if (self.conn) {
|
||||
win.find('.jsxc_settings ul').append($('<li>').append(configure));
|
||||
}
|
||||
|
||||
if (roomdata.state > self.CONST.ROOMSTATE.INIT) {
|
||||
var member = jsxc.storage.getUserItem('member', bid) || {};
|
||||
@@ -719,25 +752,29 @@ jsxc.muc = {
|
||||
$.each(member, function(nickname, val) {
|
||||
self.insertMember(bid, nickname, val);
|
||||
|
||||
if (nickname === ownNickname && val.affiliation === self.CONST.AFFILIATION.OWNER) {
|
||||
if (nickname === ownNickname && val.affiliation === self.CONST.AFFILIATION.OWNER) {
|
||||
destroy.show();
|
||||
}
|
||||
|
||||
if (nickname === ownNickname && (val.affiliation === self.CONST.AFFILIATION.OWNER || val.affiliation === self.CONST.AFFILIATION.OWNER)) {
|
||||
configure.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var leave = $('<li>');
|
||||
var leave = $('<a>');
|
||||
leave.text($.t('Leave'));
|
||||
leave.addClass('jsxc_leave');
|
||||
leave.click(function() {
|
||||
self.leave(bid);
|
||||
});
|
||||
|
||||
win.find('.jsxc_settings ul').append(leave);
|
||||
win.find('.jsxc_settings ul').append($('<li>').append(leave));
|
||||
},
|
||||
|
||||
/**
|
||||
* Triggered on incoming presence stanzas.
|
||||
*
|
||||
*
|
||||
* @private
|
||||
* @memberOf jsxc.muc
|
||||
* @param event
|
||||
@@ -759,6 +796,7 @@ jsxc.muc = {
|
||||
var nickname = Strophe.unescapeNode(res);
|
||||
var own = jsxc.storage.getUserItem('ownNicknames') || {};
|
||||
var member = jsxc.storage.getUserItem('member', room) || {};
|
||||
var openWindow = false;
|
||||
var codes = [];
|
||||
|
||||
xdata.find('status').each(function() {
|
||||
@@ -774,10 +812,6 @@ jsxc.muc = {
|
||||
|
||||
jsxc.storage.setUserItem('roomNames', jsxc.xmpp.conn.muc.roomNames);
|
||||
|
||||
// clean up
|
||||
jsxc.storage.removeUserItem('chat', room);
|
||||
member = {};
|
||||
|
||||
if (jsxc.gui.roster.getItem(room).length === 0) {
|
||||
var bl = jsxc.storage.getUserItem('buddylist');
|
||||
bl.push(room);
|
||||
@@ -787,8 +821,8 @@ jsxc.muc = {
|
||||
}
|
||||
|
||||
if ($('#jsxc_dialog').length > 0) {
|
||||
// User joined the room manually
|
||||
jsxc.gui.window.open(room);
|
||||
// User joined the room manually
|
||||
openWindow = true;
|
||||
jsxc.gui.dialog.close();
|
||||
}
|
||||
}
|
||||
@@ -800,7 +834,11 @@ jsxc.muc = {
|
||||
// room has been destroyed
|
||||
member = {};
|
||||
|
||||
jsxc.gui.window.postMessage(room, 'sys', $.t('This_room_has_been_closed'));
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: room,
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: $.t('This_room_has_been_closed')
|
||||
});
|
||||
|
||||
self.close(room);
|
||||
} else {
|
||||
@@ -810,7 +848,7 @@ jsxc.muc = {
|
||||
|
||||
var newNickname = xdata.find('item').attr('nick');
|
||||
|
||||
if (codes.indexOf('303') > -1 && newNickname) {
|
||||
if (codes.indexOf('303') > -1 && newNickname) {
|
||||
// user changed his nickname
|
||||
|
||||
newNickname = Strophe.unescapeNode(newNickname);
|
||||
@@ -818,27 +856,39 @@ jsxc.muc = {
|
||||
// prevent to display enter message
|
||||
member[newNickname] = {};
|
||||
|
||||
jsxc.gui.window.postMessage(room, 'sys', $.t('is_now_known_as', {
|
||||
oldNickname: nickname,
|
||||
newNickname: newNickname,
|
||||
escapeInterpolation: true
|
||||
}));
|
||||
} else if (codes.length === 0 || (codes.length === 1 && codes.indexOf('110') > -1)) {
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: room,
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: $.t('is_now_known_as', {
|
||||
oldNickname: nickname,
|
||||
newNickname: newNickname,
|
||||
escapeInterpolation: true
|
||||
})
|
||||
});
|
||||
} else if (codes.length === 0 || (codes.length === 1 && codes.indexOf('110') > -1)) {
|
||||
// normal user exit
|
||||
jsxc.gui.window.postMessage(room, 'sys', $.t('left_the_building', {
|
||||
nickname: nickname,
|
||||
escapeInterpolation: true
|
||||
}));
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: room,
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: $.t('left_the_building', {
|
||||
nickname: nickname,
|
||||
escapeInterpolation: true
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// new member joined
|
||||
|
||||
if (!member[nickname] && own[room]) {
|
||||
jsxc.gui.window.postMessage(room, 'sys', $.t('entered_the_room', {
|
||||
nickname: nickname,
|
||||
escapeInterpolation: true
|
||||
}));
|
||||
if (!member[nickname] && own[room]) {
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: room,
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: $.t('entered_the_room', {
|
||||
nickname: nickname,
|
||||
escapeInterpolation: true
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
member[nickname] = {
|
||||
@@ -864,12 +914,17 @@ jsxc.muc = {
|
||||
$(document).trigger('status.muc.jsxc', [code, room, nickname, member[nickname] || {}, presence]);
|
||||
});
|
||||
|
||||
if (openWindow) {
|
||||
// we wait until all parameters are set up correctly (e.g. state)
|
||||
jsxc.gui.window.open(room);
|
||||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
/**
|
||||
* Handle group chat presence errors.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.muc
|
||||
* @param event
|
||||
* @param {string} from Jid
|
||||
@@ -897,7 +952,7 @@ jsxc.muc = {
|
||||
|
||||
/**
|
||||
* Handle status codes. Every function gets room jid, nickname, member data and xdata.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.muc
|
||||
*/
|
||||
onStatus: {
|
||||
@@ -923,28 +978,44 @@ jsxc.muc = {
|
||||
},
|
||||
/** Inform occupants that room logging is now enabled */
|
||||
170: function(room) {
|
||||
jsxc.gui.window.postMessage(room, 'sys', $.t('Room_logging_is_enabled'));
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: room,
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: $.t('Room_logging_is_enabled')
|
||||
});
|
||||
},
|
||||
/** Inform occupants that room logging is now disabled */
|
||||
171: function(room) {
|
||||
jsxc.gui.window.postMessage(room, 'sys', $.t('Room_logging_is_disabled'));
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: room,
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: $.t('Room_logging_is_disabled')
|
||||
});
|
||||
},
|
||||
/** Inform occupants that the room is now non-anonymous */
|
||||
172: function(room) {
|
||||
jsxc.gui.window.postMessage(room, 'sys', $.t('Room_is_now_non-anoymous'));
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: room,
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: $.t('Room_is_now_non-anoymous')
|
||||
});
|
||||
},
|
||||
/** Inform occupants that the room is now semi-anonymous */
|
||||
173: function(room) {
|
||||
jsxc.gui.window.postMessage(room, 'sys', $.t('Room_is_now_semi-anonymous'));
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: room,
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: $.t('Room_is_now_semi-anonymous')
|
||||
});
|
||||
},
|
||||
/** Inform user that a new room has been created */
|
||||
201: function(room) {
|
||||
var self = jsxc.muc;
|
||||
var roomdata = jsxc.storage.getUserItem('buddy', room) || {};
|
||||
|
||||
if (roomdata.autojoin && roomdata.config === self.CONST.ROOMCONFIG.INSTANT) {
|
||||
if (roomdata.autojoin && roomdata.config === self.CONST.ROOMCONFIG.INSTANT) {
|
||||
self.conn.muc.createInstantRoom(room);
|
||||
} else if (roomdata.autojoin && typeof roomdata.config !== 'undefined' && roomdata.config !== null) {
|
||||
} else if (roomdata.autojoin && typeof roomdata.config !== 'undefined' && roomdata.config !== null) {
|
||||
self.conn.muc.saveConfiguration(room, roomdata.config, function() {
|
||||
jsxc.debug('Cached room configuration saved.');
|
||||
}, function() {
|
||||
@@ -981,14 +1052,22 @@ jsxc.muc = {
|
||||
|
||||
if (own[room] === nickname) {
|
||||
jsxc.muc.close(room);
|
||||
jsxc.gui.window.postMessage(room, 'sys', $.t('muc_removed_banned'));
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: room,
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: $.t('muc_removed_banned')
|
||||
});
|
||||
|
||||
jsxc.muc.postReason(room, xdata);
|
||||
} else {
|
||||
jsxc.gui.window.postMessage(room, 'sys', $.t('muc_removed_info_banned', {
|
||||
nickname: nickname,
|
||||
escapeInterpolation: true
|
||||
}));
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: room,
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: $.t('muc_removed_info_banned', {
|
||||
nickname: nickname,
|
||||
escapeInterpolation: true
|
||||
})
|
||||
});
|
||||
}
|
||||
},
|
||||
/** Inform user that he or she has been kicked */
|
||||
@@ -997,14 +1076,22 @@ jsxc.muc = {
|
||||
|
||||
if (own[room] === nickname) {
|
||||
jsxc.muc.close(room);
|
||||
jsxc.gui.window.postMessage(room, 'sys', $.t('muc_removed_kicked'));
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: room,
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: $.t('muc_removed_kicked')
|
||||
});
|
||||
|
||||
jsxc.muc.postReason(room, xdata);
|
||||
} else {
|
||||
jsxc.gui.window.postMessage(room, 'sys', $.t('muc_removed_info_kicked', {
|
||||
nickname: nickname,
|
||||
escapeInterpolation: true
|
||||
}));
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: room,
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: $.t('muc_removed_info_kicked', {
|
||||
nickname: nickname,
|
||||
escapeInterpolation: true
|
||||
})
|
||||
});
|
||||
}
|
||||
},
|
||||
/** Inform user that he or she is beeing removed from the room because of an affiliation change */
|
||||
@@ -1013,16 +1100,25 @@ jsxc.muc = {
|
||||
|
||||
if (own[room] === nickname) {
|
||||
jsxc.muc.close(room);
|
||||
jsxc.gui.window.postMessage(room, 'sys', $.t('muc_removed_affiliation'));
|
||||
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: room,
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: $.t('muc_removed_affiliation')
|
||||
});
|
||||
} else {
|
||||
jsxc.gui.window.postMessage(room, 'sys', $.t('muc_removed_info_affiliation', {
|
||||
nickname: nickname,
|
||||
escapeInterpolation: true
|
||||
}));
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: room,
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: $.t('muc_removed_info_affiliation', {
|
||||
nickname: nickname,
|
||||
escapeInterpolation: true
|
||||
})
|
||||
});
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Inform user that he or she is beeing removed from the room because the room has been
|
||||
/**
|
||||
* Inform user that he or she is beeing removed from the room because the room has been
|
||||
* changed to members-only and the user is not a member
|
||||
*/
|
||||
322: function(room, nickname) {
|
||||
@@ -1030,27 +1126,39 @@ jsxc.muc = {
|
||||
|
||||
if (own[room] === nickname) {
|
||||
jsxc.muc.close(room);
|
||||
jsxc.gui.window.postMessage(room, 'sys', $.t('muc_removed_membersonly'));
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: room,
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: $.t('muc_removed_membersonly')
|
||||
});
|
||||
} else {
|
||||
jsxc.gui.window.postMessage(room, 'sys', $.t('muc_removed_info_membersonly', {
|
||||
nickname: nickname,
|
||||
escapeInterpolation: true
|
||||
}));
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: room,
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: $.t('muc_removed_info_membersonly', {
|
||||
nickname: nickname,
|
||||
escapeInterpolation: true
|
||||
})
|
||||
});
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Inform user that he or she is beeing removed from the room because the MUC service
|
||||
* is being shut down
|
||||
* is being shut down
|
||||
*/
|
||||
332: function(room) {
|
||||
jsxc.muc.close(room);
|
||||
jsxc.gui.window.postMessage(room, 'sys', $.t('muc_removed_shutdown'));
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: room,
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: $.t('muc_removed_shutdown')
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Extract reason from xdata and if available post it to room.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.muc
|
||||
* @param {string} room Room jid
|
||||
* @param {jQuery} xdata Xdata
|
||||
@@ -1066,25 +1174,34 @@ jsxc.muc = {
|
||||
reason = $.t('Reason') + ': ' + reason;
|
||||
|
||||
if (typeof actor.name === 'string' || typeof actor.jid === 'string') {
|
||||
jsxc.gui.window.postMessage(room, 'in', reason, false, false, null, actor);
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: room,
|
||||
direction: jsxc.Message.IN,
|
||||
msg: reason,
|
||||
sender: actor
|
||||
});
|
||||
} else {
|
||||
jsxc.gui.window.postMessage(room, 'sys', reason);
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: room,
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: reason
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Insert member to room member list.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.muc
|
||||
* @param {string} room Room jid
|
||||
* @param {string} nickname Nickname
|
||||
* @param {string} memberdata Member data
|
||||
*/
|
||||
insertMember: function(room, nickname, memberdata) {
|
||||
var self = jsxc.muc;
|
||||
var win = jsxc.gui.window.get(room);
|
||||
var jid = memberdata.jid;
|
||||
var ownBid = jsxc.jidToBid(jsxc.storage.getItem('jid'));
|
||||
var m = win.find('.jsxc_memberlist li[data-nickname="' + nickname + '"]');
|
||||
|
||||
if (m.length === 0) {
|
||||
@@ -1102,9 +1219,9 @@ jsxc.muc = {
|
||||
|
||||
var data = jsxc.storage.getUserItem('buddy', jsxc.jidToBid(jid));
|
||||
|
||||
if (data !== null && typeof data === 'object') {
|
||||
if (data !== null && typeof data === 'object') {
|
||||
jsxc.gui.updateAvatar(m, jsxc.jidToBid(jid), data.avatar);
|
||||
} else if (jsxc.jidToBid(jid) === jsxc.jidToBid(self.conn.jid)) {
|
||||
} else if (jsxc.jidToBid(jid) === ownBid) {
|
||||
jsxc.gui.updateAvatar(m, jsxc.jidToBid(jid), 'own');
|
||||
}
|
||||
} else {
|
||||
@@ -1119,7 +1236,7 @@ jsxc.muc = {
|
||||
|
||||
/**
|
||||
* Remove member from room member list.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.muc
|
||||
* @param {string} room Room jid
|
||||
* @param {string} nickname Nickname
|
||||
@@ -1135,7 +1252,7 @@ jsxc.muc = {
|
||||
|
||||
/**
|
||||
* Scroll or update member list position.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.muc
|
||||
* @param {string} room Room jid
|
||||
* @param {integer} offset =0: update position; >0: Scroll to left; <0: Scroll to right
|
||||
@@ -1165,7 +1282,7 @@ jsxc.muc = {
|
||||
|
||||
/**
|
||||
* Empty member list.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.muc
|
||||
* @param {string} room Room jid
|
||||
*/
|
||||
@@ -1179,7 +1296,7 @@ jsxc.muc = {
|
||||
|
||||
/**
|
||||
* Handle incoming group chat message.
|
||||
*
|
||||
*
|
||||
* @private
|
||||
* @memberOf jsxc.muc
|
||||
* @param {string} message Message stanza
|
||||
@@ -1188,7 +1305,7 @@ jsxc.muc = {
|
||||
onGroupchatMessage: function(message) {
|
||||
var id = $(message).attr('id');
|
||||
|
||||
if (jsxc.el_exists($('#' + id))) {
|
||||
if (id && jsxc.el_exists(jsxc.Message.getDOM(id))) {
|
||||
// ignore own incoming messages
|
||||
return true;
|
||||
}
|
||||
@@ -1208,11 +1325,19 @@ jsxc.muc = {
|
||||
var sender = {};
|
||||
sender.name = nickname;
|
||||
|
||||
if (member[nickname] && typeof member[nickname].jid === 'string') {
|
||||
if (member[nickname] && typeof member[nickname].jid === 'string') {
|
||||
sender.jid = member[nickname].jid;
|
||||
}
|
||||
|
||||
jsxc.gui.window.postMessage(room, 'in', body, false, false, stamp, sender);
|
||||
jsxc.gui.window.init(room);
|
||||
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: room,
|
||||
direction: jsxc.Message.IN,
|
||||
msg: body,
|
||||
stamp: stamp,
|
||||
sender: sender
|
||||
});
|
||||
}
|
||||
|
||||
var subject = $(message).find('subject');
|
||||
@@ -1224,10 +1349,14 @@ jsxc.muc = {
|
||||
|
||||
jsxc.storage.setUserItem('buddy', room, roomdata);
|
||||
|
||||
jsxc.gui.window.postMessage(room, 'sys', $.t('changed_subject_to', {
|
||||
nickname: nickname,
|
||||
subject: subject.text()
|
||||
}));
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: room,
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: $.t('changed_subject_to', {
|
||||
nickname: nickname,
|
||||
subject: subject.text()
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -1235,7 +1364,7 @@ jsxc.muc = {
|
||||
|
||||
/**
|
||||
* Handle group chat error message.
|
||||
*
|
||||
*
|
||||
* @private
|
||||
* @memberOf jsxc.muc
|
||||
* @param {string} message Message stanza
|
||||
@@ -1248,13 +1377,29 @@ jsxc.muc = {
|
||||
}
|
||||
|
||||
if ($(message).find('item-not-found').length > 0) {
|
||||
jsxc.gui.window.postMessage(room, 'sys', $.t('message_not_send_item-not-found'));
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: room,
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: $.t('message_not_send_item-not-found')
|
||||
});
|
||||
} else if ($(message).find('forbidden').length > 0) {
|
||||
jsxc.gui.window.postMessage(room, 'sys', $.t('message_not_send_forbidden'));
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: room,
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: $.t('message_not_send_forbidden')
|
||||
});
|
||||
} else if ($(message).find('not-acceptable').length > 0) {
|
||||
jsxc.gui.window.postMessage(room, 'sys', $.t('message_not_send_not-acceptable'));
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: room,
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: $.t('message_not_send_not-acceptable')
|
||||
});
|
||||
} else {
|
||||
jsxc.gui.window.postMessage(room, 'sys', $.t('message_not_send'));
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: room,
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: $.t('message_not_send')
|
||||
});
|
||||
}
|
||||
|
||||
jsxc.debug('[muc] error message for ' + room, $(message).find('error')[0]);
|
||||
@@ -1264,7 +1409,7 @@ jsxc.muc = {
|
||||
|
||||
/**
|
||||
* Prepare group chat roster item.
|
||||
*
|
||||
*
|
||||
* @private
|
||||
* @memberOf jsxc.muc
|
||||
* @param event
|
||||
@@ -1279,8 +1424,9 @@ jsxc.muc = {
|
||||
return;
|
||||
}
|
||||
|
||||
var bo = $('<div>');
|
||||
bo.text('+');
|
||||
var bo = $('<a>');
|
||||
$('<span>').addClass('jsxc_icon jsxc_bookmarkicon').appendTo(bo);
|
||||
$('<span>').text($.t('Bookmark')).appendTo(bo);
|
||||
bo.addClass('jsxc_bookmarkOptions');
|
||||
bo.click(function(ev) {
|
||||
ev.preventDefault();
|
||||
@@ -1290,7 +1436,7 @@ jsxc.muc = {
|
||||
return false;
|
||||
});
|
||||
|
||||
bud.find('.jsxc_rename').before(bo);
|
||||
bud.find('.jsxc_menu ul').append($('<li>').append(bo));
|
||||
|
||||
if (data.bookmarked) {
|
||||
bud.addClass('jsxc_bookmarked');
|
||||
@@ -1324,13 +1470,13 @@ jsxc.muc = {
|
||||
|
||||
/**
|
||||
* Some helper functions.
|
||||
*
|
||||
*
|
||||
* @type {Object}
|
||||
*/
|
||||
helper: {
|
||||
/**
|
||||
* Convert x:data form to html.
|
||||
*
|
||||
*
|
||||
* @param {Strophe.x.Form} form - x:data form
|
||||
* @return {jQuery} jQuery representation of x:data field
|
||||
*/
|
||||
@@ -1364,7 +1510,7 @@ jsxc.muc = {
|
||||
|
||||
/**
|
||||
* Convert x:data field to html.
|
||||
*
|
||||
*
|
||||
* @param {Strophe.x.Field} field - x:data field
|
||||
* @return {html} html representation of x:data field
|
||||
*/
|
||||
@@ -1446,7 +1592,7 @@ jsxc.muc = {
|
||||
case 'boolean':
|
||||
el.attr('type', 'checkbox');
|
||||
val = (_ref2 = self.values[0]) != null ? typeof _ref2.toString === "function" ? _ref2.toString() : void 0 : void 0;
|
||||
if (val && (val === "true" || val === "1")) {
|
||||
if (val && (val === "true" || val === "1")) {
|
||||
el.attr('checked', 'checked');
|
||||
}
|
||||
break;
|
||||
@@ -1510,13 +1656,13 @@ $(document).one('connected.jsxc', function() {
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Index</a></h2><h3>Namespaces</h3><ul><li><a href="jsxc.html">jsxc</a></li><li><a href="jsxc.gui.html">gui</a></li><li><a href="jsxc.gui.dialog.html">dialog</a></li><li><a href="jsxc.gui.queryActions.html">queryActions</a></li><li><a href="jsxc.gui.roster.html">roster</a></li><li><a href="jsxc.gui.window.html">window</a></li><li><a href="jsxc.muc.html">muc</a></li><li><a href="jsxc.notification.html">notification</a></li><li><a href="jsxc.options.html">options</a></li><li><a href="jsxc.otr.html">otr</a></li><li><a href="jsxc.storage.html">storage</a></li><li><a href="jsxc.webrtc.html">webrtc</a></li><li><a href="jsxc.xmpp.html">xmpp</a></li><li><a href="jsxc.xmpp.bookmarks.html">bookmarks</a></li><li><a href="jsxc.xmpp.carbons.html">carbons</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="jsxc.Message.html">Message</a></li></ul><h3>Namespaces</h3><ul><li><a href="jsxc.html">jsxc</a></li><li><a href="jsxc.gui.html">gui</a></li><li><a href="jsxc.gui.dialog.html">dialog</a></li><li><a href="jsxc.gui.queryActions.html">queryActions</a></li><li><a href="jsxc.gui.roster.html">roster</a></li><li><a href="jsxc.gui.window.html">window</a></li><li><a href="jsxc.muc.html">muc</a></li><li><a href="jsxc.notification.html">notification</a></li><li><a href="jsxc.options.html">options</a></li><li><a href="jsxc.otr.html">otr</a></li><li><a href="jsxc.storage.html">storage</a></li><li><a href="jsxc.tab.html">tab</a></li><li><a href="jsxc.webrtc.html">webrtc</a></li><li><a href="jsxc.xmpp.html">xmpp</a></li><li><a href="jsxc.xmpp.bookmarks.html">bookmarks</a></li><li><a href="jsxc.xmpp.carbons.html">carbons</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
</nav>
|
||||
|
||||
<br clear="both">
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Tue Nov 17 2015 17:01:04 GMT+0100 (CET)
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.2</a> on Fri Oct 28 2016 13:29:05 GMT+0200 (CEST)
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>JSDoc: Source: jsxc.lib.notice.js</title>
|
||||
|
||||
|
||||
<script src="scripts/prettify/prettify.js"> </script>
|
||||
<script src="scripts/prettify/lang-css.js"> </script>
|
||||
<!--[if lt IE 9]>
|
||||
@@ -16,16 +16,17 @@
|
||||
<body>
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<h1 class="page-title">Source: jsxc.lib.notice.js</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<article>
|
||||
<pre class="prettyprint source"><code>/**
|
||||
<pre class="prettyprint source linenums"><code>/**
|
||||
* This namespace handle the notice system.
|
||||
*
|
||||
* @namspace jsxc.notice
|
||||
@@ -151,13 +152,13 @@ jsxc.notice = {
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Index</a></h2><h3>Namespaces</h3><ul><li><a href="jsxc.html">jsxc</a></li><li><a href="jsxc.gui.html">gui</a></li><li><a href="jsxc.gui.dialog.html">dialog</a></li><li><a href="jsxc.gui.queryActions.html">queryActions</a></li><li><a href="jsxc.gui.roster.html">roster</a></li><li><a href="jsxc.gui.window.html">window</a></li><li><a href="jsxc.muc.html">muc</a></li><li><a href="jsxc.notification.html">notification</a></li><li><a href="jsxc.options.html">options</a></li><li><a href="jsxc.otr.html">otr</a></li><li><a href="jsxc.storage.html">storage</a></li><li><a href="jsxc.webrtc.html">webrtc</a></li><li><a href="jsxc.xmpp.html">xmpp</a></li><li><a href="jsxc.xmpp.bookmarks.html">bookmarks</a></li><li><a href="jsxc.xmpp.carbons.html">carbons</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="jsxc.Message.html">Message</a></li></ul><h3>Namespaces</h3><ul><li><a href="jsxc.html">jsxc</a></li><li><a href="jsxc.gui.html">gui</a></li><li><a href="jsxc.gui.dialog.html">dialog</a></li><li><a href="jsxc.gui.queryActions.html">queryActions</a></li><li><a href="jsxc.gui.roster.html">roster</a></li><li><a href="jsxc.gui.window.html">window</a></li><li><a href="jsxc.muc.html">muc</a></li><li><a href="jsxc.notification.html">notification</a></li><li><a href="jsxc.options.html">options</a></li><li><a href="jsxc.otr.html">otr</a></li><li><a href="jsxc.storage.html">storage</a></li><li><a href="jsxc.tab.html">tab</a></li><li><a href="jsxc.webrtc.html">webrtc</a></li><li><a href="jsxc.xmpp.html">xmpp</a></li><li><a href="jsxc.xmpp.bookmarks.html">bookmarks</a></li><li><a href="jsxc.xmpp.carbons.html">carbons</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
</nav>
|
||||
|
||||
<br clear="both">
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Tue Nov 17 2015 17:01:04 GMT+0100 (CET)
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.2</a> on Fri Oct 28 2016 13:29:05 GMT+0200 (CEST)
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>JSDoc: Source: jsxc.lib.notification.js</title>
|
||||
|
||||
|
||||
<script src="scripts/prettify/prettify.js"> </script>
|
||||
<script src="scripts/prettify/lang-css.js"> </script>
|
||||
<!--[if lt IE 9]>
|
||||
@@ -16,16 +16,17 @@
|
||||
<body>
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<h1 class="page-title">Source: jsxc.lib.notification.js</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<article>
|
||||
<pre class="prettyprint source"><code>/**
|
||||
<pre class="prettyprint source linenums"><code>/**
|
||||
* This namespace handles the Notification API.
|
||||
*
|
||||
* @namespace jsxc.notification
|
||||
@@ -42,7 +43,7 @@ jsxc.notification = {
|
||||
*/
|
||||
init: function() {
|
||||
$(document).on('postmessagein.jsxc', function(event, bid, msg) {
|
||||
msg = (msg.match(/^\?OTR/)) ? $.t('Encrypted_message') : msg;
|
||||
msg = (msg && msg.match(/^\?OTR/)) ? $.t('Encrypted_message') : msg;
|
||||
var data = jsxc.storage.getUserItem('buddy', bid);
|
||||
|
||||
jsxc.notification.notify({
|
||||
@@ -82,7 +83,7 @@ jsxc.notification = {
|
||||
|
||||
var o;
|
||||
|
||||
if (title !== null && typeof title === 'object') {
|
||||
if (title !== null && typeof title === 'object') {
|
||||
o = title;
|
||||
} else {
|
||||
o = {
|
||||
@@ -96,7 +97,7 @@ jsxc.notification = {
|
||||
};
|
||||
}
|
||||
|
||||
if (jsxc.hasFocus() && !o.force) {
|
||||
if (jsxc.hasFocus() && !o.force) {
|
||||
return; // Tab is visible
|
||||
}
|
||||
|
||||
@@ -106,7 +107,7 @@ jsxc.notification = {
|
||||
var data = jsxc.storage.getUserItem('buddy', o.source);
|
||||
var src = jsxc.storage.getUserItem('avatar', data.avatar);
|
||||
|
||||
if (typeof src === 'string' && src !== '0') {
|
||||
if (typeof src === 'string' && src !== '0') {
|
||||
icon = src;
|
||||
}
|
||||
}
|
||||
@@ -240,7 +241,7 @@ jsxc.notification = {
|
||||
return;
|
||||
}
|
||||
|
||||
if (jsxc.hasFocus() && !force) {
|
||||
if (jsxc.hasFocus() && !force) {
|
||||
// tab is visible
|
||||
return;
|
||||
}
|
||||
@@ -263,7 +264,7 @@ jsxc.notification = {
|
||||
stopSound: function() {
|
||||
var audio = jsxc.notification.audio;
|
||||
|
||||
if (typeof audio !== 'undefined' && audio !== null) {
|
||||
if (typeof audio !== 'undefined' && audio !== null) {
|
||||
audio.pause();
|
||||
jsxc.notification.audio = null;
|
||||
}
|
||||
@@ -309,13 +310,13 @@ jsxc.notification = {
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Index</a></h2><h3>Namespaces</h3><ul><li><a href="jsxc.html">jsxc</a></li><li><a href="jsxc.gui.html">gui</a></li><li><a href="jsxc.gui.dialog.html">dialog</a></li><li><a href="jsxc.gui.queryActions.html">queryActions</a></li><li><a href="jsxc.gui.roster.html">roster</a></li><li><a href="jsxc.gui.window.html">window</a></li><li><a href="jsxc.muc.html">muc</a></li><li><a href="jsxc.notification.html">notification</a></li><li><a href="jsxc.options.html">options</a></li><li><a href="jsxc.otr.html">otr</a></li><li><a href="jsxc.storage.html">storage</a></li><li><a href="jsxc.webrtc.html">webrtc</a></li><li><a href="jsxc.xmpp.html">xmpp</a></li><li><a href="jsxc.xmpp.bookmarks.html">bookmarks</a></li><li><a href="jsxc.xmpp.carbons.html">carbons</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="jsxc.Message.html">Message</a></li></ul><h3>Namespaces</h3><ul><li><a href="jsxc.html">jsxc</a></li><li><a href="jsxc.gui.html">gui</a></li><li><a href="jsxc.gui.dialog.html">dialog</a></li><li><a href="jsxc.gui.queryActions.html">queryActions</a></li><li><a href="jsxc.gui.roster.html">roster</a></li><li><a href="jsxc.gui.window.html">window</a></li><li><a href="jsxc.muc.html">muc</a></li><li><a href="jsxc.notification.html">notification</a></li><li><a href="jsxc.options.html">options</a></li><li><a href="jsxc.otr.html">otr</a></li><li><a href="jsxc.storage.html">storage</a></li><li><a href="jsxc.tab.html">tab</a></li><li><a href="jsxc.webrtc.html">webrtc</a></li><li><a href="jsxc.xmpp.html">xmpp</a></li><li><a href="jsxc.xmpp.bookmarks.html">bookmarks</a></li><li><a href="jsxc.xmpp.carbons.html">carbons</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
</nav>
|
||||
|
||||
<br clear="both">
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Tue Nov 17 2015 17:01:04 GMT+0100 (CET)
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.2</a> on Fri Oct 28 2016 13:29:05 GMT+0200 (CEST)
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>JSDoc: Source: jsxc.lib.options.js</title>
|
||||
|
||||
|
||||
<script src="scripts/prettify/prettify.js"> </script>
|
||||
<script src="scripts/prettify/lang-css.js"> </script>
|
||||
<!--[if lt IE 9]>
|
||||
@@ -16,16 +16,17 @@
|
||||
<body>
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<h1 class="page-title">Source: jsxc.lib.options.js</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<article>
|
||||
<pre class="prettyprint source"><code>/**
|
||||
<pre class="prettyprint source linenums"><code>/**
|
||||
* Set some options for the chat.
|
||||
*
|
||||
* @namespace jsxc.options
|
||||
@@ -64,6 +65,12 @@ jsxc.options = {
|
||||
/** XMPP password */
|
||||
password: null,
|
||||
|
||||
/** session id */
|
||||
sid: null,
|
||||
|
||||
/** request id */
|
||||
rid: null,
|
||||
|
||||
/** True: Allow user to overwrite xmpp settings */
|
||||
overwrite: false,
|
||||
|
||||
@@ -80,6 +87,15 @@ jsxc.options = {
|
||||
dnd: 0
|
||||
},
|
||||
|
||||
/**
|
||||
* This function is called if a login form was found, but before any
|
||||
* modification is done to it.
|
||||
*
|
||||
* @memberOf jsxc.options
|
||||
* @function
|
||||
*/
|
||||
formFound: null,
|
||||
|
||||
/** If all 3 properties are set and enable is true, the login form is used */
|
||||
loginForm: {
|
||||
/** False, disables login through login form */
|
||||
@@ -117,9 +133,24 @@ jsxc.options = {
|
||||
*/
|
||||
onAuthFail: 'submit',
|
||||
|
||||
/** True: Attach connection even is login form was found */
|
||||
/**
|
||||
* True: Attach connection even is login form was found.
|
||||
*
|
||||
* @type {Boolean}
|
||||
* @deprecated since 3.0.0. Use now loginForm.ifFound (true => attach, false => pause)
|
||||
*/
|
||||
attachIfFound: true,
|
||||
|
||||
/**
|
||||
* Describes what we should do if login form was found:
|
||||
* - Attach connection
|
||||
* - Force new connection with loginForm.jid and loginForm.passed
|
||||
* - Pause connection and do nothing
|
||||
*
|
||||
* @type {(attach|force|pause)}
|
||||
*/
|
||||
ifFound: 'attach',
|
||||
|
||||
/**
|
||||
* True: Display roster minimized after first login. Afterwards the last
|
||||
* roster state will be used.
|
||||
@@ -151,9 +182,6 @@ jsxc.options = {
|
||||
/** Absolute path root of JSXC installation */
|
||||
root: '',
|
||||
|
||||
/** Timeout for restore in ms */
|
||||
loginTimeout: 1000 * 60 * 10,
|
||||
|
||||
/**
|
||||
* This function decides wether the roster will be displayed or not if no
|
||||
* connection is found.
|
||||
@@ -200,10 +228,10 @@ jsxc.options = {
|
||||
*
|
||||
* @memberOf jsxc.options
|
||||
* @param data Holds all data as key/value
|
||||
* @returns {boolean} false if function failes
|
||||
* @param cb Called with true on success, false otherwise
|
||||
*/
|
||||
saveSettinsPermanent: function() {
|
||||
|
||||
saveSettinsPermanent: function(data, cb) {
|
||||
cb(true);
|
||||
},
|
||||
|
||||
carbons: {
|
||||
@@ -250,6 +278,9 @@ jsxc.options = {
|
||||
/** [optional] If set, jsxc requests and uses RTCPeerConfig from this url */
|
||||
url: null,
|
||||
|
||||
/** If true, jsxc send cookies when requesting RTCPeerConfig from the url above */
|
||||
withCredentials: false,
|
||||
|
||||
/** ICE servers like defined in http://www.w3.org/TR/webrtc/#idl-def-RTCIceServer */
|
||||
iceServers: [{
|
||||
urls: 'stun:stun.stunprotocol.org'
|
||||
@@ -257,7 +288,25 @@ jsxc.options = {
|
||||
},
|
||||
|
||||
/** Link to an online user manual */
|
||||
onlineHelp: 'http://www.jsxc.org/manual.html'
|
||||
onlineHelp: 'http://www.jsxc.org/manual.html',
|
||||
|
||||
viewport: {
|
||||
getSize: function() {
|
||||
var w = $(window).width() - $('#jsxc_windowListSB').width();
|
||||
var h = $(window).height();
|
||||
|
||||
if (jsxc.storage.getUserItem('roster') === 'shown') {
|
||||
w -= $('#jsxc_roster').outerWidth(true);
|
||||
}
|
||||
|
||||
return {
|
||||
width: w,
|
||||
height: h
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
maxStorableSize: 1000000
|
||||
};
|
||||
</code></pre>
|
||||
</article>
|
||||
@@ -269,13 +318,13 @@ jsxc.options = {
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Index</a></h2><h3>Namespaces</h3><ul><li><a href="jsxc.html">jsxc</a></li><li><a href="jsxc.gui.html">gui</a></li><li><a href="jsxc.gui.dialog.html">dialog</a></li><li><a href="jsxc.gui.queryActions.html">queryActions</a></li><li><a href="jsxc.gui.roster.html">roster</a></li><li><a href="jsxc.gui.window.html">window</a></li><li><a href="jsxc.muc.html">muc</a></li><li><a href="jsxc.notification.html">notification</a></li><li><a href="jsxc.options.html">options</a></li><li><a href="jsxc.otr.html">otr</a></li><li><a href="jsxc.storage.html">storage</a></li><li><a href="jsxc.webrtc.html">webrtc</a></li><li><a href="jsxc.xmpp.html">xmpp</a></li><li><a href="jsxc.xmpp.bookmarks.html">bookmarks</a></li><li><a href="jsxc.xmpp.carbons.html">carbons</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="jsxc.Message.html">Message</a></li></ul><h3>Namespaces</h3><ul><li><a href="jsxc.html">jsxc</a></li><li><a href="jsxc.gui.html">gui</a></li><li><a href="jsxc.gui.dialog.html">dialog</a></li><li><a href="jsxc.gui.queryActions.html">queryActions</a></li><li><a href="jsxc.gui.roster.html">roster</a></li><li><a href="jsxc.gui.window.html">window</a></li><li><a href="jsxc.muc.html">muc</a></li><li><a href="jsxc.notification.html">notification</a></li><li><a href="jsxc.options.html">options</a></li><li><a href="jsxc.otr.html">otr</a></li><li><a href="jsxc.storage.html">storage</a></li><li><a href="jsxc.tab.html">tab</a></li><li><a href="jsxc.webrtc.html">webrtc</a></li><li><a href="jsxc.xmpp.html">xmpp</a></li><li><a href="jsxc.xmpp.bookmarks.html">bookmarks</a></li><li><a href="jsxc.xmpp.carbons.html">carbons</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
</nav>
|
||||
|
||||
<br clear="both">
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Tue Nov 17 2015 17:01:04 GMT+0100 (CET)
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.2</a> on Fri Oct 28 2016 13:29:05 GMT+0200 (CEST)
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
+91
-46
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>JSDoc: Source: jsxc.lib.otr.js</title>
|
||||
|
||||
|
||||
<script src="scripts/prettify/prettify.js"> </script>
|
||||
<script src="scripts/prettify/lang-css.js"> </script>
|
||||
<!--[if lt IE 9]>
|
||||
@@ -16,16 +16,17 @@
|
||||
<body>
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<h1 class="page-title">Source: jsxc.lib.otr.js</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<article>
|
||||
<pre class="prettyprint source"><code>/**
|
||||
<pre class="prettyprint source linenums"><code>/**
|
||||
* @namespace jsxc.otr
|
||||
*/
|
||||
jsxc.otr = {
|
||||
@@ -51,10 +52,24 @@ jsxc.otr = {
|
||||
jsxc.otr.backup(bid);
|
||||
}
|
||||
|
||||
if (jsxc.otr.objects[bid].msgstate !== OTR.CONST.MSGSTATE_PLAINTEXT && !d.encrypted) {
|
||||
jsxc.gui.window.postMessage(bid, 'sys', $.t('Received_an_unencrypted_message') + '. [' + d.msg + ']', d.encrypted, d.forwarded, d.stamp);
|
||||
if (jsxc.otr.objects[bid].msgstate !== OTR.CONST.MSGSTATE_PLAINTEXT && !d.encrypted) {
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: bid,
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: $.t('Received_an_unencrypted_message') + '. [' + d.msg + ']',
|
||||
encrypted: d.encrypted,
|
||||
forwarded: d.forwarded,
|
||||
stamp: d.stamp
|
||||
});
|
||||
} else {
|
||||
jsxc.gui.window.postMessage(bid, 'in', d.msg, d.encrypted, d.forwarded, d.stamp);
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: bid,
|
||||
direction: jsxc.Message.IN,
|
||||
msg: d.msg,
|
||||
encrypted: d.encrypted,
|
||||
forwarded: d.forwarded,
|
||||
stamp: d.stamp
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
@@ -114,7 +129,11 @@ jsxc.otr = {
|
||||
|
||||
switch (status) {
|
||||
case OTR.CONST.STATUS_SEND_QUERY:
|
||||
jsxc.gui.window.postMessage(bid, 'sys', $.t('trying_to_start_private_conversation'));
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: bid,
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: $.t('trying_to_start_private_conversation')
|
||||
});
|
||||
break;
|
||||
case OTR.CONST.STATUS_AKE_SUCCESS:
|
||||
data.fingerprint = jsxc.otr.objects[bid].their_priv_pk.fingerprint();
|
||||
@@ -123,7 +142,11 @@ jsxc.otr = {
|
||||
var msg_state = jsxc.otr.objects[bid].trust ? 'Verified' : 'Unverified';
|
||||
var msg = $.t(msg_state + '_private_conversation_started');
|
||||
|
||||
jsxc.gui.window.postMessage(bid, 'sys', msg);
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: bid,
|
||||
direction: 'sys',
|
||||
msg: msg
|
||||
});
|
||||
break;
|
||||
case OTR.CONST.STATUS_END_OTR:
|
||||
data.fingerprint = null;
|
||||
@@ -132,13 +155,21 @@ jsxc.otr = {
|
||||
// we abort the private conversation
|
||||
|
||||
data.msgstate = OTR.CONST.MSGSTATE_PLAINTEXT;
|
||||
jsxc.gui.window.postMessage(bid, 'sys', $.t('private_conversation_aborted'));
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: bid,
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: $.t('private_conversation_aborted')
|
||||
});
|
||||
|
||||
} else {
|
||||
// the buddy abort the private conversation
|
||||
|
||||
data.msgstate = OTR.CONST.MSGSTATE_FINISHED;
|
||||
jsxc.gui.window.postMessage(bid, 'sys', $.t('your_buddy_closed_the_private_conversation_you_should_do_the_same'));
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: bid,
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: $.t('your_buddy_closed_the_private_conversation_you_should_do_the_same')
|
||||
});
|
||||
}
|
||||
break;
|
||||
case OTR.CONST.STATUS_SMP_HANDLE:
|
||||
@@ -155,15 +186,14 @@ jsxc.otr = {
|
||||
jsxc.otr.objects[bid].on('smp', function(type, data) {
|
||||
switch (type) {
|
||||
case 'question': // verification request received
|
||||
jsxc.gui.window.postMessage(bid, 'sys', $.t('Authentication_request_received'));
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: bid,
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: $.t('Authentication_request_received')
|
||||
});
|
||||
|
||||
if ($('#jsxc_dialog').length > 0) {
|
||||
jsxc.otr.objects[bid].sm.abort();
|
||||
break;
|
||||
}
|
||||
|
||||
jsxc.otr.onSmpQuestion(bid, data);
|
||||
jsxc.storage.setUserItem('smp_' + bid, {
|
||||
jsxc.gui.window.smpRequest(bid, data);
|
||||
jsxc.storage.setUserItem('smp', bid, {
|
||||
data: data || null
|
||||
});
|
||||
|
||||
@@ -175,15 +205,28 @@ jsxc.otr = {
|
||||
jsxc.gui.update(bid);
|
||||
|
||||
if (data) {
|
||||
jsxc.gui.window.postMessage(bid, 'sys', $.t('conversation_is_now_verified'));
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: bid,
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: $.t('conversation_is_now_verified')
|
||||
});
|
||||
} else {
|
||||
jsxc.gui.window.postMessage(bid, 'sys', $.t('authentication_failed'));
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: bid,
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: $.t('authentication_failed')
|
||||
});
|
||||
}
|
||||
jsxc.storage.removeUserItem('smp_' + bid);
|
||||
jsxc.gui.dialog.close();
|
||||
jsxc.storage.removeUserItem('smp', bid);
|
||||
jsxc.gui.dialog.close('smp');
|
||||
break;
|
||||
case 'abort':
|
||||
jsxc.gui.window.postMessage(bid, 'sys', $.t('Authentication_aborted'));
|
||||
jsxc.gui.window.hideOverlay(bid);
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: bid,
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: $.t('Authentication_aborted')
|
||||
});
|
||||
break;
|
||||
default:
|
||||
jsxc.debug('[OTR] sm callback: Unknown type: ' + type);
|
||||
@@ -213,7 +256,11 @@ jsxc.otr = {
|
||||
jsxc.otr.objects[bid].on('error', function(err) {
|
||||
// Handle this case in jsxc.otr.receiveMessage
|
||||
if (err !== 'Received an unencrypted message.') {
|
||||
jsxc.gui.window.postMessage(bid, 'sys', '[OTR] ' + $.t(err));
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: bid,
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: '[OTR] ' + $.t(err)
|
||||
});
|
||||
}
|
||||
|
||||
jsxc.error('[OTR] ' + err);
|
||||
@@ -237,14 +284,16 @@ jsxc.otr = {
|
||||
|
||||
if (data) {
|
||||
$('#jsxc_dialog > div:eq(2)').find('#jsxc_quest').val(data).prop('disabled', true);
|
||||
$('#jsxc_dialog > div:eq(2)').find('.jsxc_submit').text($('Answer'));
|
||||
$('#jsxc_dialog > div:eq(2)').find('.jsxc_submit').text($.t('Answer'));
|
||||
$('#jsxc_dialog > div:eq(2)').find('.jsxc_explanation').text($.t('onsmp_explanation_question'));
|
||||
$('#jsxc_dialog > div:eq(2)').show();
|
||||
} else {
|
||||
$('#jsxc_dialog > div:eq(3)').find('.jsxc_explanation').text($.t('onsmp_explanation_secret'));
|
||||
$('#jsxc_dialog > div:eq(3)').show();
|
||||
}
|
||||
|
||||
$('#jsxc_dialog .jsxc_close').click(function() {
|
||||
jsxc.storage.removeUserItem('smp_' + bid);
|
||||
jsxc.storage.removeUserItem('smp', bid);
|
||||
|
||||
if (jsxc.master) {
|
||||
jsxc.otr.objects[bid].sm.abort();
|
||||
@@ -345,7 +394,7 @@ jsxc.otr = {
|
||||
r.their_priv_pk = JSON.stringify(o.their_priv_pk.packPublic());
|
||||
}
|
||||
|
||||
if (o.ake.otr_version && o.ake.otr_version !== '') {
|
||||
if (o.ake.otr_version && o.ake.otr_version !== '') {
|
||||
r.otr_version = JSON.stringify(o.ake.otr_version);
|
||||
}
|
||||
|
||||
@@ -366,10 +415,10 @@ jsxc.otr = {
|
||||
for (key in d) {
|
||||
if (d.hasOwnProperty(key)) {
|
||||
var val = JSON.parse(d[key]);
|
||||
if (key === 'their_priv_pk' && val !== null) {
|
||||
if (key === 'their_priv_pk' && val !== null) {
|
||||
val = DSA.parsePublic(val);
|
||||
}
|
||||
if (key === 'otr_version' && val !== null) {
|
||||
if (key === 'otr_version' && val !== null) {
|
||||
o.ake.otr_version = val;
|
||||
} else {
|
||||
o[key] = val;
|
||||
@@ -379,7 +428,7 @@ jsxc.otr = {
|
||||
|
||||
jsxc.otr.objects[bid] = o;
|
||||
|
||||
if (o.msgstate === 1 && o.their_priv_pk !== null) {
|
||||
if (o.msgstate === 1 && o.their_priv_pk !== null) {
|
||||
o._smInit.call(jsxc.otr.objects[bid]);
|
||||
}
|
||||
}
|
||||
@@ -407,8 +456,6 @@ jsxc.otr = {
|
||||
MSGSTATE_FINISHED: 2
|
||||
};
|
||||
|
||||
jsxc._onMaster();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -431,8 +478,6 @@ jsxc.otr = {
|
||||
if (!jsxc.otr.dsaFallback) {
|
||||
// create DSA key in background
|
||||
|
||||
jsxc._onMaster();
|
||||
|
||||
worker.onmessage = function(e) {
|
||||
var type = e.data.type;
|
||||
var val = e.data.val;
|
||||
@@ -444,6 +489,8 @@ jsxc.otr = {
|
||||
}
|
||||
};
|
||||
|
||||
jsxc.debug('DSA key creation started.');
|
||||
|
||||
// start worker
|
||||
worker.postMessage({
|
||||
imports: [jsxc.options.root + '/lib/otr/vendor/salsa20.js', jsxc.options.root + '/lib/otr/vendor/bigint.js', jsxc.options.root + '/lib/otr/vendor/crypto.js', jsxc.options.root + '/lib/otr/vendor/eventemitter.js', jsxc.options.root + '/lib/otr/lib/const.js', jsxc.options.root + '/lib/otr/lib/helpers.js', jsxc.options.root + '/lib/otr/lib/dsa.js'],
|
||||
@@ -453,12 +500,13 @@ jsxc.otr = {
|
||||
|
||||
} else {
|
||||
// fallback
|
||||
jsxc.xmpp.conn.pause();
|
||||
|
||||
jsxc.gui.dialog.open(jsxc.gui.template.get('waitAlert', null, msg), {
|
||||
noClose: true
|
||||
});
|
||||
|
||||
jsxc.debug('DSA key creation started.');
|
||||
jsxc.debug('DSA key creation started in fallback mode.');
|
||||
|
||||
// wait until the wait alert is opened
|
||||
setTimeout(function() {
|
||||
@@ -481,9 +529,9 @@ jsxc.otr = {
|
||||
|
||||
jsxc.storage.setUserItem('priv_fingerprint', jsxc.options.otr.priv.fingerprint());
|
||||
|
||||
if (jsxc.otr.dsaFallback !== false) {
|
||||
jsxc._onMaster();
|
||||
}
|
||||
$.each(jsxc.storage.getUserItem('windowlist') || [], function(index, val) {
|
||||
jsxc.otr.create(val);
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -497,11 +545,8 @@ jsxc.otr = {
|
||||
|
||||
// close wait alert
|
||||
if (jsxc.otr.dsaFallback) {
|
||||
jsxc.xmpp.conn.resume();
|
||||
jsxc.gui.dialog.close();
|
||||
} else {
|
||||
$.each(jsxc.storage.getUserItem('windowlist'), function(index, val) {
|
||||
jsxc.otr.create(val);
|
||||
});
|
||||
}
|
||||
|
||||
jsxc.otr._createDSA();
|
||||
@@ -521,13 +566,13 @@ jsxc.otr = {
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Index</a></h2><h3>Namespaces</h3><ul><li><a href="jsxc.html">jsxc</a></li><li><a href="jsxc.gui.html">gui</a></li><li><a href="jsxc.gui.dialog.html">dialog</a></li><li><a href="jsxc.gui.queryActions.html">queryActions</a></li><li><a href="jsxc.gui.roster.html">roster</a></li><li><a href="jsxc.gui.window.html">window</a></li><li><a href="jsxc.muc.html">muc</a></li><li><a href="jsxc.notification.html">notification</a></li><li><a href="jsxc.options.html">options</a></li><li><a href="jsxc.otr.html">otr</a></li><li><a href="jsxc.storage.html">storage</a></li><li><a href="jsxc.webrtc.html">webrtc</a></li><li><a href="jsxc.xmpp.html">xmpp</a></li><li><a href="jsxc.xmpp.bookmarks.html">bookmarks</a></li><li><a href="jsxc.xmpp.carbons.html">carbons</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="jsxc.Message.html">Message</a></li></ul><h3>Namespaces</h3><ul><li><a href="jsxc.html">jsxc</a></li><li><a href="jsxc.gui.html">gui</a></li><li><a href="jsxc.gui.dialog.html">dialog</a></li><li><a href="jsxc.gui.queryActions.html">queryActions</a></li><li><a href="jsxc.gui.roster.html">roster</a></li><li><a href="jsxc.gui.window.html">window</a></li><li><a href="jsxc.muc.html">muc</a></li><li><a href="jsxc.notification.html">notification</a></li><li><a href="jsxc.options.html">options</a></li><li><a href="jsxc.otr.html">otr</a></li><li><a href="jsxc.storage.html">storage</a></li><li><a href="jsxc.tab.html">tab</a></li><li><a href="jsxc.webrtc.html">webrtc</a></li><li><a href="jsxc.xmpp.html">xmpp</a></li><li><a href="jsxc.xmpp.bookmarks.html">bookmarks</a></li><li><a href="jsxc.xmpp.carbons.html">carbons</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
</nav>
|
||||
|
||||
<br clear="both">
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Tue Nov 17 2015 17:01:04 GMT+0100 (CET)
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.2</a> on Fri Oct 28 2016 13:29:05 GMT+0200 (CEST)
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
+107
-117
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>JSDoc: Source: jsxc.lib.storage.js</title>
|
||||
|
||||
|
||||
<script src="scripts/prettify/prettify.js"> </script>
|
||||
<script src="scripts/prettify/lang-css.js"> </script>
|
||||
<!--[if lt IE 9]>
|
||||
@@ -16,24 +16,25 @@
|
||||
<body>
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<h1 class="page-title">Source: jsxc.lib.storage.js</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<article>
|
||||
<pre class="prettyprint source"><code>/**
|
||||
<pre class="prettyprint source linenums"><code>/**
|
||||
* Handle long-live data
|
||||
*
|
||||
*
|
||||
* @namespace jsxc.storage
|
||||
*/
|
||||
jsxc.storage = {
|
||||
/**
|
||||
* Prefix for localstorage
|
||||
*
|
||||
*
|
||||
* @privat
|
||||
*/
|
||||
PREFIX: 'jsxc',
|
||||
@@ -48,12 +49,16 @@ jsxc.storage = {
|
||||
getPrefix: function(uk) {
|
||||
var self = jsxc.storage;
|
||||
|
||||
return self.PREFIX + self.SEP + ((uk && jsxc.bid) ? jsxc.bid + self.SEP : '');
|
||||
if (uk && !jsxc.bid) {
|
||||
console.trace('Unable to create user prefix');
|
||||
}
|
||||
|
||||
return self.PREFIX + self.SEP + ((uk && jsxc.bid) ? jsxc.bid + self.SEP : '');
|
||||
},
|
||||
|
||||
/**
|
||||
* Save item to storage
|
||||
*
|
||||
*
|
||||
* @function
|
||||
* @param {String} key variablename
|
||||
* @param {Object} value value
|
||||
@@ -62,8 +67,8 @@ jsxc.storage = {
|
||||
setItem: function(key, value, uk) {
|
||||
|
||||
// Workaround for non-conform browser
|
||||
if (jsxc.storageNotConform > 0 && key !== 'rid' && key !== 'lastActivity') {
|
||||
if (jsxc.storageNotConform > 1 && jsxc.toSNC === null) {
|
||||
if (jsxc.storageNotConform > 0 && key !== 'rid') {
|
||||
if (jsxc.storageNotConform > 1 && jsxc.toSNC === null) {
|
||||
jsxc.toSNC = window.setTimeout(function() {
|
||||
jsxc.storageNotConform = 0;
|
||||
jsxc.storage.setItem('storageNotConform', 0);
|
||||
@@ -104,7 +109,7 @@ jsxc.storage = {
|
||||
|
||||
/**
|
||||
* Load item from storage
|
||||
*
|
||||
*
|
||||
* @function
|
||||
* @param {String} key variablename
|
||||
* @param {String} uk Userkey? Should we add the bid as prefix?
|
||||
@@ -122,7 +127,7 @@ jsxc.storage = {
|
||||
|
||||
/**
|
||||
* Get a user item from storage.
|
||||
*
|
||||
*
|
||||
* @param key
|
||||
* @returns user item
|
||||
*/
|
||||
@@ -140,15 +145,15 @@ jsxc.storage = {
|
||||
|
||||
/**
|
||||
* Remove item from storage
|
||||
*
|
||||
*
|
||||
* @function
|
||||
* @param {String} key variablename
|
||||
* @param {String} uk Userkey? Should we add the bid as prefix?
|
||||
*/
|
||||
removeItem: function(key, uk) {
|
||||
|
||||
// Workaround for non-conform browser
|
||||
if (jsxc.storageNotConform && key !== 'rid' && key !== 'lastActivity') {
|
||||
// Workaround for non-conforming browser
|
||||
if (jsxc.storageNotConform && key !== 'rid') {
|
||||
jsxc.ls.push(JSON.stringify({
|
||||
key: jsxc.storage.prefix + key,
|
||||
value: ''
|
||||
@@ -160,7 +165,7 @@ jsxc.storage = {
|
||||
|
||||
/**
|
||||
* Remove user item from storage.
|
||||
*
|
||||
*
|
||||
* @param key
|
||||
*/
|
||||
removeUserItem: function(type, key) {
|
||||
@@ -177,7 +182,7 @@ jsxc.storage = {
|
||||
|
||||
/**
|
||||
* Updates value of a variable in a saved object.
|
||||
*
|
||||
*
|
||||
* @function
|
||||
* @param {String} key variablename
|
||||
* @param {String|object} variable variablename in object or object with
|
||||
@@ -211,16 +216,17 @@ jsxc.storage = {
|
||||
|
||||
/**
|
||||
* Updates value of a variable in a saved user object.
|
||||
*
|
||||
* @param {String} key variablename
|
||||
* @param {String|object} variable variablename in object or object with
|
||||
*
|
||||
* @param {String} type variable type (a prefix)
|
||||
* @param {String} key variable name
|
||||
* @param {String|object} variable variable name in object or object with
|
||||
* variable/key pairs
|
||||
* @param {Object} [value] value
|
||||
* @param {Object} [value] value (not used if the variable was an object)
|
||||
*/
|
||||
updateUserItem: function(type, key, variable, value) {
|
||||
var self = jsxc.storage;
|
||||
|
||||
if (arguments.length === 4 || (arguments.length === 3 && typeof variable === 'object')) {
|
||||
if (arguments.length === 4 || (arguments.length === 3 && typeof variable === 'object')) {
|
||||
key = type + self.SEP + key;
|
||||
} else {
|
||||
value = variable;
|
||||
@@ -232,8 +238,8 @@ jsxc.storage = {
|
||||
},
|
||||
|
||||
/**
|
||||
* Inkrements value
|
||||
*
|
||||
* Increments value
|
||||
*
|
||||
* @function
|
||||
* @param {String} key variablename
|
||||
* @param {String} uk Userkey? Should we add the bid as prefix?
|
||||
@@ -245,7 +251,7 @@ jsxc.storage = {
|
||||
|
||||
/**
|
||||
* Remove element from array or object
|
||||
*
|
||||
*
|
||||
* @param {string} key name of array or object
|
||||
* @param {string} name name of element in array or object
|
||||
* @param {String} uk Userkey? Should we add the bid as prefix?
|
||||
@@ -258,7 +264,7 @@ jsxc.storage = {
|
||||
item = $.grep(item, function(e) {
|
||||
return e !== name;
|
||||
});
|
||||
} else if (typeof(item) === 'object' && item !== null) {
|
||||
} else if (typeof(item) === 'object' && item !== null) {
|
||||
delete item[name];
|
||||
}
|
||||
|
||||
@@ -280,10 +286,10 @@ jsxc.storage = {
|
||||
|
||||
/**
|
||||
* Triggered if changes are recognized
|
||||
*
|
||||
*
|
||||
* @function
|
||||
* @param {event} e Storageevent
|
||||
* @param {String} e.key Keyname which triggered event
|
||||
* @param {event} e Storage event
|
||||
* @param {String} e.key Key name which triggered event
|
||||
* @param {Object} e.oldValue Old Value for key
|
||||
* @param {Object} e.newValue New Value for key
|
||||
* @param {String} e.url
|
||||
@@ -291,16 +297,17 @@ jsxc.storage = {
|
||||
onStorage: function(e) {
|
||||
|
||||
// skip
|
||||
if (e.key === jsxc.storage.PREFIX + jsxc.storage.SEP + 'rid' || e.key === jsxc.storage.PREFIX + jsxc.storage.SEP + 'lastActivity') {
|
||||
if (e.key === jsxc.storage.PREFIX + jsxc.storage.SEP + 'rid' || !e.key) {
|
||||
return;
|
||||
}
|
||||
|
||||
var re = new RegExp('^' + jsxc.storage.PREFIX + jsxc.storage.SEP + '(?:[^' + jsxc.storage.SEP + ']+@[^' + jsxc.storage.SEP + ']+' + jsxc.storage.SEP + ')?(.*)', 'i');
|
||||
var key = e.key.replace(re, '$1');
|
||||
|
||||
// Workaround for non-conform browser: Triggered event on every page
|
||||
// Workaround for non-conforming browser, which trigger
|
||||
// events on every page (notably IE): Ignore own writes
|
||||
// (own)
|
||||
if (jsxc.storageNotConform > 0 && jsxc.ls.length > 0) {
|
||||
if (jsxc.storageNotConform > 0 && jsxc.ls.length > 0) {
|
||||
|
||||
var val = e.newValue;
|
||||
try {
|
||||
@@ -326,7 +333,7 @@ jsxc.storage = {
|
||||
}
|
||||
}
|
||||
|
||||
// Workaround for non-conform browser
|
||||
// Workaround for non-conforming browser
|
||||
if (e.oldValue === e.newValue) {
|
||||
return;
|
||||
}
|
||||
@@ -334,20 +341,35 @@ jsxc.storage = {
|
||||
var n, o;
|
||||
var bid = key.replace(new RegExp('[^' + jsxc.storage.SEP + ']+' + jsxc.storage.SEP + '(.*)', 'i'), '$1');
|
||||
|
||||
// react if someone ask, if there is a master
|
||||
if (jsxc.master && key === 'alive') {
|
||||
// react if someone asks whether there is a master
|
||||
if (jsxc.master && key === 'alive') {
|
||||
jsxc.debug('Master request.');
|
||||
|
||||
jsxc.storage.ink('alive');
|
||||
if (e.newValue && e.newValue.match(/:master$/)) {
|
||||
jsxc.warn('Master request from master. Something went wrong... :-(');
|
||||
return;
|
||||
}
|
||||
|
||||
jsxc.keepAlive();
|
||||
return;
|
||||
}
|
||||
|
||||
// master alive
|
||||
if (!jsxc.master && (key === 'alive' || key === 'alive_busy') && !jsxc.triggeredFromElement) {
|
||||
if (!jsxc.master && (key === 'alive' || key === 'alive_busy')) {
|
||||
|
||||
// reset timeout
|
||||
window.clearTimeout(jsxc.to);
|
||||
jsxc.to = window.setTimeout(jsxc.checkMaster, ((key === 'alive') ? jsxc.options.timeout : jsxc.options.busyTimeout) + jsxc.random(60));
|
||||
// reset timeouts
|
||||
jsxc.to = $.grep(jsxc.to, function(timeout) {
|
||||
window.clearTimeout(timeout);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
if (typeof e.newValue === 'undefined' || e.newValue === null) {
|
||||
jsxc.xmpp.disconnected();
|
||||
return;
|
||||
}
|
||||
|
||||
jsxc.to.push(window.setTimeout(jsxc.checkMaster, ((key === 'alive') ? jsxc.options.timeout : jsxc.options.busyTimeout) + jsxc.random(60)));
|
||||
|
||||
// only call the first time
|
||||
if (!jsxc.role_allocation) {
|
||||
@@ -357,6 +379,10 @@ jsxc.storage = {
|
||||
return;
|
||||
}
|
||||
|
||||
if (jsxc.master && key === 'sid' && !e.newValue) {
|
||||
jsxc.xmpp.logout(false);
|
||||
}
|
||||
|
||||
if (key.match(/^notices/)) {
|
||||
jsxc.notice.load();
|
||||
}
|
||||
@@ -365,10 +391,10 @@ jsxc.storage = {
|
||||
jsxc.gui.changePresence(e.newValue, true);
|
||||
}
|
||||
|
||||
if (key.match(/^options/) && e.newValue) {
|
||||
if (key.match(/^options/) && e.newValue) {
|
||||
n = JSON.parse(e.newValue);
|
||||
|
||||
if (typeof n.muteNotification !== 'undefined' && n.muteNotification) {
|
||||
if (typeof n.muteNotification !== 'undefined' && n.muteNotification) {
|
||||
jsxc.notification.muteSound(true);
|
||||
} else {
|
||||
jsxc.notification.unmuteSound(true);
|
||||
@@ -391,22 +417,24 @@ jsxc.storage = {
|
||||
}
|
||||
}
|
||||
|
||||
if (key.match(new RegExp('^chat' + jsxc.storage.SEP))) {
|
||||
if (key.match(new RegExp('^history' + jsxc.storage.SEP))) {
|
||||
|
||||
var posts = JSON.parse(e.newValue);
|
||||
var data, el;
|
||||
var history = JSON.parse(e.newValue);
|
||||
var uid, el, message;
|
||||
|
||||
while (posts.length > 0) {
|
||||
data = posts.pop();
|
||||
el = $('#' + data.uid);
|
||||
while (history.length > 0) {
|
||||
uid = history.pop();
|
||||
|
||||
message = new jsxc.Message(uid);
|
||||
el = message.getDOM();
|
||||
|
||||
if (el.length === 0) {
|
||||
if (jsxc.master && data.direction === 'out') {
|
||||
jsxc.xmpp.sendMessage(bid, data.msg, data.uid);
|
||||
if (jsxc.master && message.direction === jsxc.Message.OUT) {
|
||||
jsxc.xmpp.sendMessage(message.bid, message.msg, message._uid);
|
||||
}
|
||||
|
||||
jsxc.gui.window._postMessage(bid, data);
|
||||
} else if (data.received) {
|
||||
jsxc.gui.window._postMessage(message, true);
|
||||
} else if (message.isReceived()) {
|
||||
el.addClass('jsxc_received');
|
||||
}
|
||||
}
|
||||
@@ -449,7 +477,7 @@ jsxc.storage = {
|
||||
return;
|
||||
}
|
||||
|
||||
if (key.match(/^unreadMsg/) && jsxc.gui.favicon) {
|
||||
if (key.match(/^unreadMsg/) && jsxc.gui.favicon) {
|
||||
jsxc.gui.favicon.badge(parseInt(e.newValue) || 0);
|
||||
}
|
||||
|
||||
@@ -457,7 +485,8 @@ jsxc.storage = {
|
||||
|
||||
if (!e.newValue) {
|
||||
|
||||
jsxc.gui.dialog.close();
|
||||
jsxc.gui.dialog.close('smp');
|
||||
jsxc.gui.window.hideOverlay(bid);
|
||||
|
||||
if (jsxc.master) {
|
||||
jsxc.otr.objects[bid].sm.abort();
|
||||
@@ -470,22 +499,23 @@ jsxc.storage = {
|
||||
|
||||
if (typeof(n.data) !== 'undefined') {
|
||||
|
||||
jsxc.otr.onSmpQuestion(bid, n.data);
|
||||
jsxc.gui.window.smpRequest(bid, n.data);
|
||||
|
||||
} else if (jsxc.master && n.sec) {
|
||||
jsxc.gui.dialog.close();
|
||||
} else if (jsxc.master && n.sec) {
|
||||
jsxc.gui.dialog.close('smp');
|
||||
jsxc.gui.window.hideOverlay(bid);
|
||||
|
||||
jsxc.otr.sendSmpReq(bid, n.sec, n.quest);
|
||||
}
|
||||
}
|
||||
|
||||
if (!jsxc.master && key.match(new RegExp('^buddy' + jsxc.storage.SEP))) {
|
||||
if (!jsxc.master && key.match(new RegExp('^buddy' + jsxc.storage.SEP))) {
|
||||
|
||||
if (!e.newValue) {
|
||||
jsxc.gui.roster.purge(bid);
|
||||
return;
|
||||
}
|
||||
if (!e.oldValue) {
|
||||
if (jsxc.gui.roster.getItem(bid).length === 0) {
|
||||
jsxc.gui.roster.add(bid);
|
||||
return;
|
||||
}
|
||||
@@ -500,14 +530,14 @@ jsxc.storage = {
|
||||
}
|
||||
}
|
||||
|
||||
if (jsxc.master && key.match(new RegExp('^deletebuddy' + jsxc.storage.SEP)) && e.newValue) {
|
||||
if (jsxc.master && key.match(new RegExp('^deletebuddy' + jsxc.storage.SEP)) && e.newValue) {
|
||||
n = JSON.parse(e.newValue);
|
||||
|
||||
jsxc.xmpp.removeBuddy(n.jid);
|
||||
jsxc.storage.removeUserItem(key);
|
||||
}
|
||||
|
||||
if (jsxc.master && key.match(new RegExp('^buddy' + jsxc.storage.SEP))) {
|
||||
if (jsxc.master && key.match(new RegExp('^buddy' + jsxc.storage.SEP))) {
|
||||
|
||||
n = JSON.parse(e.newValue);
|
||||
o = JSON.parse(e.oldValue);
|
||||
@@ -528,38 +558,25 @@ jsxc.storage = {
|
||||
}
|
||||
}
|
||||
|
||||
// logout
|
||||
if (key === 'sid') {
|
||||
if (!e.newValue) {
|
||||
// if (jsxc.master && jsxc.xmpp.conn) {
|
||||
// jsxc.xmpp.conn.disconnect();
|
||||
// jsxc.triggeredFromElement = true;
|
||||
// }
|
||||
jsxc.xmpp.logout();
|
||||
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (key === 'friendReq') {
|
||||
n = JSON.parse(e.newValue);
|
||||
|
||||
if (jsxc.master && n.approve >= 0) {
|
||||
if (jsxc.master && n.approve >= 0) {
|
||||
jsxc.xmpp.resFriendReq(n.jid, n.approve);
|
||||
}
|
||||
}
|
||||
|
||||
if (jsxc.master && key.match(new RegExp('^add' + jsxc.storage.SEP))) {
|
||||
if (jsxc.master && key.match(new RegExp('^add' + jsxc.storage.SEP))) {
|
||||
n = JSON.parse(e.newValue);
|
||||
|
||||
jsxc.xmpp.addBuddy(n.username, n.alias);
|
||||
}
|
||||
|
||||
if (key === 'roster') {
|
||||
jsxc.gui.roster.toggle();
|
||||
jsxc.gui.roster.toggle(e.newValue);
|
||||
}
|
||||
|
||||
if (jsxc.master && key.match(new RegExp('^vcard' + jsxc.storage.SEP)) && e.newValue !== null && e.newValue.match(/^request:/)) {
|
||||
if (jsxc.master && key.match(new RegExp('^vcard' + jsxc.storage.SEP)) && e.newValue !== null && e.newValue.match(/^request:/)) {
|
||||
|
||||
jsxc.xmpp.loadVcard(bid, function(stanza) {
|
||||
jsxc.storage.setUserItem('vcard', bid, {
|
||||
@@ -573,7 +590,7 @@ jsxc.storage = {
|
||||
});
|
||||
}
|
||||
|
||||
if (!jsxc.master && key.match(new RegExp('^vcard' + jsxc.storage.SEP)) && e.newValue !== null && !e.newValue.match(/^request:/)) {
|
||||
if (!jsxc.master && key.match(new RegExp('^vcard' + jsxc.storage.SEP)) && e.newValue !== null && !e.newValue.match(/^request:/)) {
|
||||
n = JSON.parse(e.newValue);
|
||||
|
||||
if (typeof n.state !== 'undefined') {
|
||||
@@ -582,49 +599,22 @@ jsxc.storage = {
|
||||
|
||||
jsxc.storage.removeUserItem('vcard', bid);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Save message to storage.
|
||||
*
|
||||
* @memberOf jsxc.storage
|
||||
* @param bid
|
||||
* @param direction
|
||||
* @param msg
|
||||
* @param encrypted
|
||||
* @param forwarded
|
||||
* @param sender
|
||||
* @return post
|
||||
*/
|
||||
saveMessage: function(bid, direction, msg, encrypted, forwarded, stamp, sender) {
|
||||
var chat = jsxc.storage.getUserItem('chat', bid) || [];
|
||||
if (key === '_cmd' && e.newValue) {
|
||||
n = JSON.parse(e.newValue) || {};
|
||||
jsxc.storage.removeUserItem('_cmd');
|
||||
|
||||
var uid = new Date().getTime() + ':msg';
|
||||
if (n.cmd && n.target === jsxc.tab.CONST[jsxc.master ? 'MASTER' : 'SLAVE']) {
|
||||
jsxc.debug('Execute tab cmd: ' + n.cmd);
|
||||
|
||||
if (chat.length > jsxc.options.get('numberOfMsg')) {
|
||||
chat.pop();
|
||||
jsxc.exec(n.cmd, n.params);
|
||||
}
|
||||
}
|
||||
|
||||
var post = {
|
||||
direction: direction,
|
||||
msg: msg,
|
||||
uid: uid.replace(/:/, '-'),
|
||||
received: false,
|
||||
encrypted: encrypted || false,
|
||||
forwarded: forwarded || false,
|
||||
stamp: stamp || new Date().getTime(),
|
||||
sender: sender
|
||||
};
|
||||
|
||||
chat.unshift(post);
|
||||
jsxc.storage.setUserItem('chat', bid, chat);
|
||||
|
||||
return post;
|
||||
},
|
||||
|
||||
/**
|
||||
* Save or update buddy data.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.storage
|
||||
* @param bid
|
||||
* @param data
|
||||
@@ -664,13 +654,13 @@ jsxc.storage = {
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Index</a></h2><h3>Namespaces</h3><ul><li><a href="jsxc.html">jsxc</a></li><li><a href="jsxc.gui.html">gui</a></li><li><a href="jsxc.gui.dialog.html">dialog</a></li><li><a href="jsxc.gui.queryActions.html">queryActions</a></li><li><a href="jsxc.gui.roster.html">roster</a></li><li><a href="jsxc.gui.window.html">window</a></li><li><a href="jsxc.muc.html">muc</a></li><li><a href="jsxc.notification.html">notification</a></li><li><a href="jsxc.options.html">options</a></li><li><a href="jsxc.otr.html">otr</a></li><li><a href="jsxc.storage.html">storage</a></li><li><a href="jsxc.webrtc.html">webrtc</a></li><li><a href="jsxc.xmpp.html">xmpp</a></li><li><a href="jsxc.xmpp.bookmarks.html">bookmarks</a></li><li><a href="jsxc.xmpp.carbons.html">carbons</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="jsxc.Message.html">Message</a></li></ul><h3>Namespaces</h3><ul><li><a href="jsxc.html">jsxc</a></li><li><a href="jsxc.gui.html">gui</a></li><li><a href="jsxc.gui.dialog.html">dialog</a></li><li><a href="jsxc.gui.queryActions.html">queryActions</a></li><li><a href="jsxc.gui.roster.html">roster</a></li><li><a href="jsxc.gui.window.html">window</a></li><li><a href="jsxc.muc.html">muc</a></li><li><a href="jsxc.notification.html">notification</a></li><li><a href="jsxc.options.html">options</a></li><li><a href="jsxc.otr.html">otr</a></li><li><a href="jsxc.storage.html">storage</a></li><li><a href="jsxc.tab.html">tab</a></li><li><a href="jsxc.webrtc.html">webrtc</a></li><li><a href="jsxc.xmpp.html">xmpp</a></li><li><a href="jsxc.xmpp.bookmarks.html">bookmarks</a></li><li><a href="jsxc.xmpp.carbons.html">carbons</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
</nav>
|
||||
|
||||
<br clear="both">
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Tue Nov 17 2015 17:01:04 GMT+0100 (CET)
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.2</a> on Fri Oct 28 2016 13:29:05 GMT+0200 (CEST)
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>JSDoc: Source: jsxc.lib.tab.js</title>
|
||||
|
||||
<script src="scripts/prettify/prettify.js"> </script>
|
||||
<script src="scripts/prettify/lang-css.js"> </script>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<![endif]-->
|
||||
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
||||
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="main">
|
||||
|
||||
<h1 class="page-title">Source: jsxc.lib.tab.js</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<article>
|
||||
<pre class="prettyprint source linenums"><code>/**
|
||||
* Provides communication between tabs.
|
||||
*
|
||||
* @namespace jsxc.tab
|
||||
*/
|
||||
jsxc.tab = {
|
||||
CONST: {
|
||||
MASTER: 'master',
|
||||
SLAVE: 'slave'
|
||||
},
|
||||
|
||||
exec: function(target, cmd, params) {
|
||||
|
||||
params = Array.prototype.slice.call(arguments, 2);
|
||||
if (params.length === 1 && $.isArray(params[0])) {
|
||||
params = params[0];
|
||||
}
|
||||
|
||||
if (target === jsxc.tab.CONST[jsxc.master ? 'MASTER' : 'SLAVE']) {
|
||||
jsxc.exec(cmd, params);
|
||||
|
||||
if (jsxc.master) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
jsxc.storage.setUserItem('_cmd', {
|
||||
target: target,
|
||||
cmd: cmd,
|
||||
params: params,
|
||||
rnd: Math.random() // force storage event
|
||||
});
|
||||
},
|
||||
|
||||
/*jshint -W098 */
|
||||
execMaster: function(cmd, params) {
|
||||
var args = Array.prototype.slice.call(arguments);
|
||||
args.unshift(jsxc.tab.CONST.MASTER);
|
||||
|
||||
jsxc.tab.exec.apply(this, args);
|
||||
},
|
||||
execSlave: function(cmd, params) {
|
||||
var args = Array.prototype.slice.call(arguments);
|
||||
args.unshift(jsxc.tab.CONST.SLAVE);
|
||||
|
||||
jsxc.tab.exec.apply(this, args);
|
||||
}
|
||||
/*jshint +W098 */
|
||||
};
|
||||
</code></pre>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="jsxc.Message.html">Message</a></li></ul><h3>Namespaces</h3><ul><li><a href="jsxc.html">jsxc</a></li><li><a href="jsxc.gui.html">gui</a></li><li><a href="jsxc.gui.dialog.html">dialog</a></li><li><a href="jsxc.gui.queryActions.html">queryActions</a></li><li><a href="jsxc.gui.roster.html">roster</a></li><li><a href="jsxc.gui.window.html">window</a></li><li><a href="jsxc.muc.html">muc</a></li><li><a href="jsxc.notification.html">notification</a></li><li><a href="jsxc.options.html">options</a></li><li><a href="jsxc.otr.html">otr</a></li><li><a href="jsxc.storage.html">storage</a></li><li><a href="jsxc.tab.html">tab</a></li><li><a href="jsxc.webrtc.html">webrtc</a></li><li><a href="jsxc.xmpp.html">xmpp</a></li><li><a href="jsxc.xmpp.bookmarks.html">bookmarks</a></li><li><a href="jsxc.xmpp.carbons.html">carbons</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
</nav>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.2</a> on Fri Oct 28 2016 13:29:05 GMT+0200 (CEST)
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
<script src="scripts/linenumber.js"> </script>
|
||||
</body>
|
||||
</html>
|
||||
+351
-218
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>JSDoc: Source: jsxc.lib.webrtc.js</title>
|
||||
|
||||
|
||||
<script src="scripts/prettify/prettify.js"> </script>
|
||||
<script src="scripts/prettify/lang-css.js"> </script>
|
||||
<!--[if lt IE 9]>
|
||||
@@ -16,16 +16,17 @@
|
||||
<body>
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<h1 class="page-title">Source: jsxc.lib.webrtc.js</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<article>
|
||||
<pre class="prettyprint source"><code>/* global MediaStreamTrack */
|
||||
<pre class="prettyprint source linenums"><code>/* global MediaStreamTrack, File */
|
||||
/* jshint -W020 */
|
||||
|
||||
/**
|
||||
@@ -49,9 +50,12 @@ jsxc.webrtc = {
|
||||
/** should we auto accept incoming calls? */
|
||||
AUTO_ACCEPT: false,
|
||||
|
||||
/** required disco features */
|
||||
/** required disco features for video call */
|
||||
reqVideoFeatures: ['urn:xmpp:jingle:apps:rtp:video', 'urn:xmpp:jingle:apps:rtp:audio', 'urn:xmpp:jingle:transports:ice-udp:1', 'urn:xmpp:jingle:apps:dtls:0'],
|
||||
|
||||
/** required disco features for file transfer */
|
||||
reqFileFeatures: ['urn:xmpp:jingle:1', 'urn:xmpp:jingle:apps:file-transfer:3'],
|
||||
|
||||
/** bare jid to current jid mapping */
|
||||
chatJids: {},
|
||||
|
||||
@@ -80,10 +84,17 @@ jsxc.webrtc = {
|
||||
$(document).on('mediaready.jingle', self.onMediaReady);
|
||||
$(document).on('mediafailure.jingle', self.onMediaFailure);
|
||||
|
||||
manager.on('incoming', $.proxy(self.onCallIncoming, self));
|
||||
manager.on('terminated', $.proxy(self.onCallTerminated, self));
|
||||
manager.on('incoming', $.proxy(self.onIncoming, self));
|
||||
|
||||
manager.on('terminated', $.proxy(self.onTerminated, self));
|
||||
manager.on('ringing', $.proxy(self.onCallRinging, self));
|
||||
|
||||
manager.on('receivedFile', $.proxy(self.onReceivedFile, self));
|
||||
|
||||
manager.on('sentFile', function(sess, metadata) {
|
||||
jsxc.debug('sent ' + metadata.hash);
|
||||
});
|
||||
|
||||
manager.on('peerStreamAdded', $.proxy(self.onRemoteStreamAdded, self));
|
||||
manager.on('peerStreamRemoved', $.proxy(self.onRemoteStreamRemoved, self));
|
||||
|
||||
@@ -98,7 +109,7 @@ jsxc.webrtc = {
|
||||
var url = jsxc.options.get('RTCPeerConfig').url || jsxc.options.turnCredentialsPath;
|
||||
var peerConfig = jsxc.options.get('RTCPeerConfig');
|
||||
|
||||
if (typeof url === 'string' && url.length > 0) {
|
||||
if (typeof url === 'string' && url.length > 0) {
|
||||
self.getTurnCrendentials(url);
|
||||
} else {
|
||||
if (jsxc.storage.getUserItem('iceValidity')) {
|
||||
@@ -160,11 +171,14 @@ jsxc.webrtc = {
|
||||
|
||||
$.ajax(url, {
|
||||
async: true,
|
||||
xhrFields: {
|
||||
withCredentials: jsxc.options.get('RTCPeerConfig').withCredentials
|
||||
},
|
||||
success: function(data) {
|
||||
var ttl = data.ttl || 3600;
|
||||
var iceServers = data.iceServers;
|
||||
|
||||
if (!iceServers && data.url) {
|
||||
if (!iceServers && data.url) {
|
||||
// parse deprecated (v2.1.0) syntax
|
||||
jsxc.warn('Received RTCPeer configuration is deprecated. Use now RTCPeerConfig.url.');
|
||||
|
||||
@@ -181,10 +195,10 @@ jsxc.webrtc = {
|
||||
}
|
||||
}
|
||||
|
||||
if (iceServers && iceServers.length > 0) {
|
||||
if (iceServers && iceServers.length > 0) {
|
||||
// url as parameter is deprecated
|
||||
var url = iceServers[0].url && iceServers[0].url.length > 0;
|
||||
var urls = iceServers[0].urls && iceServers[0].urls.length > 0;
|
||||
var url = iceServers[0].url && iceServers[0].url.length > 0;
|
||||
var urls = iceServers[0].urls && iceServers[0].urls.length > 0;
|
||||
|
||||
if (urls || url) {
|
||||
jsxc.debug('ice servers received');
|
||||
@@ -206,20 +220,27 @@ jsxc.webrtc = {
|
||||
},
|
||||
|
||||
/**
|
||||
* Return list of video capable resources.
|
||||
* Return list of capable resources.
|
||||
*
|
||||
* @memberOf jsxc.webrtc
|
||||
* @param jid
|
||||
* @param {(string|string[])} features list of required features
|
||||
* @returns {Array}
|
||||
*/
|
||||
getCapableRes: function(jid) {
|
||||
getCapableRes: function(jid, features) {
|
||||
var self = jsxc.webrtc;
|
||||
var bid = jsxc.jidToBid(jid);
|
||||
var res = jsxc.storage.getUserItem('res', bid) || [];
|
||||
var res = Object.keys(jsxc.storage.getUserItem('res', bid) || {}) || [];
|
||||
|
||||
if (!features) {
|
||||
return res;
|
||||
} else if (typeof features === 'string') {
|
||||
features = [features];
|
||||
}
|
||||
|
||||
var available = [];
|
||||
$.each(res, function(r) {
|
||||
if (self.conn.caps.hasFeatureByJid(bid + '/' + r, self.reqVideoFeatures)) {
|
||||
$.each(res, function(i, r) {
|
||||
if (self.conn.caps.hasFeatureByJid(bid + '/' + r, features)) {
|
||||
available.push(r);
|
||||
}
|
||||
});
|
||||
@@ -227,40 +248,6 @@ jsxc.webrtc = {
|
||||
return available;
|
||||
},
|
||||
|
||||
/**
|
||||
* Add "video" button to roster
|
||||
*
|
||||
* @private
|
||||
* @memberOf jsxc.webrtc
|
||||
* @param event
|
||||
* @param bid bid of roster item
|
||||
* @param data data wich belongs to bid
|
||||
* @param el the roster item
|
||||
*/
|
||||
onAddRosterItem: function(event, bid, data, el) {
|
||||
var self = jsxc.webrtc;
|
||||
|
||||
if (!self.conn) {
|
||||
$(document).one('connectionReady.jsxc', function() {
|
||||
self.onAddRosterItem(null, bid, data, el);
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
var videoIcon = $('<div class="jsxc_video jsxc_disabled" title="' + $.t("Start_video_call") + '"></div>');
|
||||
|
||||
videoIcon.click(function() {
|
||||
self.startCall(data.jid);
|
||||
return false;
|
||||
});
|
||||
|
||||
el.find('.jsxc_options.jsxc_left').append(videoIcon);
|
||||
|
||||
el.on('extra.jsxc', function() {
|
||||
self.updateIcon(bid);
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Add "video" button to window menu.
|
||||
*
|
||||
@@ -279,16 +266,16 @@ jsxc.webrtc = {
|
||||
jsxc.debug('webrtc.initWindow');
|
||||
|
||||
if (!self.conn) {
|
||||
$(document).one('connectionReady.jsxc', function() {
|
||||
$(document).one('attached.jsxc', function() {
|
||||
self.initWindow(null, win);
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
var div = $('<div>').addClass('jsxc_video');
|
||||
win.find('.jsxc_transfer:eq(1)').after(div);
|
||||
win.find('.jsxc_tools .jsxc_settings').after(div);
|
||||
|
||||
self.updateIcon(jsxc.jidToBid(win.data('jid')));
|
||||
self.updateIcon(win.data('bid'));
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -311,7 +298,7 @@ jsxc.webrtc = {
|
||||
var ls = jsxc.storage.getUserItem('buddy', bid);
|
||||
|
||||
if (typeof jid !== 'string') {
|
||||
if (ls && typeof ls.jid === 'string') {
|
||||
if (ls && typeof ls.jid === 'string') {
|
||||
jid = ls.jid;
|
||||
} else {
|
||||
jsxc.debug('[webrtc] Could not update icon, because could not find jid for ' + bid);
|
||||
@@ -319,10 +306,12 @@ jsxc.webrtc = {
|
||||
}
|
||||
}
|
||||
|
||||
var el = win.find('.jsxc_video').add(jsxc.gui.roster.getItem(bid).find('.jsxc_video'));
|
||||
var res = Strophe.getResourceFromJid(jid);
|
||||
|
||||
var capableRes = self.getCapableRes(jid);
|
||||
var targetRes = Strophe.getResourceFromJid(jid);
|
||||
var el = win.find('.jsxc_video');
|
||||
|
||||
var capableRes = self.getCapableRes(jid, self.reqVideoFeatures);
|
||||
var targetRes = res;
|
||||
|
||||
if (targetRes === null) {
|
||||
$.each(jsxc.storage.getUserItem('buddy', bid).res || [], function(index, val) {
|
||||
@@ -350,6 +339,15 @@ jsxc.webrtc = {
|
||||
|
||||
el.attr('title', $.t('Video_call_not_possible'));
|
||||
}
|
||||
|
||||
var fileCapableRes = self.getCapableRes(jid, self.reqFileFeatures);
|
||||
var resources = Object.keys(jsxc.storage.getUserItem('res', bid) || {}) || [];
|
||||
|
||||
if (fileCapableRes.indexOf(res) > -1 || (res === null && fileCapableRes.length === 1 && resources.length === 1)) {
|
||||
win.find('.jsxc_sendFile').removeClass('jsxc_disabled');
|
||||
} else {
|
||||
win.find('.jsxc_sendFile').addClass('jsxc_disabled');
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -493,7 +491,6 @@ jsxc.webrtc = {
|
||||
dialog.find('.jsxc_localvideo').show();
|
||||
}
|
||||
|
||||
$(document).one('cleanup.dialog.jsxc', $.proxy(self.hangUp, self));
|
||||
$(document).trigger('finish.mediaready.jsxc');
|
||||
},
|
||||
|
||||
@@ -511,10 +508,52 @@ jsxc.webrtc = {
|
||||
|
||||
self.setStatus('media failure');
|
||||
|
||||
jsxc.gui.window.postMessage(jsxc.jidToBid(jsxc.webrtc.last_caller), 'sys', $.t('Media_failure') + ': ' + $.t(err.name) + ' (' + err.name + ').');
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: jsxc.jidToBid(jsxc.webrtc.last_caller),
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: $.t('Media_failure') + ': ' + $.t(err.name) + ' (' + err.name + ').'
|
||||
});
|
||||
|
||||
jsxc.debug('media failure: ' + err.name);
|
||||
},
|
||||
|
||||
onIncoming: function(session) {
|
||||
var self = jsxc.webrtc;
|
||||
var type = (session.constructor) ? session.constructor.name : null;
|
||||
|
||||
if (type === 'FileTransferSession') {
|
||||
self.onIncomingFileTransfer(session);
|
||||
} else if (type === 'MediaSession') {
|
||||
self.onIncomingCall(session);
|
||||
}
|
||||
},
|
||||
|
||||
onIncomingFileTransfer: function(session) {
|
||||
jsxc.debug('incoming file transfer from ' + session.peerID);
|
||||
|
||||
var buddylist = jsxc.storage.getUserItem('buddylist') || [];
|
||||
var bid = jsxc.jidToBid(session.peerID);
|
||||
|
||||
if (buddylist.indexOf(bid) > -1) {
|
||||
//Accept file transfers only from contacts
|
||||
session.accept();
|
||||
|
||||
var message = jsxc.gui.window.postMessage({
|
||||
_uid: session.sid + ':msg',
|
||||
bid: bid,
|
||||
direction: jsxc.Message.IN,
|
||||
attachment: {
|
||||
name: session.receiver.metadata.name,
|
||||
type: session.receiver.metadata.type || 'application/octet-stream'
|
||||
}
|
||||
});
|
||||
|
||||
session.receiver.on('progress', function(sent, size) {
|
||||
jsxc.gui.window.updateProgress(message, sent, size);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Called on incoming call.
|
||||
*
|
||||
@@ -523,15 +562,19 @@ jsxc.webrtc = {
|
||||
* @param event
|
||||
* @param sid Session id
|
||||
*/
|
||||
onCallIncoming: function(session) {
|
||||
onIncomingCall: function(session) {
|
||||
jsxc.debug('incoming call from ' + session.peerID);
|
||||
|
||||
var self = this;
|
||||
var self = jsxc.webrtc;
|
||||
var bid = jsxc.jidToBid(session.peerID);
|
||||
|
||||
session.on('change:connectionState', $.proxy(self.onIceConnectionStateChanged, self));
|
||||
|
||||
jsxc.gui.window.postMessage(bid, 'sys', $.t('Incoming_call'));
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: bid,
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: $.t('Incoming_call')
|
||||
});
|
||||
|
||||
// display notification
|
||||
jsxc.notification.notify($.t('Incoming_call'), $.t('from_sender', {
|
||||
@@ -543,16 +586,7 @@ jsxc.webrtc = {
|
||||
|
||||
jsxc.webrtc.last_caller = session.peerID;
|
||||
|
||||
if (jsxc.webrtc.AUTO_ACCEPT) {
|
||||
self.reqUserMedia();
|
||||
return;
|
||||
}
|
||||
|
||||
var dialog = jsxc.gui.dialog.open(jsxc.gui.template.get('incomingCall', bid), {
|
||||
noClose: true
|
||||
});
|
||||
|
||||
dialog.find('.jsxc_accept').click(function() {
|
||||
function acceptCall() {
|
||||
$(document).trigger('accept.call.jsxc');
|
||||
|
||||
jsxc.switchEvents({
|
||||
@@ -569,8 +603,19 @@ jsxc.webrtc = {
|
||||
});
|
||||
|
||||
self.reqUserMedia();
|
||||
}
|
||||
|
||||
if (jsxc.webrtc.AUTO_ACCEPT) {
|
||||
acceptCall();
|
||||
return;
|
||||
}
|
||||
|
||||
var dialog = jsxc.gui.dialog.open(jsxc.gui.template.get('incomingCall', bid), {
|
||||
noClose: true
|
||||
});
|
||||
|
||||
dialog.find('.jsxc_accept').click(acceptCall);
|
||||
|
||||
dialog.find('.jsxc_reject').click(function() {
|
||||
jsxc.gui.dialog.close();
|
||||
$(document).trigger('reject.call.jsxc');
|
||||
@@ -579,6 +624,15 @@ jsxc.webrtc = {
|
||||
});
|
||||
},
|
||||
|
||||
onTerminated: function(session, reason) {
|
||||
var self = jsxc.webrtc;
|
||||
var type = (session.constructor) ? session.constructor.name : null;
|
||||
|
||||
if (type === 'MediaSession') {
|
||||
self.onCallTerminated(session, reason);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Called if call is terminated.
|
||||
*
|
||||
@@ -590,12 +644,19 @@ jsxc.webrtc = {
|
||||
* @param [text] Optional explanation
|
||||
*/
|
||||
onCallTerminated: function(session, reason) {
|
||||
this.setStatus('call terminated ' + session.peer + (reason ? reason.condition : ''));
|
||||
this.setStatus('call terminated ' + session.peerID + (reason && reason.condition ? reason.condition : ''));
|
||||
|
||||
var bid = jsxc.jidToBid(session.peer);
|
||||
var bid = jsxc.jidToBid(session.peerID);
|
||||
|
||||
if (this.localStream) {
|
||||
this.localStream.stop();
|
||||
if (typeof this.localStream.stop === 'function') {
|
||||
this.localStream.stop();
|
||||
} else {
|
||||
var tracks = this.localStream.getTracks();
|
||||
tracks.forEach(function(track) {
|
||||
track.stop();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if ($('.jsxc_videoContainer').length) {
|
||||
@@ -607,15 +668,15 @@ jsxc.webrtc = {
|
||||
this.localStream = null;
|
||||
this.remoteStream = null;
|
||||
|
||||
var win = $('#jsxc_dialog .jsxc_chatarea > ul > li');
|
||||
$('#jsxc_windowList > ul').prepend(win.detach());
|
||||
win.find('.slimScrollDiv').resizable('enable');
|
||||
jsxc.gui.closeVideoWindow();
|
||||
|
||||
$(document).off('cleanup.dialog.jsxc');
|
||||
$(document).off('error.jingle');
|
||||
jsxc.gui.dialog.close();
|
||||
|
||||
jsxc.gui.window.postMessage(bid, 'sys', ($.t('Call_terminated') + (reason ? (': ' + $.t('jingle_reason_' + reason.condition)) : '') + '.'));
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: bid,
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: ($.t('Call_terminated') + (reason && reason.condition ? (': ' + $.t('jingle_reason_' + reason.condition)) : '') + '.')
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -649,9 +710,9 @@ jsxc.webrtc = {
|
||||
this.setStatus(isAudioDevice ? 'Use remote audio device.' : 'No remote audio device');
|
||||
|
||||
if ($('.jsxc_remotevideo').length) {
|
||||
this.attachMediaStream($('#jsxc_dialog .jsxc_remotevideo'), stream);
|
||||
this.attachMediaStream($('#jsxc_webrtc .jsxc_remotevideo'), stream);
|
||||
|
||||
$('#jsxc_dialog .jsxc_' + (isVideoDevice ? 'remotevideo' : 'noRemoteVideo')).addClass('jsxc_deviceAvailable');
|
||||
$('#jsxc_webrtc .jsxc_' + (isVideoDevice ? 'remotevideo' : 'noRemoteVideo')).addClass('jsxc_deviceAvailable');
|
||||
}
|
||||
},
|
||||
|
||||
@@ -699,13 +760,15 @@ jsxc.webrtc = {
|
||||
|
||||
if (state === 'connected') {
|
||||
|
||||
$('#jsxc_dialog .jsxc_deviceAvailable').show();
|
||||
$('#jsxc_dialog .bubblingG').hide();
|
||||
$('#jsxc_webrtc .jsxc_deviceAvailable').show();
|
||||
$('#jsxc_webrtc .bubblingG').hide();
|
||||
|
||||
} else if (state === 'failed') {
|
||||
jsxc.gui.window.postMessage(jsxc.jidToBid(session.peerID), 'sys', $.t('ICE_connection_failure'));
|
||||
|
||||
$(document).off('cleanup.dialog.jsxc');
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: jsxc.jidToBid(session.peerID),
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: $.t('ICE_connection_failure')
|
||||
});
|
||||
|
||||
session.end('failed-transport');
|
||||
|
||||
@@ -736,14 +799,17 @@ jsxc.webrtc = {
|
||||
'finish.mediaready.jsxc': function() {
|
||||
self.setStatus('Initiate call');
|
||||
|
||||
jsxc.gui.window.postMessage(jsxc.jidToBid(jid), 'sys', $.t('Call_started'));
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: jsxc.jidToBid(jid),
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: $.t('Call_started')
|
||||
});
|
||||
|
||||
$(document).one('error.jingle', function(e, sid, error) {
|
||||
if (error.source !== 'offer') {
|
||||
if (error && error.source !== 'offer') {
|
||||
return;
|
||||
}
|
||||
|
||||
$(document).off('cleanup.dialog.jsxc');
|
||||
setTimeout(function() {
|
||||
jsxc.gui.showAlert("Sorry, we couldn't establish a connection. Maybe your buddy is offline.");
|
||||
}, 500);
|
||||
@@ -767,9 +833,13 @@ jsxc.webrtc = {
|
||||
* @memberOf jsxc.webrtc
|
||||
*/
|
||||
hangUp: function(reason, text) {
|
||||
$(document).off('cleanup.dialog.jsxc');
|
||||
if (jsxc.webrtc.conn.jingle.manager && !$.isEmptyObject(jsxc.webrtc.conn.jingle.manager.peers)) {
|
||||
jsxc.webrtc.conn.jingle.terminate(null, reason, text);
|
||||
} else {
|
||||
jsxc.gui.closeVideoWindow();
|
||||
}
|
||||
|
||||
jsxc.webrtc.conn.jingle.terminate(null, reason, text);
|
||||
// @TODO check event
|
||||
$(document).trigger('callterminated.jingle');
|
||||
},
|
||||
|
||||
@@ -791,7 +861,7 @@ jsxc.webrtc = {
|
||||
});
|
||||
this.setStatus('please allow access to microphone and camera');
|
||||
|
||||
if (typeof MediaStreamTrack !== 'undefined' && typeof MediaStreamTrack.getSources !== 'undefined') {
|
||||
if (typeof MediaStreamTrack !== 'undefined' && typeof MediaStreamTrack.getSources !== 'undefined') {
|
||||
MediaStreamTrack.getSources(function(sourceInfo) {
|
||||
var availableDevices = sourceInfo.map(function(el) {
|
||||
|
||||
@@ -876,6 +946,105 @@ jsxc.webrtc = {
|
||||
$('.jsxc_snapshotbar').append(link);
|
||||
|
||||
canvas.remove();
|
||||
},
|
||||
|
||||
/**
|
||||
* Send file to full jid.
|
||||
*
|
||||
* @memberOf jsxc.webrtc
|
||||
* @param {string} jid full jid
|
||||
* @param {file} file
|
||||
* @return {object} session
|
||||
*/
|
||||
sendFile: function(jid, file) {
|
||||
var self = jsxc.webrtc;
|
||||
|
||||
var sess = self.conn.jingle.manager.createFileTransferSession(jid);
|
||||
|
||||
sess.on('change:sessionState', function() {
|
||||
jsxc.debug('Session state', sess.state);
|
||||
});
|
||||
sess.on('change:connectionState', function() {
|
||||
jsxc.debug('Connection state', sess.connectionState);
|
||||
});
|
||||
|
||||
sess.start(file);
|
||||
|
||||
return sess;
|
||||
},
|
||||
|
||||
/**
|
||||
* Display received file.
|
||||
*
|
||||
* @memberOf jsxc.webrtc
|
||||
* @param {object} sess
|
||||
* @param {File} file
|
||||
* @param {object} metadata file metadata
|
||||
*/
|
||||
onReceivedFile: function(sess, file, metadata) {
|
||||
jsxc.debug('file received', metadata);
|
||||
|
||||
if (!FileReader) {
|
||||
return;
|
||||
}
|
||||
|
||||
var reader = new FileReader();
|
||||
var type;
|
||||
|
||||
if (!metadata.type) {
|
||||
// detect file type via file extension, because XEP-0234 v0.14
|
||||
// does not send any type
|
||||
var ext = metadata.name.replace(/.+\.([a-z0-9]+)$/i, '$1').toLowerCase();
|
||||
|
||||
switch (ext) {
|
||||
case 'jpg':
|
||||
case 'jpeg':
|
||||
case 'png':
|
||||
case 'gif':
|
||||
case 'svg':
|
||||
type = 'image/' + ext.replace(/^jpg$/, 'jpeg');
|
||||
break;
|
||||
case 'mp3':
|
||||
case 'wav':
|
||||
type = 'audio/' + ext;
|
||||
break;
|
||||
case 'pdf':
|
||||
type = 'application/pdf';
|
||||
break;
|
||||
case 'txt':
|
||||
type = 'text/' + ext;
|
||||
break;
|
||||
default:
|
||||
type = 'application/octet-stream';
|
||||
}
|
||||
} else {
|
||||
type = metadata.type;
|
||||
}
|
||||
|
||||
reader.onload = function(ev) {
|
||||
// modify element with uid metadata.actualhash
|
||||
|
||||
jsxc.gui.window.postMessage({
|
||||
_uid: sess.sid + ':msg',
|
||||
bid: jsxc.jidToBid(sess.peerID),
|
||||
direction: jsxc.Message.IN,
|
||||
attachment: {
|
||||
name: metadata.name,
|
||||
type: type,
|
||||
size: metadata.size,
|
||||
data: ev.target.result
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
if (!file.type) {
|
||||
// file type should be handled in lib
|
||||
file = new File([file], metadata.name, {
|
||||
type: type
|
||||
});
|
||||
}
|
||||
|
||||
reader.readAsDataURL(file);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -887,129 +1056,94 @@ jsxc.webrtc = {
|
||||
jsxc.gui.showVideoWindow = function(jid) {
|
||||
var self = jsxc.webrtc;
|
||||
|
||||
$(document).one('complete.dialog.jsxc', function() {
|
||||
|
||||
// mute own video element to avoid echoes
|
||||
$('#jsxc_dialog .jsxc_localvideo')[0].muted = true;
|
||||
$('#jsxc_dialog .jsxc_localvideo')[0].volume = 0;
|
||||
|
||||
var rv = $('#jsxc_dialog .jsxc_remotevideo');
|
||||
var lv = $('#jsxc_dialog .jsxc_localvideo');
|
||||
|
||||
lv.draggable({
|
||||
containment: "parent"
|
||||
});
|
||||
|
||||
self.attachMediaStream(lv, self.localStream);
|
||||
|
||||
var w_dialog = $('#jsxc_dialog').width();
|
||||
var w_remote = rv.width();
|
||||
|
||||
// fit in video
|
||||
if (w_remote > w_dialog) {
|
||||
var scale = w_dialog / w_remote;
|
||||
var new_h = rv.height() * scale;
|
||||
var new_w = w_dialog;
|
||||
var vc = $('#jsxc_dialog .jsxc_videoContainer');
|
||||
|
||||
rv.height(new_h);
|
||||
rv.width(new_w);
|
||||
|
||||
vc.height(new_h);
|
||||
vc.width(new_w);
|
||||
|
||||
lv.height(lv.height() * scale);
|
||||
lv.width(lv.width() * scale);
|
||||
}
|
||||
|
||||
if (self.remoteStream) {
|
||||
self.attachMediaStream(rv, self.remoteStream);
|
||||
|
||||
$('#jsxc_dialog .jsxc_' + (self.remoteStream.getVideoTracks().length > 0 ? 'remotevideo' : 'noRemoteVideo')).addClass('jsxc_deviceAvailable');
|
||||
}
|
||||
|
||||
var toggleMulti = function(elem, open) {
|
||||
$('#jsxc_dialog .jsxc_multi > div').not(elem).slideUp();
|
||||
|
||||
var opt = {
|
||||
complete: jsxc.gui.dialog.resize
|
||||
};
|
||||
|
||||
if (open) {
|
||||
elem.slideDown(opt);
|
||||
} else {
|
||||
elem.slideToggle(opt);
|
||||
}
|
||||
};
|
||||
|
||||
var win = jsxc.gui.window.open(jsxc.jidToBid(jid));
|
||||
|
||||
win.find('.slimScrollDiv').resizable('disable');
|
||||
win.find('.jsxc_textarea').slimScroll({
|
||||
height: 413
|
||||
});
|
||||
win.find('.jsxc_emoticons').css('top', (413 + 6) + 'px');
|
||||
|
||||
$('#jsxc_dialog .jsxc_chatarea ul').append(win.detach());
|
||||
|
||||
$('#jsxc_dialog .jsxc_hangUp').click(function() {
|
||||
jsxc.webrtc.hangUp('success');
|
||||
});
|
||||
|
||||
$('#jsxc_dialog .jsxc_snapshot').click(function() {
|
||||
jsxc.webrtc.snapshot(rv);
|
||||
toggleMulti($('#jsxc_dialog .jsxc_snapshotbar'), true);
|
||||
});
|
||||
|
||||
$('#jsxc_dialog .jsxc_snapshots').click(function() {
|
||||
toggleMulti($('#jsxc_dialog .jsxc_snapshotbar'));
|
||||
});
|
||||
|
||||
$('#jsxc_dialog .jsxc_showchat').click(function() {
|
||||
var chatarea = $('#jsxc_dialog .jsxc_chatarea');
|
||||
|
||||
if (chatarea.is(':hidden')) {
|
||||
chatarea.show();
|
||||
$('#jsxc_dialog .jsxc_webrtc').width('900');
|
||||
jsxc.gui.dialog.resize({
|
||||
width: '920px'
|
||||
});
|
||||
} else {
|
||||
chatarea.hide();
|
||||
$('#jsxc_dialog .jsxc_webrtc').width('650');
|
||||
jsxc.gui.dialog.resize({
|
||||
width: '660px'
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$('#jsxc_dialog .jsxc_fullscreen').click(function() {
|
||||
|
||||
if ($.support.fullscreen) {
|
||||
// Reset position of localvideo
|
||||
$(document).one('disabled.fullscreen', function() {
|
||||
lv.removeAttr('style');
|
||||
});
|
||||
|
||||
$('#jsxc_dialog .jsxc_videoContainer').fullscreen();
|
||||
}
|
||||
});
|
||||
|
||||
$('#jsxc_dialog .jsxc_volume').change(function() {
|
||||
rv[0].volume = $(this).val();
|
||||
});
|
||||
|
||||
$('#jsxc_dialog .jsxc_volume').dblclick(function() {
|
||||
$(this).val(0.5);
|
||||
});
|
||||
});
|
||||
|
||||
// needed to trigger complete.dialog.jsxc
|
||||
jsxc.gui.dialog.close();
|
||||
|
||||
return jsxc.gui.dialog.open(jsxc.gui.template.get('videoWindow'), {
|
||||
noClose: true
|
||||
$('body').append(jsxc.gui.template.get('videoWindow'));
|
||||
|
||||
// mute own video element to avoid echoes
|
||||
$('#jsxc_webrtc .jsxc_localvideo')[0].muted = true;
|
||||
$('#jsxc_webrtc .jsxc_localvideo')[0].volume = 0;
|
||||
|
||||
var rv = $('#jsxc_webrtc .jsxc_remotevideo');
|
||||
var lv = $('#jsxc_webrtc .jsxc_localvideo');
|
||||
|
||||
lv.draggable({
|
||||
containment: "parent"
|
||||
});
|
||||
|
||||
if (self.localStream) {
|
||||
self.attachMediaStream(lv, self.localStream);
|
||||
}
|
||||
|
||||
var w_dialog = $('#jsxc_webrtc').width();
|
||||
var w_remote = rv.width();
|
||||
|
||||
// fit in video
|
||||
if (w_remote > w_dialog) {
|
||||
var scale = w_dialog / w_remote;
|
||||
var new_h = rv.height() * scale;
|
||||
var new_w = w_dialog;
|
||||
var vc = $('#jsxc_webrtc .jsxc_videoContainer');
|
||||
|
||||
rv.height(new_h);
|
||||
rv.width(new_w);
|
||||
|
||||
vc.height(new_h);
|
||||
vc.width(new_w);
|
||||
|
||||
lv.height(lv.height() * scale);
|
||||
lv.width(lv.width() * scale);
|
||||
}
|
||||
|
||||
if (self.remoteStream) {
|
||||
self.attachMediaStream(rv, self.remoteStream);
|
||||
|
||||
$('#jsxc_webrtc .jsxc_' + (self.remoteStream.getVideoTracks().length > 0 ? 'remotevideo' : 'noRemoteVideo')).addClass('jsxc_deviceAvailable');
|
||||
}
|
||||
|
||||
var win = jsxc.gui.window.open(jsxc.jidToBid(jid));
|
||||
|
||||
win.find('.slimScrollDiv').resizable('disable');
|
||||
jsxc.gui.window.resize(win, {
|
||||
size: {
|
||||
width: $('#jsxc_webrtc .jsxc_chatarea').width(),
|
||||
height: $('#jsxc_webrtc .jsxc_chatarea').height()
|
||||
}
|
||||
}, true);
|
||||
|
||||
$('#jsxc_webrtc .jsxc_chatarea ul').append(win.detach());
|
||||
|
||||
$('#jsxc_webrtc .jsxc_hangUp').click(function() {
|
||||
jsxc.webrtc.hangUp('success');
|
||||
});
|
||||
|
||||
$('#jsxc_webrtc .jsxc_fullscreen').click(function() {
|
||||
|
||||
if ($.support.fullscreen) {
|
||||
// Reset position of localvideo
|
||||
$(document).one('disabled.fullscreen', function() {
|
||||
lv.removeAttr('style');
|
||||
});
|
||||
|
||||
$('#jsxc_webrtc .jsxc_videoContainer').fullscreen();
|
||||
}
|
||||
});
|
||||
|
||||
$('#jsxc_webrtc .jsxc_videoContainer').click(function() {
|
||||
$('#jsxc_webrtc .jsxc_controlbar').toggleClass('jsxc_visible');
|
||||
});
|
||||
|
||||
return $('#jsxc_webrtc');
|
||||
};
|
||||
|
||||
jsxc.gui.closeVideoWindow = function() {
|
||||
var win = $('#jsxc_webrtc .jsxc_chatarea > ul > li');
|
||||
$('#jsxc_windowList > ul').prepend(win.detach());
|
||||
win.find('.slimScrollDiv').resizable('enable');
|
||||
jsxc.gui.window.resize(win);
|
||||
|
||||
$('#jsxc_webrtc').remove();
|
||||
};
|
||||
|
||||
$.extend(jsxc.CONST, {
|
||||
@@ -1018,7 +1152,6 @@ $.extend(jsxc.CONST, {
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
$(document).on('add.roster.jsxc', jsxc.webrtc.onAddRosterItem);
|
||||
$(document).on('init.window.jsxc', jsxc.webrtc.initWindow);
|
||||
$(document).on('attached.jsxc', jsxc.webrtc.init);
|
||||
$(document).on('disconnected.jsxc', jsxc.webrtc.onDisconnected);
|
||||
@@ -1034,13 +1167,13 @@ $(document).ready(function() {
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Index</a></h2><h3>Namespaces</h3><ul><li><a href="jsxc.html">jsxc</a></li><li><a href="jsxc.gui.html">gui</a></li><li><a href="jsxc.gui.dialog.html">dialog</a></li><li><a href="jsxc.gui.queryActions.html">queryActions</a></li><li><a href="jsxc.gui.roster.html">roster</a></li><li><a href="jsxc.gui.window.html">window</a></li><li><a href="jsxc.muc.html">muc</a></li><li><a href="jsxc.notification.html">notification</a></li><li><a href="jsxc.options.html">options</a></li><li><a href="jsxc.otr.html">otr</a></li><li><a href="jsxc.storage.html">storage</a></li><li><a href="jsxc.webrtc.html">webrtc</a></li><li><a href="jsxc.xmpp.html">xmpp</a></li><li><a href="jsxc.xmpp.bookmarks.html">bookmarks</a></li><li><a href="jsxc.xmpp.carbons.html">carbons</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="jsxc.Message.html">Message</a></li></ul><h3>Namespaces</h3><ul><li><a href="jsxc.html">jsxc</a></li><li><a href="jsxc.gui.html">gui</a></li><li><a href="jsxc.gui.dialog.html">dialog</a></li><li><a href="jsxc.gui.queryActions.html">queryActions</a></li><li><a href="jsxc.gui.roster.html">roster</a></li><li><a href="jsxc.gui.window.html">window</a></li><li><a href="jsxc.muc.html">muc</a></li><li><a href="jsxc.notification.html">notification</a></li><li><a href="jsxc.options.html">options</a></li><li><a href="jsxc.otr.html">otr</a></li><li><a href="jsxc.storage.html">storage</a></li><li><a href="jsxc.tab.html">tab</a></li><li><a href="jsxc.webrtc.html">webrtc</a></li><li><a href="jsxc.xmpp.html">xmpp</a></li><li><a href="jsxc.xmpp.bookmarks.html">bookmarks</a></li><li><a href="jsxc.xmpp.carbons.html">carbons</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
</nav>
|
||||
|
||||
<br clear="both">
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Tue Nov 17 2015 17:01:04 GMT+0100 (CET)
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.2</a> on Fri Oct 28 2016 13:29:05 GMT+0200 (CEST)
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>JSDoc: Source: jsxc.lib.xmpp.bookmarks.js</title>
|
||||
|
||||
|
||||
<script src="scripts/prettify/prettify.js"> </script>
|
||||
<script src="scripts/prettify/lang-css.js"> </script>
|
||||
<!--[if lt IE 9]>
|
||||
@@ -16,16 +16,17 @@
|
||||
<body>
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<h1 class="page-title">Source: jsxc.lib.xmpp.bookmarks.js</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<article>
|
||||
<pre class="prettyprint source"><code>/**
|
||||
<pre class="prettyprint source linenums"><code>/**
|
||||
* Load and save bookmarks according to XEP-0048.
|
||||
*
|
||||
* @namespace jsxc.xmpp.bookmarks
|
||||
@@ -38,7 +39,7 @@ jsxc.xmpp.bookmarks = {};
|
||||
* @return {boolean} True: Server supports bookmark storage
|
||||
*/
|
||||
jsxc.xmpp.bookmarks.remote = function() {
|
||||
return jsxc.xmpp.conn.caps && jsxc.xmpp.hasFeatureByJid(jsxc.xmpp.conn.domain, Strophe.NS.PUBSUB + "#publish");
|
||||
return jsxc.xmpp.conn.caps && jsxc.xmpp.hasFeatureByJid(jsxc.xmpp.conn.domain, Strophe.NS.PUBSUB + "#publish");
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -376,13 +377,13 @@ jsxc.xmpp.bookmarks.showDialog = function(room) {
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Index</a></h2><h3>Namespaces</h3><ul><li><a href="jsxc.html">jsxc</a></li><li><a href="jsxc.gui.html">gui</a></li><li><a href="jsxc.gui.dialog.html">dialog</a></li><li><a href="jsxc.gui.queryActions.html">queryActions</a></li><li><a href="jsxc.gui.roster.html">roster</a></li><li><a href="jsxc.gui.window.html">window</a></li><li><a href="jsxc.muc.html">muc</a></li><li><a href="jsxc.notification.html">notification</a></li><li><a href="jsxc.options.html">options</a></li><li><a href="jsxc.otr.html">otr</a></li><li><a href="jsxc.storage.html">storage</a></li><li><a href="jsxc.webrtc.html">webrtc</a></li><li><a href="jsxc.xmpp.html">xmpp</a></li><li><a href="jsxc.xmpp.bookmarks.html">bookmarks</a></li><li><a href="jsxc.xmpp.carbons.html">carbons</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="jsxc.Message.html">Message</a></li></ul><h3>Namespaces</h3><ul><li><a href="jsxc.html">jsxc</a></li><li><a href="jsxc.gui.html">gui</a></li><li><a href="jsxc.gui.dialog.html">dialog</a></li><li><a href="jsxc.gui.queryActions.html">queryActions</a></li><li><a href="jsxc.gui.roster.html">roster</a></li><li><a href="jsxc.gui.window.html">window</a></li><li><a href="jsxc.muc.html">muc</a></li><li><a href="jsxc.notification.html">notification</a></li><li><a href="jsxc.options.html">options</a></li><li><a href="jsxc.otr.html">otr</a></li><li><a href="jsxc.storage.html">storage</a></li><li><a href="jsxc.tab.html">tab</a></li><li><a href="jsxc.webrtc.html">webrtc</a></li><li><a href="jsxc.xmpp.html">xmpp</a></li><li><a href="jsxc.xmpp.bookmarks.html">bookmarks</a></li><li><a href="jsxc.xmpp.carbons.html">carbons</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
</nav>
|
||||
|
||||
<br clear="both">
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Tue Nov 17 2015 17:01:04 GMT+0100 (CET)
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.2</a> on Fri Oct 28 2016 13:29:05 GMT+0200 (CEST)
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
+154
-113
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>JSDoc: Source: jsxc.lib.xmpp.js</title>
|
||||
|
||||
|
||||
<script src="scripts/prettify/prettify.js"> </script>
|
||||
<script src="scripts/prettify/lang-css.js"> </script>
|
||||
<!--[if lt IE 9]>
|
||||
@@ -16,16 +16,17 @@
|
||||
<body>
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<h1 class="page-title">Source: jsxc.lib.xmpp.js</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<article>
|
||||
<pre class="prettyprint source"><code>/**
|
||||
<pre class="prettyprint source linenums"><code>/**
|
||||
* Handle XMPP stuff.
|
||||
*
|
||||
* @namespace jsxc.xmpp
|
||||
@@ -38,6 +39,7 @@ jsxc.xmpp = {
|
||||
*
|
||||
* @name login
|
||||
* @memberOf jsxc.xmpp
|
||||
* @private
|
||||
*/
|
||||
/**
|
||||
* Create new connection with given parameters.
|
||||
@@ -46,6 +48,7 @@ jsxc.xmpp = {
|
||||
* @param {string} jid
|
||||
* @param {string} password
|
||||
* @memberOf jsxc.xmpp
|
||||
* @private
|
||||
*/
|
||||
/**
|
||||
* Attach connection with given parameters.
|
||||
@@ -55,10 +58,12 @@ jsxc.xmpp = {
|
||||
* @param {string} sid
|
||||
* @param {string} rid
|
||||
* @memberOf jsxc.xmpp
|
||||
* @private
|
||||
*/
|
||||
login: function() {
|
||||
|
||||
if (jsxc.xmpp.conn && jsxc.xmpp.conn.authenticated) {
|
||||
if (jsxc.xmpp.conn && jsxc.xmpp.conn.authenticated) {
|
||||
jsxc.debug('Connection already authenticated.');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -81,23 +86,38 @@ jsxc.xmpp = {
|
||||
sid = jsxc.storage.getItem('sid');
|
||||
rid = jsxc.storage.getItem('rid');
|
||||
|
||||
if (sid !== null && rid !== null) {
|
||||
if (sid !== null && rid !== null) {
|
||||
jid = jsxc.storage.getItem('jid');
|
||||
} else {
|
||||
sid = null;
|
||||
rid = null;
|
||||
sid = jsxc.options.xmpp.sid || null;
|
||||
rid = jsxc.options.xmpp.rid || null;
|
||||
jid = jsxc.options.xmpp.jid;
|
||||
}
|
||||
}
|
||||
|
||||
if (!jid) {
|
||||
jsxc.warn('Jid required for login');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (!jsxc.bid) {
|
||||
jsxc.bid = jsxc.jidToBid(jid);
|
||||
}
|
||||
|
||||
var url = jsxc.options.get('xmpp').url;
|
||||
|
||||
if (!(jsxc.xmpp.conn && jsxc.xmpp.conn.connected)) {
|
||||
if (!url) {
|
||||
jsxc.warn('xmpp.url required for login');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(jsxc.xmpp.conn && jsxc.xmpp.conn.connected)) {
|
||||
// Register eventlistener
|
||||
$(document).on('connected.jsxc', jsxc.xmpp.connected);
|
||||
$(document).on('attached.jsxc', jsxc.xmpp.attached);
|
||||
$(document).on('disconnected.jsxc', jsxc.xmpp.disconnected);
|
||||
$(document).on('ridChange', jsxc.xmpp.onRidChange);
|
||||
$(document).on('connfail.jsxc', jsxc.xmpp.onConnfail);
|
||||
$(document).on('authfail.jsxc', jsxc.xmpp.onAuthFail);
|
||||
|
||||
@@ -107,15 +127,6 @@ jsxc.xmpp = {
|
||||
// Create new connection (no login)
|
||||
jsxc.xmpp.conn = new Strophe.Connection(url);
|
||||
|
||||
// Override default function to preserve unique id
|
||||
var stropheGetUniqueId = jsxc.xmpp.conn.getUniqueId;
|
||||
jsxc.xmpp.conn.getUniqueId = function(suffix) {
|
||||
var uid = stropheGetUniqueId.call(jsxc.xmpp.conn, suffix);
|
||||
jsxc.storage.setItem('_uniqueId', jsxc.xmpp.conn._uniqueId);
|
||||
|
||||
return uid;
|
||||
};
|
||||
|
||||
if (jsxc.storage.getItem('debug') === true) {
|
||||
jsxc.xmpp.conn.xmlInput = function(data) {
|
||||
console.log('<', data);
|
||||
@@ -125,6 +136,8 @@ jsxc.xmpp = {
|
||||
};
|
||||
}
|
||||
|
||||
jsxc.xmpp.conn.nextValidRid = jsxc.xmpp.onRidChange;
|
||||
|
||||
var callback = function(status, condition) {
|
||||
|
||||
jsxc.debug(Object.getOwnPropertyNames(Strophe.Status)[status] + ': ' + condition);
|
||||
@@ -156,9 +169,12 @@ jsxc.xmpp = {
|
||||
jsxc.xmpp.conn.caps.node = 'http://jsxc.org/';
|
||||
}
|
||||
|
||||
if (jsxc.restore && sid && rid) {
|
||||
if (sid && rid) {
|
||||
jsxc.debug('Try to attach');
|
||||
jsxc.debug('SID: ' + sid);
|
||||
|
||||
jsxc.reconnect = true;
|
||||
|
||||
jsxc.xmpp.conn.attach(jid, sid, rid, callback);
|
||||
} else {
|
||||
jsxc.debug('New connection');
|
||||
@@ -182,7 +198,7 @@ jsxc.xmpp = {
|
||||
}, Strophe.NS.CAPS);
|
||||
}
|
||||
|
||||
jsxc.xmpp.conn.connect(jid || jsxc.options.xmpp.jid, password || jsxc.options.xmpp.password, callback);
|
||||
jsxc.xmpp.conn.connect(jid, password || jsxc.options.xmpp.password, callback);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -194,28 +210,28 @@ jsxc.xmpp = {
|
||||
*/
|
||||
logout: function(complete) {
|
||||
|
||||
// instruct all tabs
|
||||
jsxc.storage.removeItem('sid');
|
||||
jsxc.triggeredFromElement = (typeof complete === 'boolean') ? complete : true;
|
||||
|
||||
if (!jsxc.master) {
|
||||
// instruct master
|
||||
jsxc.storage.removeItem('sid');
|
||||
|
||||
// jsxc.xmpp.disconnected is called if master deletes alive after logout
|
||||
return true;
|
||||
}
|
||||
|
||||
// REVIEW: this should maybe moved to xmpp.disconnected
|
||||
// clean up
|
||||
jsxc.storage.removeUserItem('buddylist');
|
||||
jsxc.storage.removeUserItem('windowlist');
|
||||
jsxc.storage.removeItem('_uniqueId');
|
||||
|
||||
if (!jsxc.master) {
|
||||
$('#jsxc_roster').remove();
|
||||
$('#jsxc_windowlist').remove();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (jsxc.xmpp.conn === null) {
|
||||
return true;
|
||||
}
|
||||
jsxc.storage.removeUserItem('unreadMsg');
|
||||
|
||||
// Hide dropdown menu
|
||||
$('body').click();
|
||||
|
||||
jsxc.triggeredFromElement = (typeof complete === 'boolean') ? complete : true;
|
||||
if (!jsxc.xmpp.conn || !jsxc.xmpp.conn.authenticated) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// restore all otr objects
|
||||
$.each(jsxc.storage.getUserItem('otrlist') || {}, function(i, val) {
|
||||
@@ -262,45 +278,27 @@ jsxc.xmpp = {
|
||||
|
||||
jsxc.xmpp.conn.pause();
|
||||
|
||||
var nomJid = Strophe.getBareJidFromJid(jsxc.xmpp.conn.jid).toLowerCase() + '/' + Strophe.getResourceFromJid(jsxc.xmpp.conn.jid);
|
||||
jsxc.xmpp.initNewConnection();
|
||||
|
||||
// Save sid and jid
|
||||
jsxc.storage.setItem('sid', jsxc.xmpp.conn._proto.sid);
|
||||
jsxc.storage.setItem('jid', nomJid);
|
||||
|
||||
jsxc.storage.setItem('lastActivity', (new Date()).getTime());
|
||||
|
||||
// make shure roster will be reloaded
|
||||
jsxc.storage.removeUserItem('buddylist');
|
||||
|
||||
jsxc.storage.removeUserItem('windowlist');
|
||||
jsxc.storage.removeUserItem('own');
|
||||
jsxc.storage.removeUserItem('avatar', 'own');
|
||||
jsxc.storage.removeUserItem('otrlist');
|
||||
jsxc.storage.removeUserItem('unreadMsg');
|
||||
|
||||
// reset user options
|
||||
jsxc.storage.removeUserElement('options', 'RTCPeerConfig');
|
||||
jsxc.xmpp.saveSessionParameter();
|
||||
|
||||
if (jsxc.options.loginForm.triggered) {
|
||||
switch (jsxc.options.loginForm.onConnected || 'submit') {
|
||||
case 'submit':
|
||||
jsxc.submitLoginForm();
|
||||
/* falls through */
|
||||
return;
|
||||
case false:
|
||||
jsxc.xmpp.connectionReady();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// start chat
|
||||
|
||||
jsxc.gui.init();
|
||||
$('#jsxc_roster').removeClass('jsxc_noConnection');
|
||||
jsxc.onMaster();
|
||||
jsxc.xmpp.conn.resume();
|
||||
jsxc.gui.dialog.close();
|
||||
jsxc.restoreCompleted = true;
|
||||
|
||||
jsxc.xmpp.conn.resume();
|
||||
jsxc.onMaster();
|
||||
|
||||
$(document).trigger('attached.jsxc');
|
||||
},
|
||||
|
||||
@@ -311,11 +309,15 @@ jsxc.xmpp = {
|
||||
*/
|
||||
attached: function() {
|
||||
|
||||
$('#jsxc_roster').removeClass('jsxc_noConnection');
|
||||
|
||||
jsxc.xmpp.conn.addHandler(jsxc.xmpp.onRosterChanged, 'jabber:iq:roster', 'iq', 'set');
|
||||
jsxc.xmpp.conn.addHandler(jsxc.xmpp.onMessage, null, 'message', 'chat');
|
||||
jsxc.xmpp.conn.addHandler(jsxc.xmpp.onReceived, null, 'message');
|
||||
jsxc.xmpp.conn.addHandler(jsxc.xmpp.onPresence, null, 'presence');
|
||||
|
||||
jsxc.gui.init();
|
||||
|
||||
var caps = jsxc.xmpp.conn.caps;
|
||||
var domain = jsxc.xmpp.conn.domain;
|
||||
|
||||
@@ -354,7 +356,7 @@ jsxc.xmpp = {
|
||||
}
|
||||
|
||||
// Only load roaster if necessary
|
||||
if (!jsxc.restore || !jsxc.storage.getUserItem('buddylist')) {
|
||||
if (!jsxc.reconnect || !jsxc.storage.getUserItem('buddylist')) {
|
||||
// in order to not overide existing presence information, we send
|
||||
// pres first after roster is ready
|
||||
$(document).one('cloaded.roster.jsxc', jsxc.xmpp.sendPres);
|
||||
@@ -370,20 +372,42 @@ jsxc.xmpp = {
|
||||
jsxc.xmpp.conn.sendIQ(iq, jsxc.xmpp.onRoster);
|
||||
} else {
|
||||
jsxc.xmpp.sendPres();
|
||||
|
||||
if (!jsxc.restoreCompleted) {
|
||||
jsxc.restoreRoster();
|
||||
jsxc.restoreWindows();
|
||||
jsxc.restoreCompleted = true;
|
||||
|
||||
$(document).trigger('restoreCompleted.jsxc');
|
||||
}
|
||||
}
|
||||
|
||||
jsxc.xmpp.connectionReady();
|
||||
jsxc.xmpp.saveSessionParameter();
|
||||
|
||||
jsxc.masterActions();
|
||||
},
|
||||
|
||||
/**
|
||||
* Triggered if the connection is ready
|
||||
*/
|
||||
connectionReady: function() {
|
||||
saveSessionParameter: function() {
|
||||
|
||||
// Load saved unique id
|
||||
jsxc.xmpp.conn._uniqueId = jsxc.storage.getItem('_uniqueId') || new Date().getTime();
|
||||
var nomJid = Strophe.getBareJidFromJid(jsxc.xmpp.conn.jid).toLowerCase() + '/' + Strophe.getResourceFromJid(jsxc.xmpp.conn.jid);
|
||||
|
||||
$(document).trigger('connectionReady.jsxc');
|
||||
// Save sid and jid
|
||||
jsxc.storage.setItem('sid', jsxc.xmpp.conn._proto.sid);
|
||||
jsxc.storage.setItem('jid', nomJid);
|
||||
},
|
||||
|
||||
initNewConnection: function() {
|
||||
// make shure roster will be reloaded
|
||||
jsxc.storage.removeUserItem('buddylist');
|
||||
|
||||
jsxc.storage.removeUserItem('windowlist');
|
||||
jsxc.storage.removeUserItem('own');
|
||||
jsxc.storage.removeUserItem('avatar', 'own');
|
||||
jsxc.storage.removeUserItem('otrlist');
|
||||
jsxc.storage.removeUserItem('unreadMsg');
|
||||
|
||||
// reset user options
|
||||
jsxc.storage.removeUserElement('options', 'RTCPeerConfig');
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -411,7 +435,7 @@ jsxc.xmpp = {
|
||||
}
|
||||
|
||||
var priority = jsxc.options.get('priority');
|
||||
if (priority && typeof priority[presState] !== 'undefined' && parseInt(priority[presState]) !== 0) {
|
||||
if (priority && typeof priority[presState] !== 'undefined' && parseInt(priority[presState]) !== 0) {
|
||||
pres.c('priority').t(priority[presState]).up();
|
||||
}
|
||||
|
||||
@@ -427,9 +451,9 @@ jsxc.xmpp = {
|
||||
disconnected: function() {
|
||||
jsxc.debug('disconnected');
|
||||
|
||||
jsxc.storage.removeItem('jid');
|
||||
jsxc.storage.removeItem('sid');
|
||||
jsxc.storage.removeItem('rid');
|
||||
jsxc.storage.removeItem('lastActivity');
|
||||
jsxc.storage.removeItem('hidden');
|
||||
jsxc.storage.removeUserItem('avatar', 'own');
|
||||
jsxc.storage.removeUserItem('otrlist');
|
||||
@@ -437,7 +461,6 @@ jsxc.xmpp = {
|
||||
$(document).off('connected.jsxc', jsxc.xmpp.connected);
|
||||
$(document).off('attached.jsxc', jsxc.xmpp.attached);
|
||||
$(document).off('disconnected.jsxc', jsxc.xmpp.disconnected);
|
||||
$(document).off('ridChange', jsxc.xmpp.onRidChange);
|
||||
$(document).off('connfail.jsxc', jsxc.xmpp.onConnfail);
|
||||
$(document).off('authfail.jsxc', jsxc.xmpp.onAuthFail);
|
||||
|
||||
@@ -449,6 +472,7 @@ jsxc.xmpp = {
|
||||
$(document).trigger('toggle.roster.jsxc', ['hidden', 0]);
|
||||
$('#jsxc_roster').remove();
|
||||
|
||||
// REVIEW: logoutElement without href attribute?
|
||||
if (jsxc.triggeredFromLogout) {
|
||||
window.location = jsxc.options.logoutElement.attr('href');
|
||||
}
|
||||
@@ -456,7 +480,10 @@ jsxc.xmpp = {
|
||||
jsxc.gui.roster.noConnection();
|
||||
}
|
||||
|
||||
window.clearInterval(jsxc.keepalive);
|
||||
window.clearInterval(jsxc.keepaliveInterval);
|
||||
jsxc.role_allocation = false;
|
||||
jsxc.master = false;
|
||||
jsxc.storage.removeItem('alive');
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -526,7 +553,8 @@ jsxc.xmpp = {
|
||||
name: name,
|
||||
status: 0,
|
||||
sub: sub,
|
||||
res: []
|
||||
res: [],
|
||||
rnd: Math.random() // force storage event
|
||||
});
|
||||
|
||||
jsxc.gui.roster.add(bid);
|
||||
@@ -602,7 +630,7 @@ jsxc.xmpp = {
|
||||
for (noticeKey in notices) {
|
||||
notice = notices[noticeKey];
|
||||
|
||||
if (notice.fnName === 'gui.showApproveDialog' && notice.fnParams[0] === jid) {
|
||||
if (notice.fnName === 'gui.showApproveDialog' && notice.fnParams[0] === jid) {
|
||||
jsxc.debug('Remove notice with key ' + noticeKey);
|
||||
|
||||
jsxc.notice.remove(noticeKey);
|
||||
@@ -669,6 +697,19 @@ jsxc.xmpp = {
|
||||
|
||||
// incoming friendship request
|
||||
if (ptype === 'subscribe') {
|
||||
var bl = jsxc.storage.getUserItem('buddylist');
|
||||
|
||||
if (bl.indexOf(bid) > -1) {
|
||||
jsxc.debug('Auto approve contact request, because he is already in our contact list.');
|
||||
|
||||
jsxc.xmpp.resFriendReq(jid, true);
|
||||
if (data.sub !== 'to') {
|
||||
jsxc.xmpp.addBuddy(jid, data.name);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
jsxc.storage.setUserItem('friendReq', {
|
||||
jid: jid,
|
||||
approve: -1
|
||||
@@ -708,7 +749,7 @@ jsxc.xmpp = {
|
||||
}
|
||||
}
|
||||
|
||||
if (data.status === 0 && max > 0) {
|
||||
if (data.status === 0 && max > 0) {
|
||||
// buddy has come online
|
||||
jsxc.notification.notify({
|
||||
title: data.name,
|
||||
@@ -727,10 +768,10 @@ jsxc.xmpp = {
|
||||
data.jid = jid;
|
||||
|
||||
// Looking for avatar
|
||||
if (xVCard.length > 0 && data.type !== 'groupchat') {
|
||||
if (xVCard.length > 0 && data.type !== 'groupchat') {
|
||||
var photo = xVCard.find('photo');
|
||||
|
||||
if (photo.length > 0 && photo.text() !== data.avatar) {
|
||||
if (photo.length > 0 && photo.text() !== data.avatar) {
|
||||
jsxc.storage.removeUserItem('avatar', data.avatar);
|
||||
data.avatar = photo.text();
|
||||
}
|
||||
@@ -787,7 +828,7 @@ jsxc.xmpp = {
|
||||
|
||||
var body = $(message).find('body:first').text();
|
||||
|
||||
if (!body || (body.match(/\?OTR/i) && forwarded)) {
|
||||
if (!body || (body.match(/\?OTR/i) && forwarded)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -802,10 +843,17 @@ jsxc.xmpp = {
|
||||
stamp = stamp.getTime();
|
||||
|
||||
if (carbon) {
|
||||
var direction = (carbon.prop("tagName") === 'sent') ? 'out' : 'in';
|
||||
var direction = (carbon.prop("tagName") === 'sent') ? jsxc.Message.OUT : jsxc.Message.IN;
|
||||
bid = jsxc.jidToBid((direction === 'out') ? $(message).attr('to') : from);
|
||||
|
||||
jsxc.gui.window.postMessage(bid, direction, body, false, forwarded, stamp);
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: bid,
|
||||
direction: direction,
|
||||
msg: body,
|
||||
encrypted: false,
|
||||
forwarded: forwarded,
|
||||
stamp: stamp
|
||||
});
|
||||
|
||||
return true;
|
||||
|
||||
@@ -852,11 +900,11 @@ jsxc.xmpp = {
|
||||
$(document).trigger('message.jsxc', [from, body]);
|
||||
|
||||
// create related otr object
|
||||
if (jsxc.master && !jsxc.otr.objects[bid]) {
|
||||
if (jsxc.master && !jsxc.otr.objects[bid]) {
|
||||
jsxc.otr.create(bid);
|
||||
}
|
||||
|
||||
if (!forwarded && mid !== null && request.length && data !== null && (data.sub === 'both' || data.sub === 'from') && type === 'chat') {
|
||||
if (!forwarded && mid !== null && request.length && data !== null && (data.sub === 'both' || data.sub === 'from') && type === 'chat') {
|
||||
// Send received according to XEP-0184
|
||||
jsxc.xmpp.conn.send($msg({
|
||||
to: from
|
||||
@@ -872,7 +920,14 @@ jsxc.xmpp = {
|
||||
forwarded: forwarded
|
||||
});
|
||||
} else {
|
||||
jsxc.gui.window.postMessage(bid, 'in', body, false, forwarded, stamp);
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: bid,
|
||||
direction: jsxc.Message.IN,
|
||||
msg: body,
|
||||
encrypted: false,
|
||||
forwarded: forwarded,
|
||||
stamp: stamp
|
||||
});
|
||||
}
|
||||
|
||||
// preserve handler
|
||||
@@ -882,12 +937,11 @@ jsxc.xmpp = {
|
||||
/**
|
||||
* Triggerd if the rid changed
|
||||
*
|
||||
* @param {event} ev
|
||||
* @param {obejct} data
|
||||
* @param {integer} rid next valid request id
|
||||
* @private
|
||||
*/
|
||||
onRidChange: function(ev, data) {
|
||||
jsxc.storage.setItem('rid', data.rid);
|
||||
onRidChange: function(rid) {
|
||||
jsxc.storage.setItem('rid', rid);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -969,27 +1023,14 @@ jsxc.xmpp = {
|
||||
jsxc.gui.roster.purge(bid);
|
||||
},
|
||||
|
||||
onReceived: function(message) {
|
||||
var from = $(message).attr('from');
|
||||
var jid = Strophe.getBareJidFromJid(from);
|
||||
var bid = jsxc.jidToBid(jid);
|
||||
var received = $(message).find("received[xmlns='urn:xmpp:receipts']");
|
||||
onReceived: function(stanza) {
|
||||
var received = $(stanza).find("received[xmlns='urn:xmpp:receipts']");
|
||||
|
||||
if (received.length) {
|
||||
var receivedId = received.attr('id').replace(/:/, '-');
|
||||
var chat = jsxc.storage.getUserItem('chat', bid);
|
||||
var i;
|
||||
var receivedId = received.attr('id');
|
||||
var message = new jsxc.Message(receivedId);
|
||||
|
||||
for (i = chat.length - 1; i >= 0; i--) {
|
||||
if (chat[i].uid === receivedId) {
|
||||
chat[i].received = true;
|
||||
|
||||
$('#' + receivedId).addClass('jsxc_received');
|
||||
|
||||
jsxc.storage.setUserItem('chat', bid, chat);
|
||||
break;
|
||||
}
|
||||
}
|
||||
message.received();
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -1031,13 +1072,13 @@ jsxc.xmpp = {
|
||||
id: uid
|
||||
}).c('body').t(msg);
|
||||
|
||||
if (jsxc.xmpp.carbons.enabled && msg.match(/^\?OTR/)) {
|
||||
if (jsxc.xmpp.carbons.enabled && msg.match(/^\?OTR/)) {
|
||||
xmlMsg.up().c("private", {
|
||||
xmlns: jsxc.CONST.NS.CARBONS
|
||||
});
|
||||
}
|
||||
|
||||
if (type === 'chat' && (isBar || jsxc.xmpp.conn.caps.hasFeatureByJid(jid, Strophe.NS.RECEIPTS))) {
|
||||
if (type === 'chat' && (isBar || jsxc.xmpp.conn.caps.hasFeatureByJid(jid, Strophe.NS.RECEIPTS))) {
|
||||
// Add request according to XEP-0184
|
||||
xmlMsg.up().c('request', {
|
||||
xmlns: 'urn:xmpp:receipts'
|
||||
@@ -1062,7 +1103,7 @@ jsxc.xmpp = {
|
||||
jsxc.storage.setUserItem('vcard', bid, 'request:' + (new Date()).getTime());
|
||||
|
||||
$(document).one('loaded.vcard.jsxc', function(ev, result) {
|
||||
if (result && result.state === 'success') {
|
||||
if (result && result.state === 'success') {
|
||||
cb($(result.data).get(0));
|
||||
} else {
|
||||
error_cb();
|
||||
@@ -1126,7 +1167,7 @@ jsxc.xmpp = {
|
||||
return true;
|
||||
};
|
||||
|
||||
if (conn.caps._jidVerIndex[jid] && conn.caps._knownCapabilities[conn.caps._jidVerIndex[jid]]) {
|
||||
if (conn.caps._jidVerIndex[jid] && conn.caps._knownCapabilities[conn.caps._jidVerIndex[jid]]) {
|
||||
var hasFeature = check(conn.caps._knownCapabilities[conn.caps._jidVerIndex[jid]]);
|
||||
cb(hasFeature);
|
||||
|
||||
@@ -1233,13 +1274,13 @@ jsxc.xmpp.carbons = {
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Index</a></h2><h3>Namespaces</h3><ul><li><a href="jsxc.html">jsxc</a></li><li><a href="jsxc.gui.html">gui</a></li><li><a href="jsxc.gui.dialog.html">dialog</a></li><li><a href="jsxc.gui.queryActions.html">queryActions</a></li><li><a href="jsxc.gui.roster.html">roster</a></li><li><a href="jsxc.gui.window.html">window</a></li><li><a href="jsxc.muc.html">muc</a></li><li><a href="jsxc.notification.html">notification</a></li><li><a href="jsxc.options.html">options</a></li><li><a href="jsxc.otr.html">otr</a></li><li><a href="jsxc.storage.html">storage</a></li><li><a href="jsxc.webrtc.html">webrtc</a></li><li><a href="jsxc.xmpp.html">xmpp</a></li><li><a href="jsxc.xmpp.bookmarks.html">bookmarks</a></li><li><a href="jsxc.xmpp.carbons.html">carbons</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="jsxc.Message.html">Message</a></li></ul><h3>Namespaces</h3><ul><li><a href="jsxc.html">jsxc</a></li><li><a href="jsxc.gui.html">gui</a></li><li><a href="jsxc.gui.dialog.html">dialog</a></li><li><a href="jsxc.gui.queryActions.html">queryActions</a></li><li><a href="jsxc.gui.roster.html">roster</a></li><li><a href="jsxc.gui.window.html">window</a></li><li><a href="jsxc.muc.html">muc</a></li><li><a href="jsxc.notification.html">notification</a></li><li><a href="jsxc.options.html">options</a></li><li><a href="jsxc.otr.html">otr</a></li><li><a href="jsxc.storage.html">storage</a></li><li><a href="jsxc.tab.html">tab</a></li><li><a href="jsxc.webrtc.html">webrtc</a></li><li><a href="jsxc.xmpp.html">xmpp</a></li><li><a href="jsxc.xmpp.bookmarks.html">bookmarks</a></li><li><a href="jsxc.xmpp.carbons.html">carbons</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
</nav>
|
||||
|
||||
<br clear="both">
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Tue Nov 17 2015 17:01:04 GMT+0100 (CET)
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.2</a> on Fri Oct 28 2016 13:29:05 GMT+0200 (CEST)
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
+1604
-2511
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+756
-607
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+1877
-1580
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+1202
-1006
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+1230
-1227
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
@@ -0,0 +1,131 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>JSDoc: Namespace: tab</title>
|
||||
|
||||
<script src="scripts/prettify/prettify.js"> </script>
|
||||
<script src="scripts/prettify/lang-css.js"> </script>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<![endif]-->
|
||||
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
||||
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="main">
|
||||
|
||||
<h1 class="page-title">Namespace: tab</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
|
||||
<header>
|
||||
|
||||
<h2>
|
||||
<span class="ancestors"><a href="jsxc.html">jsxc</a>.</span>tab</h2>
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<article>
|
||||
<div class="container-overview">
|
||||
|
||||
|
||||
<div class="description">Provides communication between tabs.</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="jsxc.lib.tab.js.html">jsxc.lib.tab.js</a>, <a href="jsxc.lib.tab.js.html#line1">line 1</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="jsxc.Message.html">Message</a></li></ul><h3>Namespaces</h3><ul><li><a href="jsxc.html">jsxc</a></li><li><a href="jsxc.gui.html">gui</a></li><li><a href="jsxc.gui.dialog.html">dialog</a></li><li><a href="jsxc.gui.queryActions.html">queryActions</a></li><li><a href="jsxc.gui.roster.html">roster</a></li><li><a href="jsxc.gui.window.html">window</a></li><li><a href="jsxc.muc.html">muc</a></li><li><a href="jsxc.notification.html">notification</a></li><li><a href="jsxc.options.html">options</a></li><li><a href="jsxc.otr.html">otr</a></li><li><a href="jsxc.storage.html">storage</a></li><li><a href="jsxc.tab.html">tab</a></li><li><a href="jsxc.webrtc.html">webrtc</a></li><li><a href="jsxc.xmpp.html">xmpp</a></li><li><a href="jsxc.xmpp.bookmarks.html">bookmarks</a></li><li><a href="jsxc.xmpp.carbons.html">carbons</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
</nav>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.2</a> on Fri Oct 28 2016 13:29:05 GMT+0200 (CEST)
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
<script src="scripts/linenumber.js"> </script>
|
||||
</body>
|
||||
</html>
|
||||
+1434
-2605
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+507
-1272
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+326
-277
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>JSDoc: Namespace: carbons</title>
|
||||
|
||||
|
||||
<script src="scripts/prettify/prettify.js"> </script>
|
||||
<script src="scripts/prettify/lang-css.js"> </script>
|
||||
<!--[if lt IE 9]>
|
||||
@@ -16,432 +16,481 @@
|
||||
<body>
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<h1 class="page-title">Namespace: carbons</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
|
||||
|
||||
<header>
|
||||
<h2>
|
||||
<span class="ancestors"><a href="jsxc.html">jsxc</a><a href="jsxc.xmpp.html">.xmpp</a>.</span>
|
||||
|
||||
carbons
|
||||
</h2>
|
||||
<h2>
|
||||
<span class="ancestors"><a href="jsxc.html">jsxc</a><a href="jsxc.xmpp.html">.xmpp</a>.</span>carbons</h2>
|
||||
|
||||
|
||||
</header>
|
||||
</header>
|
||||
|
||||
<article>
|
||||
<div class="container-overview">
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">Handle carbons (XEP-0280);</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="jsxc.lib.xmpp.js.html">jsxc.lib.xmpp.js</a>, <a href="jsxc.lib.xmpp.js.html#line1121">line 1121</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="subsection-title">Methods</h3>
|
||||
|
||||
<dl>
|
||||
|
||||
<dt>
|
||||
<h4 class="name" id="disable"><span class="type-signature"><static> </span>disable<span class="signature">(cb)</span><span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
<div class="description">
|
||||
Disable carbons.
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Parameters:</h5>
|
||||
|
||||
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<th>Name</th>
|
||||
|
||||
|
||||
<th>Type</th>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<th class="last">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>cb</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last">callback</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="jsxc.lib.xmpp.js.html">jsxc.lib.xmpp.js</a>, <a href="jsxc.lib.xmpp.js.html#line1161">line 1161</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<h3 class="subsection-title">Methods</h3>
|
||||
|
||||
|
||||
|
||||
<dt>
|
||||
<h4 class="name" id="enable"><span class="type-signature"><static> </span>enable<span class="signature">(cb)</span><span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
<div class="description">
|
||||
Enable carbons.
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id=".disable"><span class="type-signature">(static) </span>disable<span class="signature">(cb)</span><span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">
|
||||
Disable carbons.
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Parameters:</h5>
|
||||
|
||||
|
||||
|
||||
<h5>Parameters:</h5>
|
||||
|
||||
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<th>Name</th>
|
||||
|
||||
|
||||
<th>Type</th>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<th class="last">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<th>Name</th>
|
||||
|
||||
|
||||
<th>Type</th>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<th class="last">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>cb</code></td>
|
||||
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last">callback</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="jsxc.lib.xmpp.js.html">jsxc.lib.xmpp.js</a>, <a href="jsxc.lib.xmpp.js.html#line1135">line 1135</a>
|
||||
<a href="jsxc.lib.xmpp.js.html">jsxc.lib.xmpp.js</a>, <a href="jsxc.lib.xmpp.js.html#line1201">line 1201</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt>
|
||||
<h4 class="name" id="refresh"><span class="type-signature"><static> </span>refresh<span class="signature">(err)</span><span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
<div class="description">
|
||||
Enable/Disable carbons depending on options key.
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id=".enable"><span class="type-signature">(static) </span>enable<span class="signature">(cb)</span><span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">
|
||||
Enable carbons.
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Parameters:</h5>
|
||||
|
||||
|
||||
|
||||
<h5>Parameters:</h5>
|
||||
|
||||
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<th>Name</th>
|
||||
|
||||
|
||||
<th>Type</th>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<th class="last">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<th>Name</th>
|
||||
|
||||
|
||||
<th>Type</th>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<th class="last">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>cb</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last">callback</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="jsxc.lib.xmpp.js.html">jsxc.lib.xmpp.js</a>, <a href="jsxc.lib.xmpp.js.html#line1175">line 1175</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id=".refresh"><span class="type-signature">(static) </span>refresh<span class="signature">(err)</span><span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">
|
||||
Enable/Disable carbons depending on options key.
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Parameters:</h5>
|
||||
|
||||
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<th>Name</th>
|
||||
|
||||
|
||||
<th>Type</th>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<th class="last">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>err</code></td>
|
||||
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last">error message</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="jsxc.lib.xmpp.js.html">jsxc.lib.xmpp.js</a>, <a href="jsxc.lib.xmpp.js.html#line1187">line 1187</a>
|
||||
<a href="jsxc.lib.xmpp.js.html">jsxc.lib.xmpp.js</a>, <a href="jsxc.lib.xmpp.js.html#line1227">line 1227</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
|
||||
</section>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
@@ -449,13 +498,13 @@
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Index</a></h2><h3>Namespaces</h3><ul><li><a href="jsxc.html">jsxc</a></li><li><a href="jsxc.gui.html">gui</a></li><li><a href="jsxc.gui.dialog.html">dialog</a></li><li><a href="jsxc.gui.queryActions.html">queryActions</a></li><li><a href="jsxc.gui.roster.html">roster</a></li><li><a href="jsxc.gui.window.html">window</a></li><li><a href="jsxc.muc.html">muc</a></li><li><a href="jsxc.notification.html">notification</a></li><li><a href="jsxc.options.html">options</a></li><li><a href="jsxc.otr.html">otr</a></li><li><a href="jsxc.storage.html">storage</a></li><li><a href="jsxc.webrtc.html">webrtc</a></li><li><a href="jsxc.xmpp.html">xmpp</a></li><li><a href="jsxc.xmpp.bookmarks.html">bookmarks</a></li><li><a href="jsxc.xmpp.carbons.html">carbons</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="jsxc.Message.html">Message</a></li></ul><h3>Namespaces</h3><ul><li><a href="jsxc.html">jsxc</a></li><li><a href="jsxc.gui.html">gui</a></li><li><a href="jsxc.gui.dialog.html">dialog</a></li><li><a href="jsxc.gui.queryActions.html">queryActions</a></li><li><a href="jsxc.gui.roster.html">roster</a></li><li><a href="jsxc.gui.window.html">window</a></li><li><a href="jsxc.muc.html">muc</a></li><li><a href="jsxc.notification.html">notification</a></li><li><a href="jsxc.options.html">options</a></li><li><a href="jsxc.otr.html">otr</a></li><li><a href="jsxc.storage.html">storage</a></li><li><a href="jsxc.tab.html">tab</a></li><li><a href="jsxc.webrtc.html">webrtc</a></li><li><a href="jsxc.xmpp.html">xmpp</a></li><li><a href="jsxc.xmpp.bookmarks.html">bookmarks</a></li><li><a href="jsxc.xmpp.carbons.html">carbons</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
</nav>
|
||||
|
||||
<br clear="both">
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Tue Nov 17 2015 17:01:05 GMT+0100 (CET)
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.2</a> on Fri Oct 28 2016 13:29:06 GMT+0200 (CEST)
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
+897
-2189
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+19
-11
@@ -1,17 +1,25 @@
|
||||
/*global document */
|
||||
(function() {
|
||||
var counter = 0;
|
||||
var numbered;
|
||||
var source = document.getElementsByClassName('prettyprint source');
|
||||
var source = document.getElementsByClassName('prettyprint source linenums');
|
||||
var i = 0;
|
||||
var lineNumber = 0;
|
||||
var lineId;
|
||||
var lines;
|
||||
var totalLines;
|
||||
var anchorHash;
|
||||
|
||||
if (source && source[0]) {
|
||||
source = source[0].getElementsByTagName('code')[0];
|
||||
anchorHash = document.location.hash.substring(1);
|
||||
lines = source[0].getElementsByTagName('li');
|
||||
totalLines = lines.length;
|
||||
|
||||
numbered = source.innerHTML.split('\n');
|
||||
numbered = numbered.map(function(item) {
|
||||
counter++;
|
||||
return '<span id="line' + counter + '" class="line"></span>' + item;
|
||||
});
|
||||
|
||||
source.innerHTML = numbered.join('\n');
|
||||
for (; i < totalLines; i++) {
|
||||
lineNumber++;
|
||||
lineId = 'line' + lineNumber;
|
||||
lines[i].id = lineId;
|
||||
if (lineId === anchorHash) {
|
||||
lines[i].className += ' selected';
|
||||
}
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
+198
-134
@@ -1,94 +1,127 @@
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
src: url('../fonts/OpenSans-Regular-webfont.eot');
|
||||
src:
|
||||
local('Open Sans'),
|
||||
local('OpenSans'),
|
||||
url('../fonts/OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'),
|
||||
url('../fonts/OpenSans-Regular-webfont.woff') format('woff'),
|
||||
url('../fonts/OpenSans-Regular-webfont.svg#open_sansregular') format('svg');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Open Sans Light';
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
src: url('../fonts/OpenSans-Light-webfont.eot');
|
||||
src:
|
||||
local('Open Sans Light'),
|
||||
local('OpenSans Light'),
|
||||
url('../fonts/OpenSans-Light-webfont.eot?#iefix') format('embedded-opentype'),
|
||||
url('../fonts/OpenSans-Light-webfont.woff') format('woff'),
|
||||
url('../fonts/OpenSans-Light-webfont.svg#open_sanslight') format('svg');
|
||||
}
|
||||
|
||||
html
|
||||
{
|
||||
overflow: auto;
|
||||
background-color: #fff;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
body
|
||||
{
|
||||
font: 14px "DejaVu Sans Condensed", "Liberation Sans", "Nimbus Sans L", Tahoma, Geneva, "Helvetica Neue", Helvetica, Arial, sans serif;
|
||||
line-height: 130%;
|
||||
color: #000;
|
||||
background-color: #fff;
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
line-height: 1.5;
|
||||
color: #4d4e53;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #444;
|
||||
a, a:visited, a:active {
|
||||
color: #0095dd;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:visited {
|
||||
color: #444;
|
||||
}
|
||||
|
||||
a:active {
|
||||
color: #444;
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
header
|
||||
{
|
||||
display: block;
|
||||
padding: 6px 4px;
|
||||
display: block;
|
||||
padding: 0px 4px;
|
||||
}
|
||||
|
||||
tt, code, kbd, samp {
|
||||
font-family: Consolas, Monaco, 'Andale Mono', monospace;
|
||||
}
|
||||
|
||||
.class-description {
|
||||
font-style: italic;
|
||||
font-family: Palatino, 'Palatino Linotype', serif;
|
||||
font-size: 130%;
|
||||
line-height: 140%;
|
||||
margin-bottom: 1em;
|
||||
margin-top: 1em;
|
||||
font-size: 130%;
|
||||
line-height: 140%;
|
||||
margin-bottom: 1em;
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
.class-description:empty {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#main {
|
||||
float: left;
|
||||
width: 100%;
|
||||
width: 70%;
|
||||
}
|
||||
|
||||
article dl {
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
section
|
||||
{
|
||||
display: block;
|
||||
|
||||
background-color: #fff;
|
||||
padding: 12px 24px;
|
||||
display: block;
|
||||
background-color: #fff;
|
||||
padding: 12px 24px;
|
||||
border-bottom: 1px solid #ccc;
|
||||
margin-right: 240px;
|
||||
margin-right: 30px;
|
||||
}
|
||||
|
||||
.variation {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.optional:after {
|
||||
content: "opt";
|
||||
font-size: 60%;
|
||||
color: #aaa;
|
||||
font-style: italic;
|
||||
font-weight: lighter;
|
||||
.signature-attributes {
|
||||
font-size: 60%;
|
||||
color: #aaa;
|
||||
font-style: italic;
|
||||
font-weight: lighter;
|
||||
}
|
||||
|
||||
nav
|
||||
{
|
||||
display: block;
|
||||
float: left;
|
||||
margin-left: -230px;
|
||||
display: block;
|
||||
float: right;
|
||||
margin-top: 28px;
|
||||
width: 220px;
|
||||
width: 30%;
|
||||
box-sizing: border-box;
|
||||
border-left: 1px solid #ccc;
|
||||
padding-left: 9px;
|
||||
padding-left: 16px;
|
||||
}
|
||||
|
||||
nav ul {
|
||||
font-family: 'Lucida Grande', 'Lucida Sans Unicode', arial, sans-serif;
|
||||
font-size: 100%;
|
||||
line-height: 17px;
|
||||
padding:0;
|
||||
margin:0;
|
||||
list-style-type:none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
nav h2 a, nav h2 a:visited {
|
||||
color: #A35A00;
|
||||
text-decoration: none;
|
||||
nav ul a, nav ul a:visited, nav ul a:active {
|
||||
font-family: Consolas, Monaco, 'Andale Mono', monospace;
|
||||
line-height: 18px;
|
||||
color: #4D4E53;
|
||||
}
|
||||
|
||||
nav h3 {
|
||||
@@ -99,18 +132,6 @@ nav li {
|
||||
margin-top: 6px;
|
||||
}
|
||||
|
||||
nav a {
|
||||
color: #5C5954;
|
||||
}
|
||||
|
||||
nav a:visited {
|
||||
color: #5C5954;
|
||||
}
|
||||
|
||||
nav a:active {
|
||||
color: #5C5954;
|
||||
}
|
||||
|
||||
footer {
|
||||
display: block;
|
||||
padding: 6px;
|
||||
@@ -119,57 +140,84 @@ footer {
|
||||
font-size: 90%;
|
||||
}
|
||||
|
||||
h1
|
||||
{
|
||||
font-size: 200%;
|
||||
font-weight: bold;
|
||||
letter-spacing: -0.01em;
|
||||
margin: 6px 0 9px 0;
|
||||
h1, h2, h3, h4 {
|
||||
font-weight: 200;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
h2
|
||||
h1
|
||||
{
|
||||
font-size: 170%;
|
||||
font-weight: bold;
|
||||
letter-spacing: -0.01em;
|
||||
margin: 6px 0 3px 0;
|
||||
font-family: 'Open Sans Light', sans-serif;
|
||||
font-size: 48px;
|
||||
letter-spacing: -2px;
|
||||
margin: 12px 24px 20px;
|
||||
}
|
||||
|
||||
h2, h3.subsection-title
|
||||
{
|
||||
font-size: 30px;
|
||||
font-weight: 700;
|
||||
letter-spacing: -1px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
h3
|
||||
{
|
||||
font-size: 150%;
|
||||
font-weight: bold;
|
||||
letter-spacing: -0.01em;
|
||||
margin-top: 16px;
|
||||
margin: 6px 0 3px 0;
|
||||
font-size: 24px;
|
||||
letter-spacing: -0.5px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
h4
|
||||
{
|
||||
font-size: 130%;
|
||||
font-weight: bold;
|
||||
letter-spacing: -0.01em;
|
||||
margin-top: 16px;
|
||||
margin: 18px 0 3px 0;
|
||||
color: #A35A00;
|
||||
font-size: 18px;
|
||||
letter-spacing: -0.33px;
|
||||
margin-bottom: 12px;
|
||||
color: #4d4e53;
|
||||
}
|
||||
|
||||
h5, .container-overview .subsection-title
|
||||
{
|
||||
font-size: 120%;
|
||||
font-weight: bold;
|
||||
letter-spacing: -0.01em;
|
||||
margin: 8px 0 3px -16px;
|
||||
font-size: 120%;
|
||||
font-weight: bold;
|
||||
letter-spacing: -0.01em;
|
||||
margin: 8px 0 3px 0;
|
||||
}
|
||||
|
||||
h6
|
||||
{
|
||||
font-size: 100%;
|
||||
letter-spacing: -0.01em;
|
||||
margin: 6px 0 3px 0;
|
||||
font-style: italic;
|
||||
font-size: 100%;
|
||||
letter-spacing: -0.01em;
|
||||
margin: 6px 0 3px 0;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
table
|
||||
{
|
||||
border-spacing: 0;
|
||||
border: 0;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
td, th
|
||||
{
|
||||
border: 1px solid #ddd;
|
||||
margin: 0px;
|
||||
text-align: left;
|
||||
vertical-align: top;
|
||||
padding: 4px 6px;
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
thead tr
|
||||
{
|
||||
background-color: #ddd;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
th { border-right: 1px solid #aaa; }
|
||||
tr > th:last-child { border-right: 1px solid #ddd; }
|
||||
|
||||
.ancestors { color: #999; }
|
||||
.ancestors a
|
||||
{
|
||||
@@ -177,10 +225,15 @@ h6
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.clear
|
||||
{
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.important
|
||||
{
|
||||
font-weight: bold;
|
||||
color: #950B02;
|
||||
font-weight: bold;
|
||||
color: #950B02;
|
||||
}
|
||||
|
||||
.yes-def {
|
||||
@@ -192,12 +245,12 @@ h6
|
||||
}
|
||||
|
||||
.name, .signature {
|
||||
font-family: Consolas, "Lucida Console", Monaco, monospace;
|
||||
font-family: Consolas, Monaco, 'Andale Mono', monospace;
|
||||
}
|
||||
|
||||
.details { margin-top: 14px; border-left: 2px solid #DDD; }
|
||||
.details dt { width:100px; float:left; padding-left: 10px; padding-top: 6px; }
|
||||
.details dd { margin-left: 50px; }
|
||||
.details dt { width: 120px; float: left; padding-left: 10px; padding-top: 6px; }
|
||||
.details dd { margin-left: 70px; }
|
||||
.details ul { margin: 0; }
|
||||
.details ul { list-style-type: none; }
|
||||
.details li { margin-left: 30px; padding-top: 6px; }
|
||||
@@ -205,23 +258,21 @@ h6
|
||||
.details .object-value { padding-top: 0; }
|
||||
|
||||
.description {
|
||||
margin-bottom: 1em;
|
||||
margin-left: -16px;
|
||||
margin-top: 1em;
|
||||
margin-bottom: 1em;
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
.code-caption
|
||||
{
|
||||
font-style: italic;
|
||||
font-family: Palatino, 'Palatino Linotype', serif;
|
||||
font-size: 107%;
|
||||
margin: 0;
|
||||
font-style: italic;
|
||||
font-size: 107%;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.prettyprint
|
||||
{
|
||||
border: 1px solid #ddd;
|
||||
width: 80%;
|
||||
border: 1px solid #ddd;
|
||||
width: 80%;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
@@ -231,15 +282,13 @@ h6
|
||||
|
||||
.prettyprint code
|
||||
{
|
||||
font-family: Consolas, 'Lucida Console', Monaco, monospace;
|
||||
font-size: 100%;
|
||||
line-height: 18px;
|
||||
display: block;
|
||||
padding: 4px 12px;
|
||||
margin: 0;
|
||||
background-color: #fff;
|
||||
color: #000;
|
||||
border-left: 3px #ddd solid;
|
||||
font-size: 100%;
|
||||
line-height: 18px;
|
||||
display: block;
|
||||
padding: 4px 12px;
|
||||
margin: 0;
|
||||
background-color: #fff;
|
||||
color: #4D4E53;
|
||||
}
|
||||
|
||||
.prettyprint code span.line
|
||||
@@ -247,44 +296,59 @@ h6
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.params, .props
|
||||
.prettyprint.linenums
|
||||
{
|
||||
border-spacing: 0;
|
||||
border: 0;
|
||||
border-collapse: collapse;
|
||||
padding-left: 70px;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.prettyprint.linenums ol
|
||||
{
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.prettyprint.linenums li
|
||||
{
|
||||
border-left: 3px #ddd solid;
|
||||
}
|
||||
|
||||
.prettyprint.linenums li.selected,
|
||||
.prettyprint.linenums li.selected *
|
||||
{
|
||||
background-color: lightyellow;
|
||||
}
|
||||
|
||||
.prettyprint.linenums li *
|
||||
{
|
||||
-webkit-user-select: text;
|
||||
-moz-user-select: text;
|
||||
-ms-user-select: text;
|
||||
user-select: text;
|
||||
}
|
||||
|
||||
.params .name, .props .name, .name code {
|
||||
color: #A35A00;
|
||||
font-family: Consolas, 'Lucida Console', Monaco, monospace;
|
||||
font-size: 100%;
|
||||
color: #4D4E53;
|
||||
font-family: Consolas, Monaco, 'Andale Mono', monospace;
|
||||
font-size: 100%;
|
||||
}
|
||||
|
||||
.params td, .params th, .props td, .props th
|
||||
.params td.description > p:first-child,
|
||||
.props td.description > p:first-child
|
||||
{
|
||||
border: 1px solid #ddd;
|
||||
margin: 0px;
|
||||
text-align: left;
|
||||
vertical-align: top;
|
||||
padding: 4px 6px;
|
||||
display: table-cell;
|
||||
margin-top: 0;
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
.params thead tr, .props thead tr
|
||||
.params td.description > p:last-child,
|
||||
.props td.description > p:last-child
|
||||
{
|
||||
background-color: #ddd;
|
||||
font-weight: bold;
|
||||
margin-bottom: 0;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.params .params thead tr, .props .props thead tr
|
||||
{
|
||||
background-color: #fff;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.params th, .props th { border-right: 1px solid #aaa; }
|
||||
.params thead .last, .props thead .last { border-right: 1px solid #ddd; }
|
||||
|
||||
.disabled {
|
||||
color: #454545;
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
/*
|
||||
pre.prettyprint {
|
||||
background: white;
|
||||
font-family: Menlo, Monaco, Consolas, monospace;
|
||||
font-family: Consolas, Monaco, 'Andale Mono', monospace;
|
||||
font-size: 12px;
|
||||
line-height: 1.5;
|
||||
border: 1px solid #ccc;
|
||||
|
||||
@@ -6,6 +6,10 @@ body {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.jsxc-org {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#content form .alert {
|
||||
display: none;
|
||||
}
|
||||
@@ -15,7 +19,7 @@ body {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
#content .form {
|
||||
#content .col-md-4 .form {
|
||||
min-height: 180px;
|
||||
}
|
||||
|
||||
@@ -23,6 +27,34 @@ body {
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
#content .col-md-4 > p {
|
||||
#content .col-md-4>p {
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
#server-flash {
|
||||
margin: 0;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
#server-flash:before {
|
||||
content: "\e031";
|
||||
position: relative;
|
||||
top: 1px;
|
||||
padding-right: 5px;
|
||||
display: inline-block;
|
||||
font-family: 'Glyphicons Halflings';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
line-height: 1;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
#server-flash.success:before {
|
||||
content: "\e089";
|
||||
color: green;
|
||||
}
|
||||
|
||||
#server-flash.fail:before {
|
||||
content: "\e088";
|
||||
color: red;
|
||||
}
|
||||
|
||||
+58
-4
@@ -12,7 +12,6 @@
|
||||
<!-- require:dependencies -->
|
||||
<link href="../build/css/jquery-ui.min.css" media="all" rel="stylesheet" type="text/css" />
|
||||
<link href="../dev/css/jsxc.css" media="all" rel="stylesheet" type="text/css" />
|
||||
<link href="../dev/css/jsxc.webrtc.css" media="all" rel="stylesheet" type="text/css" />
|
||||
<!-- endrequire -->
|
||||
|
||||
<link href="css/example.css" media="all" rel="stylesheet" type="text/css" />
|
||||
@@ -31,7 +30,7 @@
|
||||
<script src="../dev/jsxc.js"></script>
|
||||
|
||||
<!-- init script -->
|
||||
<script src="js/dev.js"></script>
|
||||
<script src="js/example.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
@@ -42,7 +41,27 @@
|
||||
<div class="col-xs-12">
|
||||
<h1 class="page-header">JSXC <small>developer example</small></h1>
|
||||
|
||||
<p>This example demonstrates different types of login methods for <a href="https://www.jsxc.org/">JSXC</a>. You find further information in our <a href="https://github.com/jsxc/jsxc/wiki">wiki</a>.</p>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<p>This example demonstrates different types of login methods for <a href="https://www.jsxc.org/">JSXC</a>. You find further information in our <a href="https://github.com/jsxc/jsxc/wiki">wiki</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="form form-horizontal col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="xmpp-domain" class="col-xs-4 control-label">XMPP domain:</label>
|
||||
<div class="col-xs-8">
|
||||
<input type="text" id="xmpp-domain" name="xmpp-domain" class="form-control" value="localhost" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="bosh-url" class="col-xs-4 control-label">BOSH url:</label>
|
||||
<div class="col-xs-8">
|
||||
<input type="text" id="bosh-url" name="bosh-url" class="form-control" value="/http-bind/" />
|
||||
<p id="server-flash"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -159,7 +178,7 @@ $('#submit').click(function(){
|
||||
|
||||
var jid = username + '@localhost';
|
||||
|
||||
jsxc.xmpp.login(jid , password);
|
||||
jsxc.start(jid , password);
|
||||
});
|
||||
</pre>
|
||||
</div>
|
||||
@@ -193,6 +212,41 @@ $('#button').click(jsxc.gui.showLoginBox);</pre>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-4">
|
||||
<h3>Prelogin</h3>
|
||||
|
||||
<p>Attach to existing BOSH connection. Helpful if you login server side.</p>
|
||||
|
||||
<pre>jsxc.init({
|
||||
xmpp: {
|
||||
url: '/http-bind/',
|
||||
jid: 'username@localhost',
|
||||
sid: 'SID',
|
||||
rid: 'RID'
|
||||
},
|
||||
root: '/jsxc/'
|
||||
});</pre>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-md-4">
|
||||
<h3>AJAX Prelogin</h3>
|
||||
|
||||
<p>Attach to existing BOSH connection after JSXC was initialized.</p>
|
||||
|
||||
<pre>jsxc.init({
|
||||
xmpp: {
|
||||
url: '/http-bind/'
|
||||
},
|
||||
root: '/jsxc/'
|
||||
});
|
||||
|
||||
function callback() {
|
||||
jsxc.start('username@localhost', 'SID', 'RID');
|
||||
}</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
|
||||
+59
-3
@@ -12,7 +12,6 @@
|
||||
<!-- require:dependencies -->
|
||||
<link href="../build/css/jquery-ui.min.css" media="all" rel="stylesheet" type="text/css" />
|
||||
<link href="../build/css/jsxc.css" media="all" rel="stylesheet" type="text/css" />
|
||||
<link href="../build/css/jsxc.webrtc.css" media="all" rel="stylesheet" type="text/css" />
|
||||
<!-- endrequire -->
|
||||
|
||||
<link href="css/example.css" media="all" rel="stylesheet" type="text/css" />
|
||||
@@ -42,7 +41,29 @@
|
||||
<div class="col-xs-12">
|
||||
<h1 class="page-header">JSXC <small>example</small></h1>
|
||||
|
||||
<p>This example demonstrates different types of login methods for <a href="https://www.jsxc.org/">JSXC</a>. You find further information in our <a href="https://github.com/jsxc/jsxc/wiki">wiki</a>.</p>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<p>This example demonstrates different types of login methods for <a href="https://www.jsxc.org/">JSXC</a>. You find further information in our <a href="https://github.com/jsxc/jsxc/wiki">wiki</a>.</p>
|
||||
|
||||
<p class="jsxc-org">You can use demo1 to demo5 with password demo to test JSXC (XMPP domain: jsxc.org, BOSH url: /http-bind/).</p>
|
||||
</div>
|
||||
|
||||
<div class="form form-horizontal col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="xmpp-domain" class="col-xs-4 control-label">XMPP domain:</label>
|
||||
<div class="col-xs-8">
|
||||
<input type="text" id="xmpp-domain" name="xmpp-domain" class="form-control" value="localhost" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="bosh-url" class="col-xs-4 control-label">BOSH url:</label>
|
||||
<div class="col-xs-8">
|
||||
<input type="text" id="bosh-url" name="bosh-url" class="form-control" value="/http-bind/" />
|
||||
<p id="server-flash"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -159,7 +180,7 @@ $('#submit').click(function(){
|
||||
|
||||
var jid = username + '@localhost';
|
||||
|
||||
jsxc.xmpp.login(jid , password);
|
||||
jsxc.start(jid , password);
|
||||
});
|
||||
</pre>
|
||||
</div>
|
||||
@@ -193,6 +214,41 @@ $('#button').click(jsxc.gui.showLoginBox);</pre>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-4">
|
||||
<h3>Prelogin</h3>
|
||||
|
||||
<p>Attach to existing BOSH connection. Helpful if you login server side.</p>
|
||||
|
||||
<pre>jsxc.init({
|
||||
xmpp: {
|
||||
url: '/http-bind/',
|
||||
jid: 'username@localhost',
|
||||
sid: 'SID',
|
||||
rid: 'RID'
|
||||
},
|
||||
root: '/jsxc/'
|
||||
});</pre>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-md-4">
|
||||
<h3>AJAX Prelogin</h3>
|
||||
|
||||
<p>Attach to existing BOSH connection after JSXC was initialized.</p>
|
||||
|
||||
<pre>jsxc.init({
|
||||
xmpp: {
|
||||
url: '/http-bind/'
|
||||
},
|
||||
root: '/jsxc/'
|
||||
});
|
||||
|
||||
function callback() {
|
||||
jsxc.start('username@localhost', 'SID', 'RID');
|
||||
}</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
$(function() {
|
||||
var settings = {
|
||||
xmpp: {
|
||||
url: '/http-bind/',
|
||||
domain: 'localhost',
|
||||
resource: 'example',
|
||||
overwrite: true,
|
||||
onlogin: true
|
||||
}
|
||||
};
|
||||
|
||||
jsxc.init({
|
||||
loginForm: {
|
||||
form: '#form',
|
||||
jid: '#username',
|
||||
pass: '#password'
|
||||
},
|
||||
logoutElement: $('#logout'),
|
||||
checkFlash: false,
|
||||
rosterAppend: 'body',
|
||||
root: window.location.pathname.replace(/\/[^/]+$/, "/") + '../dev',
|
||||
displayRosterMinimized: function() {
|
||||
return true;
|
||||
},
|
||||
otr: {
|
||||
debug: true,
|
||||
SEND_WHITESPACE_TAG: true,
|
||||
WHITESPACE_START_AKE: true
|
||||
},
|
||||
loadSettings: function(username, password, cb) {
|
||||
cb(settings);
|
||||
},
|
||||
xmpp: {
|
||||
url: settings.xmpp.url
|
||||
}
|
||||
});
|
||||
|
||||
var source = '#form';
|
||||
|
||||
$('#form2').submit(function(ev) {
|
||||
ev.preventDefault();
|
||||
|
||||
source = $(this);
|
||||
$('#submit2').button('loading');
|
||||
|
||||
jsxc.xmpp.login($('#username2').val() + '@' + settings.xmpp.domain, $('#password2').val());
|
||||
});
|
||||
|
||||
$('#form3 .submit').click(jsxc.gui.showLoginBox);
|
||||
|
||||
$(document).on('connecting.jsxc', function() {
|
||||
$('#form2 input, #form input').prop('disabled', true);
|
||||
});
|
||||
|
||||
$(document).on('authfail.jsxc', function() {
|
||||
$('#form2 input, #form input').prop('disabled', false);
|
||||
$(source).find('.alert').show();
|
||||
$(source).find('.submit').button('reset');
|
||||
});
|
||||
|
||||
$(document).on('connectionReady.jsxc', function() {
|
||||
$('#form2 input, #form input').prop('disabled', true);
|
||||
$('.submit').hide();
|
||||
$('form .alert').hide();
|
||||
|
||||
$('.logout').show().click(jsxc.xmpp.logout);
|
||||
});
|
||||
|
||||
$(document).on('disconnected.jsxc', function() {
|
||||
$(source).find('button').button('reset');
|
||||
$('#form2 input, #form input').prop('disabled', false);
|
||||
$('.submit').show();
|
||||
$('.logout').hide().off('click');
|
||||
});
|
||||
});
|
||||
+174
-15
@@ -1,14 +1,17 @@
|
||||
/*jshint latedef: nofunc */
|
||||
|
||||
$(function() {
|
||||
var settings = {
|
||||
xmpp: {
|
||||
url: '/http-bind/',
|
||||
domain: 'localhost',
|
||||
resource: 'example',
|
||||
overwrite: true,
|
||||
onlogin: true
|
||||
overwrite: true
|
||||
}
|
||||
};
|
||||
|
||||
// Initialize core functions, intercept login form
|
||||
// and attach connection if possible.
|
||||
jsxc.init({
|
||||
loginForm: {
|
||||
form: '#form',
|
||||
@@ -16,17 +19,11 @@ $(function() {
|
||||
pass: '#password'
|
||||
},
|
||||
logoutElement: $('#logout'),
|
||||
checkFlash: false,
|
||||
rosterAppend: 'body',
|
||||
root: window.location.pathname.replace(/\/[^/]+$/, '/') + '../build',
|
||||
root: window.location.pathname.replace(/\/[^/]+$/, "/") + (window.location.pathname.match(/dev\.html/) ? '../dev' : '../build'),
|
||||
displayRosterMinimized: function() {
|
||||
return true;
|
||||
},
|
||||
otr: {
|
||||
debug: true,
|
||||
SEND_WHITESPACE_TAG: true,
|
||||
WHITESPACE_START_AKE: true
|
||||
},
|
||||
loadSettings: function(username, password, cb) {
|
||||
cb(settings);
|
||||
},
|
||||
@@ -35,31 +32,42 @@ $(function() {
|
||||
}
|
||||
});
|
||||
|
||||
// helper variable
|
||||
var source = '#form';
|
||||
|
||||
// AJAX login
|
||||
$('#form2').submit(function(ev) {
|
||||
ev.preventDefault();
|
||||
|
||||
source = $(this);
|
||||
$('#submit2').button('loading');
|
||||
|
||||
jsxc.xmpp.login($('#username2').val() + '@' + settings.xmpp.domain, $('#password2').val());
|
||||
jsxc.start($('#username2').val() + '@' + settings.xmpp.domain, $('#password2').val());
|
||||
});
|
||||
|
||||
// Box Login
|
||||
$('#form3 .submit').click(jsxc.gui.showLoginBox);
|
||||
|
||||
// ============================================
|
||||
// Below you find only some helper to show/hide
|
||||
// logout buttons and similiar stuff.
|
||||
// ============================================
|
||||
|
||||
// form elements which needs to be enabled/disabled
|
||||
var formElements = $('#form2, #form').find('input');
|
||||
|
||||
$(document).on('connecting.jsxc', function() {
|
||||
$('#form2 input, #form input').prop('disabled', true);
|
||||
formElements.prop('disabled', true);
|
||||
});
|
||||
|
||||
$(document).on('authfail.jsxc', function() {
|
||||
$('#form2 input, #form input').prop('disabled', false);
|
||||
formElements.prop('disabled', false);
|
||||
$(source).find('.alert').show();
|
||||
$(source).find('.submit').button('reset');
|
||||
});
|
||||
|
||||
$(document).on('connectionReady.jsxc', function() {
|
||||
$('#form2 input, #form input').prop('disabled', true);
|
||||
$(document).on('attached.jsxc', function() {
|
||||
formElements.prop('disabled', true);
|
||||
$('.submit').hide();
|
||||
$('form .alert').hide();
|
||||
|
||||
@@ -68,8 +76,159 @@ $(function() {
|
||||
|
||||
$(document).on('disconnected.jsxc', function() {
|
||||
$(source).find('button').button('reset');
|
||||
$('#form2 input, #form input').prop('disabled', false);
|
||||
formElements.prop('disabled', false);
|
||||
$('.submit').show();
|
||||
$('.logout').hide().off('click');
|
||||
});
|
||||
|
||||
// special setup for jsxc.org/example
|
||||
if (window.location.hostname === 'www.jsxc.org' && !localStorage.getItem('bosh-url') && !localStorage.getItem('xmpp-domain')) {
|
||||
$('#bosh-url').val('/http-bind/');
|
||||
$('#xmpp-domain').val('jsxc.org');
|
||||
}
|
||||
|
||||
// load bosh url from storage
|
||||
if (typeof localStorage.getItem('bosh-url') === 'string') {
|
||||
$('#bosh-url').val(localStorage.getItem('bosh-url'));
|
||||
}
|
||||
|
||||
// load xmpp domain from storage
|
||||
if (typeof localStorage.getItem('xmpp-domain') === 'string') {
|
||||
$('#xmpp-domain').val(localStorage.getItem('xmpp-domain'));
|
||||
}
|
||||
|
||||
// Check bosh url, if input changed
|
||||
$('#bosh-url, #xmpp-domain').on('input', function() {
|
||||
var self = $(this);
|
||||
var timeout = self.data('timeout');
|
||||
|
||||
if (timeout) {
|
||||
clearTimeout(timeout);
|
||||
}
|
||||
|
||||
var url = $('#bosh-url').val();
|
||||
var domain = $('#xmpp-domain').val();
|
||||
|
||||
if (!url || !domain) {
|
||||
// we need url and domain to test BOSH server
|
||||
return;
|
||||
}
|
||||
|
||||
localStorage.setItem('bosh-url', url);
|
||||
localStorage.setItem('xmpp-domain', domain);
|
||||
|
||||
settings.xmpp.url = url;
|
||||
settings.xmpp.domain = domain;
|
||||
|
||||
$('#server-flash').removeClass('success fail').text('Testing...');
|
||||
|
||||
// test only every 2 seconds
|
||||
timeout = setTimeout(function() {
|
||||
testBoshServer($('#bosh-url').val(), $('#xmpp-domain').val(), function(result) {
|
||||
$('#server-flash').removeClass('success fail').addClass(result.status).html(result.msg);
|
||||
});
|
||||
}, 2000);
|
||||
|
||||
self.data('timeout', timeout);
|
||||
});
|
||||
|
||||
// check initial bosh url
|
||||
$('#bosh-url').trigger('input');
|
||||
|
||||
// show special information for jsxc.org/example
|
||||
if (window.location.hostname === 'www.jsxc.org') {
|
||||
$('.jsxc-org').show();
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Test if bosh server is up and running.
|
||||
*
|
||||
* @param {string} url BOSH url
|
||||
* @param {string} domain host domain for BOSH server
|
||||
* @param {Function} cb called if test is done
|
||||
*/
|
||||
function testBoshServer(url, domain, cb) {
|
||||
var rid = jsxc.storage.getItem('rid') || '123456';
|
||||
|
||||
function fail(m) {
|
||||
var msg = 'BOSH server NOT reachable or misconfigured.';
|
||||
|
||||
if (typeof m === 'string') {
|
||||
msg += '<br /><br />' + m;
|
||||
}
|
||||
|
||||
cb({
|
||||
status: 'fail',
|
||||
msg: msg
|
||||
});
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: url,
|
||||
data: "<body rid='" + rid + "' xmlns='http://jabber.org/protocol/httpbind' to='" + domain + "' xml:lang='en' wait='60' hold='1' content='text/xml; charset=utf-8' ver='1.6' xmpp:version='1.0' xmlns:xmpp='urn:xmpp:xbosh'/>",
|
||||
global: false,
|
||||
dataType: 'xml'
|
||||
}).done(function(stanza) {
|
||||
if (typeof stanza === 'string') {
|
||||
// shouldn't be needed anymore, because of dataType
|
||||
stanza = $.parseXML(stanza);
|
||||
}
|
||||
|
||||
var body = $(stanza).find('body[xmlns="http://jabber.org/protocol/httpbind"]');
|
||||
var condition = (body) ? body.attr('condition') : null;
|
||||
var type = (body) ? body.attr('type') : null;
|
||||
|
||||
// we got a valid xml response, but we have test for errors
|
||||
|
||||
if (body.length > 0 && type !== 'terminate') {
|
||||
cb({
|
||||
status: 'success',
|
||||
msg: 'BOSH Server reachable.'
|
||||
});
|
||||
} else {
|
||||
if (condition === 'internal-server-error') {
|
||||
fail('Internal server error: ' + body.text());
|
||||
} else if (condition === 'host-unknown') {
|
||||
if (url) {
|
||||
fail('Host unknown: ' + domain + ' is unknown to your XMPP server.');
|
||||
} else {
|
||||
fail('Host unknown: Please provide a XMPP domain.');
|
||||
}
|
||||
} else {
|
||||
fail(condition);
|
||||
}
|
||||
}
|
||||
}).fail(function(xhr, textStatus) {
|
||||
// no valid xml, not found or csp issue
|
||||
|
||||
var fullurl;
|
||||
if (url.match(/^https?:\/\//)) {
|
||||
fullurl = url;
|
||||
} else {
|
||||
fullurl = window.location.protocol + '//' + window.location.host;
|
||||
if (url.match(/^\//)) {
|
||||
fullurl += url;
|
||||
} else {
|
||||
fullurl += window.location.pathname.replace(/[^/]+$/, "") + url;
|
||||
}
|
||||
}
|
||||
|
||||
if (xhr.status === 0) {
|
||||
// cross-side
|
||||
fail('Cross domain request was not possible. Either your BOSH server does not send any ' +
|
||||
'Access-Control-Allow-Origin header or the content-security-policy (CSP) blocks your request. ' +
|
||||
'Starting from Owncloud 9.0 your CSP will be updated in any app which uses the appframework (e.g. files) ' +
|
||||
'after you save these settings and reload.' +
|
||||
'The savest way is still to use Apache ProxyRequest or Nginx proxy_pass.');
|
||||
} else if (xhr.status === 404) {
|
||||
// not found
|
||||
fail('Your server responded with "404 Not Found". Please check if your BOSH server is running and reachable via ' + fullurl + '.');
|
||||
} else if (textStatus === 'parsererror') {
|
||||
fail('Invalid XML received. Maybe ' + fullurl + ' was redirected. You should use an absolute url.');
|
||||
} else {
|
||||
fail(xhr.status + ' ' + xhr.statusText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -10,14 +10,10 @@
|
||||
<link href="css/bootstrap.min.css" media="all" rel="stylesheet" type="text/css" />
|
||||
|
||||
<link href="../build/css/jquery-ui.min.css" media="all" rel="stylesheet" type="text/css" />
|
||||
<link href="../build/css/jquery.mCustomScrollbar.css" media="all" rel="stylesheet" type="text/css" />
|
||||
<link href="../build/css/jquery.colorbox.css" media="all" rel="stylesheet" type="text/css" />
|
||||
<link href="../build/css/jsxc.css" media="all" rel="stylesheet" type="text/css" />
|
||||
<link href="../build/css/jsxc.webrtc.css" media="all" rel="stylesheet" type="text/css" />
|
||||
|
||||
<script src="../build/lib/jquery.min.js"></script>
|
||||
<script src="../build/lib/jquery.ui.min.js"></script>
|
||||
<script src="../build/lib/jquery.colorbox-min.js"></script>
|
||||
<script src="../build/lib/jquery.slimscroll.js"></script>
|
||||
<script src="../build/lib/jquery.fullscreen.js"></script>
|
||||
|
||||
|
||||
+111
-111
@@ -7,20 +7,20 @@
|
||||
"start_private": "Iniciar privado",
|
||||
"close_private": "Cerrar privado",
|
||||
"your_buddy_is_verificated": "Tu amigo está verificado.",
|
||||
"you_have_only_a_subscription_in_one_way": "Sólo tienes una suscripción de un modo.",
|
||||
"you_have_only_a_subscription_in_one_way": "Solo tienes una suscripción de un modo.",
|
||||
"authentication_query_sent": "Consulta de verificación enviada.",
|
||||
"your_message_wasnt_send_please_end_your_private_conversation": "Su mensaje no fue enviado. Por favor, termine su conversación privada.",
|
||||
"unencrypted_message_received": "Mensaje no cifrado recibido:",
|
||||
"not_available": "No disponible",
|
||||
"no_connection": "Sin conexión!",
|
||||
"no_connection": "¡Sin conexión!",
|
||||
"relogin": "iniciar sesión nuevamente",
|
||||
"trying_to_start_private_conversation": "Intentando iniciar una conversación privada!",
|
||||
"trying_to_start_private_conversation": "¡Intentando iniciar una conversación privada!",
|
||||
"Verified": "Verificado",
|
||||
"Unverified": "No verificado",
|
||||
"private_conversation_aborted": "Conversación privada abortada!",
|
||||
"your_buddy_closed_the_private_conversation_you_should_do_the_same": "Su amigo cerró la conversación privada! Usted debería hacer lo mismo.",
|
||||
"private_conversation_aborted": "¡Conversación privada abortada!",
|
||||
"your_buddy_closed_the_private_conversation_you_should_do_the_same": "¡Su amigo cerró la conversación privada! Usted debería hacer lo mismo.",
|
||||
"conversation_is_now_verified": "La conversación es ahora verificada.",
|
||||
"authentication_failed": "Fallo la verificación.",
|
||||
"authentication_failed": "Falló la verificación.",
|
||||
"Creating_your_private_key_": "Ahora vamos a crear su clave privada. Esto puede tomar algún tiempo.",
|
||||
"Authenticating_a_buddy_helps_": "Autenticación de un amigo ayuda a garantizar que la persona que está hablando es quien él o ella está diciendo.",
|
||||
"How_do_you_want_to_authenticate_your_buddy": "¿Cómo desea autenticar {{bid_name}} (<b>{{bid_jid}}</b>)?",
|
||||
@@ -33,9 +33,9 @@
|
||||
"Buddy_fingerprint": "firma digital de tu amigo",
|
||||
"Close": "Cerrar",
|
||||
"Compared": "Comparado",
|
||||
"To_authenticate_using_a_question_": "Para autenticar mediante una pregunta, elegir una pregunta cuya respuesta se conoce sólo usted y su amigo.",
|
||||
"To_authenticate_using_a_question_": "Para autenticar mediante una pregunta, elegid una pregunta cuya respuesta se conoce solo usted y su amigo.",
|
||||
"Ask": "Preguntar",
|
||||
"To_authenticate_pick_a_secret_": "Para autenticar, elija un secreto conocido sólo por usted y su amigo.",
|
||||
"To_authenticate_pick_a_secret_": "Para autenticar, elija un secreto conocido solo por usted y su amigo.",
|
||||
"Compare": "Comparar",
|
||||
"Fingerprints": "Firmas digitales",
|
||||
"Authentication": "Autenticación",
|
||||
@@ -78,16 +78,16 @@
|
||||
"online": "en línea",
|
||||
"chat": "chat",
|
||||
"away": "ausente",
|
||||
"xa": "mas ausente",
|
||||
"xa": "más ausente",
|
||||
"offline": "desconectado",
|
||||
"none": "nadie",
|
||||
"Unknown_instance_tag": "Etiqueta de instancia desconocida.",
|
||||
"Not_one_of_our_latest_keys": "No de nuestra ultima tecla.",
|
||||
"Not_one_of_our_latest_keys": "No una de nuestras última claves.",
|
||||
"Received_an_unreadable_encrypted_message": "Se recibió un mensaje cifrado ilegible.",
|
||||
"Online": "En linea",
|
||||
"Chatty": "Hablador",
|
||||
"Away": "Ausente",
|
||||
"Extended_away": "Mas ausente",
|
||||
"Extended_away": "Más ausente",
|
||||
"Offline": "Desconectado",
|
||||
"Friendship_request": "Solicitud de amistad",
|
||||
"Confirm": "Confirmar",
|
||||
@@ -98,18 +98,18 @@
|
||||
"N": " ",
|
||||
"FAMILY": "Apellido",
|
||||
"GIVEN": "Nombre",
|
||||
"NICKNAME": "Apodar",
|
||||
"NICKNAME": "Apodo",
|
||||
"URL": "URL",
|
||||
"ADR": "Dirección",
|
||||
"STREET": "Calle",
|
||||
"EXTADD": "Extendido dirección",
|
||||
"EXTADD": "Dirección extendida",
|
||||
"LOCALITY": "Población",
|
||||
"REGION": "Región",
|
||||
"PCODE": "Código postal",
|
||||
"CTRY": "País",
|
||||
"TEL": "Teléfono",
|
||||
"NUMBER": "Número",
|
||||
"EMAIL": "Emilio",
|
||||
"EMAIL": "Correo electrónico",
|
||||
"USERID": " ",
|
||||
"ORG": "Organización",
|
||||
"ORGNAME": "Nombre",
|
||||
@@ -158,133 +158,133 @@
|
||||
"Remote_Fingerprint": "Firma digital remota",
|
||||
"Video_call_not_possible": "Llamada de vídeo no es posible",
|
||||
"Start_video_call": "Iniciar llamada de vídeo",
|
||||
"Join_chat": null,
|
||||
"Join": null,
|
||||
"Room": null,
|
||||
"Nickname": null,
|
||||
"left_the_building": null,
|
||||
"entered_the_room": null,
|
||||
"is_now_known_as": null,
|
||||
"This_room_is": null,
|
||||
"Join_chat": "Unirse al chat",
|
||||
"Join": "Unirse",
|
||||
"Room": "Sala",
|
||||
"Nickname": "Alias",
|
||||
"left_the_building": "__nickname__ dejó el edificio",
|
||||
"entered_the_room": "__nickname__ entró en la sala",
|
||||
"is_now_known_as": "__oldNickname__ ahora es conocido como __newNickname__",
|
||||
"This_room_is": "Esta sala es",
|
||||
"muc_hidden": {
|
||||
"keyword": null,
|
||||
"description": null
|
||||
"keyword": "oculta",
|
||||
"description": "no se encontró mediante la búsqueda"
|
||||
},
|
||||
"muc_membersonly": {
|
||||
"keyword": null,
|
||||
"description": null
|
||||
"keyword": "miembros solo",
|
||||
"description": "necesitas estar en la lista de miembros"
|
||||
},
|
||||
"muc_moderated": {
|
||||
"keyword": null,
|
||||
"description": null
|
||||
"keyword": "moderada",
|
||||
"description": "solo personas con \"voice\" están permitidas para mandar mensajes"
|
||||
},
|
||||
"muc_nonanonymous": {
|
||||
"keyword": null,
|
||||
"description": null
|
||||
"keyword": "no anónima",
|
||||
"description": "tu id de jabber es expuesta al resto de ocupantes"
|
||||
},
|
||||
"muc_open": {
|
||||
"keyword": null,
|
||||
"description": null
|
||||
"keyword": "abierta",
|
||||
"description": "todo el mundo puede unirse"
|
||||
},
|
||||
"muc_passwordprotected": {
|
||||
"keyword": null,
|
||||
"description": null
|
||||
"keyword": "protegida por contraseña",
|
||||
"description": "necesitas dar la contraseña correcta"
|
||||
},
|
||||
"muc_persistent": {
|
||||
"keyword": null,
|
||||
"description": null
|
||||
"keyword": "persistente",
|
||||
"description": "no será destruida si el último ocupante sale"
|
||||
},
|
||||
"muc_public": {
|
||||
"keyword": null,
|
||||
"description": null
|
||||
"keyword": "pública",
|
||||
"description": "puede ser encontrada mediante la búsqueda"
|
||||
},
|
||||
"muc_semianonymous": {
|
||||
"keyword": null,
|
||||
"description": null
|
||||
"keyword": "semi-anónima",
|
||||
"description": "tu id de jabber es expuesta a los administradores de la sala"
|
||||
},
|
||||
"muc_temporary": {
|
||||
"keyword": null,
|
||||
"description": null
|
||||
"keyword": "temporal",
|
||||
"description": "será destruida si el último ocupante sale"
|
||||
},
|
||||
"muc_unmoderated": {
|
||||
"keyword": null,
|
||||
"description": null
|
||||
"keyword": "no moderada",
|
||||
"description": "todo el mundo puede enviar mensajes"
|
||||
},
|
||||
"muc_unsecured": {
|
||||
"keyword": null,
|
||||
"description": null
|
||||
"keyword": "sin asegurar",
|
||||
"description": "no necesitas contraseña para entrar"
|
||||
},
|
||||
"Continue": null,
|
||||
"Server": null,
|
||||
"Rooms_are_loaded": null,
|
||||
"Could_load_only": null,
|
||||
"muc_explanation": null,
|
||||
"You_already_joined_this_room": null,
|
||||
"This_room_will_be_closed": null,
|
||||
"Room_not_found_": null,
|
||||
"Loading_room_information": null,
|
||||
"Destroy": null,
|
||||
"Leave": null,
|
||||
"changed_subject_to": null,
|
||||
"muc_removed_kicked": null,
|
||||
"muc_removed_info_kicked": null,
|
||||
"muc_removed_banned": null,
|
||||
"muc_removed_info_banned": null,
|
||||
"muc_removed_affiliation": null,
|
||||
"muc_removed_info_affiliation": null,
|
||||
"muc_removed_membersonly": null,
|
||||
"muc_removed_info_membersonly": null,
|
||||
"muc_removed_shutdown": null,
|
||||
"Reason": null,
|
||||
"message_not_send": null,
|
||||
"message_not_send_item-not-found": null,
|
||||
"message_not_send_forbidden": null,
|
||||
"message_not_send_not-acceptable": null,
|
||||
"This_room_has_been_closed": null,
|
||||
"Room_logging_is_enabled": null,
|
||||
"A_password_is_required": null,
|
||||
"You_are_not_on_the_member_list": null,
|
||||
"You_are_banned_from_this_room": null,
|
||||
"Your_desired_nickname_": null,
|
||||
"The_maximum_number_": null,
|
||||
"This_room_is_locked_": null,
|
||||
"You_are_not_allowed_to_create_": null,
|
||||
"Alert": null,
|
||||
"Call_started": null,
|
||||
"Call_terminated": null,
|
||||
"Carbon_copy": null,
|
||||
"Continue": "Continuar",
|
||||
"Server": "Servidor",
|
||||
"Rooms_are_loaded": "Las salas han sido cargadas",
|
||||
"Could_load_only": "Se cargaron solo __count__ salas para el autocompletado",
|
||||
"muc_explanation": "Por favor introduce el nombre de la sala, un alias opcional y una contraseña para unirse al chat",
|
||||
"You_already_joined_this_room": "Ya te has unido a esta sala",
|
||||
"This_room_will_be_closed": "Esta sale será cerrada",
|
||||
"Room_not_found_": "Sala no encontrada",
|
||||
"Loading_room_information": "Cargando información de la sala",
|
||||
"Destroy": "Destruir",
|
||||
"Leave": "Abandonar",
|
||||
"changed_subject_to": "__nickname__ cambió el asunto de la sala a \"__subject__\"",
|
||||
"muc_removed_kicked": "Has sido echado de la sala",
|
||||
"muc_removed_info_kicked": "__nickname__ ha sido echado de la sala",
|
||||
"muc_removed_banned": "Has sido expulsado de la sala",
|
||||
"muc_removed_info_banned": "__nickname__ ha sido expulsado",
|
||||
"muc_removed_affiliation": "Has sido eliminado de la sala debido a un cambio en la afiliación",
|
||||
"muc_removed_info_affiliation": "__nickname__ ha sido eliminado de la sala debido a un cambio en la afiliación",
|
||||
"muc_removed_membersonly": "Has sido eliminado de la sala debido a que la sala ha sido cambiada a miembros solo y tú no eres un miembro",
|
||||
"muc_removed_info_membersonly": "__nickname__ ha sido eliminado de la sala debido a que la sala ha sido cambiada a miembros solo y tú no eres un miembro",
|
||||
"muc_removed_shutdown": "Has sido eliminado de la sala debido a que el servicio MUC está siendo apagado",
|
||||
"Reason": "Razón",
|
||||
"message_not_send": "Tu mensaje no fue enviado debido a un error",
|
||||
"message_not_send_item-not-found": "Tu mensaje no fue enviado debido a que esta sala no existe",
|
||||
"message_not_send_forbidden": "Tu mensaje no fue enviado debido a que no tienes voz en esta sala",
|
||||
"message_not_send_not-acceptable": "Tu mensaje no fue enviado debido a que no eres un ocupante de esta sala ",
|
||||
"This_room_has_been_closed": "Esta sala ha sido cerrada",
|
||||
"Room_logging_is_enabled": "Log de sala está habilitado",
|
||||
"A_password_is_required": "Se requiere una contraseña",
|
||||
"You_are_not_on_the_member_list": "No estás en la lista de miembros",
|
||||
"You_are_banned_from_this_room": "Estás expulsado de esta sala",
|
||||
"Your_desired_nickname_": "Tu alias ya está en uso. Por favor elige otro",
|
||||
"The_maximum_number_": "El máximo número de usuarios ha sido alcanzado en esta sala",
|
||||
"This_room_is_locked_": "Esta sala está bloqueada",
|
||||
"You_are_not_allowed_to_create_": "No tienes permiso para crear una sala",
|
||||
"Alert": "Alerta",
|
||||
"Call_started": "Llamada empezada",
|
||||
"Call_terminated": "Llamada terminada",
|
||||
"Carbon_copy": "Calco",
|
||||
"Enable": "Activar",
|
||||
"jingle_reason_busy": null,
|
||||
"jingle_reason_decline": null,
|
||||
"jingle_reason_success": null,
|
||||
"Media_failure": null,
|
||||
"No_local_audio_device": null,
|
||||
"No_local_video_device": null,
|
||||
"Ok": null,
|
||||
"PermissionDeniedError": null,
|
||||
"Use_local_audio_device": null,
|
||||
"Use_local_video_device": null,
|
||||
"jingle_reason_busy": "ocupado",
|
||||
"jingle_reason_decline": "rechazar",
|
||||
"jingle_reason_success": "colgar",
|
||||
"Media_failure": "Fallo multimedia",
|
||||
"No_local_audio_device": "No hay dispositivo de audio local",
|
||||
"No_local_video_device": "No hay dispositivo de vídeo local",
|
||||
"Ok": "Ok",
|
||||
"PermissionDeniedError": "Tú o tu navegador denegaron el permiso de audio/vídeo",
|
||||
"Use_local_audio_device": "Usar dispositivo de audio local",
|
||||
"Use_local_video_device": "Usar dispositivo de vídeo",
|
||||
"is_": "es __status__",
|
||||
"You_received_a_message_from_an_unknown_sender_": "Ha recibido un mensaje de un remitente desconocido (__sender__) ¿Quiere mostrarlos?",
|
||||
"Your_roster_is_empty_add_": "Tu lista de amigos esta vacia <a>Nuevo amigo</a>",
|
||||
"Your_roster_is_empty_add_": "Tu lista de amigos esta vacía, añadir un <a>nuevo amigo</a>",
|
||||
"onsmp_explanation_question": "Tu amigo está tratando de determinar si él o ella está realmente hablando con usted. Para autenticar a su amigo, introduce la respuesta y haga clic en Contestar.",
|
||||
"onsmp_explanation_secret": "Tu amigo está tratando de determinar si él o ella está realmente hablando con usted. Para autenticar a su amigo, especifique el secreto.",
|
||||
"from_sender": "de __sender__",
|
||||
"Verified_private_conversation_started": "Verificado se inició una conversación privada.",
|
||||
"Unverified_private_conversation_started": "No verificado se inició una conversación privada.",
|
||||
"Bookmark": null,
|
||||
"Auto-join": null,
|
||||
"Edit_bookmark": null,
|
||||
"Room_logging_is_disabled": null,
|
||||
"Room_is_now_non-anoymous": null,
|
||||
"Room_is_now_semi-anonymous": null,
|
||||
"Do_you_want_to_change_the_default_room_configuration": null,
|
||||
"Default": null,
|
||||
"Change": null,
|
||||
"Send_file": null,
|
||||
"setting-explanation-carbon": null,
|
||||
"setting-explanation-login": null,
|
||||
"setting-explanation-priority": null,
|
||||
"setting-explanation-xmpp": null
|
||||
"Bookmark": "Favorito",
|
||||
"Auto-join": "Auto-unir",
|
||||
"Edit_bookmark": "Editar favorito",
|
||||
"Room_logging_is_disabled": "Log de sala está deshabilitado",
|
||||
"Room_is_now_non-anoymous": "La sala es ahora no anónima",
|
||||
"Room_is_now_semi-anonymous": "La sale es ahora semi-anónima",
|
||||
"Do_you_want_to_change_the_default_room_configuration": "¿Quieres cambiar la configuración por defecto de la sala?",
|
||||
"Default": "Por defecto",
|
||||
"Change": "Cambiar",
|
||||
"Send_file": "Enviar archivo",
|
||||
"setting-explanation-carbon": "Con el Calco habilitado tu servidor XMPP enviará una copia de cada mensaje entrante dirigido a ti a este cliente incluso si no estaba siendo enviado a él",
|
||||
"setting-explanation-login": "Si esta opción está habilitada, el chat empezará al inicio de sesión",
|
||||
"setting-explanation-priority": "Si tú has iniciado sesión varias veces con la misma cuenta, tu servidor XMPP enviará los mensajes al cliente con la mayor prioridad",
|
||||
"setting-explanation-xmpp": "Estas opciones son usadas para conectar con el servidor XMPP"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+129
-129
@@ -1,85 +1,85 @@
|
||||
{
|
||||
"translation": {
|
||||
"Logging_in": null,
|
||||
"your_connection_is_unencrypted": null,
|
||||
"your_connection_is_encrypted": null,
|
||||
"your_buddy_closed_the_private_connection": null,
|
||||
"start_private": null,
|
||||
"close_private": null,
|
||||
"your_buddy_is_verificated": null,
|
||||
"your_connection_is_unencrypted": "Az Ön kapcsolata titkosítatlan.",
|
||||
"your_connection_is_encrypted": "Az Ön kapcsolata titkosított.",
|
||||
"your_buddy_closed_the_private_connection": "Partnere megszakította a privát kapcsolatot.",
|
||||
"start_private": "Privát beszélgetés indítása",
|
||||
"close_private": "Privát beszélgetés bezárása",
|
||||
"your_buddy_is_verificated": "Az Ön partnere megerősítve.",
|
||||
"you_have_only_a_subscription_in_one_way": null,
|
||||
"authentication_query_sent": null,
|
||||
"your_message_wasnt_send_please_end_your_private_conversation": null,
|
||||
"unencrypted_message_received": null,
|
||||
"not_available": null,
|
||||
"no_connection": null,
|
||||
"relogin": null,
|
||||
"trying_to_start_private_conversation": null,
|
||||
"Verified": null,
|
||||
"Unverified": null,
|
||||
"private_conversation_aborted": null,
|
||||
"authentication_query_sent": "Azonosítási kérelem elküldve.",
|
||||
"your_message_wasnt_send_please_end_your_private_conversation": "Az üzenetet nem sikerült elküldeni. Kérem fejezze be a privát beszélgetést.",
|
||||
"unencrypted_message_received": "Titkosítatlan üzenet fogadva",
|
||||
"not_available": "Nem elérhető",
|
||||
"no_connection": "Nincs kapcsolat!",
|
||||
"relogin": "relogin",
|
||||
"trying_to_start_private_conversation": "Privát beszélgetés indítása!",
|
||||
"Verified": "Megerősítve",
|
||||
"Unverified": "Nem megerősített",
|
||||
"private_conversation_aborted": "Privát beszélgetés megszakítva!",
|
||||
"your_buddy_closed_the_private_conversation_you_should_do_the_same": null,
|
||||
"conversation_is_now_verified": null,
|
||||
"authentication_failed": null,
|
||||
"Creating_your_private_key_": null,
|
||||
"authentication_failed": "Azonosítás sikertelen.",
|
||||
"Creating_your_private_key_": "Privát kulcs generálása. Egy kis időbe telhet...",
|
||||
"Authenticating_a_buddy_helps_": null,
|
||||
"How_do_you_want_to_authenticate_your_buddy": null,
|
||||
"Select_method": null,
|
||||
"Manual": null,
|
||||
"Question": null,
|
||||
"Secret": null,
|
||||
"Question": "Kérdés",
|
||||
"Secret": "Kulcs",
|
||||
"To_verify_the_fingerprint_": null,
|
||||
"Your_fingerprint": null,
|
||||
"Buddy_fingerprint": null,
|
||||
"Close": null,
|
||||
"Compared": null,
|
||||
"To_authenticate_using_a_question_": null,
|
||||
"Ask": null,
|
||||
"To_authenticate_pick_a_secret_": null,
|
||||
"Compare": null,
|
||||
"Fingerprints": null,
|
||||
"Authentication": null,
|
||||
"Message": null,
|
||||
"Add_buddy": null,
|
||||
"rename_buddy": null,
|
||||
"delete_buddy": null,
|
||||
"Login": null,
|
||||
"Username": null,
|
||||
"Password": null,
|
||||
"Cancel": null,
|
||||
"Connect": null,
|
||||
"Type_in_the_full_username_": null,
|
||||
"Alias": null,
|
||||
"Add": null,
|
||||
"Subscription_request": null,
|
||||
"You_have_a_request_from": null,
|
||||
"Deny": null,
|
||||
"Approve": null,
|
||||
"Remove_buddy": null,
|
||||
"Your_fingerprint": "Az Ön lenyomata",
|
||||
"Buddy_fingerprint": "Partnere lenyomata",
|
||||
"Close": "Bezárás",
|
||||
"Compared": "Összehasonlítva",
|
||||
"To_authenticate_using_a_question_": "Az azonosításhoz adjon meg egy kérdést, amelyre a választ csak Ön és Partnere ismerhetik.",
|
||||
"Ask": "Kérdez",
|
||||
"To_authenticate_pick_a_secret_": "Az azonosításhoz adjon meg egy titkot, amelyet csak Ön és Partnere ismerhetnek.",
|
||||
"Compare": "Összehasonlítás",
|
||||
"Fingerprints": "Lenyomatok",
|
||||
"Authentication": "Azonosítás",
|
||||
"Message": "Üzenet",
|
||||
"Add_buddy": "Partner hozzáadása",
|
||||
"rename_buddy": "Partner átnevezése",
|
||||
"delete_buddy": "Partner törlése",
|
||||
"Login": "Belépés",
|
||||
"Username": "Felhasználónév",
|
||||
"Password": "Jelszó",
|
||||
"Cancel": "Mégsem",
|
||||
"Connect": "Csatlakozás",
|
||||
"Type_in_the_full_username_": "Adjon meg egy teljes felhasználónevet, és egy opcionális becenevet.",
|
||||
"Alias": "Becenév",
|
||||
"Add": "Hozzáadás",
|
||||
"Subscription_request": "Feliratkozási kérelem",
|
||||
"You_have_a_request_from": "Ön felkérést kapott a következőtől",
|
||||
"Deny": "Elutasít",
|
||||
"Approve": "Jóváhagy",
|
||||
"Remove_buddy": "Partner eltávolítása",
|
||||
"You_are_about_to_remove_": null,
|
||||
"Continue_without_chat": null,
|
||||
"Please_wait": null,
|
||||
"Login_failed": null,
|
||||
"Continue_without_chat": "Folytatás chat nélkül",
|
||||
"Please_wait": "Kérem várjon",
|
||||
"Login_failed": "Chat bejelentkezés sikertelen",
|
||||
"Sorry_we_cant_authentikate_": null,
|
||||
"Retry": null,
|
||||
"clear_history": null,
|
||||
"New_message_from": null,
|
||||
"Should_we_notify_you_": null,
|
||||
"Please_accept_": null,
|
||||
"Hide_offline": null,
|
||||
"Show_offline": null,
|
||||
"Retry": "Vissza",
|
||||
"clear_history": "Előzmények törlése",
|
||||
"New_message_from": "Új üzenet __name__ partnerétől",
|
||||
"Should_we_notify_you_": "Kívánja hogy értesítsük a jövőben új üzeneteiről?",
|
||||
"Please_accept_": "Kérem kattintson a fent megjelenő \"Engedélyez\" gombra.",
|
||||
"Hide_offline": "Offline partnerek elrejtése",
|
||||
"Show_offline": "Offline partnerek mutatása",
|
||||
"About": null,
|
||||
"dnd": null,
|
||||
"Mute": null,
|
||||
"Unmute": null,
|
||||
"dnd": "Ne zavarj",
|
||||
"Mute": "Némítás",
|
||||
"Unmute": "Hangok engedélyezése",
|
||||
"Subscription": null,
|
||||
"both": null,
|
||||
"Status": null,
|
||||
"online": null,
|
||||
"both": "mindkettő",
|
||||
"Status": "Állapot",
|
||||
"online": "elérhető",
|
||||
"chat": null,
|
||||
"away": null,
|
||||
"xa": null,
|
||||
"offline": null,
|
||||
"away": "távol",
|
||||
"xa": "huzamosabban távol",
|
||||
"offline": "offline",
|
||||
"none": null,
|
||||
"Unknown_instance_tag": null,
|
||||
"Not_one_of_our_latest_keys": null,
|
||||
@@ -94,75 +94,75 @@
|
||||
"Dismiss": null,
|
||||
"Remove": null,
|
||||
"Online_help": null,
|
||||
"FN": null,
|
||||
"FN": "Teljes név",
|
||||
"N": null,
|
||||
"FAMILY": null,
|
||||
"GIVEN": null,
|
||||
"NICKNAME": null,
|
||||
"URL": null,
|
||||
"ADR": null,
|
||||
"STREET": null,
|
||||
"EXTADD": null,
|
||||
"LOCALITY": null,
|
||||
"REGION": null,
|
||||
"PCODE": null,
|
||||
"CTRY": null,
|
||||
"TEL": null,
|
||||
"NUMBER": null,
|
||||
"EMAIL": null,
|
||||
"FAMILY": "Családi név",
|
||||
"GIVEN": "Keresztnév",
|
||||
"NICKNAME": "Becenév",
|
||||
"URL": "URL",
|
||||
"ADR": "Cím",
|
||||
"STREET": "Utcanév",
|
||||
"EXTADD": "Cím",
|
||||
"LOCALITY": "Helység",
|
||||
"REGION": "Régió",
|
||||
"PCODE": "Irányítószám",
|
||||
"CTRY": "Ország",
|
||||
"TEL": "Telefonszám",
|
||||
"NUMBER": "Házszám",
|
||||
"EMAIL": "E-mail cím",
|
||||
"USERID": null,
|
||||
"ORG": null,
|
||||
"ORGNAME": null,
|
||||
"ORGUNIT": null,
|
||||
"TITLE": null,
|
||||
"ROLE": null,
|
||||
"BDAY": null,
|
||||
"DESC": null,
|
||||
"ORG": "Vállalat",
|
||||
"ORGNAME": "Név",
|
||||
"ORGUNIT": "Osztály",
|
||||
"TITLE": "Beosztás",
|
||||
"ROLE": "Részleg",
|
||||
"BDAY": "Születésnap",
|
||||
"DESC": "Leírás",
|
||||
"PHOTO": null,
|
||||
"send_message": null,
|
||||
"get_info": null,
|
||||
"Settings": null,
|
||||
"Priority": null,
|
||||
"Save": null,
|
||||
"User_settings": null,
|
||||
"send_message": "Üzenet küldése",
|
||||
"get_info": "Info mutatása",
|
||||
"Settings": "Beállítások",
|
||||
"Priority": "Prioritás",
|
||||
"Save": "Mentés",
|
||||
"User_settings": "Felhasználó beállítások",
|
||||
"A_fingerprint_": null,
|
||||
"is": null,
|
||||
"Login_options": null,
|
||||
"BOSH_url": null,
|
||||
"Domain": null,
|
||||
"Resource": null,
|
||||
"On_login": null,
|
||||
"Received_an_unencrypted_message": null,
|
||||
"Sorry_your_buddy_doesnt_provide_any_information": null,
|
||||
"Login_options": "Bejelentkezési lehetőségek",
|
||||
"BOSH_url": "BOSH URL",
|
||||
"Domain": "Domain",
|
||||
"Resource": "Erőforrás",
|
||||
"On_login": "Bejelentkezéskor",
|
||||
"Received_an_unencrypted_message": "Titkosítatlan üzenetet fogadott",
|
||||
"Sorry_your_buddy_doesnt_provide_any_information": "Sajnos az Ön partnere nem adott meg semmilyen információt.",
|
||||
"Info_about": null,
|
||||
"Authentication_aborted": null,
|
||||
"Authentication_request_received": null,
|
||||
"Log_in_without_chat": null,
|
||||
"has_come_online": null,
|
||||
"Unknown_sender": null,
|
||||
"Please_allow_access_to_microphone_and_camera": null,
|
||||
"Incoming_call": null,
|
||||
"from": null,
|
||||
"Do_you_want_to_accept_the_call_from": null,
|
||||
"Reject": null,
|
||||
"Accept": null,
|
||||
"hang_up": null,
|
||||
"snapshot": null,
|
||||
"mute_my_audio": null,
|
||||
"pause_my_video": null,
|
||||
"fullscreen": null,
|
||||
"Info": null,
|
||||
"Local_IP": null,
|
||||
"Remote_IP": null,
|
||||
"Local_Fingerprint": null,
|
||||
"Remote_Fingerprint": null,
|
||||
"Video_call_not_possible": null,
|
||||
"Start_video_call": null,
|
||||
"Join_chat": null,
|
||||
"Join": null,
|
||||
"Room": null,
|
||||
"Nickname": null,
|
||||
"left_the_building": null,
|
||||
"Authentication_aborted": "Azonosítás megszakítva.",
|
||||
"Authentication_request_received": "Azonosítási kérelem fogadva.",
|
||||
"Log_in_without_chat": "Bejelentkezés chat nélkül",
|
||||
"has_come_online": "bejelentkezett",
|
||||
"Unknown_sender": "Ismeretlen küldő",
|
||||
"Please_allow_access_to_microphone_and_camera": "Kérem kattintson a fent megjelenő \"Engedélyez/Allow\" gombra hogy hozzáférést biztosítson mikrofonjához és kamerájához.",
|
||||
"Incoming_call": "Bejövő hívás",
|
||||
"from": "tőle",
|
||||
"Do_you_want_to_accept_the_call_from": "Szeretné fogadni következő partnere hívását:",
|
||||
"Reject": "Elutasít",
|
||||
"Accept": "Fogadás",
|
||||
"hang_up": "tartás",
|
||||
"snapshot": "képernyőfotó",
|
||||
"mute_my_audio": "hangom némítása",
|
||||
"pause_my_video": "videóképem megállítása",
|
||||
"fullscreen": "teljes képernyő",
|
||||
"Info": "Info",
|
||||
"Local_IP": "Helyi IP",
|
||||
"Remote_IP": "Távoli IP",
|
||||
"Local_Fingerprint": "Helyi lenyomat",
|
||||
"Remote_Fingerprint": "Távoli lenyomat",
|
||||
"Video_call_not_possible": "Videóhívás nem lehetséges. Az Ön partnerének készüléke nem támogatja a videóhívásokat.",
|
||||
"Start_video_call": "Videóhívás indítása",
|
||||
"Join_chat": "Belépés a chatbe",
|
||||
"Join": "Belépés",
|
||||
"Room": "Szoba",
|
||||
"Nickname": "Becenév",
|
||||
"left_the_building": "__nickname__ elhagyta az épületet.",
|
||||
"entered_the_room": null,
|
||||
"is_now_known_as": null,
|
||||
"This_room_is": null,
|
||||
|
||||
+36
-36
@@ -7,10 +7,10 @@
|
||||
"start_private": "Rozpocznij rozmowę.",
|
||||
"close_private": "Zakończ rozmowę.",
|
||||
"your_buddy_is_verificated": "Twój rozmówca został zweryfikowany.",
|
||||
"you_have_only_a_subscription_in_one_way": "Masz jednostronną subskrypcję.",
|
||||
"you_have_only_a_subscription_in_one_way": "Posiadasz tylko jednostronną subskrypcję.",
|
||||
"authentication_query_sent": "Wysłano proźbę o autentykację.",
|
||||
"your_message_wasnt_send_please_end_your_private_conversation": "Twoja wiadomość nie została wysłana. Proszę, zamknij rozmowę.",
|
||||
"unencrypted_message_received": "Zwrotna niezaszyfrowana wiadomość.",
|
||||
"unencrypted_message_received": "Otrzymano niezaszyfrowaną wiadomość.",
|
||||
"not_available": "Niedostępny.",
|
||||
"no_connection": "Brak połączenia!",
|
||||
"relogin": "Połącz ponownie",
|
||||
@@ -18,7 +18,7 @@
|
||||
"Verified": "Zweryfikowano",
|
||||
"Unverified": "Niezweryfikowano",
|
||||
"private_conversation_aborted": "Anulowano rozmowę!",
|
||||
"your_buddy_closed_the_private_conversation_you_should_do_the_same": "Rozmówca przerwał połączenie!",
|
||||
"your_buddy_closed_the_private_conversation_you_should_do_the_same": "Rozmówca przerwał połączenie! Powinieneś zrobić to samo.",
|
||||
"conversation_is_now_verified": "Zweryfikowano połączenie.",
|
||||
"authentication_failed": "Weryfikacja się nie powiodła.",
|
||||
"Creating_your_private_key_": "Tworzenie klucza prywatnego; może to chwilę potrwać",
|
||||
@@ -28,20 +28,20 @@
|
||||
"Manual": "Ręcznie",
|
||||
"Question": "Pytanie",
|
||||
"Secret": "Hasło",
|
||||
"To_verify_the_fingerprint_": "Aby zweryfikować kod najpierw skontaktuj się z rozmówcą np. za pomocą telefonu.",
|
||||
"To_verify_the_fingerprint_": "Aby zweryfikować kod, najpierw skontaktuj się z rozmówcą za pomocą zaufanego sposobu, np telefonu.",
|
||||
"Your_fingerprint": "Twój kod:",
|
||||
"Buddy_fingerprint": "Kod rozmówcy",
|
||||
"Buddy_fingerprint": "Kod kontaktu",
|
||||
"Close": "Zamknij",
|
||||
"Compared": "Porównano",
|
||||
"To_authenticate_using_a_question_": "Aby autoryzować za pomocą pytania, wybierz pytanie na które tylko Twój rozmówca zna odpowiedź.",
|
||||
"To_authenticate_using_a_question_": "Aby autoryzować za pomocą pytania, wybierz pytanie na które tylko ty i twój rozmówca zna odpowiedź.",
|
||||
"Ask": "Zadaj pytanie",
|
||||
"To_authenticate_pick_a_secret_": "Aby autoryzować za pomocą hasła, wybierz hasło na które zna tylko Twój rozmówca.",
|
||||
"To_authenticate_pick_a_secret_": "Aby autoryzować za pomocą hasła, wybierz hasło na które znasz tylko Ty i twój rozmówca.",
|
||||
"Compare": "Dopasuj",
|
||||
"Fingerprints": "Kody autoryzacyjne",
|
||||
"Authentication": "Autoryzacja",
|
||||
"Message": "Wiadomość",
|
||||
"Add_buddy": "Dodaj kontakt",
|
||||
"rename_buddy": "Zmień nazwę",
|
||||
"rename_buddy": "Zmień nazwę kontaktu",
|
||||
"delete_buddy": "Usuń kontakt",
|
||||
"Login": "Login",
|
||||
"Username": "Nazwa Użytkownika",
|
||||
@@ -55,8 +55,8 @@
|
||||
"You_have_a_request_from": "Masz potwierdzenie od",
|
||||
"Deny": "Odmów",
|
||||
"Approve": "Zatwierdź",
|
||||
"Remove_buddy": "Usuń rozmówcę",
|
||||
"You_are_about_to_remove_": "Twój rozmówca {{bid_name}} (<b>{{bid_jid}}</b>) usunął Cię ze swojej listy kontaktów.",
|
||||
"Remove_buddy": "Usuń kontakt",
|
||||
"You_are_about_to_remove_": "Chcesz usunąć {{bid_name}} (<b>{{bid_jid}}</b>) z twojej listy kontaktów. Wszystkie powiązane rozmowy zostaną zamknięte.",
|
||||
"Continue_without_chat": "Kontynuuj bez komunikatora",
|
||||
"Please_wait": "Proszę czekać",
|
||||
"Login_failed": "Błędne logowanie",
|
||||
@@ -89,7 +89,7 @@
|
||||
"Away": "Daleko",
|
||||
"Extended_away": "Hen Hen...",
|
||||
"Offline": "Niedostępny",
|
||||
"Friendship_request": "Zapytanie od znajomego?",
|
||||
"Friendship_request": "Prośba o kontakt",
|
||||
"Confirm": "Potwierdzenie",
|
||||
"Dismiss": "Odwołaj",
|
||||
"Remove": "Usuń",
|
||||
@@ -133,7 +133,7 @@
|
||||
"Resource": "Źródło",
|
||||
"On_login": "Na login",
|
||||
"Received_an_unencrypted_message": "Zatwierdzono nieszyfrowaną wiadomość.",
|
||||
"Sorry_your_buddy_doesnt_provide_any_information": "Twój rozmówca nie posiada żadnych informacji.",
|
||||
"Sorry_your_buddy_doesnt_provide_any_information": "Wybacz, twój rozmówca nie posiada żadnych informacji.",
|
||||
"Info_about": "Informacja o...",
|
||||
"Authentication_aborted": "Autoryzacja anulowana.",
|
||||
"Authentication_request_received": "Prośba o autoryzację została przyjęta.",
|
||||
@@ -250,20 +250,20 @@
|
||||
"This_room_is_locked_": "Ten pokój jest zablokowany",
|
||||
"You_are_not_allowed_to_create_": "Nie masz uprawnień do tworzenia pokoju",
|
||||
"Alert": "Alarm",
|
||||
"Call_started": null,
|
||||
"Call_terminated": null,
|
||||
"Call_started": "Rozmowa rozpoczęta",
|
||||
"Call_terminated": "Rozmowa zakończona",
|
||||
"Carbon_copy": "Do wiadomości",
|
||||
"Enable": "Włączone",
|
||||
"jingle_reason_busy": null,
|
||||
"jingle_reason_decline": null,
|
||||
"jingle_reason_success": null,
|
||||
"Media_failure": null,
|
||||
"No_local_audio_device": null,
|
||||
"No_local_video_device": null,
|
||||
"jingle_reason_busy": "zajęte",
|
||||
"jingle_reason_decline": "odmów",
|
||||
"jingle_reason_success": "zakończono",
|
||||
"Media_failure": "Błąd mediów",
|
||||
"No_local_audio_device": "Brak lokalnego urządzenia audio.",
|
||||
"No_local_video_device": "Brak lokalnego urządzenia wideo.",
|
||||
"Ok": "Ok",
|
||||
"PermissionDeniedError": null,
|
||||
"Use_local_audio_device": null,
|
||||
"Use_local_video_device": null,
|
||||
"PermissionDeniedError": "Ty lub twoja przeglądarka odmówiła dostępu do audio/video",
|
||||
"Use_local_audio_device": "Użyj lokalnego urządzenia audio.",
|
||||
"Use_local_video_device": "Użyj lokalnego urządzenia wideo.",
|
||||
"is_": "jest __status__",
|
||||
"You_received_a_message_from_an_unknown_sender_": "Masz wiadomość od nieznanego nadawcy. (__sender__) Chcesz to wyświetlić?",
|
||||
"Your_roster_is_empty_add_": "Twoja lista jest pusta, dodaj kontakty <a>Nowy kontakt</a>",
|
||||
@@ -272,19 +272,19 @@
|
||||
"from_sender": "z __sender__",
|
||||
"Verified_private_conversation_started": "Zweryfikowano Rozmowa prywatna rozpoczęta.",
|
||||
"Unverified_private_conversation_started": "Niezweryfikowano Rozmowa prywatna rozpoczęta.",
|
||||
"Bookmark": null,
|
||||
"Auto-join": null,
|
||||
"Edit_bookmark": null,
|
||||
"Room_logging_is_disabled": null,
|
||||
"Room_is_now_non-anoymous": null,
|
||||
"Room_is_now_semi-anonymous": null,
|
||||
"Do_you_want_to_change_the_default_room_configuration": null,
|
||||
"Default": null,
|
||||
"Change": null,
|
||||
"Send_file": null,
|
||||
"Bookmark": "Zakładka",
|
||||
"Auto-join": "Auto-połączenie",
|
||||
"Edit_bookmark": "Edytuj zakładkę",
|
||||
"Room_logging_is_disabled": "Logowanie pokoju jest wyłączone",
|
||||
"Room_is_now_non-anoymous": "Pokój jest teraz nie-anonimowy",
|
||||
"Room_is_now_semi-anonymous": "Pokój jest teraz pół-anonimowy",
|
||||
"Do_you_want_to_change_the_default_room_configuration": "Chcesz zmienić domyślną konfigurację pokoju?",
|
||||
"Default": "Domyślny",
|
||||
"Change": "Zmień",
|
||||
"Send_file": "Wyślij plik",
|
||||
"setting-explanation-carbon": null,
|
||||
"setting-explanation-login": null,
|
||||
"setting-explanation-priority": null,
|
||||
"setting-explanation-xmpp": null
|
||||
"setting-explanation-login": "Jeżeli ta opcja jest włączona, czat uruchomi się przy zalogowaniu.",
|
||||
"setting-explanation-priority": "Jeżeli jesteś zalogowany wiele razy na to samo konto twój serwer XMPP dostarczy wiadomości do klienta z najwyższym priorytetem.",
|
||||
"setting-explanation-xmpp": "Te ustawienia używane są do połączenia z serwerem XMPP."
|
||||
}
|
||||
}
|
||||
+56
-56
@@ -29,15 +29,15 @@
|
||||
"Question": "Pergunta",
|
||||
"Secret": "Senha",
|
||||
"To_verify_the_fingerprint_": "Para verificar o fingerprint, entre em contato com seu contato usando outro meio, de preferência seguro, como o telefone.",
|
||||
"Your_fingerprint": "Seu fingerprint",
|
||||
"Buddy_fingerprint": "Fingerprint do contato",
|
||||
"Your_fingerprint": "Sua impressão digital",
|
||||
"Buddy_fingerprint": "Impressão digital do contato",
|
||||
"Close": "Fechar",
|
||||
"Compared": "Comparado",
|
||||
"To_authenticate_using_a_question_": "Para autenticar seu contato faça uma pergunta, mas escolha que só ele saiba a resposta.",
|
||||
"Ask": "Pergunta",
|
||||
"To_authenticate_pick_a_secret_": "Para autenticar, escolha um segredo que somente você e seu contato saibam.",
|
||||
"Compare": "Compare",
|
||||
"Fingerprints": "Fingerprints",
|
||||
"Fingerprints": "Impressões digitais",
|
||||
"Authentication": "Autenticação",
|
||||
"Message": "Mensagem",
|
||||
"Add_buddy": "Adicionar contato",
|
||||
@@ -110,15 +110,15 @@
|
||||
"TEL": "Telefone",
|
||||
"NUMBER": "Número",
|
||||
"EMAIL": "Email",
|
||||
"USERID": " ",
|
||||
"USERID": " IDUsuário",
|
||||
"ORG": "Empresa",
|
||||
"ORGNAME": "Nome",
|
||||
"ORGUNIT": "Unidade",
|
||||
"TITLE": "Cargo",
|
||||
"ROLE": "Rol",
|
||||
"ROLE": "Função",
|
||||
"BDAY": "Data de nascimento",
|
||||
"DESC": "Descrição",
|
||||
"PHOTO": " ",
|
||||
"PHOTO": "Foto",
|
||||
"send_message": "Enviar mensagem",
|
||||
"get_info": "Exibir informações",
|
||||
"Settings": "Configurações",
|
||||
@@ -158,8 +158,8 @@
|
||||
"Remote_Fingerprint": "Fingerprint remoto",
|
||||
"Video_call_not_possible": "Chamada de vídeo impossível. Seu contato não suporta chamadas desse tipo.",
|
||||
"Start_video_call": "Iniciar chamada de vídeo",
|
||||
"Join_chat": null,
|
||||
"Join": null,
|
||||
"Join_chat": "Entrar no chat",
|
||||
"Join": "Entrar",
|
||||
"Room": "Sala",
|
||||
"Nickname": "Apelido",
|
||||
"left_the_building": "__nickname__ deixou o prédio",
|
||||
@@ -179,27 +179,27 @@
|
||||
"description": "Somente pessoas com \"voice\" podem enviar mensagens"
|
||||
},
|
||||
"muc_nonanonymous": {
|
||||
"keyword": null,
|
||||
"description": null
|
||||
"keyword": "não-anônimo",
|
||||
"description": "Seu id jabber esta esposto para todos os outros ocupantes"
|
||||
},
|
||||
"muc_open": {
|
||||
"keyword": "abrir",
|
||||
"description": "Todos podem entrar"
|
||||
},
|
||||
"muc_passwordprotected": {
|
||||
"keyword": null,
|
||||
"keyword": "protegido por senha",
|
||||
"description": "você precisa fornecer a senha correta"
|
||||
},
|
||||
"muc_persistent": {
|
||||
"keyword": null,
|
||||
"keyword": "persistente",
|
||||
"description": "Não será destruída se o último ocupante tiver saído"
|
||||
},
|
||||
"muc_public": {
|
||||
"keyword": "público",
|
||||
"description": null
|
||||
"description": "pode ser localizado pela busca"
|
||||
},
|
||||
"muc_semianonymous": {
|
||||
"keyword": null,
|
||||
"keyword": "semi-anônimos",
|
||||
"description": "Sua identificação jabber só é exposta para administradores da sala"
|
||||
},
|
||||
"muc_temporary": {
|
||||
@@ -211,59 +211,59 @@
|
||||
"description": "Todos tem permissão de enviar mensagens"
|
||||
},
|
||||
"muc_unsecured": {
|
||||
"keyword": null,
|
||||
"keyword": "inseguro",
|
||||
"description": "Você não precisa de senha para entrar"
|
||||
},
|
||||
"Continue": "Avançar",
|
||||
"Server": null,
|
||||
"Server": "Servidor",
|
||||
"Rooms_are_loaded": "Sala carregada",
|
||||
"Could_load_only": null,
|
||||
"muc_explanation": null,
|
||||
"Could_load_only": "Pode carregar somente __count__ salas para autocompletar",
|
||||
"muc_explanation": "Por favor entre um nome de sala e um nickname opcional e uma senha para entrar no chat",
|
||||
"You_already_joined_this_room": "Você já entrou nesta sala",
|
||||
"This_room_will_be_closed": "Esta sala será fechada",
|
||||
"Room_not_found_": null,
|
||||
"Room_not_found_": "Uma nova sala será criada",
|
||||
"Loading_room_information": "Carregar informação da sala",
|
||||
"Destroy": null,
|
||||
"Leave": null,
|
||||
"changed_subject_to": null,
|
||||
"muc_removed_kicked": null,
|
||||
"muc_removed_info_kicked": null,
|
||||
"muc_removed_banned": null,
|
||||
"Destroy": "Destruir",
|
||||
"Leave": "Sair",
|
||||
"changed_subject_to": "__nickname__ alterar o assunto da sala para \"__subject__\"",
|
||||
"muc_removed_kicked": "Você foi removido da sala",
|
||||
"muc_removed_info_kicked": "__nickname__ foi removido da sala",
|
||||
"muc_removed_banned": "Você foi banido da sala",
|
||||
"muc_removed_info_banned": "__nickname__ foi banido da sala",
|
||||
"muc_removed_affiliation": null,
|
||||
"muc_removed_info_affiliation": null,
|
||||
"muc_removed_affiliation": "Você foi removido da sala pois a sala, por que a afiliação mudou",
|
||||
"muc_removed_info_affiliation": "__nickname__ foi removido da sala, por que a afiliação mudou",
|
||||
"muc_removed_membersonly": "Você foi removido da sala pois a sala foi alterada somente para membros e você não é um membro",
|
||||
"muc_removed_info_membersonly": null,
|
||||
"muc_removed_shutdown": null,
|
||||
"muc_removed_info_membersonly": "__nickname__ foi removido da sala porque a sala foi alterada para somente membros e você não é um membro",
|
||||
"muc_removed_shutdown": "Você foi removido da sala, por que o serviço MUC esta sendo desligado",
|
||||
"Reason": "Motivo",
|
||||
"message_not_send": null,
|
||||
"message_not_send_item-not-found": null,
|
||||
"message_not_send_forbidden": null,
|
||||
"message_not_send_not-acceptable": null,
|
||||
"This_room_has_been_closed": null,
|
||||
"Room_logging_is_enabled": null,
|
||||
"A_password_is_required": null,
|
||||
"You_are_not_on_the_member_list": null,
|
||||
"You_are_banned_from_this_room": null,
|
||||
"Your_desired_nickname_": null,
|
||||
"The_maximum_number_": null,
|
||||
"This_room_is_locked_": null,
|
||||
"You_are_not_allowed_to_create_": null,
|
||||
"message_not_send": "Sua mensagem não foi enviada devido a um erro",
|
||||
"message_not_send_item-not-found": "Sua mensagem não foi enviada por que essa sala nao existe mais",
|
||||
"message_not_send_forbidden": "Sua mensagem não foi enviada por que não tem 'voz' para essa sala",
|
||||
"message_not_send_not-acceptable": "Sua mensagem não foi enviada por que você nao é ocupante desta sala",
|
||||
"This_room_has_been_closed": "Essa sala foi fechada",
|
||||
"Room_logging_is_enabled": "O Logging esta habilitado",
|
||||
"A_password_is_required": "Senha é obrigatória",
|
||||
"You_are_not_on_the_member_list": "Você não esta na lista de usuarios",
|
||||
"You_are_banned_from_this_room": "Você foi banido desta sala",
|
||||
"Your_desired_nickname_": "O nickname escolhido já esta em uso. Por favor escolha outro",
|
||||
"The_maximum_number_": "O número máximo de usuarios já foi antigido para essa sala",
|
||||
"This_room_is_locked_": "A sala esta trancada",
|
||||
"You_are_not_allowed_to_create_": "Você não esta autorizado para criar uma sala",
|
||||
"Alert": "Alerta",
|
||||
"Call_started": null,
|
||||
"Call_terminated": null,
|
||||
"Carbon_copy": null,
|
||||
"Enable": null,
|
||||
"Call_started": "Chamada iniciada",
|
||||
"Call_terminated": "Chamada finalizada",
|
||||
"Carbon_copy": "Copia carbono",
|
||||
"Enable": "Habilitado",
|
||||
"jingle_reason_busy": "ocupado",
|
||||
"jingle_reason_decline": null,
|
||||
"jingle_reason_success": null,
|
||||
"Media_failure": null,
|
||||
"No_local_audio_device": null,
|
||||
"No_local_video_device": null,
|
||||
"jingle_reason_decline": "recusado",
|
||||
"jingle_reason_success": "sucesso",
|
||||
"Media_failure": "Media falhou",
|
||||
"No_local_audio_device": "sem dispositivo local de audio",
|
||||
"No_local_video_device": "sem dispositivo local de video",
|
||||
"Ok": "Ok",
|
||||
"PermissionDeniedError": "Você ou seu navegador negou permissão para acessar audio/video",
|
||||
"Use_local_audio_device": null,
|
||||
"Use_local_video_device": null,
|
||||
"Use_local_audio_device": "Usar dispositivo local de audio",
|
||||
"Use_local_video_device": "Usar dispositivo local de video",
|
||||
"is_": "é __status__",
|
||||
"You_received_a_message_from_an_unknown_sender_": "Você recebeu uma mensagem de um emissor desconhecido (__sender__) Você quer mostrá-los?",
|
||||
"Your_roster_is_empty_add_": "Sua lista está vazia, adicione um <a>novo contato</a>",
|
||||
@@ -282,9 +282,9 @@
|
||||
"Default": "Padrão",
|
||||
"Change": "Alterar",
|
||||
"Send_file": "Enviar arquivo",
|
||||
"setting-explanation-carbon": null,
|
||||
"setting-explanation-login": null,
|
||||
"setting-explanation-priority": null,
|
||||
"setting-explanation-carbon": "Com carbon copy ativado seu servidor XMPP vai enviar uma copia de cada mensagem para você neste cliente mesmo que não tenha endereço",
|
||||
"setting-explanation-login": "Se essa opção esta habilitada, o chat vai começar ao logar.",
|
||||
"setting-explanation-priority": "Você esta logado varias vezes com a mesma conta, seu servidor XMPP vai entregar as mensagens para o cliente com a prioridade mais alta.",
|
||||
"setting-explanation-xmpp": "Essas opções são usadas para conectar no Servidor XMPP"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,290 @@
|
||||
{
|
||||
"translation": {
|
||||
"Logging_in": "正在登入…",
|
||||
"your_connection_is_unencrypted": "連線沒加密。",
|
||||
"your_connection_is_encrypted": "連線有加密。",
|
||||
"your_buddy_closed_the_private_connection": "聯絡人關閉了加密連線。",
|
||||
"start_private": "開始加密",
|
||||
"close_private": "結束加密",
|
||||
"your_buddy_is_verificated": "聯絡人已校驗。",
|
||||
"you_have_only_a_subscription_in_one_way": "只有單向訂閱。",
|
||||
"authentication_query_sent": "驗證要求送出了。",
|
||||
"your_message_wasnt_send_please_end_your_private_conversation": "訊息沒送出去。請結束加密的對話。",
|
||||
"unencrypted_message_received": "收到沒加密的訊息",
|
||||
"not_available": "不存在",
|
||||
"no_connection": "沒有連線!",
|
||||
"relogin": "重新登入",
|
||||
"trying_to_start_private_conversation": "正在試著開始加密的對話!",
|
||||
"Verified": "已校驗",
|
||||
"Unverified": "未校驗",
|
||||
"private_conversation_aborted": "加密的對話中斷了!",
|
||||
"your_buddy_closed_the_private_conversation_you_should_do_the_same": "聯絡人把這場加密的對話關掉了!你也應該同樣關掉。",
|
||||
"conversation_is_now_verified": "對話現在校驗過了。",
|
||||
"authentication_failed": "驗證失敗。",
|
||||
"Creating_your_private_key_": "正在產生你的私人金鑰,會花一段時間。",
|
||||
"Authenticating_a_buddy_helps_": "聯絡人驗證可以確保跟你說話的是真的那個人。",
|
||||
"How_do_you_want_to_authenticate_your_buddy": "你想要怎樣驗證{{bid_name}} ({{bid_jid}})?",
|
||||
"Select_method": "選個方式...",
|
||||
"Manual": "手動",
|
||||
"Question": "問答",
|
||||
"Secret": "祕密",
|
||||
"To_verify_the_fingerprint_": "要校驗聯絡人的電子指紋,請透過其他可靠的管道跟她/他聯絡,比如說電話。",
|
||||
"Your_fingerprint": "你的電子指紋",
|
||||
"Buddy_fingerprint": "聯絡人的電子指紋",
|
||||
"Close": "關閉",
|
||||
"Compared": "比對正確",
|
||||
"To_authenticate_using_a_question_": "要用問答來驗證的話,請找一個只有你和聯絡人才知道答案的問題。",
|
||||
"Ask": "問題",
|
||||
"To_authenticate_pick_a_secret_": "要驗證的話,請找一個只有你和聯絡人知道的祕密。",
|
||||
"Compare": "比對",
|
||||
"Fingerprints": "電子指紋",
|
||||
"Authentication": "驗證",
|
||||
"Message": "訊息",
|
||||
"Add_buddy": "加聯絡人",
|
||||
"rename_buddy": "重新命名聯絡人",
|
||||
"delete_buddy": "刪掉聯絡人",
|
||||
"Login": "登入",
|
||||
"Username": "使用者名稱",
|
||||
"Password": "密碼",
|
||||
"Cancel": "取消",
|
||||
"Connect": "連線",
|
||||
"Type_in_the_full_username_": "請打全名,別名可有可無",
|
||||
"Alias": "別名",
|
||||
"Add": "加入",
|
||||
"Subscription_request": "訂閱請求",
|
||||
"You_have_a_request_from": "收到聯絡人的請求:",
|
||||
"Deny": "拒絕",
|
||||
"Approve": "同意",
|
||||
"Remove_buddy": "刪除聯絡人",
|
||||
"You_are_about_to_remove_": "你就要把{{bid_name}} ({{bid_jid}})從聯絡簿刪掉了。所有相關的對話也都會關掉。",
|
||||
"Continue_without_chat": "繼續不聊天",
|
||||
"Please_wait": "請等一下",
|
||||
"Login_failed": "登入聊天失敗",
|
||||
"Sorry_we_cant_authentikate_": "跟聊天伺服器驗證失敗,會不會是密碼打錯了?",
|
||||
"Retry": "上一步",
|
||||
"clear_history": "清除歷史紀錄",
|
||||
"New_message_from": "有新訊息:__name__",
|
||||
"Should_we_notify_you_": "以後若有新訊息要通知你嗎?",
|
||||
"Please_accept_": "請點上方的「允許」按鈕。",
|
||||
"Hide_offline": "隱藏離線聯絡人",
|
||||
"Show_offline": "顯示離線聯絡人",
|
||||
"About": "關於我",
|
||||
"dnd": "別打擾",
|
||||
"Mute": "開靜音",
|
||||
"Unmute": "關靜音",
|
||||
"Subscription": "訂閱狀態",
|
||||
"both": "雙向",
|
||||
"Status": "狀態",
|
||||
"online": "上線",
|
||||
"chat": "聊天",
|
||||
"away": "離開",
|
||||
"xa": "離開很久",
|
||||
"offline": "離線",
|
||||
"none": "沒有",
|
||||
"Unknown_instance_tag": null,
|
||||
"Not_one_of_our_latest_keys": null,
|
||||
"Received_an_unreadable_encrypted_message": "收到了一則加密但無法辨認的訊息。",
|
||||
"Online": "上線",
|
||||
"Chatty": "想聊天",
|
||||
"Away": "離開",
|
||||
"Extended_away": "離開很久",
|
||||
"Offline": "離線",
|
||||
"Friendship_request": "聯絡請求",
|
||||
"Confirm": "確定",
|
||||
"Dismiss": "取消",
|
||||
"Remove": "刪掉",
|
||||
"Online_help": "線上說明",
|
||||
"FN": "全名",
|
||||
"N": " ",
|
||||
"FAMILY": "姓氏",
|
||||
"GIVEN": "名字",
|
||||
"NICKNAME": "綽號",
|
||||
"URL": "網址",
|
||||
"ADR": "位址",
|
||||
"STREET": "地址",
|
||||
"EXTADD": "更多位址",
|
||||
"LOCALITY": "所在地",
|
||||
"REGION": "區域",
|
||||
"PCODE": "郵遞區號",
|
||||
"CTRY": "國家",
|
||||
"TEL": "電話",
|
||||
"NUMBER": "編號",
|
||||
"EMAIL": "電子郵件",
|
||||
"USERID": " ",
|
||||
"ORG": "團體",
|
||||
"ORGNAME": "名稱",
|
||||
"ORGUNIT": "單位",
|
||||
"TITLE": "職稱",
|
||||
"ROLE": "職位",
|
||||
"BDAY": "生日",
|
||||
"DESC": "簡介",
|
||||
"PHOTO": " ",
|
||||
"send_message": "發送訊息",
|
||||
"get_info": "顯示帳號資訊",
|
||||
"Settings": "設定",
|
||||
"Priority": "優先度",
|
||||
"Save": "儲存",
|
||||
"User_settings": "使用者設定",
|
||||
"A_fingerprint_": "電子指紋是用來確認跟你說話的是真的那個人。",
|
||||
"is": "狀態:",
|
||||
"Login_options": "登入選項",
|
||||
"BOSH_url": "BOSH 網址",
|
||||
"Domain": "網域",
|
||||
"Resource": "資源",
|
||||
"On_login": "登入啟動",
|
||||
"Received_an_unencrypted_message": "收到了一則沒加密的訊息",
|
||||
"Sorry_your_buddy_doesnt_provide_any_information": "抱歉,聯絡人沒有提供任何資訊。",
|
||||
"Info_about": "帳號資訊:",
|
||||
"Authentication_aborted": "驗證中斷。",
|
||||
"Authentication_request_received": "驗證請求收到了。",
|
||||
"Log_in_without_chat": "登入但不啟用聊天",
|
||||
"has_come_online": "上線了",
|
||||
"Unknown_sender": "不明傳訊人",
|
||||
"Please_allow_access_to_microphone_and_camera": "請點上方的「接受」按鈕來允許我們使用麥克風和相機。",
|
||||
"Incoming_call": "來電",
|
||||
"from": "只出",
|
||||
"Do_you_want_to_accept_the_call_from": "是否要接聽來電:",
|
||||
"Reject": "拒絕",
|
||||
"Accept": "接受",
|
||||
"hang_up": "掛斷",
|
||||
"snapshot": "截圖",
|
||||
"mute_my_audio": "關掉我的聲音",
|
||||
"pause_my_video": "暫停我的影像",
|
||||
"fullscreen": "全螢幕",
|
||||
"Info": "資料",
|
||||
"Local_IP": "本機網路位址",
|
||||
"Remote_IP": "遠端網路位址",
|
||||
"Local_Fingerprint": "本機電子指紋",
|
||||
"Remote_Fingerprint": "遠端電子指紋",
|
||||
"Video_call_not_possible": "無法視訊通話。聯絡人不支援視訊。",
|
||||
"Start_video_call": "開始視訊通話",
|
||||
"Join_chat": "參加聊天",
|
||||
"Join": "參加",
|
||||
"Room": "聊天室",
|
||||
"Nickname": "綽號",
|
||||
"left_the_building": "__nickname__離開了大樓",
|
||||
"entered_the_room": "__nickname__進入了聊天室",
|
||||
"is_now_known_as": "__oldNickname__改名叫做__newNickname__",
|
||||
"This_room_is": "聊天室屬性:",
|
||||
"muc_hidden": {
|
||||
"keyword": "隱藏",
|
||||
"description": "搜尋也找不到"
|
||||
},
|
||||
"muc_membersonly": {
|
||||
"keyword": "限會員",
|
||||
"description": "會員才會加入"
|
||||
},
|
||||
"muc_moderated": {
|
||||
"keyword": "有管制",
|
||||
"description": "沒被消音的人才能送訊息"
|
||||
},
|
||||
"muc_nonanonymous": {
|
||||
"keyword": "禁匿名",
|
||||
"description": "每個參與人都能看到你的 jabber 代碼"
|
||||
},
|
||||
"muc_open": {
|
||||
"keyword": "開放",
|
||||
"description": "任何人都能參加"
|
||||
},
|
||||
"muc_passwordprotected": {
|
||||
"keyword": "密碼鎖",
|
||||
"description": "要輸入正確的密碼才能加入"
|
||||
},
|
||||
"muc_persistent": {
|
||||
"keyword": "永久性",
|
||||
"description": "最後一個參與人都離開了也不會結束"
|
||||
},
|
||||
"muc_public": {
|
||||
"keyword": "公開",
|
||||
"description": "搜尋得到"
|
||||
},
|
||||
"muc_semianonymous": {
|
||||
"keyword": "半匿名",
|
||||
"description": "只有聊天室管理員才看得到你的 jabber 代碼"
|
||||
},
|
||||
"muc_temporary": {
|
||||
"keyword": "暫時性",
|
||||
"description": "最後一個參與人離開了就會結束"
|
||||
},
|
||||
"muc_unmoderated": {
|
||||
"keyword": "沒管制",
|
||||
"description": "每個人都可以送訊息"
|
||||
},
|
||||
"muc_unsecured": {
|
||||
"keyword": "沒保護",
|
||||
"description": "不需要密碼就能加入"
|
||||
},
|
||||
"Continue": "繼續",
|
||||
"Server": "伺服器",
|
||||
"Rooms_are_loaded": "聊天室載入完成",
|
||||
"Could_load_only": "只能載入__count__間聊天室供輸入自動完成使用",
|
||||
"muc_explanation": "請輸入要參加的聊天室名稱,綽號和密碼非必要",
|
||||
"You_already_joined_this_room": "你已經參加這間聊天室了",
|
||||
"This_room_will_be_closed": "聊天室即將關閉",
|
||||
"Room_not_found_": "新聊天室即將開啟",
|
||||
"Loading_room_information": "正在載入聊天室資訊",
|
||||
"Destroy": "關閉",
|
||||
"Leave": "離開",
|
||||
"changed_subject_to": "__nickname__把聊天室的標題改成了\"__subject__\"",
|
||||
"muc_removed_kicked": "你被踢出聊天室了",
|
||||
"muc_removed_info_kicked": "__nickname__被踢出聊天室了",
|
||||
"muc_removed_banned": "你被禁止進入聊天室了",
|
||||
"muc_removed_info_banned": "__nickname__被禁止進入聊天室了",
|
||||
"muc_removed_affiliation": "你因為身份改變而離開聊天室了",
|
||||
"muc_removed_info_affiliation": "__nickname__因為身份改變而離開聊天室了",
|
||||
"muc_removed_membersonly": "你離開聊天室了,因為聊天室改為只限會員,但你不是會員",
|
||||
"muc_removed_info_membersonly": "__nickname__離開聊天室了,因為聊天室改為只限會員,但她/他不是會員",
|
||||
"muc_removed_shutdown": "你離開聊天室了,因為多人聊天服務正在關閉中。",
|
||||
"Reason": "原因",
|
||||
"message_not_send": "訊息因為發生錯誤沒送出去",
|
||||
"message_not_send_item-not-found": "訊息沒送出去,因為聊天室不存在了",
|
||||
"message_not_send_forbidden": "訊息沒送出去,因為你被消音了",
|
||||
"message_not_send_not-acceptable": "訊息沒送出去,因為你不是聊天室的參與人了",
|
||||
"This_room_has_been_closed": "聊天室已經關閉了",
|
||||
"Room_logging_is_enabled": "聊天室紀錄打開了",
|
||||
"A_password_is_required": "需要密碼",
|
||||
"You_are_not_on_the_member_list": "你不是會員",
|
||||
"You_are_banned_from_this_room": "你被禁止進入聊天室了",
|
||||
"Your_desired_nickname_": "這個綽號被用掉了,請換一個",
|
||||
"The_maximum_number_": "這間聊天室已經到達使用者數目的上限",
|
||||
"This_room_is_locked_": "聊天室上鎖了",
|
||||
"You_are_not_allowed_to_create_": "不允許你開新的聊天室",
|
||||
"Alert": "警告",
|
||||
"Call_started": "通話開始",
|
||||
"Call_terminated": "通話結束",
|
||||
"Carbon_copy": "副本",
|
||||
"Enable": "打開",
|
||||
"jingle_reason_busy": "忙線中",
|
||||
"jingle_reason_decline": "被拒絕",
|
||||
"jingle_reason_success": "被掛斷",
|
||||
"Media_failure": "媒體錯誤",
|
||||
"No_local_audio_device": "本機沒有音訊設備。",
|
||||
"No_local_video_device": "本機沒有視訊設備。",
|
||||
"Ok": "好",
|
||||
"PermissionDeniedError": "你或你的瀏覽器拒絕了音視訊的權限",
|
||||
"Use_local_audio_device": "使用本機音訊設備。",
|
||||
"Use_local_video_device": "使用本機視訊設備。",
|
||||
"is_": "狀態: __status__",
|
||||
"You_received_a_message_from_an_unknown_sender_": "收到了不明人士(__sender__)傳來的訊息。你要打開來看嗎?",
|
||||
"Your_roster_is_empty_add_": "好友清單是空的,請加<a>新的聯絡人</a>",
|
||||
"onsmp_explanation_question": "聯絡人想要確定她/他是在跟真的你說話。要完成你的驗證,請輸入問題的答案,然後按\"回答\"。",
|
||||
"onsmp_explanation_secret": "聯絡人想要確定她/他是在跟真的你說話。要完成你的驗證,請輸入你們之間的祕密。",
|
||||
"from_sender": "來自:__sender__",
|
||||
"Verified_private_conversation_started": "加密且已校驗的對話開始了。",
|
||||
"Unverified_private_conversation_started": "加密但未校驗的對話開始了。",
|
||||
"Bookmark": "書籤",
|
||||
"Auto-join": "自動參加",
|
||||
"Edit_bookmark": "編輯書籤",
|
||||
"Room_logging_is_disabled": "聊天室紀錄關掉了",
|
||||
"Room_is_now_non-anoymous": "現在聊天室禁止匿名了",
|
||||
"Room_is_now_semi-anonymous": "現在聊天室變半匿名了",
|
||||
"Do_you_want_to_change_the_default_room_configuration": "你想要改變聊天室的預設配置嗎?",
|
||||
"Default": "預設值",
|
||||
"Change": "修改",
|
||||
"Send_file": "傳送檔案",
|
||||
"setting-explanation-carbon": "如果打開副本選項的話,XMPP 伺服器會把每一個收到的訊息,都送一份到這個用戶端程式,即使它不是訊息發送的對象。",
|
||||
"setting-explanation-login": "打開這個選項會在登入時同時開啟聊天。",
|
||||
"setting-explanation-priority": "如果你用同一個帳號同時登入好幾次的話,XMPP 伺服器會把訊息送給優先度最高的那個用戶端程式。",
|
||||
"setting-explanation-xmpp": "這些是用在 XMPP 伺服器連線的選項。"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,290 @@
|
||||
{
|
||||
"translation": {
|
||||
"Logging_in": null,
|
||||
"your_connection_is_unencrypted": null,
|
||||
"your_connection_is_encrypted": null,
|
||||
"your_buddy_closed_the_private_connection": null,
|
||||
"start_private": null,
|
||||
"close_private": null,
|
||||
"your_buddy_is_verificated": null,
|
||||
"you_have_only_a_subscription_in_one_way": null,
|
||||
"authentication_query_sent": null,
|
||||
"your_message_wasnt_send_please_end_your_private_conversation": null,
|
||||
"unencrypted_message_received": null,
|
||||
"not_available": null,
|
||||
"no_connection": null,
|
||||
"relogin": null,
|
||||
"trying_to_start_private_conversation": null,
|
||||
"Verified": null,
|
||||
"Unverified": null,
|
||||
"private_conversation_aborted": null,
|
||||
"your_buddy_closed_the_private_conversation_you_should_do_the_same": null,
|
||||
"conversation_is_now_verified": null,
|
||||
"authentication_failed": null,
|
||||
"Creating_your_private_key_": null,
|
||||
"Authenticating_a_buddy_helps_": null,
|
||||
"How_do_you_want_to_authenticate_your_buddy": null,
|
||||
"Select_method": null,
|
||||
"Manual": null,
|
||||
"Question": null,
|
||||
"Secret": null,
|
||||
"To_verify_the_fingerprint_": null,
|
||||
"Your_fingerprint": null,
|
||||
"Buddy_fingerprint": null,
|
||||
"Close": null,
|
||||
"Compared": null,
|
||||
"To_authenticate_using_a_question_": null,
|
||||
"Ask": null,
|
||||
"To_authenticate_pick_a_secret_": null,
|
||||
"Compare": null,
|
||||
"Fingerprints": null,
|
||||
"Authentication": null,
|
||||
"Message": null,
|
||||
"Add_buddy": null,
|
||||
"rename_buddy": null,
|
||||
"delete_buddy": null,
|
||||
"Login": null,
|
||||
"Username": null,
|
||||
"Password": null,
|
||||
"Cancel": null,
|
||||
"Connect": null,
|
||||
"Type_in_the_full_username_": null,
|
||||
"Alias": null,
|
||||
"Add": null,
|
||||
"Subscription_request": null,
|
||||
"You_have_a_request_from": null,
|
||||
"Deny": null,
|
||||
"Approve": null,
|
||||
"Remove_buddy": null,
|
||||
"You_are_about_to_remove_": null,
|
||||
"Continue_without_chat": null,
|
||||
"Please_wait": null,
|
||||
"Login_failed": null,
|
||||
"Sorry_we_cant_authentikate_": null,
|
||||
"Retry": null,
|
||||
"clear_history": null,
|
||||
"New_message_from": null,
|
||||
"Should_we_notify_you_": null,
|
||||
"Please_accept_": null,
|
||||
"Hide_offline": null,
|
||||
"Show_offline": null,
|
||||
"About": null,
|
||||
"dnd": null,
|
||||
"Mute": null,
|
||||
"Unmute": null,
|
||||
"Subscription": null,
|
||||
"both": null,
|
||||
"Status": null,
|
||||
"online": null,
|
||||
"chat": null,
|
||||
"away": null,
|
||||
"xa": null,
|
||||
"offline": null,
|
||||
"none": null,
|
||||
"Unknown_instance_tag": null,
|
||||
"Not_one_of_our_latest_keys": null,
|
||||
"Received_an_unreadable_encrypted_message": null,
|
||||
"Online": null,
|
||||
"Chatty": null,
|
||||
"Away": null,
|
||||
"Extended_away": null,
|
||||
"Offline": null,
|
||||
"Friendship_request": null,
|
||||
"Confirm": null,
|
||||
"Dismiss": null,
|
||||
"Remove": null,
|
||||
"Online_help": null,
|
||||
"FN": null,
|
||||
"N": null,
|
||||
"FAMILY": null,
|
||||
"GIVEN": null,
|
||||
"NICKNAME": null,
|
||||
"URL": null,
|
||||
"ADR": null,
|
||||
"STREET": null,
|
||||
"EXTADD": null,
|
||||
"LOCALITY": null,
|
||||
"REGION": null,
|
||||
"PCODE": null,
|
||||
"CTRY": null,
|
||||
"TEL": null,
|
||||
"NUMBER": null,
|
||||
"EMAIL": null,
|
||||
"USERID": null,
|
||||
"ORG": null,
|
||||
"ORGNAME": null,
|
||||
"ORGUNIT": null,
|
||||
"TITLE": null,
|
||||
"ROLE": null,
|
||||
"BDAY": null,
|
||||
"DESC": null,
|
||||
"PHOTO": null,
|
||||
"send_message": null,
|
||||
"get_info": null,
|
||||
"Settings": null,
|
||||
"Priority": null,
|
||||
"Save": null,
|
||||
"User_settings": null,
|
||||
"A_fingerprint_": null,
|
||||
"is": null,
|
||||
"Login_options": null,
|
||||
"BOSH_url": null,
|
||||
"Domain": null,
|
||||
"Resource": null,
|
||||
"On_login": null,
|
||||
"Received_an_unencrypted_message": null,
|
||||
"Sorry_your_buddy_doesnt_provide_any_information": null,
|
||||
"Info_about": null,
|
||||
"Authentication_aborted": null,
|
||||
"Authentication_request_received": null,
|
||||
"Log_in_without_chat": null,
|
||||
"has_come_online": null,
|
||||
"Unknown_sender": null,
|
||||
"Please_allow_access_to_microphone_and_camera": null,
|
||||
"Incoming_call": null,
|
||||
"from": null,
|
||||
"Do_you_want_to_accept_the_call_from": null,
|
||||
"Reject": null,
|
||||
"Accept": null,
|
||||
"hang_up": null,
|
||||
"snapshot": null,
|
||||
"mute_my_audio": null,
|
||||
"pause_my_video": null,
|
||||
"fullscreen": null,
|
||||
"Info": null,
|
||||
"Local_IP": null,
|
||||
"Remote_IP": null,
|
||||
"Local_Fingerprint": null,
|
||||
"Remote_Fingerprint": null,
|
||||
"Video_call_not_possible": null,
|
||||
"Start_video_call": null,
|
||||
"Join_chat": null,
|
||||
"Join": null,
|
||||
"Room": null,
|
||||
"Nickname": null,
|
||||
"left_the_building": null,
|
||||
"entered_the_room": null,
|
||||
"is_now_known_as": null,
|
||||
"This_room_is": null,
|
||||
"muc_hidden": {
|
||||
"keyword": null,
|
||||
"description": null
|
||||
},
|
||||
"muc_membersonly": {
|
||||
"keyword": null,
|
||||
"description": null
|
||||
},
|
||||
"muc_moderated": {
|
||||
"keyword": null,
|
||||
"description": null
|
||||
},
|
||||
"muc_nonanonymous": {
|
||||
"keyword": null,
|
||||
"description": null
|
||||
},
|
||||
"muc_open": {
|
||||
"keyword": null,
|
||||
"description": null
|
||||
},
|
||||
"muc_passwordprotected": {
|
||||
"keyword": null,
|
||||
"description": null
|
||||
},
|
||||
"muc_persistent": {
|
||||
"keyword": null,
|
||||
"description": null
|
||||
},
|
||||
"muc_public": {
|
||||
"keyword": null,
|
||||
"description": null
|
||||
},
|
||||
"muc_semianonymous": {
|
||||
"keyword": null,
|
||||
"description": null
|
||||
},
|
||||
"muc_temporary": {
|
||||
"keyword": null,
|
||||
"description": null
|
||||
},
|
||||
"muc_unmoderated": {
|
||||
"keyword": null,
|
||||
"description": null
|
||||
},
|
||||
"muc_unsecured": {
|
||||
"keyword": null,
|
||||
"description": null
|
||||
},
|
||||
"Continue": null,
|
||||
"Server": null,
|
||||
"Rooms_are_loaded": null,
|
||||
"Could_load_only": null,
|
||||
"muc_explanation": null,
|
||||
"You_already_joined_this_room": null,
|
||||
"This_room_will_be_closed": null,
|
||||
"Room_not_found_": null,
|
||||
"Loading_room_information": null,
|
||||
"Destroy": null,
|
||||
"Leave": null,
|
||||
"changed_subject_to": null,
|
||||
"muc_removed_kicked": null,
|
||||
"muc_removed_info_kicked": null,
|
||||
"muc_removed_banned": null,
|
||||
"muc_removed_info_banned": null,
|
||||
"muc_removed_affiliation": null,
|
||||
"muc_removed_info_affiliation": null,
|
||||
"muc_removed_membersonly": null,
|
||||
"muc_removed_info_membersonly": null,
|
||||
"muc_removed_shutdown": null,
|
||||
"Reason": null,
|
||||
"message_not_send": null,
|
||||
"message_not_send_item-not-found": null,
|
||||
"message_not_send_forbidden": null,
|
||||
"message_not_send_not-acceptable": null,
|
||||
"This_room_has_been_closed": null,
|
||||
"Room_logging_is_enabled": null,
|
||||
"A_password_is_required": null,
|
||||
"You_are_not_on_the_member_list": null,
|
||||
"You_are_banned_from_this_room": null,
|
||||
"Your_desired_nickname_": null,
|
||||
"The_maximum_number_": null,
|
||||
"This_room_is_locked_": null,
|
||||
"You_are_not_allowed_to_create_": null,
|
||||
"Alert": null,
|
||||
"Call_started": null,
|
||||
"Call_terminated": null,
|
||||
"Carbon_copy": null,
|
||||
"Enable": null,
|
||||
"jingle_reason_busy": null,
|
||||
"jingle_reason_decline": null,
|
||||
"jingle_reason_success": null,
|
||||
"Media_failure": null,
|
||||
"No_local_audio_device": null,
|
||||
"No_local_video_device": null,
|
||||
"Ok": null,
|
||||
"PermissionDeniedError": null,
|
||||
"Use_local_audio_device": null,
|
||||
"Use_local_video_device": null,
|
||||
"is_": null,
|
||||
"You_received_a_message_from_an_unknown_sender_": null,
|
||||
"Your_roster_is_empty_add_": null,
|
||||
"onsmp_explanation_question": null,
|
||||
"onsmp_explanation_secret": null,
|
||||
"from_sender": null,
|
||||
"Verified_private_conversation_started": null,
|
||||
"Unverified_private_conversation_started": null,
|
||||
"Bookmark": null,
|
||||
"Auto-join": null,
|
||||
"Edit_bookmark": null,
|
||||
"Room_logging_is_disabled": null,
|
||||
"Room_is_now_non-anoymous": null,
|
||||
"Room_is_now_semi-anonymous": null,
|
||||
"Do_you_want_to_change_the_default_room_configuration": null,
|
||||
"Default": null,
|
||||
"Change": null,
|
||||
"Send_file": null,
|
||||
"setting-explanation-carbon": null,
|
||||
"setting-explanation-login": null,
|
||||
"setting-explanation-priority": null,
|
||||
"setting-explanation-xmpp": null
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "jsxc",
|
||||
"version": "3.0.0-beta2",
|
||||
"version": "3.0.1",
|
||||
"description": "Real-time chat app",
|
||||
"homepage": "http://www.jsxc.org/",
|
||||
"bugs": "https://github.com/jsxc/jsxc/issues",
|
||||
@@ -28,7 +28,7 @@
|
||||
"grunt-data-uri": "^0.2.0",
|
||||
"grunt-html-convert": "0.0.2",
|
||||
"grunt-jsbeautifier": "^0.2.10",
|
||||
"grunt-jsdoc": "^0.5.7",
|
||||
"grunt-jsdoc": "^2.1.0",
|
||||
"grunt-merge-data": "^0.4.3",
|
||||
"grunt-postcss": "^0.2.0",
|
||||
"grunt-prettysass": "^0.2.3",
|
||||
|
||||
@@ -32,6 +32,10 @@
|
||||
|
||||
.progress {
|
||||
margin-bottom: 0px;
|
||||
|
||||
.progress-bar {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+32
-5
@@ -6,6 +6,18 @@
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.jsxc_hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.jsxc_clear {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.jsxc_uppercase {
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.jsxc_sep {
|
||||
border-top: 1px solid $separator;
|
||||
}
|
||||
@@ -24,6 +36,7 @@
|
||||
#jsxc_dialog {
|
||||
padding: 20px;
|
||||
min-width: 320px;
|
||||
max-width: 100%;
|
||||
display: inline-block;
|
||||
text-align: left;
|
||||
position: relative;
|
||||
@@ -318,12 +331,26 @@ img.jsxc_vCard {
|
||||
.jsxc_btn {
|
||||
width: auto;
|
||||
min-width: 25px;
|
||||
padding: 5px;
|
||||
background-color: rgba(240, 240, 240, 0.9);
|
||||
font-weight: bold;
|
||||
color: #555;
|
||||
border: 1px solid rgba(190, 190, 190, 0.9);
|
||||
display: inline-block;
|
||||
padding: 6px 12px;
|
||||
margin: 0px 2px;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
line-height: 1.42857143;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
vertical-align: middle;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
background-image: none;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 4px;
|
||||
|
||||
&.jsxc_btn-default {
|
||||
border-color: #ccc;
|
||||
color: #555;
|
||||
background-color: rgba(240, 240, 240, 0.9);
|
||||
}
|
||||
|
||||
&.jsxc_btn-primary {
|
||||
color: #fff;
|
||||
|
||||
+17
-2
@@ -67,7 +67,6 @@
|
||||
|
||||
.jsxc_controlbar {
|
||||
opacity: 0;
|
||||
transition: 1s opacity;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
@@ -187,12 +186,23 @@ div {
|
||||
right: 0px;
|
||||
text-align: center;
|
||||
z-index: 9090;
|
||||
transition: 1s opacity;
|
||||
opacity: 0;
|
||||
|
||||
@media (min-width: 768px) {
|
||||
bottom: 5%;
|
||||
top: initial;
|
||||
}
|
||||
|
||||
&.jsxc_visible {
|
||||
opacity: 1.0;
|
||||
}
|
||||
|
||||
& > div {
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
height: 44px;
|
||||
border-radius: 22px;
|
||||
padding: 5px;
|
||||
padding: 0px 5px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
@@ -263,6 +273,11 @@ div {
|
||||
bottom: 0;
|
||||
width: 250px;
|
||||
background-color: $window_bg;
|
||||
display: none;
|
||||
|
||||
@media (min-width: 768px) {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.jsxc_settings {
|
||||
display: none !important;
|
||||
|
||||
@@ -14,3 +14,4 @@ $font_serif: serif;
|
||||
@import "muc";
|
||||
|
||||
@import "jsxc";
|
||||
@import "webrtc";
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
@import "colors";
|
||||
|
||||
@import "webrtc";
|
||||
+128
-97
@@ -1,7 +1,7 @@
|
||||
/* global Favico, emojione*/
|
||||
/**
|
||||
* Handle functions for chat window's and buddylist
|
||||
*
|
||||
*
|
||||
* @namespace jsxc.gui
|
||||
*/
|
||||
jsxc.gui = {
|
||||
@@ -50,7 +50,7 @@ jsxc.gui = {
|
||||
|
||||
/**
|
||||
* Different uri query actions as defined in XEP-0147.
|
||||
*
|
||||
*
|
||||
* @namespace jsxc.gui.queryActions
|
||||
*/
|
||||
queryActions: {
|
||||
@@ -92,7 +92,7 @@ jsxc.gui = {
|
||||
|
||||
/**
|
||||
* Creates application skeleton.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.gui
|
||||
*/
|
||||
init: function() {
|
||||
@@ -152,7 +152,7 @@ jsxc.gui = {
|
||||
|
||||
/**
|
||||
* Init tooltip plugin for given jQuery selector.
|
||||
*
|
||||
*
|
||||
* @param {String} selector jQuery selector
|
||||
* @memberOf jsxc.gui
|
||||
*/
|
||||
@@ -169,7 +169,7 @@ jsxc.gui = {
|
||||
|
||||
/**
|
||||
* Updates Information in roster and chatbar
|
||||
*
|
||||
*
|
||||
* @param {String} bid bar jid
|
||||
*/
|
||||
update: function(bid) {
|
||||
@@ -240,7 +240,7 @@ jsxc.gui = {
|
||||
|
||||
/**
|
||||
* Update avatar on all given elements.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.gui
|
||||
* @param {jQuery} el Elements with subelement .jsxc_avatar
|
||||
* @param {string} jid Jid
|
||||
@@ -273,6 +273,11 @@ jsxc.gui = {
|
||||
|
||||
var avatarSrc = jsxc.storage.getUserItem('avatar', aid);
|
||||
|
||||
if (!jsxc.master && !avatarSrc) {
|
||||
// force avatar placeholder for slave tab, until master tab requested vCard
|
||||
avatarSrc = 0;
|
||||
}
|
||||
|
||||
if (avatarSrc !== null) {
|
||||
setAvatar(avatarSrc);
|
||||
} else {
|
||||
@@ -318,7 +323,7 @@ jsxc.gui = {
|
||||
|
||||
/**
|
||||
* Updates scrollbar handlers.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.gui
|
||||
*/
|
||||
updateWindowListSB: function() {
|
||||
@@ -333,7 +338,7 @@ jsxc.gui = {
|
||||
|
||||
/**
|
||||
* Scroll window list by offset.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.gui
|
||||
* @param offset
|
||||
*/
|
||||
@@ -375,7 +380,7 @@ jsxc.gui = {
|
||||
|
||||
/**
|
||||
* Toggle list with timeout, like menu or settings
|
||||
*
|
||||
*
|
||||
* @memberof jsxc.gui
|
||||
*/
|
||||
toggleList: function(el) {
|
||||
@@ -470,7 +475,7 @@ jsxc.gui = {
|
||||
|
||||
/**
|
||||
* Creates and show the fingerprint dialog
|
||||
*
|
||||
*
|
||||
* @param {String} bid
|
||||
*/
|
||||
showFingerprints: function(bid) {
|
||||
@@ -479,7 +484,7 @@ jsxc.gui = {
|
||||
|
||||
/**
|
||||
* Creates and show the verification dialog
|
||||
*
|
||||
*
|
||||
* @param {String} bid
|
||||
*/
|
||||
showVerification: function(bid) {
|
||||
@@ -604,7 +609,7 @@ jsxc.gui = {
|
||||
|
||||
/**
|
||||
* Create and show approve dialog
|
||||
*
|
||||
*
|
||||
* @param {type} from valid jid
|
||||
*/
|
||||
showApproveDialog: function(from) {
|
||||
@@ -638,7 +643,7 @@ jsxc.gui = {
|
||||
|
||||
/**
|
||||
* Create and show dialog to add a buddy
|
||||
*
|
||||
*
|
||||
* @param {string} [username] jabber id
|
||||
*/
|
||||
showContactDialog: function(username) {
|
||||
@@ -713,7 +718,7 @@ jsxc.gui = {
|
||||
|
||||
/**
|
||||
* Create and show dialog to remove a buddy
|
||||
*
|
||||
*
|
||||
* @param {type} bid
|
||||
* @returns {undefined}
|
||||
*/
|
||||
@@ -741,7 +746,7 @@ jsxc.gui = {
|
||||
|
||||
/**
|
||||
* Create and show a wait dialog
|
||||
*
|
||||
*
|
||||
* @param {type} msg message to display to the user
|
||||
* @returns {undefined}
|
||||
*/
|
||||
@@ -753,7 +758,7 @@ jsxc.gui = {
|
||||
|
||||
/**
|
||||
* Create and show a wait dialog
|
||||
*
|
||||
*
|
||||
* @param {type} msg message to display to the user
|
||||
* @returns {undefined}
|
||||
*/
|
||||
@@ -763,7 +768,7 @@ jsxc.gui = {
|
||||
|
||||
/**
|
||||
* Create and show a auth fail dialog
|
||||
*
|
||||
*
|
||||
* @returns {undefined}
|
||||
*/
|
||||
showAuthFail: function() {
|
||||
@@ -784,7 +789,7 @@ jsxc.gui = {
|
||||
|
||||
/**
|
||||
* Create and show a confirm dialog
|
||||
*
|
||||
*
|
||||
* @param {String} msg Message
|
||||
* @param {function} confirm
|
||||
* @param {function} dismiss
|
||||
@@ -806,7 +811,7 @@ jsxc.gui = {
|
||||
|
||||
/**
|
||||
* Show about dialog.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.gui
|
||||
*/
|
||||
showAboutDialog: function() {
|
||||
@@ -819,7 +824,7 @@ jsxc.gui = {
|
||||
|
||||
/**
|
||||
* Show debug log.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.gui
|
||||
*/
|
||||
showDebugLog: function() {
|
||||
@@ -828,12 +833,16 @@ jsxc.gui = {
|
||||
if (navigator) {
|
||||
var key;
|
||||
for (key in navigator) {
|
||||
if (navigator.hasOwnProperty(key) && typeof navigator[key] === 'string') {
|
||||
if (typeof navigator[key] === 'string') {
|
||||
userInfo += '<b>' + key + ':</b> ' + navigator[key] + '<br />';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($.fn && $.fn.jquery) {
|
||||
userInfo += '<b>jQuery:</b> ' + $.fn.jquery + '<br />';
|
||||
}
|
||||
|
||||
if (window.screen) {
|
||||
userInfo += '<b>Height:</b> ' + window.screen.height + '<br />';
|
||||
userInfo += '<b>Width:</b> ' + window.screen.width + '<br />';
|
||||
@@ -846,7 +855,7 @@ jsxc.gui = {
|
||||
|
||||
/**
|
||||
* Show vCard of user with the given bar jid.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.gui
|
||||
* @param {String} jid
|
||||
*/
|
||||
@@ -1043,22 +1052,24 @@ jsxc.gui = {
|
||||
jsxc.options.set(key, val);
|
||||
});
|
||||
|
||||
var success = jsxc.options.saveSettinsPermanent.call(this, data);
|
||||
|
||||
if (typeof self.attr('data-onsubmit') === 'string') {
|
||||
jsxc.exec(self.attr('data-onsubmit'), [success]);
|
||||
}
|
||||
|
||||
setTimeout(function() {
|
||||
if (success) {
|
||||
self.find('button[type="submit"]').switchClass('btn-primary', 'btn-success');
|
||||
} else {
|
||||
self.find('button[type="submit"]').switchClass('btn-primary', 'btn-danger');
|
||||
var cb = function(success) {
|
||||
if (typeof self.attr('data-onsubmit') === 'string') {
|
||||
jsxc.exec(self.attr('data-onsubmit'), [success]);
|
||||
}
|
||||
|
||||
setTimeout(function() {
|
||||
self.find('button[type="submit"]').switchClass('btn-danger btn-success', 'btn-primary');
|
||||
}, 2000);
|
||||
}, 200);
|
||||
if (success) {
|
||||
self.find('button[type="submit"]').switchClass('btn-primary', 'btn-success');
|
||||
} else {
|
||||
self.find('button[type="submit"]').switchClass('btn-primary', 'btn-danger');
|
||||
}
|
||||
setTimeout(function() {
|
||||
self.find('button[type="submit"]').switchClass('btn-danger btn-success', 'btn-primary');
|
||||
}, 2000);
|
||||
}, 200);
|
||||
};
|
||||
|
||||
jsxc.options.saveSettinsPermanent.call(this, data, cb);
|
||||
|
||||
return false;
|
||||
});
|
||||
@@ -1066,7 +1077,7 @@ jsxc.gui = {
|
||||
|
||||
/**
|
||||
* Show prompt for notification permission.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.gui
|
||||
*/
|
||||
showRequestNotification: function() {
|
||||
@@ -1174,7 +1185,7 @@ jsxc.gui = {
|
||||
|
||||
/**
|
||||
* Change own presence to pres.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.gui
|
||||
* @param pres {CONST.STATUS} New presence state
|
||||
* @param external {boolean} True if triggered from other tab.
|
||||
@@ -1196,7 +1207,7 @@ jsxc.gui = {
|
||||
|
||||
/**
|
||||
* Update all presence objects for given user.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.gui
|
||||
* @param bid bar jid of user.
|
||||
* @param {CONST.STATUS} pres New presence state.
|
||||
@@ -1231,7 +1242,7 @@ jsxc.gui = {
|
||||
|
||||
/**
|
||||
* Switch read state to UNread and increase counter.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.gui
|
||||
* @param bid
|
||||
*/
|
||||
@@ -1258,7 +1269,7 @@ jsxc.gui = {
|
||||
|
||||
/**
|
||||
* Switch read state to UNread.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.gui
|
||||
* @param bid
|
||||
* @param count
|
||||
@@ -1281,7 +1292,7 @@ jsxc.gui = {
|
||||
|
||||
/**
|
||||
* Switch read state to read.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.gui
|
||||
* @param bid
|
||||
*/
|
||||
@@ -1312,7 +1323,7 @@ jsxc.gui = {
|
||||
|
||||
/**
|
||||
* This function searches for URI scheme according to XEP-0147.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.gui
|
||||
* @param container In which element should we search?
|
||||
*/
|
||||
@@ -1419,7 +1430,7 @@ jsxc.gui = {
|
||||
|
||||
/**
|
||||
* Replace shortname emoticons with images.
|
||||
*
|
||||
*
|
||||
* @param {string} str text with emoticons as shortname
|
||||
* @return {string} text with emoticons as images
|
||||
*/
|
||||
@@ -1454,7 +1465,7 @@ jsxc.gui = {
|
||||
|
||||
/**
|
||||
* Handle functions related to the gui of the roster
|
||||
*
|
||||
*
|
||||
* @namespace jsxc.gui.roster
|
||||
*/
|
||||
jsxc.gui.roster = {
|
||||
@@ -1467,7 +1478,7 @@ jsxc.gui.roster = {
|
||||
|
||||
/**
|
||||
* Init the roster skeleton
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.gui.roster
|
||||
* @returns {undefined}
|
||||
*/
|
||||
@@ -1575,13 +1586,16 @@ jsxc.gui.roster = {
|
||||
|
||||
/**
|
||||
* Create roster item and add it to the roster
|
||||
*
|
||||
*
|
||||
* @param {String} bid bar jid
|
||||
*/
|
||||
add: function(bid) {
|
||||
var data = jsxc.storage.getUserItem('buddy', bid);
|
||||
var bud = jsxc.gui.buddyTemplate.clone().attr('data-bid', bid).attr('data-type', data.type || 'chat');
|
||||
|
||||
// remove all messages (offline, empty roster) from roster
|
||||
$('#jsxc_roster > p').remove();
|
||||
|
||||
jsxc.gui.roster.insert(bid, bud);
|
||||
|
||||
bud.click(function() {
|
||||
@@ -1658,7 +1672,7 @@ jsxc.gui.roster = {
|
||||
/**
|
||||
* Insert roster item. First order: online > away > offline. Second order:
|
||||
* alphabetical of the name
|
||||
*
|
||||
*
|
||||
* @param {type} bid
|
||||
* @param {jquery} li roster item which should be insert
|
||||
* @returns {undefined}
|
||||
@@ -1669,6 +1683,10 @@ jsxc.gui.roster = {
|
||||
var listElements = $('#jsxc_buddylist > li');
|
||||
var insert = false;
|
||||
|
||||
if (!data.name) {
|
||||
data.name = bid;
|
||||
}
|
||||
|
||||
// Insert buddy with no mutual friendship to the end
|
||||
var status = (data.sub === 'both') ? data.status : -1;
|
||||
|
||||
@@ -1692,7 +1710,7 @@ jsxc.gui.roster = {
|
||||
|
||||
/**
|
||||
* Initiate reorder of roster item
|
||||
*
|
||||
*
|
||||
* @param {type} bid
|
||||
* @returns {undefined}
|
||||
*/
|
||||
@@ -1702,7 +1720,7 @@ jsxc.gui.roster = {
|
||||
|
||||
/**
|
||||
* Removes buddy from roster
|
||||
*
|
||||
*
|
||||
* @param {String} bid bar jid
|
||||
* @return {JQueryObject} Roster list element
|
||||
*/
|
||||
@@ -1712,7 +1730,7 @@ jsxc.gui.roster = {
|
||||
|
||||
/**
|
||||
* Removes buddy from roster and clean up
|
||||
*
|
||||
*
|
||||
* @param {String} bid bar compatible jid
|
||||
*/
|
||||
purge: function(bid) {
|
||||
@@ -1732,7 +1750,7 @@ jsxc.gui.roster = {
|
||||
|
||||
/**
|
||||
* Create input element for rename action
|
||||
*
|
||||
*
|
||||
* @param {type} bid
|
||||
* @returns {undefined}
|
||||
*/
|
||||
@@ -1774,7 +1792,7 @@ jsxc.gui.roster = {
|
||||
|
||||
/**
|
||||
* Rename buddy
|
||||
*
|
||||
*
|
||||
* @param {type} bid
|
||||
* @param {type} newname new name of buddy
|
||||
* @returns {undefined}
|
||||
@@ -1804,7 +1822,7 @@ jsxc.gui.roster = {
|
||||
|
||||
/**
|
||||
* Toogle complete roster
|
||||
*
|
||||
*
|
||||
* @param {string} state Toggle to state
|
||||
*/
|
||||
toggle: function(state) {
|
||||
@@ -1852,7 +1870,7 @@ jsxc.gui.roster = {
|
||||
|
||||
/**
|
||||
* Shows a text with link to add a new buddy.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.gui.roster
|
||||
*/
|
||||
empty: function() {
|
||||
@@ -1871,13 +1889,13 @@ jsxc.gui.roster = {
|
||||
|
||||
/**
|
||||
* Wrapper for dialog
|
||||
*
|
||||
*
|
||||
* @namespace jsxc.gui.dialog
|
||||
*/
|
||||
jsxc.gui.dialog = {
|
||||
/**
|
||||
* Open a Dialog.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.gui.dialog
|
||||
* @param {String} data Data of the dialog
|
||||
* @param {Object} [o] Options for the dialog
|
||||
@@ -1890,9 +1908,11 @@ jsxc.gui.dialog = {
|
||||
name: ''
|
||||
}, o);
|
||||
|
||||
var src = $('<div data-name="' + opt.name + '" id="jsxc_dialog" />').append(data);
|
||||
|
||||
$.magnificPopup.open({
|
||||
items: {
|
||||
src: '<div data-name="' + opt.name + '" id="jsxc_dialog">' + data + '</div>'
|
||||
src: src
|
||||
},
|
||||
type: 'inline',
|
||||
modal: opt.noClose,
|
||||
@@ -1947,7 +1967,7 @@ jsxc.gui.dialog = {
|
||||
},
|
||||
|
||||
/**
|
||||
* If no name is provided every dialog will be closed,
|
||||
* If no name is provided every dialog will be closed,
|
||||
* otherwise only dialog with given name is closed.
|
||||
*
|
||||
* @param {string} [name] Close only dialog with the given name
|
||||
@@ -1964,7 +1984,7 @@ jsxc.gui.dialog = {
|
||||
|
||||
/**
|
||||
* Resizes current dialog.
|
||||
*
|
||||
*
|
||||
* @param {Object} options e.g. width and height
|
||||
*/
|
||||
resize: function() {
|
||||
@@ -1974,13 +1994,13 @@ jsxc.gui.dialog = {
|
||||
|
||||
/**
|
||||
* Handle functions related to the gui of the window
|
||||
*
|
||||
*
|
||||
* @namespace jsxc.gui.window
|
||||
*/
|
||||
jsxc.gui.window = {
|
||||
/**
|
||||
* Init a window skeleton
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.gui.window
|
||||
* @param {String} bid
|
||||
* @returns {jQuery} Window object
|
||||
@@ -2171,7 +2191,7 @@ jsxc.gui.window = {
|
||||
|
||||
/**
|
||||
* Resize given window to given size. If no size is provided the window is resized to the default size.
|
||||
*
|
||||
*
|
||||
* @param {(string|jquery)} win Bid or window object
|
||||
* @param {object} ui The size has to be in the format {size:{width: [INT], height: [INT]}}
|
||||
* @param {boolean} [outer] If true the given size is used as outer dimensions.
|
||||
@@ -2241,7 +2261,7 @@ jsxc.gui.window = {
|
||||
|
||||
/**
|
||||
* Returns the window element
|
||||
*
|
||||
*
|
||||
* @param {String} bid
|
||||
* @returns {jquery} jQuery object of the window element
|
||||
*/
|
||||
@@ -2252,7 +2272,7 @@ jsxc.gui.window = {
|
||||
/**
|
||||
* Open a window, related to the bid. If the window doesn't exist, it will be
|
||||
* created.
|
||||
*
|
||||
*
|
||||
* @param {String} bid
|
||||
* @returns {jQuery} Window object
|
||||
*/
|
||||
@@ -2267,7 +2287,7 @@ jsxc.gui.window = {
|
||||
|
||||
/**
|
||||
* Close chatwindow and clean up
|
||||
*
|
||||
*
|
||||
* @param {String} bid bar jid
|
||||
*/
|
||||
close: function(bid) {
|
||||
@@ -2292,7 +2312,7 @@ jsxc.gui.window = {
|
||||
|
||||
/**
|
||||
* Close chatwindow
|
||||
*
|
||||
*
|
||||
* @param {String} bid
|
||||
*/
|
||||
_close: function(bid) {
|
||||
@@ -2302,7 +2322,7 @@ jsxc.gui.window = {
|
||||
|
||||
/**
|
||||
* Toggle between minimize and maximize of the text area
|
||||
*
|
||||
*
|
||||
* @param {String} bid bar jid
|
||||
*/
|
||||
toggle: function(bid) {
|
||||
@@ -2324,7 +2344,7 @@ jsxc.gui.window = {
|
||||
|
||||
/**
|
||||
* Maximize text area and save
|
||||
*
|
||||
*
|
||||
* @param {String} bid
|
||||
*/
|
||||
show: function(bid) {
|
||||
@@ -2336,7 +2356,7 @@ jsxc.gui.window = {
|
||||
|
||||
/**
|
||||
* Maximize text area
|
||||
*
|
||||
*
|
||||
* @param {String} bid
|
||||
* @returns {undefined}
|
||||
*/
|
||||
@@ -2391,7 +2411,7 @@ jsxc.gui.window = {
|
||||
|
||||
/**
|
||||
* Minimize text area and save
|
||||
*
|
||||
*
|
||||
* @param {String} [bid]
|
||||
*/
|
||||
hide: function(bid) {
|
||||
@@ -2416,7 +2436,7 @@ jsxc.gui.window = {
|
||||
|
||||
/**
|
||||
* Minimize text area
|
||||
*
|
||||
*
|
||||
* @param {String} bid
|
||||
*/
|
||||
_hide: function(bid) {
|
||||
@@ -2430,7 +2450,7 @@ jsxc.gui.window = {
|
||||
|
||||
/**
|
||||
* Highlight window
|
||||
*
|
||||
*
|
||||
* @param {type} bid
|
||||
*/
|
||||
highlight: function(bid) {
|
||||
@@ -2445,7 +2465,7 @@ jsxc.gui.window = {
|
||||
|
||||
/**
|
||||
* Scroll chat area to the bottom
|
||||
*
|
||||
*
|
||||
* @param {String} bid bar jid
|
||||
*/
|
||||
scrollDown: function(bid) {
|
||||
@@ -2463,16 +2483,16 @@ jsxc.gui.window = {
|
||||
|
||||
/**
|
||||
* Write Message to chat area and save. Check border cases and remove html.
|
||||
*
|
||||
*
|
||||
* @function postMessage
|
||||
* @memberOf jsxc.gui.window
|
||||
* @param {jsxc.Message} message object to be send
|
||||
* @return {jsxc.Message} maybe modified message object
|
||||
*/
|
||||
/**
|
||||
* Create message object from given properties, write Message to chat area
|
||||
* Create message object from given properties, write Message to chat area
|
||||
* and save. Check border cases and remove html.
|
||||
*
|
||||
*
|
||||
* @function postMessage
|
||||
* @memberOf jsxc.gui.window
|
||||
* @param {object} args New message properties
|
||||
@@ -2540,12 +2560,16 @@ jsxc.gui.window = {
|
||||
|
||||
jsxc.gui.window._postMessage(message);
|
||||
|
||||
if (message.direction === 'out' && message.msg === '?') {
|
||||
jsxc.gui.window.postMessage(new jsxc.Message({
|
||||
bid: message.bid,
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: '42'
|
||||
}));
|
||||
if (message.direction === 'out' && message.msg === '?' && jsxc.options.get('theAnswerToAnything') !== false) {
|
||||
if (typeof jsxc.options.get('theAnswerToAnything') === 'undefined' || (Math.random() * 100 % 42) < 1) {
|
||||
jsxc.options.set('theAnswerToAnything', true);
|
||||
|
||||
jsxc.gui.window.postMessage(new jsxc.Message({
|
||||
bid: message.bid,
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: '42'
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
return message;
|
||||
@@ -2553,7 +2577,7 @@ jsxc.gui.window = {
|
||||
|
||||
/**
|
||||
* Write Message to chat area
|
||||
*
|
||||
*
|
||||
* @param {String} bid bar jid
|
||||
* @param {Object} post Post object with direction, msg, uid, received
|
||||
* @param {Bool} restore If true no highlights are used
|
||||
@@ -2652,7 +2676,7 @@ jsxc.gui.window = {
|
||||
}
|
||||
|
||||
if (direction === 'sys') {
|
||||
jsxc.gui.window.get(bid).find('.jsxc_textarea').append('<div style="clear:both"/>');
|
||||
jsxc.gui.window.get(bid).find('.jsxc_textarea').append('<div class="jsxc_clear"/>');
|
||||
} else if (typeof message.stamp !== 'undefined') {
|
||||
msgDiv.append(msgTsDiv);
|
||||
}
|
||||
@@ -2712,7 +2736,7 @@ jsxc.gui.window = {
|
||||
|
||||
/**
|
||||
* Set text into input area
|
||||
*
|
||||
*
|
||||
* @param {type} bid
|
||||
* @param {type} text
|
||||
* @returns {undefined}
|
||||
@@ -2723,7 +2747,7 @@ jsxc.gui.window = {
|
||||
|
||||
/**
|
||||
* Load old log into chat area
|
||||
*
|
||||
*
|
||||
* @param {type} bid
|
||||
* @returns {undefined}
|
||||
*/
|
||||
@@ -2759,7 +2783,7 @@ jsxc.gui.window = {
|
||||
|
||||
/**
|
||||
* Clear chat history
|
||||
*
|
||||
*
|
||||
* @param {type} bid
|
||||
* @returns {undefined}
|
||||
*/
|
||||
@@ -2784,7 +2808,7 @@ jsxc.gui.window = {
|
||||
|
||||
/**
|
||||
* Mark message as received.
|
||||
*
|
||||
*
|
||||
* @param {string} bid
|
||||
* @param {string} uid message id
|
||||
* @deprecated since v3.0.0. Use {@link jsxc.Message.received}.
|
||||
@@ -3001,7 +3025,7 @@ jsxc.gui.window = {
|
||||
|
||||
}).appendTo(msg);
|
||||
|
||||
$('<button>').text($.t('Abort')).click(function() {
|
||||
$('<button>').addClass('jsxc_btn jsxc_btn-default').text($.t('Abort')).click(function() {
|
||||
jsxc.gui.window.hideOverlay(bid);
|
||||
}).appendTo(msg);
|
||||
});
|
||||
@@ -3012,12 +3036,12 @@ jsxc.gui.template = {};
|
||||
|
||||
/**
|
||||
* Return requested template and replace all placeholder
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.gui.template;
|
||||
* @param {type} name template name
|
||||
* @param {type} bid
|
||||
* @param {type} msg
|
||||
* @returns {String} HTML Template
|
||||
* @returns {jQuery} HTML Template
|
||||
*/
|
||||
jsxc.gui.template.get = function(name, bid, msg) {
|
||||
|
||||
@@ -3055,14 +3079,21 @@ jsxc.gui.template.get = function(name, bid, msg) {
|
||||
// prevent 404
|
||||
ret = ret.replace(/\{\{root\}\}/g, ph.root);
|
||||
|
||||
// convert to string
|
||||
ret = $('<div>').append($(ret).i18n()).html();
|
||||
ret = $(ret);
|
||||
|
||||
// replace placeholders
|
||||
ret = ret.replace(/\{\{([a-zA-Z0-9_\-]+)\}\}/g, function(s, key) {
|
||||
return (typeof ph[key] === 'string') ? ph[key] : s;
|
||||
ret.find('[data-var]').each(function() {
|
||||
var key = $(this).attr('data-var');
|
||||
var val = (typeof ph[key] === 'string') ? ph[key] : '(Unknown placeholder: ' + key + ')';
|
||||
|
||||
if ($(this).prop('tagName').toUpperCase() === 'INPUT') {
|
||||
$(this).val(val);
|
||||
} else {
|
||||
$(this).text(val);
|
||||
}
|
||||
});
|
||||
|
||||
ret.i18n();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
+96
-61
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* JavaScript Xmpp Chat namespace
|
||||
*
|
||||
*
|
||||
* @namespace jsxc
|
||||
*/
|
||||
jsxc = {
|
||||
@@ -14,7 +14,7 @@ jsxc = {
|
||||
role_allocation: false,
|
||||
|
||||
/** Timeout for keepalive */
|
||||
to: null,
|
||||
to: [],
|
||||
|
||||
/** Timeout after normal keepalive starts */
|
||||
toBusy: null,
|
||||
@@ -26,7 +26,7 @@ jsxc = {
|
||||
toNotificationDelay: 500,
|
||||
|
||||
/** Interval for keep-alive */
|
||||
keepalive: null,
|
||||
keepaliveInterval: null,
|
||||
|
||||
/** True if jid, sid and rid was used to connect */
|
||||
reconnect: false,
|
||||
@@ -83,7 +83,7 @@ jsxc = {
|
||||
|
||||
/**
|
||||
* Parse a unix timestamp and return a formatted time string
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc
|
||||
* @param {Object} unixtime
|
||||
* @returns time of day and/or date
|
||||
@@ -112,7 +112,7 @@ jsxc = {
|
||||
|
||||
/**
|
||||
* Write debug message to console and to log.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc
|
||||
* @param {String} msg Debug message
|
||||
* @param {Object} data
|
||||
@@ -141,16 +141,16 @@ jsxc = {
|
||||
}
|
||||
}
|
||||
|
||||
jsxc.log = jsxc.log + msg + ': ' + d + '\n';
|
||||
jsxc.log = jsxc.log + '$ ' + msg + ': ' + d + '\n';
|
||||
} else {
|
||||
console.log(msg);
|
||||
jsxc.log = jsxc.log + msg + '\n';
|
||||
jsxc.log = jsxc.log + '$ ' + msg + '\n';
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Write warn message.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc
|
||||
* @param {String} msg Warn message
|
||||
* @param {Object} data
|
||||
@@ -161,7 +161,7 @@ jsxc = {
|
||||
|
||||
/**
|
||||
* Write error message.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc
|
||||
* @param {String} msg Error message
|
||||
* @param {Object} data
|
||||
@@ -174,10 +174,20 @@ jsxc = {
|
||||
log: '',
|
||||
|
||||
/**
|
||||
* Starts the action
|
||||
*
|
||||
* This function initializes important core functions and event handlers.
|
||||
* Afterwards it performs the following actions in the given order:
|
||||
*
|
||||
* <ol>
|
||||
* <li>If (loginForm.ifFound = 'force' and form was found) or (jid or rid or
|
||||
* sid was not found) intercept form, and listen for credentials.</li>
|
||||
* <li>Attach with jid, rid and sid from storage, if no form was found or
|
||||
* loginForm.ifFound = 'attach'</li>
|
||||
* <li>Attach with jid, rid and sid from options.xmpp, if no form was found or
|
||||
* loginForm.ifFound = 'attach'</li>
|
||||
* </ol>
|
||||
*
|
||||
* @memberOf jsxc
|
||||
* @param {object} options
|
||||
* @param {object} options See {@link jsxc.options}
|
||||
*/
|
||||
init: function(options) {
|
||||
|
||||
@@ -199,7 +209,7 @@ jsxc = {
|
||||
|
||||
/**
|
||||
* Getter method for options. Saved options will override default one.
|
||||
*
|
||||
*
|
||||
* @param {string} key option key
|
||||
* @returns default or saved option value
|
||||
*/
|
||||
@@ -207,7 +217,7 @@ jsxc = {
|
||||
if (jsxc.bid) {
|
||||
var local = jsxc.storage.getUserItem('options') || {};
|
||||
|
||||
return local[key] || jsxc.options[key];
|
||||
return (typeof local[key] !== 'undefined') ? local[key] : jsxc.options[key];
|
||||
}
|
||||
|
||||
return jsxc.options[key];
|
||||
@@ -215,7 +225,7 @@ jsxc = {
|
||||
|
||||
/**
|
||||
* Setter method for options. Will write into localstorage.
|
||||
*
|
||||
*
|
||||
* @param {string} key option key
|
||||
* @param {object} value option value
|
||||
*/
|
||||
@@ -232,6 +242,8 @@ jsxc = {
|
||||
var lang;
|
||||
if (jsxc.storage.getItem('lang') !== null) {
|
||||
lang = jsxc.storage.getItem('lang');
|
||||
} else if (jsxc.options.autoLang && navigator.languages && navigator.languages.length > 0) {
|
||||
lang = navigator.languages[0].substr(0, 2);
|
||||
} else if (jsxc.options.autoLang && navigator.language) {
|
||||
lang = navigator.language.substr(0, 2);
|
||||
} else {
|
||||
@@ -256,29 +268,14 @@ jsxc = {
|
||||
// Register event listener for the storage event
|
||||
window.addEventListener('storage', jsxc.storage.onStorage, false);
|
||||
|
||||
$(document).on('attached.jsxc', function() {
|
||||
// Looking for logout element
|
||||
if (jsxc.options.logoutElement !== null && jsxc.options.logoutElement.length > 0) {
|
||||
var logout = function(ev) {
|
||||
if (!jsxc.xmpp.conn || !jsxc.xmpp.conn.authenticated) {
|
||||
return;
|
||||
}
|
||||
$(document).on('attached.jsxc', jsxc.registerLogout);
|
||||
|
||||
ev.stopPropagation();
|
||||
ev.preventDefault();
|
||||
|
||||
jsxc.options.logoutElement = $(this);
|
||||
jsxc.triggeredFromLogout = true;
|
||||
|
||||
jsxc.xmpp.logout();
|
||||
};
|
||||
|
||||
jsxc.options.logoutElement.off('click', null, logout).one('click', logout);
|
||||
}
|
||||
});
|
||||
var isStorageAttachParameters = jsxc.storage.getItem('rid') && jsxc.storage.getItem('sid') && jsxc.storage.getItem('jid');
|
||||
var isOptionsAttachParameters = jsxc.options.xmpp.rid && jsxc.options.xmpp.sid && jsxc.options.xmpp.jid;
|
||||
var isForceLoginForm = jsxc.options.loginForm && jsxc.options.loginForm.ifFound === 'force' && jsxc.isLoginForm();
|
||||
|
||||
// Check if we have to establish a new connection
|
||||
if (!(jsxc.storage.getItem('rid') && jsxc.storage.getItem('sid') && jsxc.storage.getItem('jid')) || (jsxc.options.loginForm && jsxc.options.loginForm.ifFound === 'force' && jsxc.isLoginForm())) {
|
||||
if ((!isStorageAttachParameters && !isOptionsAttachParameters) || isForceLoginForm) {
|
||||
|
||||
// clean up rid and sid
|
||||
jsxc.storage.removeItem('rid');
|
||||
@@ -343,7 +340,7 @@ jsxc = {
|
||||
|
||||
// Restore old connection
|
||||
|
||||
if (typeof(jsxc.storage.getItem('alive')) === 'undefined') {
|
||||
if (typeof jsxc.storage.getItem('alive') === 'undefined') {
|
||||
jsxc.onMaster();
|
||||
} else {
|
||||
jsxc.checkMaster();
|
||||
@@ -352,9 +349,8 @@ jsxc = {
|
||||
},
|
||||
|
||||
/**
|
||||
* Attach to previous session if jid, sid and rid are available in storage
|
||||
* (default behaviour also for {@link jsxc.init}). Otherwise try to start new session
|
||||
* with given jid and password in jsxc.options.xmpp.
|
||||
* Attach to previous session if jid, sid and rid are available
|
||||
* in storage or options (default behaviour also for {@link jsxc.init}).
|
||||
*
|
||||
* @memberOf jsxc
|
||||
*/
|
||||
@@ -363,6 +359,7 @@ jsxc = {
|
||||
*
|
||||
* @memberOf jsxc
|
||||
* @param {string} jid Jabber Id
|
||||
* @param {string} password Jabber password
|
||||
*/
|
||||
/**
|
||||
* Attach to new chat session with jid, sid and rid.
|
||||
@@ -373,6 +370,8 @@ jsxc = {
|
||||
* @param {string} rid Request Id
|
||||
*/
|
||||
start: function() {
|
||||
var args = arguments;
|
||||
|
||||
if (jsxc.role_allocation && !jsxc.master) {
|
||||
jsxc.debug('There is an other master tab');
|
||||
|
||||
@@ -385,7 +384,7 @@ jsxc = {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (arguments.length === 3) {
|
||||
if (args.length === 3) {
|
||||
$(document).one('attached.jsxc', function() {
|
||||
// save rid after first attachment
|
||||
jsxc.xmpp.onRidChange(jsxc.xmpp.conn._proto.rid);
|
||||
@@ -394,7 +393,28 @@ jsxc = {
|
||||
});
|
||||
}
|
||||
|
||||
jsxc.xmpp.login.apply(this, arguments);
|
||||
jsxc.checkMaster(function() {
|
||||
jsxc.xmpp.login.apply(this, args);
|
||||
});
|
||||
},
|
||||
|
||||
registerLogout: function() {
|
||||
// Looking for logout element
|
||||
if (jsxc.options.logoutElement !== null && $(jsxc.options.logoutElement).length > 0) {
|
||||
var logout = function(ev) {
|
||||
ev.stopPropagation();
|
||||
ev.preventDefault();
|
||||
|
||||
jsxc.options.logoutElement = $(this);
|
||||
jsxc.triggeredFromLogout = true;
|
||||
|
||||
jsxc.xmpp.logout();
|
||||
};
|
||||
|
||||
jsxc.options.logoutElement = $(jsxc.options.logoutElement);
|
||||
|
||||
jsxc.options.logoutElement.off('click', null, logout).one('click', logout);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -409,7 +429,7 @@ jsxc = {
|
||||
|
||||
/**
|
||||
* Load settings and prepare jid.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc
|
||||
* @param {string} username
|
||||
* @param {string} password
|
||||
@@ -444,7 +464,7 @@ jsxc = {
|
||||
|
||||
/**
|
||||
* Process xmpp settings and save loaded settings.
|
||||
*
|
||||
*
|
||||
* @private
|
||||
* @memberOf jsxc
|
||||
* @param {string} username
|
||||
@@ -524,11 +544,15 @@ jsxc = {
|
||||
jsxc.bid = jsxc.jidToBid(jsxc.storage.getItem('jid'));
|
||||
|
||||
jsxc.gui.init();
|
||||
$('#jsxc_roster').removeClass('jsxc_noConnection');
|
||||
|
||||
jsxc.restoreRoster();
|
||||
jsxc.restoreWindows();
|
||||
jsxc.restoreCompleted = true;
|
||||
|
||||
jsxc.registerLogout();
|
||||
jsxc.gui.updateAvatar($('#jsxc_roster > .jsxc_bottom'), jsxc.jidToBid(jsxc.storage.getItem('jid')), 'own');
|
||||
|
||||
$(document).trigger('restoreCompleted.jsxc');
|
||||
},
|
||||
|
||||
@@ -554,12 +578,20 @@ jsxc = {
|
||||
|
||||
/**
|
||||
* Checks if there is a master
|
||||
*
|
||||
* @param {function} [cb] Called if no master was found.
|
||||
*/
|
||||
checkMaster: function() {
|
||||
checkMaster: function(cb) {
|
||||
jsxc.debug('check master');
|
||||
|
||||
jsxc.to = window.setTimeout(jsxc.onMaster, 1000);
|
||||
jsxc.storage.ink('alive');
|
||||
cb = (cb && typeof cb === 'function') ? cb : jsxc.onMaster;
|
||||
|
||||
if (typeof jsxc.storage.getItem('alive') === 'undefined') {
|
||||
cb.call();
|
||||
} else {
|
||||
jsxc.to.push(window.setTimeout(cb, 1000));
|
||||
jsxc.keepAlive('slave');
|
||||
}
|
||||
},
|
||||
|
||||
masterActions: function() {
|
||||
@@ -594,14 +626,17 @@ jsxc = {
|
||||
* Start sending keep-alive signal
|
||||
*/
|
||||
startKeepAlive: function() {
|
||||
jsxc.keepalive = window.setInterval(jsxc.keepAlive, jsxc.options.timeout - 1000);
|
||||
jsxc.keepaliveInterval = window.setInterval(jsxc.keepAlive, jsxc.options.timeout - 1000);
|
||||
},
|
||||
|
||||
/**
|
||||
* Sends the keep-alive signal to signal that the master is still there.
|
||||
*/
|
||||
keepAlive: function() {
|
||||
jsxc.storage.ink('alive');
|
||||
keepAlive: function(role) {
|
||||
var next = parseInt(jsxc.storage.getItem('alive')) + 1;
|
||||
role = role || 'master';
|
||||
|
||||
jsxc.storage.setItem('alive', next + ':' + role);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -613,8 +648,8 @@ jsxc = {
|
||||
window.clearTimeout(jsxc.toBusy);
|
||||
}
|
||||
|
||||
if (jsxc.keepalive) {
|
||||
window.clearInterval(jsxc.keepalive);
|
||||
if (jsxc.keepaliveInterval) {
|
||||
window.clearInterval(jsxc.keepaliveInterval);
|
||||
}
|
||||
|
||||
jsxc.storage.ink('alive_busy');
|
||||
@@ -623,7 +658,7 @@ jsxc = {
|
||||
|
||||
/**
|
||||
* Generates a random integer number between 0 and max
|
||||
*
|
||||
*
|
||||
* @param {Integer} max
|
||||
* @return {Integer} random integer between 0 and max
|
||||
*/
|
||||
@@ -633,7 +668,7 @@ jsxc = {
|
||||
|
||||
/**
|
||||
* Checks if there is a element with the given selector
|
||||
*
|
||||
*
|
||||
* @param {String} selector jQuery selector
|
||||
* @return {Boolean}
|
||||
*/
|
||||
@@ -643,7 +678,7 @@ jsxc = {
|
||||
|
||||
/**
|
||||
* Creates a CSS compatible string from a JID
|
||||
*
|
||||
*
|
||||
* @param {type} jid Valid Jabber ID
|
||||
* @returns {String} css Compatible string
|
||||
*/
|
||||
@@ -657,7 +692,7 @@ jsxc = {
|
||||
|
||||
/**
|
||||
* Create comparable bar jid.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc
|
||||
* @param jid
|
||||
* @returns comparable bar jid
|
||||
@@ -722,7 +757,7 @@ jsxc = {
|
||||
* This method submits the specified login form.
|
||||
*/
|
||||
submitLoginForm: function() {
|
||||
var form = jsxc.options.loginForm.form.off('submit');
|
||||
var form = $(jsxc.options.loginForm.form).off('submit');
|
||||
|
||||
// Attach original events
|
||||
var submits = form.data('submits') || [];
|
||||
@@ -747,7 +782,7 @@ jsxc = {
|
||||
|
||||
/**
|
||||
* Removes all html tags.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc
|
||||
* @param text
|
||||
* @returns stripped text
|
||||
@@ -758,7 +793,7 @@ jsxc = {
|
||||
|
||||
/**
|
||||
* Executes only one of the given events
|
||||
*
|
||||
*
|
||||
* @param {string} obj.key event name
|
||||
* @param {function} obj.value function to execute
|
||||
* @returns {string} namespace of all events
|
||||
@@ -780,7 +815,7 @@ jsxc = {
|
||||
|
||||
/**
|
||||
* Checks if tab is hidden.
|
||||
*
|
||||
*
|
||||
* @returns {boolean} True if tab is hidden
|
||||
*/
|
||||
isHidden: function() {
|
||||
@@ -829,7 +864,7 @@ jsxc = {
|
||||
|
||||
/**
|
||||
* Executes the given function in jsxc namespace.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc
|
||||
* @param {string} fnName Function name
|
||||
* @param {array} fnParams Function parameters
|
||||
@@ -850,7 +885,7 @@ jsxc = {
|
||||
|
||||
/**
|
||||
* Hash string into 32-bit signed integer.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc
|
||||
* @param {string} str input string
|
||||
* @returns {integer} 32-bit signed integer
|
||||
|
||||
+79
-40
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Implements Multi-User Chat (XEP-0045).
|
||||
*
|
||||
*
|
||||
* @namespace jsxc.muc
|
||||
*/
|
||||
jsxc.muc = {
|
||||
@@ -36,7 +36,7 @@ jsxc.muc = {
|
||||
|
||||
/**
|
||||
* Initialize muc plugin.
|
||||
*
|
||||
*
|
||||
* @private
|
||||
* @memberof jsxc.muc
|
||||
* @param {object} o Options
|
||||
@@ -50,7 +50,7 @@ jsxc.muc = {
|
||||
if (!options || typeof options.server !== 'string') {
|
||||
jsxc.debug('Discover muc service');
|
||||
|
||||
// prosody does not response, if we send query before initial presence was send
|
||||
// prosody does not respond, if we send query before initial presence was sent
|
||||
setTimeout(function() {
|
||||
self.conn.disco.items(Strophe.getDomainFromJid(self.conn.jid), null, function(items) {
|
||||
$(items).find('item').each(function() {
|
||||
@@ -99,7 +99,7 @@ jsxc.muc = {
|
||||
|
||||
/**
|
||||
* Add entry to menu.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.muc
|
||||
*/
|
||||
initMenu: function() {
|
||||
@@ -112,7 +112,7 @@ jsxc.muc = {
|
||||
|
||||
/**
|
||||
* Open join dialog.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.muc
|
||||
* @param {string} [r] - room jid
|
||||
* @param {string} [p] - room password
|
||||
@@ -355,7 +355,7 @@ jsxc.muc = {
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
/**
|
||||
* Request and show room configuration.
|
||||
*
|
||||
* @memberOf jsxc.muc
|
||||
@@ -390,10 +390,15 @@ jsxc.muc = {
|
||||
var dialog = jsxc.gui.dialog.open(jsxc.muc.helper.formToHTML(config));
|
||||
var form = dialog.find('form');
|
||||
|
||||
// work around Strophe.x behaviour
|
||||
form.find('[type="checkbox"]').change(function(){
|
||||
$(this).val(this.checked ? 1 : 0);
|
||||
});
|
||||
|
||||
var submit = $('<button>');
|
||||
submit.addClass('btn btn-primary');
|
||||
submit.attr('type', 'submit');
|
||||
submit.text($.t('Join'));
|
||||
submit.text($.t('Save'));
|
||||
|
||||
var cancel = $('<button>');
|
||||
cancel.addClass('btn btn-default');
|
||||
@@ -436,7 +441,7 @@ jsxc.muc = {
|
||||
|
||||
/**
|
||||
* Join the given room.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.muc
|
||||
* @param {string} room Room jid
|
||||
* @param {string} nickname Desired nickname
|
||||
@@ -469,11 +474,16 @@ jsxc.muc = {
|
||||
|
||||
/**
|
||||
* Leave given room.
|
||||
*
|
||||
* @memberOf jsxc.muc
|
||||
*
|
||||
* @memberOf jsxc.muc
|
||||
* @param {string} room Room jid
|
||||
*/
|
||||
leave: function(room) {
|
||||
if (!jsxc.master) {
|
||||
jsxc.tab.execMaster('muc.leave', room);
|
||||
return;
|
||||
}
|
||||
|
||||
var self = jsxc.muc;
|
||||
var own = jsxc.storage.getUserItem('ownNicknames') || {};
|
||||
var data = jsxc.storage.getUserItem('buddy', room) || {};
|
||||
@@ -489,7 +499,7 @@ jsxc.muc = {
|
||||
|
||||
/**
|
||||
* Clean up after we exited a room.
|
||||
*
|
||||
*
|
||||
* @private
|
||||
* @memberOf jsxc.muc
|
||||
* @param {string} room Room jid
|
||||
@@ -517,13 +527,18 @@ jsxc.muc = {
|
||||
|
||||
/**
|
||||
* Destroy the given room.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.muc
|
||||
* @param {string} room Room jid
|
||||
* @param {function} handler_cb Function to handle the successful destruction
|
||||
* @param {function} error_cb Function to handle an error
|
||||
*/
|
||||
destroy: function(room, handler_cb, error_cb) {
|
||||
if (!jsxc.master) {
|
||||
jsxc.tab.execMaster('muc.destroy', room);
|
||||
return;
|
||||
}
|
||||
|
||||
var self = jsxc.muc;
|
||||
var roomdata = jsxc.storage.getUserItem('buddy', room);
|
||||
|
||||
@@ -549,8 +564,8 @@ jsxc.muc = {
|
||||
},
|
||||
|
||||
/**
|
||||
* Close the given room.
|
||||
*
|
||||
* Close the given room.
|
||||
*
|
||||
* @memberOf jsxc.muc
|
||||
* @param room Room jid
|
||||
*/
|
||||
@@ -573,14 +588,16 @@ jsxc.muc = {
|
||||
self.onExited(room);
|
||||
}
|
||||
|
||||
roomdata.state = self.CONST.ROOMSTATE.DESTROYED;
|
||||
if (jsxc.storage.getUserItem('budy', room)) {
|
||||
roomdata.state = self.CONST.ROOMSTATE.DESTROYED;
|
||||
|
||||
jsxc.storage.setUserItem('buddy', room, roomdata);
|
||||
jsxc.storage.setUserItem('buddy', room, roomdata);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Init group chat window.
|
||||
*
|
||||
*
|
||||
* @private
|
||||
* @memberOf jsxc.muc
|
||||
* @param event Event
|
||||
@@ -589,7 +606,7 @@ jsxc.muc = {
|
||||
initWindow: function(event, win) {
|
||||
var self = jsxc.muc;
|
||||
|
||||
if (!jsxc.xmpp.conn) {
|
||||
if (!jsxc.xmpp.conn && jsxc.master) {
|
||||
$(document).one('attached.jsxc', function() {
|
||||
self.initWindow(null, win);
|
||||
});
|
||||
@@ -689,6 +706,18 @@ jsxc.muc = {
|
||||
|
||||
win.find('.jsxc_settings ul').append($('<li>').append(destroy));
|
||||
|
||||
var configure = $('<a>');
|
||||
configure.text($.t('Configure'));
|
||||
configure.addClass('jsxc_configure');
|
||||
configure.hide();
|
||||
configure.click(function() {
|
||||
self.showRoomConfiguration(bid);
|
||||
});
|
||||
|
||||
if (self.conn) {
|
||||
win.find('.jsxc_settings ul').append($('<li>').append(configure));
|
||||
}
|
||||
|
||||
if (roomdata.state > self.CONST.ROOMSTATE.INIT) {
|
||||
var member = jsxc.storage.getUserItem('member', bid) || {};
|
||||
|
||||
@@ -698,6 +727,10 @@ jsxc.muc = {
|
||||
if (nickname === ownNickname && val.affiliation === self.CONST.AFFILIATION.OWNER) {
|
||||
destroy.show();
|
||||
}
|
||||
|
||||
if (nickname === ownNickname && (val.affiliation === self.CONST.AFFILIATION.OWNER || val.affiliation === self.CONST.AFFILIATION.OWNER)) {
|
||||
configure.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -713,7 +746,7 @@ jsxc.muc = {
|
||||
|
||||
/**
|
||||
* Triggered on incoming presence stanzas.
|
||||
*
|
||||
*
|
||||
* @private
|
||||
* @memberOf jsxc.muc
|
||||
* @param event
|
||||
@@ -735,6 +768,7 @@ jsxc.muc = {
|
||||
var nickname = Strophe.unescapeNode(res);
|
||||
var own = jsxc.storage.getUserItem('ownNicknames') || {};
|
||||
var member = jsxc.storage.getUserItem('member', room) || {};
|
||||
var openWindow = false;
|
||||
var codes = [];
|
||||
|
||||
xdata.find('status').each(function() {
|
||||
@@ -759,8 +793,8 @@ jsxc.muc = {
|
||||
}
|
||||
|
||||
if ($('#jsxc_dialog').length > 0) {
|
||||
// User joined the room manually
|
||||
jsxc.gui.window.open(room);
|
||||
// User joined the room manually
|
||||
openWindow = true;
|
||||
jsxc.gui.dialog.close();
|
||||
}
|
||||
}
|
||||
@@ -852,12 +886,17 @@ jsxc.muc = {
|
||||
$(document).trigger('status.muc.jsxc', [code, room, nickname, member[nickname] || {}, presence]);
|
||||
});
|
||||
|
||||
if (openWindow) {
|
||||
// we wait until all parameters are set up correctly (e.g. state)
|
||||
jsxc.gui.window.open(room);
|
||||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
/**
|
||||
* Handle group chat presence errors.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.muc
|
||||
* @param event
|
||||
* @param {string} from Jid
|
||||
@@ -885,7 +924,7 @@ jsxc.muc = {
|
||||
|
||||
/**
|
||||
* Handle status codes. Every function gets room jid, nickname, member data and xdata.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.muc
|
||||
*/
|
||||
onStatus: {
|
||||
@@ -1050,8 +1089,8 @@ jsxc.muc = {
|
||||
});
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Inform user that he or she is beeing removed from the room because the room has been
|
||||
/**
|
||||
* Inform user that he or she is beeing removed from the room because the room has been
|
||||
* changed to members-only and the user is not a member
|
||||
*/
|
||||
322: function(room, nickname) {
|
||||
@@ -1077,7 +1116,7 @@ jsxc.muc = {
|
||||
},
|
||||
/**
|
||||
* Inform user that he or she is beeing removed from the room because the MUC service
|
||||
* is being shut down
|
||||
* is being shut down
|
||||
*/
|
||||
332: function(room) {
|
||||
jsxc.muc.close(room);
|
||||
@@ -1091,7 +1130,7 @@ jsxc.muc = {
|
||||
|
||||
/**
|
||||
* Extract reason from xdata and if available post it to room.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.muc
|
||||
* @param {string} room Room jid
|
||||
* @param {jQuery} xdata Xdata
|
||||
@@ -1125,16 +1164,16 @@ jsxc.muc = {
|
||||
|
||||
/**
|
||||
* Insert member to room member list.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.muc
|
||||
* @param {string} room Room jid
|
||||
* @param {string} nickname Nickname
|
||||
* @param {string} memberdata Member data
|
||||
*/
|
||||
insertMember: function(room, nickname, memberdata) {
|
||||
var self = jsxc.muc;
|
||||
var win = jsxc.gui.window.get(room);
|
||||
var jid = memberdata.jid;
|
||||
var ownBid = jsxc.jidToBid(jsxc.storage.getItem('jid'));
|
||||
var m = win.find('.jsxc_memberlist li[data-nickname="' + nickname + '"]');
|
||||
|
||||
if (m.length === 0) {
|
||||
@@ -1154,7 +1193,7 @@ jsxc.muc = {
|
||||
|
||||
if (data !== null && typeof data === 'object') {
|
||||
jsxc.gui.updateAvatar(m, jsxc.jidToBid(jid), data.avatar);
|
||||
} else if (jsxc.jidToBid(jid) === jsxc.jidToBid(self.conn.jid)) {
|
||||
} else if (jsxc.jidToBid(jid) === ownBid) {
|
||||
jsxc.gui.updateAvatar(m, jsxc.jidToBid(jid), 'own');
|
||||
}
|
||||
} else {
|
||||
@@ -1169,7 +1208,7 @@ jsxc.muc = {
|
||||
|
||||
/**
|
||||
* Remove member from room member list.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.muc
|
||||
* @param {string} room Room jid
|
||||
* @param {string} nickname Nickname
|
||||
@@ -1185,7 +1224,7 @@ jsxc.muc = {
|
||||
|
||||
/**
|
||||
* Scroll or update member list position.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.muc
|
||||
* @param {string} room Room jid
|
||||
* @param {integer} offset =0: update position; >0: Scroll to left; <0: Scroll to right
|
||||
@@ -1215,7 +1254,7 @@ jsxc.muc = {
|
||||
|
||||
/**
|
||||
* Empty member list.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.muc
|
||||
* @param {string} room Room jid
|
||||
*/
|
||||
@@ -1229,7 +1268,7 @@ jsxc.muc = {
|
||||
|
||||
/**
|
||||
* Handle incoming group chat message.
|
||||
*
|
||||
*
|
||||
* @private
|
||||
* @memberOf jsxc.muc
|
||||
* @param {string} message Message stanza
|
||||
@@ -1238,7 +1277,7 @@ jsxc.muc = {
|
||||
onGroupchatMessage: function(message) {
|
||||
var id = $(message).attr('id');
|
||||
|
||||
if (jsxc.el_exists(jsxc.Message.getDOM(id))) {
|
||||
if (id && jsxc.el_exists(jsxc.Message.getDOM(id))) {
|
||||
// ignore own incoming messages
|
||||
return true;
|
||||
}
|
||||
@@ -1297,7 +1336,7 @@ jsxc.muc = {
|
||||
|
||||
/**
|
||||
* Handle group chat error message.
|
||||
*
|
||||
*
|
||||
* @private
|
||||
* @memberOf jsxc.muc
|
||||
* @param {string} message Message stanza
|
||||
@@ -1342,7 +1381,7 @@ jsxc.muc = {
|
||||
|
||||
/**
|
||||
* Prepare group chat roster item.
|
||||
*
|
||||
*
|
||||
* @private
|
||||
* @memberOf jsxc.muc
|
||||
* @param event
|
||||
@@ -1403,13 +1442,13 @@ jsxc.muc = {
|
||||
|
||||
/**
|
||||
* Some helper functions.
|
||||
*
|
||||
*
|
||||
* @type {Object}
|
||||
*/
|
||||
helper: {
|
||||
/**
|
||||
* Convert x:data form to html.
|
||||
*
|
||||
*
|
||||
* @param {Strophe.x.Form} form - x:data form
|
||||
* @return {jQuery} jQuery representation of x:data field
|
||||
*/
|
||||
@@ -1443,7 +1482,7 @@ jsxc.muc = {
|
||||
|
||||
/**
|
||||
* Convert x:data field to html.
|
||||
*
|
||||
*
|
||||
* @param {Strophe.x.Field} field - x:data field
|
||||
* @return {html} html representation of x:data field
|
||||
*/
|
||||
|
||||
@@ -37,6 +37,12 @@ jsxc.options = {
|
||||
/** XMPP password */
|
||||
password: null,
|
||||
|
||||
/** session id */
|
||||
sid: null,
|
||||
|
||||
/** request id */
|
||||
rid: null,
|
||||
|
||||
/** True: Allow user to overwrite xmpp settings */
|
||||
overwrite: false,
|
||||
|
||||
@@ -53,6 +59,15 @@ jsxc.options = {
|
||||
dnd: 0
|
||||
},
|
||||
|
||||
/**
|
||||
* This function is called if a login form was found, but before any
|
||||
* modification is done to it.
|
||||
*
|
||||
* @memberOf jsxc.options
|
||||
* @function
|
||||
*/
|
||||
formFound: null,
|
||||
|
||||
/** If all 3 properties are set and enable is true, the login form is used */
|
||||
loginForm: {
|
||||
/** False, disables login through login form */
|
||||
@@ -104,7 +119,7 @@ jsxc.options = {
|
||||
* - Force new connection with loginForm.jid and loginForm.passed
|
||||
* - Pause connection and do nothing
|
||||
*
|
||||
* @type {('attach', 'force', 'pause')}
|
||||
* @type {(attach|force|pause)}
|
||||
*/
|
||||
ifFound: 'attach',
|
||||
|
||||
@@ -185,10 +200,10 @@ jsxc.options = {
|
||||
*
|
||||
* @memberOf jsxc.options
|
||||
* @param data Holds all data as key/value
|
||||
* @returns {boolean} false if function failes
|
||||
* @param cb Called with true on success, false otherwise
|
||||
*/
|
||||
saveSettinsPermanent: function() {
|
||||
|
||||
saveSettinsPermanent: function(data, cb) {
|
||||
cb(true);
|
||||
},
|
||||
|
||||
carbons: {
|
||||
|
||||
+62
-43
@@ -1,12 +1,12 @@
|
||||
/**
|
||||
* Handle long-live data
|
||||
*
|
||||
*
|
||||
* @namespace jsxc.storage
|
||||
*/
|
||||
jsxc.storage = {
|
||||
/**
|
||||
* Prefix for localstorage
|
||||
*
|
||||
*
|
||||
* @privat
|
||||
*/
|
||||
PREFIX: 'jsxc',
|
||||
@@ -30,7 +30,7 @@ jsxc.storage = {
|
||||
|
||||
/**
|
||||
* Save item to storage
|
||||
*
|
||||
*
|
||||
* @function
|
||||
* @param {String} key variablename
|
||||
* @param {Object} value value
|
||||
@@ -81,7 +81,7 @@ jsxc.storage = {
|
||||
|
||||
/**
|
||||
* Load item from storage
|
||||
*
|
||||
*
|
||||
* @function
|
||||
* @param {String} key variablename
|
||||
* @param {String} uk Userkey? Should we add the bid as prefix?
|
||||
@@ -99,7 +99,7 @@ jsxc.storage = {
|
||||
|
||||
/**
|
||||
* Get a user item from storage.
|
||||
*
|
||||
*
|
||||
* @param key
|
||||
* @returns user item
|
||||
*/
|
||||
@@ -117,14 +117,14 @@ jsxc.storage = {
|
||||
|
||||
/**
|
||||
* Remove item from storage
|
||||
*
|
||||
*
|
||||
* @function
|
||||
* @param {String} key variablename
|
||||
* @param {String} uk Userkey? Should we add the bid as prefix?
|
||||
*/
|
||||
removeItem: function(key, uk) {
|
||||
|
||||
// Workaround for non-conform browser
|
||||
// Workaround for non-conforming browser
|
||||
if (jsxc.storageNotConform && key !== 'rid') {
|
||||
jsxc.ls.push(JSON.stringify({
|
||||
key: jsxc.storage.prefix + key,
|
||||
@@ -137,7 +137,7 @@ jsxc.storage = {
|
||||
|
||||
/**
|
||||
* Remove user item from storage.
|
||||
*
|
||||
*
|
||||
* @param key
|
||||
*/
|
||||
removeUserItem: function(type, key) {
|
||||
@@ -154,7 +154,7 @@ jsxc.storage = {
|
||||
|
||||
/**
|
||||
* Updates value of a variable in a saved object.
|
||||
*
|
||||
*
|
||||
* @function
|
||||
* @param {String} key variablename
|
||||
* @param {String|object} variable variablename in object or object with
|
||||
@@ -188,11 +188,12 @@ jsxc.storage = {
|
||||
|
||||
/**
|
||||
* Updates value of a variable in a saved user object.
|
||||
*
|
||||
* @param {String} key variablename
|
||||
* @param {String|object} variable variablename in object or object with
|
||||
*
|
||||
* @param {String} type variable type (a prefix)
|
||||
* @param {String} key variable name
|
||||
* @param {String|object} variable variable name in object or object with
|
||||
* variable/key pairs
|
||||
* @param {Object} [value] value
|
||||
* @param {Object} [value] value (not used if the variable was an object)
|
||||
*/
|
||||
updateUserItem: function(type, key, variable, value) {
|
||||
var self = jsxc.storage;
|
||||
@@ -209,8 +210,8 @@ jsxc.storage = {
|
||||
},
|
||||
|
||||
/**
|
||||
* Inkrements value
|
||||
*
|
||||
* Increments value
|
||||
*
|
||||
* @function
|
||||
* @param {String} key variablename
|
||||
* @param {String} uk Userkey? Should we add the bid as prefix?
|
||||
@@ -222,7 +223,7 @@ jsxc.storage = {
|
||||
|
||||
/**
|
||||
* Remove element from array or object
|
||||
*
|
||||
*
|
||||
* @param {string} key name of array or object
|
||||
* @param {string} name name of element in array or object
|
||||
* @param {String} uk Userkey? Should we add the bid as prefix?
|
||||
@@ -257,10 +258,10 @@ jsxc.storage = {
|
||||
|
||||
/**
|
||||
* Triggered if changes are recognized
|
||||
*
|
||||
*
|
||||
* @function
|
||||
* @param {event} e Storageevent
|
||||
* @param {String} e.key Keyname which triggered event
|
||||
* @param {event} e Storage event
|
||||
* @param {String} e.key Key name which triggered event
|
||||
* @param {Object} e.oldValue Old Value for key
|
||||
* @param {Object} e.newValue New Value for key
|
||||
* @param {String} e.url
|
||||
@@ -268,14 +269,15 @@ jsxc.storage = {
|
||||
onStorage: function(e) {
|
||||
|
||||
// skip
|
||||
if (e.key === jsxc.storage.PREFIX + jsxc.storage.SEP + 'rid') {
|
||||
if (e.key === jsxc.storage.PREFIX + jsxc.storage.SEP + 'rid' || !e.key) {
|
||||
return;
|
||||
}
|
||||
|
||||
var re = new RegExp('^' + jsxc.storage.PREFIX + jsxc.storage.SEP + '(?:[^' + jsxc.storage.SEP + ']+@[^' + jsxc.storage.SEP + ']+' + jsxc.storage.SEP + ')?(.*)', 'i');
|
||||
var key = e.key.replace(re, '$1');
|
||||
|
||||
// Workaround for non-conform browser: Triggered event on every page
|
||||
// Workaround for non-conforming browser, which trigger
|
||||
// events on every page (notably IE): Ignore own writes
|
||||
// (own)
|
||||
if (jsxc.storageNotConform > 0 && jsxc.ls.length > 0) {
|
||||
|
||||
@@ -303,7 +305,7 @@ jsxc.storage = {
|
||||
}
|
||||
}
|
||||
|
||||
// Workaround for non-conform browser
|
||||
// Workaround for non-conforming browser
|
||||
if (e.oldValue === e.newValue) {
|
||||
return;
|
||||
}
|
||||
@@ -311,20 +313,35 @@ jsxc.storage = {
|
||||
var n, o;
|
||||
var bid = key.replace(new RegExp('[^' + jsxc.storage.SEP + ']+' + jsxc.storage.SEP + '(.*)', 'i'), '$1');
|
||||
|
||||
// react if someone ask, if there is a master
|
||||
// react if someone asks whether there is a master
|
||||
if (jsxc.master && key === 'alive') {
|
||||
jsxc.debug('Master request.');
|
||||
|
||||
jsxc.storage.ink('alive');
|
||||
if (e.newValue && e.newValue.match(/:master$/)) {
|
||||
jsxc.warn('Master request from master. Something went wrong... :-(');
|
||||
return;
|
||||
}
|
||||
|
||||
jsxc.keepAlive();
|
||||
return;
|
||||
}
|
||||
|
||||
// master alive
|
||||
if (!jsxc.master && (key === 'alive' || key === 'alive_busy') && !jsxc.triggeredFromElement) {
|
||||
if (!jsxc.master && (key === 'alive' || key === 'alive_busy')) {
|
||||
|
||||
// reset timeout
|
||||
window.clearTimeout(jsxc.to);
|
||||
jsxc.to = window.setTimeout(jsxc.checkMaster, ((key === 'alive') ? jsxc.options.timeout : jsxc.options.busyTimeout) + jsxc.random(60));
|
||||
// reset timeouts
|
||||
jsxc.to = $.grep(jsxc.to, function(timeout) {
|
||||
window.clearTimeout(timeout);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
if (typeof e.newValue === 'undefined' || e.newValue === null) {
|
||||
jsxc.xmpp.disconnected();
|
||||
return;
|
||||
}
|
||||
|
||||
jsxc.to.push(window.setTimeout(jsxc.checkMaster, ((key === 'alive') ? jsxc.options.timeout : jsxc.options.busyTimeout) + jsxc.random(60)));
|
||||
|
||||
// only call the first time
|
||||
if (!jsxc.role_allocation) {
|
||||
@@ -334,6 +351,10 @@ jsxc.storage = {
|
||||
return;
|
||||
}
|
||||
|
||||
if (jsxc.master && key === 'sid' && !e.newValue) {
|
||||
jsxc.xmpp.logout(false);
|
||||
}
|
||||
|
||||
if (key.match(/^notices/)) {
|
||||
jsxc.notice.load();
|
||||
}
|
||||
@@ -466,7 +487,7 @@ jsxc.storage = {
|
||||
jsxc.gui.roster.purge(bid);
|
||||
return;
|
||||
}
|
||||
if (!e.oldValue) {
|
||||
if (jsxc.gui.roster.getItem(bid).length === 0) {
|
||||
jsxc.gui.roster.add(bid);
|
||||
return;
|
||||
}
|
||||
@@ -509,19 +530,6 @@ jsxc.storage = {
|
||||
}
|
||||
}
|
||||
|
||||
// logout
|
||||
if (key === 'sid') {
|
||||
if (!e.newValue) {
|
||||
// if (jsxc.master && jsxc.xmpp.conn) {
|
||||
// jsxc.xmpp.conn.disconnect();
|
||||
// jsxc.triggeredFromElement = true;
|
||||
// }
|
||||
jsxc.xmpp.logout();
|
||||
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (key === 'friendReq') {
|
||||
n = JSON.parse(e.newValue);
|
||||
|
||||
@@ -563,11 +571,22 @@ jsxc.storage = {
|
||||
|
||||
jsxc.storage.removeUserItem('vcard', bid);
|
||||
}
|
||||
|
||||
if (key === '_cmd' && e.newValue) {
|
||||
n = JSON.parse(e.newValue) || {};
|
||||
jsxc.storage.removeUserItem('_cmd');
|
||||
|
||||
if (n.cmd && n.target === jsxc.tab.CONST[jsxc.master ? 'MASTER' : 'SLAVE']) {
|
||||
jsxc.debug('Execute tab cmd: ' + n.cmd);
|
||||
|
||||
jsxc.exec(n.cmd, n.params);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Save or update buddy data.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.storage
|
||||
* @param bid
|
||||
* @param data
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* Provides communication between tabs.
|
||||
*
|
||||
* @namespace jsxc.tab
|
||||
*/
|
||||
jsxc.tab = {
|
||||
CONST: {
|
||||
MASTER: 'master',
|
||||
SLAVE: 'slave'
|
||||
},
|
||||
|
||||
exec: function(target, cmd, params) {
|
||||
|
||||
params = Array.prototype.slice.call(arguments, 2);
|
||||
if (params.length === 1 && $.isArray(params[0])) {
|
||||
params = params[0];
|
||||
}
|
||||
|
||||
if (target === jsxc.tab.CONST[jsxc.master ? 'MASTER' : 'SLAVE']) {
|
||||
jsxc.exec(cmd, params);
|
||||
|
||||
if (jsxc.master) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
jsxc.storage.setUserItem('_cmd', {
|
||||
target: target,
|
||||
cmd: cmd,
|
||||
params: params,
|
||||
rnd: Math.random() // force storage event
|
||||
});
|
||||
},
|
||||
|
||||
/*jshint -W098 */
|
||||
execMaster: function(cmd, params) {
|
||||
var args = Array.prototype.slice.call(arguments);
|
||||
args.unshift(jsxc.tab.CONST.MASTER);
|
||||
|
||||
jsxc.tab.exec.apply(this, args);
|
||||
},
|
||||
execSlave: function(cmd, params) {
|
||||
var args = Array.prototype.slice.call(arguments);
|
||||
args.unshift(jsxc.tab.CONST.SLAVE);
|
||||
|
||||
jsxc.tab.exec.apply(this, args);
|
||||
}
|
||||
/*jshint +W098 */
|
||||
};
|
||||
+25
-19
@@ -463,7 +463,6 @@ jsxc.webrtc = {
|
||||
dialog.find('.jsxc_localvideo').show();
|
||||
}
|
||||
|
||||
$(document).one('cleanup.dialog.jsxc', $.proxy(self.hangUp, self));
|
||||
$(document).trigger('finish.mediaready.jsxc');
|
||||
},
|
||||
|
||||
@@ -559,16 +558,7 @@ jsxc.webrtc = {
|
||||
|
||||
jsxc.webrtc.last_caller = session.peerID;
|
||||
|
||||
if (jsxc.webrtc.AUTO_ACCEPT) {
|
||||
self.reqUserMedia();
|
||||
return;
|
||||
}
|
||||
|
||||
var dialog = jsxc.gui.dialog.open(jsxc.gui.template.get('incomingCall', bid), {
|
||||
noClose: true
|
||||
});
|
||||
|
||||
dialog.find('.jsxc_accept').click(function() {
|
||||
function acceptCall() {
|
||||
$(document).trigger('accept.call.jsxc');
|
||||
|
||||
jsxc.switchEvents({
|
||||
@@ -585,8 +575,19 @@ jsxc.webrtc = {
|
||||
});
|
||||
|
||||
self.reqUserMedia();
|
||||
}
|
||||
|
||||
if (jsxc.webrtc.AUTO_ACCEPT) {
|
||||
acceptCall();
|
||||
return;
|
||||
}
|
||||
|
||||
var dialog = jsxc.gui.dialog.open(jsxc.gui.template.get('incomingCall', bid), {
|
||||
noClose: true
|
||||
});
|
||||
|
||||
dialog.find('.jsxc_accept').click(acceptCall);
|
||||
|
||||
dialog.find('.jsxc_reject').click(function() {
|
||||
jsxc.gui.dialog.close();
|
||||
$(document).trigger('reject.call.jsxc');
|
||||
@@ -615,12 +616,19 @@ jsxc.webrtc = {
|
||||
* @param [text] Optional explanation
|
||||
*/
|
||||
onCallTerminated: function(session, reason) {
|
||||
this.setStatus('call terminated ' + session.peerID + (reason ? reason.condition : ''));
|
||||
this.setStatus('call terminated ' + session.peerID + (reason && reason.condition ? reason.condition : ''));
|
||||
|
||||
var bid = jsxc.jidToBid(session.peerID);
|
||||
|
||||
if (this.localStream) {
|
||||
this.localStream.stop();
|
||||
if (typeof this.localStream.stop === 'function') {
|
||||
this.localStream.stop();
|
||||
} else {
|
||||
var tracks = this.localStream.getTracks();
|
||||
tracks.forEach(function(track) {
|
||||
track.stop();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if ($('.jsxc_videoContainer').length) {
|
||||
@@ -639,7 +647,7 @@ jsxc.webrtc = {
|
||||
jsxc.gui.window.postMessage({
|
||||
bid: bid,
|
||||
direction: jsxc.Message.SYS,
|
||||
msg: ($.t('Call_terminated') + (reason ? (': ' + $.t('jingle_reason_' + reason.condition)) : '') + '.')
|
||||
msg: ($.t('Call_terminated') + (reason && reason.condition ? (': ' + $.t('jingle_reason_' + reason.condition)) : '') + '.')
|
||||
});
|
||||
},
|
||||
|
||||
@@ -770,7 +778,7 @@ jsxc.webrtc = {
|
||||
});
|
||||
|
||||
$(document).one('error.jingle', function(e, sid, error) {
|
||||
if (error.source !== 'offer') {
|
||||
if (error && error.source !== 'offer') {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1094,10 +1102,8 @@ jsxc.gui.showVideoWindow = function(jid) {
|
||||
}
|
||||
});
|
||||
|
||||
$('#jsxc_webrtc .jsxc_videoContainer').toggle(function() {
|
||||
$('#jsxc_webrtc .jsxc_controlbar').css('opacity', '1.0');
|
||||
}, function() {
|
||||
$('#jsxc_webrtc .jsxc_controlbar').css('opacity', '');
|
||||
$('#jsxc_webrtc .jsxc_videoContainer').click(function() {
|
||||
$('#jsxc_webrtc .jsxc_controlbar').toggleClass('jsxc_visible');
|
||||
});
|
||||
|
||||
return $('#jsxc_webrtc');
|
||||
|
||||
+26
-17
@@ -11,6 +11,7 @@ jsxc.xmpp = {
|
||||
*
|
||||
* @name login
|
||||
* @memberOf jsxc.xmpp
|
||||
* @private
|
||||
*/
|
||||
/**
|
||||
* Create new connection with given parameters.
|
||||
@@ -19,6 +20,7 @@ jsxc.xmpp = {
|
||||
* @param {string} jid
|
||||
* @param {string} password
|
||||
* @memberOf jsxc.xmpp
|
||||
* @private
|
||||
*/
|
||||
/**
|
||||
* Attach connection with given parameters.
|
||||
@@ -28,10 +30,12 @@ jsxc.xmpp = {
|
||||
* @param {string} sid
|
||||
* @param {string} rid
|
||||
* @memberOf jsxc.xmpp
|
||||
* @private
|
||||
*/
|
||||
login: function() {
|
||||
|
||||
if (jsxc.xmpp.conn && jsxc.xmpp.conn.authenticated) {
|
||||
jsxc.debug('Connection already authenticated.');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -57,8 +61,8 @@ jsxc.xmpp = {
|
||||
if (sid !== null && rid !== null) {
|
||||
jid = jsxc.storage.getItem('jid');
|
||||
} else {
|
||||
sid = null;
|
||||
rid = null;
|
||||
sid = jsxc.options.xmpp.sid || null;
|
||||
rid = jsxc.options.xmpp.rid || null;
|
||||
jid = jsxc.options.xmpp.jid;
|
||||
}
|
||||
}
|
||||
@@ -178,28 +182,28 @@ jsxc.xmpp = {
|
||||
*/
|
||||
logout: function(complete) {
|
||||
|
||||
// instruct all tabs
|
||||
jsxc.storage.removeItem('sid');
|
||||
jsxc.triggeredFromElement = (typeof complete === 'boolean') ? complete : true;
|
||||
|
||||
if (!jsxc.master) {
|
||||
// instruct master
|
||||
jsxc.storage.removeItem('sid');
|
||||
|
||||
// jsxc.xmpp.disconnected is called if master deletes alive after logout
|
||||
return true;
|
||||
}
|
||||
|
||||
// REVIEW: this should maybe moved to xmpp.disconnected
|
||||
// clean up
|
||||
jsxc.storage.removeUserItem('buddylist');
|
||||
jsxc.storage.removeUserItem('windowlist');
|
||||
jsxc.storage.removeUserItem('unreadMsg');
|
||||
|
||||
if (!jsxc.master) {
|
||||
$('#jsxc_roster').remove();
|
||||
$('#jsxc_windowlist').remove();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (jsxc.xmpp.conn === null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Hide dropdown menu
|
||||
$('body').click();
|
||||
|
||||
jsxc.triggeredFromElement = (typeof complete === 'boolean') ? complete : true;
|
||||
if (!jsxc.xmpp.conn || !jsxc.xmpp.conn.authenticated) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// restore all otr objects
|
||||
$.each(jsxc.storage.getUserItem('otrlist') || {}, function(i, val) {
|
||||
@@ -440,6 +444,7 @@ jsxc.xmpp = {
|
||||
$(document).trigger('toggle.roster.jsxc', ['hidden', 0]);
|
||||
$('#jsxc_roster').remove();
|
||||
|
||||
// REVIEW: logoutElement without href attribute?
|
||||
if (jsxc.triggeredFromLogout) {
|
||||
window.location = jsxc.options.logoutElement.attr('href');
|
||||
}
|
||||
@@ -447,7 +452,10 @@ jsxc.xmpp = {
|
||||
jsxc.gui.roster.noConnection();
|
||||
}
|
||||
|
||||
window.clearInterval(jsxc.keepalive);
|
||||
window.clearInterval(jsxc.keepaliveInterval);
|
||||
jsxc.role_allocation = false;
|
||||
jsxc.master = false;
|
||||
jsxc.storage.removeItem('alive');
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -517,7 +525,8 @@ jsxc.xmpp = {
|
||||
name: name,
|
||||
status: 0,
|
||||
sub: sub,
|
||||
res: []
|
||||
res: [],
|
||||
rnd: Math.random() // force storage event
|
||||
});
|
||||
|
||||
jsxc.gui.roster.add(bid);
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<h3>JavaScript XMPP Chat</h3>
|
||||
<p>
|
||||
<b>Version: </b>{{version}}
|
||||
<b>Version: </b><span data-var="version" />
|
||||
<br /> <a href="http://jsxc.org/" target="_blank">www.jsxc.org</a>
|
||||
</p>
|
||||
<p>
|
||||
<i>Released under the MIT license</i>
|
||||
</p>
|
||||
<p>
|
||||
Real-time chat app for {{app_name}} and more.
|
||||
Real-time chat app for <span data-var="app_name" /> and more.
|
||||
<br /> Requires an external <a href="https://xmpp.org/xmpp-software/servers/" target="_blank">XMPP server</a>.
|
||||
</p>
|
||||
<p class="jsxc_credits">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<h3 data-i18n="Alert"></h3>
|
||||
<div class="alert alert-info">
|
||||
<strong data-i18n="Info"></strong> {{msg}}
|
||||
<strong data-i18n="Info"></strong> <span data-var="msg" />
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<h3 data-i18n="Subscription_request"></h3>
|
||||
<p>
|
||||
<span data-i18n="You_have_a_request_from"></span><b class="jsxc_their_jid"></b>.
|
||||
<span data-i18n="You_have_a_request_from"></span> <b class="jsxc_their_jid"></b>.
|
||||
</p>
|
||||
|
||||
<button class="btn btn-primary jsxc_approve pull-right" data-i18n="Approve"></button>
|
||||
|
||||
@@ -10,22 +10,22 @@
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<div style="display: none">
|
||||
<div class="jsxc_hidden">
|
||||
<p data-i18n="To_verify_the_fingerprint_" class="jsxc_explanation"></p>
|
||||
<p>
|
||||
<strong data-i18n="Your_fingerprint"></strong>
|
||||
<br /> <span style="text-transform: uppercase">{{my_priv_fingerprint}}</span>
|
||||
<br /> <span class="jsxc_uppercase"><span data-var="my_priv_fingerprint"/></span>
|
||||
</p>
|
||||
<p>
|
||||
<strong data-i18n="Buddy_fingerprint"></strong>
|
||||
<br /> <span style="text-transform: uppercase">{{bid_priv_fingerprint}}</span>
|
||||
<br /> <span class="jsxc_uppercase"><span data-var="bid_priv_fingerprint"/></span>
|
||||
</p>
|
||||
<div class="jsxc_right">
|
||||
<button class="btn btn-default jsxc_close" data-i18n="Close"></button>
|
||||
<button class="btn btn-primary jsxc_submit" data-i18n="Compared"></button>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: none" class="form-horizontal">
|
||||
<div class="form-horizontal jsxc_hidden">
|
||||
<p data-i18n="To_authenticate_using_a_question_" class="jsxc_explanation"></p>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" for="jsxc_quest" data-i18n="Question"></label>
|
||||
@@ -46,7 +46,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: none" class="form-horizontal">
|
||||
<div class="form-horizontal jsxc_hidden">
|
||||
<p class="jsxc_explanation" data-i18n="To_authenticate_pick_a_secret_"></p>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" for="jsxc_secret" data-i18n="Secret"></label>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<div class="jsxc_emoticons">
|
||||
<div class="jsxc_inner">
|
||||
<ul>
|
||||
<li style="clear:both"></li>
|
||||
<li class="jsxc_clear"></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<p>{{msg}}</p>
|
||||
<p data-var="msg"></p>
|
||||
|
||||
<button class="btn btn-primary jsxc_confirm pull-right" data-i18n="Confirm"></button>
|
||||
<button class="btn btn-default jsxc_dismiss jsxc_close pull-right" data-i18n="Dismiss"></button>
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
<p class="jsxc_maxWidth" data-i18n="A_fingerprint_"></p>
|
||||
<p>
|
||||
<strong data-i18n="Your_fingerprint"></strong>
|
||||
<br /> <span style="text-transform: uppercase">{{my_priv_fingerprint}}</span>
|
||||
<br /> <span class="jsxc_uppercase" data-var="my_priv_fingerprint"></span>
|
||||
</p>
|
||||
<p>
|
||||
<strong data-i18n="Buddy_fingerprint"></strong>
|
||||
<br /> <span style="text-transform: uppercase">{{bid_priv_fingerprint}}</span>
|
||||
<br /> <span class="jsxc_uppercase" data-var="bid_priv_fingerprint"></span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<h3 data-i18n="Incoming_call"></h3>
|
||||
<p>
|
||||
<span data-i18n="Do_you_want_to_accept_the_call_from"></span> {{bid_name}}?
|
||||
<span data-i18n="Do_you_want_to_accept_the_call_from"></span> <span data-var="bid_name" />?
|
||||
</p>
|
||||
|
||||
<button class="btn btn-primary jsxc_accept pull-right" data-i18n="Accept"></button>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label" for="jsxc_username" data-i18n="Username"></label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" name="username" id="jsxc_username" class="form-control" required="required" value="{{my_node}}" />
|
||||
<input type="text" name="username" id="jsxc_username" class="form-control" required="required" data-var="my_node" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
Alguns arquivos não foram exibidos porque demasiados arquivos foram alterados neste diff Mostrar Mais
Referência em uma Nova Issue
Bloquear um usuário