From a201450b5817af23a57e8c68569c24ed5451b7ef Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sun, 2 Feb 2014 10:02:45 -0500 Subject: Modification des raccourcis de navigation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modification du raccourci pour naviguer au premier article (Home au lieu de Shift+j) Modification du raccourci pour naviguer au dernier article (End au lieu de Shift+k) Ajout de modificateurs pour utiliser les touches de navigation dans d'autres contextes (Shift pour les flux, Ctrl pour les catégories) Voir issue#256 --- app/Controllers/configureController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/Controllers/configureController.php') diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index 645f9eabf..a5d99c508 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -286,7 +286,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController { public function shortcutAction () { $list_keys = array ('a', 'b', 'backspace', 'c', 'd', 'delete', 'down', 'e', 'end', 'enter', - 'escape', 'f', 'g', 'h', 'i', 'insert', 'j', 'k', 'l', 'left', + 'escape', 'f', 'g', 'h', 'home', 'i', 'insert', 'j', 'k', 'l', 'left', 'm', 'n', 'o', 'p', 'page_down', 'page_up', 'q', 'r', 'return', 'right', 's', 'space', 't', 'tab', 'u', 'up', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', -- cgit v1.2.3 From 7dc5c9eff211b6f36340c9c40d7460afeb60fc96 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Tue, 11 Feb 2014 15:51:46 +0100 Subject: un ->color oublié MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fichier oublié dans le patch précédent https://github.com/marienfressinaud/FreshRSS/issues/295 --- app/Controllers/configureController.php | 2 -- 1 file changed, 2 deletions(-) (limited to 'app/Controllers/configureController.php') diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index a5d99c508..c0665d241 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -29,7 +29,6 @@ class FreshRSS_configure_Controller extends Minz_ActionController { $cat = new FreshRSS_Category ($name); $values = array ( 'name' => $cat->name (), - 'color' => $cat->color () ); $catDAO->updateCategory ($ids[$key], $values); } elseif ($ids[$key] != $defaultId) { @@ -43,7 +42,6 @@ class FreshRSS_configure_Controller extends Minz_ActionController { $values = array ( 'id' => $cat->id (), 'name' => $cat->name (), - 'color' => $cat->color () ); if ($catDAO->searchByName ($newCat) == false) { -- cgit v1.2.3 From 11c4c733d6971a977748f874b4976044bab7afc0 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Tue, 11 Feb 2014 23:04:12 +0100 Subject: Bug mise à jour favicons dans le cas de flux invalides MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Controllers/configureController.php | 2 +- app/Controllers/feedController.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'app/Controllers/configureController.php') diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index c0665d241..ad8bc546a 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -114,7 +114,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController { if ($feedDAO->updateFeed ($id, $values)) { $this->view->flux->_category ($cat); - + $this->view->flux->faviconPrepare(); $notif = array ( 'type' => 'good', 'content' => Minz_Translate::t ('feed_updated') diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index 61bfc5919..d98c77558 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -249,12 +249,12 @@ class FreshRSS_feed_Controller extends Minz_ActionController { if ($feed->url() !== $url) { //URL has changed (auto-discovery) $feedDAO->updateFeed($feed->id(), array('url' => $feed->url())); } - $feed->faviconPrepare(); } catch (FreshRSS_Feed_Exception $e) { Minz_Log::record ($e->getMessage (), Minz_Log::NOTICE); $feedDAO->updateLastUpdate ($feed->id (), 1); } + $feed->faviconPrepare(); $feed->unlock(); unset($feed); -- cgit v1.2.3 From 27764b36353b3066a9e92da2a96ac17b546295be Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sat, 22 Feb 2014 16:53:51 -0500 Subject: Improve sharing Previously, the share page can handle only a limited number of shares and only one of each type. Now the configuration has been change to be more flexible and allows an unlimited number of shares. The share description is located in an array and the share configuration is stored along with the user configuration. Note: I tried to include the specific javascript code in a separate file but I did not succeded to import it. --- app/Controllers/configureController.php | 12 +---- app/Models/Configuration.php | 56 ++++++++++------------- app/Models/Share.php | 44 ++++++++++++++++++ app/i18n/en.php | 3 ++ app/i18n/fr.php | 3 ++ app/views/configure/sharing.phtml | 77 +++++++++++++------------------- app/views/helpers/view/normal_view.phtml | 73 +++++------------------------- data/shares.php | 75 +++++++++++++++++++++++++++++++ p/scripts/main.js | 28 +++++++++++- 9 files changed, 219 insertions(+), 152 deletions(-) create mode 100644 app/Models/Share.php create mode 100644 data/shares.php (limited to 'app/Controllers/configureController.php') diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index ad8bc546a..104fa8900 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -192,16 +192,8 @@ class FreshRSS_configure_Controller extends Minz_ActionController { public function sharingAction () { if (Minz_Request::isPost ()) { - $this->view->conf->_sharing (array( - 'shaarli' => Minz_Request::param ('shaarli', false), - 'wallabag' => Minz_Request::param ('wallabag', false), - 'diaspora' => Minz_Request::param ('diaspora', false), - 'twitter' => Minz_Request::param ('twitter', false), - 'g+' => Minz_Request::param ('g+', false), - 'facebook' => Minz_Request::param ('facebook', false), - 'email' => Minz_Request::param ('email', false), - 'print' => Minz_Request::param ('print', false), - )); + $params = Minz_Request::params(); + $this->view->conf->_sharing ($params['share']); $this->view->conf->save(); invalidateHttpCache(); diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php index 2b719c370..052e28ba8 100644 --- a/app/Models/Configuration.php +++ b/app/Models/Configuration.php @@ -48,16 +48,7 @@ class FreshRSS_Configuration { 'bottomline_tags' => true, 'bottomline_date' => true, 'bottomline_link' => true, - 'sharing' => array( - 'shaarli' => '', - 'wallabag' => '', - 'diaspora' => '', - 'twitter' => true, - 'g+' => true, - 'facebook' => true, - 'email' => true, - 'print' => true, - ), + 'sharing' => array(), ); private $available_languages = array( @@ -65,8 +56,10 @@ class FreshRSS_Configuration { 'fr' => 'Français', ); - public function __construct ($user) { - $this->filename = DATA_PATH . '/' . $user . '_user.php'; + private $shares; + + public function __construct($user) { + $this->filename = DATA_PATH . DIRECTORY_SEPARATOR . $user . '_user.php'; $data = @include($this->filename); if (!is_array($data)) { @@ -80,10 +73,20 @@ class FreshRSS_Configuration { } } $this->data['user'] = $user; + + $this->shares = DATA_PATH . DIRECTORY_SEPARATOR . 'shares.php'; + + $shares = @include($this->shares); + if (!is_array($shares)) { + throw new Minz_PermissionDeniedException($this->shares); + } + + $this->data['shares'] = $shares; } public function save() { @rename($this->filename, $this->filename . '.bak.php'); + unset($this->data['shares']); // Remove shares because it is not intended to be stored in user configuration if (file_put_contents($this->filename, "data, true) . ';', LOCK_EX) === false) { throw new Minz_PermissionDeniedException($this->filename); } @@ -104,16 +107,6 @@ class FreshRSS_Configuration { } } - public function sharing($key = false) { - if ($key === false) { - return $this->data['sharing']; - } - if (isset($this->data['sharing'][$key])) { - return $this->data['sharing'][$key]; - } - return false; - } - public function availableLanguages() { return $this->available_languages; } @@ -187,24 +180,23 @@ class FreshRSS_Configuration { } } public function _sharing ($values) { - $are_url = array ('shaarli', 'wallabag', 'diaspora'); - foreach ($values as $key => $value) { - if (in_array($key, $are_url)) { + $this->data['sharing'] = array(); + foreach ($values as $value) { + if (array_key_exists('url', $value)) { $is_url = ( - filter_var ($value, FILTER_VALIDATE_URL) || + filter_var ($value['url'], FILTER_VALIDATE_URL) || (version_compare(PHP_VERSION, '5.3.3', '<') && (strpos($value, '-') > 0) && ($value === filter_var($value, FILTER_SANITIZE_URL))) ); //PHP bug #51192 - if (!$is_url) { - $value = ''; + continue; + } + if (!array_key_exists('name', $value) || strcmp($value['name'], '') === 0) { + $value['name'] = $value['type']; } - } elseif (!is_bool($value)) { - $value = true; } - - $this->data['sharing'][$key] = $value; + $this->data['sharing'][] = $value; } } public function _theme($value) { diff --git a/app/Models/Share.php b/app/Models/Share.php new file mode 100644 index 000000000..b146db722 --- /dev/null +++ b/app/Models/Share.php @@ -0,0 +1,44 @@ + 'HTTP username', 'http_password' => 'HTTP password', 'blank_to_disable' => 'Leave blank to disable', + 'share_name' => 'Share name to display', + 'share_url' => 'Share URL to use', 'not_yet_implemented' => 'Not yet implemented', 'access_protected_feeds' => 'Connection allows to access HTTP protected RSS feeds', 'no_selected_feed' => 'No feed selected.', @@ -230,6 +232,7 @@ return array ( 'more_information' => 'More information', 'activate_sharing' => 'Activate sharing', 'shaarli' => 'Shaarli', + 'blogotext' => 'Blogotext', 'wallabag' => 'wallabag', 'diaspora' => 'Diaspora*', 'twitter' => 'Twitter', diff --git a/app/i18n/fr.php b/app/i18n/fr.php index ab7843d12..7420e2fdd 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -166,6 +166,8 @@ return array ( 'http_username' => 'Identifiant HTTP', 'http_password' => 'Mot de passe HTTP', 'blank_to_disable' => 'Laissez vide pour désactiver', + 'share_name' => 'Nom du partage à afficher', + 'share_url' => 'URL du partage à utiliser', 'not_yet_implemented' => 'Pas encore implémenté', 'access_protected_feeds' => 'La connexion permet d’accéder aux flux protégés par une authentification HTTP', 'no_selected_feed' => 'Aucun flux sélectionné.', @@ -230,6 +232,7 @@ return array ( 'more_information' => 'Plus d’informations', 'activate_sharing' => 'Activer le partage', 'shaarli' => 'Shaarli', + 'blogotext' => 'Blogotext', 'wallabag' => 'wallabag', 'diaspora' => 'Diaspora*', 'twitter' => 'Twitter', diff --git a/app/views/configure/sharing.phtml b/app/views/configure/sharing.phtml index e3ea11665..e46284955 100644 --- a/app/views/configure/sharing.phtml +++ b/app/views/configure/sharing.phtml @@ -3,54 +3,41 @@
-
+ +
' + data-advanced='
+ + + +
'> -
- -
- - - -
-
- -
- -
- - - -
-
- -
- -
- - - + conf->sharing as $key => $sharing): ?> + conf->shares[$sharing['type']]; ?> +
+ +
+ + ' /> + + + + + +
-
+ -
- +
- - - + +
@@ -61,4 +48,4 @@
- + \ No newline at end of file diff --git a/app/views/helpers/view/normal_view.phtml b/app/views/helpers/view/normal_view.phtml index ae93b627c..f27984025 100644 --- a/app/views/helpers/view/normal_view.phtml +++ b/app/views/helpers/view/normal_view.phtml @@ -8,19 +8,10 @@ if (!empty($this->entries)) { $display_yesterday = true; $display_others = true; if ($this->loginOk) { - $shaarli = $this->conf->sharing ('shaarli'); - $wallabag = $this->conf->sharing ('wallabag'); - $diaspora = $this->conf->sharing ('diaspora'); + $sharing = $this->conf->sharing; } else { - $shaarli = ''; - $wallabag = ''; - $diaspora = ''; + $sharing = array(); } - $twitter = $this->conf->sharing ('twitter'); - $google_plus = $this->conf->sharing ('g+'); - $facebook = $this->conf->sharing ('facebook'); - $email = $this->conf->sharing ('email'); - $print = $this->conf->sharing ('print'); $hidePosts = !$this->conf->display_posts; $lazyload = $this->conf->lazyload; $topline_read = $this->conf->topline_read; @@ -29,9 +20,7 @@ if (!empty($this->entries)) { $topline_link = $this->conf->topline_link; $bottomline_read = $this->conf->bottomline_read; $bottomline_favorite = $this->conf->bottomline_favorite; - $bottomline_sharing = $this->conf->bottomline_sharing && ( - $shaarli || $wallabag || $diaspora || $twitter || - $google_plus || $facebook || $email || $print); + $bottomline_sharing = $this->conf->bottomline_sharing && (count($sharing)); $bottomline_tags = $this->conf->bottomline_tags; $bottomline_date = $this->conf->bottomline_date; $bottomline_link = $this->conf->bottomline_link; @@ -146,55 +135,13 @@ if (!empty($this->entries)) { diff --git a/data/shares.php b/data/shares.php new file mode 100644 index 000000000..44176f1bf --- /dev/null +++ b/data/shares.php @@ -0,0 +1,75 @@ + array( + 'url' => '~URL~?post=~LINK~&title=~TITLE~&source=FreshRSS', + 'transform' => array('urlencode'), + 'help' => 'http://sebsauvage.net/wiki/doku.php?id=php:shaarli', + 'form' => 'advanced', + ), + 'blogotext' => array( + 'url' => '~URL~/admin/links.php?url=~LINK~', + 'transform' => array(), + 'help' => 'http://lehollandaisvolant.net/blogotext/fr/', + 'form' => 'advanced', + ), + 'wallabag' => array( + 'url' => '~URL~?action=add&url=~LINK~', + 'transform' => array( + 'link' => array('base64_encode'), + 'title' => array(), + ), + 'help' => 'http://www.wallabag.org/', + 'form' => 'advanced', + ), + 'diaspora' => array( + 'url' => '~URL~/bookmarklet?url=~LINK~&title=~TITLE~', + 'transform' => array('urlencode'), + 'help' => 'https://diasporafoundation.org/', + 'form' => 'advanced', + ), + 'twitter' => array( + 'url' => 'https://twitter.com/share?url=~LINK~&text=~TITLE~', + 'transform' => array('urlencode'), + 'form' => 'simple', + ), + 'g+' => array( + 'url' => 'https://plus.google.com/share?url=~LINK~', + 'transform' => array('urlencode'), + 'form' => 'simple', + ), + 'facebook' => array( + 'url' => 'https://www.facebook.com/sharer.php?u=~LINK~&t=~TITLE~', + 'transform' => array('urlencode'), + 'form' => 'simple', + ), + 'email' => array( + 'url' => 'mailto:?subject=~TITLE~&body=~LINK~', + 'transform' => array( + 'link' => array('urlencode'), + 'title' => array(), + ), + 'form' => 'simple', + ), + 'print' => array( + 'url' => '#', + 'transform' => array(), + 'form' => 'simple', + ), +); diff --git a/p/scripts/main.js b/p/scripts/main.js index beb77a19c..ec27bd50c 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -1,6 +1,7 @@ "use strict"; var $stream = null, - isCollapsed = true; + isCollapsed = true, + shares = 0; function is_normal_mode() { return $stream.hasClass('normal'); @@ -945,7 +946,7 @@ function init_confirm_action() { } function init_print_action() { - $('.print-article').click(function () { + $('.item.share > a[href="#"]').click(function () { var content = "