Commit 4adf7296 authored by yPhil's avatar yPhil
Browse files

UI: CSS media: Two states

parent 4873000d
......@@ -6,7 +6,8 @@
--var-header-height: 26px;
--var-controls-width: 150px;
--var-controls-font-size: 16pt;
--var-controls-toggle-size: 18pt;
--var-controls-toggle-size: 18px;
--var-controls-flex-basis: 100px;
}
......@@ -15,9 +16,9 @@
--var-header-height: 42px;
--var-controls-width: 75%;
--var-controls-font-size: 26pt;
--var-controls-toggle-size: 28pt;
--var-controls-toggle-size: 28px;
--var-width: red;
--var-controls-flex-basis: 160px;
}
}
......@@ -42,6 +43,7 @@ body {
#nothingButton {
/* margin-top:50%; */
display:none;
}
li.ui-tabs-active,
......@@ -559,7 +561,7 @@ button > i {
.flexGrow {
flex-grow: 0 !important;
flex-shrink: 0 !important;
flex-basis: 100px !important;
flex-basis: var(--var-controls-flex-basis) !important;
}
.open {
......@@ -577,12 +579,33 @@ button > i {
flex-basis: auto;
margin: .2rem;
width : var(--var-controls-toggle-size);
}
.feedIcon {
width: var(--var-controls-toggle-size);
height: var(--var-controls-toggle-size);
background-size: var(--var-controls-toggle-size);
background-image: url("/static/images/feed-generic-rss.png");
background-repeat: no-repeat;
}
.tabSort .ui-sortable-placeholder {
visibility: visible !important;
border: 3px dashed !important;
}
.feedToggle > .ui-icon {
margin: .1rem .2rem 0 .1rem;
}
.mobHeader > .feedTitle {
flex-grow: 4;
flex-shrink: 1;
flex-basis: auto;
/* margin: .2em 0; */
font-size: var(--var-controls-font-size);
}
.mobHeader > .myControlsToggleDiv {
......@@ -590,7 +613,7 @@ button > i {
flex-shrink: 0;
flex-basis: auto;
cursor: pointer;
font-size: 18pt;
font-size: var(--var-controls-font-size);
}
.mobHeader > .feedControls {
......@@ -610,6 +633,11 @@ button > i {
.feedControl {
cursor:pointer;
font-size: var(--var-controls-font-size);
&:hover {
color: var(--ui-color-sec) !important;
}
}
.feedControl:hover {
......
......@@ -205,23 +205,6 @@ div.feedItem img.full {
min-width:100%;
}
.feedIcon {
width: 18px;
height: 18px;
background-image: url("/static/images/feed-generic-rss.png");
background-size: 18px;
background-repeat: no-repeat;
}
.tabSort .ui-sortable-placeholder {
visibility: visible !important;
border: 3px dashed !important;
}
.feedToggle > .ui-icon {
margin: .1rem .2rem 0 .1rem;
}
li.feedItem {
border:0 !important;
}
......
......@@ -36,11 +36,16 @@ MOB.dialog = {
});
var $rightSources = $('<button>').text('I want right sources');
var $noSources = $('<button>').text('I want to reset everything');
// MOB.tab.populate(JSON.parse(MOB.prefs.readConfig('tabs')));
$rightSources.click(function() {
MOB.tab.populate(JSON.parse(MOB.prefs.collection('rightFr')));
MOB.tab.populate(JSON.parse(MOB.prefs.collection('rightFr')));
});
$noSources.click(function() {
MOB.tab.empty();
});
var $nameLegend = $('<p class="name">').text(MOB.tr('I\'m a fascist'));
......@@ -48,7 +53,8 @@ MOB.dialog = {
$dialog.find('div.content')
.append($nameLegend)
.append($nameValue);
.append($nameValue)
.append($noSources);
}
});
......@@ -330,18 +336,17 @@ MOB.dialog = {
class: "dangerous translate",
click: function() {
$selectedTab.remove();
$selectedPanel.remove();
MOB.tab.saveTabs();
MOB.dialog.kill($dialog);
if ($.parseJSON(MOB.prefs.readConfig('tabs')).length > 0) {
$tabs.tabs('option', 'active', previousTabIndex).tabs('refresh');
} else {
console.error('Zero tabs!')
console.error('Zero tabs!');
$('#nothingButton').fadeIn('slow');
}
}
......
......@@ -41,7 +41,9 @@ $('<div id="menu">').appendTo($('body')).load('/static/templates/menu.html', fun
$handle.click();
MOB.dialog.question(0);
MOB.dialog.collection();
// MOB.dialog.question(0);
});
$help.click(function (event) {
......
MOB.prefs = (function() {
var tabList =
[{"name":"Actu",
"feeds":[
{"url":"http://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml","type":"photo","limit":16},
{"url":"http://feeds.bbci.co.uk/news/rss.xml?edition=int","type":"photo","limit":16},
{"url":"http://feeds.reuters.com/reuters/environment","type":"text","limit":16}
]},
{"name":"News",
"feeds": [
{"url":"http://feeds.reuters.com/news/artsculture","type":"text","limit": 12},
{"url":"http://feeds.reuters.com/reuters/businessNews","type":"mixed","limit": 8}
]},
{"name":"plup",
"feeds": [
{"url":"https://www.sciencedaily.com/rss/matter_energy/engineering.xml","type":"text","limit": 12},
{"url":"https://feeds.feedburner.com/TechCrunch/","type":"mixed","limit": 8},
{"url":"http://xkcd.com/rss.xml","type":"photo","limit": 4},
{"url":"https://www.reddit.com/.rss","type":"text","limit": 8}
]}
var tabList = [
{
"name":"Here",
"feeds":[
{
"url":"http://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml",
"type":"photo",
"limit":16
},
{
"url":"http://feeds.bbci.co.uk/news/rss.xml?edition=int",
"type":"photo",
"limit":16
},
{
"url":"http://feeds.reuters.com/reuters/environment",
"type":"text",
"limit":16
}
]
},
{
"name":"Abroad",
"feeds": [
{
"url":"http://feeds.reuters.com/news/artsculture",
"type":"text",
"limit": 12
},
{
"url":"http://feeds.reuters.com/reuters/businessNews",
"type":"mixed",
"limit": 8
}
]
},
{
"name":"Group 3",
"feeds": [
{
"url":"https://www.sciencedaily.com/rss/matter_energy/engineering.xml",
"type":"text",
"limit": 12
},
{
"url":"https://feeds.feedburner.com/TechCrunch/",
"type":"mixed",
"limit": 8
},
{
"url":"http://xkcd.com/rss.xml",
"type":"photo",
"limit": 4
},
{
"url":"https://www.reddit.com/.rss",
"type":"text",
"limit": 8
}
]
}
];
var fascistTabListEs =
[
{"name":"Spanish",
"feeds": [
{"url":"http://e00-elmundo.uecdn.es/rss/portada.xml",
"type":"mixed",
"limit": 12},
{"url":"https://feeds.feedburner.com/TechCrunch/","type":"mixed","limit": 8},
{"url":"http://xkcd.com/rss.xml","type":"photo","limit": 4},
{"url":"https://www.reddit.com/.rss","type":"text","limit": 8}
]
}
var fascistTabListEs = [
{"name":"Spanish",
"feeds": [
{"url":"http://e00-elmundo.uecdn.es/rss/portada.xml",
"type":"mixed",
"limit": 12},
{"url":"https://feeds.feedburner.com/TechCrunch/","type":"mixed","limit": 8},
{"url":"http://xkcd.com/rss.xml","type":"photo","limit": 4},
{"url":"https://www.reddit.com/.rss","type":"text","limit": 8}
]
}
];
var fascistTabListFr =
[
{"name":"Actu",
"feeds": [
{"url":"http://e00-elmundo.uecdn.es/rss/portada.xml",
"type":"mixed",
"limit": 12},
{"url":"https://feeds.feedburner.com/TechCrunch/","type":"mixed","limit": 8},
{"url":"http://xkcd.com/rss.xml","type":"photo","limit": 4},
{"url":"https://www.reddit.com/.rss","type":"text","limit": 8}
]
},
{"name":"Actu",
"feeds": [
{"url":"http://e00-elmundo.uecdn.es/rss/portada.xml",
"type":"mixed",
"limit": 12},
{"url":"https://feeds.feedburner.com/TechCrunch/","type":"mixed","limit": 8},
{"url":"http://xkcd.com/rss.xml","type":"photo","limit": 4},
{"url":"https://www.reddit.com/.rss","type":"text","limit": 8}
]
}
var fascistTabListFr = [
{"name":"Actu",
"feeds": [
{"url":"http://www.egaliteetreconciliation.fr/spip.php?page=backend",
"type":"text",
"limit": 16},
{"url":"https://feeds.feedburner.com/TechCrunch/","type":"mixed","limit": 8},
{"url":"http://xkcd.com/rss.xml","type":"photo","limit": 4},
{"url":"https://www.reddit.com/.rss","type":"text","limit": 8}
]
},
{"name":"News",
"feeds": [
{"url":"http://feeds.feedburner.com/breitbart?format=xml",
"type":"mixed",
"limit": 12},
{"url":"https://feeds.feedburner.com/TechCrunch/","type":"mixed","limit": 8},
{"url":"http://xkcd.com/rss.xml","type":"photo","limit": 4},
{"url":"https://www.reddit.com/.rss","type":"text","limit": 8}
]
}
];
// var newTabList = jQuery.extend(true, {}, tabList);
......
......@@ -3,13 +3,15 @@ MOB.tab = {
var allTabs = MOB.tab.all();
MOB.prefs.writeConfig('tabs', JSON.stringify(allTabs));
},
empty:function() {
$('div#tabs ul li').remove();
$('div#tabs div').remove();
$('#nothingButton').fadeIn('slow');
MOB.tab.saveTabs();
MOB.tab.makeNewTabButton($('div#tabs'));
},
populate:function(tabs, clickToRefresh) {
// if ($.parseJSON(MOB.prefs.readConfig('tabs')).length > 0) {
// }
$('div#tabs ul li').remove();
$('div#tabs div').remove();
......@@ -83,10 +85,12 @@ MOB.tab = {
$dummyTabLink.appendTo($newTabButton);
$newTabButton.appendTo($tabs.find('ul#tabUl'));
$tabs.tabs('refresh');
// $tabs.tabs('refresh');
},
make:function($tabs, name, feeds, progress) {
$('#nothingButton').fadeOut('fast');
var tabIndex = $('ul#tabUl li.mobTab').length + 1;
if (!name) name = 'Tab ' + tabIndex;
......@@ -176,13 +180,13 @@ MOB.tab = {
$thisTab.droppable({
tolerance: 'pointer',
over: function(event, ui) {
console.log('OVER (%s)', $(this).attr('class'));
// ui.item.css('cursor','copy');
},
console.log('OVER (%s)', $(this).attr('class'));
// ui.item.css('cursor','copy');
},
out: function(event, ui) {
console.log('OUT');
// ui.item.css('cursor','auto');
},
console.log('OUT');
// ui.item.css('cursor','auto');
},
accept: 'ul, .tabSort li',
hoverClass: 'ui-state-hover',
drop: function (event, ui) {
......
......@@ -118,7 +118,8 @@
if ($.parseJSON(MOB.prefs.readConfig('tabs')).length > 0) {
MOB.tab.populate(JSON.parse(MOB.prefs.readConfig('tabs')));
} else {
console.error('Zero tabs!')
console.error('Zero tabs!');
$('#nothingButton').fadeIn('slow');
}
// $tabs.find('div.feedControls').slideUp();
......
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