Commit c46149d8 authored by yPhil's avatar yPhil
Browse files

Port setup, autoselect txt inputs, console width, mobile feedPrefs dialog width

parent e38691d5
Pipeline #408169 passed with stage
in 47 seconds
# Changelog
## 1.2.8 (WIP)
## 1.2.8
- New option / dialog to merge the imported / open feeds with existing ones
- Feed name || URL in tooltip
- UTC Timestamps
- Better Item layout (Media/comment icons) and wrapping
- New option / dialog to merge the imported / open feeds with existing ones #e38691d5
- Better Item layout (Media/comment icons) and wrapping #c8158af2
- Better dialog defaults (WIP #9e3c8c2d)
- Server ports now set [in the config file](https://framagit.org/yphil/petrolette/-/blob/master/package.json)
- Autoselect in the text inputs
### Bugfixes
- In "photo" mode, vertical images wrapped around the text, fixed.
- In "photo" mode, vertical images wrapped around the text, fixed #2027005b
- Feed name || URL in tooltip #b02b049c
- UTC Timestamps #a5ccb4ae
- Console size adjusted
- Better "on error" favicon image handling
- Fixed a long, outstanding & known bug where the "new tab" button was not appended after an import, because of the weird gymnastics we have to do to make sure said button is always the last one, think about that
- Fixed a long, outstanding & known bug where the "new tab" button was not appended after an import, because of the weird gymnastics we have to do to make sure said button is always the last one, think about that when reviewing the (quite convoluted) code #b02b049c
- Some dialogs were not fully translated #e38691d5
## 1.2.7
......
......@@ -38,9 +38,8 @@ News feeds are organized into tabs, which can contain an infinite number of colu
git clone https://framagit.org/yphil/petrolette
cd petrolette
npm install
PTL_PORT_HTTP=8080
npm start
xdg-open http://localhost:$PTL_PORT_HTTP
xdg-open http://localhost:8000
```
#### Testing
......
const petrolette = require('../petrolette'),
pjson = require('../package.json'),
http = require('http'),
https = require('https'),
fs = require('fs');
......@@ -6,8 +7,8 @@ const petrolette = require('../petrolette'),
const httpServer = http.createServer(petrolette);
/* look for port in environment variable */
const portHttp = parseInt(process.env["PTL_PORT_HTTP"]) || 8000;
const portHttps = parseInt(process.env["PTL_PORT_HTTPS"]) || 8001;
const portHttp = pjson.HTTP_PORT || 8000;
const portHttps = pjson.HTTPS_PORT || 8001;
httpServer.listen(portHttp, () => {
console.debug('HTTP Server running on port %s', port);
......
{
"name": "petrolette",
"description": "News reading webapp.",
"version": "1.2.8b",
"version": "1.2.8",
"private": true,
"license": "GPL-3.0-only",
"HTTP_PORT": 8000,
"HTTPS_PORT": 8001,
"FAVICONS_CACHE_DIR": "favicons-cache",
"engines": {
"node": "*"
......
......@@ -44,6 +44,7 @@
--side-menu-width-expanded: 280px;
--side-menu-width: -291px;
--header-height: 22px;
--console-max-width: 242px;
--controls-width: 150px;
--controls-font-size: 14pt;
--favicon-width: 16px;
......@@ -68,6 +69,7 @@
--side-menu-width-expanded: 90%;
--side-menu-width: -999px;
--header-height: 2.2em;
--console-max-width: 278px;
--controls-width: 75%;
--controls-font-size: 22pt;
--favicon-width: 28px;
......@@ -759,7 +761,7 @@ nav#sideMenu.expanded {
resize: vertical;
height: 200px;
min-height: 2.5em;
max-width: 242px;
max-width: var(--console-max-width);
scrollbar-width: thin;
border-radius: 3px;
/* background-color: var(--color-ui-console-bg); */
......@@ -959,6 +961,10 @@ ul.help li.cloud::before {
align-items: center;
}
#feed-guess-div {
flex-wrap: nowrap;
}
.flex-box > label {
flex: 1;
flex-grow: 4;
......
......@@ -143,12 +143,12 @@ PTL.dialog = {
}
},
{
text: PTL.tr('Licence'),
title: PTL.tr('Licence'),
text: PTL.tr('Changelog'),
title: PTL.tr('Changelog'),
class: 'translate',
click: function() {
PTL.dialog.kill($dialog);
window.location.assign('/about/javascript');
window.open('https://framagit.org/yphil/petrolette/-/blob/master/CHANGELOG.md');
}
},
{
......@@ -248,7 +248,6 @@ PTL.dialog = {
$dialog.dialog({
title: isNewFeed ? PTL.tr('New feed') : PTL.tr('Feed'),
width: PTL.util.isMobile() ? 'auto' : 630,
buttons: [
{
text: PTL.tr('Cancel'),
......
......@@ -281,7 +281,7 @@ PTL.feed = {
errno = '5xx';
}
PTL.util.say(PTL.tr('Problem reading feed [%1] Error type [%2]', feedUrl, message), 'warning');
PTL.util.say(PTL.tr('Problem reading feed [%1] Error type [%2]', feedUrl, message), 'error');
var $validateLink = $('<a>'),
$validateLinkIcon = $('<i>'),
......
......@@ -30,7 +30,9 @@ var PTL = (function() {
$topMenu.removeAttr('style');
$sideMenu.removeAttr('style');
$searchPrefixInput.val(PTL.prefs.readConfig('searchPrefix'));
$searchPrefixInput
.attr('onclick', 'this.select()')
.val(PTL.prefs.readConfig('searchPrefix'));
$searchPrefixRestoreButton.click(function(){
console.log('val %s', $searchPrefixInput.val());
......@@ -386,9 +388,13 @@ var PTL = (function() {
closeOnEscape: true,
resizable: true,
height: 'auto',
width: PTL.util.vWidth(),
width: 'auto',
modal: true,
autoOpen: false
autoOpen: false,
position: {
my: "center",
at: "center",
of: window }
});
$.ui.dialog.prototype._init = function() {
......
......@@ -171,12 +171,12 @@ PTL.util = {
try {
var json = JSON.parse(o);
PTL.util.say(PTL.tr('Valid Pétrolette feeds file'), 'success', true);
PTL.util.say(PTL.tr('Valid Pétrolette feeds file'), 'success');
isJson = true;
} catch(e) {
isJson = false;
PTL.util.say(PTL.tr('This is not a valid Pétrolette feeds file'), 'warning');
PTL.util.say(PTL.tr('This is not a valid Pétrolette feeds file'), 'warning', true);
}
return isJson;
......
......@@ -3,12 +3,13 @@
<legend data-content="Location"
class="ui-corner-top translate">Location</legend>
<fieldset class="ui-widget ui-widget-content ui-corner-all">
<div class="flex-box">
<div id="feed-guess-div" class="flex-box">
<input name="guess"
id="feed-guess"
placeholder="https://xkcd.com/rss.xml or https://xkcd.com + SEARCH"
data-title="Enter a website address/URL and click search, then OK, or simply enter the URL of the feed and click OK"
value=""
onclick="this.select()"
class="ui-widget-content grow ui-corner-all translate"
/>
<button id="feedGuessButton"
......@@ -29,6 +30,7 @@
placeholder="Feed name"
data-title="Feed name"
value=""
onclick="this.select()"
class="ui-widget-content grow ui-corner-all translate"
/>
</div>
......
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