Commit 1a0d6202 authored by yPhil's avatar yPhil

Sys: PM2

parent aba98b4a
......@@ -12,13 +12,13 @@
"url": "https://framagit.org/yphil/petrolette"
},
"scripts": {
"start": "pm2 start -f bin/www --watch --log-date-format='YYYY-MM-DD HH:mm Z' --name ptl",
"stop": "pm2 stop ptl",
"start": "pm2 start pm2.config.json",
"stop": "pm2 stop petrolette",
"build:pre": "uglifyjs public/js/PTL.main.js public/js/PTL.prefs.js public/js/PTL.i18n.js -m -o dist/js/PTL.pre.min.js",
"build:post": "uglifyjs public/js/PTL.util.js public/js/PTL.tab.js public/js/PTL.src.js public/js/PTL.dialog.js public/js/PTL.sync.js -m -o dist/js/PTL.post.min.js",
"build:js": "mkdir -p dist/js cache-favicons && npm run build:pre && npm run build:post",
"watch:js": "onchange 'public/js/*.js' -- npm run build:js",
"postinstall": "npm run build:js && bower install"
"postinstall": "bower install"
},
"devDependencies": {
"onchange": "3.3.0",
......
......@@ -58,7 +58,7 @@ PTL.dialog = {
$dialog.dialog('open');
});
},
feedPrefs:function($button, isNewFeed) {
feedPrefs:function($button, isNewFeed, isQueryString) {
$('#dialogs').load('/static/templates/dialogs.html #feedPrefs', function() {
......@@ -67,8 +67,6 @@ PTL.dialog = {
var $dialog = $(this),
$dataStore = $button.parent().parent(),
$feed = $dataStore.parent().parent(),
feedId = $feed.attr('id'),
feedName = $feed.find('.source-title').text(),
allGroups = PTL.tab.list('all'),
$thisGroup = $feed.parent().parent(),
$groupMenu = $dialog.find('select#feedGroup');
......@@ -259,7 +257,7 @@ PTL.dialog = {
$('input:radio, input:checkbox').checkboxradio({
icon: false
});
});
$dialog.find('input#' + oldType || 'mixed').prop('checked', true)
.checkboxradio('refresh');
......@@ -472,17 +470,17 @@ PTL.dialog = {
.text(PTL.tr('Move focus to the next tab and immediately activate.'))));
var $kbShortCutsPanel = $('<table>')
.attr('class', 'keyboard-shortcuts')
.append($('<tr>')
.append($('<th>')
.text('Key'))
.append($('<th>')
.text('Command')))
.append($('<tr>')
.append($('<td>')
.html('<kbd><kbd class="key">CTRL</kbd>+<kbd class="key">UP</kbd></kbd>'))
.append($('<td>')
.text(PTL.tr('Move focus to associated tab.'))))
.attr('class', 'keyboard-shortcuts')
.append($('<tr>')
.append($('<th>')
.text('Key'))
.append($('<th>')
.text('Command')))
.append($('<tr>')
.append($('<td>')
.html('<kbd><kbd class="key">CTRL</kbd>+<kbd class="key">UP</kbd></kbd>'))
.append($('<td>')
.text(PTL.tr('Move focus to associated tab.'))))
.append($('<tr>')
.append($('<td>')
.html('<kbd><kbd class="key">ALT</kbd>/<kbd class="key">OPTION</kbd>+<kbd class="key">PAGE UP</kbd></kbd>'))
......@@ -541,7 +539,7 @@ PTL.dialog = {
title: PTL.tr('Add source'),
class: "translate",
click: function() {
PTL.src.add($('.column').first(), sourceUrl, 'mixed', 8, true);
PTL.src.add($('.column').first(), sourceUrl, 'mixed', 8, true, false);
PTL.dialog.kill($dialog);
}
}
......
......@@ -52,7 +52,7 @@ var PTL = (function() {
}
PTL.sideMenu('close');
PTL.src.add($column, 'New Feed', 'mixed', 8, true);
PTL.src.add($column, 'New Feed', 'mixed', 8, true, false);
});
$sourceCodeButton.click(function(event) {
......
......@@ -2,7 +2,7 @@
PTL.src = {
add:function($column, url, type, limit, clickNew, progress) {
add:function($column, url, type, limit, clickNew, isQueryString, progress) {
var feedIndex = $('#tabs').find('.feed').length;
......@@ -121,19 +121,19 @@ PTL.src = {
$(this).data('img', iconImg);
},
function() {
function() {
$feedIcon.removeClass('icon-down-big');
$feedIcon.removeClass('icon-down-big');
// $feedIcon.css('background-image', iconImg);
// $feedIcon.css('background-image', iconImg);
if ($(this).data('img') !== 'none') {
$feedToggle.css('background-image', $(this).data('img'));
} else {
$feedIcon.addClass('icon-rss');
}
if ($(this).data('img') !== 'none') {
$feedToggle.css('background-image', $(this).data('img'));
} else {
$feedIcon.addClass('icon-rss');
}
});
});
if (!PTL.util.isMobile()) {
$selectDiv.addClass('collapsible');
......@@ -168,7 +168,7 @@ PTL.src = {
if (clickNew) {
$feed.prependTo($column);
PTL.dialog.feedPrefs($feedPrefs, true);
PTL.dialog.feedPrefs($feedPrefs, true, isQueryString);
} else {
$feed.appendTo($column);
$feedReload.click();
......@@ -207,8 +207,7 @@ PTL.src = {
dataType: "json",
timeout: 2000
}, function(icon) {
console.log('icon: (%s)', icon);
console.log('ICON: (%s)', icon);
// console.log('ICON: (%s)', icon);
}).done(function(icon) {
$feedToggle.css('background-image','url("' + icon + '")');
......
......@@ -221,6 +221,15 @@ PTL.tab = {
$column.appendTo($tabPanel);
if (PTL.queryString) {
PTL.src.add($column, PTL.queryString, 'mixed', 8, true, true);
// PTL.dialog.addSource(PTL.queryString);
// console.log('PTL.queryString : (%s) isUrl: (%s)', PTL.queryString, PTL.util.isUrl(PTL.queryString));
PTL.queryString = null;
}
if (!newTab) {
sources.forEach(function(source) {
......@@ -228,7 +237,7 @@ PTL.tab = {
type = PTL.sourceTypes.includes(source.type) ? source.type : 'mixed',
limit = Number.isInteger(source.limit) ? source.limit : 8;
PTL.src.add($column, url, type, limit, false, progress);
PTL.src.add($column, url, type, limit, false, false, progress);
});
}
......
......@@ -397,12 +397,6 @@
PTL.tab.init();
if (PTL.queryString) {
PTL.dialog.addSource(PTL.queryString);
console.log('PTL.queryString : (%s) isUrl: (%s)', PTL.queryString, PTL.util.isUrl(PTL.queryString));
PTL.queryString = null;
}
});
......
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