Commit 2fb3671f authored by Siltaar's avatar Siltaar

- re-improve responsive design

parent d034d15f
......@@ -4,10 +4,6 @@
* licence: GPLv3
*/
/*
* Globals
*/
/* latin & latin-ext */
/* @font-face {
font-family: 'Amatic SC';
......@@ -56,7 +52,10 @@ p, ul { margin-top:0 }
-webkit-box-shadow: inset 0 -2px 5px rgba(0,0,0,.1);
box-shadow: inset 0 -2px 5px rgba(0,0,0,.1);
}
#meta_press_logo {
/* width:256px;
margin-right:1em; */
}
/** Nav links * */
.blog-nav-item {
position: relative;
......@@ -91,42 +90,27 @@ p, ul { margin-top:0 }
content: " ";
border-right: 5px solid transparent;
border-bottom: 5px solid;
border-left: 5px solid transparent; }
/** Blog name and description **/
#meta_press_logo {
background: url(../img/logo-metapress-256px-bg.png);
display: block;
float:left;
width:256px;
height:256px;
margin-right:2em;
}
#headlines {
max-height:256px;
overflow:hidden;
border-left: 5px solid transparent;
}
/** Blog name and description **/
#headlines .pagination {
margin-left:16%;
clear:both;
}
.blog-title {
margin-bottom: -0.4ex;
font-size: 108px;
font-size: 89px;
font-weight: bold;
padding-left:60px;
}
.blog-description {
font-size: 41.5px;
font-size: 34px;
color: #999;
padding-left:60px;
font-family:'Amatic SC', cursive;
margin-bottom:0.25ex;
}
#headlines ul {
float:left;
width:66%;
padding:0;
max-width:100%;
}
/** Main column and sidebar layout **/
.blog-main {
......@@ -136,7 +120,6 @@ p, ul { margin-top:0 }
/* Sidebar modules for boxing content */
.sidebar-module {
padding: 15px;
/*margin: 0 -15px 15px;*/
}
.sidebar-module-inset {
padding: 15px;
......@@ -212,7 +195,6 @@ p, ul { margin-top:0 }
background-color: #F0F0F0;
border: none;
height: 5ex;
/*margin-left:19ex;*/
}
#mp_submit {
background-color: #00D0C0;
......@@ -293,7 +275,6 @@ p, ul { margin-top:0 }
-webkit-transform: scale(2); /* Safari and Chrome */
-o-transform: scale(2); /* Opera */
margin-left:1ex;
/* margin-right:1ex; */
}
.f_icon {
}
......@@ -344,6 +325,7 @@ p, ul { margin-top:0 }
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
width:100%;
}
.src_name_overflow {
width: 64%;
......@@ -355,9 +337,6 @@ p, ul { margin-top:0 }
direction:rtl;
text-align:right;
}
.header-inner {
width:100%;
}
.mf_dt_lbl {
float:left;
width:46%;
......
......@@ -29,21 +29,34 @@
</div>
<div class="container">
<div class="blog-header">
<div id="headlines" class="col-sm-12">
<div id="meta_press_logo"
title="Meta-Press.es logo by Elisa de Castro Guerra"></div>
<h1 class="blog-title">Meta-Press.es</h1>
<p class="lead blog-description">Decentralized press meta-search engine</p>
<ul class="list"></ul>
<ul class="pagination pagination-dots"></ul>
</div>
<div style="display:none;"> <!-- Headline template element for List.js -->
<li id="headline-item">
<div class="header-inner h_tip">
<img class="h_icon" width="16px" align="middle" alt="&#x1F4F0;"></img>
<a class="h_url h_title" target="_blank"></a>
</div>
</li>
<div class="row">
<div id="meta_press_logo" class="col-md-3">
<center>
<img src="img/logo-metapress-256px-bg.png" width="233px"
title="Meta-Press.es logo by Elisa de Castro Guerra"/>
</center>
</div>
<div id="header" class="col-md-6 hidden-xs">
<center>
<h1 class="blog-title">Meta-Press.es</h1>
<p class="lead blog-description">
Decentralized press meta-search engine</p>
</center>
</div>
<div class="col-md-3"></div>
<div id="headlines" class="col-md-9">
<ul class="list"></ul>
<ul class="pagination pagination-dots"></ul>
</div>
<div style="display:none;"> <!-- Headline template element for List.js -->
<li id="headline-item">
<div class="header-inner h_tip">
<img class="h_icon" width="16px" align="middle" alt="&#x1F4F0;"></img>
<a class="h_url h_title" target="_blank"></a>
</div>
</li>
</div>
</div>
<div class="row">
<div class="col-sm-2"></div>
......
......@@ -696,20 +696,23 @@ import * as µ from "/js/utils.js"
})
function load_headlines() {
headlineList.clear()
current_source_selection.forEach(async (i) => {
var n = sources_objs[i]
if (! n.headline_url) return
var rep = await fetch(n.headline_url/*, {
method: "GET",
headers: { overrideMimeType: 'text/plain; charset=x-user-defined' }
}*/)
let i = 0
current_source_selection.forEach(async (k) => {
// for (let k of current_source_selection) {
// let sub_load_headline = async () => {
let n = sources_objs[k]
if (! n.headline_url) { return }
i += 1
console.log(i)
µ.sleep(1000 * i)
let rep = await fetch(n.headline_url)
if (!rep.ok) throw `status ${rep.status}`
var c_type = rep.headers.get("content-type")
var r = µ.dom_parser.parseFromString(await rep.text(), µ.clean_c_type(c_type))
if (!n.domain_part) n.domain_part = µ.domain_part(n.headline_url)
if (!n.favicon_url) n.favicon_url = µ.get_favicon_url(r, n.domain_part)
var h = r.querySelector(n.headline_selector)
let c_type = rep.headers.get("content-type")
let r = µ.dom_parser.parseFromString(await rep.text(), µ.clean_c_type(c_type))
try {
if (!n.domain_part) n.domain_part = µ.domain_part(n.headline_url)
if (!n.favicon_url) n.favicon_url = µ.get_favicon_url(r, n.domain_part)
var h = r.querySelector(n.headline_selector)
headlineList.add({
h_title:µ.shorten(µ.triw(h.textContent), HEADLINE_TITLE_SIZE),
h_url: µ.urlify(h.getAttribute("href"), n.domain_part),
......@@ -717,7 +720,7 @@ import * as µ from "/js/utils.js"
h_tip: `Headline from "${i}" (${ndt().toLocaleString()})\n`+
`${µ.triw(h.textContent)}`
})
} catch (err) {console.error("header for", i, err) }
} catch (err) {console.error("header for", k, err) }
})
}
/* * * Tags * * */
......
......@@ -629,7 +629,7 @@
"name": "Financial Tribune (Iran)",
"headline_url": "https://financialtribune.com",
"headline_selector": ".content .title a",
"search_url": "https://financialtribune.com/search/site/{}?solrsort=ds_created%20desc",
"search_url": "https://financialtribune.com/search/site/\"{}\"?solrsort=ds_created%20desc",
"results": ".search-result",
"r_h1": "a",
"r_url": "a",
......@@ -1214,7 +1214,7 @@
"name": "Plos one",
"headline_url": "https://journals.plos.org/plosone",
"headline_selector": ".block-content h2 a",
"search_url": "https://journals.plos.org/plosone/search/feed/atom?filterJournals=PLoSONE&q={}&sortOrder=DATE_NEWEST_FIRST&page=1",
"search_url": "https://journals.plos.org/plosone/search/feed/atom?filterJournals=PLoSONE&q=\"{}\"&sortOrder=DATE_NEWEST_FIRST&page=1",
"favicon_url": "https://journals.plos.org/plosone/resource/img/favicon.ico",
"extends": "ATOM_Plos",
"tags": {
......@@ -1280,7 +1280,7 @@
"name": "Science Direct (Elsevier)",
"headline_url": "https://www.sciencedirect.com",
"headline_selector": ".browse-subject-popular a",
"search_url": "https://www.sciencedirect.com/search/api?qs={}&sortBy=date&show={#}&navigation=true",
"search_url": "https://www.sciencedirect.com/search/api?qs=\"{}\"&sortBy=date&show={#}&navigation=true",
"favicon_url": "https://cdn.elsevier.io/verona/includes/favicons/favicon-192x192.png",
"type": "JSON",
"res_nb": "resultsFound",
......@@ -1303,7 +1303,7 @@
"name": "PeerCommunity Evolutionnary Biology",
"search_url": "https://evolbiol.peercommunityin.org/public/recommended_articles",
"method": "POST",
"body": "qyKeywords={}",
"body": "qyKeywords=\"{}\"",
"res_nb": "div.pci-nResults",
"res_nb_re": ["^(\\d+) ", "$1"],
"results": "tbody > tr.pci-lastArticles-row",
......
/* globals Uint8Array */
/* globals Uint8Array, Promise */
// https://stackoverflow.com/questions/3700326/decode-amp-back-to-in-javascript
export function HTML_decode_entities (s) {
var elt = document.createElement('textarea')
......@@ -123,6 +123,7 @@ export function clean_c_type(str) { return str.split(";")[0].replace(/(rss|atom)
case '%': return search_url.replace('{%}', encodeURIComponent(token))
}
}*/
export function sleep(duration) { return new Promise(resolve => setTimeout(resolve, duration)) }
// Evaluate an XPath expression aExpression against a given DOM node
// or Document object (aNode), returning the results as an array
// thanks wanderingstan at morethanwarm dot mail dot com for the
......
......@@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "Meta-Press.es",
"description": "Decentralized press meta-search engine",
"version": "1.2.2",
"version": "1.2.3",
"homepage_url": "https://www.meta-press.es",
"author": "Simon Descarpentries",
"icons": {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment