Commit 223ea801 authored by yPhil's avatar yPhil
Browse files

Merge branch 'dev' into server

parents 0cae2a44 ae8df0d4
Pipeline #410953 passed with stage
in 43 seconds
......@@ -92,17 +92,17 @@
body {
background-color: var(--color-background);
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
margin: 0;
}
a:link {
color: var(--color-text);
text-decoration: none;
ul,
li {
padding: 0;
}
.fancybox-caption a, .fancybox-caption a:link, .fancybox-caption a:visited {
background-color: var(--color-button-bg);
color: var(--color-button-text);
a:link {
color: var(--color-text);
text-decoration: none;
}
......@@ -110,15 +110,31 @@ a:visited {
color: var(--color-link-visited);
}
a:hover,
/* .ui-tab.ui-state-active a:link, .ui-tab.ui-state-active i, .ui-tab.ui-state-default a:link, */
a:active {
color: var(--color-link-hover);
}
/* .fancybox-caption a, */
/* .fancybox-caption a:link, */
/* .fancybox-caption a:visited { */
/* background-color: var(--color-button-bg); */
/* color: var(--color-button-text); */
/* text-decoration: none; */
/* } */
/* a.ui-tabs-anchor:link, */
/* a.ui-tabs-anchor:visited { */
/* color: var(--color-link); */
/* } */
a:hover,
/* .ui-tab.ui-state-active a:link, .ui-tab.ui-state-active i, .ui-tab.ui-state-default a:link, */
a:active {
color: var(--color-link-hover);
.ui-state-default a,
.ui-state-default a:link,
.ui-state-default a:visited,
.ui-state-default:not(.ui-slider-handle),
.ui-widget-content .ui-state-default:not(.ui-slider-handle) {
color: var(--color-link);
}
li.feedItem:not(.error) a {
......@@ -126,6 +142,11 @@ li.feedItem:not(.error) a {
width: 100%;
}
li.ui-state-active a:link,
li.ui-tabs-active > a:visited {
color: var(--color-link-hover);
}
.feedHeader > .feedTitle > a:link,
.feedHeader > .feedTitle > a:visited,
.feedHeader > .feedTitle > a:focus,
......@@ -151,24 +172,15 @@ table#jsLicenseTable td a:link {
text-decoration: underline;
}
.feedHeader .feedControls div {
margin: 0 2px 0 0;
}
div#logoTitle {
display: flex;
/* cursor: pointer; */
}
div#logoTitle > div,
.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,
.topNav > div.menuBarButton,
i.tabIcon,
#ptlSearch > i,
.hover {
cursor: pointer;
}
.feedHeader .feedControls div {
margin: 0 2px 0 0;
}
.feedHeader > .feedToggle,
.feedHeader .feedControls div {
text-align: center;
......@@ -179,6 +191,19 @@ i.tabIcon,
font-size: 12pt;
}
.ui-tab.ui-state-active > i {
color: var(--color-link);
}
div#logoTitle > div,
.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,
.topNav > div.menuBarButton,
i.tabIcon,
#ptlSearch > i,
.hover {
cursor: pointer;
}
p.dangerous {
color: var(--color-ui-danger);
}
......@@ -199,6 +224,10 @@ button.dangerous:hover {
transform: rotate(90deg);
}
.ui-spinner input {
width: 32px;
}
.topNav {
z-index: 20;
background-color: var(--color-ui-qua);
......@@ -261,6 +290,17 @@ i.icon-petrolette {
color: var(--color-ui-sec);
}
.logoTitle {
color: var(--color-link-hover);
display: var(--logo-display);
font-family: LobsterRegular, Helvetica, Arial, sans-serif;
font-size: 36pt;
}
#preload > .logoTitle {
font-family: LobsterRegular, Helvetica, sans-serif;
}
div#logoTitle > .logoTitle:hover,
i.icon-petrolette:hover,
i.icon-petrolette.writing {
......@@ -273,13 +313,6 @@ div#logoTitle > div {
flex: 1 0;
}
.logoTitle {
color: var(--color-link-hover);
display: var(--logo-display);
font-family: LobsterRegular, Helvetica, Arial, sans-serif;
font-size: 36pt;
}
i.tabCloser:hover {
color: var(--color-link-hover);
}
......@@ -347,12 +380,8 @@ i.tabCloser:hover {
width: 0;
}
#preload > .logoTitle {
font-family: LobsterRegular, Helvetica, sans-serif;
}
.feedHeader > .feedTitle {
margin-top: 2px;
margin-top: 3px;
flex-basis: auto;
flex-grow: 4;
flex-shrink: 1;
......@@ -395,7 +424,7 @@ h1.rs-big-headline {
}
.rs-sub-headline {
word-break: normal;
word-break: normal !important;
}
h3 {
......@@ -544,6 +573,7 @@ li.feedItem.error > strong.value {
select {
width: 100%;
height: 30px;
font-size: 1em;
}
fieldset {
......@@ -761,24 +791,6 @@ ul.help li.cloud::before {
margin: 0.1em;
}
#tabs {
overflow: hidden;
white-space: nowrap;
}
#tabs > ul {
overflow-x: auto;
overflow-y: hidden;
scrollbar-width: thin;
scrollbar-color: var(--color-fg4) var(--color-bg1);
}
#tabs > ul > li {
display: inline-block;
float: none;
vertical-align: bottom;
}
.column {
white-space: initial;
transition: transform 0.3s linear;
......@@ -841,29 +853,19 @@ ul.column div.buttons {
li.feed {
position: relative;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
/* font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; */
margin: 0 0 0.4em 0;
min-height: 20px !important;
width: 100%;
}
select,
.introjs-tooltipReferenceLayer *,
.introjs-button,
.ui-widget,
.ui-widget input,
.ui-widget select,
.ui-widget textarea,
.ui-widget button,
.ui-widget-content,
.ui-widget-header {
.rs-widget,
.ui-widget {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
}
select {
font-size: 1em;
}
.introjs-button {
border: unset;
text-shadow: unset;
......@@ -1014,10 +1016,6 @@ li.feed div.feedBody {
scrollbar-color: var(--color-scrollbar) var(--color-dialog-border);
}
li.feed div.feedBody:hover {
scrollbar-color: var(--color-link-hover) var(--color-dialog-border);
}
li.feed div.feedBody::-webkit-scrollbar {
width: 4px;
}
......@@ -1031,6 +1029,10 @@ li.feed div.feedBody::-webkit-scrollbar-thumb {
background-color: var(--color-fg4);
}
li.feed div.feedBody:hover {
scrollbar-color: var(--color-link-hover) var(--color-dialog-border);
}
.folded {
height: 0 !important;
border-bottom: var(--color-background) !important;
......@@ -1101,7 +1103,9 @@ div.fancybox-caption a.ui-button.ui-corner-all:hover {
color: var(--color-ui-sec) !important;
}
/* Javascript */
.ui-dialog p {
margin: 0.3em 0 0 0;
}
#js {
background-color: var(--color-ui-qua);
......@@ -1182,33 +1186,32 @@ video {
/* UI SHIT */
.ui-spinner {
height: 32px;
margin: 0;
}
.ui-spinner input {
width: 32px;
#tabs {
overflow: hidden;
white-space: nowrap;
}
.ui-tab i.tabCloser {
top: 2px;
color: var(--color-tab-inactive-bg);
#tabs > ul {
overflow-x: auto;
overflow-y: hidden;
scrollbar-width: thin;
scrollbar-color: var(--color-fg4) var(--color-bg1);
}
.ui-tab.ui-state-active > i {
color: var(--color-link);
#tabs > ul > li {
display: inline-block;
float: none;
vertical-align: bottom;
}
.ui-dialog p {
margin: 0.3em 0 0 0;
.ui-spinner {
height: 32px;
margin: 0;
}
.ui-tab,
.ui-tabs,
ul,
li {
padding: 0;
.ui-tab i.tabCloser {
top: 2px;
color: var(--color-tab-inactive-bg);
}
.ui-tab#newTabTab {
......@@ -1229,19 +1232,14 @@ li {
background: var(--color-tab-inactive-bg);
}
nav#sideMenu,
.ui-widget-content,
.topNav,
.ui-dialog,
.ui-dialog-buttonpane,
fieldset {
.menu,
.ui-widget-content {
background-color: var(--color-dialog-bg);
color: var(--color-text);
/* border-color: var(--color-button-border); */
}
.ui-dialog.ui-widget-content {
border: 1px solid var(--color-dialog-border)
border: 1px solid var(--color-dialog-border);
}
.ui-dialog .ui-dialog-buttonpane {
......@@ -1312,7 +1310,8 @@ li.ui-tabs-tab {
/* .ui-widget-content .ui-state-active, */
/* .ui-widget-header .ui-state-active, */
.introjs-button:active,
a.ui-button:active, .ui-button:active,
a.ui-button:active,
.ui-button:active,
.ui-button.ui-state-active:hover {
background: var(--color-button-bg-active);
}
......@@ -1323,15 +1322,6 @@ a.ui-button:active, .ui-button:active,
background-color: var(--color-tab-hover);
}
.ui-state-default a,
.ui-state-default a:link,
.ui-state-default a:visited,
.ui-state-default:not(.ui-slider-handle),
.ui-widget-content .ui-state-default:not(.ui-slider-handle),
.ui-widget-header .ui-state-default {
color: var(--color-link);
}
#feedLimit,
#gallerySpeedSlider,
.ui-slider,
......@@ -1340,10 +1330,6 @@ a.ui-button:active, .ui-button:active,
background-color: var(--color-button-bg);
}
.ui-slider-handle:hover {
background-color: var(--color-button-bg-active);
}
.ui-slider-handle {
background-color: var(--color-button-bg-active);
color: var(--color-button-text);
......@@ -1352,10 +1338,16 @@ a.ui-button:active, .ui-button:active,
line-height: 38px;
min-width: 38px;
text-align: center;
top: -.2em !important;
top: -0.2em !important;
}
.ui-widget textarea, .ui-widget-content, .ui-widget-header {
.ui-slider-handle:hover {
background-color: var(--color-button-bg-active);
}
.ui-widget textarea,
.ui-widget-content,
.ui-widget-header {
border: none !important;
}
......@@ -1364,12 +1356,6 @@ a.ui-button:active, .ui-button:active,
margin: 0;
}
li.ui-state-active a:link,
li.ui-tabs-active > a:visited {
color: var(--color-link-hover);
}
.ui-progressbar {
position: relative;
background: var(--color-button-bg);
......
......@@ -5,7 +5,7 @@
--color-dialog-bg: #1F262E;
--color-dialog-border: #1F262E;
--color-scrollbar: #555;
--color-border: #303b48;
--color-border: #1F262E;
--color-button-bg: #F6F6F6;
--color-button-bg-active: #007FFF;
--color-button-border: #CCCCCC;
......@@ -26,7 +26,7 @@
--color-feed-bg: #383C4A;
--color-feed-bg-alt: #424657;
--color-feed-bg-hover: #1F262E;
--color-tab-active-fg: #1F262E;
--color-tab-active-fg: #19B5FE;
--color-tab-active-bg: #1F262E;
--color-tab-inactive-fg: #1F262E;
--color-tab-inactive-bg: #29323C;
......
......@@ -637,7 +637,7 @@ PTL.dialog = {
.text(PTL.tr('Move focus to the next tab and immediately activate.'))));
$dialog.find('h1').text(PTL.tr('Keyboard shortcuts'))
.next('p#dialogBlurb').text(PTL.tr('A click on the Pétrolette logo puts the focus on the first tab'))
.next('p#dialogBlurb').text(PTL.tr('A click on the Pétrolette logo puts the focus on the current tab'))
.next('h2').text(PTL.tr('When focus is on a tab'))
.next('p')
.append($kbShortCutsTab)
......
......@@ -256,7 +256,7 @@ PTL.feed = {
$feedLink.removeClass('danger');
$.get("/feed", {
feedurl: feedUrl,
url: feedUrl,
dataType: 'json'
}, function() {
......
......@@ -63,8 +63,7 @@ PTL.i18n.translations = {
"Focus first tab" : { fr: "Focus sur le premier onglet", ja: "フォーカスファーストタブ", es: "Foco primera pestaña" },
"A click on the Pétrolette logo puts the focus on the first tab" : { fr: "Un clic sur le logo Pétrolette met le focus sur le premier onglet", ja: "Pétroletteのロゴをクリックすると、最初のタブに焦点を当てます。", es: "Un clic en el logotipo de Pétrolette pone el enfoque en la primera pestaña" },
"A click on the Pétrolette logo puts the focus on the current tab" : { fr: "Un clic sur le logo Pétrolette met l'accent sur l'onglet en cours", ja: "Pétroletteのロゴをクリックすると、現在のタブに焦点が合わせる", es: "Un clic en el logotipo de Pétrolette pone el enfoque en la pestaña actual" },
"Feed name (optional)" : { fr: "Nom du flux (optionnel)", ja: "フロー名(オプション)", es: "Nombre de la fuente (Opcional)" },
......
......@@ -47,8 +47,8 @@ var PTL = (function() {
});
$('#logoTitle > .logoTitle').click(function(){
$('#ui-id-1').focus().trigger('click');
});
$('.ui-state-active a').focus();
});
$logoType.click(function(){
PTL.dialog.about($logoType.attr('data-version'));
......
......@@ -5,16 +5,6 @@ const fetch = require('node-fetch'),
exports.getFeed = getFeed;
function maybeDecompress (res, encoding) {
var decompress;
if (encoding.match(/\bdeflate\b/)) {
decompress = zlib.createInflate();
} else if (encoding.match(/\bgzip\b/)) {
decompress = zlib.createGunzip();
}
return decompress ? res.pipe(decompress) : res;
}
function maybeTranslate (res, charset) {
var iconvStream;
// Decode using iconv-lite if its not utf8 already.
......@@ -44,13 +34,6 @@ function getParams(str) {
return params;
}
function done(err) {
if (err) {
// console.error('err: %s Stack %s', err, err.stack);
return;
}
}
function getFeed (feedUrl, callback) {
// Get a response stream
fetch(feedUrl, {
......@@ -59,37 +42,40 @@ function getFeed (feedUrl, callback) {
redirect: 'follow'
}).then(function (res) {
// Setup feedparser stream
var feedparser = new FeedParser();
var feedItems = [];
feedparser.on('error', function(error) {
console.error('## feedParserErr: %s (%s)', error.message, feedUrl);
return callback({error:error, errno:res.status, message:error.message});
});
feedparser.on('end', done);
feedparser.on('readable', function() {
try {
var item = this.read();
if (item !== null) feedItems.push (item);
}
catch (err) {
console.error('## feedParserCatchErr: %s (%s)', err, feedUrl);
}
}).on ('end', function () {
var meta = this.meta;
return callback (null, feedItems, meta.title || 'Untitled', meta.link || feedUrl);
});
if (res.status != 200) {
return callback({error:'error', errno:res.status, message:'Bad server response'});
callback({error:'error', errno:res.status, message:'Bad server response'});
return reject();
}
var feedparser = new FeedParser();
var feedItems = [];
var charset = getParams(res.headers.get('content-type') || '').charset;
var responseStream = res.body;
responseStream = maybeTranslate(responseStream, charset);
responseStream.pipe(feedparser);
return new Promise((resolve, reject) => {
feedparser.on('error', function(error) {
console.error('## feedParserErr: %s (%s)', error.message, feedUrl);
reject();
return callback({error:error, errno:res.status, message:error.message});
}).on('readable', function() {
try {
var item = this.read();
if (item !== null) feedItems.push (item);
}
catch (err) {
console.error('## feedParserCatchErr: %s (%s)', err, feedUrl);
}
}).on ('end', function () {
var meta = this.meta;
resolve();
return callback (null, feedItems, meta.title || 'Untitled', meta.link || feedUrl);
});
});
}).catch((err) => {
return callback({error:err, resStatus:0, message:err.message});
callback({error:err, resStatus:0, message:err.message});
});
}
......@@ -70,7 +70,7 @@ router.use(morgan('combined'));
router.get('/feed', function(req, res) {
feeder.getFeed(req.query.feedurl, function (err, feedItems, feedTitle, feedLink) {
feeder.getFeed(req.query.url, function (err, feedItems, feedTitle, feedLink) {
if (feedItems && !res.headersSent) {
res.send({
......
......@@ -8,13 +8,9 @@
<link rel="preload" as="script" href="/bower/jquery/dist/jquery.min.js">
<link rel="preload" as="script" href="/bower/jquery-ui/jquery-ui.min.js">
<link rel="preload" as="font" crossorigin href="/static/font/BebasNeue.otf">
<link rel="preload" as="font" crossorigin href="/static/font/Lobster_1.3.otf">
<link rel="preload" as="font" href="/static/font/Lobster_1.3.otf">
<link rel="preload" as="style" href="/static/css/fontello.css" />
<link rel="preload" as="style" href="/static/css/petrolette.css" />
<link rel="preload" as="image" href="/static/images/loading.gif">
<script>
......
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