{
"name" : "TV Program" ,
"version" : "0.1" ,
"options_page" : "options.html" ,
"browser_action" : {
"default_icon" : "img/icon.png" ,
"popup" : "popup.html"
},
"permissions" : [
"http://*/*"
]
}
* This source code was highlighted with Source Code Highlighter .
if (localStorage[ "tv" ] == "ont" ){
var now = new Date()
if (now.getDay() == 0)
{ var day = "#sunday" }
if (now.getDay() == 1)
{ var day = "#monday" }
if (now.getDay() == 2)
{ var day = "#tuesday" }
if (now.getDay() == 3)
{ var day = "#wednesday" }
if (now.getDay() == 4)
{ var day = "#thursday" }
if (now.getDay() == 5)
{ var day = "#friday" }
if (now.getDay() == 6)
{ var day = "#saturday" }
$.get( "http://ont.by/new/programma" , {}, function (data, status) {
var details = $(data).find(day);
$( '#logo' ).html( '<img src="/img/ont_logo.png" />' );
$( '#tv' ).html(details);
});
}
if (localStorage[ "tv" ] == "bt" ){
$.get( "http://www.tvr.by/rus/progtv1.asp" , {}, function (data, status) {
var details = $(data).find( '#rubricator' );
$( '#logo' ).html( '<img src="/img/bt_logo.png" />' );
$( '#tv' ).html(details);
});
}
if (localStorage[ "tv" ] == "ntv_by" ){
$.get( "http://www.tvr.by/rus/progntv.asp" , {}, function (data, status) {
var details = $(data).find( '#rubricator' );
$( '#logo' ).html( '<img src="/img/ntv_logo.png" />' );
$( '#tv' ).html(details);
});
}
* This source code was highlighted with Source Code Highlighter .
<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" >
< html >
< head >
< meta http-equiv ="Content-Type" content ="text/html; charset=UTF-8" >
< link href ="options.css" rel ="stylesheet" type ="text/css" />
</ head >
< body >
< div class ="menu" >
< label > </ label >
< form >
< select id ="tv" style ="width: 200px;" >
< option value ="ont" > </ option >
< option value ="bt" > </ option >
< option value ="ntv_by" > - </ option >
</ select >
</ form >
</ div >
< br />
< div class ="menu" >
< div class ="buttons" >
< input type ="button" id ="lngSave" value ="Save" onClick ="return onSave();" />
</ div >
</ div >
< script >
function onSave(){
localStorage[ "tv" ] = document .getElementById( 'tv' ).value;
}
</ script >
</ body >
</ html >
* This source code was highlighted with Source Code Highlighter .
Source: https://habr.com/ru/post/111065/
All Articles