Advertisement
anivaros

Untitled

Feb 9th, 2012
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var schedule_url = "http://www.ifmo.ru/schedule_search/1/"+localStorage["group_number"]+"/"+num+"/"+localStorage["group_number"]+".htm";
  2.             $('.active').removeClass('active');
  3.             $('.menu li:eq('+parseInt(localStorage["menu_position"])+')').addClass('active');
  4.             $.ajax({       
  5.                 url: schedule_url,
  6.                 type: "GET",
  7.                 dataType: "html",
  8.                 success: function(html) {
  9.                     if(html){
  10.                         var htmlStr = "";
  11.                         $('div#data').children('table').remove();
  12.                         htmlStr = $(html).filter('div.content').children('table').html();
  13.                         jQuery('<table/>', {
  14.                             html: htmlStr
  15.                         }).prependTo($('div#data'));
  16.                         $('h3').css('-webkit-margin-after', '0');
  17.                         $('div#data a').each(function () {
  18.                             var v = $(this);
  19.                             var link = "http://www.ifmo.ru/" + v.attr("href");
  20.                             v.click(function() {chrome.tabs.create({"url":link}); return false;});
  21.                             v.attr("href", "#");
  22.                         });
  23.                          $('tr').each(function () {
  24.                             var v = $(this);
  25.                             if (v.attr('bgcolor') != undefined) {
  26.                                 v.removeAttr('bgcolor');
  27.                                 v.addClass('odd');
  28.                             }
  29.                         });
  30.                         $('td').each(function () {
  31.                             var v = $(this);
  32.                             var aiw = $.inArray(v.text(), ifmoSchedule.DAYS_OF_WEEK);
  33.                             if (aiw >= 0) {
  34.                                 if (new Date().getDay() == aiw) {
  35.                                     v.addClass('today');
  36.                                 }
  37.                             }
  38.                         });
  39.                     }
  40.                 },
  41.             });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement