Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 1st, 2012  |  syntax: None  |  size: 2.52 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. function GameMenu() {
  2.             Menu('game');
  3.             VK.callMethod("setTitle", 'Игра');
  4.             var code = 'return {"user": API.getProfiles({uids: API.friends.getAppUsers()})};';
  5.             VK.api("execute", { code: code }, function (data) {
  6.                 frcount = data.response.user.length;
  7.                 $("#friendtable").html("<tr>");
  8.                 for (var i = 0; i < data.response.user.length; i++) {
  9.                     friends[i] = data.response.user[i].uid;
  10.                     if (i % 8 == 0) {
  11.                         $("#friendtable").append('</tr><tr><td><br/></td></tr><tr>');
  12.                     }
  13.                     $("#friendtable").append('<td><input id="fr' + data.response.user[i].uid + '"/></td>');
  14.                         new Checkbox(ge('fr' + data.response.user[i].uid), {
  15. width: 75,
  16. label: data.response.user[i].first_name
  17. });
  18.  
  19.                }
  20.                 $("#friendtable").append("</tr>");
  21.                 $("#friendsall").html(frcount);
  22.             });
  23.             $.getJSON(apiway + "/game/", { id: viewer_id, authkey: auth_key }, function (json) {
  24.                 $("#gametable").html("<tr>");
  25.                 for (var i = 0; i < json.response.length; i++) {
  26.                     if (i == 4) {
  27.                         $("#gametable").append('</tr><tr><td><br/></td></tr><tr>');
  28.                     }
  29.                     $("#gametable").append('<td><a href="' + json.response[i].link + '" target="_blank"><img src="logo/' + json.response[i].img + '" /></a></td><td width="80"><b><a href="' + json.response[i].link + '" target="_blank">' + json.response[i].name + '</a></b><br/><b><span id="logo' + i + '">' + json.response[i].have + '</span> из ' + json.response[i].count + '</b><br/><a href="javascript://" onclick="GameConvert(1, ' + i + ')">' + json.response[i].credits + ' кр</a><br/><a href="javascript://" onclick="GameConvert(2, ' + i + ')">' + json.response[i].keys + ' ключей</a><br/></td>');
  30.                 }
  31.                 $("#gametable").append("</tr>");
  32.                 waittime = json.time;
  33.                 keys = json.total;
  34.                 $("#keycount").html(keys);
  35.                 $("#partcount").html(json.frkeys);
  36.                 $("#partmax").html(json.part);
  37.                 if (json.frtime > 0) {
  38.                     $("#friendnoallow").show();
  39.                     $("#friendallow").hide();
  40.                 }
  41.                 else {
  42.                     $("#friendnoallow").hide();
  43.                     $("#friendallow").show();
  44.                 }
  45.             });
  46.         }