Commit 6b00bdaa authored by Thierry BUGEAT's avatar Thierry BUGEAT

Merge branch 'release-1.1.0'

parents 0c5d331d 78994f95
---------------------------------------------------------
# myFeeds 1.1.0 (2015-10-06)
### New feature(s):
- #9 Add buttons next & previous news
### Improvement(s):
- #6 Update themes icones
- #15 Sort keywords by alphabetical order
- #26 Dates and times localization
- #25 Update subscriptions when application start
- #23 Add GPL licence
- #24 Add copyright in sources files
- #28 Add CHANGELOG file
### Bug(s):
- #7 Bug: Some photos are not displayed
- #27 Incorrect feeds last update date
---------------------------------------------------------
# myFeeds 1.0.1
### Improvement(s):
- Keep scrolling position after synchro
- Load only visibles images
---------------------------------------------------------
This diff is collapsed.
# myFeeds : RSS reader for Firefox OS
# myFeeds 1.1.0: RSS reader for Firefox OS
This project is now hosted by Framasoft.
The main GIT repository URL is now :
https://git.framasoft.org/thierry-bugeat/myFeeds
![myFeeds](http://thierry.bugeat.free.fr/myFeeds/images/myFeeds/features/scope.jpg)
[Visit website for more informations](http://thierry.bugeat.com/myFeeds/)
[Visit website for more informations](http://thierry.bugeat.com/myFeeds/)
## How to contribute ?
This project is now hosted by Framasoft. The Github repository is only a mirror. If you want to contribute, fork this project from url on https://git.framasoft.org/thierry-bugeat/myFeeds. (no registration needed, you can sign in with your Github account)
## Comment contribuer ?
Ce projet est maintenant hébergé par Framasoft. Le dépôt Github n'est qu'un mirroir. Si vous souhaitez contribuer, forkez ce projet depuis l'url https://git.framasoft.org/thierry-bugeat/myFeeds. (l'inscription n'est pas nécessaire et vous pouvez vous connecter avec votre compte Github)
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
version="1.1"
id="svg2"
viewBox="0 0 35.433071 35.433071"
height="10mm"
width="10mm">
<defs
id="defs4" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
style="display:inline"
transform="translate(0,-1016.9291)"
id="layer1">
<rect
y="1023.2002"
x="0"
height="13.616072"
width="35.477001"
id="rect4356-3"
style="display:inline;fill:#2C393B" />
<rect
y="1040.4982"
x="0"
height="5"
width="35.477001"
id="rect4356-31"
style="display:inline;fill:#2C393B" />
</g>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
version="1.1"
id="svg2"
viewBox="0 0 35.433071 35.433071"
height="10mm"
width="10mm">
<defs
id="defs4" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
style="display:inline"
transform="translate(0,-1016.9291)"
id="layer1">
<g
transform="translate(0,2.9997501)"
id="g3527">
<g
id="g3502">
<rect
y="1020.2283"
x="0"
height="10.133928"
width="16.696428"
id="rect3485"
style="fill:#2C393B" />
<rect
y="1020.2283"
x="18.848215"
height="10.133928"
width="16.696428"
id="rect3485-1"
style="fill:#2C393B" />
</g>
<g
transform="translate(0,12.156221)"
id="g3502-0">
<rect
y="1020.2283"
x="0"
height="10.133928"
width="16.696428"
id="rect3485-5"
style="fill:#2C393B" />
<rect
y="1020.2283"
x="18.848215"
height="10.133928"
width="16.696428"
id="rect3485-1-7"
style="fill:#2C393B" />
</g>
</g>
</g>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
version="1.1"
id="svg2"
viewBox="0 0 35.433071 35.433071"
height="10mm"
width="10mm">
<defs
id="defs4" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
style="display:inline"
transform="translate(0,-1016.9291)"
id="layer1">
<rect
y="1031.9158"
x="0"
height="5"
width="26.677"
id="rect4356"
style="fill:#2C393B" />
<rect
y="1023.2002"
x="0"
height="5"
width="26.677"
id="rect4356-3"
style="display:inline;fill:#2C393B" />
<rect
y="1040.4982"
x="0"
height="5"
width="26.677"
id="rect4356-31"
style="display:inline;fill:#2C393B" />
<rect
y="1031.9377"
x="29.360001"
height="5"
width="6.0770001"
id="rect4356-1"
style="display:inline;fill:#2C393B" />
<rect
y="1023.2221"
x="29.360001"
height="5"
width="6.0770001"
id="rect4356-3-0"
style="display:inline;fill:#2C393B" />
<rect
y="1040.5201"
x="29.360001"
height="5"
width="6.0770001"
id="rect4356-31-4"
style="display:inline;fill:#2C393B" />
</g>
</svg>
<!--
Copyright 2015 Thierry BUGEAT
This file is part of myFeeds.
myFeeds is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
myFeeds is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with myFeeds. If not, see <http://www.gnu.org/licenses/>.
-->
<!DOCTYPE HTML>
<html lang="en-US">
<head>
......@@ -104,9 +122,9 @@
<section role="mySubHeader">
<header class="mySystemHeader">
<h2 id="feedsEntriesNbDaysAgo"></h2>
<span id="displayGrid" class="fa fa-th-large fa-2x"></span>
<span id="displayList" class="fa fa-list-ul fa-2x"></span>
<span id="displayCard" class="fa fa-list-ol fa-2x"></span>
<span id="displayGrid" class="icone grid"></span>
<span id="displayList" class="icone list"></span>
<span id="displayCard" class="icone card"></span>
</header>
</section>
......@@ -176,6 +194,8 @@
<header>
<button id="closeMainEntry"><span data-icon="close"></span></button>
<button id="share"><span data-icon="share"></span></button>
<button id="nextEntry"><span data-icon="back"></span></button>
<button id="previousEntry"><span data-icon="forward"></span></button>
</header>
</section>
......
/**
* Copyright 2015 Thierry BUGEAT
*
* This file is part of myFeeds.
*
* myFeeds is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* myFeeds is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with myFeeds. If not, see <http://www.gnu.org/licenses/>.
*/
Number.isInteger = Number.isInteger || function(value) {
return typeof value === "number" &&
isFinite(value) &&
......
......@@ -50,3 +50,5 @@ confirm-delete-keyword=Are you sure you want delete this keyword ?
confirm-add-keyword=Are you sure you want add this keyword ?
keyword-was-added=Keyword was added.
keyword-was-not-added=Keyword was not added.
feedly-get-subscriptions-error=Feedly error:
no-news=No news
......@@ -50,3 +50,5 @@ confirm-delete-keyword=¿Esta seguro de querer borrar esta palabra clave?
confirm-add-keyword=¿Esta seguro de quere añadir esta palabra clave?
keyword-was-added=La palabra clave ha sido añadida.
keyword-was-not-added=La palabra clave no ha sido añadida.
feedly-get-subscriptions-error=Feedly error:
no-news=No noticia
......@@ -50,3 +50,5 @@ confirm-delete-keyword=Voulez-vous vraiment effacer ce mot clé ?
confirm-add-keyword=Voulez-vous vraiment ajouter ce mot clé ?
keyword-was-added=Le mot clé a été ajouté.
keyword-was-not-added=Le mot clé n'a pas été ajouté.
feedly-get-subscriptions-error=Erreur Feedly:
no-news=Pas d'actualité
......@@ -49,3 +49,5 @@ confirm-delete-keyword=Are you sure you want delete this keyword ?
confirm-add-keyword=Are you sure you want add this keyword ?
keyword-was-added=Keyword was added.
keyword-was-not-added=Keyword was not added.
feedly-get-subscriptions-error=Feedly erro:
no-news=No notícia
{
"name": "my Feeds",
"description": "RSS & ATOM feeds reader",
"version": "1.0.1",
"version": "1.1.0",
"launch_path": "/index.html",
"icons": {
"60": "/images/icon-60.png",
......
This diff is collapsed.
/**
* Copyright 2015 Thierry BUGEAT
*
* This file is part of myFeeds.
*
* myFeeds is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* myFeeds is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with myFeeds. If not, see <http://www.gnu.org/licenses/>.
*/
/* =============== */
/* --- MyFeeds --- */
/* =============== */
......@@ -207,3 +226,22 @@ MyFeeds.prototype.error = function (message, arguments) {
window.console && console.error(message, _arguments);
}
}
/**
* Is it a small entry ?
* @param {object} entry
* @return {boolean} true, false
* */
MyFeeds.prototype.isSmallEntry = function (entry) {
var _out;
var _diff = entry.content.length - entry.contentSnippet.length;
if (_diff < params.entries.maxLengthForSmallEntries) {
_out = true;
} else {
_out = false;
}
return _out;
}
/**
* Copyright 2015 Thierry BUGEAT
*
* This file is part of myFeeds.
*
* myFeeds is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* myFeeds is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with myFeeds. If not, see <http://www.gnu.org/licenses/>.
*/
/* ==================== */
/* --- Feedly Class --- */
......@@ -60,6 +78,36 @@ Feedly.prototype.getToken = function() {
return this.feedly.token;
}
/**
* Use "refresh_token" to obtain a new "access_token"
* @param {null}
* @return {CustomEvent} Feedly.getNewToken.done | Feedly.getNewToken.error
* */
Feedly.prototype.updateToken = function() {
_MyFeeds.log('Feedly.prototype.getNewToken()');
var _url = _Feedly.feedly.host + '/v3/auth/token';
var _params = 'refresh_token=' + encodeURIComponent(_Feedly.feedly.token.refresh_token) +
'&client_id=' + encodeURIComponent(_Feedly.feedly.client_id) +
'&client_secret=' + encodeURIComponent(_Feedly.feedly.client_secret) +
'&grant_type=refresh_token';
this.post(_url, _params, function(response) {
if (typeof response['errorMessage'] !== 'undefined') {
window.alert("Feedly Error : \n" + JSON.stringify(response));
_MyFeeds.log('CustomEvent : Feedly.getNewToken.error');
} else {
_Feedly.feedly.token.access_token = response.access_token;
_Feedly._save('cache/feedly/access_token.json', 'application/json', JSON.stringify(_Feedly.feedly.token));
_Feedly._save('cache/feedly/access_token.new.json', 'application/json', JSON.stringify(response));
document.body.dispatchEvent(new CustomEvent('Feedly.getNewToken.done', {"detail": response}));
_MyFeeds.log('CustomEvent : Feedly.getNewToken.done');
}
});
}
/**
* @param {null}
* @return {CustomEvent} Feedly.login.done | Feedly.login.error
......
/**
* Copyright 2015 Thierry BUGEAT
*
* This file is part of myFeeds.
*
* myFeeds is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* myFeeds is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with myFeeds. If not, see <http://www.gnu.org/licenses/>.
*/
/* ======================== */
/* --- GoogleFeed Class --- */
......@@ -174,10 +192,14 @@ GoogleFeed.prototype.addEntries = function(entries) {
// Dans le timestamp en "ms" j'ajoute une valeur aléatoire pour ne pas avoir 2 dates de publication identiques.
// J'ajoute une valeur comprise entre 0 et 500 (0 à 0.5 seconde).
//
_entry['_myTimestamp'] = Math.round(new Date(_entry.publishedDate).getTime()/1000);
_entry['_myTimestampInMs'] = Math.round(new Date(_entry.publishedDate).getTime()) + (Math.floor(Math.random()*500));
var _date = new Date(_entry.publishedDate);
_entry['_myTimestamp'] = Math.round(_date.getTime()/1000);
_entry['_myTimestampInMs'] = Math.round(_date.getTime()) + (Math.floor(Math.random()*500));
_entry['_myLocalizedDate'] = ""; // Due to severe performances issues dates are generated later
_entry['_myLocalizedTime'] = ""; // Due to severe performances issues times are generated later
_entry['_myPublishedDateUTC'] = new Date(_entry.publishedDate).toUTCString();
_entry['_mySha256_title'] = (_entry['_myFeedInformations']['_myFeedId'] + _entry['title']).toString();
_entry['_mySha256_link'] = (_entry['_myFeedInformations']['_myFeedId'] + _entry['link']).toString();
......@@ -238,6 +260,12 @@ GoogleFeed.prototype.deleteEntries = function(account, feedId) {
* */
GoogleFeed.prototype.deleteOldEntries = function(timestamp) {
_MyFeeds.log('deleteOldEntries(' + timestamp + ')');
var date = new Date(timestamp * 1000);
var dateTimeString = date.getFullYear() + '-' + ('0' + (date.getMonth() + 1)).slice(-2) + '-' + ('0' + date.getDate()).slice(-2) + ' ' + ('0' + date.getHours()).slice(-2) + ':' + ('0' + date.getMinutes()).slice(-2);
_MyFeeds.log('deleteOldEntries(' + dateTimeString + ') => ' + this.gf_unsortedEntries.length + ' entrie(s)');
var _tmp = [];
var _oldEntries = 0;
......@@ -264,6 +292,7 @@ GoogleFeed.prototype.addFeed = function(feed) {
var _myNewfeed = feed;
var _myNewEntries = feed.entries;
var _lastUpdateTimestamp = 0;
for (var i = 0; i < _myNewEntries.length; i++) {
_myNewEntries[i]._myFeedInformations = feed;
......@@ -273,17 +302,21 @@ GoogleFeed.prototype.addFeed = function(feed) {
// Add custom values.
_myNewfeed['_myNbEntries'] = _myNewEntries.length;
_myNewfeed['_myLastPublishedDate'] = _myNewEntries[0].publishedDate; // Non, les news ne sont pas ordonnées par date
_myNewfeed['_myLastTimestamp'] = _myNewEntries[0]._myTimestamp; // Non, les news ne sont pas ordonnées par date
_myNewfeed['_myLastTimestampInMs'] = _myNewEntries[0]._myTimestampInMs; // Non, les news ne sont pas ordonnées par date
//_myNewfeed['_myFeedId'] = _myNewfeed._myFeedId;
// Pulsations ?
var _timestamps = [];
var _timestamp = 0;
for (var i = 0; i < _myNewEntries.length; i++) {
_timestamps.push(Math.round(new Date(_myNewEntries[i].publishedDate).getTime() / 1000));
_timestamp = Math.round(new Date(_myNewEntries[i].publishedDate).getTime() / 1000);
_timestamps.push(_timestamp);
if ((_lastUpdateTimestamp < _timestamp)
&& (((params.entries.displaySmallEntries == false) && (!_MyFeeds.isSmallEntry(_myNewEntries[i])))
|| (params.entries.displaySmallEntries == true))
){
_lastUpdateTimestamp = _timestamp;
}
}
var _timestampMin = Math.min.apply(Math, _timestamps);
......@@ -299,6 +332,14 @@ GoogleFeed.prototype.addFeed = function(feed) {
else if (_myPulsations > 3 ) { _myNewfeed['_myPulsationsIcone'] = 'wifi-2'; }
else { _myNewfeed['_myPulsationsIcone'] = 'wifi-1'; }
// /!\ The 3 following values are false. Entries are not sorted by dates.
var _date = new Date(_lastUpdateTimestamp * 1000);
_myNewfeed['_myLastPublishedDate'] = _date.toLocaleString(userLocale);
_myNewfeed['_myLastTimestamp'] = _lastUpdateTimestamp;
_myNewfeed['_myLastTimestampInMs'] = _lastUpdateTimestamp;
// Remove values.
delete _myNewfeed.entries;
......@@ -464,3 +505,22 @@ GoogleFeed.prototype.get = function (url, myParams) {
}); // Schedule the execution for later
});
}
/**
* Is it a small entry ?
* @param {object} entry
* @return {boolean} true, false
* */
GoogleFeed.prototype.isSmallEntry = function (entry) {
var _out;
var _diff = entry.content.length - entry.contentSnippet.length;
if (_diff < params.entries.maxLengthForSmallEntries) {
_out = true;
} else {
_out = false;
}
return _out;
}
/**
* Copyright 2015 Thierry BUGEAT
*
* This file is part of myFeeds.
*
* myFeeds is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* myFeeds is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with myFeeds. If not, see <http://www.gnu.org/licenses/>.
*/
/* ============================ */
/* --- The Old Reader Class --- */
......
/**
* Copyright 2015 Thierry BUGEAT
*
* This file is part of myFeeds.
*
* myFeeds is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* myFeeds is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with myFeeds. If not, see <http://www.gnu.org/licenses/>.
*/
// DOM elements :
var main = document.getElementById('main');
......@@ -13,6 +32,10 @@ var dom = {
"topups": {
"entries": document.getElementById("topup"),
"feeds": document.getElementById("topupFeedsList")
},
"entry": {
"next": document.getElementById("nextEntry"),
"previous": document.getElementById("previousEntry")
}
};
var search = document.getElementById("search");
......
<!--
Copyright 2015 Thierry BUGEAT
This file is part of myFeeds.
myFeeds is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
myFeeds is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with myFeeds. If not, see <http://www.gnu.org/licenses/>.
-->
<html>
<header></header>
<body>
......
/**
* Copyright 2015 Thierry BUGEAT
*
* This file is part of myFeeds.
*
* myFeeds is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* myFeeds is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with myFeeds. If not, see <http://www.gnu.org/licenses/>.
*/
opener.feedly._loginCallback(location.href);
window.close();
/**
* Example : https://developer.mozilla.org/en-US/docs/Web/API/Touch_events#Example
* */
* Copyright 2015 Thierry BUGEAT
*
* This file is part of myFeeds.
*
* myFeeds is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* myFeeds is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with myFeeds. If not, see <http://www.gnu.org/licenses/>.
*/
function _swipe(callback) {
myGesture = new Object();
......
......@@ -3,6 +3,27 @@
/* Responsive images – how to prevent reflow */
/* http://andmag.se/2012/10/responsive-images-how-to-prevent-reflow/ */
.icone {
height:4rem;
padding:0;
margin:0;
}
.card{
background: url("/images/card.svg") no-repeat center center;
background-size: 2rem 2.5rem;
}
.list{
background: url("/images/list.svg") no-repeat center center;
background-size: 2rem 2.5rem;
}
.grid{
background: url("/images/grid.svg") no-repeat center center;
background-size: 2rem 2.5rem;
}
/* ======================== */
/* --- Entry LIST theme --- */
/* ======================== */
......
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