Advertisement
Punk_UnDeaD

Код видите? А теперь рисуйте блоксхему!!!

Mar 20th, 2012
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function ($) {
  2.   Drupal.game_status_request = function () {
  3.     $.post(Drupal.settings.basePath + "game/status", Drupal.game_status_proceed, "json");
  4.   }
  5.   Drupal.game_status_proceed = function (data, status) {
  6.     $(document).stopTime()
  7.       .oneTime(Drupal.settings.game.request_frequency * 1000, Drupal.game_status_request)
  8.       .trigger("game_update", data);
  9.     if (data.status == "error") {
  10.       alert(data.status + ": " + data.message);
  11.     }
  12.   }
  13.   $(document).bind("game_update", function (event, data) {
  14.     if (data.tokens)
  15.       Drupal.theme('showMyTokens', data.tokens)
  16.   });
  17.   Drupal.theme.prototype.showMyTokens = function (tokens) {
  18.     $("#block-block-1 .utokens").text(tokens).show();
  19.   };
  20.   $(function () {
  21.     $(document).trigger("game_prepare");
  22.     Drupal.game_status_request();
  23.   });
  24. })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement