M
M
Maxim Zuev2014-07-06 20:46:24
css
Maxim Zuev, 2014-07-06 20:46:24

What should I write in js so that the interlocutor's name and photo are replaced in the VK dialog?

<a href="/durov" class="mem_link" target="_blank" wotsearchprocessed="true">Павел</a>

I turned on the search for mem_link and found this code:
if (srvMsg) {
extend(row.insertCell(0), {colSpan: 5, className: 'im_srv_msg_td', innerHTML: '<div class="im_srv_msg">' + srvMsg + '</div>'});
} else {
if (peer_data && actual_peer && (user = peer_data.members[actual_peer])) {
user = [user.link, user.photo, user.name  ];
} else {
if (out) {
user = ['/id' + cur.id  , cur.photo, cur.name  ]
} else {
var link = '/id' + fromId, photo = cur.tabs[peer_id].photo, name = cur.tabs[peer_id].name;
if (fromId < -2e9) {
if (peer_id > 2e9) {
name = 'Unknown';
link = '/im?sel=c'+(peer_id - 2e9);
} else {
link = '/im?sel=e'+(-fromId - 2e9);
}
photo = '/images/contact_50.gif';
} else if (peer_id > 2e9) {
name = 'Unknown';
photo = '/images/camera_c.gif';
}
user = [link, photo, name];
}
}
author_html = '<div class="im_log_author_chat_thumb"><a href="' + user[0] + '"><img src="' + user[1] + '" class="im_log_author_chat_thumb" width="32" height="32"/></a></div>';
message = '<div class="im_log_author_chat_name"><a href="' + user[0] + '" class="mem_link">'+ user[2] + '</a>' + msgInfo + '</div>' + message;

means it is necessary to do something with user? I'm not good at js, please help

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Alex, 2016-03-15
@streetflush

opacity 0 -> opacity 1

M
Mikhail, 2016-03-15
Chirskiy @chirskiy_mixail

There is such a useful thing for such things, I used it on landing pages
https://github.com/protonet/jquery.inview
It works simply:

$('div').on('inview', function(event, isInView) {
  if (isInView) {
    // element is now visible in the viewport
  } else {
    // element has gone out of viewport
  }
});

If I understand you correctly, it should help.

L
Lisonok, 2014-07-06
@Lisonok

You can, but where do you want to change js? and what to replace?

A
alex9252, 2016-07-28
@alex9252

for normal vk there is cur.tabs . but in new.vk there is no cur.tabs
, tell me how to solve the problem,
thanks

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question