Showing 1 changed files with 29 additions and 0 deletions
+29
index.php
... ...
@@ -1,5 +1,6 @@
1 1
 <?php
2 2
 require_once('sources/rss.php');
3
+require_once('sources/news-constants.php');
3 4
 //List available images
4 5
 $newslist = array();
5 6
 $imagelist = array();
... ...
@@ -52,6 +53,29 @@ function NewsSection($sourceHTML) {
52 53
         link.setAttribute('href', 'data:' + mimeType  +  ';charset=utf-8,' + encodeURIComponent(elHtml));
53 54
         link.click(); 
54 55
     }
56
+    function downloadInnerHtmlAll(filename, mimeType) {
57
+        var elHtml = '<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />'; 
58
+        elHtml += '<meta name="viewport" content="width=device-width, initial-scale=1.0">';
59
+        elHtml += '<style>';
60
+        elHtml += 'html { font-family: "Lucida Sans", sans-serif; }'; 
61
+        elHtml += 'img { width: 80%; margin-left: auto; margin-right: auto; }';
62
+        elHtml += '.img-conspiracy { width: 50%; margin-left: 30%; margin-right: auto; }';
63
+        elHtml += 'iframe { width: 80%; margin-left: auto; margin-right: auto; }';
64
+        elHtml += '</style>';
65
+        elHtml += '</head><body>';
66
+        for(index=0; index < <?php echo $NEWS_RSS_MAX_ITEMS; ?>; index++) {
67
+          var string_index = "article-"+index;
68
+          elHtml += document.getElementById(index).innerHTML;
69
+          console.log(document.getElementById(index).innerHTML);
70
+          elHtml += '<hr>';
71
+        }
72
+        elHtml += '</body><html>';
73
+        var link = document.createElement('a');
74
+        mimeType = mimeType || 'text/plain';
75
+        link.setAttribute('download', filename);
76
+        link.setAttribute('href', 'data:' + mimeType  +  ';charset=utf-8,' + encodeURIComponent(elHtml));
77
+        link.click(); 
78
+    }
55 79
     function changeCSS(cssFile, cssLinkIndex) {
56 80
       var oldlink = document.getElementsByTagName("link").item(cssLinkIndex);
57 81
       var newlink = document.createElement("link");
... ...
@@ -198,6 +222,11 @@ function NewsSection($sourceHTML) {
198 222
       var filename = 'test.html'
199 223
       downloadInnerHtml(filename, 'article-current','text/html');
200 224
     }
225
+    function printHTMLAll(channel) {
226
+      console.log("printHTMLAll : channel ["+channel+"]");
227
+      var filename = channel+".html";
228
+      downloadInnerHtmlAll(filename, 'text/html');
229
+    }
201 230
     function printPDF() {
202 231
       var filename = 'test.pdf'
203 232
       var margin = { top: 0, left: 10, right: 0, bottom: 0 };