Commit f84718e6 authored by yPhil's avatar yPhil
Browse files

JQuery-UI libs in separate files, running with one last error

parent 51befbd1
This diff is collapsed.
......@@ -20,6 +20,7 @@
"show": "./node_modules/pm2/bin/pm2 show petrolette",
"logs": "./node_modules/pm2/bin/pm2 logs petrolette",
"errors": "./node_modules/pm2/bin/pm2 logs --err --format",
"test": "mocha --timeout 30s",
"postinstall": "bower install --allow-root"
},
"dependencies": {
......@@ -36,5 +37,9 @@
"npm": "^7.5.2",
"pm2": "^4.5.4",
"request": "^2.88.2"
},
"devDependencies": {
"mocha": "^8.3.0",
"should": "^13.2.3"
}
}
......@@ -277,21 +277,34 @@ a:active {
}
.feed-header > .feed-title {
/* padding-top: 0.2em; */
vertical-align: middle;
flex-basis: auto;
flex-grow: 4;
flex-shrink: 1;
font-family: "Aveny T WEB", Arial, sans-serif;
/* font-style: normal; */
/* display:flex; */
/* align-items: center; */
/* font-family: "Aveny T WEB", Arial, sans-serif; */
font-family: BebasNeueRegular, Verdana, sans-serif !important;
/* font-stretch: ultra-condensed; */
font-style: normal;
-webkit-font-smoothing: antialiased;
-webkit-text-stroke-width: 0.2px;
-moz-osx-font-smoothing: grayscale;
font-size: var(--feed-title-font-size);
text-transform: uppercase;
/* text-transform: uppercase; */
/* margin-top: var(--title-padding-top); */
font-style: oblique;
/* height: 30px; */
margin-left: var(--title-margin-left);
text-overflow: ellipsis;
color: var(--color-fg6);
overflow: hidden;
display: block;
width: 100px;
white-space: nowrap;
text-overflow: ellipsis;
}
#preload > .feed-title {
......@@ -374,7 +387,7 @@ ul.help li {
.ui-tab#new-group {
width: 40px;
background-color: var(--color-fg4);
background-color: var(--color-bg1);
}
.ui-tab.ui-state-default {
......@@ -397,8 +410,6 @@ ul.help li {
color: var(--color-fg1);
}
html body main div#tabs.ui-tabs.ui-corner-all.ui-widget.ui-widget-content ul#tab-names.ui-tabs-nav.ui-corner-all.ui-helper-reset.ui-helper-clearfix.ui-widget-header.ui-sortable li.modal.tab-name.translate.ui-droppable.ui-tabs-tab.ui-corner-top.ui-state-default.ui-tab a#ui-id-5.ui-tabs-anchor
.ui-tab.ui-state-active i:hover {
color: var(--color-fg2);
}
......@@ -412,6 +423,14 @@ li.feed-item:not(.error) a {
width: 100%;
}
i.feed-control {
color: var(--color-fg1);
}
i.feed-control:hover {
color: var(--color-fg5);
}
.ui-tab.ui-state-default a:hover {
cursor: pointer !important;
color: var(--color-fg2) !important;
......@@ -434,15 +453,17 @@ i.item-icon {
margin: 0.2em;
}
i.tab-closer {
.ui-tab i.tab-closer {
top: 2px;
color: var(--color-bg1);
}
i.rotate:hover,
i.tab-closer:hover,
i.feed-control:hover {
color: var(--color-ui-sec);
.ui-tab.ui-state-active i {
color: var(--color-fg1);
}
.ui-tab.ui-state-active {
border-top: 1px solid var(--color-ui-danger) !important;
}
i.danger,
......@@ -450,7 +471,8 @@ i.dangerous:hover {
color: var(--color-ui-danger);
}
.feed-header > .feed-title > a:link {
.feed-header > .feed-title > a:link,
.feed-header > .feed-title > a:visited {
color: var(--color-fg6);
}
......@@ -1080,19 +1102,11 @@ li.feed.selected {
margin: 0;
}
.truncate {
overflow: hidden;
display: block;
width: 100px;
white-space: nowrap;
text-overflow: ellipsis;
}
.feed-header {
display: flex;
flex-direction: row;
background-color: var(--color-bg2);
color: var(--color-fg5);
/* color: var(--color-fg5); */
transition: all 0.3s linear;
height: var(--header-height);
max-height: var(--header-height);
......@@ -1106,8 +1120,8 @@ li.feed.selected {
.feed-header > .feed-handle {
background-color: transparent;
border-left: 3px dotted var(--color-fg2);
border-right: 3px dotted var(--color-fg2);
border-left: 3px dotted var(--color-fg4);
border-right: 3px dotted var(--color-fg4);
flex-basis: 4px;
flex-grow: 0;
flex-shrink: var(--handle-flex-shrink);
......@@ -1171,7 +1185,7 @@ li.feed-item:nth-child(even) {
}
li.feed-item:hover {
background-color: var(--color-fg3);
background-color: var(--color-bg5);
}
li.feed-item > div.itemDiv > a > .ptl-img {
......@@ -1206,13 +1220,13 @@ table {
}
li.feed div.feed-body {
border-right: 1px solid var(--color-fg3);
border-bottom: 1px solid var(--color-bg1);
border-left: 1px solid var(--color-fg3);
border-right: 1px solid var(--color-bg1);
border-bottom: 1px solid var(--color-bg2);
border-left: 1px solid var(--color-bg1);
}
li.feed:hover div.feed-body {
border-color: var(--color-bg2);
border-color: var(--color-bg5);
}
.feed-header > .feed-handle:hover {
......@@ -1262,7 +1276,7 @@ div.introjs-helperLayer {
/* Gallery */
div.fancybox-caption a.ui-button.ui-corner-all {
color: var(--color-bg1);
color: var(--color-ui-qua);
}
div.fancybox-caption a.ui-button.ui-corner-all:hover {
......@@ -1357,3 +1371,46 @@ div#logo-title > .logo-title > a:hover {
#js p {
margin-left: 40px;
}
#beggar {
background-color: var(--color-ui-qua);
border: 1px solid var(--color-ui-oct);
border-radius: 5px;
width: 22rem;
/* height: 220px; */
max-width: 100%;
padding: 2em;
position: sticky;
bottom: 16px;
left: 16px;
z-index: 30;
flex-direction: column;
}
#beggar > span {
font-size: 6em;
}
#beggar > a.ui-button {
margin-top: 1em;
}
#beggar > p {
color: var(--color-ui-pri);
margin: 0 0 0.2em 0;
font-size: 11pt;
}
#beggar a.beggarLink:link,
#beggar a.beggarLink:visited {
text-decoration: underline !important;
color: var(--color-ui-sec);
}
#beggar a.beggarLink:hover {
color: var(--color-ui-sen);
}
/* #beggar > h4 { */
/* margin-top: 0; */
/* } */
:root {
--color-fg1: #FFFFFF; /* Normal text */
--color-fg2: #FF4136; /* Links */
--color-fg3: #404552; /* Visited links */
--color-fg3: #CCCCCC; /* Visited links */
--color-fg4: #404552; /* Separators */
--color-fg5: #F77F00; /* Feed controls */
--color-fg6: #eae2b7; /* Feed title */
--color-bg1: #29323C; /* Body */
--color-bg1: #29323C; /* Body / Feed border */
--color-bg2: #1F262E; /* Feed header */
--color-bg3: #383C4A; /* Feed item BG */
--color-bg4: #424657; /* Feed item BG alternate */
--color-bg5: #1F262E; /* Feed item BG hover */
--color-hl1: #1F262E;
--color-hl2: #000000;
--color-hl3: #000000;
......
......@@ -7,134 +7,25 @@ PTL.dialog = {
},
nagUser:function() {
var $dialogs = $('#dialogs'),
isOpen = $dialogs.dialog('instance') === 'undefined';
if (isOpen) {
// PTL.dialog.kill($dialog);
PTL.util.console(PTL.tr('A window is already open, so not nagging'), 'warning');
} else {
$dialogs.load('/static/templates/dialogs.html #nagDialog', function() {
var $dialog = $(this);
var $nag1 = $('<div>').attr('class', 'dialogContent')
.append($('<div>').attr('class', 'dialogImage')
.append($('<span>')
.attr('class', 'huge dialogImage')
.text('🍏')))
.append($('<div>').attr('class', 'dialogText')
.append($('<h1>').text(PTL.tr('Pétrolette needs you')))
.append($('<h2>').text(PTL.tr('Help me pay the bills'))
.append($('<span>').attr('class', 'dialogHeaderIcon')))
.append($('<p>')
.text(PTL.tr('Pétrolette is free software. However the development requires '))
.append($('<a>')
.attr('href', 'https://www.youtube.com/watch?v=JlbMEx9H6FE')
.text(PTL.tr(' a lot of time ')))
.append($('<span>').text(PTL.tr(' and ')))
.append($('<a>').attr('href', 'https://framagit.org/yphil/petrolette/-/commits/master').text(PTL.tr(' a lot of work')))
.append($('<span>').text(PTL.tr('.'))))
.append($('<p>').text(PTL.tr('In order to keep developing Pétrolette with new features I need your help.')))
.append($('<p>').text(PTL.tr('Please consider to support the Pétrolette project by sending a donation. Even the smallest amount will help a lot.'))));
var $nag2 = $('<div>').attr('class', 'dialogContent')
.append($('<div>').attr('class', 'dialogImage')
.append($('<span>').attr('class', 'huge dialogImage')
.text('🌴')))
.append($('<div>').attr('class', 'dialogText')
.append($('<h1>').text(PTL.tr('Pétrolette is cool')))
.append($('<h2>').text(PTL.tr('Free as the wind')))
.append($('<p>').text(PTL.tr('Pétrolette is designed from the outset to respect the user: It does not embed any tracker or statistical tool, and does not call on any online resource.')))
.append($('<p>').text(PTL.tr('Pétrolette is completely transparent, its source code is directly available.')))
.append($('<p>').text(PTL.tr('This site is just a test instance ; You can install Pétrolette on your own server and manage it on your own.'))));
var $nag3 = $('<div>').attr('class', 'dialogContent')
.append($('<div>').attr('class', 'dialogImage')
.append($('<span>')
.attr('class', 'huge dialogImage')
.text('🌱')))
.append($('<div>').attr('class', 'dialogText')
.append($('<h1>').text(PTL.tr('Pétrolette is growing')))
.append($('<h2>').text(PTL.tr('Early and often')))
.append($('<p>').text(PTL.tr('A lot of exciting things are in the pipeline:'))
.append($('<ul>').attr('class', 'dialogTextList')
.append($('<li>')
.append($('<a>').attr('href', 'https://framagit.org/yphil/petrolette/-/issues/72')
.append($('<span>')
.attr('class', 'translate')
.text(PTL.tr('Dedicated feeds')))))
.append($('<li>')
.append($('<a>').attr('href', 'https://framagit.org/yphil/petrolette/-/issues/48')
.append($('<span>')
.attr('class', 'translate')
.text(PTL.tr('Even better mobile device experience')))))
.append($('<li>')
.append($('<a>').attr('href', 'https://framagit.org/yphil/petrolette/-/issues/59')
.append($('<span>')
.attr('class', 'translate')
.text(PTL.tr('HTTPS / SSL')))))
.append($('<li>')
.append($('<a>').attr('href', 'https://framagit.org/yphil/petrolette/-/issues/63')
.append($('<span>')
.attr('class', 'translate')
.text(PTL.tr('Asynchronous / infinite loading of feed items')))))
.append($('<li>')
.append($('<a>').attr('href', 'https://framagit.org/yphil/petrolette/-/issues/new?issue')
.append($('<span>')
.attr('class', 'translate')
.text(PTL.tr('Any improvement or proposal you have for Pétrolette')))))))
.append($('<p>').text(PTL.tr('In order to keep developing Pétrolette with new features I need your help.')))
.append($('<p>').text(PTL.tr('Please consider to support the Pétrolette project by sending a donation. Even the smallest amount will help a lot.'))));
var $nags = [$nag1, $nag2, $nag3];
var random = Math.floor(Math.random() * $nags.length);
$dialogs.html('').empty().append($nags[random]);
// $dialog.append($nags[random]);
$dialog.dialog({
title: PTL.tr('Support Pétrolette'),
autoOpen: true,
buttons: [
{
text: PTL.tr('Cancel'),
title: PTL.tr('Cancel'),
class: 'ui-state-default translate',
click: function() {
PTL.dialog.kill($dialog);
}
},
{
text: PTL.tr('Donate'),
title: PTL.tr('Send your love to Pétrolette'),
class: 'translate ui-state-focus',
click: function(e) {
e.preventDefault();
window.open('https://liberapay.com/yPhil/donate');
}
}
],
open: function () {
$('.ui-widget-overlay').on('click', function() {
PTL.dialog.kill($dialog);
});
const $beggar = $('#beggar'),
$beggarH4 = $('#beggar > h4'),
$beggarOkButton = $('#beggar > #beggarOkButton'),
$beggarNoButton = $('#beggar > #beggarNoButton');
$beggarOkButton.on('click', function() {
$beggar.fadeOut('fast');
window.open('https://liberapay.com/yPhil/donate');
});
}
});
$beggarH4.on('click', function() {
$beggar.fadeOut('fast');
});
$dialog.dialog('open');
$beggarNoButton.on('click', function() {
$beggar.fadeOut('fast');
});
});
}
$beggar.fadeIn('fast');
},
help:function() {
......
......@@ -110,7 +110,7 @@ PTL.feed = {
var $titleDiv = $('<div>')
.attr('title', url)
.attr('class', 'feed-title truncate');
.attr('class', 'feed-title trucate');
var $titleLink = $('<a>')
.attr('href', url)
......@@ -118,8 +118,8 @@ PTL.feed = {
.html(url);
$feedControls.hover (
function() {$(this).find('.collapsible').show('fade', 'fast');},
function() {$(this).find('.collapsible').hide('fade', 'slow');}
function() {$(this).find('.collapsible').show();},
function() {$(this).find('.collapsible').hide('fade', 'fast');}
);
$header.hover (function() {
......
......@@ -100,10 +100,10 @@ PTL.i18n.translations = {
"Help me pay the bills" : { fr: "Aide-moi à payer les factures" , ja: "手形を支払うのを手伝ってください", es: "Ayúdame a pagar las facturas" },
"Pétrolette is free software. However the development requires " : { fr: "Pétrolette est un logiciel libre. Cependant, le développement demande " , ja: "Pétroletteはフリーソフトウェアです。 ただし、開発には多くの時間と作業が必要です。", es: "Pétrolette es un software gratuito. Sin embargo, el desarrollo requiere " },
" a lot of time " : { fr: " beaucoup de temps " , ja: "多くの時間", es: " mucho tiempo " },
" and " : { fr: " et " , ja: "そして", es: " y " },
" a lot of work" : { fr: " beaucoup de travail" , ja: "多くの作業", es: " mucho trabajo" },
"Pétrolette is free software. However the development requires" : { fr: "Pétrolette est un logiciel libre. Cependant, le développement demande" , ja: "Pétroletteはフリーソフトウェアです。 ただし、開発には多くの時間と作業が必要です。", es: "Pétrolette es un software gratuito. Sin embargo, el desarrollo requiere" },
"a lot of time" : { fr: "beaucoup de temps" , ja: "多くの時間", es: "mucho tiempo" },
"and" : { fr: "et" , ja: "そして", es: "y" },
"a lot of work" : { fr: "beaucoup de travail" , ja: "多くの作業", es: "mucho trabajo" },
"In order to keep developing Pétrolette with new features I need your help." : { fr: "Afin de continuer à développer Pétrolette avec de nouvelles fonctionnalités, j'ai besoin de votre aide." , ja: "新しい機能を備えたペトロレットを開発し続けるために、私はあなたの助けが必要です。", es: "Para seguir desarrollando Pétrolette con nuevas funciones, necesito su ayuda." },
"Please consider to support the Pétrolette project by sending a donation. Even the smallest amount will help a lot." : { fr: "Pensez à soutenir le projet Pétrolette en envoyant un don. Même la plus petite quantité aidera beaucoup." , ja: "寄付を送って、ペトロレットプロジェクトを支援することを検討してください。 少量でも大いに役立ちます。", es: "Considere apoyar el proyecto Pétrolette enviando una donación. Incluso la cantidad más pequeña ayudará mucho." },
......
......@@ -64,7 +64,6 @@ var PTL = (function() {
$('body').on('click','.help-button', function() {
PTL.dialog.help();
// PTL.util.nagUser();
});
$('body').on('click','.new-feed-button', function() {
......
const should = require('should'),
fs = require('fs'),
pjson = require('../package.json'),
request = require('request');
describe('Pétrolette', function() {
it('Favicon cache created', function(done) {
fs.access(pjson.FAVICONS_CACHE_DIR, function(err) {
if (err) return done(err);
done();
});
});
it('Favicon cache dir writeable', function(done) {
fs.access(pjson.FAVICONS_CACHE_DIR, fs.constants.W_OK, function(err) {
if (err) return done(err);
done();
});
});
it('Intro.js is installed and built', function(done) {
fs.access(__dirname + '/../bower_components/intro.js/dist/minified/intro.min.js', function(err) {
if (err) return done(err);
done();
});
});
it('Pétrolette server is running', function(done) {
request('http://localhost:8000', { json: true }, (err, res, body) => {
if (err) return done(err);
res.statusCode.should.eql(200);
done();
});
});
it('Pétrolette is returning a feed', function(done) {
request('http://localhost:8000/discover/?url=http://lemonde.fr', { json: true }, (err, res, body) => {
if (err) return done(err);
body.should.eql('https://www.lemonde.fr/rss/une.xml');
done();
});
});
// it('Pétrolette is returning a favicon', function(done) {
// request('http://localhost:8000/favicon/?url=http://lemonde.fr', { json: true }, (err, res, body) => {
// if (err) return done(err);
// body.should.eql('https://www.lemonde.fr/favicon.ico');
// done();
// });
// });
});
......@@ -73,8 +73,92 @@
href="/static/css/petrolette.css" />
</noscript>
<script src="/bower/jquery/dist/jquery.min.js"></script>
<script src="/bower/jquery-ui/jquery-ui.min.js"></script>
<script src="/bower/jquery/dist/jquery.js"></script>
<!-- <script src="/bower/jquery-ui/jquery-ui.js"></script>
-->
<script src="/bower/jquery-ui/ui/version.js"></script>
<script src="/bower/jquery-ui/ui/core.js"></script>
<script src="/bower/jquery-ui/ui/data.js"></script>
<script src="/bower/jquery-ui/ui/disable-selection.js"></script>
<script src="/bower/jquery-ui/ui/focusable.js"></script>
<script src="/bower/jquery-ui/ui/form.js"></script>
<script src="/bower/jquery-ui/ui/ie.js"></script>
<script src="/bower/jquery-ui/ui/keycode.js"></script>
<script src="/bower/jquery-ui/ui/labels.js"></script>
<script src="/bower/jquery-ui/ui/labels.js"></script>
<script src="/bower/jquery-ui/ui/jquery-1-7.js"></script>
<script src="/bower/jquery-ui/ui/plugin.js"></script>
<script src="/bower/jquery-ui/ui/safe-active-element.js"></script>
<script src="/bower/jquery-ui/ui/safe-blur.js"></script>
<script src="/bower/jquery-ui/ui/scroll-parent.js"></script>
<script src="/bower/jquery-ui/ui/tabbable.js"></script>
<script src="/bower/jquery-ui/ui/unique-id.js"></script>
<script src="/bower/jquery-ui/ui/widget.js"></script>
<script src="/bower/jquery-ui/ui/position.js"></script>
<script src="/bower/jquery-ui/ui/effect.js"></script>
<script src="/bower/jquery-ui/ui/effects/"></script>
<script src="/bower/jquery-ui/ui/effects/effect-blind.js"></script>
<script src="/bower/jquery-ui/ui/effects/effect-bounce.js"></script>
<script src="/bower/jquery-ui/ui/effects/effect-clip.js"></script>
<script src="/bower/jquery-ui/ui/effects/effect-drop.js"></script>
<script src="/bower/jquery-ui/ui/effects/effect-explode.js"></script>
<script src="/bower/jquery-ui/ui/effects/effect-fade.js"></script>
<script src="/bower/jquery-ui/ui/effects/effect-fold.js"></script>
<script src="/bower/jquery-ui/ui/effects/effect-highlight.js"></script>
<script src="/bower/jquery-ui/ui/effects/effect-puff.js"></script>
<script src="/bower/jquery-ui/ui/effects/effect-pulsate.js"></script>
<script src="/bower/jquery-ui/ui/effects/effect-scale.js"></script>
<script src="/bower/jquery-ui/ui/effects/effect-shake.js"></script>
<script src="/bower/jquery-ui/ui/effects/effect-size.js"></script>
<script src="/bower/jquery-ui/ui/effects/effect-slide.js"></script>
<script src="/bower/jquery-ui/ui/effects/effect-transfer.js"></script>
<script src="/bower/jquery-ui/ui/form-reset-mixin.js"></script>
<script src="/bower/jquery-ui/ui/keycode.js"></script>
<script src="/bower/jquery-ui/ui/labels.js"></script>
<script src="/bower/jquery-ui/ui/scroll-parent.js"></script>
<script src="/bower/jquery-ui/ui/tabbable.js"></script>
<script src="/bower/jquery-ui/ui/unique-id.js"></script>
<script src="/bower/jquery-ui/ui/widgets/accordion.js"></script>
<script src="/bower/jquery-ui/ui/widgets/accordion.js"></script>
<script src="/bower/jquery-ui/ui/widgets/autocomplete.js"></script>
<script src="/bower/jquery-ui/ui/widgets/button.js"></script>
<script src="/bower/jquery-ui/ui/widgets/checkboxradio.js"></script>
<script src="/bower/jquery-ui/ui/widgets/controlgroup.js"></script>
<script src="/bower/jquery-ui/ui/widgets/datepicker.js"></script>
<script src="/bower/jquery-ui/ui/widgets/dialog.js"></script>
<script src="/bower/jquery-ui/ui/widgets/draggable.js"></script>
<script src="/bower/jquery-ui/ui/widgets/droppable.js"></script>
<script src="/bower/jquery-ui/ui/widgets/menu.js"></script>
<script src="/bower/jquery-ui/ui/widgets/mouse.js"></script>
<script src="/bower/jquery-ui/ui/widgets/progressbar.js"></script>
<script src="/bower/jquery-ui/ui/widgets/resizable.js"></script>
<script src="/bower/jquery-ui/ui/widgets/resizable.js"></script>
<script src="/bower/jquery-ui/ui/widgets/selectmenu.js"></script>
<script src="/bower/jquery-ui/ui/widgets/slider.js"></script>
<script src="/bower/jquery-ui/ui/widgets/sortable.js"></script>
<script src="/bower/jquery-ui/ui/widgets/spinner.js"></script>
<script src="/bower/jquery-ui/ui/widgets/tabs.js"></script>
<script src="/bower/jquery-ui/ui/widgets/tooltip.js"></script>
<!--
<script src="/bower/jquery-ui/ui/escape-selector.js"></script>
<script src="/bower/jquery-ui/ui/form.js"></script>
<script src="/bower/jquery-ui/ui/ie.js"></script>
<script src="/bower/jquery-ui/ui/plugin.js"></script>
<script src="/bower/jquery-ui/ui/safe-active-element.js"></script>
<script src="/bower/jquery-ui/ui/safe-blur.js"></script>
<script src="/bower/jquery-ui/ui/version.js"></script>
-->
<script src="/bower/intro.js/dist/minified/intro.min.js"></script>
<script src="/bower/fancybox/dist/jquery.fancybox.min.js"></script>
<script src="/bower/remotestorage/release/remotestorage.js"></script>
......@@ -444,38 +528,6 @@
<script src="/static/js/PTL.sync.js"></script>
<script>