diff --git a/.vs/DayView/DesignTimeBuild/.dtbcache b/.vs/DayView/DesignTimeBuild/.dtbcache index ea4bacc..f1ffc4c 100644 Binary files a/.vs/DayView/DesignTimeBuild/.dtbcache and b/.vs/DayView/DesignTimeBuild/.dtbcache differ diff --git a/.vs/DayView/v15/.suo b/.vs/DayView/v15/.suo index 44e3e03..2228b05 100644 Binary files a/.vs/DayView/v15/.suo and b/.vs/DayView/v15/.suo differ diff --git a/DayView/BundleArtifacts/neutral.txt b/DayView/BundleArtifacts/neutral.txt index 019f913..3f9fbcf 100644 --- a/DayView/BundleArtifacts/neutral.txt +++ b/DayView/BundleArtifacts/neutral.txt @@ -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 diff --git a/DayView/DayView.jsproj b/DayView/DayView.jsproj index 2b1be0a..8bf3f01 100644 --- a/DayView/DayView.jsproj +++ b/DayView/DayView.jsproj @@ -79,6 +79,8 @@ + + @@ -87,7 +89,7 @@ - + @@ -134,6 +136,8 @@ + + diff --git a/DayView/DayView.jsproj.user b/DayView/DayView.jsproj.user index 1226597..e95fe82 100644 --- a/DayView/DayView.jsproj.user +++ b/DayView/DayView.jsproj.user @@ -12,6 +12,6 @@ False False neutral - True + False \ No newline at end of file diff --git a/DayView/css/default.css b/DayView/css/default.css index e863e8d..f460868 100644 --- a/DayView/css/default.css +++ b/DayView/css/default.css @@ -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;*/ @@ -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; @@ -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 { @@ -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; diff --git a/DayView/images/news.png b/DayView/images/alle.png similarity index 100% rename from DayView/images/news.png rename to DayView/images/alle.png diff --git a/DayView/images/ausland.png b/DayView/images/ausland.png new file mode 100644 index 0000000..e256e39 Binary files /dev/null and b/DayView/images/ausland.png differ diff --git a/DayView/images/inland.png b/DayView/images/inland.png new file mode 100644 index 0000000..46165b5 Binary files /dev/null and b/DayView/images/inland.png differ diff --git a/DayView/images/wirtschaft.png b/DayView/images/wirtschaft.png new file mode 100644 index 0000000..c6afa69 Binary files /dev/null and b/DayView/images/wirtschaft.png differ diff --git a/DayView/images/wissen.png b/DayView/images/wissen.png new file mode 100644 index 0000000..d502a99 Binary files /dev/null and b/DayView/images/wissen.png differ diff --git a/DayView/index.html b/DayView/index.html index e397474..1d5f2f3 100644 --- a/DayView/index.html +++ b/DayView/index.html @@ -13,19 +13,19 @@ - microRSS2 - + DayView - -
-
- + +
+
- -
-
- +
+
+
+
+
+
diff --git a/DayView/js/main.js b/DayView/js/main.js index 6b7510b..1411b21 100644 --- a/DayView/js/main.js +++ b/DayView/js/main.js @@ -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; @@ -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(''); $.ajax({ url: RSS_URL, @@ -102,6 +106,7 @@ function getFeed(RSS_URL, SRC_NAME) { newsDone++ console.log(SRC_NAME + ' fetched') if (newsDone == newsNeeded) { + html += '
' + SRC_NAME + '
'; // Create html for news for (var t = 0; t < newsArr.length; t++) { var ArticleDate = new Date(Number(newsArr[t][0])) @@ -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'); @@ -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"; } }, @@ -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) } @@ -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 @@ -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 = '
' - + '
Settings
' + + '
Settings
' + '
DayView by mavodev v' + appstring + '
' - + '
Newsfeeds:
' - + '
' - + '' - + '' - + '' - + '
' - - settingsout += '
Content settings:
' + + '
Content settings:
' + '
' - + '