-
- {% trans "This can take a while and can even fail if you have too many articles, depending on your server configuration." %}
-
-
{% trans 'Add user' %}
-
{% trans 'Add a new user :' %}
-
-
-
{% trans "Delete account" %}
- {% if not only_user %}
- {% else %}
{% trans "You are the only user, you cannot delete your own account." %}
- {% trans "To completely remove wallabag, delete the wallabag folder on your web server." %}
{% endif %}
-
-{% endblock %}
From 30b948e68b53dcb8b79c2aa1b62b992045892e90 Mon Sep 17 00:00:00 2001
From: goofy-bz
Date: Fri, 2 Jan 2015 21:13:54 +0100
Subject: [PATCH 09/36] Update fr_FR.utf8.po
formulation (trivial)
---
locale/fr_FR.utf8/LC_MESSAGES/fr_FR.utf8.po | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/locale/fr_FR.utf8/LC_MESSAGES/fr_FR.utf8.po b/locale/fr_FR.utf8/LC_MESSAGES/fr_FR.utf8.po
index 3d031967b..849e66dcc 100644
--- a/locale/fr_FR.utf8/LC_MESSAGES/fr_FR.utf8.po
+++ b/locale/fr_FR.utf8/LC_MESSAGES/fr_FR.utf8.po
@@ -250,7 +250,7 @@ msgid ""
"your config file: IMPORT_LIMIT (how many articles are fetched at once) and "
"IMPORT_DELAY (delay between fetch of next batch of articles)."
msgstr ""
-"Sélectionner le fichier à importer sur votre disque dur, et pressez la "
+"Sélectionnez le fichier à importer sur votre disque dur, et pressez la "
"bouton « Importer » ci-dessous. wallabag analysera votre fichier, "
"ajoutera toutes les URL trouvées et commencera à télécharger les contenus si "
"nécessaire. Le processus de téléchargement est contrôlé par deux "
From 166ff0a0932ede6824a30d553c39ff6dd7dbb0b4 Mon Sep 17 00:00:00 2001
From: Thomas Citharel
Date: Sat, 3 Jan 2015 11:40:19 +0100
Subject: [PATCH 10/36] updated french mo file (see #986)
---
locale/fr_FR.utf8/LC_MESSAGES/fr_FR.utf8.mo | Bin 21037 -> 21037 bytes
1 file changed, 0 insertions(+), 0 deletions(-)
diff --git a/locale/fr_FR.utf8/LC_MESSAGES/fr_FR.utf8.mo b/locale/fr_FR.utf8/LC_MESSAGES/fr_FR.utf8.mo
index eed260b2e0a008835e8fcc661fb8d2035da8dc1b..83f397a05d37afd64e4e148c7340b97ae3144b2e 100644
GIT binary patch
delta 16
YcmZ3xgmLW>#tr9f7^^m4u!$7~06;ni3;+NC
delta 16
YcmZ3xgmLW>#tr9f7>hPvu!$7~06+={1ONa4
From 8ae45e7fe27ab416cf2a30cd2c319940037b7cbf Mon Sep 17 00:00:00 2001
From: Thomas Citharel
Date: Sat, 3 Jan 2015 13:03:26 +0100
Subject: [PATCH 11/36] fixes #963 and use our own readability.php file for
mobiClass
---
inc/3rdparty/libraries/MOBIClass/MOBI.php | 4 +-
.../readability/JSLikeHTMLElement.php | 110 --
.../MOBIClass/readability/Readability.php | 1069 -----------------
.../libraries/readability/Readability.php | 5 +-
inc/3rdparty/makefulltextfeed.php | 2 +
5 files changed, 7 insertions(+), 1183 deletions(-)
delete mode 100644 inc/3rdparty/libraries/MOBIClass/readability/JSLikeHTMLElement.php
delete mode 100644 inc/3rdparty/libraries/MOBIClass/readability/Readability.php
diff --git a/inc/3rdparty/libraries/MOBIClass/MOBI.php b/inc/3rdparty/libraries/MOBIClass/MOBI.php
index 17e718c12..df4826b04 100644
--- a/inc/3rdparty/libraries/MOBIClass/MOBI.php
+++ b/inc/3rdparty/libraries/MOBIClass/MOBI.php
@@ -1,5 +1,5 @@
\ No newline at end of file
+?>
diff --git a/inc/3rdparty/libraries/MOBIClass/readability/JSLikeHTMLElement.php b/inc/3rdparty/libraries/MOBIClass/readability/JSLikeHTMLElement.php
deleted file mode 100644
index 1a8ec88cb..000000000
--- a/inc/3rdparty/libraries/MOBIClass/readability/JSLikeHTMLElement.php
+++ /dev/null
@@ -1,110 +0,0 @@
-registerNodeClass('DOMElement', 'JSLikeHTMLElement');
-* $doc->loadHTML('
'
-* echo "\n\n";
-*
-* // set innerHTML
-* $elem->innerHTML = 'FiveFilters.org';
-* echo $elem->innerHTML; // prints 'FiveFilters.org'
-* echo "\n\n";
-*
-* // print document (with our changes)
-* echo $doc->saveXML();
-* @endcode
-*
-* @author Keyvan Minoukadeh - http://www.keyvan.net - keyvan@keyvan.net
-* @see http://fivefilters.org (the project this was written for)
-*/
-class JSLikeHTMLElement extends DOMElement
-{
- /**
- * Used for setting innerHTML like it's done in JavaScript:
- * @code
- * $div->innerHTML = '
Chapter 2
The story begins...
';
- * @endcode
- */
- public function __set($name, $value) {
- if ($name == 'innerHTML') {
- // first, empty the element
- for ($x=$this->childNodes->length-1; $x>=0; $x--) {
- $this->removeChild($this->childNodes->item($x));
- }
- // $value holds our new inner HTML
- if ($value != '') {
- $f = $this->ownerDocument->createDocumentFragment();
- // appendXML() expects well-formed markup (XHTML)
- $result = @$f->appendXML($value); // @ to suppress PHP warnings
- if ($result) {
- if ($f->hasChildNodes()) $this->appendChild($f);
- } else {
- // $value is probably ill-formed
- $f = new DOMDocument();
- $value = mb_convert_encoding($value, 'HTML-ENTITIES', 'UTF-8');
- // Using will generate a warning, but so will bad HTML
- // (and by this point, bad HTML is what we've got).
- // We use it (and suppress the warning) because an HTML fragment will
- // be wrapped around tags which we don't really want to keep.
- // Note: despite the warning, if loadHTML succeeds it will return true.
- $result = @$f->loadHTML(''.$value.'');
- if ($result) {
- $import = $f->getElementsByTagName('htmlfragment')->item(0);
- foreach ($import->childNodes as $child) {
- $importedNode = $this->ownerDocument->importNode($child, true);
- $this->appendChild($importedNode);
- }
- } else {
- // oh well, we tried, we really did. :(
- // this element is now empty
- }
- }
- }
- } else {
- $trace = debug_backtrace();
- trigger_error('Undefined property via __set(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_NOTICE);
- }
- }
-
- /**
- * Used for getting innerHTML like it's done in JavaScript:
- * @code
- * $string = $div->innerHTML;
- * @endcode
- */
- public function __get($name)
- {
- if ($name == 'innerHTML') {
- $inner = '';
- foreach ($this->childNodes as $child) {
- $inner .= $this->ownerDocument->saveXML($child);
- }
- return $inner;
- }
-
- $trace = debug_backtrace();
- trigger_error('Undefined property via __get(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_NOTICE);
- return null;
- }
-
- public function __toString()
- {
- return '['.$this->tagName.']';
- }
-}
-?>
\ No newline at end of file
diff --git a/inc/3rdparty/libraries/MOBIClass/readability/Readability.php b/inc/3rdparty/libraries/MOBIClass/readability/Readability.php
deleted file mode 100644
index 915542435..000000000
--- a/inc/3rdparty/libraries/MOBIClass/readability/Readability.php
+++ /dev/null
@@ -1,1069 +0,0 @@
-init();
-echo $r->articleContent->innerHTML;
-*/
-
-class Readability
-{
- public $version = '1.7.1-without-multi-page';
- public $convertLinksToFootnotes = false;
- public $revertForcedParagraphElements = true;
- public $articleTitle;
- public $articleContent;
- public $dom;
- public $url = null; // optional - URL where HTML was retrieved
- public $debug = false;
- protected $body = null; //
- protected $bodyCache = null; // Cache the body HTML in case we need to re-use it later
- protected $flags = 7; // 1 | 2 | 4; // Start with all flags set.
- protected $success = false; // indicates whether we were able to extract or not
-
- /**
- * All of the regular expressions in use within readability.
- * Defined up here so we don't instantiate them repeatedly in loops.
- **/
- public $regexps = array(
- 'unlikelyCandidates' => '/combx|comment|community|disqus|extra|foot|header|menu|remark|rss|shoutbox|sidebar|sponsor|ad-break|agegate|pagination|pager|popup|tweet|twitter/i',
- 'okMaybeItsACandidate' => '/and|article|body|column|main|shadow/i',
- 'positive' => '/article|body|content|entry|hentry|main|page|pagination|post|text|blog|story/i',
- 'negative' => '/combx|comment|com-|contact|foot|footer|footnote|masthead|media|meta|outbrain|promo|related|scroll|shoutbox|sidebar|sponsor|shopping|tags|tool|widget/i',
- 'divToPElements' => '/<(a|blockquote|dl|div|img|ol|p|pre|table|ul)/i',
- 'replaceBrs' => '/( ]*>[ \n\r\t]*){2,}/i',
- 'replaceFonts' => '/<(\/?)font[^>]*>/i',
- // 'trimRe' => '/^\s+|\s+$/g', // PHP has trim()
- 'normalize' => '/\s{2,}/',
- 'killBreaks' => '/( (\s| ?)*){1,}/',
- 'video' => '/http:\/\/(www\.)?(youtube|vimeo)\.com/i',
- 'skipFootnoteLink' => '/^\s*(\[?[a-z0-9]{1,2}\]?|^|edit|citation needed)\s*$/i'
- );
-
- /* constants */
- const FLAG_STRIP_UNLIKELYS = 1;
- const FLAG_WEIGHT_CLASSES = 2;
- const FLAG_CLEAN_CONDITIONALLY = 4;
-
- /**
- * Create instance of Readability
- * @param string UTF-8 encoded string
- * @param string (optional) URL associated with HTML (used for footnotes)
- */
- function __construct($html, $url=null)
- {
- /* Turn all double br's into p's */
- /* Note, this is pretty costly as far as processing goes. Maybe optimize later. */
- $html = preg_replace($this->regexps['replaceBrs'], '
', $html);
- $html = preg_replace($this->regexps['replaceFonts'], '<$1span>', $html);
- $html = mb_convert_encoding($html, 'HTML-ENTITIES', "UTF-8");
- $this->dom = new DOMDocument();
- $this->dom->preserveWhiteSpace = false;
- $this->dom->registerNodeClass('DOMElement', 'JSLikeHTMLElement');
- @$this->dom->loadHTML($html);
- $this->url = $url;
- }
-
- /**
- * Get article title element
- * @return DOMElement
- */
- public function getTitle() {
- return $this->articleTitle;
- }
-
- /**
- * Get article content element
- * @return DOMElement
- */
- public function getContent() {
- return $this->articleContent;
- }
-
- /**
- * Runs readability.
- *
- * Workflow:
- * 1. Prep the document by removing script tags, css, etc.
- * 2. Build readability's DOM tree.
- * 3. Grab the article content from the current dom tree.
- * 4. Replace the current DOM tree with the new one.
- * 5. Read peacefully.
- *
- * @return boolean true if we found content, false otherwise
- **/
- public function init()
- {
- $this->removeScripts($this->dom);
-
- // Assume successful outcome
- $this->success = true;
-
- $bodyElems = $this->dom->getElementsByTagName('body');
- if ($bodyElems->length > 0) {
- if ($this->bodyCache == null) {
- $this->bodyCache = $bodyElems->item(0)->innerHTML;
- }
- if ($this->body == null) {
- $this->body = $bodyElems->item(0);
- }
- }
-
- $this->prepDocument();
-
- //die($this->dom->documentElement->parentNode->nodeType);
- //$this->setInnerHTML($this->dom->documentElement, $this->getInnerHTML($this->dom->documentElement));
- //die($this->getInnerHTML($this->dom->documentElement));
-
- /* Build readability's DOM tree */
- $overlay = $this->dom->createElement('div');
- $innerDiv = $this->dom->createElement('div');
- $articleTitle = $this->getArticleTitle();
- $articleContent = $this->grabArticle();
-
- if (!$articleContent) {
- $this->success = false;
- $articleContent = $this->dom->createElement('div');
- $articleContent->setAttribute('id', 'readability-content');
- $articleContent->innerHTML = '
Sorry, Readability was unable to parse this page for content.
';
- }
-
- $overlay->setAttribute('id', 'readOverlay');
- $innerDiv->setAttribute('id', 'readInner');
-
- /* Glue the structure of our document together. */
- $innerDiv->appendChild($articleTitle);
- $innerDiv->appendChild($articleContent);
- $overlay->appendChild($innerDiv);
-
- /* Clear the old HTML, insert the new content. */
- $this->body->innerHTML = '';
- $this->body->appendChild($overlay);
- //document.body.insertBefore(overlay, document.body.firstChild);
- $this->body->removeAttribute('style');
-
- $this->postProcessContent($articleContent);
-
- // Set title and content instance variables
- $this->articleTitle = $articleTitle;
- $this->articleContent = $articleContent;
-
- return $this->success;
- }
-
- /**
- * Debug
- */
- protected function dbg($msg) {
- if ($this->debug) echo '* ',$msg, ' ', "\n";
- }
-
- /**
- * Run any post-process modifications to article content as necessary.
- *
- * @param DOMElement
- * @return void
- */
- public function postProcessContent($articleContent) {
- if ($this->convertLinksToFootnotes && !preg_match('/wikipedia\.org/', @$this->url)) {
- $this->addFootnotes($articleContent);
- }
- }
-
- /**
- * Get the article title as an H1.
- *
- * @return DOMElement
- */
- protected function getArticleTitle() {
- $curTitle = '';
- $origTitle = '';
-
- try {
- $curTitle = $origTitle = $this->getInnerText($this->dom->getElementsByTagName('title')->item(0));
- } catch(Exception $e) {}
-
- if (preg_match('/ [\|\-] /', $curTitle))
- {
- $curTitle = preg_replace('/(.*)[\|\-] .*/i', '$1', $origTitle);
-
- if (count(explode(' ', $curTitle)) < 3) {
- $curTitle = preg_replace('/[^\|\-]*[\|\-](.*)/i', '$1', $origTitle);
- }
- }
- else if (strpos($curTitle, ': ') !== false)
- {
- $curTitle = preg_replace('/.*:(.*)/i', '$1', $origTitle);
-
- if (count(explode(' ', $curTitle)) < 3) {
- $curTitle = preg_replace('/[^:]*[:](.*)/i','$1', $origTitle);
- }
- }
- else if(strlen($curTitle) > 150 || strlen($curTitle) < 15)
- {
- $hOnes = $this->dom->getElementsByTagName('h1');
- if($hOnes->length == 1)
- {
- $curTitle = $this->getInnerText($hOnes->item(0));
- }
- }
-
- $curTitle = trim($curTitle);
-
- if (count(explode(' ', $curTitle)) <= 4) {
- $curTitle = $origTitle;
- }
-
- $articleTitle = $this->dom->createElement('h1');
- $articleTitle->innerHTML = $curTitle;
-
- return $articleTitle;
- }
-
- /**
- * Prepare the HTML document for readability to scrape it.
- * This includes things like stripping javascript, CSS, and handling terrible markup.
- *
- * @return void
- **/
- protected function prepDocument() {
- /**
- * In some cases a body element can't be found (if the HTML is totally hosed for example)
- * so we create a new body node and append it to the document.
- */
- if($this->dom->documentElement == null){
- throw new Exception("No document element");
- }
- if ($this->body == null)
- {
- $this->body = $this->dom->createElement('body');
- $this->dom->documentElement->appendChild($this->body);
- }
-
- $this->body->setAttribute('id', 'readabilityBody');
-
- /* Remove all style tags in head */
- $styleTags = $this->dom->getElementsByTagName('style');
- for ($i = $styleTags->length-1; $i >= 0; $i--)
- {
- $styleTags->item($i)->parentNode->removeChild($styleTags->item($i));
- }
-
- /* Turn all double br's into p's */
- /* Note, this is pretty costly as far as processing goes. Maybe optimize later. */
- //document.body.innerHTML = document.body.innerHTML.replace(readability.regexps.replaceBrs, '
').replace(readability.regexps.replaceFonts, '<$1span>');
- // We do this in the constructor for PHP as that's when we have raw HTML - before parsing it into a DOM tree.
- // Manipulating innerHTML as it's done in JS is not possible in PHP.
- }
-
- /**
- * For easier reading, convert this document to have footnotes at the bottom rather than inline links.
- * @see http://www.roughtype.com/archives/2010/05/experiments_in.php
- *
- * @return void
- **/
- public function addFootnotes($articleContent) {
- $footnotesWrapper = $this->dom->createElement('div');
- $footnotesWrapper->setAttribute('id', 'readability-footnotes');
- $footnotesWrapper->innerHTML = '
References
';
-
- $articleFootnotes = $this->dom->createElement('ol');
- $articleFootnotes->setAttribute('id', 'readability-footnotes-list');
- $footnotesWrapper->appendChild($articleFootnotes);
-
- $articleLinks = $articleContent->getElementsByTagName('a');
-
- $linkCount = 0;
- for ($i = 0; $i < $articleLinks->length; $i++)
- {
- $articleLink = $articleLinks->item($i);
- $footnoteLink = $articleLink->cloneNode(true);
- $refLink = $this->dom->createElement('a');
- $footnote = $this->dom->createElement('li');
- $linkDomain = @parse_url($footnoteLink->getAttribute('href'), PHP_URL_HOST);
- if (!$linkDomain && isset($this->url)) $linkDomain = @parse_url($this->url, PHP_URL_HOST);
- //linkDomain = footnoteLink.host ? footnoteLink.host : document.location.host,
- $linkText = $this->getInnerText($articleLink);
-
- if ((strpos($articleLink->getAttribute('class'), 'readability-DoNotFootnote') !== false) || preg_match($this->regexps['skipFootnoteLink'], $linkText)) {
- continue;
- }
-
- $linkCount++;
-
- /** Add a superscript reference after the article link */
- $refLink->setAttribute('href', '#readabilityFootnoteLink-' . $linkCount);
- $refLink->innerHTML = '[' . $linkCount . ']';
- $refLink->setAttribute('class', 'readability-DoNotFootnote');
- $refLink->setAttribute('style', 'color: inherit;');
-
- //TODO: does this work or should we use DOMNode.isSameNode()?
- if ($articleLink->parentNode->lastChild == $articleLink) {
- $articleLink->parentNode->appendChild($refLink);
- } else {
- $articleLink->parentNode->insertBefore($refLink, $articleLink->nextSibling);
- }
-
- $articleLink->setAttribute('style', 'color: inherit; text-decoration: none;');
- $articleLink->setAttribute('name', 'readabilityLink-' . $linkCount);
-
- $footnote->innerHTML = '^ ';
-
- $footnoteLink->innerHTML = ($footnoteLink->getAttribute('title') != '' ? $footnoteLink->getAttribute('title') : $linkText);
- $footnoteLink->setAttribute('name', 'readabilityFootnoteLink-' . $linkCount);
-
- $footnote->appendChild($footnoteLink);
- if ($linkDomain) $footnote->innerHTML = $footnote->innerHTML . ' (' . $linkDomain . ')';
-
- $articleFootnotes->appendChild($footnote);
- }
-
- if ($linkCount > 0) {
- $articleContent->appendChild($footnotesWrapper);
- }
- }
-
- /**
- * Reverts P elements with class 'readability-styled'
- * to text nodes - which is what they were before.
- *
- * @param DOMElement
- * @return void
- */
- function revertReadabilityStyledElements($articleContent) {
- $xpath = new DOMXPath($articleContent->ownerDocument);
- $elems = $xpath->query('.//p[@class="readability-styled"]', $articleContent);
- //$elems = $articleContent->getElementsByTagName('p');
- for ($i = $elems->length-1; $i >= 0; $i--) {
- $e = $elems->item($i);
- $e->parentNode->replaceChild($articleContent->ownerDocument->createTextNode($e->textContent), $e);
- //if ($e->hasAttribute('class') && $e->getAttribute('class') == 'readability-styled') {
- // $e->parentNode->replaceChild($this->dom->createTextNode($e->textContent), $e);
- //}
- }
- }
-
- /**
- * Prepare the article node for display. Clean out any inline styles,
- * iframes, forms, strip extraneous
tags, etc.
- *
- * @param DOMElement
- * @return void
- */
- function prepArticle($articleContent) {
- $this->cleanStyles($articleContent);
- $this->killBreaks($articleContent);
- if ($this->revertForcedParagraphElements) {
- $this->revertReadabilityStyledElements($articleContent);
- }
-
- /* Clean out junk from the article content */
- $this->cleanConditionally($articleContent, 'form');
- $this->clean($articleContent, 'object');
- $this->clean($articleContent, 'h1');
-
- /**
- * If there is only one h2, they are probably using it
- * as a header and not a subheader, so remove it since we already have a header.
- ***/
- if ($articleContent->getElementsByTagName('h2')->length == 1) {
- $this->clean($articleContent, 'h2');
- }
- $this->clean($articleContent, 'iframe');
-
- $this->cleanHeaders($articleContent);
-
- /* Do these last as the previous stuff may have removed junk that will affect these */
- $this->cleanConditionally($articleContent, 'table');
- $this->cleanConditionally($articleContent, 'ul');
- $this->cleanConditionally($articleContent, 'div');
-
- /* Remove extra paragraphs */
- $articleParagraphs = $articleContent->getElementsByTagName('p');
- for ($i = $articleParagraphs->length-1; $i >= 0; $i--)
- {
- $imgCount = $articleParagraphs->item($i)->getElementsByTagName('img')->length;
- $embedCount = $articleParagraphs->item($i)->getElementsByTagName('embed')->length;
- $objectCount = $articleParagraphs->item($i)->getElementsByTagName('object')->length;
-
- if ($imgCount === 0 && $embedCount === 0 && $objectCount === 0 && $this->getInnerText($articleParagraphs->item($i), false) == '')
- {
- $articleParagraphs->item($i)->parentNode->removeChild($articleParagraphs->item($i));
- }
- }
-
- try {
- $articleContent->innerHTML = preg_replace('/ ]*>\s*