Commit ae0cbbbd authored by yPhil's avatar yPhil

Sys: Query-string enabled ; Now a call to petrolette.url?source=plop creates a new "plop" source

parent 771f9e56
...@@ -43,6 +43,7 @@ PTL.menu = { ...@@ -43,6 +43,7 @@ PTL.menu = {
$newSourceButton.click(function() { $newSourceButton.click(function() {
var $openGroupPanel = $($('.ui-tabs-active').find('a').attr('href')).find('.tabSort'); var $openGroupPanel = $($('.ui-tabs-active').find('a').attr('href')).find('.tabSort');
console.log('$openGroupPanel: ', $openGroupPanel.attr('class'));
$overlay.removeClass('visible'); $overlay.removeClass('visible');
$menu.removeClass('expanded'); $menu.removeClass('expanded');
PTL.feed.make($openGroupPanel, 'New Feed', 'mixed', 8, true); PTL.feed.make($openGroupPanel, 'New Feed', 'mixed', 8, true);
......
PTL.tab = { PTL.tab = {
init:function() { init:function(qstring) {
var $tabs = $('#tabs').tabs({ var $tabs = $('#tabs').tabs({
heightStyle: 'content', heightStyle: 'content',
...@@ -25,6 +25,10 @@ PTL.tab = { ...@@ -25,6 +25,10 @@ PTL.tab = {
} }
}); });
if (qstring) {
PTL.qstring = qstring;
}
$tabs.on('mouseup', '.ui-tabs-active a', function(e){ $tabs.on('mouseup', '.ui-tabs-active a', function(e){
e.preventDefault(); e.preventDefault();
if (e.which === 1) { if (e.which === 1) {
...@@ -161,7 +165,7 @@ PTL.tab = { ...@@ -161,7 +165,7 @@ PTL.tab = {
}, },
make:function($tabs, name, feeds, progress) { make:function($tabs, name, feeds, progress) {
$tabs.tabs(); // $tabs.tabs();
$('#noSourcesButton').fadeOut('fast'); $('#noSourcesButton').fadeOut('fast');
...@@ -174,6 +178,7 @@ PTL.tab = { ...@@ -174,6 +178,7 @@ PTL.tab = {
// .css('columns', 'auto ' + PTL.prefs.readConfig('columns')) // .css('columns', 'auto ' + PTL.prefs.readConfig('columns'))
.attr('id', 'sortable' + tabIndex); .attr('id', 'sortable' + tabIndex);
var $tabCloser = $('<i>') var $tabCloser = $('<i>')
.attr('class', 'icon-cancel tabCloser translate dangerous') .attr('class', 'icon-cancel tabCloser translate dangerous')
.data('title', PTL.tr('Delete the [%1] tab', name)) .data('title', PTL.tr('Delete the [%1] tab', name))
...@@ -229,6 +234,11 @@ PTL.tab = { ...@@ -229,6 +234,11 @@ PTL.tab = {
$sortable.appendTo($tabPanel); $sortable.appendTo($tabPanel);
$tabPanel.appendTo($tabs); $tabPanel.appendTo($tabs);
if (PTL.qstring) {
PTL.feed.make($('.tabSort').first(), PTL.qstring, 'mixed', 8, true);
PTL.qstring = null;
}
var $thisTabLink = $('<a href="#tab-' + tabIndex + '">' + name + '</a>'); var $thisTabLink = $('<a href="#tab-' + tabIndex + '">' + name + '</a>');
var $thisTab = $('<li>') var $thisTab = $('<li>')
......
...@@ -8,7 +8,7 @@ var feedrat = require('feedrat'); ...@@ -8,7 +8,7 @@ var feedrat = require('feedrat');
// require('request').debug = true; // require('request').debug = true;
router.get('/', function(req, res) { router.get('/', function(req, res) {
res.render('index'); res.render('index', {qstring:req.query.source});
}); });
router.use(function(req,res,next){ router.use(function(req,res,next){
......
...@@ -102,11 +102,21 @@ ...@@ -102,11 +102,21 @@
PTL.menu.top(); PTL.menu.top();
PTL.menu.side(); PTL.menu.side();
var qstring = "<%= qstring %>";
setTimeout( setTimeout(
function() { function() {
PTL.tab.init(); PTL.tab.init(qstring);
// if (qstring) {
// var $openGroupPanel = $('#sortable1');
// console.log('qstring: %s, $openGroupPanel: ', qstring, $openGroupPanel.get())
// }
}, 500); }, 500);
</script> </script>
</body> </body>
......
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