Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var schedule_url = "http://www.ifmo.ru/schedule_search/1/"+localStorage["group_number"]+"/"+num+"/"+localStorage["group_number"]+".htm";
- $('.active').removeClass('active');
- $('.menu li:eq('+parseInt(localStorage["menu_position"])+')').addClass('active');
- $.ajax({
- url: schedule_url,
- type: "GET",
- dataType: "html",
- success: function(html) {
- if(html){
- var htmlStr = "";
- $('div#data').children('table').remove();
- htmlStr = $(html).filter('div.content').children('table').html();
- jQuery('<table/>', {
- html: htmlStr
- }).prependTo($('div#data'));
- $('h3').css('-webkit-margin-after', '0');
- $('div#data a').each(function () {
- var v = $(this);
- var link = "http://www.ifmo.ru/" + v.attr("href");
- v.click(function() {chrome.tabs.create({"url":link}); return false;});
- v.attr("href", "#");
- });
- $('tr').each(function () {
- var v = $(this);
- if (v.attr('bgcolor') != undefined) {
- v.removeAttr('bgcolor');
- v.addClass('odd');
- }
- });
- $('td').each(function () {
- var v = $(this);
- var aiw = $.inArray(v.text(), ifmoSchedule.DAYS_OF_WEEK);
- if (aiw >= 0) {
- if (new Date().getDay() == aiw) {
- v.addClass('today');
- }
- }
- });
- }
- },
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement