From 2871f531d38211cf9edca3fd85f7f72e50174c0a Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Fri, 7 Mar 2014 22:10:38 -0500 Subject: Optimize SVG files See #341 First step was to save from Inkscape in optimize SVG format. The used parameters are the following: * Simplify colors -> true * Style to xml -> true * Group collapsing -> true * Enable id stripping -> true * Embed rasters -> true * Keep editor data -> false * Enable view boxing -> false * Strip xml prolog -> true * Set precision -> 5 * Indent -> None Second step was to edit the file and remove meta-data, title, extra carriage return and unnecessary namespaces. --- p/themes/icons/add.svg | 35 ++-------- p/themes/icons/all.svg | 39 ++--------- p/themes/icons/bookmark.svg | 37 ++-------- p/themes/icons/category-white.svg | 38 ++--------- p/themes/icons/category.svg | 38 ++--------- p/themes/icons/close.svg | 35 ++-------- p/themes/icons/configure.svg | 36 ++-------- p/themes/icons/down.svg | 36 ++-------- p/themes/icons/favicon.svg | 4 -- p/themes/icons/help.svg | 39 ++--------- p/themes/icons/icon.svg | 3 - p/themes/icons/link.svg | 40 ++--------- p/themes/icons/login.svg | 39 ++--------- p/themes/icons/logout.svg | 39 ++--------- p/themes/icons/next.svg | 36 ++-------- p/themes/icons/non-starred.svg | 37 ++-------- p/themes/icons/prev.svg | 36 ++-------- p/themes/icons/read.svg | 36 ++-------- p/themes/icons/refresh.svg | 36 ++-------- p/themes/icons/rss.svg | 38 ++--------- p/themes/icons/search.svg | 38 ++--------- p/themes/icons/share.svg | 42 +++--------- p/themes/icons/starred.svg | 37 ++-------- p/themes/icons/tag.svg | 139 ++------------------------------------ p/themes/icons/unread.svg | 36 ++-------- p/themes/icons/up.svg | 36 ++-------- 26 files changed, 140 insertions(+), 865 deletions(-) (limited to 'p') diff --git a/p/themes/icons/add.svg b/p/themes/icons/add.svg index 425c9b4aa..652491775 100644 --- a/p/themes/icons/add.svg +++ b/p/themes/icons/add.svg @@ -1,30 +1,5 @@ - - - - - - - - image/svg+xml - - Gnome Symbolic Icon Theme - - - - - - - Gnome Symbolic Icon Theme - - - - - - - - - - - - - + + + + + \ No newline at end of file diff --git a/p/themes/icons/all.svg b/p/themes/icons/all.svg index 2180f7a4b..aeaa96277 100644 --- a/p/themes/icons/all.svg +++ b/p/themes/icons/all.svg @@ -1,32 +1,7 @@ - - - - - - - - image/svg+xml - - Gnome Symbolic Icon Theme - - - - - - - Gnome Symbolic Icon Theme - - - - - - - - - - - - - - - + + + + + + + \ No newline at end of file diff --git a/p/themes/icons/bookmark.svg b/p/themes/icons/bookmark.svg index d6e2cebb5..63a44908f 100644 --- a/p/themes/icons/bookmark.svg +++ b/p/themes/icons/bookmark.svg @@ -1,32 +1,5 @@ - - - - - - - - image/svg+xml - - Gnome Symbolic Icon Theme - - - - - - - Gnome Symbolic Icon Theme - - - - - - - - - - - - - - - + + + + + \ No newline at end of file diff --git a/p/themes/icons/category-white.svg b/p/themes/icons/category-white.svg index 5e61aeea5..5bb5cecd9 100644 --- a/p/themes/icons/category-white.svg +++ b/p/themes/icons/category-white.svg @@ -1,31 +1,7 @@ - - - - - - - - image/svg+xml - - Gnome Symbolic Icon Theme - - - - - - - Gnome Symbolic Icon Theme - - - - - - - - - - - - - - + + + + + + + \ No newline at end of file diff --git a/p/themes/icons/category.svg b/p/themes/icons/category.svg index 71f95490e..b5470d84a 100644 --- a/p/themes/icons/category.svg +++ b/p/themes/icons/category.svg @@ -1,31 +1,7 @@ - - - - - - - - image/svg+xml - - Gnome Symbolic Icon Theme - - - - - - - Gnome Symbolic Icon Theme - - - - - - - - - - - - - - + + + + + + + \ No newline at end of file diff --git a/p/themes/icons/close.svg b/p/themes/icons/close.svg index c0c786fd6..20d1577ab 100644 --- a/p/themes/icons/close.svg +++ b/p/themes/icons/close.svg @@ -1,28 +1,7 @@ - - - - - Gnome Symbolic Icon Theme - - - - image/svg+xml - - Gnome Symbolic Icon Theme - - - - - - - - - - - - - - - - - + + + + + + + \ No newline at end of file diff --git a/p/themes/icons/configure.svg b/p/themes/icons/configure.svg index 52df8bca7..2957a7abe 100644 --- a/p/themes/icons/configure.svg +++ b/p/themes/icons/configure.svg @@ -1,31 +1,5 @@ - - - - - - - - image/svg+xml - - Gnome Symbolic Icon Theme - - - - - - - Gnome Symbolic Icon Theme - - - - - - - - - - - - - - + + + + + \ No newline at end of file diff --git a/p/themes/icons/down.svg b/p/themes/icons/down.svg index 06d031fae..8a234ee99 100644 --- a/p/themes/icons/down.svg +++ b/p/themes/icons/down.svg @@ -1,31 +1,5 @@ - - - - - - - - image/svg+xml - - Gnome Symbolic Icon Theme - - - - - - - Gnome Symbolic Icon Theme - - - - - - - - - - - - - - + + + + + \ No newline at end of file diff --git a/p/themes/icons/favicon.svg b/p/themes/icons/favicon.svg index a44f0a1c0..a252050b9 100644 --- a/p/themes/icons/favicon.svg +++ b/p/themes/icons/favicon.svg @@ -1,11 +1,7 @@ - Logo FreshRSS - - - diff --git a/p/themes/icons/help.svg b/p/themes/icons/help.svg index b103ec46d..9a0022f76 100644 --- a/p/themes/icons/help.svg +++ b/p/themes/icons/help.svg @@ -1,32 +1,7 @@ - - - - - - - - image/svg+xml - - Gnome Symbolic Icon Theme - - - - - - - Gnome Symbolic Icon Theme - - - - - - - - - - - - - - - + + + + + + + \ No newline at end of file diff --git a/p/themes/icons/icon.svg b/p/themes/icons/icon.svg index 742c04b6e..caa987dac 100644 --- a/p/themes/icons/icon.svg +++ b/p/themes/icons/icon.svg @@ -1,9 +1,6 @@ - Logo FreshRSS - - diff --git a/p/themes/icons/link.svg b/p/themes/icons/link.svg index ddc8e0706..e5290af76 100644 --- a/p/themes/icons/link.svg +++ b/p/themes/icons/link.svg @@ -1,33 +1,7 @@ - - - - - - - - image/svg+xml - - Gnome Symbolic Icon Theme - - - - - - - Gnome Symbolic Icon Theme - - - - - - - - - - - - - - - - + + + + + + + \ No newline at end of file diff --git a/p/themes/icons/login.svg b/p/themes/icons/login.svg index 0a8af162f..954a0b74b 100644 --- a/p/themes/icons/login.svg +++ b/p/themes/icons/login.svg @@ -1,33 +1,6 @@ - - - - - - - - image/svg+xml - - Gnome Symbolic Icon Theme - - - - - - - Gnome Symbolic Icon Theme - - - - - - - - - - - - - - - - + + + + + + \ No newline at end of file diff --git a/p/themes/icons/logout.svg b/p/themes/icons/logout.svg index 284a67578..8dd4ef08b 100644 --- a/p/themes/icons/logout.svg +++ b/p/themes/icons/logout.svg @@ -1,33 +1,6 @@ - - - - - - - - image/svg+xml - - Gnome Symbolic Icon Theme - - - - - - - Gnome Symbolic Icon Theme - - - - - - - - - - - - - - - - + + + + + + \ No newline at end of file diff --git a/p/themes/icons/next.svg b/p/themes/icons/next.svg index 72637b4e6..d504d096c 100644 --- a/p/themes/icons/next.svg +++ b/p/themes/icons/next.svg @@ -1,31 +1,5 @@ - - - - - - - - image/svg+xml - - Gnome Symbolic Icon Theme - - - - - - - Gnome Symbolic Icon Theme - - - - - - - - - - - - - - + + + + + \ No newline at end of file diff --git a/p/themes/icons/non-starred.svg b/p/themes/icons/non-starred.svg index 346717f78..4ebcfccbd 100644 --- a/p/themes/icons/non-starred.svg +++ b/p/themes/icons/non-starred.svg @@ -1,32 +1,5 @@ - - - - - - - - image/svg+xml - - Gnome Symbolic Icon Theme - - - - - - - Gnome Symbolic Icon Theme - - - - - - - - - - - - - - - + + + + + \ No newline at end of file diff --git a/p/themes/icons/prev.svg b/p/themes/icons/prev.svg index 67685c50c..ea4372098 100644 --- a/p/themes/icons/prev.svg +++ b/p/themes/icons/prev.svg @@ -1,31 +1,5 @@ - - - - - - - - image/svg+xml - - Gnome Symbolic Icon Theme - - - - - - - Gnome Symbolic Icon Theme - - - - - - - - - - - - - - + + + + + \ No newline at end of file diff --git a/p/themes/icons/read.svg b/p/themes/icons/read.svg index 932bfd860..d72c198df 100644 --- a/p/themes/icons/read.svg +++ b/p/themes/icons/read.svg @@ -1,31 +1,5 @@ - - - - - - - - image/svg+xml - - Gnome Symbolic Icon Theme - - - - - - - Gnome Symbolic Icon Theme - - - - - - - - - - - - - - + + + + + \ No newline at end of file diff --git a/p/themes/icons/refresh.svg b/p/themes/icons/refresh.svg index 11728fc5d..62fe56c1e 100644 --- a/p/themes/icons/refresh.svg +++ b/p/themes/icons/refresh.svg @@ -1,31 +1,5 @@ - - - - - - - - image/svg+xml - - Gnome Symbolic Icon Theme - - - - - - - Gnome Symbolic Icon Theme - - - - - - - - - - - - - - + + + + + \ No newline at end of file diff --git a/p/themes/icons/rss.svg b/p/themes/icons/rss.svg index ceaddceee..6db5b3eae 100644 --- a/p/themes/icons/rss.svg +++ b/p/themes/icons/rss.svg @@ -1,32 +1,6 @@ - - - - - - - - image/svg+xml - - Gnome Symbolic Icon Theme - - - - - - - Gnome Symbolic Icon Theme - - - - - - - - - - - - - - - + + + + + + \ No newline at end of file diff --git a/p/themes/icons/search.svg b/p/themes/icons/search.svg index acfb364cc..35a28dfca 100644 --- a/p/themes/icons/search.svg +++ b/p/themes/icons/search.svg @@ -1,32 +1,6 @@ - - - - - - - - image/svg+xml - - Gnome Symbolic Icon Theme - - - - - - - Gnome Symbolic Icon Theme - - - - - - - - - - - - - - - + + + + + + \ No newline at end of file diff --git a/p/themes/icons/share.svg b/p/themes/icons/share.svg index 443321882..db7a3649c 100644 --- a/p/themes/icons/share.svg +++ b/p/themes/icons/share.svg @@ -1,34 +1,8 @@ - - - - - - - - image/svg+xml - - Gnome Symbolic Icon Theme - - - - - - - Gnome Symbolic Icon Theme - - - - - - - - - - - - - - - - - + + + + + + + + \ No newline at end of file diff --git a/p/themes/icons/starred.svg b/p/themes/icons/starred.svg index d6e2cebb5..63a44908f 100644 --- a/p/themes/icons/starred.svg +++ b/p/themes/icons/starred.svg @@ -1,32 +1,5 @@ - - - - - - - - image/svg+xml - - Gnome Symbolic Icon Theme - - - - - - - Gnome Symbolic Icon Theme - - - - - - - - - - - - - - - + + + + + \ No newline at end of file diff --git a/p/themes/icons/tag.svg b/p/themes/icons/tag.svg index 688aca7a4..0d6db6ed8 100644 --- a/p/themes/icons/tag.svg +++ b/p/themes/icons/tag.svg @@ -1,134 +1,5 @@ - - - - - - - - image/svg+xml - - Gnome Symbolic Icon Theme - - - - - - - Gnome Symbolic Icon Theme - - - - - - - - - - - - - + + + + + \ No newline at end of file diff --git a/p/themes/icons/unread.svg b/p/themes/icons/unread.svg index f541fb25b..dc1cc609c 100644 --- a/p/themes/icons/unread.svg +++ b/p/themes/icons/unread.svg @@ -1,30 +1,6 @@ - - - - - - - - image/svg+xml - - Gnome Symbolic Icon Theme - - - - - - - Gnome Symbolic Icon Theme - - - - - - - - - - - - - + + + + + + \ No newline at end of file diff --git a/p/themes/icons/up.svg b/p/themes/icons/up.svg index dab31a20d..4819c9205 100644 --- a/p/themes/icons/up.svg +++ b/p/themes/icons/up.svg @@ -1,31 +1,5 @@ - - - - - - - - image/svg+xml - - Gnome Symbolic Icon Theme - - - - - - - Gnome Symbolic Icon Theme - - - - - - - - - - - - - - + + + + + \ No newline at end of file -- cgit v1.2.3 From c3cac60b319189017c38b7d5e1d09f51ded96d0e Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 9 Mar 2014 21:30:20 +0100 Subject: Autoload when less than 2 remaining articles https://github.com/marienfressinaud/FreshRSS/issues/388 + Simplify code --- p/scripts/main.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'p') diff --git a/p/scripts/main.js b/p/scripts/main.js index 6cc992379..b69ac0a2a 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -278,11 +278,8 @@ function next_entry() { new_active = old_active.length === 0 ? $(".flux:first") : old_active.nextAll(".flux:first"); toggleContent(new_active, old_active); - if (!auto_load_more) { - var last_active = $(".flux:last"); - if (last_active.attr("id") === new_active.attr("id")) { - load_more_posts(); - } + if (new_active.nextAll().length < 3) { + load_more_posts(); } } -- cgit v1.2.3 From 3083af6288f23ba6986232798fde67b91517f287 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sun, 9 Mar 2014 21:45:25 -0400 Subject: Enhance feed adding popup I added a new option in the category select. It allows the user to add dynamically a new category and add the feed to the newly created category. See #356 --- app/Controllers/feedController.php | 8 ++++++++ app/layout/aside_feed.phtml | 5 +++++ p/scripts/main.js | 13 +++++++++++++ 3 files changed, 26 insertions(+) (limited to 'p') diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index c718fcd5c..9996725e4 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -30,6 +30,14 @@ class FreshRSS_feed_Controller extends Minz_ActionController { $url = Minz_Request::param ('url_rss'); $cat = Minz_Request::param ('category', false); + if ($cat === 'nc') { + $new_cat = Minz_Request::param ('new_category'); + if (empty($new_cat['name'])) { + $cat = false; + } else { + $cat = $this->catDAO->addCategory($new_cat); + } + } if ($cat === false) { $def_cat = $this->catDAO->getDefault (); $cat = $def_cat->id (); diff --git a/app/layout/aside_feed.phtml b/app/layout/aside_feed.phtml index e324b15bd..6f3cdafb2 100644 --- a/app/layout/aside_feed.phtml +++ b/app/layout/aside_feed.phtml @@ -20,9 +20,14 @@ name (); ?> + + +
  • diff --git a/p/scripts/main.js b/p/scripts/main.js index b69ac0a2a..3a4d4e4fb 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -986,6 +986,18 @@ function init_share_observers() { }); }; +function init_feed_observers() { + $('select[id="category"]').on('change', function(){ + var detail = $(this).parent('li').next('li'); + if ($(this).val() === 'nc') { + detail.show(); + detail.find('input').focus(); + } else { + detail.hide(); + } + }); +}; + function init_all() { if (!(window.$ && window.url_freshrss && ((!full_lazyload) || $.fn.lazyload))) { if (window.console) { @@ -1017,6 +1029,7 @@ function init_all() { window.setInterval(refreshUnreads, 120000); } else { init_share_observers(); + init_feed_observers(); } if (window.console) { -- cgit v1.2.3 From ed328ae69c186148d30d458268ddc66be3dd7e72 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 10 Mar 2014 17:58:11 +0100 Subject: API: Optimisation nginx + less debug info https://github.com/marienfressinaud/FreshRSS/issues/443 Faster access to headers in nginx Show detailed debug info only in the case of errors --- p/api/greader.php | 63 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 32 insertions(+), 31 deletions(-) (limited to 'p') diff --git a/p/api/greader.php b/p/api/greader.php index 19241d55b..ba091db90 100644 --- a/p/api/greader.php +++ b/p/api/greader.php @@ -25,24 +25,6 @@ require(LIB_PATH . '/lib_rss.php'); //Includes class autoloader $ORIGINAL_INPUT = file_get_contents('php://input'); -$nativeGetallheaders = function_exists('getallheaders'); - -if (!$nativeGetallheaders) { //nginx http://php.net/getallheaders#84262 - function getallheaders() { - $headers = ''; - foreach ($_SERVER as $name => $value) { - if (substr($name, 0, 5) === 'HTTP_') { - $headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value; - } - } - return $headers; - } -} - -$ALL_HEADERS = getallheaders(); - -$debugInfo = array('date' => date('c'), 'headers' => $ALL_HEADERS, '_SERVER' => $_SERVER, '_GET' => $_GET, '_POST' => $_POST, '_COOKIE' => $_COOKIE, 'INPUT' => $ORIGINAL_INPUT); - if (PHP_INT_SIZE < 8) { //32-bit function dec2hex($dec) { return str_pad(gmp_strval(gmp_init($dec, 10), 16), 16, '0', STR_PAD_LEFT); @@ -60,12 +42,17 @@ if (PHP_INT_SIZE < 8) { //32-bit } function headerVariable($headerName, $varName) { - global $ALL_HEADERS; - if (empty($ALL_HEADERS[$headerName])) { - return null; + $header = ''; + $upName = 'HTTP_' . strtoupper($headerName); + if (isset($_SERVER[$upName])) { + $header = $_SERVER[$upName]; + } elseif (function_exists('getallheaders')) { + $ALL_HEADERS = getallheaders(); + if (isset($ALL_HEADERS[$headerName])) { + $header = $ALL_HEADERS[$headerName]; + } } - parse_str($ALL_HEADERS[$headerName], $pairs); - //logMe('headerVariable(' . $headerName . ') => ' . print_r($pairs, true)); + parse_str($header, $pairs); return isset($pairs[$varName]) ? $pairs[$varName] : null; } @@ -93,8 +80,24 @@ function logMe($text) { file_put_contents(LOG_PATH . '/api.log', $text, FILE_APPEND); } +function debugInfo() { + if (function_exists('getallheaders')) { + $ALL_HEADERS = getallheaders(); + } else { //nginx http://php.net/getallheaders#84262 + $ALL_HEADERS = ''; + foreach ($_SERVER as $name => $value) { + if (substr($name, 0, 5) === 'HTTP_') { + $ALL_HEADERS[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value; + } + } + } + global $ORIGINAL_INPUT; + return print_r(array('date' => date('c'), 'headers' => $ALL_HEADERS, '_SERVER' => $_SERVER, '_GET' => $_GET, '_POST' => $_POST, '_COOKIE' => $_COOKIE, 'INPUT' => $ORIGINAL_INPUT), true); +} + function badRequest() { logMe("badRequest()\n"); + logMe(debugInfo()); header('HTTP/1.1 400 Bad Request'); header('Content-Type: text/plain; charset=UTF-8'); die('Bad Request!'); @@ -102,6 +105,7 @@ function badRequest() { function unauthorized() { logMe("unauthorized()\n"); + logMe(debugInfo()); header('HTTP/1.1 401 Unauthorized'); header('Content-Type: text/plain; charset=UTF-8'); header('Google-Bad-Token: true'); @@ -110,6 +114,7 @@ function unauthorized() { function notImplemented() { logMe("notImplemented()\n"); + logMe(debugInfo()); header('HTTP/1.1 501 Not Implemented'); header('Content-Type: text/plain; charset=UTF-8'); die('Not Implemented!'); @@ -128,8 +133,7 @@ function checkCompatibility() { if (PHP_INT_SIZE < 8 && !function_exists('gmp_init')) { die('FAIL 64-bit or GMP extension!'); } - global $nativeGetallheaders; - if ((!$nativeGetallheaders) && isset($_SERVER['SERVER_SOFTWARE']) && (stripos($_SERVER['SERVER_SOFTWARE'], 'nginx') === false)) { + if ((!function_exists('getallheaders')) && isset($_SERVER['SERVER_SOFTWARE']) && (stripos($_SERVER['SERVER_SOFTWARE'], 'nginx') === false)) { die('FAIL getallheaders! (probably)'); } echo 'PASS'; @@ -318,7 +322,7 @@ function unreadCount() { //http://blog.martindoms.com/2009/10/16/using-the-googl function streamContents($path, $include_target, $start_time, $count, $order, $exclude_target, $continuation) { //http://code.google.com/p/pyrfeed/wiki/GoogleReaderAPI //http://blog.martindoms.com/2009/10/16/using-the-google-reader-api-part-2/#feed - logMe('streamContents(' . $include_target . ")\n"); + logMe("streamContents($path, $include_target, $start_time, $count, $order, $exclude_target, $continuation)\n"); header('Content-Type: application/json; charset=UTF-8'); $feedDAO = new FreshRSS_FeedDAO(); @@ -424,7 +428,7 @@ function streamContentsItemsIds($streamId, $start_time, $count, $order, $exclude //http://code.google.com/p/google-reader-api/wiki/ApiStreamItemsIds //http://code.google.com/p/pyrfeed/wiki/GoogleReaderAPI //http://blog.martindoms.com/2009/10/16/using-the-google-reader-api-part-2/#feed - logMe('streamContentsItemsIds(' . $streamId . ")\n"); + logMe("streamContentsItemsIds($streamId, $start_time, $count, $order, $exclude_target)\n"); $type = 'A'; $id = ''; @@ -505,7 +509,7 @@ function editTag($e_ids, $a, $r) { } function markAllAsRead($streamId, $olderThanId) { - logMe('markAllAsRead(' . $streamId . ")\n"); + logMe("markAllAsRead($streamId, $olderThanId)\n"); $entryDAO = new FreshRSS_EntryDAO(); if (strpos($streamId, 'feed/') === 0) { $f_id = basename($streamId); @@ -522,13 +526,10 @@ function markAllAsRead($streamId, $olderThanId) { } logMe('----------------------------------------------------------------'."\n"); -logMe(print_r($debugInfo, true)); $pathInfo = empty($_SERVER['PATH_INFO']) ? '/Error' : urldecode($_SERVER['PATH_INFO']); $pathInfos = explode('/', $pathInfo); -logMe('pathInfos => ' . print_r($pathInfos, true)); - Minz_Configuration::init(); if (!Minz_Configuration::apiEnabled()) { -- cgit v1.2.3 From ab1bec28c2a1e9534a66baa25a12b4639cbed726 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 10 Mar 2014 21:06:58 +0100 Subject: API: Better compatibility with Apache/PHP-CGI https://github.com/marienfressinaud/FreshRSS/issues/443#issuecomment-37226210 --- p/api/.htaccess | 4 ++++ p/api/greader.php | 1 + 2 files changed, 5 insertions(+) create mode 100644 p/api/.htaccess (limited to 'p') diff --git a/p/api/.htaccess b/p/api/.htaccess new file mode 100644 index 000000000..41b653d96 --- /dev/null +++ b/p/api/.htaccess @@ -0,0 +1,4 @@ + + RewriteEngine on + RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] + diff --git a/p/api/greader.php b/p/api/greader.php index ba091db90..8ce1c5b9a 100644 --- a/p/api/greader.php +++ b/p/api/greader.php @@ -526,6 +526,7 @@ function markAllAsRead($streamId, $olderThanId) { } logMe('----------------------------------------------------------------'."\n"); +//logMe(debugInfo()); $pathInfo = empty($_SERVER['PATH_INFO']) ? '/Error' : urldecode($_SERVER['PATH_INFO']); $pathInfos = explode('/', $pathInfo); -- cgit v1.2.3 From f48fc2755c44d4968bce87cad13e1b4546aa7b2d Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 10 Mar 2014 21:26:52 +0100 Subject: API: New test for getallheaders() problem https://github.com/marienfressinaud/FreshRSS/issues/443 --- p/api/greader.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'p') diff --git a/p/api/greader.php b/p/api/greader.php index 8ce1c5b9a..741c4fbd4 100644 --- a/p/api/greader.php +++ b/p/api/greader.php @@ -133,7 +133,9 @@ function checkCompatibility() { if (PHP_INT_SIZE < 8 && !function_exists('gmp_init')) { die('FAIL 64-bit or GMP extension!'); } - if ((!function_exists('getallheaders')) && isset($_SERVER['SERVER_SOFTWARE']) && (stripos($_SERVER['SERVER_SOFTWARE'], 'nginx') === false)) { + if ((!array_key_exists('HTTP_AUTHORIZATION', $_SERVER)) && //Apache mod_rewrite trick should be fine + (empty($_SERVER['SERVER_SOFTWARE']) || (stripos($_SERVER['SERVER_SOFTWARE'], 'nginx') === false)) && //nginx should be fine + ((!function_exists('getallheaders')) || (stripos(php_sapi_name(), 'cgi') !== false))) { //Main problem is Apache/CGI mode die('FAIL getallheaders! (probably)'); } echo 'PASS'; -- cgit v1.2.3 From 6863ad663f50425db76b64b638805821f3419874 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Wed, 12 Mar 2014 22:40:20 -0400 Subject: Add an observer to close an article when clicking on its footer See #449 --- p/scripts/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'p') diff --git a/p/scripts/main.js b/p/scripts/main.js index 3a4d4e4fb..799d46625 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -606,7 +606,7 @@ function init_shortcuts() { } function init_stream(divStream) { - divStream.on('click', '.flux_header', function (e) { //flux_header_toggle + divStream.on('click', '.flux_header,.flux_content > .bottom', function (e) { //flux_header_toggle, flux_footer_toggle if ($(e.target).closest('.item.website, .item.link').length > 0) { return; } -- cgit v1.2.3 From be46819f517a105ad32ddbfcd22b9824b4446ea1 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Fri, 14 Mar 2014 20:46:50 -0400 Subject: Change article observer Instead of observe only the bottom of the article to collapse the article, the whole article is observed. Now if you want to close an article in the middle of your reading, you can. --- p/scripts/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'p') diff --git a/p/scripts/main.js b/p/scripts/main.js index 799d46625..898ec8c69 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -606,7 +606,7 @@ function init_shortcuts() { } function init_stream(divStream) { - divStream.on('click', '.flux_header,.flux_content > .bottom', function (e) { //flux_header_toggle, flux_footer_toggle + divStream.on('click', '.flux_header,.flux_content', function (e) { //flux_toggle if ($(e.target).closest('.item.website, .item.link').length > 0) { return; } -- cgit v1.2.3 From 1af723ca68e2558232ef4c4eb5a7c8f41a07bd0c Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sat, 15 Mar 2014 07:08:58 -0400 Subject: Add a button to reveal/hide password I add a button on the configure user interface to reveal the password for 2 seconds and hide it after that period. See #442 I am not sure if the fallback unicode text for the icon is correct. I can not make it work. --- app/Models/Themes.php | 1 + app/views/configure/users.phtml | 2 ++ p/scripts/main.js | 12 ++++++++++++ p/themes/icons/key.svg | 7 +++++++ 4 files changed, 22 insertions(+) create mode 100644 p/themes/icons/key.svg (limited to 'p') diff --git a/app/Models/Themes.php b/app/Models/Themes.php index c7099a1df..ed746b7e9 100644 --- a/app/Models/Themes.php +++ b/app/Models/Themes.php @@ -77,6 +77,7 @@ class FreshRSS_Themes extends Minz_Model { 'down' => '▽', 'favorite' => '★', 'help' => 'ⓘ', + 'key' => '⚿', 'link' => '↗', 'login' => '🔒', 'logout' => '🔓', diff --git a/app/views/configure/users.phtml b/app/views/configure/users.phtml index 1a02b0e90..fdc94cd18 100644 --- a/app/views/configure/users.phtml +++ b/app/views/configure/users.phtml @@ -21,6 +21,7 @@
    /> +
    @@ -178,6 +179,7 @@
    +
    diff --git a/p/scripts/main.js b/p/scripts/main.js index 799d46625..57618c29b 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -998,6 +998,17 @@ function init_feed_observers() { }); }; +function init_password_observers() { + $('input[type="password"] + a.btn.toggle-password').on('click', function(e){ + e.preventDefault(); + var passwordField = $(this).siblings('input[type="password"]'); + passwordField.attr('type','text'); + setTimeout(function(){ + passwordField.attr('type','password'); + },2000); + }); +}; + function init_all() { if (!(window.$ && window.url_freshrss && ((!full_lazyload) || $.fn.lazyload))) { if (window.console) { @@ -1030,6 +1041,7 @@ function init_all() { } else { init_share_observers(); init_feed_observers(); + init_password_observers(); } if (window.console) { diff --git a/p/themes/icons/key.svg b/p/themes/icons/key.svg new file mode 100644 index 000000000..9193f4552 --- /dev/null +++ b/p/themes/icons/key.svg @@ -0,0 +1,7 @@ + + + + + + + -- cgit v1.2.3 From 19fb901cb417c13be0ac3019d1bb1e7b09d08b37 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 15 Mar 2014 15:08:44 +0100 Subject: Small corrections previous pull requests https://github.com/marienfressinaud/FreshRSS/issues/457 https://github.com/marienfressinaud/FreshRSS/pull/459 https://github.com/marienfressinaud/FreshRSS/issues/422 https://github.com/marienfressinaud/FreshRSS/pull/461 --- app/layout/layout.phtml | 8 ++++++-- app/views/helpers/view/rss_view.phtml | 2 +- p/scripts/main.js | 22 +++++++++++----------- 3 files changed, 18 insertions(+), 14 deletions(-) (limited to 'p') diff --git a/app/layout/layout.phtml b/app/layout/layout.phtml index 1501df3c3..63255b54f 100644 --- a/app/layout/layout.phtml +++ b/app/layout/layout.phtml @@ -18,8 +18,12 @@ -rss_url)) { ?> - +url)) { + $rss_url = $this->url; + $rss_url['params']['output'] = 'rss'; +?> + diff --git a/app/views/helpers/view/rss_view.phtml b/app/views/helpers/view/rss_view.phtml index 620bf1388..2c6ca610b 100755 --- a/app/views/helpers/view/rss_view.phtml +++ b/app/views/helpers/view/rss_view.phtml @@ -6,7 +6,7 @@ rss_title); ?> GMT - + entries as $item) { ?> diff --git a/p/scripts/main.js b/p/scripts/main.js index bee56d1b3..a03be85eb 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -968,12 +968,12 @@ function init_print_action() { function init_share_observers() { shares = $('.form-group:not(".form-actions")').length; - $('.post').on('click', '.share.remove', function(e){ + $('.post').on('click', '.share.remove', function(e) { e.preventDefault(); $(this).parents('.form-group').remove(); }); - $('.share.add').on('click',function(e){ + $('.share.add').on('click', function(e) { e.preventDefault(); var opt = $(this).siblings('select').find(':selected'); var row = $(this).parents('form').data(opt.data('form')); @@ -984,10 +984,10 @@ function init_share_observers() { $(this).parents('.form-actions').before(row); shares++; }); -}; +} function init_feed_observers() { - $('select[id="category"]').on('change', function(){ + $('select[id="category"]').on('change', function() { var detail = $(this).parent('li').next('li'); if ($(this).val() === 'nc') { detail.show(); @@ -996,18 +996,18 @@ function init_feed_observers() { detail.hide(); } }); -}; +} function init_password_observers() { - $('input[type="password"] + a.btn.toggle-password').on('click', function(e){ + $('input[type="password"] + a.btn.toggle-password').on('click', function(e) { e.preventDefault(); var passwordField = $(this).siblings('input[type="password"]'); - passwordField.attr('type','text'); - setTimeout(function(){ - passwordField.attr('type','password'); - },2000); + passwordField.attr('type', 'text'); + setTimeout(function() { + passwordField.attr('type', 'password'); + }, 2000); }); -}; +} function init_all() { if (!(window.$ && window.url_freshrss && ((!full_lazyload) || $.fn.lazyload))) { -- cgit v1.2.3