Commit 4873000d authored by yPhil's avatar yPhil
Browse files

Collection: Basic prototype OK

parent 8871e745
......@@ -41,7 +41,7 @@ body {
}
#nothingButton {
margin-top:50%;
/* margin-top:50%; */
}
li.ui-tabs-active,
......
......@@ -3,6 +3,59 @@ MOB.dialog = {
$dialog.dialog('destroy');
$('#mobDialogs').empty();
},
collection:function() {
$('#mobDialogs').load('/static/templates/dialogs.html #collectionDialog', function() {
var $dialog = $('#collectionDialog');
$dialog.dialog({
title: MOB.tr('Collection'),
autoOpen: false,
closeOnEscape: true,
resizable: false,
height: 'auto',
width: MOB.utilities.vWidth(),
modal: true,
buttons: [
{
text: MOB.tr('Ok'),
title: MOB.tr('Ok'),
class: 'translate',
click: function() {
MOB.dialog.kill($dialog);
}
}
],
open: function () {
MOB.utilities.translate();
$('.ui-widget-overlay').on('click', function() {
MOB.dialog.kill($dialog);
});
var $rightSources = $('<button>').text('I want right sources');
// MOB.tab.populate(JSON.parse(MOB.prefs.readConfig('tabs')));
$rightSources.click(function() {
MOB.tab.populate(JSON.parse(MOB.prefs.collection('rightFr')));
});
var $nameLegend = $('<p class="name">').text(MOB.tr('I\'m a fascist'));
var $nameValue = $('<p class="value">').html($rightSources);
$dialog.find('div.content')
.append($nameLegend)
.append($nameValue);
}
});
$dialog.dialog('open');
});
},
help:function() {
$('#mobDialogs').load('/static/templates/dialogs.html #helpDialog', function() {
......
......@@ -155,10 +155,11 @@ MOB.i18n.translations = {
"Source: Parameters" : { fr: "Source: Paramètres", ja: "フィード:パラメータ", es: "Source: Parámetros" },
"Source Type" : { fr: "Type de Source", ja: "フィードの種類", es: "Tipo de Source" },
"What type of source? All text, all image, or mixed" : { fr: "Quel type de source? Tout le texte, toute l'image, ou les deux", ja: "どんな種類の飼料ですか? すべてのテキスト、すべてのイメージ、または混合。", es: "¿Qué tipo de source? Todo el texto, toda la imagen o mixto" },
"Mixed" : { fr: "Mixte", ja: "混合", es: "Mezclado" },
"Image" : { fr: "Image", ja: "画像", es: "Imagen" },
"Text" : { fr: "Texte", ja: "テキスト", es: "Texto" },
"Collection" : { fr: "Collection", ja: "コレクション", es: "Colección" },
"Number of items" : { fr: "Nombre de titres", ja: "タイトル数", es: "Cantidad de títulos" },
"Number of sources" : { fr: "Nombre de sources", ja: "ソース数", es: "Cantidad de fuentes" },
......
......@@ -35,6 +35,30 @@ MOB.prefs = (function() {
}
];
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 newTabList = jQuery.extend(true, {}, tabList);
var defaults = {'gallerySlideTransition': 'fade',
......@@ -45,7 +69,12 @@ MOB.prefs = (function() {
'explicitLang': false,
'tabs': JSON.stringify(tabList)};
var collections = {'rightFr': JSON.stringify(fascistTabListFr)};
return {
collection:function(key) {
return collections[key];
},
readConfig:function(key) {
if(typeof localStorage.getItem(key) === 'undefined' || !localStorage.getItem(key)) {
......@@ -54,25 +83,25 @@ MOB.prefs = (function() {
return localStorage.getItem(key);
}
},
writeConfig:function(key, val) {
$('#progressBar').fadeToggle('fast');
// $('#savingIcon').fadeToggle('fast');
localStorage.setItem(key, val);
// $('#savingIcon').fadeToggle('slow');
$('#progressBar').fadeToggle('slow');
},
exportConfig:function(data, fileName) {
var a = document.createElement("a");
document.body.appendChild(a);
a.style = "display: none";
var json = JSON.stringify(data, null, 2),
blop = new Blob([json], {type: "application/json"}),
url = window.URL.createObjectURL(blop);
a.href = url;
a.download = fileName;
a.click();
window.URL.revokeObjectURL(url);
}
},
writeConfig:function(key, val) {
$('#progressBar').fadeToggle('fast');
// $('#savingIcon').fadeToggle('fast');
localStorage.setItem(key, val);
// $('#savingIcon').fadeToggle('slow');
$('#progressBar').fadeToggle('slow');
},
exportConfig:function(data, fileName) {
var a = document.createElement("a");
document.body.appendChild(a);
a.style = "display: none";
var json = JSON.stringify(data, null, 2),
blop = new Blob([json], {type: "application/json"}),
url = window.URL.createObjectURL(blop);
a.href = url;
a.download = fileName;
a.click();
window.URL.revokeObjectURL(url);
}
};
}());
......@@ -7,6 +7,15 @@
</div>
</div>
<div id="collectionDialog">
<div class="dialog">
<div class="icon">
<img class="warning" alt="Petrolette attention!" src="/static/images/icon-flamable.png"/>
</div>
<div class="content"></div>
</div>
</div>
<div id="questionDialog" title="Just answer the question">
<p class="ui">
Yo!
......
......@@ -104,6 +104,10 @@
MOB.dialog.killTab($(this));
});
$('button#nothingButton').click(function() {
MOB.dialog.collection();
});
// INIT
......
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