mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-05 10:49:36 +02:00
FIx
This commit is contained in:
parent
d2b03a1011
commit
75bd236da6
4 changed files with 38 additions and 33 deletions
|
@ -90,9 +90,9 @@ function defaultCallback(json) {
|
|||
|
||||
function parseSocketResponse(json) {
|
||||
console.log("parseSocketResponse", json);
|
||||
if(json.isAdmin && webSocketServerVersion>json.webSocketServerVersion){
|
||||
if(typeof avideoToastWarning == 'funciton'){
|
||||
avideoToastWarning("Please restart your socket server. You are running (v"+json.webSocketServerVersion+") and your client is expecting (v"+webSocketServerVersion+")");
|
||||
if (json.isAdmin && webSocketServerVersion > json.webSocketServerVersion) {
|
||||
if (typeof avideoToastWarning == 'funciton') {
|
||||
avideoToastWarning("Please restart your socket server. You are running (v" + json.webSocketServerVersion + ") and your client is expecting (v" + webSocketServerVersion + ")");
|
||||
}
|
||||
}
|
||||
if (json && typeof json.autoUpdateOnHTML !== 'undefined') {
|
||||
|
@ -105,7 +105,7 @@ function parseSocketResponse(json) {
|
|||
}
|
||||
var val = json.autoUpdateOnHTML[prop];
|
||||
$('.' + prop).text(val);
|
||||
if(parseInt(val)>0){
|
||||
if (parseInt(val) > 0) {
|
||||
$('.' + prop).parent().addClass('text-success');
|
||||
}
|
||||
}
|
||||
|
@ -136,32 +136,32 @@ function parseSocketResponse(json) {
|
|||
if (json.users_uri[prop][prop2][prop3] === false || typeof json.users_uri[prop][prop2][prop3] !== 'object') {
|
||||
continue;
|
||||
}
|
||||
|
||||
var socketUserDivID = 'socketUser'+json.users_uri[prop][prop2][prop3].users_id;
|
||||
|
||||
if(!$('#'+socketUserDivID).length){
|
||||
var html = '<div class="socketUserDiv" id="'+socketUserDivID+'" >';
|
||||
html += '<div class="socketUserName" onclick="socketUserNameToggle(\'#'+socketUserDivID+'\');">';
|
||||
html += '<i class="fas fa-caret-down"></i><i class="fas fa-caret-up"></i> <img src="'+webSiteRootURL+'user/' + json.users_uri[prop][prop2][prop3].users_id + '/foto.png" class="img img-circle img-responsive">' + json.users_uri[prop][prop2][prop3].user_name + '</div>';
|
||||
|
||||
var socketUserDivID = 'socketUser' + json.users_uri[prop][prop2][prop3].users_id;
|
||||
|
||||
if (!$('#' + socketUserDivID).length) {
|
||||
var html = '<div class="socketUserDiv" id="' + socketUserDivID + '" >';
|
||||
html += '<div class="socketUserName" onclick="socketUserNameToggle(\'#' + socketUserDivID + '\');">';
|
||||
html += '<i class="fas fa-caret-down"></i><i class="fas fa-caret-up"></i> <img src="' + webSiteRootURL + 'user/' + json.users_uri[prop][prop2][prop3].users_id + '/foto.png" class="img img-circle img-responsive">' + json.users_uri[prop][prop2][prop3].user_name + '</div>';
|
||||
html += '<div class="socketUserPages"></div></div>';
|
||||
$('#socketUsersURI').append(html);
|
||||
}
|
||||
|
||||
|
||||
var text = '';
|
||||
if(json.ResourceID == json.users_uri[prop][prop2][prop3].resourceId){
|
||||
text += '<stcong>(YOU)</strong>' ;
|
||||
if (json.ResourceID == json.users_uri[prop][prop2][prop3].resourceId) {
|
||||
text += '<stcong>(YOU)</strong>';
|
||||
}
|
||||
text = ' ' + json.users_uri[prop][prop2][prop3].page_title;
|
||||
text += '<br><small>' + json.users_uri[prop][prop2][prop3].ip+'</small>' ;
|
||||
if(json.users_uri[prop][prop2][prop3].location){
|
||||
text += '<br><i class="flagstrap-icon flagstrap-'+json.users_uri[prop][prop2][prop3].location.country_code+'" style="margin-right: 10px;"></i>';
|
||||
text += ' '+json.users_uri[prop][prop2][prop3].location.country_name;
|
||||
text += '<br><small>(' + json.users_uri[prop][prop2][prop3].client.browser + ' - ' + json.users_uri[prop][prop2][prop3].client.os + ') ' + json.users_uri[prop][prop2][prop3].ip + '</small>';
|
||||
if (json.users_uri[prop][prop2][prop3].location) {
|
||||
text += '<br><i class="flagstrap-icon flagstrap-' + json.users_uri[prop][prop2][prop3].location.country_code + '" style="margin-right: 10px;"></i>';
|
||||
text += ' ' + json.users_uri[prop][prop2][prop3].location.country_name;
|
||||
}
|
||||
html = '<a href="' + json.users_uri[prop][prop2][prop3].selfURI + '" target="_blank" class="btn btn-xs btn-default btn-block"><i class="far fa-compass"></i> '+text+'</a>';
|
||||
$('#'+socketUserDivID+' .socketUserPages').append(html);
|
||||
var isVisible = Cookies.get('#'+socketUserDivID);
|
||||
if(isVisible && isVisible !== 'false'){
|
||||
$('#'+socketUserDivID).addClass('visible')
|
||||
html = '<a href="' + json.users_uri[prop][prop2][prop3].selfURI + '" target="_blank" class="btn btn-xs btn-default btn-block"><i class="far fa-compass"></i> ' + text + '</a>';
|
||||
$('#' + socketUserDivID + ' .socketUserPages').append(html);
|
||||
var isVisible = Cookies.get('#' + socketUserDivID);
|
||||
if (isVisible && isVisible !== 'false') {
|
||||
$('#' + socketUserDivID).addClass('visible')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -179,12 +179,12 @@ $(function () {
|
|||
$.ajax({
|
||||
url: getWebSocket,
|
||||
success: function (response) {
|
||||
if(response.error){
|
||||
console.log('Getting webSocketToken ERROR '+response.msg);
|
||||
if(typeof avideoToastError == 'funciton'){
|
||||
if (response.error) {
|
||||
console.log('Getting webSocketToken ERROR ' + response.msg);
|
||||
if (typeof avideoToastError == 'funciton') {
|
||||
avideoToastError(response.msg);
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
console.log('Getting webSocketToken SUCCESS ', response);
|
||||
webSocketToken = response.webSocketToken;
|
||||
webSocketURL = response.webSocketURL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue