Skip to content

Commit

Permalink
apply customization for Tagesschau
Browse files Browse the repository at this point in the history
  • Loading branch information
vogtmh committed Oct 25, 2024
1 parent 7ac9198 commit ee88c7b
Show file tree
Hide file tree
Showing 14 changed files with 120 additions and 121 deletions.
Binary file modified .vs/DayView/DesignTimeBuild/.dtbcache
Binary file not shown.
Binary file modified .vs/DayView/v15/.suo
Binary file not shown.
10 changes: 5 additions & 5 deletions DayView/BundleArtifacts/neutral.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
MainPackage=C:\Users\mavo\Documents\dayview\DayView\bin\Release\DayView_1.0.1.0_AnyCPU.appx
ResourcePack=C:\Users\mavo\Documents\dayview\DayView\bin\Release\DayView_1.0.1.0_scale-100.appx
ResourcePack=C:\Users\mavo\Documents\dayview\DayView\bin\Release\DayView_1.0.1.0_scale-125.appx
ResourcePack=C:\Users\mavo\Documents\dayview\DayView\bin\Release\DayView_1.0.1.0_scale-150.appx
ResourcePack=C:\Users\mavo\Documents\dayview\DayView\bin\Release\DayView_1.0.1.0_scale-400.appx
MainPackage=C:\Users\mavo\Documents\dayview\DayView\bin\Release\DayView_1.0.7.0_AnyCPU.appx
ResourcePack=C:\Users\mavo\Documents\dayview\DayView\bin\Release\DayView_1.0.7.0_scale-100.appx
ResourcePack=C:\Users\mavo\Documents\dayview\DayView\bin\Release\DayView_1.0.7.0_scale-125.appx
ResourcePack=C:\Users\mavo\Documents\dayview\DayView\bin\Release\DayView_1.0.7.0_scale-150.appx
ResourcePack=C:\Users\mavo\Documents\dayview\DayView\bin\Release\DayView_1.0.7.0_scale-400.appx
6 changes: 5 additions & 1 deletion DayView/DayView.jsproj
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@
<Content Include="images\add.png" />
<Content Include="images\arrow-left.png" />
<Content Include="images\arrow-right.png" />
<Content Include="images\ausland.png" />
<Content Include="images\inland.png" />
<Content Include="images\LargeTile.scale-100.png" />
<Content Include="images\LargeTile.scale-125.png" />
<Content Include="images\LargeTile.scale-150.png" />
Expand All @@ -87,7 +89,7 @@
<Content Include="images\loading.gif" />
<Content Include="images\loading.png" />
<Content Include="images\LockScreenLogo.scale-200.png" />
<Content Include="images\news.png" />
<Content Include="images\alle.png" />
<Content Include="images\preloading.gif" />
<Content Include="images\rss.png" />
<Content Include="images\searchicon.png" />
Expand Down Expand Up @@ -134,6 +136,8 @@
<Content Include="images\Wide310x150Logo.scale-150.png" />
<Content Include="images\Wide310x150Logo.scale-200.png" />
<Content Include="images\Wide310x150Logo.scale-400.png" />
<Content Include="images\wirtschaft.png" />
<Content Include="images\wissen.png" />
<Content Include="index.html" />
<Content Include="js\jquery3.js" />
<Content Include="js\main.js" />
Expand Down
2 changes: 1 addition & 1 deletion DayView/DayView.jsproj.user
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
<AppxPackageIsForStore>False</AppxPackageIsForStore>
<AppxShowAllApps>False</AppxShowAllApps>
<AppxBuildConfigurationSelection>neutral</AppxBuildConfigurationSelection>
<PackageOptionalProjectsInIdeBuilds>True</PackageOptionalProjectsInIdeBuilds>
<PackageOptionalProjectsInIdeBuilds>False</PackageOptionalProjectsInIdeBuilds>
</PropertyGroup>
</Project>
56 changes: 47 additions & 9 deletions DayView/css/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,22 @@
font-size: 14px;
}

#content {
position: absolute;
z-index: 2;
width: 100%;
top: 0px;
bottom: 0px;
}

#preloader {
margin-left: 40%;
margin-right: 40%;
margin-top: 40%;
width: 20%;
border: none;
}

img {
max-width: 100%;
/*box-shadow: 0 0 3px #B0BEC5;*/
Expand All @@ -32,6 +48,17 @@ tr {
background-color: #12265d;
}

#feedtitle {
position: relative;
left: 3%;
width: 90%;
padding: 2%;
padding-bottom: 0px;
font-size: 24px;
font-weight: bold;
text-align:center;
}

article {
background: #222;
opacity: 1.0;
Expand Down Expand Up @@ -60,20 +87,31 @@ article {
color: #ffffff;
}

#controls {
position: fixed;
bottom: -20px;
right: 0px;
width: 100%;
height: 80px;
z-index: 5;
opacity: 0.9;
text-align: center;
background-color: #111111;
}

.controlbutton {
position: relative;
background-color: Highlight;
width: 70px;
height: 40px;
margin-top: 5px;
margin-left: 10px;
margin-right: 10px;
border-radius: 10px;
background-color: transparent;
width: 16.66%;
height: 60px;
display: inline-block;
background-repeat: no-repeat;
background-size: 30px;
background-size: auto 60%;
background-position: center;
opacity: 0.8;
margin: 0px;
padding: 0px;
float: left;
}

.controlbutton:hover, .controlbutton:focus {
Expand Down Expand Up @@ -102,7 +140,7 @@ article {
padding-left: 35px;
margin-bottom: 12px;
cursor: pointer;
font-size: 22px;
font-size: 18px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
Expand Down
File renamed without changes
Binary file added DayView/images/ausland.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DayView/images/inland.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DayView/images/wirtschaft.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DayView/images/wissen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 10 additions & 10 deletions DayView/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@
<script src="js/jquery3.js"></script>
<script src="js/xml2json.js"></script>
<link rel="stylesheet" type="text/css" href="css/default.css">
<title>microRSS2</title>

<title>DayView</title>
</head>
<body translate="no" style="overflow-x:hidden;">
<div id="reload" class="reload"></div>

<div id="content" style="position: relative; z-index:2; width:100%; bottom:0px; margin-top:0px;">
<img src="images/preloading.gif" style="margin-left:40%;margin-right:40%;margin-top:40%; width:20%;border:none;" />
<body translate="no" style="overflow-x:hidden;">
<div id="content">
<img src="images/preloading.gif" id="preloader" />
</div>
<div id="footer" style="position: relative; z-index:2; width:100%; height:90px; margin-top:20px;pointer-events:none"></div>
<div id="controls" style="position:fixed;bottom:-20px;right:0px; width:100%;height:80px; z-index: 5; opacity:0.9; text-align: center; background-color:#111111">
<div id="control-news" class="controlbutton" onclick="clickNews()" style="background-image: url(images/news.png);border:2px solid #ffffff;"></div>
<!--<div id="control-stats" class="controlbutton" style="background-image: url(images/stats.png);"></div>-->
<div id="controls">
<div id="control-alle" class="controlbutton" onclick="clickNews('alle')" style="background-image: url(images/alle.png);"></div>
<div id="control-inland" class="controlbutton" onclick="clickNews('inland')" style="background-image: url(images/inland.png);"></div>
<div id="control-ausland" class="controlbutton" onclick="clickNews('ausland')" style="background-image: url(images/ausland.png);"></div>
<div id="control-wirtschaft" class="controlbutton" onclick="clickNews('wirtschaft')" style="background-image: url(images/wirtschaft.png);"></div>
<div id="control-wissen" class="controlbutton" onclick="clickNews('wissen')" style="background-image: url(images/wissen.png);"></div>
<div id="control-settings" class="controlbutton" onclick="clickSettings()" style="background-image: url(images/settings.png);"></div>
</div>
<script src="js/main.js"></script>
Expand Down
145 changes: 51 additions & 94 deletions DayView/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ function getCookie(cname) {
return "";
}

function upperCase(val) {
return String(val).charAt(0).toUpperCase() + String(val).slice(1);
}

// Declares variables
var currenttab = "news"
var currenttab = "alle"
var feedsArr = []
var newsArr;
var loadcontent = false;
Expand All @@ -49,9 +53,9 @@ else {
var datafile;

// Fetches news data and updates page once all sources have been fetched
function getFeed(RSS_URL, SRC_NAME) {
function getFeed(RSS_URL, SRC_NAME, ressort) {

$('#content').html = 'Fetching ' + SRC_NAME
$('#content').html('<img src="images/preloading.gif" id="preloader" />');

$.ajax({
url: RSS_URL,
Expand Down Expand Up @@ -102,6 +106,7 @@ function getFeed(RSS_URL, SRC_NAME) {
newsDone++
console.log(SRC_NAME + ' fetched')
if (newsDone == newsNeeded) {
html += '<div id="feedtitle">' + SRC_NAME + '</div>';
// Create html for news
for (var t = 0; t < newsArr.length; t++) {
var ArticleDate = new Date(Number(newsArr[t][0]))
Expand Down Expand Up @@ -129,7 +134,7 @@ function getFeed(RSS_URL, SRC_NAME) {
}
// Output news in html format
//contentDIV = document.getElementById('content')
if (currenttab == 'news') {
if (currenttab == ressort) {
$('#content').html(html)
if (jumptotop) { scroll(0, 0) }
console.log('News page updated');
Expand All @@ -139,7 +144,7 @@ function getFeed(RSS_URL, SRC_NAME) {
}

//newsbuttonDIV = document.getElementById('control-news')
document.getElementById('control-news').style.backgroundImage = "url(images/news.png)";
document.getElementById('control-' + ressort).style.backgroundImage = "url(images/" + ressort + ".png)";
newsbuttonDIV.style.backgroundColor = "Highlight";
}
},
Expand All @@ -151,16 +156,36 @@ function getFeed(RSS_URL, SRC_NAME) {
}

// Triggers the fetch of news data
function updateNews() {
newsbuttonDIV = document.getElementById('control-news')
function updateNews(ressort) {
var feedTitle = upperCase(ressort);
var feedURL = '';
newsbuttonDIV = document.getElementById('control-'+ressort)
newsbuttonDIV.style.backgroundImage = "url(images/loading.gif)";
contentDIV = document.getElementById('content')
newsArr = []
newsDone = 0
newsNeeded = feedsArr.length //required feeds to update page
if (feedsArr.includes('ard')) { getFeed("https://www.tagesschau.de/infoservices/alle-meldungen-100~rss2.xml", "Alle") }
if (feedsArr.includes('inland')) { getFeed("https://www.tagesschau.de/inland/index~rss2.xml", "Inland") }
if (feedsArr.includes('ausland')) { getFeed("https://www.tagesschau.de/ausland/index~rss2.xml", "Ausland") }
newsNeeded = 1 //required feeds to update page
console.log('update requested for ' + ressort);
switch (ressort) {
case 'alle':
feedURL = "https://www.tagesschau.de/infoservices/alle-meldungen-100~rss2.xml";
break;
case 'inland':
feedURL = "https://www.tagesschau.de/inland/index~rss2.xml";
break;
case 'ausland':
feedURL = "https://www.tagesschau.de/ausland/index~rss2.xml";
break;
case 'wirtschaft':
feedURL = "https://www.tagesschau.de/wirtschaft/index~rss2.xml";
break;
case 'wissen':
feedURL = "https://www.tagesschau.de/wissen/index~rss2.xml";
break;
default:
console.log('unknown news ressort')
}
getFeed(feedURL, feedTitle, ressort)
scroll(0, 0)
}

Expand Down Expand Up @@ -196,33 +221,15 @@ function timestamp2fulldate(ts) {
return (year + "-" + month + "-" + date + ' ' + hours + ':' + minutes);
}

// Checks the current tab and starts the content update
function updateContent() {
reloadDIV = document.getElementById('reload')
reloadDIV.innerHTML = ''
switch (currenttab) {
case 'news':
updateNews()
break;
case 'stats':
break;
case 'settings':
break;
default:
window.alert('unknown tab')
}
}

// Switches to news or triggers a news update
function clickNews() {
function clickNews(ressort) {
jumptotop = false
if (currenttab != "news") { jumptotop = true }
currenttab = "news"
console.log('Active news feeds: ' + feedsArr)
$('#control-news').css('border', '2px solid #ffffff');
$('#control-stats').css('border', 'none');
$('#control-settings').css('border', 'none');
updateContent()
if (currenttab != ressort) { jumptotop = true }
currenttab = ressort
$('.controlbutton').css('background-color', 'transparent');
$('#control-' + ressort).css('background-color', 'Highlight');
console.log('clicked to update ' + ressort);
updateNews(ressort);
}

// Displays the settings page
Expand All @@ -236,52 +243,15 @@ function clickSettings() {
}

currenttab = "settings"
$('#control-news').css('border', 'none');
$('#control-stats').css('border', 'none');
$('#control-settings').css('border', '2px solid #ffffff');
$('.controlbutton').css('background-color', 'transparent');
$('#control-settings').css('background-color', 'Highlight');
contentDIV = document.getElementById('content')
settingsout = '<div style="font-size:16px; sans-serif; margin-left:10%;width:80%;">'
+ '<div style="font-size:24px; text-align:center;width:40%; margin-left:30%;margin-bottom:30px;">Settings</div>'
+ '<div id="feedtitle" style="margin-bottom:20px;">Settings</div>'
+ '<div id="version" style="text-align:left;width:80%;margin-left:10%;margin-bottom:15px;">DayView by mavodev v' + appstring + '</div>'
+ '<div style="text-align:left;width:80%;margin-left:10%;margin-bottom:10px;">Newsfeeds:</div>'
+ '<div style="width:80%;margin-left:10%;">'
+ '<label class="container">Alle Meldungen';

if (feedsArr.includes('ard')) {
settingsout += ' <input type="checkbox" id="feed_ard" checked="checked">';
}
else {
settingsout += ' <input type="checkbox" id="feed_ard">';
}

settingsout += ' <span class="checkmark"></span>'
+ '</label>'
+ '<label class="container">Inland';
if (feedsArr.includes('inland')) {
settingsout += ' <input type="checkbox" id="feed_inland" checked="checked">'
}
else {
settingsout += ' <input type="checkbox" id="feed_inland">';
}

settingsout += ' <span class="checkmark"></span>'
+ '</label>'
+ '<label class="container">Ausland';

if (feedsArr.includes('ausland')) {
settingsout += ' <input type="checkbox" id="feed_ausland" checked="checked">'
}
else {
settingsout += ' <input type="checkbox" id="feed_ausland">';
}

settingsout += ' <span class="checkmark"></span>'
+ '</label>'
+ '</div>'

settingsout += '<div style="text-align:left;width:80%;margin-left:10%;margin-bottom:10px;">Content settings:</div>'
+ '<div style="text-align:left;width:80%;margin-left:10%;margin-bottom:10px;">Content settings:</div>'
+ '<div style="width:80%;margin-left:10%;">'
+ '<label class="container">Load all content'
+ '<label class="container">Include pictures'
if (loadcontent == true) {
settingsout += ' <input type="checkbox" id="content_loadall" checked="checked">'
}
Expand All @@ -301,19 +271,6 @@ function clickSettings() {
function applySettings() {
applyButtonDIV = document.getElementById('settings-apply-button')
applyButtonDIV.style.backgroundColor = '#a0a0a0';
feedsArr = []
if (document.getElementById("feed_ard").checked) {
feedsArr.push('ard')
}
if (document.getElementById("feed_inland").checked) {
feedsArr.push('inland')
}
if (document.getElementById("feed_ausland").checked) {
feedsArr.push('ausland')
}

feedsCookie = feedsArr.join('|');
setCookie('feeds', feedsCookie)

if (document.getElementById("content_loadall").checked) {
setCookie('loadcontent', 'true');
Expand All @@ -324,7 +281,7 @@ function applySettings() {
loadcontent = false;
}

clickNews();
clickNews('alle');
}

// Hides the control bar
Expand Down Expand Up @@ -368,5 +325,5 @@ $(document).ready(function () {
document.onselectstart = new Function("return false")
});

updateContent()
setInterval(updateContent, 1800000)
updateNews('alle')
setInterval(updateNews(currenttab), 1800000)
Loading

0 comments on commit ee88c7b

Please sign in to comment.