From f8eac7d1a5486106bbb11404d5060b0feb7baf56 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Wed, 5 Mar 2014 20:22:03 -0500 Subject: Sharing optimization Change the storage and display of sharings to improve the time needed to generate the page. Instead of looking for a default value when displaying the sharing links, they are added during the configuration. --- app/Models/Configuration.php | 15 +++++++++++---- app/Models/Share.php | 3 --- app/views/helpers/view/normal_view.phtml | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php index 827a1d166..85e891b64 100644 --- a/app/Models/Configuration.php +++ b/app/Models/Configuration.php @@ -193,7 +193,9 @@ class FreshRSS_Configuration { if (!is_array($value)) { continue; } - if (array_key_exists('url', $value)) { + + // Verify URL and add default value when needed + if (array_key_exists('url', $value) && $value['url'] !== null) { $is_url = ( filter_var ($value['url'], FILTER_VALIDATE_URL) || (version_compare(PHP_VERSION, '5.3.3', '<') && @@ -203,10 +205,15 @@ class FreshRSS_Configuration { if (!$is_url) { continue; } - if (!array_key_exists('name', $value) || strcmp($value['name'], '') === 0) { - $value['name'] = $value['type']; - } + } else { + $value['url'] = null; } + + // Add a default name + if (!array_key_exists('name', $value) || strcmp($value['name'], '') === 0) { + $value['name'] = $value['type']; + } + $this->data['sharing'][] = $value; } } diff --git a/app/Models/Share.php b/app/Models/Share.php index 887fcef05..b146db722 100644 --- a/app/Models/Share.php +++ b/app/Models/Share.php @@ -3,9 +3,6 @@ class FreshRSS_Share { static public function generateUrl($options, $selected, $link, $title) { - if (!array_key_exists('url', $selected)) { - $selected['url'] = ''; - } $share = $options[$selected['type']]; $matches = array( '~URL~', diff --git a/app/views/helpers/view/normal_view.phtml b/app/views/helpers/view/normal_view.phtml index ff535c60a..9fd06ebae 100644 --- a/app/views/helpers/view/normal_view.phtml +++ b/app/views/helpers/view/normal_view.phtml @@ -138,7 +138,7 @@ if (!empty($this->entries)) {
  • - +
  • -- cgit v1.2.3 From 1fea1277d6dffd6b71a78c33a53422ce1282de9a Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Fri, 7 Mar 2014 21:04:16 -0500 Subject: Change test --- app/Models/Configuration.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php index 85e891b64..3e5cd8bad 100644 --- a/app/Models/Configuration.php +++ b/app/Models/Configuration.php @@ -210,7 +210,7 @@ class FreshRSS_Configuration { } // Add a default name - if (!array_key_exists('name', $value) || strcmp($value['name'], '') === 0) { + if (empty($value['name'])) { $value['name'] = $value['type']; } -- cgit v1.2.3 From 90c840d8f1977c6e7d5117fff24c7daf6af3c951 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Fri, 7 Mar 2014 21:11:46 -0500 Subject: Add a test to avoid warnings in log --- app/views/configure/sharing.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/configure/sharing.phtml b/app/views/configure/sharing.phtml index b50e6ddc4..ddb404ef5 100644 --- a/app/views/configure/sharing.phtml +++ b/app/views/configure/sharing.phtml @@ -35,7 +35,7 @@ -- cgit v1.2.3 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(-) 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 e9eca6aff6c7e2e2349b3b6cf714e2e7eb99405e Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Wed, 5 Mar 2014 20:22:03 -0500 Subject: Sharing optimization Change the storage and display of sharings to improve the time needed to generate the page. Instead of looking for a default value when displaying the sharing links, they are added during the configuration. --- app/Models/Configuration.php | 15 +++++++++++---- app/Models/Share.php | 3 --- app/views/helpers/view/normal_view.phtml | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php index 827a1d166..85e891b64 100644 --- a/app/Models/Configuration.php +++ b/app/Models/Configuration.php @@ -193,7 +193,9 @@ class FreshRSS_Configuration { if (!is_array($value)) { continue; } - if (array_key_exists('url', $value)) { + + // Verify URL and add default value when needed + if (array_key_exists('url', $value) && $value['url'] !== null) { $is_url = ( filter_var ($value['url'], FILTER_VALIDATE_URL) || (version_compare(PHP_VERSION, '5.3.3', '<') && @@ -203,10 +205,15 @@ class FreshRSS_Configuration { if (!$is_url) { continue; } - if (!array_key_exists('name', $value) || strcmp($value['name'], '') === 0) { - $value['name'] = $value['type']; - } + } else { + $value['url'] = null; } + + // Add a default name + if (!array_key_exists('name', $value) || strcmp($value['name'], '') === 0) { + $value['name'] = $value['type']; + } + $this->data['sharing'][] = $value; } } diff --git a/app/Models/Share.php b/app/Models/Share.php index 887fcef05..b146db722 100644 --- a/app/Models/Share.php +++ b/app/Models/Share.php @@ -3,9 +3,6 @@ class FreshRSS_Share { static public function generateUrl($options, $selected, $link, $title) { - if (!array_key_exists('url', $selected)) { - $selected['url'] = ''; - } $share = $options[$selected['type']]; $matches = array( '~URL~', diff --git a/app/views/helpers/view/normal_view.phtml b/app/views/helpers/view/normal_view.phtml index ff535c60a..9fd06ebae 100644 --- a/app/views/helpers/view/normal_view.phtml +++ b/app/views/helpers/view/normal_view.phtml @@ -138,7 +138,7 @@ if (!empty($this->entries)) { -- cgit v1.2.3 From b0a3610db735c7f719e8c35d84ffdc5a4e4987af Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Fri, 7 Mar 2014 21:04:16 -0500 Subject: Change test --- app/Models/Configuration.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php index 85e891b64..3e5cd8bad 100644 --- a/app/Models/Configuration.php +++ b/app/Models/Configuration.php @@ -210,7 +210,7 @@ class FreshRSS_Configuration { } // Add a default name - if (!array_key_exists('name', $value) || strcmp($value['name'], '') === 0) { + if (empty($value['name'])) { $value['name'] = $value['type']; } -- cgit v1.2.3 From c2e9bfd0d7cddbadef272f2258b5fe1a5d1d26a6 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Fri, 7 Mar 2014 21:11:46 -0500 Subject: Add a test to avoid warnings in log --- app/views/configure/sharing.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/configure/sharing.phtml b/app/views/configure/sharing.phtml index b50e6ddc4..ddb404ef5 100644 --- a/app/views/configure/sharing.phtml +++ b/app/views/configure/sharing.phtml @@ -35,7 +35,7 @@ -- cgit v1.2.3 From 339a0dd49c79b9adba67483a3cab55c4cb2e2066 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sat, 8 Mar 2014 09:23:59 -0500 Subject: Change test on URL parameter --- app/Models/Configuration.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php index 3e5cd8bad..80031369e 100644 --- a/app/Models/Configuration.php +++ b/app/Models/Configuration.php @@ -195,7 +195,7 @@ class FreshRSS_Configuration { } // Verify URL and add default value when needed - if (array_key_exists('url', $value) && $value['url'] !== null) { + if (isset($value['url'])) { $is_url = ( filter_var ($value['url'], FILTER_VALIDATE_URL) || (version_compare(PHP_VERSION, '5.3.3', '<') && -- cgit v1.2.3 From 670ee57b6288549ac611d53d86d8f5ffee641b0e Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 8 Mar 2014 20:16:10 +0100 Subject: Interface to enable/disable API and unsafe automatic login https://github.com/marienfressinaud/FreshRSS/issues/13 https://github.com/marienfressinaud/FreshRSS/issues/440 --- app/Controllers/usersController.php | 8 +++++++- app/Models/Feed.php | 11 ++++++----- app/i18n/en.php | 2 ++ app/i18n/fr.php | 2 ++ app/views/configure/users.phtml | 21 +++++++++++++++++++++ 5 files changed, 38 insertions(+), 6 deletions(-) diff --git a/app/Controllers/usersController.php b/app/Controllers/usersController.php index b03989cd7..fa967cedc 100644 --- a/app/Controllers/usersController.php +++ b/app/Controllers/usersController.php @@ -69,13 +69,19 @@ class FreshRSS_users_Controller extends Minz_ActionController { $anon_refresh = Minz_Request::param('anon_refresh', false); $anon_refresh = ((bool)$anon_refresh) && ($anon_refresh !== 'no'); $auth_type = Minz_Request::param('auth_type', 'none'); + $unsafe_autologin = Minz_Request::param('unsafe_autologin', false); + $api_enabled = Minz_Request::param('api_enabled', false); if ($anon != Minz_Configuration::allowAnonymous() || $auth_type != Minz_Configuration::authType() || - $anon_refresh != Minz_Configuration::allowAnonymousRefresh()) { + $anon_refresh != Minz_Configuration::allowAnonymousRefresh() || + $unsafe_autologin != Minz_Configuration::unsafeAutologinEnabled() || + $api_enabled != Minz_Configuration::apiEnabled()) { Minz_Configuration::_authType($auth_type); Minz_Configuration::_allowAnonymous($anon); Minz_Configuration::_allowAnonymousRefresh($anon_refresh); + Minz_Configuration::_enableAutologin($unsafe_autologin); + Minz_Configuration::_enableApi($api_enabled); $ok &= Minz_Configuration::writeFile(); } } diff --git a/app/Models/Feed.php b/app/Models/Feed.php index 73f9c32fb..bce3bd24f 100644 --- a/app/Models/Feed.php +++ b/app/Models/Feed.php @@ -254,11 +254,12 @@ class FreshRSS_Feed extends Minz_Model { $elinks = array(); foreach ($item->get_enclosures() as $enclosure) { $elink = $enclosure->get_link(); - if (array_key_exists($elink, $elinks)) continue; - $elinks[$elink] = '1'; - $mime = strtolower($enclosure->get_type()); - if (strpos($mime, 'image/') === 0) { - $content .= '
    '; + if (empty($elinks[$elink])) { + $elinks[$elink] = '1'; + $mime = strtolower($enclosure->get_type()); + if (strpos($mime, 'image/') === 0) { + $content .= '
    '; + } } } diff --git a/app/i18n/en.php b/app/i18n/en.php index d504ffc11..69247165f 100644 --- a/app/i18n/en.php +++ b/app/i18n/en.php @@ -180,6 +180,8 @@ return array ( 'persona_connection_email' => 'Login mail address
    (for Mozilla Persona)', 'allow_anonymous' => 'Allow anonymous reading of the articles of the default user (%s)', 'allow_anonymous_refresh' => 'Allow anonymous refresh of the articles', + 'unsafe_autologin' => 'Allow unsafe automatic login using the format: ', + 'api_enabled' => 'Allow API access (required for mobile apps)', 'auth_token' => 'Authentication token', 'explain_token' => 'Allows to access RSS output of the default user without authentication.
    %s?output=rss&token=%s', 'login_configuration' => 'Login', diff --git a/app/i18n/fr.php b/app/i18n/fr.php index c5581a78b..e364ed130 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -180,6 +180,8 @@ return array ( 'persona_connection_email' => 'Adresse courriel de connexion
    (pour Mozilla Persona)', 'allow_anonymous' => 'Autoriser la lecture anonyme des articles de l’utilisateur par défaut (%s)', 'allow_anonymous_refresh' => 'Autoriser le rafraîchissement anonyme des flux', + 'unsafe_autologin' => 'Autoriser les connexion automatiques non-sûres au format : ', + 'api_enabled' => 'Autoriser l’accès par API (nécessaire pour les applis mobiles)', 'auth_token' => 'Jeton d’identification', 'explain_token' => 'Permet d’accéder à la sortie RSS de l’utilisateur par défaut sans besoin de s’authentifier.
    %s?output=rss&token=%s', 'login_configuration' => 'Identification', diff --git a/app/views/configure/users.phtml b/app/views/configure/users.phtml index 3f3f19418..1a02b0e90 100644 --- a/app/views/configure/users.phtml +++ b/app/views/configure/users.phtml @@ -90,6 +90,17 @@ +
    +
    + +
    +
    +
    @@ -102,6 +113,16 @@
    +
    +
    + +
    +
    +
    -- 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(-) 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(+) 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 8a8fe93d34cc0886502f02732228051f77a0f1ff Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 10 Mar 2014 17:34:29 +0100 Subject: SQL: Update cached values after an optimization https://github.com/marienfressinaud/FreshRSS/issues/452 --- app/Controllers/entryController.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Controllers/entryController.php b/app/Controllers/entryController.php index ca7122a7c..bbcb990f5 100755 --- a/app/Controllers/entryController.php +++ b/app/Controllers/entryController.php @@ -100,6 +100,9 @@ class FreshRSS_entry_Controller extends Minz_ActionController { $entryDAO = new FreshRSS_EntryDAO(); $entryDAO->optimizeTable(); + $feedDAO = new FreshRSS_FeedDAO(); + $feedDAO->updateCachedValues(); + invalidateHttpCache(); $notif = array ( -- 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(-) 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 608b3a8656d986ff177e97e968256bcbf6785c13 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 10 Mar 2014 20:16:41 +0100 Subject: Link to logs in case of error when adding new feed https://github.com/marienfressinaud/FreshRSS/issues/453 --- app/Controllers/feedController.php | 4 ++-- app/i18n/en.php | 2 +- app/i18n/fr.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index 9996725e4..16516ad39 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -136,7 +136,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController { Minz_Log::record ($e->getMessage (), Minz_Log::WARNING); $notif = array ( 'type' => 'bad', - 'content' => Minz_Translate::t ('internal_problem_feed') + 'content' => Minz_Translate::t ('internal_problem_feed', Minz_Url::display(array('a' => 'logs'))) ); Minz_Session::_param ('notification', $notif); } catch (Minz_FileNotExistException $e) { @@ -144,7 +144,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController { Minz_Log::record ($e->getMessage (), Minz_Log::ERROR); $notif = array ( 'type' => 'bad', - 'content' => Minz_Translate::t ('internal_problem_feed') + 'content' => Minz_Translate::t ('internal_problem_feed', Minz_Url::display(array('a' => 'logs'))) ); Minz_Session::_param ('notification', $notif); } diff --git a/app/i18n/en.php b/app/i18n/en.php index 69247165f..7f95500ad 100644 --- a/app/i18n/en.php +++ b/app/i18n/en.php @@ -89,7 +89,7 @@ return array ( 'already_subscribed' => 'You have already subscribed to %s', 'feed_added' => 'RSS feed %s has been added', 'feed_not_added' => '%s could not be added', - 'internal_problem_feed' => 'The RSS feed could not be added. Check FressRSS logs for details.', + 'internal_problem_feed' => 'The RSS feed could not be added. Check FressRSS logs for details.', 'invalid_url' => 'URL %s is invalid', 'feed_actualized' => '%s has been updated', 'n_feeds_actualized' => '%d feeds have been updated', diff --git a/app/i18n/fr.php b/app/i18n/fr.php index e364ed130..91daa4f51 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -89,7 +89,7 @@ return array ( 'already_subscribed' => 'Vous êtes déjà abonné à %s', 'feed_added' => 'Le flux %s a bien été ajouté', 'feed_not_added' => '%s n’a pas pu être ajouté', - 'internal_problem_feed' => 'Le flux n’a pas pu être ajouté. Consulter les logs de FreshRSS pour plus de détails.', + 'internal_problem_feed' => 'Le flux n’a pas pu être ajouté. Consulter les logs de FreshRSS pour plus de détails.', 'invalid_url' => 'L’url %s est invalide', 'feed_actualized' => '%s a été mis à jour', 'n_feeds_actualized' => '%d flux ont été mis à jour', -- 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 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(-) 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(-) 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 f31747ee7bdaebf02e7e58d51c27102e0c7c9ef1 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Fri, 14 Mar 2014 06:15:52 -0400 Subject: Refresh page after getting new articles. Change the URL to the refresh link. Before it was redirecting to the home page. Now it is redirecting to the same page, which make more sense. See #457 --- app/Controllers/indexController.php | 4 +--- app/layout/nav_menu.phtml | 20 +++++--------------- app/views/helpers/view/normal_view.phtml | 2 +- 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/app/Controllers/indexController.php b/app/Controllers/indexController.php index 73f454715..9da1e5022 100755 --- a/app/Controllers/indexController.php +++ b/app/Controllers/indexController.php @@ -25,16 +25,14 @@ class FreshRSS_index_Controller extends Minz_ActionController { } } - // construction of RSS url of this feed $params = Minz_Request::params (); - $params['output'] = 'rss'; if (isset ($params['search'])) { $params['search'] = urlencode ($params['search']); } if (!Minz_Configuration::allowAnonymous()) { $params['token'] = $token; } - $this->view->rss_url = array ( + $this->view->url = array ( 'c' => 'index', 'a' => 'index', 'params' => $params diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml index 097809e08..ffdc95b24 100644 --- a/app/layout/nav_menu.phtml +++ b/app/layout/nav_menu.phtml @@ -99,17 +99,6 @@
    - 'index', - 'a' => 'index', - 'params' => $params - ); - ?> 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(-) 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 From 996c387f50f9b65f271b3cd13b9d63165236b6d2 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sun, 16 Mar 2014 19:43:17 +0100 Subject: Add some helpers to Minz_Log class Add following methods: - Minz_Log::debug($msg) - Minz_Log::notice($msg) - Minz_Log::warning($msg) - Minz_Log::error($msg) --- lib/Minz/Log.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lib/Minz/Log.php b/lib/Minz/Log.php index e710aad4a..d3eaec2ae 100644 --- a/lib/Minz/Log.php +++ b/lib/Minz/Log.php @@ -80,4 +80,21 @@ class Minz_Log { self::record($msg_get, Minz_Log::DEBUG, $file_name); self::record($msg_post, Minz_Log::DEBUG, $file_name); } + + /** + * Some helpers to Minz_Log::record() method + * Parameters are the same of those of the record() method. + */ + public static function debug($msg, $file_name = null) { + self::record($msg, Minz_Log::DEBUG, $file_name); + } + public static function notice($msg, $file_name = null) { + self::record($msg, Minz_Log::NOTICE, $file_name); + } + public static function warning($msg, $file_name = null) { + self::record($msg, Minz_Log::WARNING, $file_name); + } + public static function error($msg, $file_name = null) { + self::record($msg, Minz_Log::ERROR, $file_name); + } } -- cgit v1.2.3