Commit 78a63a26 authored by yPhil's avatar yPhil

Tab: Manage empty columns

parent ce57ad59
......@@ -15,7 +15,7 @@
"start": "pm2 start -f bin/www --watch --log-date-format='YYYY-MM-DD HH:mm Z' --name PTL",
"stop": "pm2 stop PTL",
"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.utilities.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: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"
......
......@@ -9,11 +9,12 @@
--ui-color-oct: #2b2b2b;
--ui-color-title-one: #ff4136;
--ui-color-console-bg: #002b36;
--ui-color-message-normal: #268bd2;
--ui-color-message-error: #dc322f;
--ui-color-message-success: #859900;
--ui-color-message-warning: #b58900;
--ui-color-console-bg: #eee8d5;
--ui-color-console-fg: #002b36;
--ui-color-console-normal: #268bd2;
--ui-color-console-error: #dc322f;
--ui-color-console-success: #859900;
--ui-color-console-warning: #b58900;
--ui-color-rss: #f26522;
......@@ -146,40 +147,49 @@ div.dialog {
}
#console {
/* background-color: var(--ui-color-oct); */
/* max-height: 100px; */
border-radius: 3px;
border: 1px solid var(--ui-color-console);
color: var(--ui-color-console-fg);
cursor: pointer;
display: flex;
flex-direction: column-reverse;
overflow-y: scroll;
height: 100px;
max-height: 100px;
font-size: 7pt;
font-family: monospace;
height: 2.5em;
overflow-wrap: break-word;
overflow-y: scroll;
padding: 0 .2em;
position:relative;
transition: all .3s linear;
width: 100%;
padding: .2em;
color: var(--ui-color-message-normal);
background-color: var(--ui-color-oct);
border: 1px solid var(--ui-color-console);
text-align:left;
}
#console.expanded {
height: 100px;
}
#console > div > span.prompt {
margin-right: 3px;
font-weight: 900;
color: var(--ui-color-pri);
color: var(--ui-color-console-fg);
}
#console div.normal {
color: var(--ui-color-message-normal);
color: var(--ui-color-console-normal);
}
#console div.error {
color: var(--ui-color-message-error);
color: var(--ui-color-console-error);
}
#console div.success {
color: var(--ui-color-message-success);
color: var(--ui-color-console-success);
}
#console div.warning {
color: var(--ui-color-message-warning);
color: var(--ui-color-console-warning);
}
kbd.key {
......@@ -493,6 +503,7 @@ nav#side-menu {
}
nav#side-menu.expanded {
height: 100%;
left: 0px;
}
......@@ -561,6 +572,7 @@ fieldset {
background-color: var(--ui-color-sec);
}
#console,
.ui-state-hover,
.ui-widget-content .ui-state-hover,
.ui-widget-header .ui-state-hover,
......@@ -578,6 +590,8 @@ fieldset {
border: 3px solid var(--ui-color-sep);
}
#console:hover,
.ui-button-icon-only:focus,
.ui-slider-handle:focus,
.ui-slider-handle:hover,
.ui-button:hover,
......@@ -593,7 +607,10 @@ fieldset {
.ui-button-icon-only:hover,
.ui-button-icon-only:focus {
color: var(--ui-color-pri);
border: 1px solid var(--ui-color-sec);
}
.ui-button-icon-only:hover {
background-color: var(--ui-color-sec);
}
.ui-button:active,
......@@ -647,7 +664,7 @@ button.ui-state-error {
.dialog button.help-button {
background-color: var(--ui-color-success);
border-color: var(--ui-color-success);
/* border-color: var(--ui-color-success); */
color: var(--ui-color-pri);
padding: .4em;
}
......@@ -800,6 +817,11 @@ div.testFlex {
.column {
white-space: initial;
transition: all .3s linear;
}
.new-source-button {
margin-bottom: 0 !important;;
}
.ui-dialog.ui-corner-all {
......@@ -1118,6 +1140,7 @@ div.introjs-helperLayer {
.source-header {
background-color: var(--color-sen);
color: var(--color-pri);
transition: all .3s linear;
}
.fancybox-thumbs {
......
......@@ -22,15 +22,14 @@ PTL.col = {
.attr('class', 'buttons flex-box');
var $colLegend = $('<legend>')
.attr('class', 'legend unique')
.text(PTL.tr('Column') + ' ' + colIndex);
.attr('class', 'legend legend-col unique')
.text(PTL.tr('Column'));
var $srcLegend = $('<legend>')
.attr('class', 'legend unique')
.text(PTL.tr('Source'));
var $column = $('<ul>')
.attr('id', 'column-' + (colIndex - 1))
.attr('class', 'column')
.append($colButtons);
......@@ -58,12 +57,18 @@ PTL.col = {
$colDelButton.bind('click', function() {
var $column = $(this).parent().parent(),
$sourcesInCol = $column.find('.feed'),
nbOfSourcesInCol = $sourcesInCol.length;
$sourcesInCol = $column.find('.feed'),
nbOfSourcesInCol = $sourcesInCol.length;
console.log('nbOfSourcesInCol : (%s)', nbOfSourcesInCol);
console.log('nbOfSourcesInCol : (%s)', nbOfSourcesInCol);
if (nbOfSourcesInCol < 1) {
PTL.col.del($column, nbOfColumnsInTab);
} else {
PTL.dialog.killColumn($(this));
});
}
});
$colNewButton.bind('click', function() {
......@@ -75,52 +80,54 @@ PTL.col = {
var $newColumn = PTL.col.add(colIndex, nbOfColumnsInTab, true);
$panel.find('button.col-del').show();
PTL.util.reOrderColButtons($(this));
console.log('$column: (%s) nbOfColumnsInTab: (%s)', $column.attr('id'), nbOfColumnsInTab);
$panel.find('button.col-del').show();
$newColumn.insertAfter($column);
// PTL.util.reOrderColButtons($(this));
});
$column.sortable({
cursor: 'move',
handle: ".source-handle",
connectWith: ".column",
cursorAt: {top: 10, left: 32},
receive: function(e, ui) {
if (ui.helper)
ui.helper.first().removeAttr('style'); // undo styling set by jqueryUI
},
helper: function (e, item) { //create custom helper
if (!item.hasClass('selected')) item.addClass('selected');
// clone selected items before hiding
var $elements = $('.selected').not('.ui-sortable-placeholder').clone();
//hide selected items
item.siblings('.selected').addClass('hidden');
var $helper = $('<ul class="feedHelper">');
return $helper.append($elements);
},
start: function (e, ui) {
// Drag begins
var $elements = ui.item.siblings('.selected.hidden').not('.ui-sortable-placeholder');
// Store the selected items to item being dragged
ui.item.data('items', $elements);
// Size the placeHolder
$('.ui-sortable-placeholder').css('height', ui.item.height());
},
update: function (e, ui) {
//manually add the selected items before the one actually being dragged
ui.item.before(ui.item.data('items'));
},
stop: function (e, ui) {
//show the selected items after the operation
ui.item.siblings('.selected').removeClass('hidden');
//unselect since the operation is complete
$('.selected').removeClass('selected ui-state-hover');
$(this).find('i.source-select').removeClass('icon-ok').addClass('icon-check-empty-1');
PTL.tab.saveTabs();
}
$column.sortable({
cursor: 'move',
handle: ".source-handle",
connectWith: ".column",
cursorAt: {top: 10, left: 32},
receive: function(e, ui) {
if (ui.helper)
ui.helper.first().removeAttr('style'); // undo styling set by jqueryUI
},
helper: function (e, item) { //create custom helper
if (!item.hasClass('selected')) item.addClass('selected');
// clone selected items before hiding
var $elements = $('.selected').not('.ui-sortable-placeholder').clone();
//hide selected items
item.siblings('.selected').addClass('hidden');
var $helper = $('<ul class="feedHelper">');
return $helper.append($elements);
},
start: function (e, ui) {
// Drag begins
var $elements = ui.item.siblings('.selected.hidden').not('.ui-sortable-placeholder');
// Store the selected items to item being dragged
ui.item.data('items', $elements);
// Size the placeHolder
$('.ui-sortable-placeholder').css('height', ui.item.height());
},
update: function (e, ui) {
//manually add the selected items before the one actually being dragged
ui.item.before(ui.item.data('items'));
},
stop: function (e, ui) {
//show the selected items after the operation
ui.item.siblings('.selected').removeClass('hidden');
//unselect since the operation is complete
$('.selected').removeClass('selected ui-state-hover');
$(this).find('i.source-select').removeClass('icon-ok').addClass('icon-check-empty-1');
PTL.tab.saveTabs();
}
}).disableSelection();
......
......@@ -17,7 +17,7 @@ PTL.dialog = {
closeOnEscape: true,
resizable: false,
height: 'auto',
width: PTL.utilities.vWidth(),
width: PTL.util.vWidth(),
modal: true,
buttons: [
{
......@@ -31,7 +31,7 @@ PTL.dialog = {
],
open: function () {
PTL.utilities.translate();
PTL.util.translate();
$('.ui-widget-overlay').on('click', function() {
PTL.dialog.kill($dialog);
......@@ -43,7 +43,7 @@ PTL.dialog = {
PTL.sideMenu('close');
PTL.dialog.kill($dialog);
$('#tabs').tabs('option', 'active', 0);
PTL.utilities.help('ui');
PTL.util.help('ui');
});
$('.help-kb-shortcuts').on('click', function() {
......@@ -62,7 +62,7 @@ PTL.dialog = {
$('#dialogs').load('/static/templates/dialogs.html #feedPrefs', function() {
PTL.utilities.translate();
PTL.util.translate();
var $dialog = $(this),
$dataStore = $button.parent().parent(),
......@@ -87,7 +87,7 @@ PTL.dialog = {
closeOnEscape: true,
resizable: true,
height: 'auto',
width: PTL.utilities.vWidth(),
width: PTL.util.vWidth(),
modal: true,
buttons: [
{
......@@ -200,7 +200,7 @@ PTL.dialog = {
$dialog.parent().find('.ui-dialog-titlebar').append($helpButton);
if (!PTL.utilities.isMobile()) {
if (!PTL.util.isMobile()) {
$guessField.click(function() {
$(this).select();
});
......@@ -208,7 +208,7 @@ PTL.dialog = {
$helpButton.on('click', function() {
PTL.utilities.help('dialog');
PTL.util.help('dialog');
});
......@@ -324,15 +324,13 @@ PTL.dialog = {
$icon.addClass('icon-trash-empty danger');
console.log('There is %s sources', nbOfSourcesInCol);
$dialog.dialog({
title: PTL.tr('Delete column'),
autoOpen: false,
closeOnEscape: true,
resizable: false,
height: 'auto',
width: PTL.utilities.vWidth(),
width: PTL.util.vWidth(),
modal: true,
buttons: [
{
......@@ -355,8 +353,6 @@ PTL.dialog = {
],
open: function () {
console.log('NB : (%s)', nbOfColumnsInTab);
$('.ui-widget-overlay').on('click', function() {
PTL.dialog.kill($dialog);
});
......@@ -523,7 +519,7 @@ PTL.dialog = {
closeOnEscape: true,
resizable: false,
height: 'auto',
width: PTL.utilities.vWidth(),
width: PTL.util.vWidth(),
modal: true,
buttons: [
{
......@@ -546,7 +542,7 @@ PTL.dialog = {
],
open: function () {
if (!PTL.utilities.isUrl(sourceUrl)) {
if (!PTL.util.isUrl(sourceUrl)) {
h1 = 'Whoops!';
h2 = PTL.tr('Unrecognized URL: %1', sourceUrl);
} else {
......@@ -591,7 +587,7 @@ PTL.dialog = {
closeOnEscape: true,
resizable: false,
height: 'auto',
width: PTL.utilities.vWidth(),
width: PTL.util.vWidth(),
modal: true,
buttons: [
{
......@@ -618,7 +614,7 @@ PTL.dialog = {
$tabs.tabs('option', 'active', previousTabIndex).tabs('refresh');
} else {
console.error('Zero tabs!');
PTL.utilities.console(PTL.tr('Zero tabs!'), 'error');
PTL.util.console(PTL.tr('Zero tabs!'), 'error');
$('#noSourcesButton').fadeIn('slow');
}
......@@ -664,7 +660,7 @@ PTL.dialog = {
closeOnEscape: true,
resizable: false,
height: 'auto',
width: PTL.utilities.vWidth(),
width: PTL.util.vWidth(),
modal: true,
buttons: [
{
......@@ -717,7 +713,7 @@ PTL.dialog = {
closeOnEscape: true,
resizable: false,
height: 'auto',
width: PTL.utilities.vWidth(),
width: PTL.util.vWidth(),
modal: true,
buttons: [
{
......@@ -744,7 +740,7 @@ PTL.dialog = {
],
open: function() {
PTL.utilities.translate();
PTL.util.translate();
$('.ui-widget-overlay').on('click', function() {
PTL.dialog.kill($dialog);
......@@ -763,11 +759,11 @@ PTL.dialog = {
});
$tabLeft.button().click(function() {
PTL.utilities.moveEltLeft($tab);
PTL.util.moveEltLeft($tab);
});
$tabRight.button().click(function() {
PTL.utilities.moveEltRight($tab);
PTL.util.moveEltRight($tab);
});
$tabNameLegend.text(PTL.tr('Group name'));
......
......@@ -295,6 +295,10 @@ PTL.i18n.translations = {
"Remote file validation OK" : { fr: "Validation fichier distant OK" , ja: "リモートファイルの検証OK", es: "Validación remota de archivos OK" },
"Writing to remote storage OK" : { fr: "Ecriture sur le stockage distant OK" , ja: "リモートストレージへの書き込みOK", es: "Escribir en el almacenamiento remoto OK" },
"There was a problem writing to remote storage: [%1]" : { fr: "Un problème est survenu lors de l'écriture sur le stockage distant: [%1]" , ja: "リモートストレージへの書き込みに問題がありました:[%1]", es: "Hubo un problema al escribir en el almacenamiento remoto: [%1]" },
"Problem reading source [%1] Error type [%2]" : { fr: "Problème lecture source [%1] Type d'erreur [%2]", ja: "問題の読書の問題[%1]エラータイプ[%2]", es: "Problema al leer la fuente [%1] Tipo de error [%2]" },
"Error type" : { fr: "Type d'erreur", ja: "エラータイプ", es: "Tipo de error" },
......
......@@ -8,10 +8,7 @@ var PTL = (function() {
language: 'en',
start : function() {
PTL.utilities.console(PTL.tr('Pétrolette starting up'));
$('nav#top-menu')
.load('/static/templates/menu.html div#topnav', null);
PTL.util.console(PTL.tr('Pétrolette starting up'));
var $menu = $('nav#side-menu'),
$overlay = $('#overlay'),
......@@ -23,6 +20,10 @@ var PTL = (function() {
$slider = $('div#gallerySpeedSlider'),
$spinner = $('#gallerySpeedSpinner');
$('#console').click(function() {
$(this).toggleClass('expanded');
});
PTL.sync.attachWidget();
$('button').button();
......@@ -97,7 +98,7 @@ var PTL = (function() {
event.preventDefault();
});
PTL.utilities.translate();
PTL.util.translate();
$langMenu.val(PTL.prefs.readConfig('lang')).prop('selected', true);
......@@ -105,7 +106,7 @@ var PTL = (function() {
var selectedLang = $(this).val();
PTL.language = selectedLang;
PTL.prefs.writeConfig('lang', selectedLang);
PTL.utilities.translate();
PTL.util.translate();
});
$importButton.click(function () {
......@@ -167,11 +168,11 @@ var PTL = (function() {
}
});
$spinner.spinner('value', PTL.utilities.milliToSecs(gallerySlideshowSpeed));
$spinner.spinner('value', PTL.util.milliToSecs(gallerySlideshowSpeed));
$spinner.on( 'spinstop', function() {
$slider.slider( 'option', 'value', $(this).val() * 1000);
$('.ui-slider-handle').text(PTL.utilities.milliToSecs($(this).val() * 1000) + 's');
$('.ui-slider-handle').text(PTL.util.milliToSecs($(this).val() * 1000) + 's');
});
$slider.slider({
......@@ -185,12 +186,12 @@ var PTL = (function() {
max: 10000,
step: 500,
create: function() {
$(this).find('.ui-slider-handle').text(PTL.utilities.milliToSecs(gallerySlideshowSpeed) + 's');
$(this).find('.ui-slider-handle').text(PTL.util.milliToSecs(gallerySlideshowSpeed) + 's');
},
slide: function(event, ui) {
// $('#gallerySlideshowSpeedValue').text(ui.value + 'ms');
$spinner.val(PTL.utilities.milliToSecs(ui.value));
$(this).find('.ui-slider-handle').text(PTL.utilities.milliToSecs(ui.value) + 's');
$spinner.val(PTL.util.milliToSecs(ui.value));
$(this).find('.ui-slider-handle').text(PTL.util.milliToSecs(ui.value) + 's');
},
change: function(event, ui) {
......@@ -209,7 +210,7 @@ var PTL = (function() {
reader.onload = (function() {
return function(e) {
if (PTL.utilities.isPTLStruct(e.target.result)) {
if (PTL.util.isPTLStruct(e.target.result)) {
PTL.tab.empty();
// PTL.tab.populate(JSON.parse(e.target.result), true);
}
......
......@@ -136,7 +136,7 @@ PTL.src = {
});
if (!PTL.utilities.isMobile()) {
if (!PTL.util.isMobile()) {
$selectDiv.addClass('collapsible');
$deleteDiv.addClass('collapsible');
$prefsDiv.addClass('collapsible');
......@@ -192,14 +192,14 @@ PTL.src = {
$feedToggle = $feed.find('.source-toggle'),
$feedIcon = $feed.find('.source-toggle > i');
var l = PTL.utilities.getLocation(feedUrl),
var l = PTL.util.getLocation(feedUrl),
feedHost = l.protocol + '//' + l.hostname,
subdomain = l.hostname.substr(0, l.hostname.indexOf('.'));
if (!PTL.utilities.isUrl(feedUrl)) {
if (!PTL.util.isUrl(feedUrl)) {
console.info('bad URL: (%s)', feedUrl);
PTL.utilities.console(PTL.tr('Unrecognized URL: %1', feedUrl), 'warning');
PTL.util.console(PTL.tr('Unrecognized URL: %1', feedUrl), 'warning');
$feedTitle
.text(PTL.tr("Error"))
......@@ -360,7 +360,7 @@ PTL.src = {
var $tempDom = $('<null>').append($description);
if (typeof $tempDom.find('span a').attr('href') !== 'undefined') {
if (PTL.utilities.isImage($tempDom.find('span a').attr('href'))) {
if (PTL.util.isImage($tempDom.find('span a').attr('href'))) {
imageUrl = $tempDom.find('span a').attr('href');
}
}
......
......@@ -66,19 +66,19 @@ PTL.sync = (function() {
remoteStorage.on('connected', function() {
PTL.synchronized = true;
console.info('Pétrolette | ' + PTL.tr('Connected to remote storage'));
PTL.utilities.console(PTL.tr('Connected to remote storage'), 'ok');
PTL.util.console(PTL.tr('Connected to remote storage'), 'ok');
});
remoteStorage.on('not-connected', function() {
PTL.synchronized = false;
console.info('Pétrolette | ' + PTL.tr('NOT connected to remote storage'));
PTL.utilities.console(PTL.tr('NOT connected to remote storage'), 'warning');
PTL.util.console(PTL.tr('NOT connected to remote storage'), 'warning');
});
remoteStorage.on('disconnected', function() {
PTL.synchronized = false;
console.warn('Pétrolette | ' + PTL.tr('Disconnected from remote storage'));
PTL.utilities.console(PTL.tr('Disconnected from remote storage'), 'warning');
PTL.util.console(PTL.tr('Disconnected from remote storage'), 'warning');
});
......@@ -98,7 +98,7 @@ PTL.sync = (function() {
remoteStorage.petrolette.read()
.then((data) => {
if (PTL.utilities.isValidSourcesFile(JSON.parse(data))) {
if (PTL.util.isValidSourcesFile(JSON.parse(data))) {
console.info('Pétrolette | ' + PTL.tr('Remote file validation OK'));
......@@ -115,7 +115,7 @@ PTL.sync = (function() {
})
.catch((err) => {
PTL.utilities.console(PTL.tr('Remote file validation NOT OK (error [%1]) now reading from browser cache', err), 'error');
PTL.util.console(PTL.tr('Remote file validation NOT OK (error [%1]) now reading from browser cache', err), 'warning');
PTL.tab.populate(JSON.parse(PTL.prefs.readConfig('sources')));
......@@ -125,11 +125,12 @@ PTL.sync = (function() {
writeSync:function(sources) {
remoteStorage.petrolette.write(sources)
.then((data) => {
console.info('Pétrolette | Writing to remote storage OK: ', data);
.then(() => {
PTL.util.console(PTL.tr('Writing to remote storage OK'), 'success');
})
.catch((err) => {
console.error('Pétrolette | Remote file validation error:', err);
PTL.util.console(PTL.tr('There was a problem writing to remote storage: %1', err), 'warning');
});
}
......
......@@ -45,7 +45,7 @@ PTL.tab = {
PTL.dialog.killTab($(this));
});
if (PTL.utilities.isMobile()) {
if (PTL.util.isMobile()) {
$tabs.find('.source-controls > div').removeClass('collapsible');
}
......@@ -66,7 +66,7 @@ PTL.tab = {
});
PTL.tab.makeNewTabButton($tabs);
PTL.utilities.noSourcesButton();
PTL.util.noSourcesButton();
PTL.sync.readSync();
$("#theme").attr({href: '/static/css/themes/' + PTL.prefs.readConfig('theme') + '.css'});
......@@ -74,9 +74,8 @@ PTL.tab = {
},
saveTabs:function() {
var sources = PTL.tab.list();
console.log('sources LIST : (%s)', JSON.stringify(sources));
PTL.prefs.writeConfig('sources', JSON.stringify(sources));
// PTL.sync.writeSync(JSON.stringify(sources));
PTL.sync.writeSync(JSON.stringify(sources));
},
populate:function(sources) {
......@@ -84,7 +83,7 @@ PTL.tab = {
var nbOfGroups = 0,
nbOfSources = 0,
progress = PTL.utilities.buildProgress();
progress = PTL.util.buildProgress();
sources.forEach(function(group) {
nbOfGroups++;
......@@ -97,7 +96,7 @@ PTL.tab = {
console.log('nbOfGroups, nbOfSources: (%s) %s', nbOfGroups, nbOfSources);
PTL.utilities.console(PTL.tr('Found %1 groups containing %2 sources', nbOfGroups, nbOfSources), 'ok');
PTL.util.console(PTL.tr('Found %1 groups containing %2 sources', nbOfGroups, nbOfSources), 'success');
progress.init(nbOfSources);
......@@ -126,7 +125,7 @@ PTL.tab = {
});
thisTabCols.push(thisColSources);
});
PTL.tab.newTab($('#tabs'), thisGroup.name, thisTabCols, progress);
PTL.tab.add($('#tabs'), thisGroup.name, thisTabCols, progress);
// console.log('thisTabColsA: (%s)', JSON.stringify(thisTabCols));
// console.log('Group: %s, %s cols, %s sources', ThisGroup.name, cols, sources);
......@@ -139,9 +138,9 @@ PTL.tab = {
// $('#noSourcesButton').fadeIn('slow');
// PTL.tab.makeNewTabButton($('div#tabs'));
},
newTab:function($tabs, name, columns, progress) {
add:function($tabs, name, columns, progress) {
console.log('columns: (%s)', columns);
// console.log('columns: (%s)', columns);
$('#noSourcesButton').fadeOut('fast');
$('#new-group').removeClass('invisible');
......@@ -185,6 +184,8 @@ PTL.tab = {
ui.draggable.show().hide('fade', 300, function () {
console.log('$list: (%s)', $item.find('a').attr('href'));
// if ($('#tabDropActivate').prop('checked'))
$tabs.tabs('option', 'active', $index);
......@@ -205,9 +206,12 @@ PTL.tab = {
var newTab = false;
if (typeof columns === 'undefined') {
if (!columns || columns.length <= 0) {
console.log('there is no columns: (%s)');
console.log('undefined: (%s)');
newTab = true;
columns = ['empty'];
console.log('undefined');
}
var colIndex = 1,
......@@ -219,10 +223,11 @@ PTL.tab = {
$column.appendTo($tabPanel);
if (!newTab) {
sources.forEach(function(source) {
var url = PTL.utilities.isUrl(source.url) ? source.url : PTL.tr('Unrecognized URL'),
var url = PTL.util.isUrl(source.url) ? source.url : PTL.tr('Unrecognized URL'),
type = PTL.sourceTypes.includes(source.type) ? source.type : 'mixed',
limit = Number.isInteger(source.limit) ? source.limit : 8;
......@@ -302,7 +307,7 @@ PTL.tab = {
$newTabButtonLink.bind('click', function(event) {
event.stopImmediatePropagation();
PTL.tab.newTab($tabs);
PTL.tab.add($tabs);