diff options
| author | 2014-09-26 14:36:30 +0200 | |
|---|---|---|
| committer | 2014-09-26 14:36:30 +0200 | |
| commit | 147a3d21bbe78ae66c7134ac0c355472a92e1159 (patch) | |
| tree | 7f8ca64ccc0939c8c9aef145a8fd86cc2e52640b | |
| parent | 7e949d50320317b5c3b5a2da2bdaf324e794b2f7 (diff) | |
| parent | c14162221365077bcaeecde7127806190490dd58 (diff) | |
Merge branch 'dev'
197 files changed, 15150 insertions, 9196 deletions
@@ -1,5 +1,87 @@ # Journal des modifications +## 2014-09-xx FreshRSS 0.8.0 + +* UI + * New interface for statistics + * Fix filter buttons + * Number of articles divided by 2 in reading view + * Redesign of bigMarkAsRead +* Features + * New automatic update system + * New reset auth system +* Security + * "Mark as read" requires POST requests for several articles + * Test HTTP REFERER in install.php +* Configuration + * New "Show all articles" / "Show only unread" / "Adjust viewing" option + * New notification timeout option +* Misc. + * Improve coding style + comments + * Fix SQLite bug "ON DELETE CASCADE" + * Improve performance when importing articles + + +## 2014-08-24 FreshRSS 0.7.4 + +* UI + * Hide categories/feeds with unread articles when showing only unread articles + * Dynamic favicon showing the number of unread articles + * New theme: Screwdriver by Mister aiR +* Statistics + * New page with article repartition + * Improvements +* Security + * Basic protection against XSRF (Cross-Site Request Forgery) based on HTTP Referer (POST requests only) +* API + * Compatible with lighttpd +* Misc. + * Changed lazyload implementation + * Support of HTML5 notifications for new upcoming articles + * Add option to stay logged in +* Bux fixes in export function, add/remove users, keyboard shortcuts, etc. + + +## 2014-07-21 FreshRSS 0.7.3 + +* New options + * Add system of user queries which are shortcuts to filter the view + * New TTL option to limit the frequency at which feeds are refreshed (by cron or manual refresh button). + It is still possible to manually refresh an individual feed at a higher frequency. +* SQL + * Add support for SQLite (beta) in addition to MySQL +* SimplePie + * Complies with HTTP "301 Moved Permanently" responses by automatically updating the URL of feeds that have changed address. +* Themes + * Flat and Dark designs are based on same template file as Origine +* Statistics + * Refactor code + * Add an idle feed page +* Misc + * Several bug fixes + * Add confirmation option when marking all articles as read + * Fix some typo + + +## 2014-06-13 FreshRSS 0.7.2 + +* API compatible with Google Reader API level 2 + * FreshRSS can now be used from e.g.: + * (Android) News+ https://play.google.com/store/apps/details?id=com.noinnion.android.newsplus.extension.google_reader + * (Android) EasyRSS https://github.com/Alkarex/EasyRSS +* Basic support for audio and video podcasts +* Searching + * New search filters date: and pubdate: accepting ISO 8601 date intervals such as `date:2013-2014` or `pubdate:P1W` + * Possibility to combine search filters, e.g. `date:2014-05 intitle:FreshRSS intitle:Open great reader #Internet` +* Change nav menu with more buttons instead of dropdown menus and add some filters +* New system of import / export + * Support OPML, Json (like Google Reader) and Zip archives + * Can export and import articles (specific option for favorites) +* Refactor "Origine" theme + * Some improvements + * Based on a template file (other themes will use it too) + + ## 2014-02-19 FreshRSS 0.7.1 * Mise à jour des flux plus rapide grâce à une meilleure utilisation du cache diff --git a/README.fr.md b/README.fr.md new file mode 100644 index 000000000..df43ef7e8 --- /dev/null +++ b/README.fr.md @@ -0,0 +1,101 @@ +* [English version](README.md) + +# FreshRSS +FreshRSS est un agrégateur de flux RSS à auto-héberger à l’image de [Leed](http://projet.idleman.fr/leed/) ou de [Kriss Feed](http://tontof.net/kriss/feed/). + +Il se veut léger et facile à prendre en main tout en étant un outil puissant et paramétrable. + +Il permet de gérer plusieurs utilisateurs, et dispose d’un mode de lecture anonyme. + +* Site officiel : http://freshrss.org +* Démo : http://demo.freshrss.org/ +* Développeur : Marien Fressinaud <dev@marienfressinaud.fr> +* Version actuelle : 0.8-dev +* Date de publication 2014-0x-xx +* License [GNU AGPL 3](http://www.gnu.org/licenses/agpl-3.0.html) + + + +# Note sur les branches +**Ce logiciel est encore en développement !** Veuillez vous assurer d'utiliser la branche qui vous correspond : + +* Utilisez [la branche master](https://github.com/marienfressinaud/FreshRSS/tree/master/) si vous visez la stabilité. +* [La branche beta](https://github.com/marienfressinaud/FreshRSS/tree/beta) est celle par défaut : les nouveautés y sont ajoutées environ tous les mois. +* Pour les développeurs et ceux qui savent ce qu'ils font, [la branche dev](https://github.com/marienfressinaud/FreshRSS/tree/dev) vous ouvre les bras ! + +# Disclaimer +Cette application a été développée pour s’adapter à des besoins personnels et non professionnels. +Je ne garantis en aucun cas la sécurité de celle-ci, ni son bon fonctionnement. +Je m’engage néanmoins à répondre dans la mesure du possible aux demandes d’évolution si celles-ci me semblent justifiées. +Privilégiez pour cela des demandes sur GitHub +(https://github.com/marienfressinaud/FreshRSS/issues) ou par mail (dev@marienfressinaud.fr) + +# Pré-requis +* Serveur modeste, par exemple sous Linux ou Windows + * Fonctionne même sur un Raspberry Pi avec des temps de réponse < 1s (testé sur 150 flux, 22k articles, soit 32Mo de données partiellement compressées) +* Serveur Web Apache2 (recommandé), ou nginx, lighttpd (non testé sur les autres) +* PHP 5.2.1+ (PHP 5.3.7+ recommandé) + * Requis : [PDO_MySQL](http://php.net/pdo-mysql) ou [PDO_SQLite](http://php.net/pdo-sqlite), [cURL](http://php.net/curl), [GMP](http://php.net/gmp) (seulement pour accès API sur platformes < 64 bits) + * Recommandés : [JSON](http://php.net/json), [mbstring](http://php.net/mbstring), [zlib](http://php.net/zlib), [Zip](http://php.net/zip) +* MySQL 5.0.3+ (recommandé) ou SQLite 3.7.4+ +* Un navigateur Web récent tel Firefox 4+, Chrome, Opera, Safari, Internet Explorer 9+ + * Fonctionne aussi sur mobile + + + +# Installation +1. Récupérez l’application FreshRSS via la commande git ou [en téléchargeant l’archive](https://github.com/marienfressinaud/FreshRSS/archive/master.zip) +2. Placez l’application sur votre serveur (la partie à exposer au Web est le répertoire `./p/`) +3. Le serveur Web doit avoir les droits d’écriture dans le répertoire `./data/` +4. Accédez à FreshRSS à travers votre navigateur Web et suivez les instructions d’installation +5. Tout devrait fonctionner :) En cas de problème, n’hésitez pas à me contacter. + +# Contrôle d’accès +Il est requis pour le mode multi-utilisateur, et recommandé dans tous les cas, de limiter l’accès à votre FreshRSS. Au choix : +* En utilisant l’identification par formulaire (requiert JavaScript, et PHP 5.3.7+ recommandé – fonctionne avec certaines versions de PHP 5.3.3+) +* En utilisant l’identification par [Mozilla Persona](https://login.persona.org/about) incluse dans FreshRSS +* En utilisant un contrôle d’accès HTTP défini par votre serveur Web + * Voir par exemple la [documentation d’Apache sur l’authentification](http://httpd.apache.org/docs/trunk/howto/auth.html) + * Créer dans ce cas un fichier `./p/i/.htaccess` avec un fichier `.htpasswd` correspondant. + +# Rafraîchissement automatique des flux +* Vous pouvez ajouter une tâche Cron lançant régulièrement le script d’actualisation automatique des flux. +Consultez la documentation de Cron de votre système d’exploitation ([Debian/Ubuntu](http://doc.ubuntu-fr.org/cron), [Red Hat/Fedora](http://doc.fedora-fr.org/wiki/CRON_:_Configuration_de_t%C3%A2ches_automatis%C3%A9es), [Slackware](http://docs.slackware.com/fr:slackbook:process_control?#cron), [Gentoo](http://wiki.gentoo.org/wiki/Cron/fr), [Arch Linux](http://wiki.archlinux.fr/Cron)…). +C’est une bonne idée d’utiliser le même utilisateur que votre serveur Web (souvent “www-data”). +Par exemple, pour exécuter le script toutes les heures : + +``` +7 * * * * php /chemin/vers/FreshRSS/app/actualize_script.php > /tmp/FreshRSS.log 2>&1 +``` + +# Conseils +* Pour une meilleure sécurité, faites en sorte que seul le répertoire `./p/` soit accessible depuis le Web, par exemple en faisant pointer un sous-domaine sur le répertoire `./p/`. + * En particulier, les données personnelles se trouvent dans le répertoire `./data/`. +* Le fichier `./constants.php` définit les chemins d’accès aux répertoires clés de l’application. Si vous les bougez, tout se passe ici. +* En cas de problème, les logs peuvent être utile à lire, soit depuis l’interface de FreshRSS, soit manuellement depuis `./data/log/*.log`. + +# Sauvegarde +* Il faut conserver vos fichiers `./data/config.php` ainsi que `./data/*_user.php` et éventuellement `./data/persona/` +* Vous pouvez exporter votre liste de flux depuis FreshRSS au format OPML +* Pour sauvegarder les articles eux-même, vous pouvez utiliser [phpMyAdmin](http://www.phpmyadmin.net) ou les outils de MySQL : + +```bash +mysqldump -u utilisateur -p --databases freshrss > freshrss.sql +``` + + +# Bibliothèques incluses +* [SimplePie](http://simplepie.org/) +* [MINZ](https://github.com/marienfressinaud/MINZ) +* [php-http-304](http://alexandre.alapetite.fr/doc-alex/php-http-304/) +* [jQuery](http://jquery.com/) +* [keyboard_shortcuts](http://www.openjs.com/scripts/events/keyboard_shortcuts/) +* [flotr2](http://www.humblesoftware.com/flotr2) + +## Uniquement pour certaines options +* [bcrypt.js](https://github.com/dcodeIO/bcrypt.js) +* [phpQuery](http://code.google.com/p/phpquery/) + +## Si les fonctions natives ne sont pas disponibles +* [Services_JSON](http://pear.php.net/pepr/pepr-proposal-show.php?id=198) +* [password_compat](https://github.com/ircmaxell/password_compat) @@ -1,80 +1,90 @@ +* [Version française](README.fr.md) + # FreshRSS -FreshRSS est un agrégateur de flux RSS à auto-héberger à l’image de [Leed](http://projet.idleman.fr/leed/) ou de [Kriss Feed](http://tontof.net/kriss/feed/). +FreshRSS is a self-hosted RSS feed agregator like [Leed](http://projet.idleman.fr/leed/) or [Kriss Feed](http://tontof.net/kriss/feed/). -Il se veut léger et facile à prendre en main tout en étant un outil puissant et paramétrable. +It is at the same time light-weight, easy to work with, powerful and customizable. -Il permet de gérer plusieurs utilisateurs, et dispose d’un mode de lecture anonyme. +It is a multi-user application with an anonymous reading mode. -* Site officiel : http://freshrss.org -* Démo : http://demo.freshrss.org/ -* Développeur : Marien Fressinaud <dev@marienfressinaud.fr> -* Version actuelle : 0.7.1 -* Date de publication 2014-02-19 +* Official website: http://freshrss.org +* Demo: http://demo.freshrss.org/ +* Developer: Marien Fressinaud <dev@marienfressinaud.fr> +* Current version: 0.8-dev +* Publication date: 2014-0x-xx * License [GNU AGPL 3](http://www.gnu.org/licenses/agpl-3.0.html) - + + +# Note on branches +**This application is still in development!** Please use the branch that suits your needs: + +* Use [the master branch](https://github.com/marienfressinaud/FreshRSS/tree/master/) if you need a stable version. +* [The beta branch](https://github.com/marienfressinaud/FreshRSS/tree/beta) is the default branch: new features are added on a monthly basis. +* For developers and tech savvy persons, [the dev branch](https://github.com/marienfressinaud/FreshRSS/tree/dev) is waiting for you! # Disclaimer -Cette application a été développée pour s’adapter à des besoins personnels et non professionnels. -Je ne garantis en aucun cas la sécurité de celle-ci, ni son bon fonctionnement. -Je m’engage néanmoins à répondre dans la mesure du possible aux demandes d’évolution si celles-ci me semblent justifiées. -Privilégiez pour cela des demandes sur GitHub -(https://github.com/marienfressinaud/FreshRSS/issues) ou par mail (dev@marienfressinaud.fr) - -# Pré-requis -* Serveur modeste, par exemple sous Linux ou Windows - * Fonctionne même sur un Raspberry Pi avec des temps de réponse < 1s (testé sur 150 flux, 22k articles, soit 32Mo de données partiellement compressées) -* Serveur Web Apache2 ou Nginx (non testé sur les autres) -* PHP 5.2.1+ (PHP 5.3.7+ recommandé) - * Requis : [PDO_MySQL](http://php.net/pdo-mysql), [cURL](http://php.net/curl), [LibXML](http://php.net/xml), [PCRE](http://php.net/pcre), [ctype](http://php.net/ctype) - * Recommandés : [JSON](http://php.net/json), [zlib](http://php.net/zlib), [mbstring](http://php.net/mbstring), [iconv](http://php.net/iconv) -* MySQL 5.0.3+ (ou SQLite 3.7.4+ à venir) -* Un navigateur Web récent tel Firefox 4+, Chrome, Opera, Safari, Internet Explorer 9+ - * Fonctionne aussi sur mobile - - +This application was developed to fulfill personal needs not professional needs. +There is no guarantee neither on its security nor its proper functioning. +If there is feature requests which I think are good for the project, I'll do my best to include them. +The best way is to open issues on GitHub +(https://github.com/marienfressinaud/FreshRSS/issues) or by email (dev@marienfressinaud.fr) + +# Requirements +* Light server running Linux or Windows + * It even works on Raspberry Pi with response time under a second (tested with 150 feeds, 22k articles, or 32Mo of compressed data) +* A web server: Apache2 (recommanded), nginx, lighttpd (not tested on others) +* PHP 5.2.1+ (PHP 5.3.7+ recommanded) + * Required extensions: [PDO_MySQL](http://php.net/pdo-mysql) or [PDO_SQLite](http://php.net/pdo-sqlite), [cURL](http://php.net/curl), [GMP](http://php.net/gmp) (only for API access on platforms under 64 bits) + * Recommanded extensions : [JSON](http://php.net/json), [mbstring](http://php.net/mbstring), [zlib](http://php.net/zlib), [Zip](http://php.net/zip) +* MySQL 5.0.3+ (recommanded) ou SQLite 3.7.4+ +* A recent browser like Firefox 4+, Chrome, Opera, Safari, Internet Explorer 9+ + * Works on mobile + + # Installation -1. Récupérez l’application FreshRSS via la commande git ou [en téléchargeant l’archive](https://github.com/marienfressinaud/FreshRSS/archive/master.zip) -2. Placez l’application sur votre serveur (la partie à exposer au Web est le répertoire `./p/`) -3. Le serveur Web doit avoir les droits d’écriture dans le répertoire `./data/` -4. Accédez à FreshRSS à travers votre navigateur Web et suivez les instructions d’installation -5. Tout devrait fonctionner :) En cas de problème, n’hésitez pas à me contacter. - -# Contrôle d’accès -Il est requis pour le mode multi-utilisateur, et recommandé dans tous les cas, de limiter l’accès à votre FreshRSS : -* En utilisant l’identification par [Mozilla Persona](https://login.persona.org/about) incluse dans FreshRSS -* En utilisant un contrôle d’accès HTTP défini par votre serveur Web - * Voir par exemple la [documentation d’Apache sur l’authentification](http://httpd.apache.org/docs/trunk/howto/auth.html) - * Créer dans ce cas un fichier `./p/i/.htaccess` avec un fichier `.htpasswd` correspondant. - -# Rafraîchissement automatique des flux -* Vous pouvez ajouter une tâche Cron lançant régulièrement le script d’actualisation automatique des flux. -Consultez la documentation de Cron de votre système d’exploitation ([Debian/Ubuntu](http://doc.ubuntu-fr.org/cron), [Red Hat/Fedora](http://doc.fedora-fr.org/wiki/CRON_:_Configuration_de_t%C3%A2ches_automatis%C3%A9es), [Slackware](http://docs.slackware.com/fr:slackbook:process_control?#cron), [Gentoo](http://wiki.gentoo.org/wiki/Cron/fr), [Arch Linux](http://wiki.archlinux.fr/Cron)…). -C’est une bonne idée d’utiliser le même utilisateur que votre serveur Web (souvent “www-data”). -Par exemple, pour exécuter le script toutes les heures : +1. Get FreshRSS with git or [by downloading the archive](https://github.com/marienfressinaud/FreshRSS/archive/master.zip) +2. Dump the application on your server (expose only the `./p/` folder) +3. Add write access on `./data/` folder to the webserver user +4. Access FreshRSS with your browser and follow the installation process +5. Every thing should be working :) If you encounter any problem, feel free to contact me. + +# Access control +It is needed for the multi-user mode to limit access to FreshRSS. You can: +* use form authentication (need JavaScript and PHP 5.3.7+, works with some PHP 5.3.3+) +* use [Mozilla Persona](https://login.persona.org/about) authentication included in FreshRSS +* use HTTP authentication supported by your web server + * See [Apache documentation](http://httpd.apache.org/docs/trunk/howto/auth.html) + * In that case, create a `./p/i/.htaccess` file with a matching `.htpasswd` file. + +# Automatic feed update +* You can add a Cron job to launch the update script. +Check the Cron documentation related to your distribution ([Debian/Ubuntu](https://help.ubuntu.com/community/CronHowto), [Red Hat/Fedora](https://fedoraproject.org/wiki/Administration_Guide_Draft/Cron), [Slackware](http://docs.slackware.com/fr:slackbook:process_control?#cron), [Gentoo](https://wiki.gentoo.org/wiki/Cron), [Arch Linux](https://wiki.archlinux.org/index.php/Cron)…). +It’s a good idea to use the web server user . +For example, if you want to run the script every hour: ``` 7 * * * * php /chemin/vers/FreshRSS/app/actualize_script.php > /tmp/FreshRSS.log 2>&1 ``` -# Conseils -* Pour une meilleure sécurité, faites en sorte que seul le répertoire `./p/` soit accessible depuis le Web, par exemple en faisant pointer un sous-domaine sur le répertoire `./p/`. - * En particulier, les données personnelles se trouvent dans le répertoire `./data/`. -* Le fichier `./constants.php` définit les chemins d’accès aux répertoires clés de l’application. Si vous les bougez, tout se passe ici. -* En cas de problème, les logs peuvent être utile à lire, soit depuis l’interface de FreshRSS, soit manuellement depuis `./data/log/*.log`. +# Advices +* For a better security, expose only the `./p/` folder on the web. + * Be aware that the `./data/` folder contain all personal data, so it is a bad idea to expose it. +* The `./constants.php` file define access to application folder. If you want to customize your installation, every thing happens here. +* If you encounter some problem, logs are accessibles from the interface or manually in `./data/log/*.log` files. -# Sauvegarde -* Il faut conserver vos fichiers `./data/config.php` ainsi que `./data/*_user.php` et éventuellement `./data/persona/` -* Vous pouvez exporter votre liste de flux depuis FreshRSS au format OPML -* Pour sauvegarder les articles eux-même, vous pouvez utiliser [phpMyAdmin](http://www.phpmyadmin.net) ou les outils de MySQL : +# Backup +* You need to keep `./data/config.php`, `./data/*_user.php` and `./data/persona/` files +* You can export your feed list in OPML format from FreshRSS +* To save articles, you can use [phpMyAdmin](http://www.phpmyadmin.net) or MySQL tools: ```bash -mysqldump -u utilisateur -p --databases freshrss > freshrss.sql +mysqldump -u user -p --databases freshrss > freshrss.sql ``` -# Bibliothèques incluses +# Included libraries * [SimplePie](http://simplepie.org/) * [MINZ](https://github.com/marienfressinaud/MINZ) * [php-http-304](http://alexandre.alapetite.fr/doc-alex/php-http-304/) @@ -82,11 +92,10 @@ mysqldump -u utilisateur -p --databases freshrss > freshrss.sql * [keyboard_shortcuts](http://www.openjs.com/scripts/events/keyboard_shortcuts/) * [flotr2](http://www.humblesoftware.com/flotr2) -## Uniquement pour certaines options +## Only for some options * [bcrypt.js](https://github.com/dcodeIO/bcrypt.js) * [phpQuery](http://code.google.com/p/phpquery/) -* [Lazy Load](http://www.appelsiini.net/projects/lazyload) -## Si les fonctions natives ne sont pas disponibles +## If native functions are not available * [Services_JSON](http://pear.php.net/pepr/pepr-proposal-show.php?id=198) * [password_compat](https://github.com/ircmaxell/password_compat) diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index ad8bc546a..231865bd7 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -1,82 +1,123 @@ <?php +/** + * Controller to handle every configuration options. + */ class FreshRSS_configure_Controller extends Minz_ActionController { - public function firstAction () { + /** + * This action is called before every other action in that class. It is + * the common boiler plate for every action. It is triggered by the + * underlying framework. + * + * @todo see if the category default configuration is needed here or if + * we can move it to the categorize action + */ + public function firstAction() { if (!$this->view->loginOk) { - Minz_Error::error ( + Minz_Error::error( 403, - array ('error' => array (Minz_Translate::t ('access_denied'))) + array('error' => array(_t('access_denied'))) ); } - $catDAO = new FreshRSS_CategoryDAO (); - $catDAO->checkDefault (); + $catDAO = new FreshRSS_CategoryDAO(); + $catDAO->checkDefault(); } - public function categorizeAction () { - $feedDAO = new FreshRSS_FeedDAO (); - $catDAO = new FreshRSS_CategoryDAO (); - $defaultCategory = $catDAO->getDefault (); - $defaultId = $defaultCategory->id (); + /** + * This action handles the category configuration page + * + * It displays the category configuration page. + * If this action is reached through a POST request, it loops through + * every category to check for modification then add a new category if + * needed then sends a notification to the user. + * If a category name is emptied, the category is deleted and all + * related feeds are moved to the default category. Related user queries + * are deleted too. + * If a category name is changed, it is updated. + */ + public function categorizeAction() { + $feedDAO = FreshRSS_Factory::createFeedDao(); + $catDAO = new FreshRSS_CategoryDAO(); + $defaultCategory = $catDAO->getDefault(); + $defaultId = $defaultCategory->id(); - if (Minz_Request::isPost ()) { - $cats = Minz_Request::param ('categories', array ()); - $ids = Minz_Request::param ('ids', array ()); - $newCat = trim (Minz_Request::param ('new_category', '')); + if (Minz_Request::isPost()) { + $cats = Minz_Request::param('categories', array()); + $ids = Minz_Request::param('ids', array()); + $newCat = trim(Minz_Request::param('new_category', '')); foreach ($cats as $key => $name) { - if (strlen ($name) > 0) { - $cat = new FreshRSS_Category ($name); - $values = array ( - 'name' => $cat->name (), + if (strlen($name) > 0) { + $cat = new FreshRSS_Category($name); + $values = array( + 'name' => $cat->name(), ); - $catDAO->updateCategory ($ids[$key], $values); + $catDAO->updateCategory($ids[$key], $values); } elseif ($ids[$key] != $defaultId) { - $feedDAO->changeCategory ($ids[$key], $defaultId); - $catDAO->deleteCategory ($ids[$key]); + $feedDAO->changeCategory($ids[$key], $defaultId); + $catDAO->deleteCategory($ids[$key]); + + // Remove related queries. + $this->view->conf->remove_query_by_get('c_' . $ids[$key]); + $this->view->conf->save(); } } if ($newCat != '') { - $cat = new FreshRSS_Category ($newCat); - $values = array ( - 'id' => $cat->id (), - 'name' => $cat->name (), + $cat = new FreshRSS_Category($newCat); + $values = array( + 'id' => $cat->id(), + 'name' => $cat->name(), ); - if ($catDAO->searchByName ($newCat) == false) { - $catDAO->addCategory ($values); + if ($catDAO->searchByName($newCat) == null) { + $catDAO->addCategory($values); } } invalidateHttpCache(); - $notif = array ( - 'type' => 'good', - 'content' => Minz_Translate::t ('categories_updated') - ); - Minz_Session::_param ('notification', $notif); - - Minz_Request::forward (array ('c' => 'configure', 'a' => 'categorize'), true); + Minz_Request::good(_t('categories_updated'), + array('c' => 'configure', 'a' => 'categorize')); } - $this->view->categories = $catDAO->listCategories (false); - $this->view->defaultCategory = $catDAO->getDefault (); - $this->view->feeds = $feedDAO->listFeeds (); - $this->view->flux = false; + $this->view->categories = $catDAO->listCategories(false); + $this->view->defaultCategory = $catDAO->getDefault(); + $this->view->feeds = $feedDAO->listFeeds(); - Minz_View::prependTitle (Minz_Translate::t ('categories_management') . ' · '); + Minz_View::prependTitle(_t('categories_management') . ' · '); } - public function feedAction () { - $catDAO = new FreshRSS_CategoryDAO (); - $this->view->categories = $catDAO->listCategories (false); - - $feedDAO = new FreshRSS_FeedDAO (); - $this->view->feeds = $feedDAO->listFeeds (); - - $id = Minz_Request::param ('id'); - if ($id == false && !empty ($this->view->feeds)) { - $id = current ($this->view->feeds)->id (); + /** + * This action handles the feed configuration page. + * + * It displays the feed configuration page. + * If this action is reached through a POST request, it stores all new + * configuraiton values then sends a notification to the user. + * + * The options available on the page are: + * - name + * - description + * - website URL + * - feed URL + * - category id (default: default category id) + * - CSS path to article on website + * - display in main stream (default: 0) + * - HTTP authentication + * - number of article to retain (default: -2) + * - refresh frequency (default: -2) + * Default values are empty strings unless specified. + */ + public function feedAction() { + $catDAO = new FreshRSS_CategoryDAO(); + $this->view->categories = $catDAO->listCategories(false); + + $feedDAO = FreshRSS_Factory::createFeedDao(); + $this->view->feeds = $feedDAO->listFeeds(); + + $id = Minz_Request::param('id'); + if ($id == false && !empty($this->view->feeds)) { + $id = current($this->view->feeds)->id(); } $this->view->flux = false; @@ -84,14 +125,14 @@ class FreshRSS_configure_Controller extends Minz_ActionController { $this->view->flux = $this->view->feeds[$id]; if (!$this->view->flux) { - Minz_Error::error ( + Minz_Error::error( 404, - array ('error' => array (Minz_Translate::t ('page_not_found'))) + array('error' => array(_t('page_not_found'))) ); } else { - if (Minz_Request::isPost () && $this->view->flux) { - $user = Minz_Request::param ('http_user', ''); - $pass = Minz_Request::param ('http_pass', ''); + if (Minz_Request::isPost() && $this->view->flux) { + $user = Minz_Request::param('http_user', ''); + $pass = Minz_Request::param('http_pass', ''); $httpAuth = ''; if ($user != '' || $pass != '') { @@ -100,66 +141,74 @@ class FreshRSS_configure_Controller extends Minz_ActionController { $cat = intval(Minz_Request::param('category', 0)); - $values = array ( - 'name' => Minz_Request::param ('name', ''), + $values = array( + 'name' => Minz_Request::param('name', ''), 'description' => sanitizeHTML(Minz_Request::param('description', '', true)), 'website' => Minz_Request::param('website', ''), 'url' => Minz_Request::param('url', ''), 'category' => $cat, - 'pathEntries' => Minz_Request::param ('path_entries', ''), - 'priority' => intval(Minz_Request::param ('priority', 0)), + 'pathEntries' => Minz_Request::param('path_entries', ''), + 'priority' => intval(Minz_Request::param('priority', 0)), 'httpAuth' => $httpAuth, - 'keep_history' => intval(Minz_Request::param ('keep_history', -2)), + 'keep_history' => intval(Minz_Request::param('keep_history', -2)), + 'ttl' => intval(Minz_Request::param('ttl', -2)), ); - if ($feedDAO->updateFeed ($id, $values)) { - $this->view->flux->_category ($cat); + if ($feedDAO->updateFeed($id, $values)) { + $this->view->flux->_category($cat); $this->view->flux->faviconPrepare(); - $notif = array ( + $notif = array( 'type' => 'good', - 'content' => Minz_Translate::t ('feed_updated') + 'content' => _t('feed_updated') ); } else { - $notif = array ( + $notif = array( 'type' => 'bad', - 'content' => Minz_Translate::t ('error_occurred_update') + 'content' => _t('error_occurred_update') ); } invalidateHttpCache(); - Minz_Session::_param ('notification', $notif); - Minz_Request::forward (array ('c' => 'configure', 'a' => 'feed', 'params' => array ('id' => $id)), true); + Minz_Session::_param('notification', $notif); + Minz_Request::forward(array('c' => 'configure', 'a' => 'feed', 'params' => array('id' => $id)), true); } - Minz_View::prependTitle (Minz_Translate::t ('rss_feed_management') . ' — ' . $this->view->flux->name () . ' · '); + Minz_View::prependTitle(_t('rss_feed_management') . ' — ' . $this->view->flux->name() . ' · '); } } else { - Minz_View::prependTitle (Minz_Translate::t ('rss_feed_management') . ' · '); + Minz_View::prependTitle(_t('rss_feed_management') . ' · '); } } - public function displayAction () { + /** + * This action handles the display configuration page. + * + * It displays the display configuration page. + * If this action is reached through a POST request, it stores all new + * configuration values then sends a notification to the user. + * + * The options available on the page are: + * - language (default: en) + * - theme (default: Origin) + * - content width (default: thin) + * - display of read action in header + * - display of favorite action in header + * - display of date in header + * - display of open action in header + * - display of read action in footer + * - display of favorite action in footer + * - display of sharing action in footer + * - display of tags in footer + * - display of date in footer + * - display of open action in footer + * - html5 notification timeout (default: 0) + * Default values are false unless specified. + */ + public function displayAction() { if (Minz_Request::isPost()) { $this->view->conf->_language(Minz_Request::param('language', 'en')); - $this->view->conf->_posts_per_page(Minz_Request::param('posts_per_page', 10)); - $this->view->conf->_view_mode(Minz_Request::param('view_mode', 'normal')); - $this->view->conf->_default_view (Minz_Request::param('default_view', 'a')); - $this->view->conf->_auto_load_more(Minz_Request::param('auto_load_more', false)); - $this->view->conf->_display_posts(Minz_Request::param('display_posts', false)); - $this->view->conf->_onread_jump_next(Minz_Request::param('onread_jump_next', false)); - $this->view->conf->_lazyload (Minz_Request::param('lazyload', false)); - $this->view->conf->_sort_order(Minz_Request::param('sort_order', 'DESC')); - $this->view->conf->_mark_when (array( - 'article' => Minz_Request::param('mark_open_article', false), - 'site' => Minz_Request::param('mark_open_site', false), - 'scroll' => Minz_Request::param('mark_scroll', false), - 'reception' => Minz_Request::param('mark_upon_reception', false), - )); - $themeId = Minz_Request::param('theme', ''); - if ($themeId == '') { - $themeId = FreshRSS_Themes::defaultTheme; - } - $this->view->conf->_theme($themeId); + $this->view->conf->_theme(Minz_Request::param('theme', FreshRSS_Themes::$defaultTheme)); + $this->view->conf->_content_width(Minz_Request::param('content_width', 'thin')); $this->view->conf->_topline_read(Minz_Request::param('topline_read', false)); $this->view->conf->_topline_favorite(Minz_Request::param('topline_favorite', false)); $this->view->conf->_topline_date(Minz_Request::param('topline_date', false)); @@ -170,131 +219,127 @@ class FreshRSS_configure_Controller extends Minz_ActionController { $this->view->conf->_bottomline_tags(Minz_Request::param('bottomline_tags', false)); $this->view->conf->_bottomline_date(Minz_Request::param('bottomline_date', false)); $this->view->conf->_bottomline_link(Minz_Request::param('bottomline_link', false)); + $this->view->conf->_html5_notif_timeout(Minz_Request::param('html5_notif_timeout', 0)); $this->view->conf->save(); - Minz_Session::_param ('language', $this->view->conf->language); - Minz_Translate::reset (); + Minz_Session::_param('language', $this->view->conf->language); + Minz_Translate::reset(); invalidateHttpCache(); - $notif = array ( - 'type' => 'good', - 'content' => Minz_Translate::t ('configuration_updated') - ); - Minz_Session::_param ('notification', $notif); - - Minz_Request::forward (array ('c' => 'configure', 'a' => 'display'), true); + Minz_Request::good(_t('configuration_updated'), + array('c' => 'configure', 'a' => 'display')); } $this->view->themes = FreshRSS_Themes::get(); - Minz_View::prependTitle (Minz_Translate::t ('reading_configuration') . ' · '); + Minz_View::prependTitle(_t('display_configuration') . ' · '); } - 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), + /** + * This action handles the reading configuration page. + * + * It displays the reading configuration page. + * If this action is reached through a POST request, it stores all new + * configuration values then sends a notification to the user. + * + * The options available on the page are: + * - number of posts per page (default: 10) + * - view mode (default: normal) + * - default article view (default: all) + * - load automatically articles + * - display expanded articles + * - display expanded categories + * - hide categories and feeds without unread articles + * - jump on next category or feed when marked as read + * - image lazy loading + * - stick open articles to the top + * - display a confirmation when reading all articles + * - article order (default: DESC) + * - mark articles as read when: + * - displayed + * - opened on site + * - scrolled + * - received + * Default values are false unless specified. + */ + public function readingAction() { + if (Minz_Request::isPost()) { + $this->view->conf->_posts_per_page(Minz_Request::param('posts_per_page', 10)); + $this->view->conf->_view_mode(Minz_Request::param('view_mode', 'normal')); + $this->view->conf->_default_view((int)Minz_Request::param('default_view', FreshRSS_Entry::STATE_ALL)); + $this->view->conf->_auto_load_more(Minz_Request::param('auto_load_more', false)); + $this->view->conf->_display_posts(Minz_Request::param('display_posts', false)); + $this->view->conf->_display_categories(Minz_Request::param('display_categories', false)); + $this->view->conf->_hide_read_feeds(Minz_Request::param('hide_read_feeds', false)); + $this->view->conf->_onread_jump_next(Minz_Request::param('onread_jump_next', false)); + $this->view->conf->_lazyload(Minz_Request::param('lazyload', false)); + $this->view->conf->_sticky_post(Minz_Request::param('sticky_post', false)); + $this->view->conf->_reading_confirm(Minz_Request::param('reading_confirm', false)); + $this->view->conf->_sort_order(Minz_Request::param('sort_order', 'DESC')); + $this->view->conf->_mark_when(array( + 'article' => Minz_Request::param('mark_open_article', false), + 'site' => Minz_Request::param('mark_open_site', false), + 'scroll' => Minz_Request::param('mark_scroll', false), + 'reception' => Minz_Request::param('mark_upon_reception', false), )); $this->view->conf->save(); - invalidateHttpCache(); - $notif = array ( - 'type' => 'good', - 'content' => Minz_Translate::t ('configuration_updated') - ); - Minz_Session::_param ('notification', $notif); + Minz_Session::_param('language', $this->view->conf->language); + Minz_Translate::reset(); + invalidateHttpCache(); - Minz_Request::forward (array ('c' => 'configure', 'a' => 'sharing'), true); + Minz_Request::good(_t('configuration_updated'), + array('c' => 'configure', 'a' => 'reading')); } - Minz_View::prependTitle (Minz_Translate::t ('sharing') . ' · '); + Minz_View::prependTitle(_t('reading_configuration') . ' · '); } - public function importExportAction () { - require_once(LIB_PATH . '/lib_opml.php'); - $catDAO = new FreshRSS_CategoryDAO (); - $this->view->categories = $catDAO->listCategories (); - - $this->view->req = Minz_Request::param ('q'); - - if ($this->view->req == 'export') { - Minz_View::_title ('freshrss_feeds.opml'); - - $this->view->_useLayout (false); - header('Content-Type: application/xml; charset=utf-8'); - header('Content-disposition: attachment; filename=freshrss_feeds.opml'); - - $feedDAO = new FreshRSS_FeedDAO (); - $catDAO = new FreshRSS_CategoryDAO (); - - $list = array (); - foreach ($catDAO->listCategories () as $key => $cat) { - $list[$key]['name'] = $cat->name (); - $list[$key]['feeds'] = $feedDAO->listByCategory ($cat->id ()); - } - - $this->view->categories = $list; - } elseif ($this->view->req == 'import' && Minz_Request::isPost ()) { - if ($_FILES['file']['error'] == 0) { - invalidateHttpCache(); - // on parse le fichier OPML pour récupérer les catégories et les flux associés - try { - list ($categories, $feeds) = opml_import ( - file_get_contents ($_FILES['file']['tmp_name']) - ); - - // On redirige vers le controller feed qui va se charger d'insérer les flux en BDD - // les flux sont mis au préalable dans des variables de Request - Minz_Request::_param ('q', 'null'); - Minz_Request::_param ('categories', $categories); - Minz_Request::_param ('feeds', $feeds); - Minz_Request::forward (array ('c' => 'feed', 'a' => 'massiveImport')); - } catch (FreshRSS_Opml_Exception $e) { - Minz_Log::record ($e->getMessage (), Minz_Log::WARNING); - - $notif = array ( - 'type' => 'bad', - 'content' => Minz_Translate::t ('bad_opml_file') - ); - Minz_Session::_param ('notification', $notif); + /** + * This action handles the sharing configuration page. + * + * It displays the sharing configuration page. + * If this action is reached through a POST request, it stores all + * configuration values then sends a notification to the user. + */ + public function sharingAction() { + if (Minz_Request::isPost()) { + $params = Minz_Request::params(); + $this->view->conf->_sharing($params['share']); + $this->view->conf->save(); + invalidateHttpCache(); - Minz_Request::forward (array ( - 'c' => 'configure', - 'a' => 'importExport' - ), true); - } - } + Minz_Request::good(_t('configuration_updated'), + array('c' => 'configure', 'a' => 'sharing')); } - $feedDAO = new FreshRSS_FeedDAO (); - $this->view->feeds = $feedDAO->listFeeds (); - - // au niveau de la vue, permet de ne pas voir un flux sélectionné dans la liste - $this->view->flux = false; - - Minz_View::prependTitle (Minz_Translate::t ('import_export_opml') . ' · '); + Minz_View::prependTitle(_t('sharing') . ' · '); } - public function shortcutAction () { - $list_keys = array ('a', 'b', 'backspace', 'c', 'd', 'delete', 'down', 'e', 'end', 'enter', + /** + * This action handles the shortcut configuration page. + * + * It displays the shortcut configuration page. + * If this action is reached through a POST request, it stores all new + * configuration values then sends a notification to the user. + * + * The authorized values for shortcuts are letters (a to z), numbers (0 + * to 9), function keys (f1 to f12), backspace, delete, down, end, enter, + * escape, home, insert, left, page down, page up, return, right, space, + * tab and up. + */ + public function shortcutAction() { + $list_keys = array('a', 'b', 'backspace', 'c', 'd', 'delete', 'down', 'e', 'end', 'enter', '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', - '9', 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', + 'z', 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10', 'f11', 'f12'); $this->view->list_keys = $list_keys; - if (Minz_Request::isPost ()) { - $shortcuts = Minz_Request::param ('shortcuts'); - $shortcuts_ok = array (); + if (Minz_Request::isPost()) { + $shortcuts = Minz_Request::param('shortcuts'); + $shortcuts_ok = array(); foreach ($shortcuts as $key => $value) { if (in_array($value, $list_keys)) { @@ -302,48 +347,56 @@ class FreshRSS_configure_Controller extends Minz_ActionController { } } - $this->view->conf->_shortcuts ($shortcuts_ok); + $this->view->conf->_shortcuts($shortcuts_ok); $this->view->conf->save(); invalidateHttpCache(); - $notif = array ( - 'type' => 'good', - 'content' => Minz_Translate::t ('shortcuts_updated') - ); - Minz_Session::_param ('notification', $notif); - - Minz_Request::forward (array ('c' => 'configure', 'a' => 'shortcut'), true); + Minz_Request::good(_t('shortcuts_updated'), + array('c' => 'configure', 'a' => 'shortcut')); } - Minz_View::prependTitle (Minz_Translate::t ('shortcuts') . ' · '); + Minz_View::prependTitle(_t('shortcuts') . ' · '); } + /** + * This action display the user configuration page + * + * @todo move that action in the user controller + */ public function usersAction() { - Minz_View::prependTitle(Minz_Translate::t ('users') . ' · '); + Minz_View::prependTitle(_t('users') . ' · '); } - public function archivingAction () { + /** + * This action handles the archive configuration page. + * + * It displays the archive configuration page. + * If this action is reached through a POST request, it stores all new + * configuration values then sends a notification to the user. + * + * The options available on that page are: + * - duration to retain old article (default: 3) + * - number of article to retain per feed (default: 0) + * - refresh frequency (default: -2) + * + * @todo explain why the default value is -2 but this value does not + * exist in the drop-down list + */ + public function archivingAction() { if (Minz_Request::isPost()) { - $old = Minz_Request::param('old_entries', 3); - $keepHistoryDefault = Minz_Request::param('keep_history_default', 0); - - $this->view->conf->_old_entries($old); - $this->view->conf->_keep_history_default($keepHistoryDefault); + $this->view->conf->_old_entries(Minz_Request::param('old_entries', 3)); + $this->view->conf->_keep_history_default(Minz_Request::param('keep_history_default', 0)); + $this->view->conf->_ttl_default(Minz_Request::param('ttl_default', -2)); $this->view->conf->save(); invalidateHttpCache(); - $notif = array( - 'type' => 'good', - 'content' => Minz_Translate::t('configuration_updated') - ); - Minz_Session::_param('notification', $notif); - - Minz_Request::forward(array('c' => 'configure', 'a' => 'archiving'), true); + Minz_Request::good(_t('configuration_updated'), + array('c' => 'configure', 'a' => 'archiving')); } - Minz_View::prependTitle(Minz_Translate::t('archiving_configuration') . ' · '); + Minz_View::prependTitle(_t('archiving_configuration') . ' · '); - $entryDAO = new FreshRSS_EntryDAO(); + $entryDAO = FreshRSS_Factory::createEntryDao(); $this->view->nb_total = $entryDAO->count(); $this->view->size_user = $entryDAO->size(); @@ -351,4 +404,119 @@ class FreshRSS_configure_Controller extends Minz_ActionController { $this->view->size_total = $entryDAO->size(true); } } + + /** + * This action handles the user queries configuration page. + * + * If this action is reached through a POST request, it stores all new + * configuration values then sends a notification to the user then + * redirect to the same page. + * If this action is not reached through a POST request, it displays the + * configuration page and verifies that every user query is runable by + * checking if categories and feeds are still in use. + */ + public function queriesAction() { + if (Minz_Request::isPost()) { + $queries = Minz_Request::param('queries', array()); + + foreach ($queries as $key => $query) { + if (!$query['name']) { + $query['name'] = _t('query_number', $key + 1); + } + } + $this->view->conf->_queries($queries); + $this->view->conf->save(); + + Minz_Request::good(_t('configuration_updated'), + array('c' => 'configure', 'a' => 'queries')); + } else { + $this->view->query_get = array(); + $cat_dao = new FreshRSS_CategoryDAO(); + $feed_dao = FreshRSS_Factory::createFeedDao(); + foreach ($this->view->conf->queries as $key => $query) { + if (!isset($query['get'])) { + continue; + } + + switch ($query['get'][0]) { + case 'c': + $category = $cat_dao->searchById(substr($query['get'], 2)); + + $deprecated = true; + $cat_name = ''; + if ($category) { + $cat_name = $category->name(); + $deprecated = false; + } + + $this->view->query_get[$key] = array( + 'type' => 'category', + 'name' => $cat_name, + 'deprecated' => $deprecated, + ); + break; + case 'f': + $feed = $feed_dao->searchById(substr($query['get'], 2)); + + $deprecated = true; + $feed_name = ''; + if ($feed) { + $feed_name = $feed->name(); + $deprecated = false; + } + + $this->view->query_get[$key] = array( + 'type' => 'feed', + 'name' => $feed_name, + 'deprecated' => $deprecated, + ); + break; + case 's': + $this->view->query_get[$key] = array( + 'type' => 'favorite', + 'name' => 'favorite', + 'deprecated' => false, + ); + break; + case 'a': + $this->view->query_get[$key] = array( + 'type' => 'all', + 'name' => 'all', + 'deprecated' => false, + ); + break; + } + } + } + + Minz_View::prependTitle(_t('queries') . ' · '); + } + + /** + * This action handles the creation of a user query. + * + * It gets the GET parameters and stores them in the configuration query + * storage. Before it is saved, the unwanted parameters are unset to keep + * lean data. + */ + public function addQueryAction() { + $whitelist = array('get', 'order', 'name', 'search', 'state'); + $queries = $this->view->conf->queries; + $query = Minz_Request::params(); + $query['name'] = _t('query_number', count($queries) + 1); + foreach ($query as $key => $value) { + if (!in_array($key, $whitelist)) { + unset($query[$key]); + } + } + if (!empty($query['state']) && $query['state'] & FreshRSS_Entry::STATE_STRICT) { + $query['state'] -= FreshRSS_Entry::STATE_STRICT; + } + $queries[] = $query; + $this->view->conf->_queries($queries); + $this->view->conf->save(); + + Minz_Request::good(_t('query_created', $query['name']), + array('c' => 'configure', 'a' => 'queries')); + } } diff --git a/app/Controllers/entryController.php b/app/Controllers/entryController.php index 1756c91e5..ab66d9198 100755 --- a/app/Controllers/entryController.php +++ b/app/Controllers/entryController.php @@ -43,8 +43,12 @@ class FreshRSS_entry_Controller extends Minz_ActionController { $nextGet = Minz_Request::param ('nextGet', $get); $idMax = Minz_Request::param ('idMax', 0); - $entryDAO = new FreshRSS_EntryDAO (); + $entryDAO = FreshRSS_Factory::createEntryDao(); if ($id == false) { + if (!Minz_Request::isPost()) { + return; + } + if (!$get) { $entryDAO->markReadEntries ($idMax); } else { @@ -85,7 +89,7 @@ class FreshRSS_entry_Controller extends Minz_ActionController { $id = Minz_Request::param ('id'); if ($id) { - $entryDAO = new FreshRSS_EntryDAO (); + $entryDAO = FreshRSS_Factory::createEntryDao(); $entryDAO->markFavorite ($id, (bool)(Minz_Request::param ('is_favorite', true))); } } @@ -97,9 +101,12 @@ class FreshRSS_entry_Controller extends Minz_ActionController { // La table des entrées a tendance à grossir énormément // Cette action permet d'optimiser cette table permettant de grapiller un peu de place // Cette fonctionnalité n'est à appeler qu'occasionnellement - $entryDAO = new FreshRSS_EntryDAO(); + $entryDAO = FreshRSS_Factory::createEntryDao(); $entryDAO->optimizeTable(); + $feedDAO = FreshRSS_Factory::createFeedDao(); + $feedDAO->updateCachedValues(); + invalidateHttpCache(); $notif = array ( @@ -121,8 +128,8 @@ class FreshRSS_entry_Controller extends Minz_ActionController { $nb_month_old = max($this->view->conf->old_entries, 1); $date_min = time() - (3600 * 24 * 30 * $nb_month_old); - $feedDAO = new FreshRSS_FeedDAO(); - $feeds = $feedDAO->listFeedsOrderUpdate(); + $feedDAO = FreshRSS_Factory::createFeedDao(); + $feeds = $feedDAO->listFeeds(); $nbTotal = 0; invalidateHttpCache(); @@ -137,11 +144,13 @@ class FreshRSS_entry_Controller extends Minz_ActionController { if ($nb > 0) { $nbTotal += $nb; Minz_Log::record($nb . ' old entries cleaned in feed [' . $feed->url() . ']', Minz_Log::DEBUG); - $feedDAO->updateLastUpdate($feed->id()); + //$feedDAO->updateLastUpdate($feed->id()); } } } + $feedDAO->updateCachedValues(); + invalidateHttpCache(); $notif = array( diff --git a/app/Controllers/errorController.php b/app/Controllers/errorController.php index dc9a2ee25..922650b3d 100644 --- a/app/Controllers/errorController.php +++ b/app/Controllers/errorController.php @@ -1,26 +1,38 @@ <?php class FreshRSS_error_Controller extends Minz_ActionController { - public function indexAction () { - switch (Minz_Request::param ('code')) { - case 403: - $this->view->code = 'Error 403 - Forbidden'; - break; - case 404: - $this->view->code = 'Error 404 - Not found'; - break; - case 500: - $this->view->code = 'Error 500 - Internal Server Error'; - break; - case 503: - $this->view->code = 'Error 503 - Service Unavailable'; - break; - default: - $this->view->code = 'Error 404 - Not found'; + public function indexAction() { + switch (Minz_Request::param('code')) { + case 403: + $this->view->code = 'Error 403 - Forbidden'; + break; + case 404: + $this->view->code = 'Error 404 - Not found'; + break; + case 500: + $this->view->code = 'Error 500 - Internal Server Error'; + break; + case 503: + $this->view->code = 'Error 503 - Service Unavailable'; + break; + default: + $this->view->code = 'Error 404 - Not found'; } - - $this->view->logs = Minz_Request::param ('logs'); - - Minz_View::prependTitle ($this->view->code . ' · '); + + $errors = Minz_Request::param('logs', array()); + $this->view->errorMessage = trim(implode($errors)); + if ($this->view->errorMessage == '') { + switch(Minz_Request::param('code')) { + case 403: + $this->view->errorMessage = Minz_Translate::t('forbidden_access'); + break; + case 404: + default: + $this->view->errorMessage = Minz_Translate::t('page_not_found'); + break; + } + } + + Minz_View::prependTitle($this->view->code . ' · '); } } diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index c718fcd5c..c7cc25fbb 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -22,14 +22,32 @@ class FreshRSS_feed_Controller extends Minz_ActionController { } public function addAction () { - @set_time_limit(300); + $url = Minz_Request::param('url_rss', false); + + if ($url === false) { + Minz_Request::forward(array( + 'c' => 'configure', + 'a' => 'feed' + ), true); + } + + $feedDAO = FreshRSS_Factory::createFeedDao(); + $this->catDAO = new FreshRSS_CategoryDAO (); + $this->catDAO->checkDefault (); + + if (Minz_Request::isPost()) { + @set_time_limit(300); - if (Minz_Request::isPost ()) { - $this->catDAO = new FreshRSS_CategoryDAO (); - $this->catDAO->checkDefault (); - $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 (); @@ -52,7 +70,6 @@ class FreshRSS_feed_Controller extends Minz_ActionController { $feed->load(true); - $feedDAO = new FreshRSS_FeedDAO (); $values = array ( 'url' => $feed->url (), 'category' => $feed->category (), @@ -85,25 +102,30 @@ class FreshRSS_feed_Controller extends Minz_ActionController { $is_read = $this->view->conf->mark_when['reception'] ? 1 : 0; - $entryDAO = new FreshRSS_EntryDAO (); + $entryDAO = FreshRSS_Factory::createEntryDao(); $entries = array_reverse($feed->entries()); //We want chronological order and SimplePie uses reverse order // on calcule la date des articles les plus anciens qu'on accepte $nb_month_old = $this->view->conf->old_entries; $date_min = time () - (3600 * 24 * 30 * $nb_month_old); + //MySQL: http://docs.oracle.com/cd/E17952_01/refman-5.5-en/optimizing-innodb-transaction-management.html + //SQLite: http://stackoverflow.com/questions/1711631/how-do-i-improve-the-performance-of-sqlite + $preparedStatement = $entryDAO->addEntryPrepare(); $transactionStarted = true; - $feedDAO->beginTransaction (); + $feedDAO->beginTransaction(); // on ajoute les articles en masse sans vérification foreach ($entries as $entry) { - $values = $entry->toArray (); - $values['id_feed'] = $feed->id (); - $values['id'] = min(time(), $entry->date (true)) . uSecString(); + $values = $entry->toArray(); + $values['id_feed'] = $feed->id(); + $values['id'] = min(time(), $entry->date(true)) . uSecString(); $values['is_read'] = $is_read; - $entryDAO->addEntry ($values); + $entryDAO->addEntry($values, $preparedStatement); + } + $feedDAO->updateLastUpdate($feed->id()); + if ($transactionStarted) { + $feedDAO->commit(); } - $feedDAO->updateLastUpdate ($feed->id ()); - $feedDAO->commit (); $transactionStarted = false; // ok, ajout terminé @@ -128,7 +150,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) { @@ -136,7 +158,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); } @@ -145,13 +167,46 @@ class FreshRSS_feed_Controller extends Minz_ActionController { } Minz_Request::forward (array ('c' => 'configure', 'a' => 'feed', 'params' => $params), true); + } else { + + // GET request so we must ask confirmation to user + Minz_View::prependTitle(Minz_Translate::t('add_rss_feed') . ' · '); + $this->view->categories = $this->catDAO->listCategories(); + $this->view->feed = new FreshRSS_Feed($url); + try { + // We try to get some more information about the feed + $this->view->feed->load(true); + $this->view->load_ok = true; + } catch (Exception $e) { + $this->view->load_ok = false; + } + + $feed = $feedDAO->searchByUrl($this->view->feed->url()); + if ($feed) { + // Already subscribe so we redirect to the feed configuration page + $notif = array( + 'type' => 'bad', + 'content' => Minz_Translate::t( + 'already_subscribed', $feed->name() + ) + ); + Minz_Session::_param('notification', $notif); + + Minz_Request::forward(array( + 'c' => 'configure', + 'a' => 'feed', + 'params' => array( + 'id' => $feed->id() + ) + ), true); + } } } public function truncateAction () { if (Minz_Request::isPost ()) { $id = Minz_Request::param ('id'); - $feedDAO = new FreshRSS_FeedDAO (); + $feedDAO = FreshRSS_Factory::createFeedDao(); $n = $feedDAO->truncate($id); $notif = array( 'type' => $n === false ? 'bad' : 'good', @@ -166,8 +221,8 @@ class FreshRSS_feed_Controller extends Minz_ActionController { public function actualizeAction () { @set_time_limit(300); - $feedDAO = new FreshRSS_FeedDAO (); - $entryDAO = new FreshRSS_EntryDAO (); + $feedDAO = FreshRSS_Factory::createFeedDao(); + $entryDAO = FreshRSS_Factory::createEntryDao(); Minz_Session::_param('actualize_feeds', false); $id = Minz_Request::param ('id'); @@ -183,7 +238,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController { $feeds = array ($feed); } } else { - $feeds = $feedDAO->listFeedsOrderUpdate (); + $feeds = $feedDAO->listFeedsOrderUpdate($this->view->conf->ttl_default); } // on calcule la date des articles les plus anciens qu'on accepte @@ -215,22 +270,23 @@ class FreshRSS_feed_Controller extends Minz_ActionController { $feedHistory = $this->view->conf->keep_history_default; } + $preparedStatement = $entryDAO->addEntryPrepare(); $hasTransaction = true; $feedDAO->beginTransaction(); // On ne vérifie pas strictement que l'article n'est pas déjà en BDD // La BDD refusera l'ajout car (id_feed, guid) doit être unique foreach ($entries as $entry) { - $eDate = $entry->date (true); - if ((!isset ($existingGuids[$entry->guid ()])) && + $eDate = $entry->date(true); + if ((!isset($existingGuids[$entry->guid()])) && (($feedHistory != 0) || ($eDate >= $date_min))) { - $values = $entry->toArray (); + $values = $entry->toArray(); //Use declared date at first import, otherwise use discovery date $values['id'] = ($useDeclaredDate || $eDate < $date_min) ? min(time(), $eDate) . uSecString() : uTimeString(); $values['is_read'] = $is_read; - $entryDAO->addEntry ($values); + $entryDAO->addEntry($values, $preparedStatement); } } } @@ -251,7 +307,8 @@ class FreshRSS_feed_Controller extends Minz_ActionController { $feedDAO->commit(); } $flux_update++; - if ($feed->url() !== $url) { //URL has changed (auto-discovery) + if (($feed->url() !== $url)) { //HTTP 301 Moved Permanently + Minz_Log::record('Feed ' . $url . ' moved permanently to ' . $feed->url(), Minz_Log::NOTICE); $feedDAO->updateFeed($feed->id(), array('url' => $feed->url())); } } catch (FreshRSS_Feed_Exception $e) { @@ -319,88 +376,23 @@ class FreshRSS_feed_Controller extends Minz_ActionController { } } - public function massiveImportAction () { - @set_time_limit(300); - - $this->catDAO = new FreshRSS_CategoryDAO (); - $this->catDAO->checkDefault (); - - $entryDAO = new FreshRSS_EntryDAO (); - $feedDAO = new FreshRSS_FeedDAO (); - - $categories = Minz_Request::param ('categories', array (), true); - $feeds = Minz_Request::param ('feeds', array (), true); - - // on ajoute les catégories en masse dans une fonction à part - $this->addCategories ($categories); - - // on calcule la date des articles les plus anciens qu'on accepte - $nb_month_old = $this->view->conf->old_entries; - $date_min = time () - (3600 * 24 * 30 * $nb_month_old); - - // la variable $error permet de savoir si une erreur est survenue - // Le but est de ne pas arrêter l'import même en cas d'erreur - // L'utilisateur sera mis au courant s'il y a eu des erreurs, mais - // ne connaîtra pas les détails. Ceux-ci seront toutefois logguées - $error = false; - $i = 0; - foreach ($feeds as $feed) { - try { - $values = array ( - 'id' => $feed->id (), - 'url' => $feed->url (), - 'category' => $feed->category (), - 'name' => $feed->name (), - 'website' => $feed->website (), - 'description' => $feed->description (), - 'lastUpdate' => 0, - 'httpAuth' => $feed->httpAuth () - ); - - // ajout du flux que s'il n'est pas déjà en BDD - if (!$feedDAO->searchByUrl ($values['url'])) { - $id = $feedDAO->addFeed ($values); - if ($id) { - $feed->_id ($id); - $feed->faviconPrepare(); - } else { - $error = true; - } - } - } catch (FreshRSS_Feed_Exception $e) { - $error = true; - Minz_Log::record ($e->getMessage (), Minz_Log::WARNING); - } - } - - if ($error) { - $res = Minz_Translate::t ('feeds_imported_with_errors'); - } else { - $res = Minz_Translate::t ('feeds_imported'); - } - - $notif = array ( - 'type' => 'good', - 'content' => $res - ); - Minz_Session::_param ('notification', $notif); - Minz_Session::_param ('actualize_feeds', true); - - // et on redirige vers la page d'accueil - Minz_Request::forward (array ( - 'c' => 'index', - 'a' => 'index' - ), true); - } - public function deleteAction () { if (Minz_Request::isPost ()) { $type = Minz_Request::param ('type', 'feed'); $id = Minz_Request::param ('id'); - $feedDAO = new FreshRSS_FeedDAO (); + $feedDAO = FreshRSS_Factory::createFeedDao(); if ($type == 'category') { + // List feeds to remove then related user queries. + $feeds = $feedDAO->listByCategory($id); + if ($feedDAO->deleteFeedByCategory ($id)) { + // Remove related queries + foreach ($feeds as $feed) { + $this->view->conf->remove_query_by_get('f_' . $feed->id()); + } + $this->view->conf->save(); + $notif = array ( 'type' => 'good', 'content' => Minz_Translate::t ('category_emptied') @@ -414,6 +406,10 @@ class FreshRSS_feed_Controller extends Minz_ActionController { } } else { if ($feedDAO->deleteFeed ($id)) { + // Remove related queries + $this->view->conf->remove_query_by_get('f_' . $id); + $this->view->conf->save(); + $notif = array ( 'type' => 'good', 'content' => Minz_Translate::t ('feed_deleted') @@ -429,22 +425,13 @@ class FreshRSS_feed_Controller extends Minz_ActionController { Minz_Session::_param ('notification', $notif); - if ($type == 'category') { - Minz_Request::forward (array ('c' => 'configure', 'a' => 'categorize'), true); + $redirect_url = Minz_Request::param('r', false, true); + if ($redirect_url) { + Minz_Request::forward($redirect_url); + } elseif ($type == 'category') { + Minz_Request::forward(array ('c' => 'configure', 'a' => 'categorize'), true); } else { - Minz_Request::forward (array ('c' => 'configure', 'a' => 'feed'), true); - } - } - } - - private function addCategories ($categories) { - foreach ($categories as $cat) { - if (!$this->catDAO->searchByName ($cat->name ())) { - $values = array ( - 'id' => $cat->id (), - 'name' => $cat->name (), - ); - $catDAO->addCategory ($values); + Minz_Request::forward(array ('c' => 'configure', 'a' => 'feed'), true); } } } diff --git a/app/Controllers/importExportController.php b/app/Controllers/importExportController.php new file mode 100644 index 000000000..f329766b8 --- /dev/null +++ b/app/Controllers/importExportController.php @@ -0,0 +1,447 @@ +<?php + +class FreshRSS_importExport_Controller extends Minz_ActionController { + public function firstAction() { + if (!$this->view->loginOk) { + Minz_Error::error( + 403, + array('error' => array(_t('access_denied'))) + ); + } + + require_once(LIB_PATH . '/lib_opml.php'); + + $this->catDAO = new FreshRSS_CategoryDAO(); + $this->entryDAO = FreshRSS_Factory::createEntryDao(); + $this->feedDAO = FreshRSS_Factory::createFeedDao(); + } + + public function indexAction() { + $this->view->categories = $this->catDAO->listCategories(); + $this->view->feeds = $this->feedDAO->listFeeds(); + + Minz_View::prependTitle(_t('import_export') . ' · '); + } + + public function importAction() { + if (!Minz_Request::isPost()) { + Minz_Request::forward(array('c' => 'importExport', 'a' => 'index'), true); + } + + $file = $_FILES['file']; + $status_file = $file['error']; + + if ($status_file !== 0) { + Minz_Log::error('File cannot be uploaded. Error code: ' . $status_file); + Minz_Request::bad(_t('file_cannot_be_uploaded'), + array('c' => 'importExport', 'a' => 'index')); + } + + @set_time_limit(300); + + $type_file = $this->guessFileType($file['name']); + + $list_files = array( + 'opml' => array(), + 'json_starred' => array(), + 'json_feed' => array() + ); + + // We try to list all files according to their type + $list = array(); + if ($type_file === 'zip' && extension_loaded('zip')) { + $zip = zip_open($file['tmp_name']); + + if (!is_resource($zip)) { + // zip_open cannot open file: something is wrong + Minz_Log::error('Zip archive cannot be imported. Error code: ' . $zip); + Minz_Request::bad(_t('zip_error'), + array('c' => 'importExport', 'a' => 'index')); + } + + while (($zipfile = zip_read($zip)) !== false) { + if (!is_resource($zipfile)) { + // zip_entry() can also return an error code! + Minz_Log::error('Zip file cannot be imported. Error code: ' . $zipfile); + } else { + $type_zipfile = $this->guessFileType(zip_entry_name($zipfile)); + if ($type_file !== 'unknown') { + $list_files[$type_zipfile][] = zip_entry_read( + $zipfile, + zip_entry_filesize($zipfile) + ); + } + } + } + + zip_close($zip); + } elseif ($type_file === 'zip') { + // Zip extension is not loaded + Minz_Request::bad(_t('no_zip_extension'), + array('c' => 'importExport', 'a' => 'index')); + } elseif ($type_file !== 'unknown') { + $list_files[$type_file][] = file_get_contents($file['tmp_name']); + } + + // Import file contents. + // OPML first(so categories and feeds are imported) + // Starred articles then so the "favourite" status is already set + // And finally all other files. + $error = false; + foreach ($list_files['opml'] as $opml_file) { + $error = $this->importOpml($opml_file); + } + foreach ($list_files['json_starred'] as $article_file) { + $error = $this->importArticles($article_file, true); + } + foreach ($list_files['json_feed'] as $article_file) { + $error = $this->importArticles($article_file); + } + + // And finally, we get import status and redirect to the home page + Minz_Session::_param('actualize_feeds', true); + $content_notif = $error === true ? _t('feeds_imported_with_errors') : + _t('feeds_imported'); + Minz_Request::good($content_notif); + } + + private function guessFileType($filename) { + // A *very* basic guess file type function. Only based on filename + // That's could be improved but should be enough, at least for a first + // implementation. + + if (substr_compare($filename, '.zip', -4) === 0) { + return 'zip'; + } elseif (substr_compare($filename, '.opml', -5) === 0 || + substr_compare($filename, '.xml', -4) === 0) { + return 'opml'; + } elseif (substr_compare($filename, '.json', -5) === 0 && + strpos($filename, 'starred') !== false) { + return 'json_starred'; + } elseif (substr_compare($filename, '.json', -5) === 0) { + return 'json_feed'; + } else { + return 'unknown'; + } + } + + private function importOpml($opml_file) { + $opml_array = array(); + try { + $opml_array = libopml_parse_string($opml_file); + } catch (LibOPML_Exception $e) { + Minz_Log::warning($e->getMessage()); + return true; + } + + $this->catDAO->checkDefault(); + + return $this->addOpmlElements($opml_array['body']); + } + + private function addOpmlElements($opml_elements, $parent_cat = null) { + $error = false; + foreach ($opml_elements as $elt) { + $res = false; + if (isset($elt['xmlUrl'])) { + $res = $this->addFeedOpml($elt, $parent_cat); + } else { + $res = $this->addCategoryOpml($elt, $parent_cat); + } + + if (!$error && $res) { + // oops: there is at least one error! + $error = $res; + } + } + + return $error; + } + + private function addFeedOpml($feed_elt, $parent_cat) { + if (is_null($parent_cat)) { + // This feed has no parent category so we get the default one + $parent_cat = $this->catDAO->getDefault()->name(); + } + + $cat = $this->catDAO->searchByName($parent_cat); + + if (!$cat) { + return true; + } + + // We get different useful information + $url = Minz_Helper::htmlspecialchars_utf8($feed_elt['xmlUrl']); + $name = Minz_Helper::htmlspecialchars_utf8($feed_elt['text']); + $website = ''; + if (isset($feed_elt['htmlUrl'])) { + $website = Minz_Helper::htmlspecialchars_utf8($feed_elt['htmlUrl']); + } + $description = ''; + if (isset($feed_elt['description'])) { + $description = Minz_Helper::htmlspecialchars_utf8($feed_elt['description']); + } + + $error = false; + try { + // Create a Feed object and add it in DB + $feed = new FreshRSS_Feed($url); + $feed->_category($cat->id()); + $feed->_name($name); + $feed->_website($website); + $feed->_description($description); + + // addFeedObject checks if feed is already in DB so nothing else to + // check here + $id = $this->feedDAO->addFeedObject($feed); + $error = ($id === false); + } catch (FreshRSS_Feed_Exception $e) { + Minz_Log::warning($e->getMessage()); + $error = true; + } + + return $error; + } + + private function addCategoryOpml($cat_elt, $parent_cat) { + // Create a new Category object + $cat = new FreshRSS_Category(Minz_Helper::htmlspecialchars_utf8($cat_elt['text'])); + + $id = $this->catDAO->addCategoryObject($cat); + $error = ($id === false); + + if (isset($cat_elt['@outlines'])) { + // Our cat_elt contains more categories or more feeds, so we + // add them recursively. + // Note: FreshRSS does not support yet category arborescence + $res = $this->addOpmlElements($cat_elt['@outlines'], $cat->name()); + if (!$error && $res) { + $error = true; + } + } + + return $error; + } + + private function importArticles($article_file, $starred = false) { + $article_object = json_decode($article_file, true); + if (is_null($article_object)) { + Minz_Log::warning('Try to import a non-JSON file'); + return true; + } + + $is_read = $this->view->conf->mark_when['reception'] ? 1 : 0; + + $google_compliant = ( + strpos($article_object['id'], 'com.google') !== false + ); + + $error = false; + $article_to_feed = array(); + + // First, we check feeds of articles are in DB (and add them if needed). + foreach ($article_object['items'] as $item) { + $feed = $this->addFeedArticles($item['origin'], $google_compliant); + if (is_null($feed)) { + $error = true; + } else { + $article_to_feed[$item['id']] = $feed->id(); + } + } + + // Then, articles are imported. + $prepared_statement = $this->entryDAO->addEntryPrepare(); + $this->entryDAO->beginTransaction(); + foreach ($article_object['items'] as $item) { + if (!isset($article_to_feed[$item['id']])) { + continue; + } + + $feed_id = $article_to_feed[$item['id']]; + $author = isset($item['author']) ? $item['author'] : ''; + $key_content = ($google_compliant && !isset($item['content'])) ? + 'summary' : 'content'; + $tags = $item['categories']; + if ($google_compliant) { + $tags = array_filter($tags, function($var) { + return strpos($var, '/state/com.google') === false; + }); + } + + $entry = new FreshRSS_Entry( + $feed_id, $item['id'], $item['title'], $author, + $item[$key_content]['content'], $item['alternate'][0]['href'], + $item['published'], $is_read, $starred + ); + $entry->_id(min(time(), $entry->date(true)) . uSecString()); + $entry->_tags($tags); + + $values = $entry->toArray(); + $id = $this->entryDAO->addEntry($values, $prepared_statement); + + if (!$error && ($id === false)) { + $error = true; + } + } + $this->entryDAO->commit(); + + return $error; + } + + private function addFeedArticles($origin, $google_compliant) { + $default_cat = $this->catDAO->getDefault(); + + $return = null; + $key = $google_compliant ? 'htmlUrl' : 'feedUrl'; + $url = $origin[$key]; + $name = $origin['title']; + $website = $origin['htmlUrl']; + + try { + // Create a Feed object and add it in DB + $feed = new FreshRSS_Feed($url); + $feed->_category($default_cat->id()); + $feed->_name($name); + $feed->_website($website); + + // addFeedObject checks if feed is already in DB so nothing else to + // check here + $id = $this->feedDAO->addFeedObject($feed); + + if ($id !== false) { + $feed->_id($id); + $return = $feed; + } + } catch (FreshRSS_Feed_Exception $e) { + Minz_Log::warning($e->getMessage()); + } + + return $return; + } + + public function exportAction() { + if (!Minz_Request::isPost()) { + Minz_Request::forward(array('c' => 'importExport', 'a' => 'index'), true); + } + + $this->view->_useLayout(false); + + $export_opml = Minz_Request::param('export_opml', false); + $export_starred = Minz_Request::param('export_starred', false); + $export_feeds = Minz_Request::param('export_feeds', array()); + + $export_files = array(); + if ($export_opml) { + $export_files['feeds.opml'] = $this->generateOpml(); + } + + if ($export_starred) { + $export_files['starred.json'] = $this->generateArticles('starred'); + } + + foreach ($export_feeds as $feed_id) { + $feed = $this->feedDAO->searchById($feed_id); + if ($feed) { + $filename = 'feed_' . $feed->category() . '_' + . $feed->id() . '.json'; + $export_files[$filename] = $this->generateArticles( + 'feed', $feed + ); + } + } + + $nb_files = count($export_files); + if ($nb_files > 1) { + // If there are more than 1 file to export, we need a zip archive. + try { + $this->exportZip($export_files); + } catch (Exception $e) { + # Oops, there is no Zip extension! + Minz_Request::bad(_t('export_no_zip_extension'), + array('c' => 'importExport', 'a' => 'index')); + } + } elseif ($nb_files === 1) { + // Only one file? Guess its type and export it. + $filename = key($export_files); + $type = $this->guessFileType($filename); + $this->exportFile('freshrss_' . $filename, $export_files[$filename], $type); + } else { + Minz_Request::forward(array('c' => 'importExport', 'a' => 'index'), true); + } + } + + private function generateOpml() { + $list = array(); + foreach ($this->catDAO->listCategories() as $key => $cat) { + $list[$key]['name'] = $cat->name(); + $list[$key]['feeds'] = $this->feedDAO->listByCategory($cat->id()); + } + + $this->view->categories = $list; + return $this->view->helperToString('export/opml'); + } + + private function generateArticles($type, $feed = NULL) { + $this->view->categories = $this->catDAO->listCategories(); + + if ($type == 'starred') { + $this->view->list_title = _t('starred_list'); + $this->view->type = 'starred'; + $unread_fav = $this->entryDAO->countUnreadReadFavorites(); + $this->view->entries = $this->entryDAO->listWhere( + 's', '', FreshRSS_Entry::STATE_ALL, 'ASC', + $unread_fav['all'] + ); + } elseif ($type == 'feed' && !is_null($feed)) { + $this->view->list_title = _t('feed_list', $feed->name()); + $this->view->type = 'feed/' . $feed->id(); + $this->view->entries = $this->entryDAO->listWhere( + 'f', $feed->id(), FreshRSS_Entry::STATE_ALL, 'ASC', + $this->view->conf->posts_per_page + ); + $this->view->feed = $feed; + } + + return $this->view->helperToString('export/articles'); + } + + private function exportZip($files) { + if (!extension_loaded('zip')) { + throw new Exception(); + } + + // From https://stackoverflow.com/questions/1061710/php-zip-files-on-the-fly + $zip_file = tempnam('tmp', 'zip'); + $zip = new ZipArchive(); + $zip->open($zip_file, ZipArchive::OVERWRITE); + + foreach ($files as $filename => $content) { + $zip->addFromString($filename, $content); + } + + // Close and send to user + $zip->close(); + header('Content-Type: application/zip'); + header('Content-Length: ' . filesize($zip_file)); + header('Content-Disposition: attachment; filename="freshrss_export.zip"'); + readfile($zip_file); + unlink($zip_file); + } + + private function exportFile($filename, $content, $type) { + if ($type === 'unknown') { + return; + } + + $content_type = ''; + if ($type === 'opml') { + $content_type = "text/opml"; + } elseif ($type === 'json_feed' || $type === 'json_starred') { + $content_type = "text/json"; + } + + header('Content-Type: ' . $content_type . '; charset=utf-8'); + header('Content-disposition: attachment; filename=' . $filename); + print($content); + } +} diff --git a/app/Controllers/indexController.php b/app/Controllers/indexController.php index 38f4c0e7c..e8e26b142 100755 --- a/app/Controllers/indexController.php +++ b/app/Controllers/indexController.php @@ -25,16 +25,12 @@ 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 @@ -49,7 +45,7 @@ class FreshRSS_index_Controller extends Minz_ActionController { } $catDAO = new FreshRSS_CategoryDAO(); - $entryDAO = new FreshRSS_EntryDAO(); + $entryDAO = FreshRSS_Factory::createEntryDao(); $this->view->cat_aside = $catDAO->listCategories (); $this->view->nb_favorites = $entryDAO->countUnreadReadFavorites (); @@ -73,31 +69,32 @@ class FreshRSS_index_Controller extends Minz_ActionController { // mise à jour des titres $this->view->rss_title = $this->view->currentName . ' | ' . Minz_View::title(); - if ($this->view->nb_not_read > 0) { - Minz_View::appendTitle (' (' . formatNumber($this->view->nb_not_read) . ')'); - } - Minz_View::prependTitle ( + Minz_View::prependTitle( + ($this->nb_not_read_cat > 0 ? '(' . formatNumber($this->nb_not_read_cat) . ') ' : '') . $this->view->currentName . - ($this->nb_not_read_cat > 0 ? ' (' . formatNumber($this->nb_not_read_cat) . ')' : '') . ' · ' ); // On récupère les différents éléments de filtrage - $this->view->state = $state = Minz_Request::param ('state', $this->view->conf->default_view); + $this->view->state = Minz_Request::param('state', $this->view->conf->default_view); + $state_param = Minz_Request::param ('state', null); $filter = Minz_Request::param ('search', ''); - if (!empty($filter)) { - $state = 'all'; //Search always in read and unread articles - } $this->view->order = $order = Minz_Request::param ('order', $this->view->conf->sort_order); $nb = Minz_Request::param ('nb', $this->view->conf->posts_per_page); $first = Minz_Request::param ('next', ''); - if ($state === 'not_read') { //Any unread article in this category at all? + $ajax_request = Minz_Request::param('ajax', false); + if ($output === 'reader') { + $nb = max(1, round($nb / 2)); + } + + if ($this->view->state === FreshRSS_Entry::STATE_NOT_READ) { //Any unread article in this category at all? switch ($getType) { case 'a': $hasUnread = $this->view->nb_not_read > 0; break; case 's': + // This is deprecated. The favorite button does not exist anymore $hasUnread = $this->view->nb_favorites['unread'] > 0; break; case 'c': @@ -111,8 +108,8 @@ class FreshRSS_index_Controller extends Minz_ActionController { $hasUnread = true; break; } - if (!$hasUnread) { - $this->view->state = $state = 'all'; + if (!$hasUnread && ($state_param === null)) { + $this->view->state = FreshRSS_Entry::STATE_ALL; } } @@ -125,15 +122,22 @@ class FreshRSS_index_Controller extends Minz_ActionController { $keepHistoryDefault = $this->view->conf->keep_history_default; try { - $entries = $entryDAO->listWhere($getType, $getId, $state, $order, $nb + 1, $first, $filter, $date_min, $keepHistoryDefault); + $entries = $entryDAO->listWhere($getType, $getId, $this->view->state, $order, $nb + 1, $first, $filter, $date_min, true, $keepHistoryDefault); // Si on a récupéré aucun article "non lus" // on essaye de récupérer tous les articles - if ($state === 'not_read' && empty($entries)) { - Minz_Log::record ('Conflicting information about nbNotRead!', Minz_Log::DEBUG); - $this->view->state = 'all'; - $entries = $entryDAO->listWhere($getType, $getId, 'all', $order, $nb, $first, $filter, $date_min, $keepHistoryDefault); + if ($this->view->state === FreshRSS_Entry::STATE_NOT_READ && empty($entries) && ($state_param === null) && ($filter == '')) { + Minz_Log::record('Conflicting information about nbNotRead!', Minz_Log::DEBUG); + $feedDAO = FreshRSS_Factory::createFeedDao(); + try { + $feedDAO->updateCachedValues(); + } catch (Exception $ex) { + Minz_Log::record('Failed to automatically correct nbNotRead! ' + $ex->getMessage(), Minz_Log::NOTICE); + } + $this->view->state = FreshRSS_Entry::STATE_ALL; + $entries = $entryDAO->listWhere($getType, $getId, $this->view->state, $order, $nb, $first, $filter, $date_min, true, $keepHistoryDefault); } + Minz_Request::_param('state', $this->view->state); if (count($entries) <= $nb) { $this->view->nextId = ''; @@ -186,7 +190,7 @@ class FreshRSS_index_Controller extends Minz_ActionController { case 'f': $feed = FreshRSS_CategoryDAO::findFeed($this->view->cat_aside, $getId); if (empty($feed)) { - $feedDAO = new FreshRSS_FeedDAO(); + $feedDAO = FreshRSS_Factory::createFeedDao(); $feed = $feedDAO->searchById($getId); } if ($feed) { @@ -203,25 +207,6 @@ class FreshRSS_index_Controller extends Minz_ActionController { } } - public function statsAction () { - if (!$this->view->loginOk) { - Minz_Error::error ( - 403, - array ('error' => array (Minz_Translate::t ('access_denied'))) - ); - } - - Minz_View::prependTitle (Minz_Translate::t ('stats') . ' · '); - - $statsDAO = new FreshRSS_StatsDAO (); - Minz_View::appendScript (Minz_Url::display ('/scripts/flotr2.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/flotr2.min.js'))); - $this->view->repartition = $statsDAO->calculateEntryRepartition(); - $this->view->count = ($statsDAO->calculateEntryCount()); - $this->view->feedByCategory = $statsDAO->calculateFeedByCategory(); - $this->view->entryByCategory = $statsDAO->calculateEntryByCategory(); - $this->view->topFeed = $statsDAO->calculateTopFeed(); - } - public function aboutAction () { Minz_View::prependTitle (Minz_Translate::t ('about') . ' · '); } @@ -316,7 +301,46 @@ class FreshRSS_index_Controller extends Minz_ActionController { Minz_Session::_param('passwordHash'); } + private static function makeLongTermCookie($username, $passwordHash) { + do { + $token = sha1(Minz_Configuration::salt() . $username . uniqid(mt_rand(), true)); + $tokenFile = DATA_PATH . '/tokens/' . $token . '.txt'; + } while (file_exists($tokenFile)); + if (@file_put_contents($tokenFile, $username . "\t" . $passwordHash) === false) { + return false; + } + $expire = time() + 2629744; //1 month //TODO: Use a configuration instead + Minz_Session::setLongTermCookie('FreshRSS_login', $token, $expire); + Minz_Session::_param('token', $token); + return $token; + } + + private static function deleteLongTermCookie() { + Minz_Session::deleteLongTermCookie('FreshRSS_login'); + $token = Minz_Session::param('token', null); + if (ctype_alnum($token)) { + @unlink(DATA_PATH . '/tokens/' . $token . '.txt'); + } + Minz_Session::_param('token'); + if (rand(0, 10) === 1) { + self::purgeTokens(); + } + } + + private static function purgeTokens() { + $oldest = time() - 2629744; //1 month //TODO: Use a configuration instead + foreach (new DirectoryIterator(DATA_PATH . '/tokens/') as $fileInfo) { + if ($fileInfo->getExtension() === 'txt' && $fileInfo->getMTime() < $oldest) { + @unlink($fileInfo->getPathname()); + } + } + } + public function formLoginAction () { + if ($this->view->loginOk) { + Minz_Request::forward(array('c' => 'index', 'a' => 'index'), true); + } + if (Minz_Request::isPost()) { $ok = false; $nonce = Minz_Session::param('nonce'); @@ -333,6 +357,11 @@ class FreshRSS_index_Controller extends Minz_ActionController { if ($ok) { Minz_Session::_param('currentUser', $username); Minz_Session::_param('passwordHash', $s); + if (Minz_Request::param('keep_logged_in', false)) { + self::makeLongTermCookie($username, $s); + } else { + self::deleteLongTermCookie(); + } } else { Minz_Log::record('Password mismatch for user ' . $username . ', nonce=' . $nonce . ', c=' . $c, Minz_Log::WARNING); } @@ -351,6 +380,32 @@ class FreshRSS_index_Controller extends Minz_ActionController { } $this->view->_useLayout(false); Minz_Request::forward(array('c' => 'index', 'a' => 'index'), true); + } elseif (Minz_Configuration::unsafeAutologinEnabled() && isset($_GET['u']) && isset($_GET['p'])) { + Minz_Session::_param('currentUser'); + Minz_Session::_param('mail'); + Minz_Session::_param('passwordHash'); + $username = ctype_alnum($_GET['u']) ? $_GET['u'] : ''; + $passwordPlain = $_GET['p']; + Minz_Request::_param('p'); //Discard plain-text password ASAP + $_GET['p'] = ''; + if (!function_exists('password_verify')) { + include_once(LIB_PATH . '/password_compat.php'); + } + try { + $conf = new FreshRSS_Configuration($username); + $s = $conf->passwordHash; + $ok = password_verify($passwordPlain, $s); + unset($passwordPlain); + if ($ok) { + Minz_Session::_param('currentUser', $username); + Minz_Session::_param('passwordHash', $s); + } else { + Minz_Log::record('Unsafe password mismatch for user ' . $username, Minz_Log::WARNING); + } + } catch (Minz_Exception $me) { + Minz_Log::record('Unsafe login failure: ' . $me->getMessage(), Minz_Log::WARNING); + } + Minz_Request::forward(array('c' => 'index', 'a' => 'index'), true); } elseif (!Minz_Configuration::canLogIn()) { Minz_Error::error ( 403, @@ -366,6 +421,78 @@ class FreshRSS_index_Controller extends Minz_ActionController { Minz_Session::_param('currentUser'); Minz_Session::_param('mail'); Minz_Session::_param('passwordHash'); + self::deleteLongTermCookie(); Minz_Request::forward(array('c' => 'index', 'a' => 'index'), true); } + + public function resetAuthAction() { + Minz_View::prependTitle(_t('auth_reset') . ' · '); + Minz_View::appendScript(Minz_Url::display( + '/scripts/bcrypt.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/bcrypt.min.js') + )); + + $this->view->no_form = false; + // Enable changement of auth only if Persona! + if (Minz_Configuration::authType() != 'persona') { + $this->view->message = array( + 'status' => 'bad', + 'title' => _t('damn'), + 'body' => _t('auth_not_persona') + ); + $this->view->no_form = true; + return; + } + + $conf = new FreshRSS_Configuration(Minz_Configuration::defaultUser()); + // Admin user must have set its master password. + if (!$conf->passwordHash) { + $this->view->message = array( + 'status' => 'bad', + 'title' => _t('damn'), + 'body' => _t('auth_no_password_set') + ); + $this->view->no_form = true; + return; + } + + invalidateHttpCache(); + + if (Minz_Request::isPost()) { + $nonce = Minz_Session::param('nonce'); + $username = Minz_Request::param('username', ''); + $c = Minz_Request::param('challenge', ''); + if (!(ctype_alnum($username) && ctype_graph($c) && ctype_alnum($nonce))) { + Minz_Log::debug('Invalid credential parameters:' . + ' user=' . $username . + ' challenge=' . $c . + ' nonce=' . $nonce); + Minz_Request::bad(_t('invalid_login'), + array('c' => 'index', 'a' => 'resetAuth')); + } + + if (!function_exists('password_verify')) { + include_once(LIB_PATH . '/password_compat.php'); + } + + $s = $conf->passwordHash; + $ok = password_verify($nonce . $s, $c); + if ($ok) { + Minz_Configuration::_authType('form'); + $ok = Minz_Configuration::writeFile(); + + if ($ok) { + Minz_Request::good(_t('auth_form_set')); + } else { + Minz_Request::bad(_t('auth_form_not_set'), + array('c' => 'index', 'a' => 'resetAuth')); + } + } else { + Minz_Log::debug('Password mismatch for user ' . $username . + ', nonce=' . $nonce . ', c=' . $c); + + Minz_Request::bad(_t('invalid_login'), + array('c' => 'index', 'a' => 'resetAuth')); + } + } + } } diff --git a/app/Controllers/javascriptController.php b/app/Controllers/javascriptController.php index 3d741e298..67148350f 100755 --- a/app/Controllers/javascriptController.php +++ b/app/Controllers/javascriptController.php @@ -7,8 +7,8 @@ class FreshRSS_javascript_Controller extends Minz_ActionController { public function actualizeAction () { header('Content-Type: text/javascript; charset=UTF-8'); - $feedDAO = new FreshRSS_FeedDAO (); - $this->view->feeds = $feedDAO->listFeedsOrderUpdate(); + $feedDAO = FreshRSS_Factory::createFeedDao(); + $this->view->feeds = $feedDAO->listFeedsOrderUpdate($this->view->conf->ttl_default); } public function nbUnreadsPerFeedAction() { diff --git a/app/Controllers/statsController.php b/app/Controllers/statsController.php new file mode 100644 index 000000000..256543f37 --- /dev/null +++ b/app/Controllers/statsController.php @@ -0,0 +1,129 @@ +<?php + +/** + * Controller to handle application statistics. + */ +class FreshRSS_stats_Controller extends Minz_ActionController { + + /** + * This action handles the statistic main page. + * + * It displays the statistic main page. + * The values computed to display the page are: + * - repartition of read/unread/favorite/not favorite + * - number of article per day + * - number of feed by category + * - number of article by category + * - list of most prolific feed + */ + public function indexAction() { + $statsDAO = FreshRSS_Factory::createStatsDAO(); + Minz_View::appendScript(Minz_Url::display('/scripts/flotr2.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/flotr2.min.js'))); + $this->view->repartition = $statsDAO->calculateEntryRepartition(); + $this->view->count = $statsDAO->calculateEntryCount(); + $this->view->feedByCategory = $statsDAO->calculateFeedByCategory(); + $this->view->entryByCategory = $statsDAO->calculateEntryByCategory(); + $this->view->topFeed = $statsDAO->calculateTopFeed(); + } + + /** + * This action handles the idle feed statistic page. + * + * It displays the list of idle feed for different period. The supported + * periods are: + * - last year + * - last 6 months + * - last 3 months + * - last month + * - last week + */ + public function idleAction() { + $statsDAO = FreshRSS_Factory::createStatsDAO(); + $feeds = $statsDAO->calculateFeedLastDate(); + $idleFeeds = array( + 'last_year' => array(), + 'last_6_month' => array(), + 'last_3_month' => array(), + 'last_month' => array(), + 'last_week' => array(), + ); + $now = new \DateTime(); + $feedDate = clone $now; + $lastWeek = clone $now; + $lastWeek->modify('-1 week'); + $lastMonth = clone $now; + $lastMonth->modify('-1 month'); + $last3Month = clone $now; + $last3Month->modify('-3 month'); + $last6Month = clone $now; + $last6Month->modify('-6 month'); + $lastYear = clone $now; + $lastYear->modify('-1 year'); + + foreach ($feeds as $feed) { + $feedDate->setTimestamp($feed['last_date']); + if ($feedDate >= $lastWeek) { + continue; + } + if ($feedDate < $lastYear) { + $idleFeeds['last_year'][] = $feed; + } elseif ($feedDate < $last6Month) { + $idleFeeds['last_6_month'][] = $feed; + } elseif ($feedDate < $last3Month) { + $idleFeeds['last_3_month'][] = $feed; + } elseif ($feedDate < $lastMonth) { + $idleFeeds['last_month'][] = $feed; + } elseif ($feedDate < $lastWeek) { + $idleFeeds['last_week'][] = $feed; + } + } + + $this->view->idleFeeds = $idleFeeds; + } + + /** + * This action handles the article repartition statistic page. + * + * It displays the number of article and the average of article for the + * following periods: + * - hour of the day + * - day of the week + * - month + * + * @todo verify that the metrics used here make some sense. Especially + * for the average. + */ + public function repartitionAction() { + $statsDAO = FreshRSS_Factory::createStatsDAO(); + $categoryDAO = new FreshRSS_CategoryDAO(); + $feedDAO = FreshRSS_Factory::createFeedDao(); + Minz_View::appendScript(Minz_Url::display('/scripts/flotr2.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/flotr2.min.js'))); + $id = Minz_Request::param ('id', null); + $this->view->categories = $categoryDAO->listCategories(); + $this->view->feed = $feedDAO->searchById($id); + $this->view->days = $statsDAO->getDays(); + $this->view->months = $statsDAO->getMonths(); + $this->view->repartitionHour = $statsDAO->calculateEntryRepartitionPerFeedPerHour($id); + $this->view->averageHour = $statsDAO->calculateEntryAveragePerFeedPerHour($id); + $this->view->repartitionDayOfWeek = $statsDAO->calculateEntryRepartitionPerFeedPerDayOfWeek($id); + $this->view->averageDayOfWeek = $statsDAO->calculateEntryAveragePerFeedPerDayOfWeek($id); + $this->view->repartitionMonth = $statsDAO->calculateEntryRepartitionPerFeedPerMonth($id); + $this->view->averageMonth = $statsDAO->calculateEntryAveragePerFeedPerMonth($id); + } + + /** + * This action is called before every other action in that class. It is + * the common boiler plate for every action. It is triggered by the + * underlying framework. + */ + public function firstAction() { + if (!$this->view->loginOk) { + Minz_Error::error( + 403, array('error' => array(Minz_Translate::t('access_denied'))) + ); + } + + Minz_View::prependTitle(Minz_Translate::t('stats') . ' · '); + } + +} diff --git a/app/Controllers/updateController.php b/app/Controllers/updateController.php new file mode 100644 index 000000000..da5bddc65 --- /dev/null +++ b/app/Controllers/updateController.php @@ -0,0 +1,129 @@ +<?php + +class FreshRSS_update_Controller extends Minz_ActionController { + public function firstAction() { + $current_user = Minz_Session::param('currentUser', ''); + if (!$this->view->loginOk && Minz_Configuration::isAdmin($current_user)) { + Minz_Error::error( + 403, + array('error' => array(_t('access_denied'))) + ); + } + + invalidateHttpCache(); + + Minz_View::prependTitle(_t('update_system') . ' · '); + $this->view->update_to_apply = false; + $this->view->last_update_time = 'unknown'; + $this->view->check_last_hour = false; + $timestamp = (int)@file_get_contents(DATA_PATH . '/last_update.txt'); + if (is_numeric($timestamp) && $timestamp > 0) { + $this->view->last_update_time = timestamptodate($timestamp); + $this->view->check_last_hour = (time() - 3600) <= $timestamp; + } + } + + public function indexAction() { + if (file_exists(UPDATE_FILENAME) && !is_writable(FRESHRSS_PATH)) { + $this->view->message = array( + 'status' => 'bad', + 'title' => _t('damn'), + 'body' => _t('file_is_nok', FRESHRSS_PATH) + ); + } elseif (file_exists(UPDATE_FILENAME)) { + // There is an update file to apply! + $this->view->update_to_apply = true; + $this->view->message = array( + 'status' => 'good', + 'title' => _t('ok'), + 'body' => _t('update_can_apply') + ); + } + } + + public function checkAction() { + $this->view->change_view('update', 'index'); + + if (file_exists(UPDATE_FILENAME) || $this->view->check_last_hour) { + // There is already an update file to apply: we don't need to check + // the webserver! + // Or if already check during the last hour, do nothing. + Minz_Request::forward(array('c' => 'update')); + + return; + } + + $c = curl_init(FRESHRSS_UPDATE_WEBSITE); + curl_setopt($c, CURLOPT_RETURNTRANSFER, true); + curl_setopt($c, CURLOPT_SSL_VERIFYPEER, true); + curl_setopt($c, CURLOPT_SSL_VERIFYHOST, 2); + $result = curl_exec($c); + $c_status = curl_getinfo($c, CURLINFO_HTTP_CODE); + $c_error = curl_error($c); + curl_close($c); + + if ($c_status !== 200) { + Minz_Log::error( + 'Error during update (HTTP code ' . $c_status . '): ' . $c_error + ); + + $this->view->message = array( + 'status' => 'bad', + 'title' => _t('damn'), + 'body' => _t('update_server_not_found', FRESHRSS_UPDATE_WEBSITE) + ); + return; + } + + $res_array = explode("\n", $result, 2); + $status = $res_array[0]; + if (strpos($status, 'UPDATE') !== 0) { + $this->view->message = array( + 'status' => 'bad', + 'title' => _t('damn'), + 'body' => _t('no_update') + ); + + @file_put_contents(DATA_PATH . '/last_update.txt', time()); + + return; + } + + $script = $res_array[1]; + if (file_put_contents(UPDATE_FILENAME, $script) !== false) { + Minz_Request::forward(array('c' => 'update')); + } else { + $this->view->message = array( + 'status' => 'bad', + 'title' => _t('damn'), + 'body' => _t('update_problem', 'Cannot save the update script') + ); + } + } + + public function applyAction() { + if (!file_exists(UPDATE_FILENAME) || !is_writable(FRESHRSS_PATH)) { + Minz_Request::forward(array('c' => 'update'), true); + } + + require(UPDATE_FILENAME); + + if (Minz_Request::isPost()) { + save_info_update(); + } + + if (!need_info_update()) { + $res = apply_update(); + + if ($res === true) { + @unlink(UPDATE_FILENAME); + @file_put_contents(DATA_PATH . '/last_update.txt', time()); + + Minz_Request::good(_t('update_finished')); + } else { + Minz_Request::bad(_t('update_problem', $res), + array('c' => 'update', 'a' => 'index')); + } + } + } +} diff --git a/app/Controllers/usersController.php b/app/Controllers/usersController.php index bb4f34c5e..a9e6c32bc 100644 --- a/app/Controllers/usersController.php +++ b/app/Controllers/usersController.php @@ -17,7 +17,7 @@ class FreshRSS_users_Controller extends Minz_ActionController { if (Minz_Request::isPost()) { $ok = true; - $passwordPlain = Minz_Request::param('passwordPlain', false); + $passwordPlain = Minz_Request::param('passwordPlain', '', true); if ($passwordPlain != '') { Minz_Request::_param('passwordPlain'); //Discard plain-text password ASAP $_POST['passwordPlain'] = ''; @@ -32,8 +32,20 @@ class FreshRSS_users_Controller extends Minz_ActionController { } Minz_Session::_param('passwordHash', $this->view->conf->passwordHash); + $passwordPlain = Minz_Request::param('apiPasswordPlain', '', true); + if ($passwordPlain != '') { + if (!function_exists('password_hash')) { + include_once(LIB_PATH . '/password_compat.php'); + } + $passwordHash = password_hash($passwordPlain, PASSWORD_BCRYPT, array('cost' => self::BCRYPT_COST)); + $passwordPlain = ''; + $passwordHash = preg_replace('/^\$2[xy]\$/', '\$2a\$', $passwordHash); //Compatibility with bcrypt.js + $ok &= ($passwordHash != ''); + $this->view->conf->_apiPasswordHash($passwordHash); + } + if (Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_'))) { - $this->view->conf->_mail_login(Minz_Request::param('mail_login', false)); + $this->view->conf->_mail_login(Minz_Request::param('mail_login', '', true)); } $email = $this->view->conf->mail_login; Minz_Session::_param('mail', $email); @@ -57,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(); } } @@ -81,7 +99,8 @@ class FreshRSS_users_Controller extends Minz_ActionController { public function createAction() { if (Minz_Request::isPost() && Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_'))) { - require_once(APP_PATH . '/sql.php'); + $db = Minz_Configuration::dataBase(); + require_once(APP_PATH . '/SQL/install.sql.' . $db['type'] . '.php'); $new_user_language = Minz_Request::param('new_user_language', $this->view->conf->language); if (!in_array($new_user_language, $this->view->conf->availableLanguages())) { @@ -101,7 +120,7 @@ class FreshRSS_users_Controller extends Minz_ActionController { } if ($ok) { - $passwordPlain = Minz_Request::param('new_user_passwordPlain', false); + $passwordPlain = Minz_Request::param('new_user_passwordPlain', '', true); $passwordHash = ''; if ($passwordPlain != '') { Minz_Request::_param('new_user_passwordPlain'); //Discard plain-text password ASAP @@ -152,7 +171,8 @@ class FreshRSS_users_Controller extends Minz_ActionController { public function deleteAction() { if (Minz_Request::isPost() && Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_'))) { - require_once(APP_PATH . '/sql.php'); + $db = Minz_Configuration::dataBase(); + require_once(APP_PATH . '/SQL/install.sql.' . $db['type'] . '.php'); $username = Minz_Request::param('username'); $ok = ctype_alnum($username); diff --git a/app/Exceptions/OpmlException.php b/app/Exceptions/OpmlException.php deleted file mode 100644 index e0ea3e493..000000000 --- a/app/Exceptions/OpmlException.php +++ /dev/null @@ -1,6 +0,0 @@ -<?php -class FreshRSS_Opml_Exception extends FreshRSS_Feed_Exception { - public function __construct ($name_file) { - parent::__construct ('OPML file is invalid'); - } -} diff --git a/app/FreshRSS.php b/app/FreshRSS.php index 84cf3429b..cdf8962cb 100644 --- a/app/FreshRSS.php +++ b/app/FreshRSS.php @@ -6,17 +6,48 @@ class FreshRSS extends Minz_FrontController { } $loginOk = $this->accessControl(Minz_Session::param('currentUser', '')); $this->loadParamsView(); + if (Minz_Request::isPost() && !is_referer_from_same_domain()) { + $loginOk = false; //Basic protection against XSRF attacks + Minz_Error::error( + 403, + array('error' => array(Minz_Translate::t('access_denied') . ' [HTTP_REFERER=' . + htmlspecialchars(empty($_SERVER['HTTP_REFERER']) ? '' : $_SERVER['HTTP_REFERER']) . ']')) + ); + } + Minz_View::_param('loginOk', $loginOk); $this->loadStylesAndScripts($loginOk); //TODO: Do not load that when not needed, e.g. some Ajax requests $this->loadNotifications(); } + private static function getCredentialsFromLongTermCookie() { + $token = Minz_Session::getLongTermCookie('FreshRSS_login'); + if (!ctype_alnum($token)) { + return array(); + } + $tokenFile = DATA_PATH . '/tokens/' . $token . '.txt'; + $mtime = @filemtime($tokenFile); + if ($mtime + 2629744 < time()) { //1 month //TODO: Use a configuration instead + @unlink($tokenFile); + return array(); //Expired or token does not exist + } + $credentials = @file_get_contents($tokenFile); + return $credentials === false ? array() : explode("\t", $credentials, 2); + } + private function accessControl($currentUser) { if ($currentUser == '') { switch (Minz_Configuration::authType()) { case 'form': - $currentUser = Minz_Configuration::defaultUser(); - Minz_Session::_param('passwordHash'); - $loginOk = false; + $credentials = self::getCredentialsFromLongTermCookie(); + if (isset($credentials[1])) { + $currentUser = trim($credentials[0]); + Minz_Session::_param('passwordHash', trim($credentials[1])); + } + $loginOk = $currentUser != ''; + if (!$loginOk) { + $currentUser = Minz_Configuration::defaultUser(); + Minz_Session::_param('passwordHash'); + } break; case 'http_auth': $currentUser = httpAuthUser(); @@ -95,7 +126,6 @@ class FreshRSS extends Minz_FrontController { break; } } - Minz_View::_param ('loginOk', $loginOk); return $loginOk; } @@ -109,11 +139,21 @@ class FreshRSS extends Minz_FrontController { } } - private function loadStylesAndScripts ($loginOk) { + private function loadStylesAndScripts($loginOk) { $theme = FreshRSS_Themes::load($this->conf->theme); if ($theme) { foreach($theme['files'] as $file) { - Minz_View::appendStyle (Minz_Url::display ('/themes/' . $theme['id'] . '/' . $file . '?' . @filemtime(PUBLIC_PATH . '/themes/' . $theme['id'] . '/' . $file))); + if ($file[0] === '_') { + $theme_id = 'base-theme'; + $filename = substr($file, 1); + } else { + $theme_id = $theme['id']; + $filename = $file; + } + $filetime = @filemtime(PUBLIC_PATH . '/themes/' . $theme_id . '/' . $filename); + Minz_View::appendStyle(Minz_Url::display( + '/themes/' . $theme_id . '/' . $filename . '?' . $filetime + )); } } @@ -127,13 +167,9 @@ class FreshRSS extends Minz_FrontController { Minz_View::appendScript('https://login.persona.org/include.js'); break; } - $includeLazyLoad = $this->conf->lazyload && ($this->conf->display_posts || Minz_Request::param ('output') === 'reader'); - Minz_View::appendScript (Minz_Url::display ('/scripts/jquery.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/jquery.min.js')), false, !$includeLazyLoad, !$includeLazyLoad); - if ($includeLazyLoad) { - Minz_View::appendScript (Minz_Url::display ('/scripts/jquery.lazyload.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/jquery.lazyload.min.js'))); - } - Minz_View::appendScript (Minz_Url::display ('/scripts/shortcut.js?' . @filemtime(PUBLIC_PATH . '/scripts/shortcut.js'))); - Minz_View::appendScript (Minz_Url::display ('/scripts/main.js?' . @filemtime(PUBLIC_PATH . '/scripts/main.js'))); + Minz_View::appendScript(Minz_Url::display('/scripts/jquery.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/jquery.min.js'))); + Minz_View::appendScript(Minz_Url::display('/scripts/shortcut.js?' . @filemtime(PUBLIC_PATH . '/scripts/shortcut.js'))); + Minz_View::appendScript(Minz_Url::display('/scripts/main.js?' . @filemtime(PUBLIC_PATH . '/scripts/main.js'))); } private function loadNotifications () { diff --git a/app/Models/Category.php b/app/Models/Category.php index 328bae799..0a0dbd3ca 100644 --- a/app/Models/Category.php +++ b/app/Models/Category.php @@ -44,7 +44,7 @@ class FreshRSS_Category extends Minz_Model { } public function feeds () { if ($this->feeds === null) { - $feedDAO = new FreshRSS_FeedDAO (); + $feedDAO = FreshRSS_Factory::createFeedDao(); $this->feeds = $feedDAO->listByCategory ($this->id ()); $this->nbFeed = 0; $this->nbNotRead = 0; diff --git a/app/Models/CategoryDAO.php b/app/Models/CategoryDAO.php index 5355228a5..f11f87f47 100644 --- a/app/Models/CategoryDAO.php +++ b/app/Models/CategoryDAO.php @@ -12,12 +12,25 @@ class FreshRSS_CategoryDAO extends Minz_ModelPdo { if ($stm && $stm->execute ($values)) { return $this->bd->lastInsertId(); } else { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::record('SQL error addCategory: ' . $info[2], Minz_Log::ERROR); return false; } } + public function addCategoryObject($category) { + $cat = $this->searchByName($category->name()); + if (!$cat) { + // Category does not exist yet in DB so we add it before continue + $values = array( + 'name' => $category->name(), + ); + return $this->addCategory($values); + } + + return $cat->id(); + } + public function updateCategory ($id, $valuesTmp) { $sql = 'UPDATE `' . $this->prefix . 'category` SET name=? WHERE id=?'; $stm = $this->bd->prepare ($sql); @@ -30,8 +43,8 @@ class FreshRSS_CategoryDAO extends Minz_ModelPdo { if ($stm && $stm->execute ($values)) { return $stm->rowCount(); } else { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::record('SQL error updateCategory: ' . $info[2], Minz_Log::ERROR); return false; } } @@ -45,8 +58,8 @@ class FreshRSS_CategoryDAO extends Minz_ModelPdo { if ($stm && $stm->execute ($values)) { return $stm->rowCount(); } else { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::record('SQL error deleteCategory: ' . $info[2], Minz_Log::ERROR); return false; } } @@ -64,7 +77,7 @@ class FreshRSS_CategoryDAO extends Minz_ModelPdo { if (isset ($cat[0])) { return $cat[0]; } else { - return false; + return null; } } public function searchByName ($name) { @@ -80,7 +93,7 @@ class FreshRSS_CategoryDAO extends Minz_ModelPdo { if (isset ($cat[0])) { return $cat[0]; } else { - return false; + return null; } } @@ -89,7 +102,7 @@ class FreshRSS_CategoryDAO extends Minz_ModelPdo { $sql = 'SELECT c.id AS c_id, c.name AS c_name, ' . ($details ? 'f.* ' : 'f.id, f.name, f.url, f.website, f.priority, f.error, f.cache_nbEntries, f.cache_nbUnreads ') . 'FROM `' . $this->prefix . 'category` c ' - . 'LEFT OUTER JOIN `' . $this->prefix . 'feed` f ON f.category = c.id ' + . 'LEFT OUTER JOIN `' . $this->prefix . 'feed` f ON f.category=c.id ' . 'GROUP BY f.id ' . 'ORDER BY c.name, f.name'; $stm = $this->bd->prepare ($sql); @@ -120,7 +133,7 @@ class FreshRSS_CategoryDAO extends Minz_ModelPdo { public function checkDefault () { $def_cat = $this->searchById (1); - if ($def_cat === false) { + if ($def_cat == null) { $cat = new FreshRSS_Category (Minz_Translate::t ('default_category')); $cat->_id (1); @@ -153,7 +166,7 @@ class FreshRSS_CategoryDAO extends Minz_ModelPdo { } public function countNotRead ($id) { - $sql = 'SELECT COUNT(*) AS count FROM `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id WHERE category=? AND e.is_read=0'; + $sql = 'SELECT COUNT(*) AS count FROM `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed=f.id WHERE category=? AND e.is_read=0'; $stm = $this->bd->prepare ($sql); $values = array ($id); $stm->execute ($values); diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php index 2b719c370..95f819779 100644 --- a/app/Models/Configuration.php +++ b/app/Models/Configuration.php @@ -7,16 +7,22 @@ class FreshRSS_Configuration { 'language' => 'en', 'old_entries' => 3, 'keep_history_default' => 0, + 'ttl_default' => 3600, 'mail_login' => '', 'token' => '', 'passwordHash' => '', //CRYPT_BLOWFISH + 'apiPasswordHash' => '', //CRYPT_BLOWFISH 'posts_per_page' => 20, 'view_mode' => 'normal', - 'default_view' => 'not_read', + 'default_view' => FreshRSS_Entry::STATE_NOT_READ, 'auto_load_more' => true, 'display_posts' => false, + 'display_categories' => false, + 'hide_read_feeds' => true, 'onread_jump_next' => true, 'lazyload' => true, + 'sticky_post' => true, + 'reading_confirm' => false, 'sort_order' => 'DESC', 'anon_access' => false, 'mark_when' => array( @@ -26,6 +32,7 @@ class FreshRSS_Configuration { 'reception' => false, ), 'theme' => 'Origine', + 'content_width' => 'thin', 'shortcuts' => array( 'mark_read' => 'r', 'mark_favorite' => 'f', @@ -37,6 +44,9 @@ class FreshRSS_Configuration { 'collapse_entry' => 'c', 'load_more' => 'm', 'auto_share' => 's', + 'focus_search' => 'a', + 'user_filter' => 'u', + 'help' => 'f1', ), 'topline_read' => true, 'topline_favorite' => true, @@ -48,16 +58,9 @@ 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(), + 'queries' => array(), + 'html5_notif_timeout' => 0, ); private $available_languages = array( @@ -65,8 +68,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 +85,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, "<?php\n return " . var_export($this->data, true) . ';', LOCK_EX) === false) { throw new Minz_PermissionDeniedException($this->filename); } @@ -104,20 +119,20 @@ 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; } + public function remove_query_by_get($get) { + $final_queries = array(); + foreach ($this->queries as $key => $query) { + if (empty($query['get']) || $query['get'] !== $get) { + $final_queries[$key] = $query; + } + } + $this->_queries($final_queries); + } + public function _language($value) { if (!isset($this->available_languages[$value])) { $value = 'en'; @@ -136,17 +151,40 @@ class FreshRSS_Configuration { } } public function _default_view ($value) { - $this->data['default_view'] = $value === 'all' ? 'all' : 'not_read'; + switch ($value) { + case FreshRSS_Entry::STATE_ALL: + // left blank on purpose + case FreshRSS_Entry::STATE_NOT_READ: + // left blank on purpose + case FreshRSS_Entry::STATE_STRICT + FreshRSS_Entry::STATE_NOT_READ: + $this->data['default_view'] = $value; + break; + default: + $this->data['default_view'] = FreshRSS_Entry::STATE_ALL; + break; + } } public function _display_posts ($value) { $this->data['display_posts'] = ((bool)$value) && $value !== 'no'; } + public function _display_categories ($value) { + $this->data['display_categories'] = ((bool)$value) && $value !== 'no'; + } + public function _hide_read_feeds($value) { + $this->data['hide_read_feeds'] = (bool)$value; + } public function _onread_jump_next ($value) { $this->data['onread_jump_next'] = ((bool)$value) && $value !== 'no'; } public function _lazyload ($value) { $this->data['lazyload'] = ((bool)$value) && $value !== 'no'; } + public function _sticky_post($value) { + $this->data['sticky_post'] = ((bool)$value) && $value !== 'no'; + } + public function _reading_confirm($value) { + $this->data['reading_confirm'] = ((bool)$value) && $value !== 'no'; + } public function _sort_order ($value) { $this->data['sort_order'] = $value === 'ASC' ? 'ASC' : 'DESC'; } @@ -158,6 +196,10 @@ class FreshRSS_Configuration { $value = intval($value); $this->data['keep_history_default'] = $value >= -1 ? $value : 0; } + public function _ttl_default($value) { + $value = intval($value); + $this->data['ttl_default'] = $value >= -1 ? $value : 3600; + } public function _shortcuts ($values) { foreach ($values as $key => $value) { if (isset($this->data['shortcuts'][$key])) { @@ -168,6 +210,9 @@ class FreshRSS_Configuration { public function _passwordHash ($value) { $this->data['passwordHash'] = ctype_graph($value) && (strlen($value) >= 60) ? $value : ''; } + public function _apiPasswordHash ($value) { + $this->data['apiPasswordHash'] = ctype_graph($value) && (strlen($value) >= 60) ? $value : ''; + } public function _mail_login ($value) { $value = filter_var($value, FILTER_VALIDATE_EMAIL); if ($value) { @@ -187,29 +232,70 @@ 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(); + $unique = array(); + foreach ($values as $value) { + if (!is_array($value)) { + continue; + } + + // Verify URL and add default value when needed + if (isset($value['url'])) { $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; } - } elseif (!is_bool($value)) { - $value = true; + } else { + $value['url'] = null; + } + + // Add a default name + if (empty($value['name'])) { + $value['name'] = $value['type']; } - $this->data['sharing'][$key] = $value; + $json_value = json_encode($value); + if (!in_array($json_value, $unique)) { + $unique[] = $json_value; + $this->data['sharing'][] = $value; + } + } + } + public function _queries ($values) { + $this->data['queries'] = array(); + foreach ($values as $value) { + $value = array_filter($value); + $params = $value; + unset($params['name']); + unset($params['url']); + $value['url'] = Minz_Url::display(array('params' => $params)); + + $this->data['queries'][] = $value; } } public function _theme($value) { $this->data['theme'] = $value; } + public function _content_width($value) { + if ($value === 'medium' || + $value === 'large' || + $value === 'no_limit') { + $this->data['content_width'] = $value; + } else { + $this->data['content_width'] = 'thin'; + } + } + + public function _html5_notif_timeout ($value) { + $value = intval($value); + $this->data['html5_notif_timeout'] = $value >= 0 ? $value : 0; + } + public function _token($value) { $this->data['token'] = $value; } diff --git a/app/Models/Entry.php b/app/Models/Entry.php index a6c67221b..9d7dd5dc4 100644 --- a/app/Models/Entry.php +++ b/app/Models/Entry.php @@ -1,6 +1,12 @@ <?php class FreshRSS_Entry extends Minz_Model { + const STATE_ALL = 0; + const STATE_READ = 1; + const STATE_NOT_READ = 2; + const STATE_FAVORITE = 4; + const STATE_NOT_FAVORITE = 8; + const STATE_STRICT = 16; private $id = 0; private $guid; @@ -69,7 +75,7 @@ class FreshRSS_Entry extends Minz_Model { } public function feed ($object = false) { if ($object) { - $feedDAO = new FreshRSS_FeedDAO (); + $feedDAO = FreshRSS_Factory::createFeedDao(); return $feedDAO->searchById ($this->feed); } else { return $this->feed; @@ -149,7 +155,7 @@ class FreshRSS_Entry extends Minz_Model { // Gestion du contenu // On cherche à récupérer les articles en entier... même si le flux ne le propose pas if ($pathEntries) { - $entryDAO = new FreshRSS_EntryDAO(); + $entryDAO = FreshRSS_Factory::createEntryDao(); $entry = $entryDAO->searchByGuid($this->feed, $this->guid); if($entry) { diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php index aaf4dcf6a..c1f87ee34 100644 --- a/app/Models/EntryDAO.php +++ b/app/Models/EntryDAO.php @@ -1,12 +1,27 @@ <?php class FreshRSS_EntryDAO extends Minz_ModelPdo { - public function addEntry ($valuesTmp) { - $sql = 'INSERT INTO `' . $this->prefix . 'entry`(id, guid, title, author, content_bin, link, date, is_read, is_favorite, id_feed, tags) ' - . 'VALUES(?, ?, ?, ?, COMPRESS(?), ?, ?, ?, ?, ?, ?)'; - $stm = $this->bd->prepare ($sql); - $values = array ( + public function isCompressed() { + return parent::$sharedDbType !== 'sqlite'; + } + + public function addEntryPrepare() { + $sql = 'INSERT INTO `' . $this->prefix . 'entry`(id, guid, title, author, ' + . ($this->isCompressed() ? 'content_bin' : 'content') + . ', link, date, is_read, is_favorite, id_feed, tags) ' + . 'VALUES(?, ?, ?, ?, ' + . ($this->isCompressed() ? 'COMPRESS(?)' : '?') + . ', ?, ?, ?, ?, ?, ?)'; + return $this->bd->prepare($sql); + } + + public function addEntry($valuesTmp, $preparedStatement = null) { + $stm = $preparedStatement === null ? + FreshRSS_EntryDAO::addEntryPrepare() : + $preparedStatement; + + $values = array( $valuesTmp['id'], substr($valuesTmp['guid'], 0, 760), substr($valuesTmp['title'], 0, 255), @@ -20,12 +35,12 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo { substr($valuesTmp['tags'], 0, 1023), ); - if ($stm && $stm->execute ($values)) { + if ($stm && $stm->execute($values)) { return $this->bd->lastInsertId(); } else { - $info = $stm->errorInfo(); + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); if ((int)($info[0] / 1000) !== 23) { //Filter out "SQLSTATE Class code 23: Constraint Violation" because of expected duplicate entries - Minz_Log::record ('SQL error ' . $info[0] . ': ' . $info[1] . ' ' . $info[2] + Minz_Log::record('SQL error addEntry: ' . $info[0] . ': ' . $info[1] . ' ' . $info[2] . ' while adding entry in feed ' . $valuesTmp['id_feed'] . ' with title: ' . $valuesTmp['title'], Minz_Log::ERROR); } /*else { Minz_Log::record ('SQL error ' . $info[0] . ': ' . $info[1] . ' ' . $info[2] @@ -35,232 +50,259 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo { } } - public function markFavorite ($id, $is_favorite = true) { - $sql = 'UPDATE `' . $this->prefix . 'entry` e ' - . 'SET e.is_favorite = ? ' - . 'WHERE e.id=?'; - $values = array ($is_favorite ? 1 : 0, $id); - $stm = $this->bd->prepare ($sql); - if ($stm && $stm->execute ($values)) { + public function addEntryObject($entry, $conf, $feedHistory) { + $existingGuids = array_fill_keys( + $this->listLastGuidsByFeed($entry->feed(), 20), 1 + ); + + $nb_month_old = max($conf->old_entries, 1); + $date_min = time() - (3600 * 24 * 30 * $nb_month_old); + + $eDate = $entry->date(true); + + if ($feedHistory == -2) { + $feedHistory = $conf->keep_history_default; + } + + if (!isset($existingGuids[$entry->guid()]) && + ($feedHistory != 0 || $eDate >= $date_min || $entry->isFavorite())) { + $values = $entry->toArray(); + + $useDeclaredDate = empty($existingGuids); + $values['id'] = ($useDeclaredDate || $eDate < $date_min) ? + min(time(), $eDate) . uSecString() : + uTimeString(); + + return $this->addEntry($values); + } + + // We don't return Entry object to avoid a research in DB + return -1; + } + + public function markFavorite($ids, $is_favorite = true) { + if (!is_array($ids)) { + $ids = array($ids); + } + $sql = 'UPDATE `' . $this->prefix . 'entry` ' + . 'SET is_favorite=? ' + . 'WHERE id IN (' . str_repeat('?,', count($ids) - 1). '?)'; + $values = array($is_favorite ? 1 : 0); + $values = array_merge($values, $ids); + $stm = $this->bd->prepare($sql); + if ($stm && $stm->execute($values)) { return $stm->rowCount(); } else { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::record('SQL error markFavorite: ' . $info[2], Minz_Log::ERROR); return false; } } - public function markRead ($id, $is_read = true) { - $sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id ' - . 'SET e.is_read = ?,' - . 'f.cache_nbUnreads=f.cache_nbUnreads' . ($is_read ? '-' : '+') . '1 ' - . 'WHERE e.id=?'; - $values = array ($is_read ? 1 : 0, $id); - $stm = $this->bd->prepare ($sql); - if ($stm && $stm->execute ($values)) { - return $stm->rowCount(); + + protected function updateCacheUnreads($catId = false, $feedId = false) { + $sql = 'UPDATE `' . $this->prefix . 'feed` f ' + . 'LEFT OUTER JOIN (' + . 'SELECT e.id_feed, ' + . 'COUNT(*) AS nbUnreads ' + . 'FROM `' . $this->prefix . 'entry` e ' + . 'WHERE e.is_read=0 ' + . 'GROUP BY e.id_feed' + . ') x ON x.id_feed=f.id ' + . 'SET f.cache_nbUnreads=COALESCE(x.nbUnreads, 0) ' + . 'WHERE 1'; + $values = array(); + if ($feedId !== false) { + $sql .= ' AND f.id=?'; + $values[] = $id; + } + if ($catId !== false) { + $sql .= ' AND f.category=?'; + $values[] = $catId; + } + $stm = $this->bd->prepare($sql); + if ($stm && $stm->execute($values)) { + return true; } else { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::record('SQL error updateCacheUnreads: ' . $info[2], Minz_Log::ERROR); return false; } } - public function markReadEntries ($idMax = 0, $favorites = false) { - if ($idMax === 0) { - $sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id ' - . 'SET e.is_read = 1, f.cache_nbUnreads=0 ' - . 'WHERE e.is_read = 0 AND '; - if ($favorites) { - $sql .= 'e.is_favorite = 1'; - } else { - $sql .= 'f.priority > 0'; - } - $stm = $this->bd->prepare ($sql); - if ($stm && $stm->execute ()) { - return $stm->rowCount(); - } else { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); - return false; - } - } else { - $this->bd->beginTransaction (); - $sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id ' - . 'SET e.is_read = 1 ' - . 'WHERE e.is_read = 0 AND e.id <= ? AND '; - if ($favorites) { - $sql .= 'e.is_favorite = 1'; - } else { - $sql .= 'f.priority > 0'; + public function markRead($ids, $is_read = true) { + if (is_array($ids)) { //Many IDs at once (used by API) + if (count($ids) < 6) { //Speed heuristics + $affected = 0; + foreach ($ids as $id) { + $affected += $this->markRead($id, $is_read); + } + return $affected; } - $values = array ($idMax); - $stm = $this->bd->prepare ($sql); - if (!($stm && $stm->execute ($values))) { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); - $this->bd->rollBack (); + + $sql = 'UPDATE `' . $this->prefix . 'entry` ' + . 'SET is_read=? ' + . 'WHERE id IN (' . str_repeat('?,', count($ids) - 1). '?)'; + $values = array($is_read ? 1 : 0); + $values = array_merge($values, $ids); + $stm = $this->bd->prepare($sql); + if (!($stm && $stm->execute($values))) { + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::record('SQL error markRead: ' . $info[2], Minz_Log::ERROR); return false; } $affected = $stm->rowCount(); - - if ($affected > 0) { - $sql = 'UPDATE `' . $this->prefix . 'feed` f ' - . 'LEFT OUTER JOIN (' - . 'SELECT e.id_feed, ' - . 'COUNT(*) AS nbUnreads ' - . 'FROM `' . $this->prefix . 'entry` e ' - . 'WHERE e.is_read = 0 ' - . 'GROUP BY e.id_feed' - . ') x ON x.id_feed=f.id ' - . 'SET f.cache_nbUnreads=COALESCE(x.nbUnreads, 0)'; - $stm = $this->bd->prepare ($sql); - if (!($stm && $stm->execute ())) { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); - $this->bd->rollBack (); - return false; - } + if (($affected > 0) && (!$this->updateCacheUnreads(false, false))) { + return false; } - - $this->bd->commit (); return $affected; - } - } - public function markReadCat ($id, $idMax = 0) { - if ($idMax === 0) { - $sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id ' - . 'SET e.is_read = 1, f.cache_nbUnreads=0 ' - . 'WHERE f.category = ? AND e.is_read = 0'; - $values = array ($id); - $stm = $this->bd->prepare ($sql); - if ($stm && $stm->execute ($values)) { + } else { + $sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed=f.id ' + . 'SET e.is_read=?,' + . 'f.cache_nbUnreads=f.cache_nbUnreads' . ($is_read ? '-' : '+') . '1 ' + . 'WHERE e.id=? AND e.is_read=?'; + $values = array($is_read ? 1 : 0, $ids, $is_read ? 0 : 1); + $stm = $this->bd->prepare($sql); + if ($stm && $stm->execute($values)) { return $stm->rowCount(); } else { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::record('SQL error markRead: ' . $info[2], Minz_Log::ERROR); return false; } - } else { - $this->bd->beginTransaction (); - - $sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id ' - . 'SET e.is_read = 1 ' - . 'WHERE f.category = ? AND e.is_read = 0 AND e.id <= ?'; - $values = array ($id, $idMax); - $stm = $this->bd->prepare ($sql); - if (!($stm && $stm->execute ($values))) { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); - $this->bd->rollBack (); - return false; - } - $affected = $stm->rowCount(); + } + } - if ($affected > 0) { - $sql = 'UPDATE `' . $this->prefix . 'feed` f ' - . 'LEFT OUTER JOIN (' - . 'SELECT e.id_feed, ' - . 'COUNT(*) AS nbUnreads ' - . 'FROM `' . $this->prefix . 'entry` e ' - . 'WHERE e.is_read = 0 ' - . 'GROUP BY e.id_feed' - . ') x ON x.id_feed=f.id ' - . 'SET f.cache_nbUnreads=COALESCE(x.nbUnreads, 0) ' - . 'WHERE f.category = ?'; - $values = array ($id); - $stm = $this->bd->prepare ($sql); - if (!($stm && $stm->execute ($values))) { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); - $this->bd->rollBack (); - return false; - } - } + public function markReadEntries($idMax = 0, $onlyFavorites = false, $priorityMin = 0) { + if ($idMax == 0) { + $idMax = time() . '000000'; + Minz_Log::record('Calling markReadEntries(0) is deprecated!', Minz_Log::DEBUG); + } - $this->bd->commit (); - return $affected; + $sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed=f.id ' + . 'SET e.is_read=1 ' + . 'WHERE e.is_read=0 AND e.id <= ?'; + if ($onlyFavorites) { + $sql .= ' AND e.is_favorite=1'; + } elseif ($priorityMin >= 0) { + $sql .= ' AND f.priority > ' . intval($priorityMin); + } + $values = array($idMax); + $stm = $this->bd->prepare($sql); + if (!($stm && $stm->execute($values))) { + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::record('SQL error markReadEntries: ' . $info[2], Minz_Log::ERROR); + return false; } + $affected = $stm->rowCount(); + if (($affected > 0) && (!$this->updateCacheUnreads(false, false))) { + return false; + } + return $affected; } - public function markReadFeed ($id, $idMax = 0) { - if ($idMax === 0) { - $sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id ' - . 'SET e.is_read = 1, f.cache_nbUnreads=0 ' - . 'WHERE f.id=? AND e.is_read = 0'; - $values = array ($id); - $stm = $this->bd->prepare ($sql); - if ($stm && $stm->execute ($values)) { - return $stm->rowCount(); - } else { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); - return false; - } - } else { - $this->bd->beginTransaction (); - - $sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id ' - . 'SET e.is_read = 1 ' - . 'WHERE f.id=? AND e.is_read = 0 AND e.id <= ?'; - $values = array ($id, $idMax); - $stm = $this->bd->prepare ($sql); - if (!($stm && $stm->execute ($values))) { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); - $this->bd->rollBack (); - return false; - } - $affected = $stm->rowCount(); - if ($affected > 0) { - $sql = 'UPDATE `' . $this->prefix . 'feed` f ' - . 'SET f.cache_nbUnreads=f.cache_nbUnreads-' . $affected - . ' WHERE f.id=?'; - $values = array ($id); - $stm = $this->bd->prepare ($sql); - if (!($stm && $stm->execute ($values))) { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); - $this->bd->rollBack (); - return false; - } - } + public function markReadCat($id, $idMax = 0) { + if ($idMax == 0) { + $idMax = time() . '000000'; + Minz_Log::record('Calling markReadCat(0) is deprecated!', Minz_Log::DEBUG); + } - $this->bd->commit (); - return $affected; + $sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed=f.id ' + . 'SET e.is_read=1 ' + . 'WHERE f.category=? AND e.is_read=0 AND e.id <= ?'; + $values = array($id, $idMax); + $stm = $this->bd->prepare($sql); + if (!($stm && $stm->execute($values))) { + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::record('SQL error markReadCat: ' . $info[2], Minz_Log::ERROR); + return false; + } + $affected = $stm->rowCount(); + if (($affected > 0) && (!$this->updateCacheUnreads($id, false))) { + return false; + } + return $affected; + } + + public function markReadFeed($id, $idMax = 0) { + if ($idMax == 0) { + $idMax = time() . '000000'; + Minz_Log::record('Calling markReadFeed(0) is deprecated!', Minz_Log::DEBUG); + } + $this->bd->beginTransaction(); + + $sql = 'UPDATE `' . $this->prefix . 'entry` ' + . 'SET is_read=1 ' + . 'WHERE id_feed=? AND is_read=0 AND id <= ?'; + $values = array($id, $idMax); + $stm = $this->bd->prepare($sql); + if (!($stm && $stm->execute($values))) { + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::record('SQL error markReadFeed: ' . $info[2], Minz_Log::ERROR); + $this->bd->rollBack(); + return false; + } + $affected = $stm->rowCount(); + + if ($affected > 0) { + $sql = 'UPDATE `' . $this->prefix . 'feed` ' + . 'SET cache_nbUnreads=cache_nbUnreads-' . $affected + . ' WHERE id=?'; + $values = array($id); + $stm = $this->bd->prepare($sql); + if (!($stm && $stm->execute($values))) { + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::record('SQL error markReadFeed: ' . $info[2], Minz_Log::ERROR); + $this->bd->rollBack(); + return false; + } } + + $this->bd->commit(); + return $affected; } - public function searchByGuid ($feed_id, $id) { + public function searchByGuid($feed_id, $id) { // un guid est unique pour un flux donné - $sql = 'SELECT id, guid, title, author, UNCOMPRESS(content_bin) AS content, link, date, is_read, is_favorite, id_feed, tags ' + $sql = 'SELECT id, guid, title, author, ' + . ($this->isCompressed() ? 'UNCOMPRESS(content_bin) AS content' : 'content') + . ', link, date, is_read, is_favorite, id_feed, tags ' . 'FROM `' . $this->prefix . 'entry` WHERE id_feed=? AND guid=?'; - $stm = $this->bd->prepare ($sql); + $stm = $this->bd->prepare($sql); - $values = array ( + $values = array( $feed_id, $id ); - $stm->execute ($values); - $res = $stm->fetchAll (PDO::FETCH_ASSOC); - $entries = self::daoToEntry ($res); - return isset ($entries[0]) ? $entries[0] : false; + $stm->execute($values); + $res = $stm->fetchAll(PDO::FETCH_ASSOC); + $entries = self::daoToEntry($res); + return isset($entries[0]) ? $entries[0] : null; } - public function searchById ($id) { - $sql = 'SELECT id, guid, title, author, UNCOMPRESS(content_bin) AS content, link, date, is_read, is_favorite, id_feed, tags ' + public function searchById($id) { + $sql = 'SELECT id, guid, title, author, ' + . ($this->isCompressed() ? 'UNCOMPRESS(content_bin) AS content' : 'content') + . ', link, date, is_read, is_favorite, id_feed, tags ' . 'FROM `' . $this->prefix . 'entry` WHERE id=?'; - $stm = $this->bd->prepare ($sql); + $stm = $this->bd->prepare($sql); + + $values = array($id); - $values = array ($id); + $stm->execute($values); + $res = $stm->fetchAll(PDO::FETCH_ASSOC); + $entries = self::daoToEntry($res); + return isset($entries[0]) ? $entries[0] : null; + } - $stm->execute ($values); - $res = $stm->fetchAll (PDO::FETCH_ASSOC); - $entries = self::daoToEntry ($res); - return isset ($entries[0]) ? $entries[0] : false; + protected function sqlConcat($s1, $s2) { + return 'CONCAT(' . $s1 . ',' . $s2 . ')'; //MySQL } - public function listWhere($type = 'a', $id = '', $state = 'all', $order = 'DESC', $limit = 1, $firstId = '', $filter = '', $date_min = 0, $keepHistoryDefault = 0) { + private function sqlListWhere($type = 'a', $id = '', $state = FreshRSS_Entry::STATE_ALL, $order = 'DESC', $limit = 1, $firstId = '', $filter = '', $date_min = 0, $showOlderUnreadsorFavorites = false, $keepHistoryDefault = 0) { + if (!$state) { + $state = FreshRSS_Entry::STATE_ALL; + } $where = ''; $joinFeed = false; $values = array(); @@ -269,185 +311,237 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo { $where .= 'f.priority > 0 '; $joinFeed = true; break; - case 's': - $where .= 'e1.is_favorite = 1 '; + case 's': //Deprecated: use $state instead + $where .= 'e1.is_favorite=1 '; break; case 'c': - $where .= 'f.category = ? '; + $where .= 'f.category=? '; $values[] = intval($id); $joinFeed = true; break; case 'f': - $where .= 'e1.id_feed = ? '; + $where .= 'e1.id_feed=? '; $values[] = intval($id); break; - default: - throw new FreshRSS_EntriesGetter_Exception ('Bad type in Entry->listByType: [' . $type . ']!'); - } - switch ($state) { - case 'all': - break; - case 'not_read': - $where .= 'AND e1.is_read = 0 '; - break; - case 'read': - $where .= 'AND e1.is_read = 1 '; - break; - case 'favorite': - $where .= 'AND e1.is_favorite = 1 '; + case 'A': + $where .= '1 '; break; default: - throw new FreshRSS_EntriesGetter_Exception ('Bad state in Entry->listByType: [' . $state . ']!'); + throw new FreshRSS_EntriesGetter_Exception('Bad type in Entry->listByType: [' . $type . ']!'); + } + + if ($state & FreshRSS_Entry::STATE_NOT_READ) { + if (!($state & FreshRSS_Entry::STATE_READ)) { + $where .= 'AND e1.is_read=0 '; + } elseif ($state & FreshRSS_Entry::STATE_STRICT) { + $where .= 'AND e1.is_read=0 '; + } + } + elseif ($state & FreshRSS_Entry::STATE_READ) { + $where .= 'AND e1.is_read=1 '; } + if ($state & FreshRSS_Entry::STATE_FAVORITE) { + if (!($state & FreshRSS_Entry::STATE_NOT_FAVORITE)) { + $where .= 'AND e1.is_favorite=1 '; + } + } + elseif ($state & FreshRSS_Entry::STATE_NOT_FAVORITE) { + $where .= 'AND e1.is_favorite=0 '; + } + switch ($order) { case 'DESC': case 'ASC': break; default: - throw new FreshRSS_EntriesGetter_Exception ('Bad order in Entry->listByType: [' . $order . ']!'); + throw new FreshRSS_EntriesGetter_Exception('Bad order in Entry->listByType: [' . $order . ']!'); + } + if ($firstId === '' && parent::$sharedDbType === 'mysql') { + $firstId = $order === 'DESC' ? '9000000000'. '000000' : '0'; //MySQL optimization. Tested on MySQL 5.5 with 150k articles } if ($firstId !== '') { $where .= 'AND e1.id ' . ($order === 'DESC' ? '<=' : '>=') . $firstId . ' '; } if (($date_min > 0) && ($type !== 's')) { - $where .= 'AND (e1.id >= ' . $date_min . '000000 OR e1.is_read = 0 OR e1.is_favorite = 1 OR (f.keep_history <> 0'; - if (intval($keepHistoryDefault) === 0) { - $where .= ' AND f.keep_history <> -2'; //default + $where .= 'AND (e1.id >= ' . $date_min . '000000'; + if ($showOlderUnreadsorFavorites) { //Lax date constraint + $where .= ' OR e1.is_read=0 OR e1.is_favorite=1 OR (f.keep_history <> 0'; + if (intval($keepHistoryDefault) === 0) { + $where .= ' AND f.keep_history <> -2'; //default + } + $where .= ')'; } - $where .= ')) '; + $where .= ') '; $joinFeed = true; } $search = ''; if ($filter !== '') { + require_once(LIB_PATH . '/lib_date.php'); $filter = trim($filter); $filter = addcslashes($filter, '\\%_'); - if (stripos($filter, 'intitle:') === 0) { - $filter = substr($filter, strlen('intitle:')); - $intitle = true; - } else { - $intitle = false; - } - if (stripos($filter, 'inurl:') === 0) { - $filter = substr($filter, strlen('inurl:')); - $inurl = true; - } else { - $inurl = false; - } - if (stripos($filter, 'author:') === 0) { - $filter = substr($filter, strlen('author:')); - $author = true; - } else { - $author = false; - } $terms = array_unique(explode(' ', $filter)); - sort($terms); //Put #tags first + //sort($terms); //Put #tags first //TODO: Put the cheapest filters first foreach ($terms as $word) { $word = trim($word); - if (strlen($word) > 0) { - if ($intitle) { - $search .= 'AND e1.title LIKE ? '; - $values[] = '%' . $word .'%'; - } elseif ($inurl) { - $search .= 'AND CONCAT(e1.link, e1.guid) LIKE ? '; - $values[] = '%' . $word .'%'; - } elseif ($author) { - $search .= 'AND e1.author LIKE ? '; + if (stripos($word, 'intitle:') === 0) { + $word = substr($word, strlen('intitle:')); + $search .= 'AND e1.title LIKE ? '; + $values[] = '%' . $word .'%'; + } elseif (stripos($word, 'inurl:') === 0) { + $word = substr($word, strlen('inurl:')); + $search .= 'AND CONCAT(e1.link, e1.guid) LIKE ? '; + $values[] = '%' . $word .'%'; + } elseif (stripos($word, 'author:') === 0) { + $word = substr($word, strlen('author:')); + $search .= 'AND e1.author LIKE ? '; + $values[] = '%' . $word .'%'; + } elseif (stripos($word, 'date:') === 0) { + $word = substr($word, strlen('date:')); + list($minDate, $maxDate) = parseDateInterval($word); + if ($minDate) { + $search .= 'AND e1.id >= ' . $minDate . '000000 '; + } + if ($maxDate) { + $search .= 'AND e1.id <= ' . $maxDate . '000000 '; + } + } elseif (stripos($word, 'pubdate:') === 0) { + $word = substr($word, strlen('pubdate:')); + list($minDate, $maxDate) = parseDateInterval($word); + if ($minDate) { + $search .= 'AND e1.date >= ' . $minDate . ' '; + } + if ($maxDate) { + $search .= 'AND e1.date <= ' . $maxDate . ' '; + } + } else { + if ($word[0] === '#' && isset($word[1])) { + $search .= 'AND e1.tags LIKE ? '; $values[] = '%' . $word .'%'; } else { - if ($word[0] === '#' && isset($word[1])) { - $search .= 'AND e1.tags LIKE ? '; - $values[] = '%' . $word .'%'; - } else { - $search .= 'AND CONCAT(e1.title, UNCOMPRESS(e1.content_bin)) LIKE ? '; - $values[] = '%' . $word .'%'; - } + $search .= 'AND ' . $this->sqlconcat('e1.title', $this->isCompressed() ? 'UNCOMPRESS(content_bin)' : 'content') . ' LIKE ? '; + $values[] = '%' . $word .'%'; } } } } - $sql = 'SELECT e.id, e.guid, e.title, e.author, UNCOMPRESS(e.content_bin) AS content, e.link, e.date, e.is_read, e.is_favorite, e.id_feed, e.tags ' + return array($values, + 'SELECT e1.id FROM `' . $this->prefix . 'entry` e1 ' + . ($joinFeed ? 'INNER JOIN `' . $this->prefix . 'feed` f ON e1.id_feed=f.id ' : '') + . 'WHERE ' . $where + . $search + . 'ORDER BY e1.id ' . $order + . ($limit > 0 ? ' LIMIT ' . $limit : '')); //TODO: See http://explainextended.com/2009/10/23/mysql-order-by-limit-performance-late-row-lookups/ + } + + public function listWhere($type = 'a', $id = '', $state = FreshRSS_Entry::STATE_ALL, $order = 'DESC', $limit = 1, $firstId = '', $filter = '', $date_min = 0, $showOlderUnreadsorFavorites = false, $keepHistoryDefault = 0) { + list($values, $sql) = $this->sqlListWhere($type, $id, $state, $order, $limit, $firstId, $filter, $date_min, $showOlderUnreadsorFavorites, $keepHistoryDefault); + + $sql = 'SELECT e.id, e.guid, e.title, e.author, ' + . ($this->isCompressed() ? 'UNCOMPRESS(content_bin) AS content' : 'content') + . ', e.link, e.date, e.is_read, e.is_favorite, e.id_feed, e.tags ' . 'FROM `' . $this->prefix . 'entry` e ' - . 'INNER JOIN (SELECT e1.id FROM `' . $this->prefix . 'entry` e1 ' - . ($joinFeed ? 'INNER JOIN `' . $this->prefix . 'feed` f ON e1.id_feed = f.id ' : '') - . 'WHERE ' . $where - . $search - . 'ORDER BY e1.id ' . $order - . ($limit > 0 ? ' LIMIT ' . $limit : '') //TODO: See http://explainextended.com/2009/10/23/mysql-order-by-limit-performance-late-row-lookups/ - . ') e2 ON e2.id = e.id ' + . 'INNER JOIN (' + . $sql + . ') e2 ON e2.id=e.id ' . 'ORDER BY e.id ' . $order; - $stm = $this->bd->prepare ($sql); - $stm->execute ($values); + $stm = $this->bd->prepare($sql); + $stm->execute($values); - return self::daoToEntry ($stm->fetchAll (PDO::FETCH_ASSOC)); + return self::daoToEntry($stm->fetchAll(PDO::FETCH_ASSOC)); + } + + public function listIdsWhere($type = 'a', $id = '', $state = FreshRSS_Entry::STATE_ALL, $order = 'DESC', $limit = 1, $firstId = '', $filter = '', $date_min = 0, $showOlderUnreadsorFavorites = false, $keepHistoryDefault = 0) { //For API + list($values, $sql) = $this->sqlListWhere($type, $id, $state, $order, $limit, $firstId, $filter, $date_min, $showOlderUnreadsorFavorites, $keepHistoryDefault); + + $stm = $this->bd->prepare($sql); + $stm->execute($values); + + return $stm->fetchAll(PDO::FETCH_COLUMN, 0); } public function listLastGuidsByFeed($id, $n) { $sql = 'SELECT guid FROM `' . $this->prefix . 'entry` WHERE id_feed=? ORDER BY id DESC LIMIT ' . intval($n); - $stm = $this->bd->prepare ($sql); - $values = array ($id); - $stm->execute ($values); - return $stm->fetchAll (PDO::FETCH_COLUMN, 0); + $stm = $this->bd->prepare($sql); + $values = array($id); + $stm->execute($values); + return $stm->fetchAll(PDO::FETCH_COLUMN, 0); } - public function countUnreadRead () { - $sql = 'SELECT COUNT(e.id) AS count FROM `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id WHERE priority > 0' - . ' UNION SELECT COUNT(e.id) AS count FROM `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id WHERE priority > 0 AND is_read = 0'; - $stm = $this->bd->prepare ($sql); - $stm->execute (); - $res = $stm->fetchAll (PDO::FETCH_COLUMN, 0); + public function countUnreadRead() { + $sql = 'SELECT COUNT(e.id) AS count FROM `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed=f.id WHERE priority > 0' + . ' UNION SELECT COUNT(e.id) AS count FROM `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed=f.id WHERE priority > 0 AND is_read=0'; + $stm = $this->bd->prepare($sql); + $stm->execute(); + $res = $stm->fetchAll(PDO::FETCH_COLUMN, 0); $all = empty($res[0]) ? 0 : $res[0]; $unread = empty($res[1]) ? 0 : $res[1]; return array('all' => $all, 'unread' => $unread, 'read' => $all - $unread); } - public function count ($minPriority = null) { - $sql = 'SELECT COUNT(e.id) AS count FROM `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id'; + public function count($minPriority = null) { + $sql = 'SELECT COUNT(e.id) AS count FROM `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed=f.id'; if ($minPriority !== null) { $sql = ' WHERE priority > ' . intval($minPriority); } - $stm = $this->bd->prepare ($sql); - $stm->execute (); - $res = $stm->fetchAll (PDO::FETCH_COLUMN, 0); + $stm = $this->bd->prepare($sql); + $stm->execute(); + $res = $stm->fetchAll(PDO::FETCH_COLUMN, 0); return $res[0]; } - public function countNotRead ($minPriority = null) { - $sql = 'SELECT COUNT(e.id) AS count FROM `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id WHERE is_read = 0'; + public function countNotRead($minPriority = null) { + $sql = 'SELECT COUNT(e.id) AS count FROM `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed=f.id WHERE is_read=0'; if ($minPriority !== null) { $sql = ' AND priority > ' . intval($minPriority); } - $stm = $this->bd->prepare ($sql); - $stm->execute (); - $res = $stm->fetchAll (PDO::FETCH_COLUMN, 0); + $stm = $this->bd->prepare($sql); + $stm->execute(); + $res = $stm->fetchAll(PDO::FETCH_COLUMN, 0); return $res[0]; } - public function countUnreadReadFavorites () { - $sql = 'SELECT COUNT(id) FROM `' . $this->prefix . 'entry` WHERE is_favorite=1' - . ' UNION SELECT COUNT(id) FROM `' . $this->prefix . 'entry` WHERE is_favorite=1 AND is_read = 0'; - $stm = $this->bd->prepare ($sql); - $stm->execute (); - $res = $stm->fetchAll (PDO::FETCH_COLUMN, 0); + public function countUnreadReadFavorites() { + $sql = 'SELECT c FROM (' + . 'SELECT COUNT(id) AS c, 1 as o FROM `' . $this->prefix . 'entry` WHERE is_favorite=1 ' + . 'UNION SELECT COUNT(id) AS c, 2 AS o FROM `' . $this->prefix . 'entry` WHERE is_favorite=1 AND is_read=0' + . ') u ORDER BY o'; + $stm = $this->bd->prepare($sql); + $stm->execute(); + $res = $stm->fetchAll(PDO::FETCH_COLUMN, 0); $all = empty($res[0]) ? 0 : $res[0]; $unread = empty($res[1]) ? 0 : $res[1]; return array('all' => $all, 'unread' => $unread, 'read' => $all - $unread); } public function optimizeTable() { - $sql = 'OPTIMIZE TABLE `' . $this->prefix . 'entry`'; - $stm = $this->bd->prepare ($sql); - $stm->execute (); + $sql = 'OPTIMIZE TABLE `' . $this->prefix . 'entry`'; //MySQL + $stm = $this->bd->prepare($sql); + $stm->execute(); + } + + public function size($all = false) { + $db = Minz_Configuration::dataBase(); + $sql = 'SELECT SUM(data_length + index_length) FROM information_schema.TABLES WHERE table_schema=?'; //MySQL + $values = array($db['base']); + if (!$all) { + $sql .= ' AND table_name LIKE ?'; + $values[] = $this->prefix . '%'; + } + $stm = $this->bd->prepare($sql); + $stm->execute($values); + $res = $stm->fetchAll(PDO::FETCH_COLUMN, 0); + return $res[0]; } - public static function daoToEntry ($listDAO) { - $list = array (); + public static function daoToEntry($listDAO) { + $list = array(); - if (!is_array ($listDAO)) { - $listDAO = array ($listDAO); + if (!is_array($listDAO)) { + $listDAO = array($listDAO); } foreach ($listDAO as $key => $dao) { - $entry = new FreshRSS_Entry ( + $entry = new FreshRSS_Entry( $dao['id_feed'], $dao['guid'], $dao['title'], @@ -459,13 +553,13 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo { $dao['is_favorite'], $dao['tags'] ); - if (isset ($dao['id'])) { - $entry->_id ($dao['id']); + if (isset($dao['id'])) { + $entry->_id($dao['id']); } $list[] = $entry; } - unset ($listDAO); + unset($listDAO); return $list; } diff --git a/app/Models/EntryDAOSQLite.php b/app/Models/EntryDAOSQLite.php new file mode 100644 index 000000000..9dc395c3c --- /dev/null +++ b/app/Models/EntryDAOSQLite.php @@ -0,0 +1,129 @@ +<?php + +class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO { + + protected function sqlConcat($s1, $s2) { + return $s1 . '||' . $s2; + } + + protected function updateCacheUnreads($catId = false, $feedId = false) { + $sql = 'UPDATE `' . $this->prefix . 'feed` ' + . 'SET cache_nbUnreads=(' + . 'SELECT COUNT(*) AS nbUnreads FROM `' . $this->prefix . 'entry` e ' + . 'WHERE e.id_feed=`' . $this->prefix . 'feed`.id AND e.is_read=0) ' + . 'WHERE 1'; + $values = array(); + if ($feedId !== false) { + $sql .= ' AND id=?'; + $values[] = $feedId; + } + if ($catId !== false) { + $sql .= ' AND category=?'; + $values[] = $catId; + } + $stm = $this->bd->prepare($sql); + if ($stm && $stm->execute($values)) { + return true; + } else { + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::record('SQL error updateCacheUnreads: ' . $info[2], Minz_Log::ERROR); + return false; + } + } + + public function markRead($ids, $is_read = true) { + if (is_array($ids)) { //Many IDs at once (used by API) + if (true) { //Speed heuristics //TODO: Not implemented yet for SQLite (so always call IDs one by one) + $affected = 0; + foreach ($ids as $id) { + $affected += $this->markRead($id, $is_read); + } + return $affected; + } + } else { + $this->bd->beginTransaction(); + $sql = 'UPDATE `' . $this->prefix . 'entry` SET is_read=? WHERE id=? AND is_read=?'; + $values = array($is_read ? 1 : 0, $ids, $is_read ? 0 : 1); + $stm = $this->bd->prepare($sql); + if (!($stm && $stm->execute($values))) { + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::record('SQL error markRead 1: ' . $info[2], Minz_Log::ERROR); + $this->bd->rollBack(); + return false; + } + $affected = $stm->rowCount(); + if ($affected > 0) { + $sql = 'UPDATE `' . $this->prefix . 'feed` SET cache_nbUnreads=cache_nbUnreads' . ($is_read ? '-' : '+') . '1 ' + . 'WHERE id=(SELECT e.id_feed FROM `' . $this->prefix . 'entry` e WHERE e.id=?)'; + $values = array($ids); + $stm = $this->bd->prepare($sql); + if (!($stm && $stm->execute($values))) { + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::record('SQL error markRead 2: ' . $info[2], Minz_Log::ERROR); + $this->bd->rollBack(); + return false; + } + } + $this->bd->commit(); + return $affected; + } + } + + public function markReadEntries($idMax = 0, $onlyFavorites = false, $priorityMin = 0) { + if ($idMax == 0) { + $idMax = time() . '000000'; + Minz_Log::record('Calling markReadEntries(0) is deprecated!', Minz_Log::DEBUG); + } + + $sql = 'UPDATE `' . $this->prefix . 'entry` SET is_read=1 WHERE is_read=0 AND id <= ?'; + if ($onlyFavorites) { + $sql .= ' AND is_favorite=1'; + } elseif ($priorityMin >= 0) { + $sql .= ' AND id_feed IN (SELECT f.id FROM `' . $this->prefix . 'feed` f WHERE f.priority > ' . intval($priorityMin) . ')'; + } + $values = array($idMax); + $stm = $this->bd->prepare($sql); + if (!($stm && $stm->execute($values))) { + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::record('SQL error markReadEntries: ' . $info[2], Minz_Log::ERROR); + return false; + } + $affected = $stm->rowCount(); + if (($affected > 0) && (!$this->updateCacheUnreads(false, false))) { + return false; + } + return $affected; + } + + public function markReadCat($id, $idMax = 0) { + if ($idMax == 0) { + $idMax = time() . '000000'; + Minz_Log::record('Calling markReadCat(0) is deprecated!', Minz_Log::DEBUG); + } + + $sql = 'UPDATE `' . $this->prefix . 'entry` ' + . 'SET is_read=1 ' + . 'WHERE is_read=0 AND id <= ? AND ' + . 'id_feed IN (SELECT f.id FROM `' . $this->prefix . 'feed` f WHERE f.category=?)'; + $values = array($idMax, $id); + $stm = $this->bd->prepare($sql); + if (!($stm && $stm->execute($values))) { + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::record('SQL error markReadCat: ' . $info[2], Minz_Log::ERROR); + return false; + } + $affected = $stm->rowCount(); + if (($affected > 0) && (!$this->updateCacheUnreads($id, false))) { + return false; + } + return $affected; + } + + public function optimizeTable() { + //TODO: Search for an equivalent in SQLite + } + + public function size($all = false) { + return @filesize(DATA_PATH . '/' . Minz_Session::param('currentUser', '_') . '.sqlite'); + } +} diff --git a/app/Models/Factory.php b/app/Models/Factory.php new file mode 100644 index 000000000..08569b2e2 --- /dev/null +++ b/app/Models/Factory.php @@ -0,0 +1,32 @@ +<?php + +class FreshRSS_Factory { + + public static function createFeedDao() { + $db = Minz_Configuration::dataBase(); + if ($db['type'] === 'sqlite') { + return new FreshRSS_FeedDAOSQLite(); + } else { + return new FreshRSS_FeedDAO(); + } + } + + public static function createEntryDao() { + $db = Minz_Configuration::dataBase(); + if ($db['type'] === 'sqlite') { + return new FreshRSS_EntryDAOSQLite(); + } else { + return new FreshRSS_EntryDAO(); + } + } + + public static function createStatsDAO() { + $db = Minz_Configuration::dataBase(); + if ($db['type'] === 'sqlite') { + return new FreshRSS_StatsDAOSQLite(); + } else { + return new FreshRSS_StatsDAO(); + } + } + +} diff --git a/app/Models/Feed.php b/app/Models/Feed.php index 73f9c32fb..2a5ea45ac 100644 --- a/app/Models/Feed.php +++ b/app/Models/Feed.php @@ -16,17 +16,25 @@ class FreshRSS_Feed extends Minz_Model { private $httpAuth = ''; private $error = false; private $keep_history = -2; + private $ttl = -2; private $hash = null; + private $lockPath = ''; - public function __construct ($url, $validate=true) { + public function __construct($url, $validate=true) { if ($validate) { - $this->_url ($url); + $this->_url($url); } else { $this->url = $url; } } - public function id () { + public static function example() { + $f = new FreshRSS_Feed('http://example.net/', false); + $f->faviconPrepare(); + return $f; + } + + public function id() { return $this->id; } @@ -37,74 +45,77 @@ class FreshRSS_Feed extends Minz_Model { return $this->hash; } - public function url () { + public function url() { return $this->url; } - public function category () { + public function category() { return $this->category; } - public function entries () { + public function entries() { return $this->entries === null ? array() : $this->entries; } - public function name () { + public function name() { return $this->name; } - public function website () { + public function website() { return $this->website; } - public function description () { + public function description() { return $this->description; } - public function lastUpdate () { + public function lastUpdate() { return $this->lastUpdate; } - public function priority () { + public function priority() { return $this->priority; } - public function pathEntries () { + public function pathEntries() { return $this->pathEntries; } - public function httpAuth ($raw = true) { + public function httpAuth($raw = true) { if ($raw) { return $this->httpAuth; } else { - $pos_colon = strpos ($this->httpAuth, ':'); - $user = substr ($this->httpAuth, 0, $pos_colon); - $pass = substr ($this->httpAuth, $pos_colon + 1); + $pos_colon = strpos($this->httpAuth, ':'); + $user = substr($this->httpAuth, 0, $pos_colon); + $pass = substr($this->httpAuth, $pos_colon + 1); - return array ( + return array( 'username' => $user, 'password' => $pass ); } } - public function inError () { + public function inError() { return $this->error; } - public function keepHistory () { + public function keepHistory() { return $this->keep_history; } - public function nbEntries () { + public function ttl() { + return $this->ttl; + } + public function nbEntries() { if ($this->nbEntries < 0) { - $feedDAO = new FreshRSS_FeedDAO (); - $this->nbEntries = $feedDAO->countEntries ($this->id ()); + $feedDAO = FreshRSS_Factory::createFeedDao(); + $this->nbEntries = $feedDAO->countEntries($this->id()); } return $this->nbEntries; } - public function nbNotRead () { + public function nbNotRead() { if ($this->nbNotRead < 0) { - $feedDAO = new FreshRSS_FeedDAO (); - $this->nbNotRead = $feedDAO->countNotRead ($this->id ()); + $feedDAO = FreshRSS_Factory::createFeedDao(); + $this->nbNotRead = $feedDAO->countNotRead($this->id()); } return $this->nbNotRead; } public function faviconPrepare() { $file = DATA_PATH . '/favicons/' . $this->hash() . '.txt'; - if (!file_exists ($file)) { + if (!file_exists($file)) { $t = $this->website; - if (empty($t)) { + if ($t == '') { $t = $this->url; } file_put_contents($file, $t); @@ -115,109 +126,123 @@ class FreshRSS_Feed extends Minz_Model { @unlink($path . '.ico'); @unlink($path . '.txt'); } - public function favicon () { - return Minz_Url::display ('/f.php?' . $this->hash()); + public function favicon() { + return Minz_Url::display('/f.php?' . $this->hash()); } - public function _id ($value) { + public function _id($value) { $this->id = $value; } - public function _url ($value, $validate=true) { + public function _url($value, $validate=true) { + $this->hash = null; if ($validate) { $value = checkUrl($value); } - if (empty ($value)) { - throw new FreshRSS_BadUrl_Exception ($value); + if (empty($value)) { + throw new FreshRSS_BadUrl_Exception($value); } $this->url = $value; } - public function _category ($value) { + public function _category($value) { $value = intval($value); $this->category = $value >= 0 ? $value : 0; } - public function _name ($value) { + public function _name($value) { $this->name = $value === null ? '' : $value; } - public function _website ($value, $validate=true) { + public function _website($value, $validate=true) { if ($validate) { $value = checkUrl($value); } - if (empty ($value)) { + if (empty($value)) { $value = ''; } $this->website = $value; } - public function _description ($value) { + public function _description($value) { $this->description = $value === null ? '' : $value; } - public function _lastUpdate ($value) { + public function _lastUpdate($value) { $this->lastUpdate = $value; } - public function _priority ($value) { + public function _priority($value) { $value = intval($value); $this->priority = $value >= 0 ? $value : 10; } - public function _pathEntries ($value) { + public function _pathEntries($value) { $this->pathEntries = $value; } - public function _httpAuth ($value) { + public function _httpAuth($value) { $this->httpAuth = $value; } - public function _error ($value) { + public function _error($value) { $this->error = (bool)$value; } - public function _keepHistory ($value) { + public function _keepHistory($value) { $value = intval($value); $value = min($value, 1000000); $value = max($value, -2); $this->keep_history = $value; } - public function _nbNotRead ($value) { + public function _ttl($value) { + $value = intval($value); + $value = min($value, 100000000); + $value = max($value, -2); + $this->ttl = $value; + } + public function _nbNotRead($value) { $this->nbNotRead = intval($value); } - public function _nbEntries ($value) { + public function _nbEntries($value) { $this->nbEntries = intval($value); } - public function load ($loadDetails = false) { + public function load($loadDetails = false) { if ($this->url !== null) { if (CACHE_PATH === false) { - throw new Minz_FileNotExistException ( + throw new Minz_FileNotExistException( 'CACHE_PATH', Minz_Exception::ERROR ); } else { - $url = htmlspecialchars_decode ($this->url, ENT_QUOTES); + $url = htmlspecialchars_decode($this->url, ENT_QUOTES); if ($this->httpAuth != '') { - $url = preg_replace ('#((.+)://)(.+)#', '${1}' . $this->httpAuth . '@${3}', $url); + $url = preg_replace('#((.+)://)(.+)#', '${1}' . $this->httpAuth . '@${3}', $url); } $feed = customSimplePie(); - $feed->set_feed_url ($url); + $feed->set_feed_url($url); + if (!$loadDetails) { //Only activates auto-discovery when adding a new feed + $feed->set_autodiscovery_level(SIMPLEPIE_LOCATOR_NONE); + } $mtime = $feed->init(); if ((!$mtime) || $feed->error()) { - throw new FreshRSS_Feed_Exception ($feed->error() . ' [' . $url . ']'); - } - - // si on a utilisé l'auto-discover, notre url va avoir changé - $subscribe_url = $feed->subscribe_url (); - if ($subscribe_url !== null && $subscribe_url !== $this->url) { - if ($this->httpAuth != '') { - // on enlève les id si authentification HTTP - $subscribe_url = preg_replace ('#((.+)://)((.+)@)(.+)#', '${1}${5}', $subscribe_url); - } - $this->_url ($subscribe_url); + throw new FreshRSS_Feed_Exception($feed->error() . ' [' . $url . ']'); } if ($loadDetails) { - $title = htmlspecialchars(html_only_entity_decode($feed->get_title()), ENT_COMPAT, 'UTF-8'); - $this->_name ($title === null ? $this->url : $title); + // si on a utilisé l'auto-discover, notre url va avoir changé + $subscribe_url = $feed->subscribe_url(false); + + $title = strtr(html_only_entity_decode($feed->get_title()), array('<' => '<', '>' => '>', '"' => '"')); //HTML to HTML-PRE //ENT_COMPAT except & + $this->_name($title == '' ? $this->url : $title); $this->_website(html_only_entity_decode($feed->get_link())); $this->_description(html_only_entity_decode($feed->get_description())); + } else { + //The case of HTTP 301 Moved Permanently + $subscribe_url = $feed->subscribe_url(true); } - if (($mtime === true) || ($mtime > $this->lastUpdate)) { + if ($subscribe_url !== null && $subscribe_url !== $this->url) { + if ($this->httpAuth != '') { + // on enlève les id si authentification HTTP + $subscribe_url = preg_replace('#((.+)://)((.+)@)(.+)#', '${1}${5}', $subscribe_url); + } + $this->_url($subscribe_url); + } + + if (($mtime === true) ||($mtime > $this->lastUpdate)) { syslog(LOG_DEBUG, 'FreshRSS no cache ' . $mtime . ' > ' . $this->lastUpdate . ' for ' . $subscribe_url); $this->loadEntries($feed); // et on charge les articles du flux } else { @@ -231,47 +256,52 @@ class FreshRSS_Feed extends Minz_Model { } } - private function loadEntries ($feed) { - $entries = array (); + private function loadEntries($feed) { + $entries = array(); - foreach ($feed->get_items () as $item) { - $title = html_only_entity_decode (strip_tags ($item->get_title ())); - $author = $item->get_author (); - $link = $item->get_permalink (); - $date = @strtotime ($item->get_date ()); + foreach ($feed->get_items() as $item) { + $title = html_only_entity_decode(strip_tags($item->get_title())); + $author = $item->get_author(); + $link = $item->get_permalink(); + $date = @strtotime($item->get_date()); // gestion des tags (catégorie == tag) - $tags_tmp = $item->get_categories (); - $tags = array (); + $tags_tmp = $item->get_categories(); + $tags = array(); if ($tags_tmp !== null) { foreach ($tags_tmp as $tag) { - $tags[] = html_only_entity_decode ($tag->get_label ()); + $tags[] = html_only_entity_decode($tag->get_label()); } } - $content = html_only_entity_decode ($item->get_content ()); + $content = html_only_entity_decode($item->get_content()); $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 .= '<br /><img src="' . $elink . '" alt="" />'; + if (empty($elinks[$elink])) { + $elinks[$elink] = '1'; + $mime = strtolower($enclosure->get_type()); + if (strpos($mime, 'image/') === 0) { + $content .= '<br /><img lazyload="" postpone="" src="' . $elink . '" alt="" />'; + } elseif (strpos($mime, 'audio/') === 0) { + $content .= '<br /><audio lazyload="" postpone="" preload="none" src="' . $elink . '" controls="controls" />'; + } elseif (strpos($mime, 'video/') === 0) { + $content .= '<br /><video lazyload="" postpone="" preload="none" src="' . $elink . '" controls="controls" />'; + } } } - $entry = new FreshRSS_Entry ( - $this->id (), - $item->get_id (), + $entry = new FreshRSS_Entry( + $this->id(), + $item->get_id(), $title === null ? '' : $title, - $author === null ? '' : html_only_entity_decode ($author->name), + $author === null ? '' : html_only_entity_decode($author->name), $content === null ? '' : $content, $link === null ? '' : $link, - $date ? $date : time () + $date ? $date : time() ); - $entry->_tags ($tags); + $entry->_tags($tags); // permet de récupérer le contenu des flux tronqués $entry->loadCompleteContent($this->pathEntries()); @@ -283,20 +313,19 @@ class FreshRSS_Feed extends Minz_Model { } function lock() { - $lock = TMP_PATH . '/' . md5(Minz_Configuration::salt() . $this->url) . '.freshrss.lock'; - if (file_exists($lock) && ((time() - @filemtime($lock)) > 3600)) { - @unlink($lock); + $this->lockPath = TMP_PATH . '/' . $this->hash() . '.freshrss.lock'; + if (file_exists($this->lockPath) && ((time() - @filemtime($this->lockPath)) > 3600)) { + @unlink($this->lockPath); } - if (($handle = @fopen($lock, 'x')) === false) { + if (($handle = @fopen($this->lockPath, 'x')) === false) { return false; } - //register_shutdown_function('unlink', $lock); + //register_shutdown_function('unlink', $this->lockPath); @fclose($handle); return true; } function unlock() { - $lock = TMP_PATH . '/' . md5(Minz_Configuration::salt() . $this->url) . '.freshrss.lock'; - @unlink($lock); + @unlink($this->lockPath); } } diff --git a/app/Models/FeedDAO.php b/app/Models/FeedDAO.php index 7ebe68d2b..b89ae2045 100644 --- a/app/Models/FeedDAO.php +++ b/app/Models/FeedDAO.php @@ -1,244 +1,279 @@ <?php class FreshRSS_FeedDAO extends Minz_ModelPdo { - public function addFeed ($valuesTmp) { - $sql = 'INSERT INTO `' . $this->prefix . 'feed` (url, category, name, website, description, lastUpdate, priority, httpAuth, error, keep_history) VALUES(?, ?, ?, ?, ?, ?, 10, ?, 0, -2)'; - $stm = $this->bd->prepare ($sql); + public function addFeed($valuesTmp) { + $sql = 'INSERT INTO `' . $this->prefix . 'feed` (url, category, name, website, description, lastUpdate, priority, httpAuth, error, keep_history, ttl) VALUES(?, ?, ?, ?, ?, ?, 10, ?, 0, -2, -2)'; + $stm = $this->bd->prepare($sql); - $values = array ( + $values = array( substr($valuesTmp['url'], 0, 511), $valuesTmp['category'], substr($valuesTmp['name'], 0, 255), substr($valuesTmp['website'], 0, 255), substr($valuesTmp['description'], 0, 1023), $valuesTmp['lastUpdate'], - base64_encode ($valuesTmp['httpAuth']), + base64_encode($valuesTmp['httpAuth']), ); - if ($stm && $stm->execute ($values)) { + if ($stm && $stm->execute($values)) { return $this->bd->lastInsertId(); } else { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::record('SQL error addFeed: ' . $info[2], Minz_Log::ERROR); return false; } } - public function updateFeed ($id, $valuesTmp) { + public function addFeedObject($feed) { + // TODO: not sure if we should write this method in DAO since DAO + // should not be aware about feed class + + // Add feed only if we don't find it in DB + $feed_search = $this->searchByUrl($feed->url()); + if (!$feed_search) { + $values = array( + 'id' => $feed->id(), + 'url' => $feed->url(), + 'category' => $feed->category(), + 'name' => $feed->name(), + 'website' => $feed->website(), + 'description' => $feed->description(), + 'lastUpdate' => 0, + 'httpAuth' => $feed->httpAuth() + ); + + $id = $this->addFeed($values); + if ($id) { + $feed->_id($id); + $feed->faviconPrepare(); + } + + return $id; + } + + return $feed_search->id(); + } + + public function updateFeed($id, $valuesTmp) { $set = ''; foreach ($valuesTmp as $key => $v) { $set .= $key . '=?, '; if ($key == 'httpAuth') { - $valuesTmp[$key] = base64_encode ($v); + $valuesTmp[$key] = base64_encode($v); } } - $set = substr ($set, 0, -2); + $set = substr($set, 0, -2); $sql = 'UPDATE `' . $this->prefix . 'feed` SET ' . $set . ' WHERE id=?'; - $stm = $this->bd->prepare ($sql); + $stm = $this->bd->prepare($sql); foreach ($valuesTmp as $v) { $values[] = $v; } $values[] = $id; - if ($stm && $stm->execute ($values)) { + if ($stm && $stm->execute($values)) { return $stm->rowCount(); } else { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::record('SQL error updateFeed: ' . $info[2], Minz_Log::ERROR); return false; } } - public function updateLastUpdate ($id, $inError = 0, $updateCache = true) { + public function updateLastUpdate($id, $inError = 0, $updateCache = true) { if ($updateCache) { - $sql = 'UPDATE `' . $this->prefix . 'feed` f ' //2 sub-requests with FOREIGN KEY(e.id_feed), INDEX(e.is_read) faster than 1 request with GROUP BY or CASE - . 'SET f.cache_nbEntries=(SELECT COUNT(e1.id) FROM `' . $this->prefix . 'entry` e1 WHERE e1.id_feed=f.id),' - . 'f.cache_nbUnreads=(SELECT COUNT(e2.id) FROM `' . $this->prefix . 'entry` e2 WHERE e2.id_feed=f.id AND e2.is_read=0),' + $sql = 'UPDATE `' . $this->prefix . 'feed` ' //2 sub-requests with FOREIGN KEY(e.id_feed), INDEX(e.is_read) faster than 1 request with GROUP BY or CASE + . 'SET cache_nbEntries=(SELECT COUNT(e1.id) FROM `' . $this->prefix . 'entry` e1 WHERE e1.id_feed=`' . $this->prefix . 'feed`.id),' + . 'cache_nbUnreads=(SELECT COUNT(e2.id) FROM `' . $this->prefix . 'entry` e2 WHERE e2.id_feed=`' . $this->prefix . 'feed`.id AND e2.is_read=0),' . 'lastUpdate=?, error=? ' - . 'WHERE f.id=?'; + . 'WHERE id=?'; } else { - $sql = 'UPDATE `' . $this->prefix . 'feed` f ' + $sql = 'UPDATE `' . $this->prefix . 'feed` ' . 'SET lastUpdate=?, error=? ' - . 'WHERE f.id=?'; + . 'WHERE id=?'; } - $values = array ( + $values = array( time(), $inError, $id, ); - $stm = $this->bd->prepare ($sql); + $stm = $this->bd->prepare($sql); - if ($stm && $stm->execute ($values)) { + if ($stm && $stm->execute($values)) { return $stm->rowCount(); } else { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::record('SQL error updateLastUpdate: ' . $info[2], Minz_Log::ERROR); return false; } } - public function changeCategory ($idOldCat, $idNewCat) { - $catDAO = new FreshRSS_CategoryDAO (); - $newCat = $catDAO->searchById ($idNewCat); + public function changeCategory($idOldCat, $idNewCat) { + $catDAO = new FreshRSS_CategoryDAO(); + $newCat = $catDAO->searchById($idNewCat); if (!$newCat) { - $newCat = $catDAO->getDefault (); + $newCat = $catDAO->getDefault(); } $sql = 'UPDATE `' . $this->prefix . 'feed` SET category=? WHERE category=?'; - $stm = $this->bd->prepare ($sql); + $stm = $this->bd->prepare($sql); - $values = array ( - $newCat->id (), + $values = array( + $newCat->id(), $idOldCat ); - if ($stm && $stm->execute ($values)) { + if ($stm && $stm->execute($values)) { return $stm->rowCount(); } else { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::record('SQL error changeCategory: ' . $info[2], Minz_Log::ERROR); return false; } } - public function deleteFeed ($id) { - /*//For MYISAM (MySQL 5.5-) without FOREIGN KEY - $sql = 'DELETE FROM `' . $this->prefix . 'entry` WHERE id_feed=?'; - $stm = $this->bd->prepare ($sql); - $values = array ($id); - if (!($stm && $stm->execute ($values))) { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); - return false; - }*/ - + public function deleteFeed($id) { $sql = 'DELETE FROM `' . $this->prefix . 'feed` WHERE id=?'; - $stm = $this->bd->prepare ($sql); + $stm = $this->bd->prepare($sql); - $values = array ($id); + $values = array($id); - if ($stm && $stm->execute ($values)) { + if ($stm && $stm->execute($values)) { return $stm->rowCount(); } else { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::record('SQL error deleteFeed: ' . $info[2], Minz_Log::ERROR); return false; } } - public function deleteFeedByCategory ($id) { - /*//For MYISAM (MySQL 5.5-) without FOREIGN KEY - $sql = 'DELETE FROM `' . $this->prefix . 'entry` e ' - . 'INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id ' - . 'WHERE f.category=?'; - $stm = $this->bd->prepare ($sql); - $values = array ($id); - if (!($stm && $stm->execute ($values))) { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); - return false; - }*/ - + public function deleteFeedByCategory($id) { $sql = 'DELETE FROM `' . $this->prefix . 'feed` WHERE category=?'; - $stm = $this->bd->prepare ($sql); + $stm = $this->bd->prepare($sql); - $values = array ($id); + $values = array($id); - if ($stm && $stm->execute ($values)) { + if ($stm && $stm->execute($values)) { return $stm->rowCount(); } else { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::record('SQL error deleteFeedByCategory: ' . $info[2], Minz_Log::ERROR); return false; } } - public function searchById ($id) { + public function searchById($id) { $sql = 'SELECT * FROM `' . $this->prefix . 'feed` WHERE id=?'; - $stm = $this->bd->prepare ($sql); + $stm = $this->bd->prepare($sql); - $values = array ($id); + $values = array($id); - $stm->execute ($values); - $res = $stm->fetchAll (PDO::FETCH_ASSOC); - $feed = self::daoToFeed ($res); + $stm->execute($values); + $res = $stm->fetchAll(PDO::FETCH_ASSOC); + $feed = self::daoToFeed($res); - if (isset ($feed[$id])) { + if (isset($feed[$id])) { return $feed[$id]; } else { - return false; + return null; } } - public function searchByUrl ($url) { + public function searchByUrl($url) { $sql = 'SELECT * FROM `' . $this->prefix . 'feed` WHERE url=?'; - $stm = $this->bd->prepare ($sql); + $stm = $this->bd->prepare($sql); - $values = array ($url); + $values = array($url); - $stm->execute ($values); - $res = $stm->fetchAll (PDO::FETCH_ASSOC); - $feed = current (self::daoToFeed ($res)); + $stm->execute($values); + $res = $stm->fetchAll(PDO::FETCH_ASSOC); + $feed = current(self::daoToFeed($res)); - if (isset ($feed)) { + if (isset($feed)) { return $feed; } else { - return false; + return null; } } - public function listFeeds () { + public function listFeeds() { $sql = 'SELECT * FROM `' . $this->prefix . 'feed` ORDER BY name'; - $stm = $this->bd->prepare ($sql); - $stm->execute (); + $stm = $this->bd->prepare($sql); + $stm->execute(); - return self::daoToFeed ($stm->fetchAll (PDO::FETCH_ASSOC)); + return self::daoToFeed($stm->fetchAll(PDO::FETCH_ASSOC)); } - public function listFeedsOrderUpdate ($cacheDuration = 1500) { - $sql = 'SELECT id, name, url, lastUpdate, pathEntries, httpAuth, keep_history ' + public function arrayFeedCategoryNames() { //For API + $sql = 'SELECT f.id, f.name, c.name as c_name FROM `' . $this->prefix . 'feed` f ' + . 'INNER JOIN `' . $this->prefix . 'category` c ON c.id = f.category'; + $stm = $this->bd->prepare($sql); + $stm->execute(); + $res = $stm->fetchAll(PDO::FETCH_ASSOC); + $feedCategoryNames = array(); + foreach ($res as $line) { + $feedCategoryNames[$line['id']] = array( + 'name' => $line['name'], + 'c_name' => $line['c_name'], + ); + } + return $feedCategoryNames; + } + + public function listFeedsOrderUpdate($defaultCacheDuration = 3600) { + if ($defaultCacheDuration < 0) { + $defaultCacheDuration = 2147483647; + } + $sql = 'SELECT id, url, name, website, lastUpdate, pathEntries, httpAuth, keep_history, ttl ' . 'FROM `' . $this->prefix . 'feed` ' - . 'WHERE lastUpdate < ' . (time() - intval($cacheDuration)) - . ' ORDER BY lastUpdate'; - $stm = $this->bd->prepare ($sql); - $stm->execute (); + . 'WHERE ttl <> -1 AND lastUpdate < (' . (time() + 60) . '-(CASE WHEN ttl=-2 THEN ' . intval($defaultCacheDuration) . ' ELSE ttl END)) ' + . 'ORDER BY lastUpdate'; + $stm = $this->bd->prepare($sql); + if (!($stm && $stm->execute())) { + $sql2 = 'ALTER TABLE `' . $this->prefix . 'feed` ADD COLUMN ttl INT NOT NULL DEFAULT -2'; //v0.7.3 + $stm = $this->bd->prepare($sql2); + $stm->execute(); + $stm = $this->bd->prepare($sql); + $stm->execute(); + } - return self::daoToFeed ($stm->fetchAll (PDO::FETCH_ASSOC)); + return self::daoToFeed($stm->fetchAll(PDO::FETCH_ASSOC)); } - public function listByCategory ($cat) { + public function listByCategory($cat) { $sql = 'SELECT * FROM `' . $this->prefix . 'feed` WHERE category=? ORDER BY name'; - $stm = $this->bd->prepare ($sql); + $stm = $this->bd->prepare($sql); - $values = array ($cat); + $values = array($cat); - $stm->execute ($values); + $stm->execute($values); - return self::daoToFeed ($stm->fetchAll (PDO::FETCH_ASSOC)); + return self::daoToFeed($stm->fetchAll(PDO::FETCH_ASSOC)); } - public function countEntries ($id) { + public function countEntries($id) { $sql = 'SELECT COUNT(*) AS count FROM `' . $this->prefix . 'entry` WHERE id_feed=?'; - $stm = $this->bd->prepare ($sql); - $values = array ($id); - $stm->execute ($values); - $res = $stm->fetchAll (PDO::FETCH_ASSOC); + $stm = $this->bd->prepare($sql); + $values = array($id); + $stm->execute($values); + $res = $stm->fetchAll(PDO::FETCH_ASSOC); return $res[0]['count']; } - public function countNotRead ($id) { + + public function countNotRead($id) { $sql = 'SELECT COUNT(*) AS count FROM `' . $this->prefix . 'entry` WHERE id_feed=? AND is_read=0'; - $stm = $this->bd->prepare ($sql); - $values = array ($id); - $stm->execute ($values); - $res = $stm->fetchAll (PDO::FETCH_ASSOC); + $stm = $this->bd->prepare($sql); + $values = array($id); + $stm->execute($values); + $res = $stm->fetchAll(PDO::FETCH_ASSOC); return $res[0]['count']; } - public function updateCachedValues () { //For one single feed, call updateLastUpdate($id) + + public function updateCachedValues() { //For one single feed, call updateLastUpdate($id) $sql = 'UPDATE `' . $this->prefix . 'feed` f ' . 'INNER JOIN (' . 'SELECT e.id_feed, ' @@ -248,80 +283,78 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo { . 'GROUP BY e.id_feed' . ') x ON x.id_feed=f.id ' . 'SET f.cache_nbEntries=x.nbEntries, f.cache_nbUnreads=x.nbUnreads'; - $stm = $this->bd->prepare ($sql); - - $values = array ($feed_id); + $stm = $this->bd->prepare($sql); - if ($stm && $stm->execute ($values)) { + if ($stm && $stm->execute()) { return $stm->rowCount(); } else { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::record('SQL error updateCachedValues: ' . $info[2], Minz_Log::ERROR); return false; } } - public function truncate ($id) { - $sql = 'DELETE e.* FROM `' . $this->prefix . 'entry` e WHERE e.id_feed=?'; + public function truncate($id) { + $sql = 'DELETE FROM `' . $this->prefix . 'entry` WHERE id_feed=?'; $stm = $this->bd->prepare($sql); $values = array($id); - $this->bd->beginTransaction (); - if (!($stm && $stm->execute ($values))) { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); - $this->bd->rollBack (); - return false; - } + $this->bd->beginTransaction(); + if (!($stm && $stm->execute($values))) { + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::record('SQL error truncate: ' . $info[2], Minz_Log::ERROR); + $this->bd->rollBack(); + return false; + } $affected = $stm->rowCount(); - $sql = 'UPDATE `' . $this->prefix . 'feed` f ' - . 'SET f.cache_nbEntries=0, f.cache_nbUnreads=0 WHERE f.id=?'; - $values = array ($id); - $stm = $this->bd->prepare ($sql); - if (!($stm && $stm->execute ($values))) { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); - $this->bd->rollBack (); + $sql = 'UPDATE `' . $this->prefix . 'feed` ' + . 'SET cache_nbEntries=0, cache_nbUnreads=0 WHERE id=?'; + $values = array($id); + $stm = $this->bd->prepare($sql); + if (!($stm && $stm->execute($values))) { + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::record('SQL error truncate: ' . $info[2], Minz_Log::ERROR); + $this->bd->rollBack(); return false; } - $this->bd->commit (); + $this->bd->commit(); return $affected; } - public function cleanOldEntries ($id, $date_min, $keep = 15) { //Remember to call updateLastUpdate($id) just after - $sql = 'DELETE e.* FROM `' . $this->prefix . 'entry` e ' - . 'WHERE e.id_feed = :id_feed AND e.id <= :id_max AND e.is_favorite = 0 AND e.id NOT IN ' - . '(SELECT id FROM (SELECT e2.id FROM `' . $this->prefix . 'entry` e2 WHERE e2.id_feed = :id_feed ORDER BY id DESC LIMIT :keep) keep)'; //Double select because of: MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' - $stm = $this->bd->prepare ($sql); + public function cleanOldEntries($id, $date_min, $keep = 15) { //Remember to call updateLastUpdate($id) just after + $sql = 'DELETE FROM `' . $this->prefix . 'entry` ' + . 'WHERE id_feed = :id_feed AND id <= :id_max AND is_favorite=0 AND id NOT IN ' + . '(SELECT id FROM (SELECT e2.id FROM `' . $this->prefix . 'entry` e2 WHERE e2.id_feed = :id_feed ORDER BY id DESC LIMIT :keep) keep)'; //Double select MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' + $stm = $this->bd->prepare($sql); $id_max = intval($date_min) . '000000'; $stm->bindParam(':id_feed', $id, PDO::PARAM_INT); - $stm->bindParam(':id_max', $id_max, PDO::PARAM_INT); + $stm->bindParam(':id_max', $id_max, PDO::PARAM_STR); $stm->bindParam(':keep', $keep, PDO::PARAM_INT); - if ($stm && $stm->execute ()) { + if ($stm && $stm->execute()) { return $stm->rowCount(); } else { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::record('SQL error cleanOldEntries: ' . $info[2], Minz_Log::ERROR); return false; } } - public static function daoToFeed ($listDAO, $catID = null) { - $list = array (); + public static function daoToFeed($listDAO, $catID = null) { + $list = array(); - if (!is_array ($listDAO)) { - $listDAO = array ($listDAO); + if (!is_array($listDAO)) { + $listDAO = array($listDAO); } foreach ($listDAO as $key => $dao) { - if (!isset ($dao['name'])) { + if (!isset($dao['name'])) { continue; } - if (isset ($dao['id'])) { + if (isset($dao['id'])) { $key = $dao['id']; } if ($catID === null) { @@ -338,13 +371,14 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo { $myFeed->_lastUpdate(isset($dao['lastUpdate']) ? $dao['lastUpdate'] : 0); $myFeed->_priority(isset($dao['priority']) ? $dao['priority'] : 10); $myFeed->_pathEntries(isset($dao['pathEntries']) ? $dao['pathEntries'] : ''); - $myFeed->_httpAuth(isset($dao['httpAuth']) ? base64_decode ($dao['httpAuth']) : ''); + $myFeed->_httpAuth(isset($dao['httpAuth']) ? base64_decode($dao['httpAuth']) : ''); $myFeed->_error(isset($dao['error']) ? $dao['error'] : 0); $myFeed->_keepHistory(isset($dao['keep_history']) ? $dao['keep_history'] : -2); + $myFeed->_ttl(isset($dao['ttl']) ? $dao['ttl'] : -2); $myFeed->_nbNotRead(isset($dao['cache_nbUnreads']) ? $dao['cache_nbUnreads'] : 0); $myFeed->_nbEntries(isset($dao['cache_nbEntries']) ? $dao['cache_nbEntries'] : 0); - if (isset ($dao['id'])) { - $myFeed->_id ($dao['id']); + if (isset($dao['id'])) { + $myFeed->_id($dao['id']); } $list[$key] = $myFeed; } diff --git a/app/Models/FeedDAOSQLite.php b/app/Models/FeedDAOSQLite.php new file mode 100644 index 000000000..0d1872389 --- /dev/null +++ b/app/Models/FeedDAOSQLite.php @@ -0,0 +1,19 @@ +<?php + +class FreshRSS_FeedDAOSQLite extends FreshRSS_FeedDAO { + + public function updateCachedValues() { //For one single feed, call updateLastUpdate($id) + $sql = 'UPDATE `' . $this->prefix . 'feed` ' + . 'SET cache_nbEntries=(SELECT COUNT(e1.id) FROM `' . $this->prefix . 'entry` e1 WHERE e1.id_feed=`' . $this->prefix . 'feed`.id),' + . 'cache_nbUnreads=(SELECT COUNT(e2.id) FROM `' . $this->prefix . 'entry` e2 WHERE e2.id_feed=`' . $this->prefix . 'feed`.id AND e2.is_read=0)'; + $stm = $this->bd->prepare($sql); + if ($stm && $stm->execute()) { + return $stm->rowCount(); + } else { + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::record('SQL error updateCachedValues: ' . $info[2], Minz_Log::ERROR); + return false; + } + } + +} 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 @@ +<?php + +class FreshRSS_Share { + + static public function generateUrl($options, $selected, $link, $title) { + $share = $options[$selected['type']]; + $matches = array( + '~URL~', + '~TITLE~', + '~LINK~', + ); + $replaces = array( + $selected['url'], + self::transformData($title, self::getTransform($share, 'title')), + self::transformData($link, self::getTransform($share, 'link')), + ); + $url = str_replace($matches, $replaces, $share['url']); + return $url; + } + + static private function transformData($data, $transform) { + if (!is_array($transform)) { + return $data; + } + if (count($transform) === 0) { + return $data; + } + foreach ($transform as $action) { + $data = call_user_func($action, $data); + } + return $data; + } + + static private function getTransform($options, $type) { + $transform = $options['transform']; + + if (array_key_exists($type, $transform)) { + return $transform[$type]; + } + + return $transform; + } + +} diff --git a/app/Models/StatsDAO.php b/app/Models/StatsDAO.php index 60cec7847..40505ab3e 100644 --- a/app/Models/StatsDAO.php +++ b/app/Models/StatsDAO.php @@ -2,6 +2,8 @@ class FreshRSS_StatsDAO extends Minz_ModelPdo { + const ENTRY_COUNT_PERIOD = 30; + /** * Calculates entry repartition for all feeds and for main stream. * The repartition includes: @@ -9,7 +11,7 @@ class FreshRSS_StatsDAO extends Minz_ModelPdo { * - read entries * - unread entries * - favorite entries - * + * * @return type */ public function calculateEntryRepartition() { @@ -50,68 +52,190 @@ SQL; /** * Calculates entry count per day on a 30 days period. * Returns the result as a JSON string. - * + * * @return string */ public function calculateEntryCount() { - $count = array(); + $count = $this->initEntryCountArray(); + $period = self::ENTRY_COUNT_PERIOD; - // Generates a list of 30 last day to be sure we always have 30 days. - // If we do not do that kind of thing, we'll end up with holes in the - // days if the user do not have a lot of feeds. + // Get stats per day for the last 30 days $sql = <<<SQL -SELECT - (tens.val + units.val + 1) AS day -FROM ( - SELECT 0 AS val - UNION ALL SELECT 1 - UNION ALL SELECT 2 - UNION ALL SELECT 3 - UNION ALL SELECT 4 - UNION ALL SELECT 5 - UNION ALL SELECT 6 - UNION ALL SELECT 7 - UNION ALL SELECT 8 - UNION ALL SELECT 9 -) AS units -CROSS JOIN ( - SELECT 0 AS val - UNION ALL SELECT 10 - UNION ALL SELECT 20 -) AS tens +SELECT DATEDIFF(FROM_UNIXTIME(e.date), NOW()) AS day, +COUNT(1) AS count +FROM {$this->prefix}entry AS e +WHERE FROM_UNIXTIME(e.date, '%Y%m%d') BETWEEN DATE_FORMAT(DATE_ADD(NOW(), INTERVAL -{$period} DAY), '%Y%m%d') AND DATE_FORMAT(DATE_ADD(NOW(), INTERVAL -1 DAY), '%Y%m%d') +GROUP BY day ORDER BY day ASC SQL; $stm = $this->bd->prepare($sql); $stm->execute(); $res = $stm->fetchAll(PDO::FETCH_ASSOC); + foreach ($res as $value) { - $count[$value['day']] = 0; + $count[$value['day']] = (int) $value['count']; } - // Get stats per day for the last 30 days and applies the result on - // the array created with the last query. + return $this->convertToSerie($count); + } + + /** + * Initialize an array for the entry count. + * + * @return array + */ + protected function initEntryCountArray() { + return $this->initStatsArray(-self::ENTRY_COUNT_PERIOD, -1); + } + + /** + * Calculates the number of article per hour of the day per feed + * + * @param integer $feed id + * @return string + */ + public function calculateEntryRepartitionPerFeedPerHour($feed = null) { + return $this->calculateEntryRepartitionPerFeedPerPeriod('%H', $feed); + } + + /** + * Calculates the number of article per day of week per feed + * + * @param integer $feed id + * @return string + */ + public function calculateEntryRepartitionPerFeedPerDayOfWeek($feed = null) { + return $this->calculateEntryRepartitionPerFeedPerPeriod('%w', $feed); + } + + /** + * Calculates the number of article per month per feed + * + * @param integer $feed + * @return string + */ + public function calculateEntryRepartitionPerFeedPerMonth($feed = null) { + return $this->calculateEntryRepartitionPerFeedPerPeriod('%m', $feed); + } + + /** + * Calculates the number of article per period per feed + * + * @param string $period format string to use for grouping + * @param integer $feed id + * @return string + */ + protected function calculateEntryRepartitionPerFeedPerPeriod($period, $feed = null) { + if ($feed) { + $restrict = "WHERE e.id_feed = {$feed}"; + } else { + $restrict = ''; + } $sql = <<<SQL -SELECT DATEDIFF(FROM_UNIXTIME(e.date), NOW()) AS day, -COUNT(1) AS count +SELECT DATE_FORMAT(FROM_UNIXTIME(e.date), '{$period}') AS period +, COUNT(1) AS count FROM {$this->prefix}entry AS e -WHERE FROM_UNIXTIME(e.date, '%Y%m%d') BETWEEN DATE_FORMAT(DATE_ADD(NOW(), INTERVAL -30 DAY), '%Y%m%d') AND DATE_FORMAT(DATE_ADD(NOW(), INTERVAL -1 DAY), '%Y%m%d') -GROUP BY day -ORDER BY day ASC +{$restrict} +GROUP BY period +ORDER BY period ASC SQL; + $stm = $this->bd->prepare($sql); $stm->execute(); - $res = $stm->fetchAll(PDO::FETCH_ASSOC); + $res = $stm->fetchAll(PDO::FETCH_NAMED); foreach ($res as $value) { - $count[$value['day']] = (int) $value['count']; + $repartition[(int) $value['period']] = (int) $value['count']; } - return $this->convertToSerie($count); + return $this->convertToSerie($repartition); + } + + /** + * Calculates the average number of article per hour per feed + * + * @param integer $feed id + * @return integer + */ + public function calculateEntryAveragePerFeedPerHour($feed = null) { + return $this->calculateEntryAveragePerFeedPerPeriod(1/24, $feed); + } + + /** + * Calculates the average number of article per day of week per feed + * + * @param integer $feed id + * @return integer + */ + public function calculateEntryAveragePerFeedPerDayOfWeek($feed = null) { + return $this->calculateEntryAveragePerFeedPerPeriod(7, $feed); + } + + /** + * Calculates the average number of article per month per feed + * + * @param integer $feed id + * @return integer + */ + public function calculateEntryAveragePerFeedPerMonth($feed = null) { + return $this->calculateEntryAveragePerFeedPerPeriod(30, $feed); + } + + /** + * Calculates the average number of article per feed + * + * @param float $period number used to divide the number of day in the period + * @param integer $feed id + * @return integer + */ + protected function calculateEntryAveragePerFeedPerPeriod($period, $feed = null) { + if ($feed) { + $restrict = "WHERE e.id_feed = {$feed}"; + } else { + $restrict = ''; + } + $sql = <<<SQL +SELECT COUNT(1) AS count +, MIN(date) AS date_min +, MAX(date) AS date_max +FROM {$this->prefix}entry AS e +{$restrict} +SQL; + $stm = $this->bd->prepare($sql); + $stm->execute(); + $res = $stm->fetch(PDO::FETCH_NAMED); + $date_min = new \DateTime(); + $date_min->setTimestamp($res['date_min']); + $date_max = new \DateTime(); + $date_max->setTimestamp($res['date_max']); + $interval = $date_max->diff($date_min, true); + $interval_in_days = $interval->format('%a'); + if ($interval_in_days <= 0) { + // Surely only one article. + // We will return count / (period/period) == count. + $interval_in_days = $period; + } + + return round($res['count'] / ($interval_in_days / $period), 2); + } + + /** + * Initialize an array for statistics depending on a range + * + * @param integer $min + * @param integer $max + * @return array + */ + protected function initStatsArray($min, $max) { + return array_map(function () { + return 0; + }, array_flip(range($min, $max))); } /** * Calculates feed count per category. * Returns the result as a JSON string. - * + * * @return string */ public function calculateFeedByCategory() { @@ -134,7 +258,7 @@ SQL; /** * Calculates entry count per category. * Returns the result as a JSON string. - * + * * @return string */ public function calculateEntryByCategory() { @@ -158,7 +282,7 @@ SQL; /** * Calculates the 10 top feeds based on their number of entries - * + * * @return array */ public function calculateTopFeed() { @@ -172,7 +296,7 @@ FROM {$this->prefix}category AS c, {$this->prefix}entry AS e WHERE c.id = f.category AND f.id = e.id_feed -GROUP BY id +GROUP BY f.id ORDER BY count DESC LIMIT 10 SQL; @@ -181,7 +305,29 @@ SQL; return $stm->fetchAll(PDO::FETCH_ASSOC); } - private function convertToSerie($data) { + /** + * Calculates the last publication date for each feed + * + * @return array + */ + public function calculateFeedLastDate() { + $sql = <<<SQL +SELECT MAX(f.id) as id +, MAX(f.name) AS name +, MAX(date) AS last_date +, COUNT(*) AS nb_articles +FROM {$this->prefix}feed AS f, +{$this->prefix}entry AS e +WHERE f.id = e.id_feed +GROUP BY f.id +ORDER BY name +SQL; + $stm = $this->bd->prepare($sql); + $stm->execute(); + return $stm->fetchAll(PDO::FETCH_ASSOC); + } + + protected function convertToSerie($data) { $serie = array(); foreach ($data as $key => $value) { @@ -191,7 +337,7 @@ SQL; return json_encode($serie); } - private function convertToPieSerie($data) { + protected function convertToPieSerie($data) { $serie = array(); foreach ($data as $value) { @@ -202,4 +348,57 @@ SQL; return json_encode($serie); } + /** + * Gets days ready for graphs + * + * @return string + */ + public function getDays() { + return $this->convertToTranslatedJson(array( + 'sun', + 'mon', + 'tue', + 'wed', + 'thu', + 'fri', + 'sat', + )); + } + + /** + * Gets months ready for graphs + * + * @return string + */ + public function getMonths() { + return $this->convertToTranslatedJson(array( + 'jan', + 'feb', + 'mar', + 'apr', + 'may', + 'jun', + 'jul', + 'aug', + 'sep', + 'oct', + 'nov', + 'dec', + )); + } + + /** + * Translates array content and encode it as JSON + * + * @param array $data + * @return string + */ + private function convertToTranslatedJson($data = array()) { + $translated = array_map(function ($a) { + return Minz_Translate::t($a); + }, $data); + + return json_encode($translated); + } + } diff --git a/app/Models/StatsDAOSQLite.php b/app/Models/StatsDAOSQLite.php new file mode 100644 index 000000000..3b1256de1 --- /dev/null +++ b/app/Models/StatsDAOSQLite.php @@ -0,0 +1,64 @@ +<?php + +class FreshRSS_StatsDAOSQLite extends FreshRSS_StatsDAO { + + /** + * Calculates entry count per day on a 30 days period. + * Returns the result as a JSON string. + * + * @return string + */ + public function calculateEntryCount() { + $count = $this->initEntryCountArray(); + $period = parent::ENTRY_COUNT_PERIOD; + + // Get stats per day for the last 30 days + $sql = <<<SQL +SELECT round(julianday(e.date, 'unixepoch') - julianday('now')) AS day, +COUNT(1) AS count +FROM {$this->prefix}entry AS e +WHERE strftime('%Y%m%d', e.date, 'unixepoch') + BETWEEN strftime('%Y%m%d', 'now', '-{$period} days') + AND strftime('%Y%m%d', 'now', '-1 day') +GROUP BY day +ORDER BY day ASC +SQL; + $stm = $this->bd->prepare($sql); + $stm->execute(); + $res = $stm->fetchAll(PDO::FETCH_ASSOC); + + foreach ($res as $value) { + $count[(int) $value['day']] = (int) $value['count']; + } + + return $this->convertToSerie($count); + } + + protected function calculateEntryRepartitionPerFeedPerPeriod($period, $feed = null) { + if ($feed) { + $restrict = "WHERE e.id_feed = {$feed}"; + } else { + $restrict = ''; + } + $sql = <<<SQL +SELECT strftime('{$period}', e.date, 'unixepoch') AS period +, COUNT(1) AS count +FROM {$this->prefix}entry AS e +{$restrict} +GROUP BY period +ORDER BY period ASC +SQL; + + $stm = $this->bd->prepare($sql); + $stm->execute(); + $res = $stm->fetchAll(PDO::FETCH_NAMED); + + $repartition = array(); + foreach ($res as $value) { + $repartition[(int) $value['period']] = (int) $value['count']; + } + + return $this->convertToSerie($repartition); + } + +} diff --git a/app/Models/Themes.php b/app/Models/Themes.php index c7099a1df..68fc17a2b 100644 --- a/app/Models/Themes.php +++ b/app/Models/Themes.php @@ -31,7 +31,10 @@ class FreshRSS_Themes extends Minz_Model { if (file_exists($json_filename)) { $content = file_get_contents($json_filename); $res = json_decode($content, true); - if ($res && isset($res['files']) && is_array($res['files'])) { + if ($res && + !empty($res['name']) && + isset($res['files']) && + is_array($res['files'])) { $res['id'] = $theme_id; return $res; } @@ -70,6 +73,7 @@ class FreshRSS_Themes extends Minz_Model { 'add' => '✚', 'all' => '☰', 'bookmark' => '★', + 'bookmark-add' => '✚', 'category' => '☷', 'category-white' => '☷', 'close' => '❌', @@ -77,6 +81,8 @@ class FreshRSS_Themes extends Minz_Model { 'down' => '▽', 'favorite' => '★', 'help' => 'ⓘ', + 'icon' => '⊚', + 'key' => '⚿', 'link' => '↗', 'login' => '🔒', 'logout' => '🔓', @@ -84,13 +90,18 @@ class FreshRSS_Themes extends Minz_Model { 'non-starred' => '☆', 'prev' => '⏪', 'read' => '☑', + 'rss' => '☄', 'unread' => '☐', 'refresh' => '🔃', //↻ 'search' => '🔍', 'share' => '♺', 'starred' => '★', + 'stats' => '%', 'tag' => '⚐', 'up' => '△', + 'view-normal' => '☰', + 'view-global' => '☷', + 'view-reader' => '☕', ); if (!isset($alts[$name])) { return ''; @@ -104,3 +115,7 @@ class FreshRSS_Themes extends Minz_Model { '<img class="icon" src="' . Minz_Url::display($url) . '" alt="' . $alts[$name] . '" />'; } } + +function _i($icon, $url_only = false) { + return FreshRSS_Themes::icon($icon, $url_only); +} diff --git a/app/Models/UserDAO.php b/app/Models/UserDAO.php index a25b57f89..9f64fb4a7 100644 --- a/app/Models/UserDAO.php +++ b/app/Models/UserDAO.php @@ -2,35 +2,55 @@ class FreshRSS_UserDAO extends Minz_ModelPdo { public function createUser($username) { - require_once(APP_PATH . '/sql.php'); $db = Minz_Configuration::dataBase(); + require_once(APP_PATH . '/SQL/install.sql.' . $db['type'] . '.php'); - $sql = sprintf(SQL_CREATE_TABLES, $db['prefix'] . $username . '_'); - $stm = $this->bd->prepare($sql, array(PDO::ATTR_EMULATE_PREPARES => true)); - $values = array( - 'catName' => Minz_Translate::t('default_category'), - ); - if ($stm && $stm->execute($values)) { + $userPDO = new Minz_ModelPdo($username); + + $ok = false; + if (defined('SQL_CREATE_TABLES')) { //E.g. MySQL + $sql = sprintf(SQL_CREATE_TABLES, $db['prefix'] . $username . '_', Minz_Translate::t('default_category')); + $stm = $userPDO->bd->prepare($sql); + $ok = $stm && $stm->execute(); + } else { //E.g. SQLite + global $SQL_CREATE_TABLES; + if (is_array($SQL_CREATE_TABLES)) { + $ok = true; + foreach ($SQL_CREATE_TABLES as $instruction) { + $sql = sprintf($instruction, '', Minz_Translate::t('default_category')); + $stm = $userPDO->bd->prepare($sql); + $ok &= ($stm && $stm->execute()); + } + } + } + + if ($ok) { return true; } else { - $info = $stm->errorInfo(); + $info = empty($stm) ? array(2 => 'syntax error') : $stm->errorInfo(); Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); return false; } } public function deleteUser($username) { - require_once(APP_PATH . '/sql.php'); $db = Minz_Configuration::dataBase(); + require_once(APP_PATH . '/SQL/install.sql.' . $db['type'] . '.php'); - $sql = sprintf(SQL_DROP_TABLES, $db['prefix'] . $username . '_'); - $stm = $this->bd->prepare($sql); - if ($stm && $stm->execute()) { - return true; + if ($db['type'] === 'sqlite') { + return unlink(DATA_PATH . '/' . $username . '.sqlite'); } else { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); - return false; + $userPDO = new Minz_ModelPdo($username); + + $sql = sprintf(SQL_DROP_TABLES, $db['prefix'] . $username . '_'); + $stm = $userPDO->bd->prepare($sql); + if ($stm && $stm->execute()) { + return true; + } else { + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); + return false; + } } } } diff --git a/app/sql.php b/app/SQL/install.sql.mysql.php index 5cd7c52ed..16cb3a3b8 100644 --- a/app/sql.php +++ b/app/SQL/install.sql.mysql.php @@ -21,6 +21,7 @@ CREATE TABLE IF NOT EXISTS `%1$sfeed` ( `httpAuth` varchar(511) DEFAULT NULL, `error` boolean DEFAULT 0, `keep_history` MEDIUMINT NOT NULL DEFAULT -2, -- v0.7 + `ttl` INT NOT NULL DEFAULT -2, -- v0.7.3 `cache_nbEntries` int DEFAULT 0, -- v0.7 `cache_nbUnreads` int DEFAULT 0, -- v0.7 PRIMARY KEY (`id`), @@ -52,7 +53,9 @@ CREATE TABLE IF NOT EXISTS `%1$sentry` ( ) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = INNODB; -INSERT IGNORE INTO `%1$scategory` (id, name) VALUES(1, :catName); +INSERT IGNORE INTO `%1$scategory` (id, name) VALUES(1, "%2$s"); '); define('SQL_DROP_TABLES', 'DROP TABLES %1$sentry, %1$sfeed, %1$scategory'); + +define('SQL_SHOW_TABLES', 'SHOW tables;'); diff --git a/app/SQL/install.sql.sqlite.php b/app/SQL/install.sql.sqlite.php new file mode 100644 index 000000000..7988ada04 --- /dev/null +++ b/app/SQL/install.sql.sqlite.php @@ -0,0 +1,59 @@ +<?php +global $SQL_CREATE_TABLES; +$SQL_CREATE_TABLES = array( +'CREATE TABLE IF NOT EXISTS `%1$scategory` ( + `id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + `name` varchar(255) NOT NULL, + UNIQUE (`name`) +);', + +'CREATE TABLE IF NOT EXISTS `%1$sfeed` ( + `id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + `url` varchar(511) NOT NULL, + `%1$scategory` SMALLINT DEFAULT 0, + `name` varchar(255) NOT NULL, + `website` varchar(255), + `description` text, + `lastUpdate` int(11) DEFAULT 0, + `priority` tinyint(2) NOT NULL DEFAULT 10, + `pathEntries` varchar(511) DEFAULT NULL, + `httpAuth` varchar(511) DEFAULT NULL, + `error` boolean DEFAULT 0, + `keep_history` MEDIUMINT NOT NULL DEFAULT -2, + `ttl` INT NOT NULL DEFAULT -2, + `cache_nbEntries` int DEFAULT 0, + `cache_nbUnreads` int DEFAULT 0, + FOREIGN KEY (`%1$scategory`) REFERENCES `%1$scategory`(`id`) ON DELETE SET NULL ON UPDATE CASCADE, + UNIQUE (`url`) +);', + +'CREATE INDEX IF NOT EXISTS feed_name_index ON `%1$sfeed`(`name`);', +'CREATE INDEX IF NOT EXISTS feed_priority_index ON `%1$sfeed`(`priority`);', +'CREATE INDEX IF NOT EXISTS feed_keep_history_index ON `%1$sfeed`(`keep_history`);', + +'CREATE TABLE IF NOT EXISTS `%1$sentry` ( + `id` bigint NOT NULL, + `guid` varchar(760) NOT NULL, + `title` varchar(255) NOT NULL, + `author` varchar(255), + `content` text, + `link` varchar(1023) NOT NULL, + `date` int(11), + `is_read` boolean NOT NULL DEFAULT 0, + `is_favorite` boolean NOT NULL DEFAULT 0, + `id_feed` SMALLINT, + `tags` varchar(1023), + PRIMARY KEY (`id`), + FOREIGN KEY (`id_feed`) REFERENCES `%1$sfeed`(`id`) ON DELETE CASCADE ON UPDATE CASCADE, + UNIQUE (`id_feed`,`guid`) +);', + +'CREATE INDEX IF NOT EXISTS entry_is_favorite_index ON `%1$sentry`(`is_favorite`);', +'CREATE INDEX IF NOT EXISTS entry_is_read_index ON `%1$sentry`(`is_read`);', + +'INSERT OR IGNORE INTO `%1$scategory` (id, name) VALUES(1, "%2$s");', +); + +define('SQL_DROP_TABLES', 'DROP TABLES %1$sentry, %1$sfeed, %1$scategory'); + +define('SQL_SHOW_TABLES', 'SELECT name FROM sqlite_master WHERE type="table"'); diff --git a/app/actualize_script.php b/app/actualize_script.php index 8d81e0189..4c306b8da 100755 --- a/app/actualize_script.php +++ b/app/actualize_script.php @@ -28,7 +28,6 @@ foreach ($users as $myUser) { $_SERVER['HTTP_HOST'] = ''; $freshRSS = new FreshRSS(); - $freshRSS->_useOb(false); Minz_Configuration::_authType('none'); diff --git a/app/i18n/en.php b/app/i18n/en.php index 932513588..beba02c4d 100644 --- a/app/i18n/en.php +++ b/app/i18n/en.php @@ -3,7 +3,9 @@ return array ( // LAYOUT 'login' => 'Login', + 'keep_logged_in' => 'Keep me logged in <small>(1 month)</small>', 'login_with_persona' => 'Login with Persona', + 'login_persona_problem' => 'Connection problem with Persona?', 'logout' => 'Logout', 'search' => 'Search words or #tags', 'search_short' => 'Search', @@ -15,18 +17,62 @@ return array ( 'feed' => 'Feed', 'feeds' => 'Feeds', 'shortcuts' => 'Shortcuts', + 'queries' => 'User queries', + 'query_search' => 'Search for "%s"', + 'query_order_asc' => 'Display oldest articles first', + 'query_order_desc' => 'Display newest articles first', + 'query_get_category' => 'Display "%s" category', + 'query_get_feed' => 'Display "%s" feed', + 'query_get_all' => 'Display all articles', + 'query_get_favorite' => 'Display favorite articles', + 'query_state_0' => 'Display all articles', + 'query_state_1' => 'Display read articles', + 'query_state_2' => 'Display unread articles', + 'query_state_3' => 'Display all articles', + 'query_state_4' => 'Display favorite articles', + 'query_state_5' => 'Display read favorite articles', + 'query_state_6' => 'Display unread favorite articles', + 'query_state_7' => 'Display favorite articles', + 'query_state_8' => 'Display not favorite articles', + 'query_state_9' => 'Display read not favorite articles', + 'query_state_10' => 'Display unread not favorite articles', + 'query_state_11' => 'Display not favorite articles', + 'query_state_12' => 'Display all articles', + 'query_state_13' => 'Display read articles', + 'query_state_14' => 'Display unread articles', + 'query_state_15' => 'Display all articles', + 'query_number' => 'Query n°%d', + 'add_query' => 'Add a query', + 'query_created' => 'Query "%s" has been created.', + 'no_query' => 'You haven’t created any user query yet.', + 'query_filter' => 'Filter applied:', + 'no_query_filter' => 'No filter', + 'query_deprecated' => 'This query is no longer valid. The referenced category or feed has been deleted.', 'about' => 'About', 'stats' => 'Statistics', + 'stats_idle' => 'Idle feeds', + 'stats_main' => 'Main statistics', + 'stats_repartition' => 'Articles repartition', + 'stats_entry_per_hour' => 'Per hour', + 'stats_entry_per_day_of_week' => 'Per day of week', + 'stats_entry_per_month' => 'Per month', + + 'last_week' => 'Last week', + 'last_month' => 'Last month', + 'last_3_month' => 'Last three months', + 'last_6_month' => 'Last six months', + 'last_year' => 'Last year', 'your_rss_feeds' => 'Your RSS feeds', 'add_rss_feed' => 'Add a RSS feed', 'no_rss_feed' => 'No RSS feed', - 'import_export_opml' => 'Import / export (OPML)', + 'import_export' => 'Import / export', + 'bookmark' => 'Subscribe (FreshRSS bookmark)', 'subscription_management' => 'Subscriptions management', 'main_stream' => 'Main stream', 'all_feeds' => 'All feeds', - 'favorite_feeds' => 'Favourites (%d)', + 'favorite_feeds' => 'Favourites (%s)', 'not_read' => '%d unread', 'not_reads' => '%d unread', @@ -49,8 +95,10 @@ return array ( 'rss_view' => 'RSS feed', 'show_all_articles' => 'Show all articles', 'show_not_reads' => 'Show only unread', + 'show_adaptive' => 'Adjust showing', 'show_read' => 'Show only read', - 'show_favorite' => 'Show favorites', + 'show_favorite' => 'Show only favorites', + 'show_not_favorite' => 'Show all but favorites', 'older_first' => 'Oldest first', 'newer_first' => 'Newer first', @@ -67,7 +115,7 @@ return array ( 'access_denied' => 'You don’t have permission to access this page', 'page_not_found' => 'You are looking for a page which doesn’t exist', 'error_occurred' => 'An error occurred', - 'error_occurred_update' => 'Nothing was changed', + 'error_occurred_update' => 'Nothing was changed', 'default_category' => 'Uncategorized', 'categories_updated' => 'Categories have been updated', @@ -78,7 +126,6 @@ return array ( 'sharing_management' => 'Sharing options management', 'bad_opml_file' => 'Your OPML file is invalid', 'shortcuts_updated' => 'Shortcuts have been updated', - 'shortcuts_management' => 'Shortcuts management', 'shortcuts_navigation' => 'Navigation', 'shortcuts_navigation_help' => 'With the "Shift" modifier, navigation shortcuts apply on feeds.<br/>With the "Alt" modifier, navigation shortcuts apply on categories.', 'shortcuts_article_action' => 'Article actions', @@ -89,7 +136,7 @@ return array ( 'already_subscribed' => 'You have already subscribed to <em>%s</em>', 'feed_added' => 'RSS feed <em>%s</em> has been added', 'feed_not_added' => '<em>%s</em> 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. <a href="%s">Check FressRSS logs</a> for details.', 'invalid_url' => 'URL <em>%s</em> is invalid', 'feed_actualized' => '<em>%s</em> has been updated', 'n_feeds_actualized' => '%d feeds have been updated', @@ -109,10 +156,13 @@ return array ( 'public' => 'Public', 'invalid_login' => 'Login is invalid', + 'file_is_nok' => 'Check permissions on <em>%s</em> directory. HTTP server must have rights to write into.', + // VIEWS 'save' => 'Save', 'delete' => 'Delete', 'cancel' => 'Cancel', + 'submit' => 'Submit', 'back_to_rss_feeds' => '← Go back to your RSS feeds', 'feeds_moved_category_deleted' => 'When you delete a category, their feeds are automatically classified under <em>%s</em>.', @@ -136,24 +186,40 @@ return array ( 'collapse_article' => 'Collapse', 'auto_share' => 'Share', 'auto_share_help' => 'If there is only one sharing mode, it is used. Else modes are accessible by their number.', + 'focus_search' => 'Access search box', + 'user_filter' => 'Access user filters', + 'user_filter_help' => 'If there is only one user filter, it is used. Else filters are accessible by their number.', + 'help' => 'Display documentation', - 'file_to_import' => 'File to import', + 'file_to_import' => 'File to import<br />(OPML, Json or Zip)', + 'file_to_import_no_zip' => 'File to import<br />(OPML or Json)', 'import' => 'Import', + 'file_cannot_be_uploaded' => 'File cannot be uploaded!', + 'zip_error' => 'An error occured during Zip import.', + 'no_zip_extension' => 'Zip extension is not present on your server.', 'export' => 'Export', + 'export_opml' => 'Export list of feeds (OPML)', + 'export_starred' => 'Export your favourites', + 'export_no_zip_extension' => 'Zip extension is not present on your server. Please try to export files one by one.', + 'starred_list' => 'List of favourite articles', + 'feed_list' => 'List of %s articles', 'or' => 'or', 'informations' => 'Information', 'damn' => 'Damn!', + 'ok' => 'Ok!', + 'attention' => 'Be careful!', 'feed_in_error' => 'This feed has encountered a problem. Please verify that it is always reachable then actualize it.', 'feed_empty' => 'This feed is empty. Please verify that it is still maintained.', 'feed_description' => 'Description', 'website_url' => 'Website URL', 'feed_url' => 'Feed URL', 'articles' => 'articles', - 'number_articles' => 'Number of articles', + 'number_articles' => '%d articles', 'by_feed' => 'by feed', 'by_default' => 'By default', 'keep_history' => 'Minimum number of articles to keep', + 'ttl' => 'Do not automatically refresh more often than', 'categorize' => 'Store in a category', 'truncate' => 'Delete all articles', 'advanced' => 'Advanced', @@ -166,19 +232,24 @@ return array ( 'http_username' => '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.', - 'think_to_add' => '<a href="./?c=configure&a=feed">You may add some feeds</a>.', + 'think_to_add' => 'You may add some feeds.', 'current_user' => 'Current user', 'default_user' => 'Username of the default user <small>(maximum 16 alphanumeric characters)</small>', 'password_form' => 'Password<br /><small>(for the Web-form login method)</small>', + 'password_api' => 'Password API<br /><small>(e.g., for mobile apps)</small>', 'persona_connection_email' => 'Login mail address<br /><small>(for <a href="https://persona.org/" rel="external">Mozilla Persona</a>)</small>', '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 <abbr>API</abbr> access <small>(required for mobile apps)</small>', 'auth_token' => 'Authentication token', - 'explain_token' => 'Allows to access RSS output of the default user without authentication.<br /><kbd>%s?output=rss&token=%s</kbd>', + 'explain_token' => 'Allows to access RSS output of the default user without authentication.<br /><kbd>%s?output=rss&token=%s</kbd>', 'login_configuration' => 'Login', 'is_admin' => 'is administrator', 'auth_type' => 'Authentication method', @@ -189,6 +260,7 @@ return array ( 'users_list' => 'List of users', 'create_user' => 'Create new user', 'username' => 'Username', + 'username_admin' => 'Administrator username', 'password' => 'Password', 'create' => 'Create', 'user_created' => 'User %s has been created', @@ -197,26 +269,35 @@ return array ( 'language' => 'Language', 'month' => 'months', 'archiving_configuration' => 'Archiving', - 'delete_articles_every' => 'Remove articles after', + 'delete_articles_every' => 'Remove articles after', 'purge_now' => 'Purge now', 'purge_completed' => 'Purge completed (%d articles deleted)', 'archiving_configuration_help' => 'More options are available in the individual stream settings', 'reading_configuration' => 'Reading', + 'display_configuration' => 'Display', 'articles_per_page' => 'Number of articles per page', + 'number_divided_when_reader' => 'Divided by 2 in the reading view.', 'default_view' => 'Default view', + 'articles_to_display' => 'Articles to display', 'sort_order' => 'Sort order', 'auto_load_more' => 'Load next articles at the page bottom', 'display_articles_unfolded' => 'Show articles unfolded by default', + 'display_categories_unfolded' => 'Show categories folded by default', + 'hide_read_feeds' => 'Hide categories & feeds with no unread article (does not work with “Show all articles” configuration)', 'after_onread' => 'After “mark all as read”,', 'jump_next' => 'jump to next unread sibling (feed or category)', - 'reading_icons' => 'Reading icons', + 'article_icons' => 'Article icons', 'top_line' => 'Top line', 'bottom_line' => 'Bottom line', + 'html5_notif_timeout' => 'HTML5 notification timeout', + 'seconds_(0_means_no_timeout)' => 'seconds (0 means no timeout)', 'img_with_lazyload' => 'Use "lazy load" mode to load pictures', + 'sticky_post' => 'Stick the article to the top when opened', + 'reading_confirm' => 'Display a confirmation dialog on “mark all as read” actions', 'auto_read_when' => 'Mark article as read…', - 'article_selected' => 'when article is selected', + 'article_viewed' => 'when article is viewed', 'article_open_on_website' => 'when article is opened on its original website', - 'scroll' => 'during page scrolls', + 'scroll' => 'while scrolling', 'upon_reception' => 'upon reception of the article', 'your_shaarli' => 'Your Shaarli', 'your_wallabag' => 'Your wallabag', @@ -227,9 +308,15 @@ return array ( 'optimize_bdd' => 'Optimize database', 'optimize_todo_sometimes' => 'To do occasionally to reduce the size of the database', 'theme' => 'Theme', + 'content_width' => 'Content width', + 'width_thin' => 'Thin', + 'width_medium' => 'Medium', + 'width_large' => 'Large', + 'width_no_limit' => 'No limit', 'more_information' => 'More information', 'activate_sharing' => 'Activate sharing', 'shaarli' => 'Shaarli', + 'blogotext' => 'Blogotext', 'wallabag' => 'wallabag', 'diaspora' => 'Diaspora*', 'twitter' => 'Twitter', @@ -270,7 +357,7 @@ return array ( 'agpl3' => '<a href="https://www.gnu.org/licenses/agpl-3.0.html">AGPL 3</a>', 'freshrss_description' => 'FreshRSS is a RSS feeds aggregator to self-host like <a href="http://tontof.net/kriss/feed/">Kriss Feed</a> or <a href="http://projet.idleman.fr/leed/">Leed</a>. It is light and easy to take in hand while being powerful and configurable tool.', 'credits' => 'Credits', - 'credits_content' => 'Some design elements come from <a href="http://twitter.github.io/bootstrap/">Bootstrap</a> although FreshRSS doesn’t use this framework. <a href="https://git.gnome.org/browse/gnome-icon-theme-symbolic">Icons</a> come from <a href="https://www.gnome.org/">GNOME project</a>. <em>Open Sans</em> font police used has been created by <a href="https://www.google.com/webfonts/specimen/Open+Sans">Steve Matteson</a>. Favicons are collected with <a href="https://getfavicon.appspot.com/">getFavicon API</a>. FreshRSS is based on <a href="https://github.com/marienfressinaud/MINZ">Minz</a>, a PHP framework.', + 'credits_content' => 'Some design elements come from <a href="http://twitter.github.io/bootstrap/">Bootstrap</a> although FreshRSS doesn’t use this framework. <a href="https://git.gnome.org/browse/gnome-icon-theme-symbolic">Icons</a> come from <a href="https://www.gnome.org/">GNOME project</a>. <em>Open Sans</em> font police has been created by <a href="https://www.google.com/webfonts/specimen/Open+Sans">Steve Matteson</a>. Favicons are collected with <a href="https://getfavicon.appspot.com/">getFavicon API</a>. FreshRSS is based on <a href="https://github.com/marienfressinaud/MINZ">Minz</a>, a PHP framework.', 'version' => 'Version', 'logs' => 'Logs', @@ -281,20 +368,42 @@ return array ( 'login_required' => 'Login required:', 'confirm_action' => 'Are you sure you want to perform this action? It cannot be cancelled!', + 'confirm_action_feed_cat' => 'Are you sure you want to perform this action? You may lost related favorites and user queries. It cannot be cancelled!', + 'notif_title_new_articles' => 'FreshRSS: new articles!', + 'notif_body_new_articles' => 'There are \d new articles to read on FreshRSS.', // DATE - 'january' => 'january', - 'february' => 'february', - 'march' => 'march', - 'april' => 'april', - 'may' => 'may', - 'june' => 'june', - 'july' => 'july', - 'august' => 'august', - 'september' => 'september', - 'october' => 'october', - 'november' => 'november', - 'december' => 'december', + 'january' => 'January', + 'february' => 'February', + 'march' => 'March', + 'april' => 'April', + 'may' => 'May', + 'june' => 'June', + 'july' => 'July', + 'august' => 'August', + 'september' => 'September', + 'october' => 'October', + 'november' => 'November', + 'december' => 'December', + 'january' => 'Jan', + 'february' => 'Feb', + 'march' => 'Mar', + 'april' => 'Apr', + 'may' => 'May', + 'june' => 'Jun', + 'july' => 'Jul', + 'august' => 'Aug', + 'september' => 'Sep', + 'october' => 'Oct', + 'november' => 'Nov', + 'december' => 'Dec', + 'sun' => 'Sun', + 'mon' => 'Mon', + 'tue' => 'Tue', + 'wed' => 'Wed', + 'thu' => 'Thu', + 'fri' => 'Fri', + 'sat' => 'Sat', // special format for date() function 'Jan' => '\J\a\n\u\a\r\y', 'Feb' => '\F\e\b\r\u\a\r\y', @@ -323,4 +432,23 @@ return array ( 'stats_entry_per_category' => 'Entries per category', 'stats_top_feed' => 'Top ten feeds', 'stats_entry_count' => 'Entry count', + 'stats_no_idle' => 'There is no idle feed!', + + 'update' => 'Update', + 'update_system' => 'Update system', + 'update_check' => 'Check for new updates', + 'update_last' => 'Last verification: %s', + 'update_can_apply' => 'An update is available.', + 'update_apply' => 'Apply', + 'update_server_not_found' => 'Update server cannot be found. [%s]', + 'no_update' => 'No update to apply', + 'update_problem' => 'The update process has encountered an error: %s', + 'update_finished' => 'Update completed!', + + 'auth_reset' => 'Authentication reset', + 'auth_will_reset' => 'Authentication system will be reset: a form will be used instead of Persona.', + 'auth_not_persona' => 'Only Persona system can be reset.', + 'auth_no_password_set' => 'Administrator password hasn’t been set. This feature isn’t available.', + 'auth_form_set' => 'Form is now your default authentication system.', + 'auth_form_not_set' => 'A problem occured during authentication system configuration. Please retry later.', ); diff --git a/app/i18n/fr.php b/app/i18n/fr.php index ab7843d12..b0fbf15ae 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -3,7 +3,9 @@ return array ( // LAYOUT 'login' => 'Connexion', + 'keep_logged_in' => 'Rester connecté <small>(1 mois)</small>', 'login_with_persona' => 'Connexion avec Persona', + 'login_persona_problem' => 'Problème de connexion à Persona ?', 'logout' => 'Déconnexion', 'search' => 'Rechercher des mots ou des #tags', 'search_short' => 'Rechercher', @@ -15,24 +17,68 @@ return array ( 'feed' => 'Flux', 'feeds' => 'Flux', 'shortcuts' => 'Raccourcis', + 'queries' => 'Filtres utilisateurs', + 'query_search' => 'Recherche de "%s"', + 'query_order_asc' => 'Afficher les articles les plus anciens en premier', + 'query_order_desc' => 'Afficher les articles les plus récents en premier', + 'query_get_category' => 'Afficher la catégorie "%s"', + 'query_get_feed' => 'Afficher le flux "%s"', + 'query_get_all' => 'Afficher tous les articles', + 'query_get_favorite' => 'Afficher les articles favoris', + 'query_state_0' => 'Afficher tous les articles', + 'query_state_1' => 'Afficher les articles lus', + 'query_state_2' => 'Afficher les articles non lus', + 'query_state_3' => 'Afficher tous les articles', + 'query_state_4' => 'Afficher les articles favoris', + 'query_state_5' => 'Afficher les articles lus et favoris', + 'query_state_6' => 'Afficher les articles non lus et favoris', + 'query_state_7' => 'Afficher les articles favoris', + 'query_state_8' => 'Afficher les articles non favoris', + 'query_state_9' => 'Afficher les articles lus et non favoris', + 'query_state_10' => 'Afficher les articles non lus et non favoris', + 'query_state_11' => 'Afficher les articles non favoris', + 'query_state_12' => 'Afficher tous les articles', + 'query_state_13' => 'Afficher les articles lus', + 'query_state_14' => 'Afficher les articles non lus', + 'query_state_15' => 'Afficher tous les articles', + 'query_number' => 'Filtre n°%d', + 'add_query' => 'Créer un filtre', + 'query_created' => 'Le filtre "%s" a bien été créé.', + 'no_query' => 'Vous n’avez pas encore créé de filtre.', + 'query_filter' => 'Filtres appliqués :', + 'no_query_filter' => 'Aucun filtre appliqué', + 'query_deprecated' => 'Ce filtre n’est plus valide. La catégorie ou le flux concerné a été supprimé.', 'about' => 'À propos', 'stats' => 'Statistiques', + 'stats_idle' => 'Flux inactifs', + 'stats_main' => 'Statistiques principales', + 'stats_repartition' => 'Répartition des articles', + 'stats_entry_per_hour' => 'Par heure', + 'stats_entry_per_day_of_week' => 'Par jour de la semaine', + 'stats_entry_per_month' => 'Par mois', + + 'last_week' => 'Depuis la semaine dernière', + 'last_month' => 'Depuis le mois dernier', + 'last_3_month' => 'Depuis les trois derniers mois', + 'last_6_month' => 'Depuis les six derniers mois', + 'last_year' => 'Depuis l’année dernière', 'your_rss_feeds' => 'Vos flux RSS', 'add_rss_feed' => 'Ajouter un flux RSS', 'no_rss_feed' => 'Aucun flux RSS', - 'import_export_opml' => 'Importer / exporter (OPML)', + 'import_export' => 'Importer / exporter', + 'bookmark' => 'S’abonner (bookmark FreshRSS)', 'subscription_management' => 'Gestion des abonnements', 'main_stream' => 'Flux principal', 'all_feeds' => 'Tous les flux', - 'favorite_feeds' => 'Favoris (%d)', + 'favorite_feeds' => 'Favoris (%s)', 'not_read' => '%d non lu', 'not_reads' => '%d non lus', 'filter' => 'Filtrer', 'see_website' => 'Voir le site', - 'administration' => 'Gestion', + 'administration' => 'Gérer', 'actualize' => 'Actualiser', 'mark_read' => 'Marquer comme lu', @@ -49,8 +95,10 @@ return array ( 'rss_view' => 'Flux RSS', 'show_all_articles' => 'Afficher tous les articles', 'show_not_reads' => 'Afficher les non lus', + 'show_adaptive' => 'Adapter l’affichage', 'show_read' => 'Afficher les lus', 'show_favorite' => 'Afficher les favoris', + 'show_not_favorite' => 'Afficher tout sauf les favoris', 'older_first' => 'Plus anciens en premier', 'newer_first' => 'Plus récents en premier', @@ -64,67 +112,69 @@ return array ( 'article_published_on' => 'Article publié initialement sur <a href="%s">%s</a>', 'article_published_on_author' => 'Article publié initialement sur <a href="%s">%s</a> par %s', - 'access_denied' => 'Vous n’avez pas le droit d’accéder à cette page', - 'page_not_found' => 'La page que vous cherchez n’existe pas', - 'error_occurred' => 'Une erreur est survenue', - 'error_occurred_update' => 'Rien n’a été modifié', + 'access_denied' => 'Vous n’avez pas le droit d’accéder à cette page !', + 'page_not_found' => 'La page que vous cherchez n’existe pas !', + 'error_occurred' => 'Une erreur est survenue !', + 'error_occurred_update' => 'Rien n’a été modifié !', 'default_category' => 'Sans catégorie', - 'categories_updated' => 'Les catégories ont été mises à jour', + 'categories_updated' => 'Les catégories ont été mises à jour.', 'categories_management' => 'Gestion des catégories', - 'feed_updated' => 'Le flux a été mis à jour', + 'feed_updated' => 'Le flux a été mis à jour.', 'rss_feed_management' => 'Gestion des flux RSS', - 'configuration_updated' => 'La configuration a été mise à jour', + 'configuration_updated' => 'La configuration a été mise à jour.', 'sharing_management' => 'Gestion des options de partage', - 'bad_opml_file' => 'Votre fichier OPML n’est pas valide', - 'shortcuts_updated' => 'Les raccourcis ont été mis à jour', - 'shortcuts_management' => 'Gestion des raccourcis', + 'bad_opml_file' => 'Votre fichier OPML n’est pas valide.', + 'shortcuts_updated' => 'Les raccourcis ont été mis à jour.', 'shortcuts_navigation' => 'Navigation', 'shortcuts_navigation_help' => 'Avec le modificateur "Shift", les raccourcis de navigation s’appliquent aux flux.<br/>Avec le modificateur "Alt", les raccourcis de navigation s’appliquent aux catégories.', 'shortcuts_article_action' => 'Actions associées à l’article courant', 'shortcuts_other_action' => 'Autres actions', - 'feeds_marked_read' => 'Les flux ont été marqués comme lus', - 'updated' => 'Modifications enregistrées', + 'feeds_marked_read' => 'Les flux ont été marqués comme lus.', + 'updated' => 'Modifications enregistrées.', 'already_subscribed' => 'Vous êtes déjà abonné à <em>%s</em>', - 'feed_added' => 'Le flux <em>%s</em> a bien été ajouté', - 'feed_not_added' => '<em>%s</em> 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.', - 'invalid_url' => 'L’url <em>%s</em> est invalide', - 'feed_actualized' => '<em>%s</em> a été mis à jour', - 'n_feeds_actualized' => '%d flux ont été mis à jour', - 'feeds_actualized' => 'Les flux ont été mis à jour', - 'no_feed_actualized' => 'Aucun flux n’a pu être mis à jour', - 'n_entries_deleted' => '%d articles ont été supprimés', - 'feeds_imported_with_errors' => 'Vos flux ont été importés mais des erreurs sont survenues', - 'feeds_imported' => 'Vos flux ont été importés et vont maintenant être actualisés', - 'category_emptied' => 'La catégorie a été vidée', - 'feed_deleted' => 'Le flux a été supprimé', + 'feed_added' => 'Le flux <em>%s</em> a bien été ajouté.', + 'feed_not_added' => '<em>%s</em> n’a pas pu être ajouté.', + 'internal_problem_feed' => 'Le flux ne peut pas être ajouté. <a href="%s">Consulter les logs de FreshRSS</a> pour plus de détails.', + 'invalid_url' => 'L’url <em>%s</em> est invalide.', + 'feed_actualized' => '<em>%s</em> a été mis à jour.', + 'n_feeds_actualized' => '%d flux ont été mis à jour.', + 'feeds_actualized' => 'Les flux ont été mis à jour.', + 'no_feed_actualized' => 'Aucun flux n’a pu être mis à jour.', + 'n_entries_deleted' => '%d articles ont été supprimés.', + 'feeds_imported_with_errors' => 'Vos flux ont été importés mais des erreurs sont survenues.', + 'feeds_imported' => 'Vos flux ont été importés et vont maintenant être actualisés.', + 'category_emptied' => 'La catégorie a été vidée.', + 'feed_deleted' => 'Le flux a été supprimé.', 'feed_validator' => 'Vérifier la valididé du flux', - 'optimization_complete' => 'Optimisation terminée', + 'optimization_complete' => 'Optimisation terminée.', 'your_rss_feeds' => 'Vos flux RSS', 'your_favorites' => 'Vos favoris', 'public' => 'Public', - 'invalid_login' => 'L’identifiant est invalide', + 'invalid_login' => 'L’identifiant est invalide !', + + 'file_is_nok' => 'Veuillez vérifier les droits sur le répertoire <em>%s</em>. Le serveur HTTP doit être capable d’écrire dedans.', // VIEWS 'save' => 'Enregistrer', 'delete' => 'Supprimer', 'cancel' => 'Annuler', + 'submit' => 'Valider', 'back_to_rss_feeds' => '← Retour à vos flux RSS', 'feeds_moved_category_deleted' => 'Lors de la suppression d’une catégorie, ses flux seront automatiquement classés dans <em>%s</em>.', 'category_number' => 'Catégorie n°%d', 'ask_empty' => 'Vider ?', 'number_feeds' => '%d flux', - 'can_not_be_deleted' => 'Ne peut pas être supprimée', + 'can_not_be_deleted' => 'Ne peut pas être supprimée.', 'add_category' => 'Ajouter une catégorie', 'new_category' => 'Nouvelle catégorie', - 'javascript_for_shortcuts' => 'Le JavaScript doit être activé pour pouvoir profiter des raccourcis', - 'javascript_should_be_activated'=> 'Le JavaScript doit être activé', + 'javascript_for_shortcuts' => 'Le JavaScript doit être activé pour pouvoir profiter des raccourcis.', + 'javascript_should_be_activated'=> 'Le JavaScript doit être activé.', 'shift_for_all_read' => '+ <code>shift</code> pour marquer tous les articles comme lus', 'see_on_website' => 'Voir sur le site d’origine', 'next_article' => 'Passer à l’article suivant', @@ -135,25 +185,41 @@ return array ( 'previous_page' => 'Passer à la page précédente', 'collapse_article' => 'Refermer', 'auto_share' => 'Partager', - 'auto_share_help' => 'Si il n’y a qu’un mode de partage, celui ci est utilisé automatiquement. Sinon ils sont accessibles par leur numéro.', + 'auto_share_help' => 'S’il n’y a qu’un mode de partage, celui ci est utilisé automatiquement. Sinon ils sont accessibles par leur numéro.', + 'focus_search' => 'Accéder à la recherche', + 'user_filter' => 'Accéder aux filtres utilisateur', + 'user_filter_help' => 'S’il n’y a qu’un filtre utilisateur, celui ci est utilisé automatiquement. Sinon ils sont accessibles par leur numéro.', + 'help' => 'Afficher la documentation', - 'file_to_import' => 'Fichier à importer', + 'file_to_import' => 'Fichier à importer<br />(OPML, Json ou Zip)', + 'file_to_import_no_zip' => 'Fichier à importer<br />(OPML ou Json)', 'import' => 'Importer', + 'file_cannot_be_uploaded' => 'Le fichier ne peut pas être téléchargé!', + 'zip_error' => 'Une erreur est survenue durant l’import du fichier Zip.', + 'no_zip_extension' => 'L’extension Zip n’est pas présente sur votre serveur.', 'export' => 'Exporter', + 'export_opml' => 'Exporter la liste des flux (OPML)', + 'export_starred' => 'Exporter les favoris', + 'export_no_zip_extension' => 'L’extension Zip n’est pas présente sur votre serveur. Veuillez essayer d’exporter les fichiers un par un.', + 'starred_list' => 'Liste des articles favoris', + 'feed_list' => 'Liste des articles de %s', 'or' => 'ou', 'informations' => 'Informations', 'damn' => 'Arf !', + 'ok' => 'Ok !', + 'attention' => 'Attention !', 'feed_in_error' => 'Ce flux a rencontré un problème. Veuillez vérifier qu’il est toujours accessible puis actualisez-le.', 'feed_empty' => 'Ce flux est vide. Veuillez vérifier qu’il est toujours maintenu.', 'feed_description' => 'Description', 'website_url' => 'URL du site', 'feed_url' => 'URL du flux', 'articles' => 'articles', - 'number_articles' => 'Nombre d’articles', + 'number_articles' => '%d articles', 'by_feed' => 'par flux', 'by_default' => 'Par défaut', 'keep_history' => 'Nombre minimum d’articles à conserver', + 'ttl' => 'Ne pas automatiquement rafraîchir plus souvent que', 'categorize' => 'Ranger dans une catégorie', 'truncate' => 'Supprimer tous les articles', 'advanced' => 'Avancé', @@ -166,19 +232,24 @@ 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', + '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é.', - 'think_to_add' => '<a href="./?c=configure&a=feed">Vous pouvez ajouter des flux</a>.', + 'think_to_add' => 'Vous pouvez ajouter des flux.', 'current_user' => 'Utilisateur actuel', 'password_form' => 'Mot de passe<br /><small>(pour connexion par formulaire)</small>', + 'password_api' => 'Mot de passe API<br /><small>(ex. : pour applis mobiles)</small>', 'default_user' => 'Nom de l’utilisateur par défaut <small>(16 caractères alphanumériques maximum)</small>', 'persona_connection_email' => 'Adresse courriel de connexion<br /><small>(pour <a href="https://persona.org/" rel="external">Mozilla Persona</a>)</small>', '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 connexions automatiques non-sûres au format : ', + 'api_enabled' => 'Autoriser l’accès par <abbr>API</abbr> <small>(nécessaire pour les applis mobiles)</small>', '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.<br /><kbd>%s?output=rss&token=%s</kbd>', + 'explain_token' => 'Permet d’accéder à la sortie RSS de l’utilisateur par défaut sans besoin de s’authentifier.<br /><kbd>%s?output=rss&token=%s</kbd>', 'login_configuration' => 'Identification', 'is_admin' => 'est administrateur', 'auth_type' => 'Méthode d’authentification', @@ -189,32 +260,42 @@ return array ( 'users_list' => 'Liste des utilisateurs', 'create_user' => 'Créer un nouvel utilisateur', 'username' => 'Nom d’utilisateur', + 'username_admin' => 'Nom d’utilisateur administrateur', 'password' => 'Mot de passe', 'create' => 'Créer', - 'user_created' => 'L’utilisateur %s a été créé', - 'user_deleted' => 'L’utilisateur %s a été supprimé', + 'user_created' => 'L’utilisateur %s a été créé.', + 'user_deleted' => 'L’utilisateur %s a été supprimé.', 'language' => 'Langue', 'month' => 'mois', 'archiving_configuration' => 'Archivage', - 'delete_articles_every' => 'Supprimer les articles après', + 'delete_articles_every' => 'Supprimer les articles après', 'purge_now' => 'Purger maintenant', - 'purge_completed' => 'Purge effectuée (%d articles supprimés)', - 'archiving_configuration_help' => 'D’autres options sont disponibles dans la configuration individuelle des flux', + 'purge_completed' => 'Purge effectuée (%d articles supprimés).', + 'archiving_configuration_help' => 'D’autres options sont disponibles dans la configuration individuelle des flux.', 'reading_configuration' => 'Lecture', + 'display_configuration' => 'Affichage', 'articles_per_page' => 'Nombre d’articles par page', + 'number_divided_when_reader' => 'Divisé par 2 dans la vue de lecture.', 'default_view' => 'Vue par défaut', + 'articles_to_display' => 'Articles à afficher', 'sort_order' => 'Ordre de tri', 'auto_load_more' => 'Charger les articles suivants en bas de page', 'display_articles_unfolded' => 'Afficher les articles dépliés par défaut', + 'display_categories_unfolded' => 'Afficher les catégories pliées par défaut', + 'hide_read_feeds' => 'Cacher les catégories & flux sans article non-lu (ne fonctionne pas avec la configuration “Afficher tous les articles”)', 'after_onread' => 'Après “marquer tout comme lu”,', 'jump_next' => 'sauter au prochain voisin non lu (flux ou catégorie)', - 'reading_icons' => 'Icônes de lecture', + 'article_icons' => 'Icônes d’article', 'top_line' => 'Ligne du haut', 'bottom_line' => 'Ligne du bas', + 'html5_notif_timeout' => 'Temps d’affichage de la notification HTML5', + 'seconds_(0_means_no_timeout)' => 'secondes (0 signifie aucun timeout ) ', 'img_with_lazyload' => 'Utiliser le mode “chargement différé” pour les images', + 'sticky_post' => 'Aligner l’article en haut quand il est ouvert', + 'reading_confirm' => 'Afficher une confirmation lors des actions “marquer tout comme lu”', 'auto_read_when' => 'Marquer un article comme lu…', - 'article_selected' => 'lorsque l’article est sélectionné', + 'article_viewed' => 'lorsque l’article est affiché', 'article_open_on_website' => 'lorsque l’article est ouvert sur le site d’origine', 'scroll' => 'au défilement de la page', 'upon_reception' => 'dès la réception du nouvel article', @@ -227,9 +308,15 @@ return array ( 'optimize_bdd' => 'Optimiser la base de données', 'optimize_todo_sometimes' => 'À faire de temps en temps pour réduire la taille de la BDD', 'theme' => 'Thème', + 'content_width' => 'Largeur du contenu', + 'width_thin' => 'Fine', + 'width_medium' => 'Moyenne', + 'width_large' => 'Large', + 'width_no_limit' => 'Pas de limite', 'more_information' => 'Plus d’informations', 'activate_sharing' => 'Activer le partage', 'shaarli' => 'Shaarli', + 'blogotext' => 'Blogotext', 'wallabag' => 'wallabag', 'diaspora' => 'Diaspora*', 'twitter' => 'Twitter', @@ -274,13 +361,16 @@ return array ( 'version' => 'Version', 'logs' => 'Logs', - 'logs_empty' => 'Les logs sont vides', + 'logs_empty' => 'Les logs sont vides.', 'clear_logs' => 'Effacer les logs', 'forbidden_access' => 'L’accès vous est interdit !', 'login_required' => 'Accès protégé par mot de passe :', 'confirm_action' => 'Êtes-vous sûr(e) de vouloir continuer ? Cette action ne peut être annulée !', + 'confirm_action_feed_cat' => 'Êtes-vous sûr(e) de vouloir continuer ? Vous pourriez perdre les favoris et les filtres associés. Cette action ne peut être annulée !', + 'notif_title_new_articles' => 'FreshRSS : nouveaux articles !', + 'notif_body_new_articles' => 'Il y a \d nouveaux articles à lire sur FreshRSS.', // DATE 'january' => 'janvier', @@ -295,6 +385,25 @@ return array ( 'october' => 'octobre', 'november' => 'novembre', 'december' => 'décembre', + 'jan' => 'jan.', + 'feb' => 'fév.', + 'mar' => 'mar.', + 'apr' => 'avr.', + 'may' => 'mai.', + 'jun' => 'juin', + 'jul' => 'jui.', + 'aug' => 'août', + 'sep' => 'sep.', + 'oct' => 'oct.', + 'nov' => 'nov.', + 'dec' => 'déc.', + 'sun' => 'dim.', + 'mon' => 'lun.', + 'tue' => 'mar.', + 'wed' => 'mer.', + 'thu' => 'jeu.', + 'fri' => 'ven.', + 'sat' => 'sam.', // format spécial pour la fonction date() 'Jan' => '\j\a\n\v\i\e\r', 'Feb' => '\f\é\v\r\i\e\r', @@ -323,4 +432,23 @@ return array ( 'stats_entry_per_category' => 'Articles par catégorie', 'stats_top_feed' => 'Les dix plus gros flux', 'stats_entry_count' => 'Nombre d’articles', + 'stats_no_idle' => 'Il n’y a aucun flux inactif !', + + 'update' => 'Mise à jour', + 'update_system' => 'Système de mise à jour', + 'update_check' => 'Vérifier les mises à jour', + 'update_last' => 'Dernière vérification : %s', + 'update_can_apply' => 'Une mise à jour est disponible.', + 'update_apply' => 'Appliquer la mise à jour', + 'update_server_not_found' => 'Le serveur de mise à jour n’a pas été trouvé. [%s]', + 'no_update' => 'Aucune mise à jour à appliquer', + 'update_problem' => 'La mise à jour a rencontré un problème : %s', + 'update_finished' => 'La mise à jour est terminée !', + + 'auth_reset' => 'Réinitialisation de l’authentification', + 'auth_will_reset' => 'Le système d’authentification va être réinitialisé : un formulaire sera utilisé à la place de Persona.', + 'auth_not_persona' => 'Seul le système d’authentification Persona peut être réinitialisé.', + 'auth_no_password_set' => 'Aucun mot de passe administrateur n’a été précisé. Cette fonctionnalité n’est pas disponible.', + 'auth_form_set' => 'Le formulaire est désormais votre système d’authentification.', + 'auth_form_not_set' => 'Un problème est survenu lors de la configuration de votre système d’authentification. Veuillez réessayer plus tard.', ); diff --git a/app/i18n/install.en.php b/app/i18n/install.en.php index 0311ee9a4..c422de90f 100644 --- a/app/i18n/install.en.php +++ b/app/i18n/install.en.php @@ -28,8 +28,8 @@ return array ( 'minz_is_nok' => 'You lack the Minz framework. You should execute <em>build.sh</em> script or <a href="https://github.com/marienfressinaud/MINZ">download it on Github</a> and install in <em>%s</em> directory the content of its <em>/lib</em> directory.', 'curl_is_ok' => 'You have version %s of cURL', 'curl_is_nok' => 'You lack cURL (php5-curl package)', - 'pdomysql_is_ok' => 'You have PDO and its driver for MySQL', - 'pdomysql_is_nok' => 'You lack PDO or its driver for MySQL (php5-mysql package)', + 'pdo_is_ok' => 'You have PDO and at least one of the supported drivers (pdo_mysql, pdo_sqlite)', + 'pdo_is_nok' => 'You lack PDO or one of the supported drivers (pdo_mysql, pdo_sqlite)', 'dom_is_ok' => 'You have the required library to browse the DOM', 'dom_is_nok' => 'You lack a required library to browse the DOM (php-xml package)', 'pcre_is_ok' => 'You have the required library for regular expressions (PCRE)', @@ -42,6 +42,8 @@ return array ( 'data_is_ok' => 'Permissions on data directory are good', 'persona_is_ok' => 'Permissions on Mozilla Persona directory are good', 'file_is_nok' => 'Check permissions on <em>%s</em> directory. HTTP server must have rights to write into', + 'http_referer_is_ok' => 'Your HTTP REFERER is known and corresponds to your server.', + 'http_referer_is_nok' => 'Please check that you are not altering your HTTP REFERER.', 'fix_errors_before' => 'Fix errors before skip to the next step.', 'general_conf_is_ok' => 'General configuration has been saved.', @@ -61,7 +63,7 @@ return array ( 'update_end' => 'Update process is completed, now you can go to the final step.', - 'installation_is_ok' => 'The installation process was successful.<br />The final step will now attempt to delete the <kbd>./p/i/install.php</kbd> file and any database backup created during the update process.<br />You may choose to skip this step and delete <kbd>./p/i/install.php</kbd> manually.', + 'installation_is_ok' => 'The installation process was successful.<br />The final step will now attempt to delete any file and database backup created during the update process.<br />You may choose to skip this step by deleting <kbd>./data/do-install.txt</kbd> manually.', 'finish_installation' => 'Complete installation', 'install_not_deleted' => 'Something went wrong; you must delete the file <em>%s</em> manually.', ); diff --git a/app/i18n/install.fr.php b/app/i18n/install.fr.php index bb183642f..785c02459 100644 --- a/app/i18n/install.fr.php +++ b/app/i18n/install.fr.php @@ -28,8 +28,8 @@ return array ( 'minz_is_nok' => 'Vous ne disposez pas de la librairie Minz. Vous devriez exécuter le script <em>build.sh</em> ou bien <a href="https://github.com/marienfressinaud/MINZ">la télécharger sur Github</a> et installer dans le répertoire <em>%s</em> le contenu de son répertoire <em>/lib</em>.', 'curl_is_ok' => 'Vous disposez de cURL dans sa version %s', 'curl_is_nok' => 'Vous ne disposez pas de cURL (paquet php5-curl)', - 'pdomysql_is_ok' => 'Vous disposez de PDO et de son driver pour MySQL (paquet php5-mysql)', - 'pdomysql_is_nok' => 'Vous ne disposez pas de PDO ou de son driver pour MySQL', + 'pdo_is_ok' => 'Vous disposez de PDO et d’au moins un des drivers supportés (pdo_mysql, pdo_sqlite)', + 'pdo_is_nok' => 'Vous ne disposez pas de PDO ou d’un des drivers supportés (pdo_mysql, pdo_sqlite)', 'dom_is_ok' => 'Vous disposez du nécessaire pour parcourir le DOM', 'dom_is_nok' => 'Il manque une librairie pour parcourir le DOM (paquet php-xml)', 'pcre_is_ok' => 'Vous disposez du nécessaire pour les expressions régulières (PCRE)', @@ -42,6 +42,8 @@ return array ( 'data_is_ok' => 'Les droits sur le répertoire de data sont bons', 'persona_is_ok' => 'Les droits sur le répertoire de Mozilla Persona sont bons', 'file_is_nok' => 'Veuillez vérifier les droits sur le répertoire <em>%s</em>. Le serveur HTTP doit être capable d’écrire dedans', + 'http_referer_is_ok' => 'Le HTTP REFERER est connu et semble correspondre à votre serveur.', + 'http_referer_is_nok' => 'Veuillez vérifier que vous ne modifiez pas votre HTTP REFERER.', 'fix_errors_before' => 'Veuillez corriger les erreurs avant de passer à l’étape suivante.', 'general_conf_is_ok' => 'La configuration générale a été enregistrée.', @@ -60,7 +62,7 @@ return array ( 'update_long' => 'Ce processus peut prendre longtemps, selon la taille de votre base de données. Vous aurez peut-être à attendre que cette page dépasse son temps maximum d’exécution (~5 minutes) puis à la recharger.', 'update_end' => 'La mise à jour est terminée, vous pouvez maintenant passer à l’étape finale.', - 'installation_is_ok' => 'L’installation s’est bien passée.<br />La dernière étape va maintenant tenter de supprimer le fichier <kbd>./p/i/install.php</kbd>, ainsi que d’éventuelles copies de base de données créées durant le processus de mise à jour.<br />Vous pouvez choisir de sauter cette étape et de supprimer <kbd>./p/i/install.php</kbd> manuellement.', + 'installation_is_ok' => 'L’installation s’est bien passée.<br />La dernière étape va maintenant tenter de supprimer les fichiers ainsi que d’éventuelles copies de base de données créés durant le processus de mise à jour.<br />Vous pouvez choisir de sauter cette étape en supprimant <kbd>./data/do-install.txt</kbd> manuellement.', 'finish_installation' => 'Terminer l’installation', 'install_not_deleted' => 'Quelque chose s’est mal passé, vous devez supprimer le fichier <em>%s</em> à la main.', ); diff --git a/app/install.php b/app/install.php new file mode 100644 index 000000000..4449cd063 --- /dev/null +++ b/app/install.php @@ -0,0 +1,879 @@ +<?php +if (function_exists('opcache_reset')) { + opcache_reset(); +} + +define('BCRYPT_COST', 9); + +session_name('FreshRSS'); +session_set_cookie_params(0, dirname(empty($_SERVER['REQUEST_URI']) ? '/' : dirname($_SERVER['REQUEST_URI'])), null, false, true); +session_start(); + +if (isset($_GET['step'])) { + define('STEP',(int)$_GET['step']); +} else { + define('STEP', 0); +} + +define('SQL_CREATE_DB', 'CREATE DATABASE IF NOT EXISTS %1$s DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); + +if (STEP === 3 && isset($_POST['type'])) { + $_SESSION['bd_type'] = $_POST['type']; +} + +if (isset($_SESSION['bd_type'])) { + switch ($_SESSION['bd_type']) { + case 'mysql': + include(APP_PATH . '/SQL/install.sql.mysql.php'); + break; + case 'sqlite': + include(APP_PATH . '/SQL/install.sql.sqlite.php'); + break; + } +} + +function param($key, $default = false) { + if (isset($_POST[$key])) { + return $_POST[$key]; + } else { + return $default; + } +} + + +// gestion internationalisation +$translates = array(); +$actual = 'en'; +function initTranslate() { + global $translates; + global $actual; + + $actual = isset($_SESSION['language']) ? $_SESSION['language'] : getBetterLanguage('en'); + + $file = APP_PATH . '/i18n/' . $actual . '.php'; + if (file_exists($file)) { + $translates = array_merge($translates, include($file)); + } + + $file = APP_PATH . '/i18n/install.' . $actual . '.php'; + if (file_exists($file)) { + $translates = array_merge($translates, include($file)); + } +} + +function getBetterLanguage($fallback) { + $available = availableLanguages(); + $accept = $_SERVER['HTTP_ACCEPT_LANGUAGE']; + $language = strtolower(substr($accept, 0, 2)); + + if (isset($available[$language])) { + return $language; + } else { + return $fallback; + } +} + +function availableLanguages() { + return array( + 'en' => 'English', + 'fr' => 'Français' + ); +} + +function _t($key) { + global $translates; + $translate = $key; + if (isset($translates[$key])) { + $translate = $translates[$key]; + } + + $args = func_get_args(); + unset($args[0]); + + return vsprintf($translate, $args); +} + + +/*** SAUVEGARDES ***/ +function saveLanguage() { + if (!empty($_POST)) { + if (!isset($_POST['language'])) { + return false; + } + + $_SESSION['language'] = $_POST['language']; + + header('Location: index.php?step=1'); + } +} + +function saveStep2() { + if (!empty($_POST)) { + $_SESSION['title'] = substr(trim(param('title', _t('freshrss'))), 0, 25); + $_SESSION['old_entries'] = param('old_entries', 3); + $_SESSION['auth_type'] = param('auth_type', 'form'); + $_SESSION['default_user'] = substr(preg_replace('/[^a-zA-Z0-9]/', '', param('default_user', '')), 0, 16); + $_SESSION['mail_login'] = filter_var(param('mail_login', ''), FILTER_VALIDATE_EMAIL); + + $password_plain = param('passwordPlain', false); + if ($password_plain !== false) { + if (!function_exists('password_hash')) { + include_once(LIB_PATH . '/password_compat.php'); + } + $passwordHash = password_hash($password_plain, PASSWORD_BCRYPT, array('cost' => BCRYPT_COST)); + $passwordHash = preg_replace('/^\$2[xy]\$/', '\$2a\$', $passwordHash); //Compatibility with bcrypt.js + $_SESSION['passwordHash'] = $passwordHash; + } + + if (empty($_SESSION['title']) || + empty($_SESSION['old_entries']) || + empty($_SESSION['auth_type']) || + empty($_SESSION['default_user'])) { + return false; + } + + if (($_SESSION['auth_type'] === 'form' && empty($_SESSION['passwordHash'])) || + ($_SESSION['auth_type'] === 'persona' && empty($_SESSION['mail_login']))) { + return false; + } + + $_SESSION['salt'] = sha1(uniqid(mt_rand(), true).implode('', stat(__FILE__))); + if ((!ctype_digit($_SESSION['old_entries'])) ||($_SESSION['old_entries'] < 1)) { + $_SESSION['old_entries'] = 3; + } + + $token = ''; + if ($_SESSION['mail_login']) { + $token = sha1($_SESSION['salt'] . $_SESSION['mail_login']); + } + + $config_array = array( + 'language' => $_SESSION['language'], + 'theme' => 'Origine', + 'old_entries' => $_SESSION['old_entries'], + 'mail_login' => $_SESSION['mail_login'], + 'passwordHash' => $_SESSION['passwordHash'], + 'token' => $token, + ); + + $configPath = DATA_PATH . '/' . $_SESSION['default_user'] . '_user.php'; + @unlink($configPath); //To avoid access-rights problems + file_put_contents($configPath, "<?php\n return " . var_export($config_array, true) . ';'); + + if ($_SESSION['mail_login'] != '') { + $personaFile = DATA_PATH . '/persona/' . $_SESSION['mail_login'] . '.txt'; + @unlink($personaFile); + file_put_contents($personaFile, $_SESSION['default_user']); + } + + header('Location: index.php?step=3'); + } +} + +function saveStep3() { + if (!empty($_POST)) { + if ($_SESSION['bd_type'] === 'sqlite') { + $_SESSION['bd_base'] = $_SESSION['default_user']; + $_SESSION['bd_host'] = ''; + $_SESSION['bd_user'] = ''; + $_SESSION['bd_password'] = ''; + $_SESSION['bd_prefix'] = ''; + $_SESSION['bd_prefix_user'] = ''; //No prefix for SQLite + } else { + if (empty($_POST['type']) || + empty($_POST['host']) || + empty($_POST['user']) || + empty($_POST['base'])) { + $_SESSION['bd_error'] = 'Missing parameters!'; + } + $_SESSION['bd_base'] = substr($_POST['base'], 0, 64); + $_SESSION['bd_host'] = $_POST['host']; + $_SESSION['bd_user'] = $_POST['user']; + $_SESSION['bd_password'] = $_POST['pass']; + $_SESSION['bd_prefix'] = substr($_POST['prefix'], 0, 16); + $_SESSION['bd_prefix_user'] = $_SESSION['bd_prefix'] .(empty($_SESSION['default_user']) ? '' :($_SESSION['default_user'] . '_')); + } + + $ini_array = array( + 'general' => array( + 'environment' => empty($_SESSION['environment']) ? 'production' : $_SESSION['environment'], + 'salt' => $_SESSION['salt'], + 'base_url' => '', + 'title' => $_SESSION['title'], + 'default_user' => $_SESSION['default_user'], + 'allow_anonymous' => isset($_SESSION['allow_anonymous']) ? $_SESSION['allow_anonymous'] : false, + 'allow_anonymous_refresh' => isset($_SESSION['allow_anonymous_refresh']) ? $_SESSION['allow_anonymous_refresh'] : false, + 'auth_type' => $_SESSION['auth_type'], + 'api_enabled' => isset($_SESSION['api_enabled']) ? $_SESSION['api_enabled'] : false, + 'unsafe_autologin_enabled' => isset($_SESSION['unsafe_autologin_enabled']) ? $_SESSION['unsafe_autologin_enabled'] : false, + ), + 'db' => array( + 'type' => $_SESSION['bd_type'], + 'host' => $_SESSION['bd_host'], + 'user' => $_SESSION['bd_user'], + 'password' => $_SESSION['bd_password'], + 'base' => $_SESSION['bd_base'], + 'prefix' => $_SESSION['bd_prefix'], + ), + ); + + @unlink(DATA_PATH . '/config.php'); //To avoid access-rights problems + file_put_contents(DATA_PATH . '/config.php', "<?php\n return " . var_export($ini_array, true) . ';'); + + $res = checkBD(); + + if ($res) { + $_SESSION['bd_error'] = ''; + header('Location: index.php?step=4'); + } elseif (empty($_SESSION['bd_error'])) { + $_SESSION['bd_error'] = 'Unknown error!'; + } + } + invalidateHttpCache(); +} + +function newPdo() { + switch ($_SESSION['bd_type']) { + case 'mysql': + $str = 'mysql:host=' . $_SESSION['bd_host'] . ';dbname=' . $_SESSION['bd_base']; + $driver_options = array( + PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8', + ); + break; + case 'sqlite': + $str = 'sqlite:' . DATA_PATH . '/' . $_SESSION['default_user'] . '.sqlite'; + $driver_options = array( + PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, + ); + break; + default: + return false; + } + return new PDO($str, $_SESSION['bd_user'], $_SESSION['bd_password'], $driver_options); +} + +function deleteInstall() { + $res = unlink(DATA_PATH . '/do-install.txt'); + + if (!$res) { + return false; + } + + header('Location: index.php'); +} + + +/*** VÉRIFICATIONS ***/ +function checkStep() { + $s0 = checkStep0(); + $s1 = checkStep1(); + $s2 = checkStep2(); + $s3 = checkStep3(); + if (STEP > 0 && $s0['all'] != 'ok') { + header('Location: index.php?step=0'); + } elseif (STEP > 1 && $s1['all'] != 'ok') { + header('Location: index.php?step=1'); + } elseif (STEP > 2 && $s2['all'] != 'ok') { + header('Location: index.php?step=2'); + } elseif (STEP > 3 && $s3['all'] != 'ok') { + header('Location: index.php?step=3'); + } + $_SESSION['actualize_feeds'] = true; +} + +function checkStep0() { + $languages = availableLanguages(); + $language = isset($_SESSION['language']) && + isset($languages[$_SESSION['language']]); + + return array( + 'language' => $language ? 'ok' : 'ko', + 'all' => $language ? 'ok' : 'ko' + ); +} + +function checkStep1() { + $php = version_compare(PHP_VERSION, '5.2.1') >= 0; + $minz = file_exists(LIB_PATH . '/Minz'); + $curl = extension_loaded('curl'); + $pdo_mysql = extension_loaded('pdo_mysql'); + $pdo_sqlite = extension_loaded('pdo_sqlite'); + $pdo = $pdo_mysql || $pdo_sqlite; + $pcre = extension_loaded('pcre'); + $ctype = extension_loaded('ctype'); + $dom = class_exists('DOMDocument'); + $data = DATA_PATH && is_writable(DATA_PATH); + $cache = CACHE_PATH && is_writable(CACHE_PATH); + $log = LOG_PATH && is_writable(LOG_PATH); + $favicons = is_writable(DATA_PATH . '/favicons'); + $persona = is_writable(DATA_PATH . '/persona'); + $http_referer = is_referer_from_same_domain(); + + return array( + 'php' => $php ? 'ok' : 'ko', + 'minz' => $minz ? 'ok' : 'ko', + 'curl' => $curl ? 'ok' : 'ko', + 'pdo-mysql' => $pdo_mysql ? 'ok' : 'ko', + 'pdo-sqlite' => $pdo_sqlite ? 'ok' : 'ko', + 'pdo' => $pdo ? 'ok' : 'ko', + 'pcre' => $pcre ? 'ok' : 'ko', + 'ctype' => $ctype ? 'ok' : 'ko', + 'dom' => $dom ? 'ok' : 'ko', + 'data' => $data ? 'ok' : 'ko', + 'cache' => $cache ? 'ok' : 'ko', + 'log' => $log ? 'ok' : 'ko', + 'favicons' => $favicons ? 'ok' : 'ko', + 'persona' => $persona ? 'ok' : 'ko', + 'http_referer' => $http_referer ? 'ok' : 'ko', + 'all' => $php && $minz && $curl && $pdo && $pcre && $ctype && $dom && + $data && $cache && $log && $favicons && $persona && $http_referer ? + 'ok' : 'ko' + ); +} + +function checkStep2() { + $conf = !empty($_SESSION['title']) && + !empty($_SESSION['old_entries']) && + isset($_SESSION['mail_login']) && + !empty($_SESSION['default_user']); + + $form = ( + isset($_SESSION['auth_type']) && + ($_SESSION['auth_type'] != 'form' || !empty($_SESSION['passwordHash'])) + ); + + $persona = ( + isset($_SESSION['auth_type']) && + ($_SESSION['auth_type'] != 'persona' || !empty($_SESSION['mail_login'])) + ); + + $defaultUser = empty($_POST['default_user']) ? null : $_POST['default_user']; + if ($defaultUser === null) { + $defaultUser = empty($_SESSION['default_user']) ? '' : $_SESSION['default_user']; + } + $data = is_writable(DATA_PATH . '/' . $defaultUser . '_user.php'); + + return array( + 'conf' => $conf ? 'ok' : 'ko', + 'form' => $form ? 'ok' : 'ko', + 'persona' => $persona ? 'ok' : 'ko', + 'data' => $data ? 'ok' : 'ko', + 'all' => $conf && $form && $persona && $data ? 'ok' : 'ko' + ); +} + +function checkStep3() { + $conf = is_writable(DATA_PATH . '/config.php'); + + $bd = isset($_SESSION['bd_type']) && + isset($_SESSION['bd_host']) && + isset($_SESSION['bd_user']) && + isset($_SESSION['bd_password']) && + isset($_SESSION['bd_base']) && + isset($_SESSION['bd_prefix']) && + isset($_SESSION['bd_error']); + $conn = empty($_SESSION['bd_error']); + + return array( + 'bd' => $bd ? 'ok' : 'ko', + 'conn' => $conn ? 'ok' : 'ko', + 'conf' => $conf ? 'ok' : 'ko', + 'all' => $bd && $conn && $conf ? 'ok' : 'ko' + ); +} + +function checkBD() { + $ok = false; + + try { + $str = ''; + $driver_options = null; + switch ($_SESSION['bd_type']) { + case 'mysql': + $driver_options = array( + PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8' + ); + + try { // on ouvre une connexion juste pour créer la base si elle n'existe pas + $str = 'mysql:host=' . $_SESSION['bd_host'] . ';'; + $c = new PDO($str, $_SESSION['bd_user'], $_SESSION['bd_password'], $driver_options); + $sql = sprintf(SQL_CREATE_DB, $_SESSION['bd_base']); + $res = $c->query($sql); + } catch (PDOException $e) { + } + + // on écrase la précédente connexion en sélectionnant la nouvelle BDD + $str = 'mysql:host=' . $_SESSION['bd_host'] . ';dbname=' . $_SESSION['bd_base']; + break; + case 'sqlite': + $str = 'sqlite:' . DATA_PATH . '/' . $_SESSION['default_user'] . '.sqlite'; + $driver_options = array( + PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, + ); + break; + default: + return false; + } + + $c = new PDO($str, $_SESSION['bd_user'], $_SESSION['bd_password'], $driver_options); + + if (defined('SQL_CREATE_TABLES')) { + $sql = sprintf(SQL_CREATE_TABLES, $_SESSION['bd_prefix_user'], _t('default_category')); + $stm = $c->prepare($sql); + $ok = $stm->execute(); + } else { + global $SQL_CREATE_TABLES; + if (is_array($SQL_CREATE_TABLES)) { + $ok = true; + foreach ($SQL_CREATE_TABLES as $instruction) { + $sql = sprintf($instruction, $_SESSION['bd_prefix_user'], _t('default_category')); + $stm = $c->prepare($sql); + $ok &= $stm->execute(); + } + } + } + } catch (PDOException $e) { + $ok = false; + $_SESSION['bd_error'] = $e->getMessage(); + } + + if (!$ok) { + @unlink(DATA_PATH . '/config.php'); + } + + return $ok; +} + +/*** AFFICHAGE ***/ +function printStep0() { + global $actual; +?> + <?php $s0 = checkStep0(); if ($s0['all'] == 'ok') { ?> + <p class="alert alert-success"><span class="alert-head"><?php echo _t('ok'); ?></span> <?php echo _t('language_defined'); ?></p> + <?php } ?> + + <form action="index.php?step=0" method="post"> + <legend><?php echo _t('choose_language'); ?></legend> + <div class="form-group"> + <label class="group-name" for="language"><?php echo _t('language'); ?></label> + <div class="group-controls"> + <select name="language" id="language"> + <?php $languages = availableLanguages(); ?> + <?php foreach ($languages as $short => $lib) { ?> + <option value="<?php echo $short; ?>"<?php echo $actual == $short ? ' selected="selected"' : ''; ?>><?php echo $lib; ?></option> + <?php } ?> + </select> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo _t('save'); ?></button> + <button type="reset" class="btn"><?php echo _t('cancel'); ?></button> + <?php if ($s0['all'] == 'ok') { ?> + <a class="btn btn-important next-step" href="?step=1"><?php echo _t('next_step'); ?></a> + <?php } ?> + </div> + </div> + </form> +<?php +} + +function printStep1() { + $res = checkStep1(); +?> + <noscript><p class="alert alert-warn"><span class="alert-head"><?php echo _t('attention'); ?></span> <?php echo _t('javascript_is_better'); ?></p></noscript> + + <?php if ($res['php'] == 'ok') { ?> + <p class="alert alert-success"><span class="alert-head"><?php echo _t('ok'); ?></span> <?php echo _t('php_is_ok', PHP_VERSION); ?></p> + <?php } else { ?> + <p class="alert alert-error"><span class="alert-head"><?php echo _t('damn'); ?></span> <?php echo _t('php_is_nok', PHP_VERSION, '5.2.1'); ?></p> + <?php } ?> + + <?php if ($res['minz'] == 'ok') { ?> + <p class="alert alert-success"><span class="alert-head"><?php echo _t('ok'); ?></span> <?php echo _t('minz_is_ok'); ?></p> + <?php } else { ?> + <p class="alert alert-error"><span class="alert-head"><?php echo _t('damn'); ?></span> <?php echo _t('minz_is_nok', LIB_PATH . '/Minz'); ?></p> + <?php } ?> + + <?php if ($res['pdo'] == 'ok') { ?> + <p class="alert alert-success"><span class="alert-head"><?php echo _t('ok'); ?></span> <?php echo _t('pdo_is_ok'); ?></p> + <?php } else { ?> + <p class="alert alert-error"><span class="alert-head"><?php echo _t('damn'); ?></span> <?php echo _t('pdo_is_nok'); ?></p> + <?php } ?> + + <?php if ($res['curl'] == 'ok') { ?> + <?php $version = curl_version(); ?> + <p class="alert alert-success"><span class="alert-head"><?php echo _t('ok'); ?></span> <?php echo _t('curl_is_ok', $version['version']); ?></p> + <?php } else { ?> + <p class="alert alert-error"><span class="alert-head"><?php echo _t('damn'); ?></span> <?php echo _t('curl_is_nok'); ?></p> + <?php } ?> + + <?php if ($res['pcre'] == 'ok') { ?> + <p class="alert alert-success"><span class="alert-head"><?php echo _t('ok'); ?></span> <?php echo _t('pcre_is_ok'); ?></p> + <?php } else { ?> + <p class="alert alert-error"><span class="alert-head"><?php echo _t('damn'); ?></span> <?php echo _t('pcre_is_nok'); ?></p> + <?php } ?> + + <?php if ($res['ctype'] == 'ok') { ?> + <p class="alert alert-success"><span class="alert-head"><?php echo _t('ok'); ?></span> <?php echo _t('ctype_is_ok'); ?></p> + <?php } else { ?> + <p class="alert alert-error"><span class="alert-head"><?php echo _t('damn'); ?></span> <?php echo _t('ctype_is_nok'); ?></p> + <?php } ?> + + <?php if ($res['dom'] == 'ok') { ?> + <p class="alert alert-success"><span class="alert-head"><?php echo _t('ok'); ?></span> <?php echo _t('dom_is_ok'); ?></p> + <?php } else { ?> + <p class="alert alert-error"><span class="alert-head"><?php echo _t('damn'); ?></span> <?php echo _t('dom_is_nok'); ?></p> + <?php } ?> + + <?php if ($res['data'] == 'ok') { ?> + <p class="alert alert-success"><span class="alert-head"><?php echo _t('ok'); ?></span> <?php echo _t('data_is_ok'); ?></p> + <?php } else { ?> + <p class="alert alert-error"><span class="alert-head"><?php echo _t('damn'); ?></span> <?php echo _t('file_is_nok', DATA_PATH); ?></p> + <?php } ?> + + <?php if ($res['cache'] == 'ok') { ?> + <p class="alert alert-success"><span class="alert-head"><?php echo _t('ok'); ?></span> <?php echo _t('cache_is_ok'); ?></p> + <?php } else { ?> + <p class="alert alert-error"><span class="alert-head"><?php echo _t('damn'); ?></span> <?php echo _t('file_is_nok', CACHE_PATH); ?></p> + <?php } ?> + + <?php if ($res['log'] == 'ok') { ?> + <p class="alert alert-success"><span class="alert-head"><?php echo _t('ok'); ?></span> <?php echo _t('log_is_ok'); ?></p> + <?php } else { ?> + <p class="alert alert-error"><span class="alert-head"><?php echo _t('damn'); ?></span> <?php echo _t('file_is_nok', LOG_PATH); ?></p> + <?php } ?> + + <?php if ($res['favicons'] == 'ok') { ?> + <p class="alert alert-success"><span class="alert-head"><?php echo _t('ok'); ?></span> <?php echo _t('favicons_is_ok'); ?></p> + <?php } else { ?> + <p class="alert alert-error"><span class="alert-head"><?php echo _t('damn'); ?></span> <?php echo _t('file_is_nok', DATA_PATH . '/favicons'); ?></p> + <?php } ?> + + <?php if ($res['persona'] == 'ok') { ?> + <p class="alert alert-success"><span class="alert-head"><?php echo _t('ok'); ?></span> <?php echo _t('persona_is_ok'); ?></p> + <?php } else { ?> + <p class="alert alert-error"><span class="alert-head"><?php echo _t('damn'); ?></span> <?php echo _t('file_is_nok', DATA_PATH . '/persona'); ?></p> + <?php } ?> + + <?php if ($res['http_referer'] == 'ok') { ?> + <p class="alert alert-success"><span class="alert-head"><?php echo _t('ok'); ?></span> <?php echo _t('http_referer_is_ok'); ?></p> + <?php } else { ?> + <p class="alert alert-error"><span class="alert-head"><?php echo _t('damn'); ?></span> <?php echo _t('http_referer_is_nok'); ?></p> + <?php } ?> + + <?php if ($res['all'] == 'ok') { ?> + <a class="btn btn-important next-step" href="?step=2"><?php echo _t('next_step'); ?></a> + <?php } else { ?> + <p class="alert alert-error"><?php echo _t('fix_errors_before'); ?></p> + <?php } ?> +<?php +} + +function printStep2() { +?> + <?php $s2 = checkStep2(); if ($s2['all'] == 'ok') { ?> + <p class="alert alert-success"><span class="alert-head"><?php echo _t('ok'); ?></span> <?php echo _t('general_conf_is_ok'); ?></p> + <?php } elseif (!empty($_POST)) { ?> + <p class="alert alert-error"><?php echo _t('fix_errors_before'); ?></p> + <?php } ?> + + <form action="index.php?step=2" method="post"> + <legend><?php echo _t('general_configuration'); ?></legend> + + <div class="form-group"> + <label class="group-name" for="title"><?php echo _t('title'); ?></label> + <div class="group-controls"> + <input type="text" id="title" name="title" value="<?php echo isset($_SESSION['title']) ? $_SESSION['title'] : _t('freshrss'); ?>" /> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="old_entries"><?php echo _t('delete_articles_every'); ?></label> + <div class="group-controls"> + <input type="number" id="old_entries" name="old_entries" required="required" min="1" max="1200" value="<?php echo isset($_SESSION['old_entries']) ? $_SESSION['old_entries'] : '3'; ?>" /> <?php echo _t('month'); ?> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="default_user"><?php echo _t('default_user'); ?></label> + <div class="group-controls"> + <input type="text" id="default_user" name="default_user" required="required" size="16" maxlength="16" pattern="[0-9a-zA-Z]{1,16}" value="<?php echo isset($_SESSION['default_user']) ? $_SESSION['default_user'] : ''; ?>" placeholder="<?php echo httpAuthUser() == '' ? 'user1' : httpAuthUser(); ?>" /> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="auth_type"><?php echo _t('auth_type'); ?></label> + <div class="group-controls"> + <select id="auth_type" name="auth_type" required="required" onchange="auth_type_change(true)"> + <?php + function no_auth($auth_type) { + return !in_array($auth_type, array('form', 'persona', 'http_auth', 'none')); + } + $auth_type = isset($_SESSION['auth_type']) ? $_SESSION['auth_type'] : ''; + ?> + <option value="form"<?php echo $auth_type === 'form' || no_auth($auth_type) ? ' selected="selected"' : '', cryptAvailable() ? '' : ' disabled="disabled"'; ?>><?php echo _t('auth_form'); ?></option> + <option value="persona"<?php echo $auth_type === 'persona' ? ' selected="selected"' : ''; ?>><?php echo _t('auth_persona'); ?></option> + <option value="http_auth"<?php echo $auth_type === 'http_auth' ? ' selected="selected"' : '', httpAuthUser() == '' ? ' disabled="disabled"' : ''; ?>><?php echo _t('http_auth'); ?>(REMOTE_USER = '<?php echo httpAuthUser(); ?>')</option> + <option value="none"<?php echo $auth_type === 'none' ? ' selected="selected"' : ''; ?>><?php echo _t('auth_none'); ?></option> + </select> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="passwordPlain"><?php echo _t('password_form'); ?></label> + <div class="group-controls"> + <div class="stick"> + <input type="password" id="passwordPlain" name="passwordPlain" pattern=".{7,}" autocomplete="off" <?php echo $auth_type === 'form' ? ' required="required"' : ''; ?> /> + <a class="btn toggle-password" data-toggle="passwordPlain"><?php echo FreshRSS_Themes::icon('key'); ?></a> + </div> + <noscript><b><?php echo _t('javascript_should_be_activated'); ?></b></noscript> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="mail_login"><?php echo _t('persona_connection_email'); ?></label> + <div class="group-controls"> + <input type="email" id="mail_login" name="mail_login" value="<?php echo isset($_SESSION['mail_login']) ? $_SESSION['mail_login'] : ''; ?>" placeholder="alice@example.net" <?php echo $auth_type === 'persona' ? ' required="required"' : ''; ?> /> + <noscript><b><?php echo _t('javascript_should_be_activated'); ?></b></noscript> + </div> + </div> + + <script> + function toggle_password() { + var button = this; + var passwordField = document.getElementById(button.getAttribute('data-toggle')); + + passwordField.setAttribute('type', 'text'); + button.className += ' active'; + + setTimeout(function() { + passwordField.setAttribute('type', 'password'); + button.className = button.className.replace(/(?:^|\s)active(?!\S)/g , ''); + }, 2000); + + return false; + } + toggles = document.getElementsByClassName('toggle-password'); + for (var i = 0 ; i < toggles.length ; i++) { + toggles[i].addEventListener('click', toggle_password); + } + + function auth_type_change(focus) { + var auth_value = document.getElementById('auth_type').value, + password_input = document.getElementById('passwordPlain'), + mail_input = document.getElementById('mail_login'); + + if (auth_value === 'form') { + password_input.required = true; + mail_input.required = false; + if (focus) { + password_input.focus(); + } + } else if (auth_value === 'persona') { + password_input.required = false; + mail_input.required = true; + if (focus) { + mail_input.focus(); + } + } else { + password_input.required = false; + mail_input.required = false; + } + } + auth_type_change(false); + </script> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo _t('save'); ?></button> + <button type="reset" class="btn"><?php echo _t('cancel'); ?></button> + <?php if ($s2['all'] == 'ok') { ?> + <a class="btn btn-important next-step" href="?step=3"><?php echo _t('next_step'); ?></a> + <?php } ?> + </div> + </div> + </form> +<?php +} + +function printStep3() { +?> + <?php $s3 = checkStep3(); if ($s3['all'] == 'ok') { ?> + <p class="alert alert-success"><span class="alert-head"><?php echo _t('ok'); ?></span> <?php echo _t('bdd_conf_is_ok'); ?></p> + <?php } elseif ($s3['conn'] == 'ko') { ?> + <p class="alert alert-error"><span class="alert-head"><?php echo _t('damn'); ?></span> <?php echo _t('bdd_conf_is_ko'),(empty($_SESSION['bd_error']) ? '' : ' : ' . $_SESSION['bd_error']); ?></p> + <?php } ?> + + <form action="index.php?step=3" method="post"> + <legend><?php echo _t('bdd_configuration'); ?></legend> + <div class="form-group"> + <label class="group-name" for="type"><?php echo _t('bdd_type'); ?></label> + <div class="group-controls"> + <select name="type" id="type" onchange="mySqlShowHide()"> + <?php if (extension_loaded('pdo_mysql')) {?> + <option value="mysql" + <?php echo(isset($_SESSION['bd_type']) && $_SESSION['bd_type'] === 'mysql') ? 'selected="selected"' : ''; ?>> + MySQL + </option> + <?php }?> + <?php if (extension_loaded('pdo_sqlite')) {?> + <option value="sqlite" + <?php echo(isset($_SESSION['bd_type']) && $_SESSION['bd_type'] === 'sqlite') ? 'selected="selected"' : ''; ?>> + SQLite + </option> + <?php }?> + </select> + </div> + </div> + + <div id="mysql"> + <div class="form-group"> + <label class="group-name" for="host"><?php echo _t('host'); ?></label> + <div class="group-controls"> + <input type="text" id="host" name="host" pattern="[0-9A-Za-z_.-]{1,64}" value="<?php echo isset($_SESSION['bd_host']) ? $_SESSION['bd_host'] : 'localhost'; ?>" /> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="user"><?php echo _t('username'); ?></label> + <div class="group-controls"> + <input type="text" id="user" name="user" maxlength="16" pattern="[0-9A-Za-z_.-]{1,16}" value="<?php echo isset($_SESSION['bd_user']) ? $_SESSION['bd_user'] : ''; ?>" /> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="pass"><?php echo _t('password'); ?></label> + <div class="group-controls"> + <input type="password" id="pass" name="pass" value="<?php echo isset($_SESSION['bd_password']) ? $_SESSION['bd_password'] : ''; ?>" /> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="base"><?php echo _t('bdd'); ?></label> + <div class="group-controls"> + <input type="text" id="base" name="base" maxlength="64" pattern="[0-9A-Za-z_]{1,64}" value="<?php echo isset($_SESSION['bd_base']) ? $_SESSION['bd_base'] : ''; ?>" placeholder="freshrss" /> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="prefix"><?php echo _t('prefix'); ?></label> + <div class="group-controls"> + <input type="text" id="prefix" name="prefix" maxlength="16" pattern="[0-9A-Za-z_]{1,16}" value="<?php echo isset($_SESSION['bd_prefix']) ? $_SESSION['bd_prefix'] : 'freshrss_'; ?>" /> + </div> + </div> + </div> + <script> + function mySqlShowHide() { + document.getElementById('mysql').style.display = document.getElementById('type').value === 'mysql' ? 'block' : 'none'; + } + mySqlShowHide(); + </script> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo _t('save'); ?></button> + <button type="reset" class="btn"><?php echo _t('cancel'); ?></button> + <?php if ($s3['all'] == 'ok') { ?> + <a class="btn btn-important next-step" href="?step=4"><?php echo _t('next_step'); ?></a> + <?php } ?> + </div> + </div> + </form> +<?php +} + +function printStep4() { +?> + <p class="alert alert-success"><span class="alert-head"><?php echo _t('congratulations'); ?></span> <?php echo _t('installation_is_ok'); ?></p> + <a class="btn btn-important next-step" href="?step=5"><?php echo _t('finish_installation'); ?></a> +<?php +} + +function printStep5() { +?> + <p class="alert alert-error"><span class="alert-head"><?php echo _t('oops'); ?></span> <?php echo _t('install_not_deleted', DATA_PATH . '/do-install.txt'); ?></p> +<?php +} + +checkStep(); + +initTranslate(); + +switch (STEP) { +case 0: +default: + saveLanguage(); + break; +case 1: + break; +case 2: + saveStep2(); + break; +case 3: + saveStep3(); + break; +case 4: + break; +case 5: + deleteInstall(); + break; +} +?> +<!DOCTYPE html> +<html lang="fr"> + <head> + <meta charset="utf-8"> + <meta name="viewport" content="initial-scale=1.0"> + <title><?php echo _t('freshrss_installation'); ?></title> + <link rel="stylesheet" type="text/css" media="all" href="../themes/base-theme/template.css" /> + <link rel="stylesheet" type="text/css" media="all" href="../themes/Origine/origine.css" /> + </head> + <body> + +<div class="header"> + <div class="item title"> + <h1><a href="index.php"><?php echo _t('freshrss'); ?></a></h1> + <h2><?php echo _t('installation_step', STEP); ?></h2> + </div> +</div> + +<div id="global"> + <ul class="nav nav-list aside"> + <li class="nav-header"><?php echo _t('steps'); ?></li> + <li class="item<?php echo STEP == 0 ? ' active' : ''; ?>"><a href="?step=0"><?php echo _t('language'); ?></a></li> + <li class="item<?php echo STEP == 1 ? ' active' : ''; ?>"><a href="?step=1"><?php echo _t('checks'); ?></a></li> + <li class="item<?php echo STEP == 2 ? ' active' : ''; ?>"><a href="?step=2"><?php echo _t('general_configuration'); ?></a></li> + <li class="item<?php echo STEP == 3 ? ' active' : ''; ?>"><a href="?step=3"><?php echo _t('bdd_configuration'); ?></a></li> + <li class="item<?php echo STEP == 4 ? ' active' : ''; ?>"><a href="?step=5"><?php echo _t('this_is_the_end'); ?></a></li> + </ul> + + <div class="post"> + <?php + switch (STEP) { + case 0: + default: + printStep0(); + break; + case 1: + printStep1(); + break; + case 2: + printStep2(); + break; + case 3: + printStep3(); + break; + case 4: + printStep4(); + break; + case 5: + printStep5(); + break; + } + ?> + </div> +</div> + </body> +</html> diff --git a/app/layout/aside_configure.phtml b/app/layout/aside_configure.phtml index 27f11ab6d..d5c9bf4c9 100644 --- a/app/layout/aside_configure.phtml +++ b/app/layout/aside_configure.phtml @@ -1,19 +1,33 @@ <ul class="nav nav-list aside"> - <li class="nav-header"><?php echo Minz_Translate::t ('configuration'); ?></li> - <li class="item<?php echo Minz_Request::actionName () == 'display' ? ' active' : ''; ?>"> - <a href="<?php echo _url ('configure', 'display'); ?>"><?php echo Minz_Translate::t ('reading_configuration'); ?></a> + <li class="nav-header"><?php echo _t('configuration'); ?></li> + <li class="item<?php echo Minz_Request::actionName() === 'display' ? ' active' : ''; ?>"> + <a href="<?php echo _url('configure', 'display'); ?>"><?php echo _t('display_configuration'); ?></a> </li> - <li class="item<?php echo Minz_Request::actionName () == 'archiving' ? ' active' : ''; ?>"> - <a href="<?php echo _url ('configure', 'archiving'); ?>"><?php echo Minz_Translate::t ('archiving_configuration'); ?></a> + <li class="item<?php echo Minz_Request::actionName() === 'reading' ? ' active' : ''; ?>"> + <a href="<?php echo _url('configure', 'reading'); ?>"><?php echo _t('reading_configuration'); ?></a> </li> - <li class="item<?php echo Minz_Request::actionName () == 'sharing' ? ' active' : ''; ?>"> - <a href="<?php echo _url ('configure', 'sharing'); ?>"><?php echo Minz_Translate::t ('sharing'); ?></a> + <li class="item<?php echo Minz_Request::actionName() === 'archiving' ? ' active' : ''; ?>"> + <a href="<?php echo _url('configure', 'archiving'); ?>"><?php echo _t('archiving_configuration'); ?></a> </li> - <li class="item<?php echo Minz_Request::actionName () == 'shortcut' ? ' active' : ''; ?>"> - <a href="<?php echo _url ('configure', 'shortcut'); ?>"><?php echo Minz_Translate::t ('shortcuts'); ?></a> + <li class="item<?php echo Minz_Request::actionName() === 'sharing' ? ' active' : ''; ?>"> + <a href="<?php echo _url('configure', 'sharing'); ?>"><?php echo _t('sharing'); ?></a> + </li> + <li class="item<?php echo Minz_Request::actionName() === 'shortcut' ? ' active' : ''; ?>"> + <a href="<?php echo _url('configure', 'shortcut'); ?>"><?php echo _t('shortcuts'); ?></a> + </li> + <li class="item<?php echo Minz_Request::actionName() === 'queries' ? ' active' : ''; ?>"> + <a href="<?php echo _url('configure', 'queries'); ?>"><?php echo _t('queries'); ?></a> </li> <li class="separator"></li> - <li class="item<?php echo Minz_Request::actionName () == 'users' ? ' active' : ''; ?>"> - <a href="<?php echo _url ('configure', 'users'); ?>"><?php echo Minz_Translate::t ('users'); ?></a> + <li class="item<?php echo Minz_Request::actionName() === 'users' ? ' active' : ''; ?>"> + <a href="<?php echo _url('configure', 'users'); ?>"><?php echo _t('users'); ?></a> + </li> + <?php + $current_user = Minz_Session::param('currentUser', ''); + if (Minz_Configuration::isAdmin($current_user)) { + ?> + <li class="item<?php echo Minz_Request::controllerName() === 'update' ? ' active' : ''; ?>"> + <a href="<?php echo _url('update', 'index'); ?>"><?php echo _t('update'); ?></a> </li> + <?php } ?> </ul> diff --git a/app/layout/aside_feed.phtml b/app/layout/aside_feed.phtml index e324b15bd..5ffb1c791 100644 --- a/app/layout/aside_feed.phtml +++ b/app/layout/aside_feed.phtml @@ -20,9 +20,14 @@ <?php echo $cat->name (); ?> </option> <?php } ?> + <option value="nc"><?php echo Minz_Translate::t ('new_category'); ?></option> </select> </li> + <li class="input" style="display:none"> + <input type="text" name="new_category[name]" id="new_category_name" autocomplete="off" placeholder="<?php echo Minz_Translate::t ('new_category'); ?>" /> + </li> + <li class="separator"></li> <li class="dropdown-header"><?php echo Minz_Translate::t ('http_authentication'); ?></li> @@ -38,8 +43,14 @@ </div> </form></li> - <li class="item<?php echo Minz_Request::actionName () == 'importExport' ? ' active' : ''; ?>"> - <a href="<?php echo _url ('configure', 'importExport'); ?>"><?php echo Minz_Translate::t ('import_export_opml'); ?></a> + <li class="item"> + <a onclick="return false;" href="javascript:(function(){var%20url%20=%20location.href;window.open('<?php echo Minz_Url::display(array('c' => 'feed', 'a' => 'add'), 'html', true); ?>&url_rss='+encodeURIComponent(url), '_blank');})();"> + <?php echo Minz_Translate::t('bookmark'); ?> + </a> + </li> + + <li class="item<?php echo Minz_Request::controllerName () == 'importExport' ? ' active' : ''; ?>"> + <a href="<?php echo _url ('importExport', 'index'); ?>"><?php echo Minz_Translate::t ('import_export'); ?></a> </li> <li class="item<?php echo Minz_Request::actionName () == 'categorize' ? ' active' : ''; ?>"> @@ -51,7 +62,7 @@ <?php if (!empty ($this->feeds)) { ?> <?php foreach ($this->feeds as $feed) { ?> <?php $nbEntries = $feed->nbEntries (); ?> - <li class="item<?php echo ($this->flux && $this->flux->id () == $feed->id ()) ? ' active' : ''; ?><?php echo $feed->inError () ? ' error' : ''; ?><?php echo $nbEntries == 0 ? ' empty' : ''; ?>"> + <li class="item<?php echo (isset($this->flux) && $this->flux->id () == $feed->id ()) ? ' active' : ''; ?><?php echo $feed->inError () ? ' error' : ''; ?><?php echo $nbEntries == 0 ? ' empty' : ''; ?>"> <a href="<?php echo _url ('configure', 'feed', 'id', $feed->id ()); ?>"> <img class="favicon" src="<?php echo $feed->favicon (); ?>" alt="✇" /> <?php echo $feed->name (); ?> diff --git a/app/layout/aside_flux.phtml b/app/layout/aside_flux.phtml index 817dae676..aac3c0896 100644 --- a/app/layout/aside_flux.phtml +++ b/app/layout/aside_flux.phtml @@ -1,16 +1,18 @@ -<div class="aside aside_flux" id="aside_flux"> - <a class="toggle_aside" href="#close"><?php echo FreshRSS_Themes::icon('close'); ?></a> +<div class="aside aside_flux<?php if ($this->conf->hide_read_feeds && ($this->state & FreshRSS_Entry::STATE_NOT_READ) && !($this->state & FreshRSS_Entry::STATE_READ)) echo ' state_unread'; ?>" id="aside_flux"> + <a class="toggle_aside" href="#close"><?php echo _i('close'); ?></a> <ul class="categories"> <?php if ($this->loginOk) { ?> + <form id="mark-read-aside" method="post" style="display: none"></form> + <li> - <div class="stick"> - <a class="btn btn-important" href="<?php echo _url ('configure', 'feed'); ?>"><?php echo Minz_Translate::t ('subscription_management'); ?></a> - <a class="btn btn-important" href="<?php echo _url ('configure', 'categorize'); ?>" title="<?php echo Minz_Translate::t ('categories_management'); ?>"><?php echo FreshRSS_Themes::icon('category-white'); ?></a> + <div class="stick configure-feeds"> + <a class="btn btn-important" href="<?php echo _url('configure', 'feed'); ?>"><?php echo _t('subscription_management'); ?></a> + <a class="btn btn-important" href="<?php echo _url('configure', 'categorize'); ?>" title="<?php echo _t('categories_management'); ?>"><?php echo _i('category-white'); ?></a> </div> </li> <?php } elseif (Minz_Configuration::needsLogin()) { ?> - <li><a href="<?php echo _url ('index', 'about'); ?>"><?php echo Minz_Translate::t ('about_freshrss'); ?></a></li> + <li><a href="<?php echo _url('index', 'about'); ?>"><?php echo _t('about_freshrss'); ?></a></li> <?php } ?> <?php @@ -22,8 +24,8 @@ <li> <div class="category all<?php echo $this->get_c == 'a' ? ' active' : ''; ?>"> <a data-unread="<?php echo formatNumber($this->nb_not_read); ?>" class="btn<?php echo $this->get_c == 'a' ? ' active' : ''; ?>" href="<?php echo Minz_Url::display($arUrl); ?>"> - <?php echo FreshRSS_Themes::icon('all'); ?> - <?php echo Minz_Translate::t ('main_stream'); ?> + <?php echo _i('all'); ?> + <?php echo _t('main_stream'); ?> </a> </div> </li> @@ -31,38 +33,42 @@ <li> <div class="category favorites<?php echo $this->get_c == 's' ? ' active' : ''; ?>"> <a data-unread="<?php echo formatNumber($this->nb_favorites['unread']); ?>" class="btn<?php echo $this->get_c == 's' ? ' active' : ''; ?>" href="<?php $arUrl['params']['get'] = 's'; echo Minz_Url::display($arUrl); ?>"> - <?php echo FreshRSS_Themes::icon('bookmark'); ?> - <?php echo Minz_Translate::t('favorite_feeds', formatNumber($this->nb_favorites['all'])); ?> + <?php echo _i('bookmark'); ?> + <?php echo _t('favorite_feeds', formatNumber($this->nb_favorites['all'])); ?> </a> </div> </li> <?php foreach ($this->cat_aside as $cat) { - $feeds = $cat->feeds (); - if (!empty ($feeds)) { - ?><li><?php + $feeds = $cat->feeds(); + if (!empty($feeds)) { $c_active = false; - if ($this->get_c == $cat->id ()) { + $c_show = false; + if ($this->get_c == $cat->id()) { $c_active = true; + if (!$this->conf->display_categories || $this->get_f) { + $c_show = true; + } } + ?><li data-unread="<?php echo $cat->nbNotRead(); ?>"<?php if ($c_active) echo ' class="active"'; ?>><?php ?><div class="category stick<?php echo $c_active ? ' active' : ''; ?>"><?php - ?><a data-unread="<?php echo formatNumber($cat->nbNotRead()); ?>" class="btn<?php echo $c_active ? ' active' : ''; ?>" href="<?php $arUrl['params']['get'] = 'c_' . $cat->id(); echo Minz_Url::display($arUrl); ?>"><?php echo $cat->name (); ?></a><?php - ?><a class="btn dropdown-toggle" href="#"><?php echo FreshRSS_Themes::icon($c_active ? 'up' : 'down'); ?></a><?php + ?><a data-unread="<?php echo formatNumber($cat->nbNotRead()); ?>" class="btn<?php echo $c_active ? ' active' : ''; ?>" href="<?php $arUrl['params']['get'] = 'c_' . $cat->id(); echo Minz_Url::display($arUrl); ?>"><?php echo $cat->name(); ?></a><?php + ?><a class="btn dropdown-toggle" href="#"><?php echo _i($c_show ? 'up' : 'down'); ?></a><?php ?></div><?php - ?><ul class="feeds<?php echo $c_active ? ' active' : ''; ?>"><?php + ?><ul class="feeds<?php echo $c_show ? ' active' : ''; ?>"><?php foreach ($feeds as $feed) { - $feed_id = $feed->id (); - $nbEntries = $feed->nbEntries (); + $feed_id = $feed->id(); + $nbEntries = $feed->nbEntries(); $f_active = ($this->get_f == $feed_id); - ?><li id="f_<?php echo $feed_id; ?>" class="item<?php echo $f_active ? ' active' : ''; ?><?php echo $feed->inError () ? ' error' : ''; ?><?php echo $nbEntries == 0 ? ' empty' : ''; ?>"><?php + ?><li id="f_<?php echo $feed_id; ?>" class="item<?php echo $f_active ? ' active' : ''; ?><?php echo $feed->inError() ? ' error' : ''; ?><?php echo $nbEntries == 0 ? ' empty' : ''; ?>" data-unread="<?php echo $feed->nbNotRead(); ?>"><?php ?><div class="dropdown"><?php ?><div class="dropdown-target"></div><?php - ?><a class="dropdown-toggle" data-fweb="<?php echo $feed->website (); ?>"><?php echo FreshRSS_Themes::icon('configure'); ?></a><?php + ?><a class="dropdown-toggle" data-fweb="<?php echo $feed->website(); ?>"><?php echo _i('configure'); ?></a><?php /* feed_config_template */ ?></div><?php - ?> <img class="favicon" src="<?php echo $feed->favicon (); ?>" alt="✇" /> <?php - ?><a class="feed" data-unread="<?php echo formatNumber($feed->nbNotRead()); ?>" data-priority="<?php echo $feed->priority (); ?>" href="<?php $arUrl['params']['get'] = 'f_' . $feed_id; echo Minz_Url::display($arUrl); ?>"><?php echo $feed->name(); ?></a><?php + ?> <img class="favicon" src="<?php echo $feed->favicon(); ?>" alt="✇" /> <?php + ?><a class="feed" data-unread="<?php echo formatNumber($feed->nbNotRead()); ?>" data-priority="<?php echo $feed->priority(); ?>" href="<?php $arUrl['params']['get'] = 'f_' . $feed_id; echo Minz_Url::display($arUrl); ?>"><?php echo $feed->name(); ?></a><?php ?></li><?php } ?></ul><?php @@ -76,13 +82,22 @@ <script id="feed_config_template" type="text/html"> <ul class="dropdown-menu"> <li class="dropdown-close"><a href="#close">❌</a></li> - <li class="item"><a href="<?php echo _url ('index', 'index', 'get', 'f_!!!!!!'); ?>"><?php echo Minz_Translate::t ('filter'); ?></a></li> - <li class="item"><a target="_blank" href="http://example.net/"><?php echo Minz_Translate::t ('see_website'); ?></a></li> + <li class="item"><a href="<?php echo _url('index', 'index', 'get', 'f_!!!!!!'); ?>"><?php echo _t('filter'); ?></a></li> + <?php if ($this->loginOk) { ?> + <li class="item"><a href="<?php echo _url('stats', 'repartition', 'id', '!!!!!!'); ?>"><?php echo _t('stats'); ?></a></li> + <?php } ?> + <li class="item"><a target="_blank" href="http://example.net/"><?php echo _t('see_website'); ?></a></li> <?php if ($this->loginOk) { ?> <li class="separator"></li> - <li class="item"><a href="<?php echo _url ('configure', 'feed', 'id', '!!!!!!'); ?>"><?php echo Minz_Translate::t ('administration'); ?></a></li> - <li class="item"><a href="<?php echo _url ('feed', 'actualize', 'id', '!!!!!!'); ?>"><?php echo Minz_Translate::t ('actualize'); ?></a></li> - <li class="item"><a href="<?php echo _url ('entry', 'read', 'get', 'f_!!!!!!'); ?>"><?php echo Minz_Translate::t ('mark_read'); ?></a></li> + <li class="item"><a href="<?php echo _url('configure', 'feed', 'id', '!!!!!!'); ?>"><?php echo _t('administration'); ?></a></li> + <li class="item"><a href="<?php echo _url('feed', 'actualize', 'id', '!!!!!!'); ?>"><?php echo _t('actualize'); ?></a></li> + <li class="item"> + <?php $confirm = $this->conf->reading_confirm ? 'confirm' : ''; ?> + <button class="read_all as-link <?php echo $confirm; ?>" + form="mark-read-aside" + formaction="<?php echo _url('entry', 'read', 'get', 'f_!!!!!!'); ?>" + type="submit"><?php echo _t('mark_read'); ?></button> + </li> <?php } ?> </ul> </script> diff --git a/app/layout/aside_stats.phtml b/app/layout/aside_stats.phtml new file mode 100644 index 000000000..fbfb9d84d --- /dev/null +++ b/app/layout/aside_stats.phtml @@ -0,0 +1,12 @@ +<ul class="nav nav-list aside"> + <li class="nav-header"><?php echo Minz_Translate::t ('stats'); ?></li> + <li class="item<?php echo Minz_Request::actionName () == 'index' ? ' active' : ''; ?>"> + <a href="<?php echo _url ('stats', 'index'); ?>"><?php echo Minz_Translate::t ('stats_main'); ?></a> + </li> + <li class="item<?php echo Minz_Request::actionName () == 'idle' ? ' active' : ''; ?>"> + <a href="<?php echo _url ('stats', 'idle'); ?>"><?php echo Minz_Translate::t ('stats_idle'); ?></a> + </li> + <li class="item<?php echo Minz_Request::actionName () == 'repartition' ? ' active' : ''; ?>"> + <a href="<?php echo _url ('stats', 'repartition'); ?>"><?php echo Minz_Translate::t ('stats_repartition'); ?></a> + </li> +</ul> diff --git a/app/layout/header.phtml b/app/layout/header.phtml index d20f7487f..028e63d8a 100644 --- a/app/layout/header.phtml +++ b/app/layout/header.phtml @@ -2,20 +2,20 @@ if (Minz_Configuration::canLogIn()) { ?><ul class="nav nav-head nav-login"><?php switch (Minz_Configuration::authType()) { - case 'form': - if ($this->loginOk) { - ?><li class="item"><?php echo FreshRSS_Themes::icon('logout'); ?> <a class="signout" href="<?php echo _url ('index', 'formLogout'); ?>"><?php echo Minz_Translate::t ('logout'); ?></a></li><?php - } else { - ?><li class="item"><?php echo FreshRSS_Themes::icon('login'); ?> <a class="signin" href="<?php echo _url ('index', 'formLogin'); ?>"><?php echo Minz_Translate::t ('login'); ?></a></li><?php - } - break; - case 'persona': - if ($this->loginOk) { - ?><li class="item"><?php echo FreshRSS_Themes::icon('logout'); ?> <a class="signout" href="#"><?php echo Minz_Translate::t ('logout'); ?></a></li><?php - } else { - ?><li class="item"><?php echo FreshRSS_Themes::icon('login'); ?> <a class="signin" href="#"><?php echo Minz_Translate::t ('login'); ?></a></li><?php - } - break; + case 'form': + if ($this->loginOk) { + ?><li class="item"><?php echo _i('logout'); ?> <a class="signout" href="<?php echo _url('index', 'formLogout'); ?>"><?php echo _t('logout'); ?></a></li><?php + } else { + ?><li class="item"><?php echo _i('login'); ?> <a class="signin" href="<?php echo _url('index', 'formLogin'); ?>"><?php echo _t('login'); ?></a></li><?php + } + break; + case 'persona': + if ($this->loginOk) { + ?><li class="item"><?php echo _i('logout'); ?> <a class="signout" href="#"><?php echo _t('logout'); ?></a></li><?php + } else { + ?><li class="item"><?php echo _i('login'); ?> <a class="signin" href="#"><?php echo _t('login'); ?></a></li><?php + } + break; } ?></ul><?php } @@ -24,36 +24,36 @@ if (Minz_Configuration::canLogIn()) { <div class="header"> <div class="item title"> <h1> - <a href="<?php echo _url ('index', 'index'); ?>"> - <img class="logo" src="<?php echo Minz_Url::display ('/themes/icons/icon.svg'); ?>" alt="⊚" /> - <?php echo Minz_Configuration::title (); ?> + <a href="<?php echo _url('index', 'index'); ?>"> + <img class="logo" src="<?php echo _i('icon', true); ?>" alt="⊚" /> + <?php echo Minz_Configuration::title(); ?> </a> </h1> </div> <div class="item search"> <?php if ($this->loginOk || Minz_Configuration::allowAnonymous()) { ?> - <form action="<?php echo _url ('index', 'index'); ?>" method="get"> + <form action="<?php echo _url('index', 'index'); ?>" method="get"> <div class="stick"> - <?php $search = Minz_Request::param ('search', ''); ?> - <input type="search" name="search" id="search" class="extend" value="<?php echo $search; ?>" placeholder="<?php echo Minz_Translate::t ('search'); ?>" /> + <?php $search = Minz_Request::param('search', ''); ?> + <input type="search" name="search" id="search" class="extend" value="<?php echo $search; ?>" placeholder="<?php echo _t('search'); ?>" /> - <?php $get = Minz_Request::param ('get', ''); ?> - <?php if($get != '') { ?> + <?php $get = Minz_Request::param('get', ''); ?> + <?php if ($get != '') { ?> <input type="hidden" name="get" value="<?php echo $get; ?>" /> <?php } ?> - <?php $order = Minz_Request::param ('order', ''); ?> - <?php if($order != '') { ?> + <?php $order = Minz_Request::param('order', ''); ?> + <?php if ($order != '') { ?> <input type="hidden" name="order" value="<?php echo $order; ?>" /> <?php } ?> - <?php $state = Minz_Request::param ('state', ''); ?> - <?php if($state != '') { ?> + <?php $state = Minz_Request::param('state', ''); ?> + <?php if ($state != '') { ?> <input type="hidden" name="state" value="<?php echo $state; ?>" /> <?php } ?> - <button class="btn" type="submit"><?php echo FreshRSS_Themes::icon('search'); ?></button> + <button class="btn" type="submit"><?php echo _i('search'); ?></button> </div> </form> <?php } ?> @@ -63,30 +63,38 @@ if (Minz_Configuration::canLogIn()) { <div class="item configure"> <div class="dropdown"> <div id="dropdown-configure" class="dropdown-target"></div> - <a class="btn dropdown-toggle" href="#dropdown-configure"><?php echo FreshRSS_Themes::icon('configure'); ?></a> + <a class="btn dropdown-toggle" href="#dropdown-configure"><?php echo _i('configure'); ?></a> <ul class="dropdown-menu"> <li class="dropdown-close"><a href="#close">❌</a></li> - <li class="dropdown-header"><?php echo Minz_Translate::t ('configuration'); ?></li> - <li class="item"><a href="<?php echo _url ('configure', 'display'); ?>"><?php echo Minz_Translate::t ('reading_configuration'); ?></a></li> - <li class="item"><a href="<?php echo _url ('configure', 'archiving'); ?>"><?php echo Minz_Translate::t ('archiving_configuration'); ?></a></li> - <li class="item"><a href="<?php echo _url ('configure', 'sharing'); ?>"><?php echo Minz_Translate::t ('sharing'); ?></a></li> - <li class="item"><a href="<?php echo _url ('configure', 'shortcut'); ?>"><?php echo Minz_Translate::t ('shortcuts'); ?></a></li> + <li class="dropdown-header"><?php echo _t('configuration'); ?></li> + <li class="item"><a href="<?php echo _url('configure', 'display'); ?>"><?php echo _t('display_configuration'); ?></a></li> + <li class="item"><a href="<?php echo _url('configure', 'reading'); ?>"><?php echo _t('reading_configuration'); ?></a></li> + <li class="item"><a href="<?php echo _url('configure', 'archiving'); ?>"><?php echo _t('archiving_configuration'); ?></a></li> + <li class="item"><a href="<?php echo _url('configure', 'sharing'); ?>"><?php echo _t('sharing'); ?></a></li> + <li class="item"><a href="<?php echo _url('configure', 'shortcut'); ?>"><?php echo _t('shortcuts'); ?></a></li> + <li class="item"><a href="<?php echo _url('configure', 'queries'); ?>"><?php echo _t('queries'); ?></a></li> <li class="separator"></li> - <li class="item"><a href="<?php echo _url ('configure', 'users'); ?>"><?php echo Minz_Translate::t ('users'); ?></a></li> + <li class="item"><a href="<?php echo _url('configure', 'users'); ?>"><?php echo _t('users'); ?></a></li> + <?php + $current_user = Minz_Session::param('currentUser', ''); + if (Minz_Configuration::isAdmin($current_user)) { + ?> + <li class="item"><a href="<?php echo _url('update', 'index'); ?>"><?php echo _t('update'); ?></a></li> + <?php } ?> <li class="separator"></li> - <li class="item"><a href="<?php echo _url ('index', 'stats'); ?>"><?php echo Minz_Translate::t ('stats'); ?></a></li> - <li class="item"><a href="<?php echo _url ('index', 'logs'); ?>"><?php echo Minz_Translate::t ('logs'); ?></a></li> - <li class="item"><a href="<?php echo _url ('index', 'about'); ?>"><?php echo Minz_Translate::t ('about'); ?></a></li> + <li class="item"><a href="<?php echo _url('stats', 'index'); ?>"><?php echo _t('stats'); ?></a></li> + <li class="item"><a href="<?php echo _url('index', 'logs'); ?>"><?php echo _t('logs'); ?></a></li> + <li class="item"><a href="<?php echo _url('index', 'about'); ?>"><?php echo _t('about'); ?></a></li> <?php if (Minz_Configuration::canLogIn()) { ?><li class="separator"></li><?php switch (Minz_Configuration::authType()) { - case 'form': - ?><li class="item"><a class="signout" href="<?php echo _url ('index', 'formLogout'); ?>"><?php echo FreshRSS_Themes::icon('logout'), ' ', Minz_Translate::t ('logout'); ?></a></li><?php - break; - case 'persona': - ?><li class="item"><a class="signout" href="#"><?php echo FreshRSS_Themes::icon('logout'), ' ', Minz_Translate::t ('logout'); ?></a></li><?php - break; + case 'form': + ?><li class="item"><a class="signout" href="<?php echo _url('index', 'formLogout'); ?>"><?php echo _i('logout'), ' ', _t('logout'); ?></a></li><?php + break; + case 'persona': + ?><li class="item"><a class="signout" href="#"><?php echo _i('logout'), ' ', _t('logout'); ?></a></li><?php + break; } } ?> </ul> @@ -95,12 +103,12 @@ if (Minz_Configuration::canLogIn()) { <?php } elseif (Minz_Configuration::canLogIn()) { ?><div class="item configure"><?php switch (Minz_Configuration::authType()) { - case 'form': - echo FreshRSS_Themes::icon('login'); ?><a class="signin" href="<?php echo _url ('index', 'formLogin'); ?>"><?php echo Minz_Translate::t ('login'); ?></a></li><?php - break; - case 'persona': - echo FreshRSS_Themes::icon('login'); ?><a class="signin" href="#"><?php echo Minz_Translate::t ('login'); ?></a></li><?php - break; + case 'form': + echo _i('login'); ?><a class="signin" href="<?php echo _url('index', 'formLogin'); ?>"><?php echo _t('login'); ?></a></li><?php + break; + case 'persona': + echo _i('login'); ?><a class="signin" href="#"><?php echo _t('login'); ?></a></li><?php + break; } ?></div><?php } ?> diff --git a/app/layout/layout.phtml b/app/layout/layout.phtml index 1501df3c3..f95f45b5e 100644 --- a/app/layout/layout.phtml +++ b/app/layout/layout.phtml @@ -3,49 +3,58 @@ <head> <meta charset="UTF-8" /> <meta name="viewport" content="initial-scale=1.0" /> - <?php echo self::headTitle (); ?> - <?php echo self::headStyle (); ?> - <?php echo self::headScript (); ?> + <?php echo self::headTitle(); ?> + <?php echo self::headStyle(); ?> + <?php echo self::headScript(); ?> <script>//<![CDATA[ -<?php $this->renderHelper ('javascript_vars'); ?> +<?php $this->renderHelper('javascript_vars'); ?> //]]></script> <?php if (!empty($this->nextId)) { - $params = Minz_Request::params (); + $params = Minz_Request::params(); $params['next'] = $this->nextId; + $params['ajax'] = 1; ?> - <link id="prefetch" rel="next prefetch" href="<?php echo Minz_Url::display (array ('c' => Minz_Request::controllerName (), 'a' => Minz_Request::actionName (), 'params' => $params)); ?>" /> + <link id="prefetch" rel="next prefetch" href="<?php echo Minz_Url::display(array('c' => Minz_Request::controllerName(), 'a' => Minz_Request::actionName(), 'params' => $params)); ?>" /> <?php } ?> - <link rel="shortcut icon" type="image/x-icon" sizes="16x16 64x64" href="<?php echo Minz_Url::display('/favicon.ico'); ?>" /> + <link rel="shortcut icon" id="favicon" type="image/x-icon" sizes="16x16 64x64" href="<?php echo Minz_Url::display('/favicon.ico'); ?>" /> <link rel="icon msapplication-TileImage apple-touch-icon" type="image/png" sizes="256x256" href="<?php echo Minz_Url::display('/themes/icons/favicon-256.png'); ?>" /> -<?php if (isset ($this->rss_url)) { ?> - <link rel="alternate" type="application/rss+xml" title="<?php echo $this->rss_title; ?>" href="<?php echo Minz_Url::display ($this->rss_url); ?>" /> +<?php + if (isset($this->url)) { + $rss_url = $this->url; + $rss_url['params']['output'] = 'rss'; +?> + <link rel="alternate" type="application/rss+xml" title="<?php echo $this->rss_title; ?>" href="<?php echo Minz_Url::display($rss_url); ?>" /> <?php } ?> <link rel="prefetch" href="<?php echo FreshRSS_Themes::icon('starred', true); ?>"> <link rel="prefetch" href="<?php echo FreshRSS_Themes::icon('non-starred', true); ?>"> <link rel="prefetch" href="<?php echo FreshRSS_Themes::icon('read', true); ?>"> <link rel="prefetch" href="<?php echo FreshRSS_Themes::icon('unread', true); ?>"> + <link rel="apple-touch-icon" href="<?php echo Minz_Url::display('/themes/icons/apple-touch-icon.png'); ?>"> + <meta name="apple-mobile-web-app-capable" content="yes" /> + <meta name="apple-mobile-web-app-status-bar-style" content="black" /> + <meta name="apple-mobile-web-app-title" content="<?php echo Minz_Configuration::title(); ?>"> <meta name="msapplication-TileColor" content="#FFF" /> <meta name="robots" content="noindex,nofollow" /> </head> <body class="<?php echo Minz_Request::param('output', 'normal'); ?>"> -<?php $this->partial ('header'); ?> +<?php $this->partial('header'); ?> <div id="global"> - <?php $this->render (); ?> + <?php $this->render(); ?> </div> <?php $msg = ''; $status = 'closed'; - if (isset ($this->notification)) { + if (isset($this->notification)) { $msg = $this->notification['content']; $status = $this->notification['type']; invalidateHttpCache(); } ?> -<div id="notification" class="<?php echo $status; ?>"> +<div id="notification" class="notification <?php echo $status; ?>"> <span class="msg"><?php echo $msg; ?></span> <a class="close" href=""><?php echo FreshRSS_Themes::icon('close'); ?></a> </div> diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml index 98064a6f7..a9e6614e7 100644 --- a/app/layout/nav_menu.phtml +++ b/app/layout/nav_menu.phtml @@ -3,226 +3,304 @@ ?> <div class="nav_menu"> <?php if ($actual_view === 'normal') { ?> - <a class="btn toggle_aside" href="#aside_flux"><?php echo FreshRSS_Themes::icon('category'); ?></a> - <?php } ?> - - <?php if ($this->loginOk || Minz_Configuration::allowAnonymousRefresh()) { ?> - <a id="actualize" class="btn" href="<?php echo _url ('feed', 'actualize'); ?>"><?php echo FreshRSS_Themes::icon('refresh'); ?></a> + <a class="btn toggle_aside" href="#aside_flux"><?php echo _i('category'); ?></a> <?php } ?> <?php if ($this->loginOk) { ?> + <div id="nav_menu_actions" class="stick"> + <?php + $url_state = $this->url; + + if ($this->state & FreshRSS_Entry::STATE_READ) { + $url_state['params']['state'] = $this->state & ~FreshRSS_Entry::STATE_READ; + $checked = 'true'; + $class = 'active'; + } else { + $url_state['params']['state'] = $this->state | FreshRSS_Entry::STATE_READ; + $checked = 'false'; + $class = ''; + } + ?> + <a id="toggle-read" + class="btn <?php echo $class; ?>" + aria-checked="<?php echo $checked; ?>" + href="<?php echo Minz_Url::display($url_state); ?>" + title="<?php echo _t('show_read'); ?>"> + <?php echo _i('read'); ?> + </a> + + <?php + if ($this->state & FreshRSS_Entry::STATE_NOT_READ) { + $url_state['params']['state'] = $this->state & ~FreshRSS_Entry::STATE_NOT_READ; + $checked = 'true'; + $class = 'active'; + } else { + $url_state['params']['state'] = $this->state | FreshRSS_Entry::STATE_NOT_READ; + $checked = 'false'; + $class = ''; + } + ?> + <a id="toggle-unread" + class="btn <?php echo $class; ?>" + aria-checked="<?php echo $checked; ?>" + href="<?php echo Minz_Url::display($url_state); ?>" + title="<?php echo _t('show_not_reads'); ?>"> + <?php echo _i('unread'); ?> + </a> + + <?php + if ($this->state & FreshRSS_Entry::STATE_FAVORITE || $this->get_c == 's') { + $url_state['params']['state'] = $this->state & ~FreshRSS_Entry::STATE_FAVORITE; + $checked = 'true'; + $class = 'active'; + } else { + $url_state['params']['state'] = $this->state | FreshRSS_Entry::STATE_FAVORITE; + $checked = 'false'; + $class = ''; + } + ?> + <a id="toggle-favorite" + class="btn <?php echo $class; ?>" + aria-checked="<?php echo $checked; ?>" + href="<?php echo Minz_Url::display($url_state); ?>" + title="<?php echo _t('show_favorite'); ?>"> + <?php echo _i('starred'); ?> + </a> + + <?php + if ($this->state & FreshRSS_Entry::STATE_NOT_FAVORITE) { + $url_state['params']['state'] = $this->state & ~FreshRSS_Entry::STATE_NOT_FAVORITE; + $checked = 'true'; + $class = 'active'; + } else { + $url_state['params']['state'] = $this->state | FreshRSS_Entry::STATE_NOT_FAVORITE; + $checked = 'false'; + $class = ''; + } + ?> + <a id="toggle-not-favorite" + class="btn <?php echo $class; ?>" + aria-checked="<?php echo $checked; ?>" + href="<?php echo Minz_Url::display($url_state); ?>" + title="<?php echo _t('show_not_favorite'); ?>"> + <?php echo _i('non-starred'); ?> + </a> + + <div class="dropdown"> + <div id="dropdown-query" class="dropdown-target"></div> + + <a class="dropdown-toggle btn" href="#dropdown-query"><?php echo _i('down'); ?></a> + <ul class="dropdown-menu"> + <li class="dropdown-close"><a href="#close">❌</a></li> + + <li class="dropdown-header"> + <?php echo _t('queries'); ?> + <a class="no-mobile" href="<?php echo _url('configure', 'queries'); ?>"><?php echo _i('configure'); ?></a> + </li> + + <?php foreach ($this->conf->queries as $query) { ?> + <li class="item query"> + <a href="<?php echo $query['url']; ?>"><?php echo $query['name']; ?></a> + </li> + <?php } ?> + + <?php if (count($this->conf->queries) > 0) { ?> + <li class="separator no-mobile"></li> + <?php } ?> + + <?php + $url_query = $this->url; + $url_query['c'] = 'configure'; + $url_query['a'] = 'addQuery'; + ?> + <li class="item no-mobile"><a href="<?php echo Minz_Url::display($url_query); ?>"><?php echo _i('bookmark-add'); ?> <?php echo _t('add_query'); ?></a></li> + </ul> + </div> + </div> <?php $get = false; - $string_mark = Minz_Translate::t ('mark_all_read'); + $string_mark = _t('mark_all_read'); if ($this->get_f) { $get = 'f_' . $this->get_f; - $string_mark = Minz_Translate::t ('mark_feed_read'); + $string_mark = _t('mark_feed_read'); } elseif ($this->get_c && $this->get_c != 'a') { if ($this->get_c === 's') { $get = 's'; } else { $get = 'c_' . $this->get_c; } - $string_mark = Minz_Translate::t ('mark_cat_read'); + $string_mark = _t('mark_cat_read'); } $nextGet = $get; - if ($this->conf->onread_jump_next && (strlen ($get) > 2)) { + if ($this->conf->onread_jump_next && strlen($get) > 2) { $anotherUnreadId = ''; $foundCurrent = false; switch ($get[0]) { - case 'c': - foreach ($this->cat_aside as $cat) { - if ($cat->id () == $this->get_c) { - $foundCurrent = true; - continue; - } - if ($cat->nbNotRead () <= 0) continue; - $anotherUnreadId = $cat->id (); - if ($foundCurrent) break; + case 'c': + foreach ($this->cat_aside as $cat) { + if ($cat->id() == $this->get_c) { + $foundCurrent = true; + continue; } - $nextGet = empty ($anotherUnreadId) ? 'a' : 'c_' . $anotherUnreadId; - break; - case 'f': - foreach ($this->cat_aside as $cat) { - if ($cat->id () == $this->get_c) { - foreach ($cat->feeds () as $feed) { - if ($feed->id () == $this->get_f) { - $foundCurrent = true; - continue; - } - if ($feed->nbNotRead () <= 0) continue; - $anotherUnreadId = $feed->id (); - if ($foundCurrent) break; + if ($cat->nbNotRead() <= 0) continue; + $anotherUnreadId = $cat->id(); + if ($foundCurrent) break; + } + $nextGet = empty($anotherUnreadId) ? 'a' : 'c_' . $anotherUnreadId; + break; + case 'f': + foreach ($this->cat_aside as $cat) { + if ($cat->id() == $this->get_c) { + foreach ($cat->feeds() as $feed) { + if ($feed->id() == $this->get_f) { + $foundCurrent = true; + continue; } - break; + if ($feed->nbNotRead() <= 0) continue; + $anotherUnreadId = $feed->id(); + if ($foundCurrent) break; } + break; } - $nextGet = empty ($anotherUnreadId) ? 'c_' . $this->get_c : 'f_' . $anotherUnreadId; - break; + } + $nextGet = empty($anotherUnreadId) ? 'c_' . $this->get_c : 'f_' . $anotherUnreadId; + break; } } + $p = isset($this->entries[0]) ? $this->entries[0] : null; - $idMax = $p === null ? '0' : $p->id(); + $idMax = $p === null ? (time() - 1) . '000000' : $p->id(); + + if ($this->order === 'ASC') { //In this case we do not know but we guess idMax + $idMax2 = (time() - 1) . '000000'; + if (strcmp($idMax2, $idMax) > 0) { + $idMax = $idMax2; + } + } $arUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('get' => $get, 'nextGet' => $nextGet, 'idMax' => $idMax)); $output = Minz_Request::param('output', ''); - if (($output != '') && ($this->conf->view_mode !== $output)) { + if ($output != '' && $this->conf->view_mode !== $output) { $arUrl['params']['output'] = $output; } $markReadUrl = Minz_Url::display($arUrl); - Minz_Session::_param ('markReadUrl', $markReadUrl); + Minz_Session::_param('markReadUrl', $markReadUrl); ?> + <form id="mark-read-menu" method="post" style="display: none"></form> + <div class="stick" id="nav_menu_read_all"> - <a class="read_all btn" href="<?php echo $markReadUrl; ?>"><?php echo Minz_Translate::t ('mark_read'); ?></a> + <?php $confirm = $this->conf->reading_confirm ? 'confirm' : ''; ?> + <button class="read_all btn <?php echo $confirm; ?>" + form="mark-read-menu" + formaction="<?php echo $markReadUrl; ?>" + type="submit"><?php echo _t('mark_read'); ?></button> + <div class="dropdown"> <div id="dropdown-read" class="dropdown-target"></div> - <a class="dropdown-toggle btn" href="#dropdown-read"><?php echo FreshRSS_Themes::icon('down'); ?></a> + <a class="dropdown-toggle btn" href="#dropdown-read"><?php echo _i('down'); ?></a> <ul class="dropdown-menu"> <li class="dropdown-close"><a href="#close">❌</a></li> - <li class="item"><a href="<?php echo $markReadUrl; ?>"><?php echo $string_mark; ?></a></li> + <li class="item"> + <button class="as-link <?php echo $confirm; ?>" + form="mark-read-menu" + formaction="<?php echo $markReadUrl; ?>" + type="submit"><?php echo $string_mark; ?></button> + </li> <li class="separator"></li> <?php - $today = $this->today; - $one_week = $today - 604800; + $mark_before_today = $arUrl; + $mark_before_today['params']['idMax'] = $this->today . '000000'; + $mark_before_one_week = $arUrl; + $mark_before_one_week['params']['idMax'] = ($this->today - 604800) . '000000'; ?> - <li class="item"><a href="<?php echo _url ('entry', 'read', 'is_read', 1, 'get', $get, 'idMax', $today . '000000'); ?>"><?php echo Minz_Translate::t ('before_one_day'); ?></a></li> - <li class="item"><a href="<?php echo _url ('entry', 'read', 'is_read', 1, 'get', $get, 'idMax', $one_week . '000000'); ?>"><?php echo Minz_Translate::t ('before_one_week'); ?></a></li> + <li class="item"> + <button class="as-link <?php echo $confirm; ?>" + form="mark-read-menu" + formaction="<?php echo Minz_Url::display($mark_before_today); ?>" + type="submit"><?php echo _t('before_one_day'); ?></button> + </li> + <li class="item"> + <button class="as-link <?php echo $confirm; ?>" + form="mark-read-menu" + formaction="<?php echo Minz_Url::display($mark_before_one_week); ?>" + type="submit"><?php echo _t('before_one_week'); ?></button> + </li> </ul> </div> </div> <?php } ?> - <?php - $params = Minz_Request::params (); - if (isset ($params['search'])) { - $params['search'] = urlencode ($params['search']); - } - $url = array ( - 'c' => 'index', - 'a' => 'index', - 'params' => $params - ); - ?> - <div class="dropdown" id="nav_menu_views"> - <div id="dropdown-views" class="dropdown-target"></div> - <a class="dropdown-toggle btn" href="#dropdown-views"><?php echo Minz_Translate::t ('display'); ?> <?php echo FreshRSS_Themes::icon('down'); ?></a> - <ul class="dropdown-menu"> - <li class="dropdown-close"><a href="#close">❌</a></li> - - <?php - $url_output = $url; - if ($actual_view !== 'normal') { ?> - <li class="item"> - <?php $url_output['params']['output'] = 'normal'; ?> - <a class="view_normal" href="<?php echo Minz_Url::display ($url_output); ?>"> - <?php echo Minz_Translate::t ('normal_view'); ?> - </a> - </li> - <?php } if($actual_view !== 'reader') { ?> - <li class="item"> - <?php $url_output['params']['output'] = 'reader'; ?> - <a class="view_normal" href="<?php echo Minz_Url::display ($url_output); ?>"> - <?php echo Minz_Translate::t ('reader_view'); ?> - </a> - </li> - <?php } if($actual_view !== 'global') { ?> - <li class="item"> - <?php $url_output['params']['output'] = 'global'; ?> - <a class="view_normal" href="<?php echo Minz_Url::display ($url_output); ?>"> - <?php echo Minz_Translate::t ('global_view'); ?> - </a> - </li> - <?php } ?> + <?php $url_output = $this->url; ?> + <div class="stick" id="nav_menu_views"> + <?php $url_output['params']['output'] = 'normal'; ?> + <a class="view_normal btn <?php echo $actual_view == 'normal'? 'active' : ''; ?>" title="<?php echo _t('normal_view'); ?>" href="<?php echo Minz_Url::display($url_output); ?>"> + <?php echo _i("view-normal"); ?> + </a> - <li class="separator"></li> - - <?php - $url_state = $url; - $url_state['params']['state'] = 'all'; - ?> - <li class="item" role="checkbox" aria-checked="<?php echo ($this->state === 'all') ? 'true' :'false'; ?>"> - <a class="print_all" href="<?php echo Minz_Url::display ($url_state); ?>"> - <?php echo Minz_Translate::t ('show_all_articles'); ?> - </a> - </li> - <?php - $url_state['params']['state'] = 'not_read'; - ?> - <li class="item" role="checkbox" aria-checked="<?php echo ($this->state === 'not_read') ? 'true' :'false'; ?>"> - <a class="print_non_read" href="<?php echo Minz_Url::display ($url_state); ?>"> - <?php echo Minz_Translate::t ('show_not_reads'); ?> - </a> - </li> - <?php - $url_state['params']['state'] = 'read'; - ?> - <li class="item" role="checkbox" aria-checked="<?php echo ($this->state === 'read') ? 'true' :'false'; ?>"> - <a class="print_read" href="<?php echo Minz_Url::display ($url_state); ?>"> - <?php echo Minz_Translate::t ('show_read'); ?> - </a> - </li> - <?php - $url_state['params']['state'] = 'favorite'; - ?> - <li class="item" role="checkbox" aria-checked="<?php echo ($this->state === 'favorite') ? 'true' :'false'; ?>"> - <a class="print_favorite" href="<?php echo Minz_Url::display ($url_state); ?>"> - <?php echo Minz_Translate::t ('show_favorite'); ?> - </a> - </li> - - <li class="separator"></li> - - <li class="item"> - <?php - $url_order = $url; - if ($this->order === 'DESC') { - $url_order['params']['order'] = 'ASC'; - ?> - <a href="<?php echo Minz_Url::display ($url_order); ?>"> - <?php echo Minz_Translate::t ('older_first'); ?> - </a> - <?php - } else { - $url_order['params']['order'] = 'DESC'; - ?> - <a href="<?php echo Minz_Url::display ($url_order); ?>"> - <?php echo Minz_Translate::t ('newer_first'); ?> - </a> - <?php } ?> - </li> + <?php $url_output['params']['output'] = 'global'; ?> + <a class="view_global btn <?php echo $actual_view == 'global'? 'active' : ''; ?>" title="<?php echo _t('global_view'); ?>" href="<?php echo Minz_Url::display($url_output); ?>"> + <?php echo _i("view-global"); ?> + </a> - <li class="separator"></li> + <?php $url_output['params']['output'] = 'reader'; ?> + <a class="view_reader btn <?php echo $actual_view == 'reader'? 'active' : ''; ?>" title="<?php echo _t('reader_view'); ?>" href="<?php echo Minz_Url::display($url_output); ?>"> + <?php echo _i("view-reader"); ?> + </a> - <li class="item"> - <a class="view_rss" target="_blank" href="<?php echo Minz_Url::display ($this->rss_url); ?>"> - <?php echo Minz_Translate::t ('rss_view'); ?> - </a> - </li> - </ul> + <?php + $url_output['params']['output'] = 'rss'; + if ($this->conf->token) { + $url_output['params']['token'] = $this->conf->token; + } + ?> + <a class="view_rss btn" target="_blank" title="<?php echo _t('rss_view'); ?>" href="<?php echo Minz_Url::display($url_output); ?>"> + <?php echo _i('rss'); ?> + </a> </div> <div class="item search"> - <form action="<?php echo _url ('index', 'index'); ?>" method="get"> - <?php $search = Minz_Request::param ('search', ''); ?> - <input type="search" name="search" class="extend" value="<?php echo $search; ?>" placeholder="<?php echo Minz_Translate::t ('search_short'); ?>" /> + <form action="<?php echo _url('index', 'index'); ?>" method="get"> + <?php $search = Minz_Request::param('search', ''); ?> + <input type="search" name="search" class="extend" value="<?php echo $search; ?>" placeholder="<?php echo _t('search_short'); ?>" /> - <?php $get = Minz_Request::param ('get', ''); ?> + <?php $get = Minz_Request::param('get', ''); ?> <?php if($get != '') { ?> <input type="hidden" name="get" value="<?php echo $get; ?>" /> <?php } ?> - <?php $order = Minz_Request::param ('order', ''); ?> + <?php $order = Minz_Request::param('order', ''); ?> <?php if($order != '') { ?> <input type="hidden" name="order" value="<?php echo $order; ?>" /> <?php } ?> - <?php $state = Minz_Request::param ('state', ''); ?> + <?php $state = Minz_Request::param('state', ''); ?> <?php if($state != '') { ?> <input type="hidden" name="state" value="<?php echo $state; ?>" /> <?php } ?> </form> </div> + + <?php + if ($this->order === 'DESC') { + $order = 'ASC'; + $icon = 'up'; + $title = 'older_first'; + } else { + $order = 'DESC'; + $icon = 'down'; + $title = 'newer_first'; + } + $url_order = $this->url; + $url_order['params']['order'] = $order; + ?> + <a id="toggle-order" class="btn" href="<?php echo Minz_Url::display($url_order); ?>" title="<?php echo _t($title); ?>"> + <?php echo _i($icon); ?> + </a> + + <?php if ($this->loginOk || Minz_Configuration::allowAnonymousRefresh()) { ?> + <a id="actualize" class="btn" href="<?php echo _url('feed', 'actualize'); ?>"><?php echo _i('refresh'); ?></a> + <?php } ?> </div> diff --git a/app/views/configure/archiving.phtml b/app/views/configure/archiving.phtml index e144d0f45..c9cc7fe02 100644 --- a/app/views/configure/archiving.phtml +++ b/app/views/configure/archiving.phtml @@ -24,6 +24,27 @@ ?></select> (<?php echo Minz_Translate::t('by_default'); ?>) </div> </div> + <div class="form-group"> + <label class="group-name" for="ttl_default"><?php echo Minz_Translate::t('ttl'); ?></label> + <div class="group-controls"> + <select class="number" name="ttl_default" id="ttl_default" required="required"><?php + $found = false; + foreach (array(1200 => '20min', 1500 => '25min', 1800 => '30min', 2700 => '45min', + 3600 => '1h', 5400 => '1.5h', 7200 => '2h', 10800 => '3h', 14400 => '4h', 18800 => '5h', 21600 => '6h', 25200 => '7h', 28800 => '8h', + 36000 => '10h', 43200 => '12h', 64800 => '18h', + 86400 => '1d', 129600 => '1.5d', 172800 => '2d', 259200 => '3d', 345600 => '4d', 432000 => '5d', 518400 => '6d', + 604800 => '1wk', -1 => '∞') as $v => $t) { + echo '<option value="' . $v . ($this->conf->ttl_default == $v ? '" selected="selected' : '') . '">' . $t . '</option>'; + if ($this->conf->ttl_default == $v) { + $found = true; + } + } + if (!$found) { + echo '<option value="' . intval($this->conf->ttl_default) . '" selected="selected">' . intval($this->conf->ttl_default) . 's</option>'; + } + ?></select> (<?php echo Minz_Translate::t('by_default'); ?>) + </div> + </div> <div class="form-group form-actions"> <div class="group-controls"> diff --git a/app/views/configure/categorize.phtml b/app/views/configure/categorize.phtml index a564e8cdd..23d1c9fa1 100644 --- a/app/views/configure/categorize.phtml +++ b/app/views/configure/categorize.phtml @@ -14,14 +14,22 @@ <?php echo Minz_Translate::t ('category_number', $i); ?> </label> <div class="group-controls"> - <input type="text" id="cat_<?php echo $cat->id (); ?>" name="categories[]" value="<?php echo $cat->name (); ?>" /> - - <?php if ($cat->nbFeed () > 0) { ?> - <a class="confirm" href="<?php echo _url ('feed', 'delete', 'id', $cat->id (), 'type', 'category'); ?>"><?php echo Minz_Translate::t ('ask_empty'); ?></a> - <?php } ?> + <div class="stick"> + <input type="text" id="cat_<?php echo $cat->id (); ?>" name="categories[]" value="<?php echo $cat->name (); ?>" /> + + <?php if ($cat->nbFeed () > 0) { ?> + <a class="btn" href="<?php echo _url('index', 'index', 'get', 'c_' . $cat->id ()); ?>"> + <?php echo _i('link'); ?> + </a> + <button formaction="<?php echo _url('feed', 'delete', 'id', $cat->id (), 'type', 'category'); ?>" + class="btn btn-attention confirm" + data-str-confirm="<?php echo _t('confirm_action_feed_cat'); ?>" + type="submit"><?php echo _t('ask_empty'); ?></button> + <?php } ?> + </div> (<?php echo Minz_Translate::t ('number_feeds', $cat->nbFeed ()); ?>) - <?php if ($cat->id () == $this->defaultCategory->id ()) { ?> + <?php if ($cat->id () === $this->defaultCategory->id ()) { ?> <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t ('can_not_be_deleted'); ?> <?php } ?> diff --git a/app/views/configure/display.phtml b/app/views/configure/display.phtml index 9104e4ef1..8eb3a156b 100644 --- a/app/views/configure/display.phtml +++ b/app/views/configure/display.phtml @@ -4,7 +4,7 @@ <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a> <form method="post" action="<?php echo _url ('configure', 'display'); ?>"> - <legend><?php echo Minz_Translate::t ('theme'); ?></legend> + <legend><?php echo Minz_Translate::t ('display_configuration'); ?></legend> <div class="form-group"> <label class="group-name" for="language"><?php echo Minz_Translate::t ('language'); ?></label> @@ -35,122 +35,29 @@ </div> </div> - <div class="form-group form-actions"> - <div class="group-controls"> - <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button> - <button type="reset" class="btn"><?php echo Minz_Translate::t ('cancel'); ?></button> - </div> - </div> - - <legend><?php echo Minz_Translate::t ('reading_configuration'); ?></legend> - - <div class="form-group"> - <label class="group-name" for="posts_per_page"><?php echo Minz_Translate::t ('articles_per_page'); ?></label> - <div class="group-controls"> - <input type="number" id="posts_per_page" name="posts_per_page" value="<?php echo $this->conf->posts_per_page; ?>" /> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="sort_order"><?php echo Minz_Translate::t ('sort_order'); ?></label> - <div class="group-controls"> - <select name="sort_order" id="sort_order"> - <option value="DESC"<?php echo $this->conf->sort_order === 'DESC' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('newer_first'); ?></option> - <option value="ASC"<?php echo $this->conf->sort_order === 'ASC' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('older_first'); ?></option> - </select> - </div> - </div> - + <?php $width = $this->conf->content_width; ?> <div class="form-group"> - <label class="group-name" for="view_mode"><?php echo Minz_Translate::t ('default_view'); ?></label> + <label class="group-name" for="content_width"><?php echo Minz_Translate::t('content_width'); ?></label> <div class="group-controls"> - <select name="view_mode" id="view_mode"> - <option value="normal"<?php echo $this->conf->view_mode === 'normal' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('normal_view'); ?></option> - <option value="reader"<?php echo $this->conf->view_mode === 'reader' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('reader_view'); ?></option> - <option value="global"<?php echo $this->conf->view_mode === 'global' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('global_view'); ?></option> + <select name="content_width" id="content_width" required=""> + <option value="thin" <?php echo $width === 'thin'? 'selected="selected"' : ''; ?>> + <?php echo Minz_Translate::t('width_thin'); ?> + </option> + <option value="medium" <?php echo $width === 'medium'? 'selected="selected"' : ''; ?>> + <?php echo Minz_Translate::t('width_medium'); ?> + </option> + <option value="large" <?php echo $width === 'large'? 'selected="selected"' : ''; ?>> + <?php echo Minz_Translate::t('width_large'); ?> + </option> + <option value="no_limit" <?php echo $width === 'no_limit'? 'selected="selected"' : ''; ?>> + <?php echo Minz_Translate::t('width_no_limit'); ?> + </option> </select> - <label class="radio" for="radio_all"> - <input type="radio" name="default_view" id="radio_all" value="all"<?php echo $this->conf->default_view === 'all' ? ' checked="checked"' : ''; ?> /> - <?php echo Minz_Translate::t ('show_all_articles'); ?> - </label> - <label class="radio" for="radio_not_read"> - <input type="radio" name="default_view" id="radio_not_read" value="not_read"<?php echo $this->conf->default_view === 'not_read' ? ' checked="checked"' : ''; ?> /> - <?php echo Minz_Translate::t ('show_not_reads'); ?> - </label> - </div> - </div> - - <div class="form-group"> - <div class="group-controls"> - <label class="checkbox" for="auto_load_more"> - <input type="checkbox" name="auto_load_more" id="auto_load_more" value="1"<?php echo $this->conf->auto_load_more ? ' checked="checked"' : ''; ?> /> - <?php echo Minz_Translate::t ('auto_load_more'); ?> - <noscript> — <strong><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></strong></noscript> - </label> </div> </div> <div class="form-group"> - <div class="group-controls"> - <label class="checkbox" for="display_posts"> - <input type="checkbox" name="display_posts" id="display_posts" value="1"<?php echo $this->conf->display_posts ? ' checked="checked"' : ''; ?> /> - <?php echo Minz_Translate::t ('display_articles_unfolded'); ?> - <noscript> — <strong><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></strong></noscript> - </label> - </div> - </div> - - <div class="form-group"> - <div class="group-controls"> - <label class="checkbox" for="lazyload"> - <input type="checkbox" name="lazyload" id="lazyload" value="1"<?php echo $this->conf->lazyload ? ' checked="checked"' : ''; ?> /> - <?php echo Minz_Translate::t ('img_with_lazyload'); ?> - <noscript> — <strong><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></strong></noscript> - </label> - </div> - </div> - - <div class="form-group"> - <label class="group-name"><?php echo Minz_Translate::t ('auto_read_when'); ?></label> - <div class="group-controls"> - <label class="checkbox" for="check_open_article"> - <input type="checkbox" name="mark_open_article" id="check_open_article" value="1"<?php echo $this->conf->mark_when['article'] ? ' checked="checked"' : ''; ?> /> - <?php echo Minz_Translate::t ('article_selected'); ?> - </label> - <label class="checkbox" for="check_open_site"> - <input type="checkbox" name="mark_open_site" id="check_open_site" value="1"<?php echo $this->conf->mark_when['site'] ? ' checked="checked"' : ''; ?> /> - <?php echo Minz_Translate::t ('article_open_on_website'); ?> - </label> - <label class="checkbox" for="check_scroll"> - <input type="checkbox" name="mark_scroll" id="check_scroll" value="1"<?php echo $this->conf->mark_when['scroll'] ? ' checked="checked"' : ''; ?> /> - <?php echo Minz_Translate::t ('scroll'); ?> - </label> - <label class="checkbox" for="check_reception"> - <input type="checkbox" name="mark_upon_reception" id="check_reception" value="1"<?php echo $this->conf->mark_when['reception'] ? ' checked="checked"' : ''; ?> /> - <?php echo Minz_Translate::t ('upon_reception'); ?> - </label> - </div> - </div> - - <div class="form-group"> - <label class="group-name"><?php echo Minz_Translate::t ('after_onread'); ?></label> - <div class="group-controls"> - <label class="checkbox" for="onread_jump_next"> - <input type="checkbox" name="onread_jump_next" id="onread_jump_next" value="1"<?php echo $this->conf->onread_jump_next ? ' checked="checked"' : ''; ?> /> - <?php echo Minz_Translate::t ('jump_next'); ?> - </label> - </div> - </div> - - <div class="form-group form-actions"> - <div class="group-controls"> - <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button> - <button type="reset" class="btn"><?php echo Minz_Translate::t ('cancel'); ?></button> - </div> - </div> - - <legend><?php echo Minz_Translate::t ('reading_icons'); ?></legend> - <div class="form-group"> + <label class="group-name" for="theme"><?php echo Minz_Translate::t ('article_icons'); ?></label> <table> <thead> <tr> @@ -184,6 +91,13 @@ </tbody> </table><br /> </div> + + <div class="form-group"> + <label class="group-name" for="posts_per_page"><?php echo Minz_Translate::t ('html5_notif_timeout'); ?></label> + <div class="group-controls"> + <input type="number" id="html5_notif_timeout" name="html5_notif_timeout" value="<?php echo $this->conf->html5_notif_timeout; ?>" /> <?php echo Minz_Translate::t ('seconds_(0_means_no_timeout)'); ?> + </div> + </div> <div class="form-group form-actions"> <div class="group-controls"> diff --git a/app/views/configure/feed.phtml b/app/views/configure/feed.phtml index 2da04ac2d..e96a28739 100644 --- a/app/views/configure/feed.phtml +++ b/app/views/configure/feed.phtml @@ -32,16 +32,21 @@ <div class="form-group"> <label class="group-name" for="website"><?php echo Minz_Translate::t ('website_url'); ?></label> <div class="group-controls"> - <input type="text" name="website" id="website" class="extend" value="<?php echo $this->flux->website (); ?>" /> - <a target="_blank" href="<?php echo $this->flux->website (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a> + <div class="stick"> + <input type="text" name="website" id="website" class="extend" value="<?php echo $this->flux->website (); ?>" /> + <a class="btn" target="_blank" href="<?php echo $this->flux->website (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a> + </div> </div> </div> <div class="form-group"> <label class="group-name" for="url"><?php echo Minz_Translate::t ('feed_url'); ?></label> <div class="group-controls"> - <input type="text" name="url" id="url" class="extend" value="<?php echo $this->flux->url (); ?>" /> - <a target="_blank" href="<?php echo $this->flux->url (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a> - <a class="btn" target="_blank" href="http://validator.w3.org/feed/check.cgi?url=<?php echo $this->flux->url (); ?>"><?php echo Minz_Translate::t ('feed_validator'); ?></a> + <div class="stick"> + <input type="text" name="url" id="url" class="extend" value="<?php echo $this->flux->url (); ?>" /> + <a class="btn" target="_blank" href="<?php echo $this->flux->url (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a> + </div> + + <a class="btn" target="_blank" href="http://validator.w3.org/feed/check.cgi?url=<?php echo $this->flux->url (); ?>"><?php echo Minz_Translate::t ('feed_validator'); ?></a> </div> </div> <div class="form-group"> @@ -65,27 +70,33 @@ </label> </div> </div> + <div class="form-group"> + <div class="group-controls"> + <a href="<?php echo _url('stats', 'repartition', 'id', $this->flux->id()); ?>"> + <?php echo _i('stats'); ?> <?php echo _t('stats'); ?> + </a> + </div> + </div> <div class="form-group form-actions"> <div class="group-controls"> - <button class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button> - <button class="btn btn-attention confirm" formmethod="post" formaction="<?php echo Minz_Url::display (array ('c' => 'feed', 'a' => 'delete', 'params' => array ('id' => $this->flux->id ()))); ?>"><?php echo Minz_Translate::t ('delete'); ?></button> + <button class="btn btn-important"><?php echo _t('save'); ?></button> + <button class="btn btn-attention confirm" + data-str-confirm="<?php echo _t('confirm_action_feed_cat'); ?>" + formaction="<?php echo _url('feed', 'delete', 'id', $this->flux->id ()); ?>" + formmethod="post"><?php echo _t('delete'); ?></button> </div> </div> <legend><?php echo Minz_Translate::t ('archiving_configuration'); ?></legend> <div class="form-group"> - <label class="group-name"></label> - <div class="group-controls"> - <a class="btn" href="<?php echo _url ('feed', 'actualize', 'id', $this->flux->id ()); ?>"> - <?php echo FreshRSS_Themes::icon('refresh'); ?> <?php echo Minz_Translate::t('actualize'); ?> - </a> - </div> - </div> - <div class="form-group"> - <label class="group-name"><?php echo Minz_Translate::t ('number_articles'); ?></label> <div class="group-controls"> - <span class="control"><?php echo $nbEntries; ?></span> + <div class="stick"> + <input type="text" value="<?php echo _t('number_articles', $nbEntries); ?>" disabled="disabled" /> + <a class="btn" href="<?php echo _url('feed', 'actualize', 'id', $this->flux->id ()); ?>"> + <?php echo _i('refresh'); ?> <?php echo _t('actualize'); ?> + </a> + </div> </div> </div> <div class="form-group"> @@ -98,6 +109,27 @@ ?></select> </div> </div> + <div class="form-group"> + <label class="group-name" for="ttl"><?php echo Minz_Translate::t('ttl'); ?></label> + <div class="group-controls"> + <select class="number" name="ttl" id="ttl" required="required"><?php + $found = false; + foreach (array(-2 => Minz_Translate::t('by_default'), 900 => '15min', 1200 => '20min', 1500 => '25min', 1800 => '30min', 2700 => '45min', + 3600 => '1h', 5400 => '1.5h', 7200 => '2h', 10800 => '3h', 14400 => '4h', 18800 => '5h', 21600 => '6h', 25200 => '7h', 28800 => '8h', + 36000 => '10h', 43200 => '12h', 64800 => '18h', + 86400 => '1d', 129600 => '1.5d', 172800 => '2d', 259200 => '3d', 345600 => '4d', 432000 => '5d', 518400 => '6d', + 604800 => '1wk', 1209600 => '2wk', 1814400 => '3wk', 2419200 => '4wk', 2629744 => '1mo', -1 => '∞') as $v => $t) { + echo '<option value="' . $v . ($this->flux->ttl() === $v ? '" selected="selected' : '') . '">' . $t . '</option>'; + if ($this->flux->ttl() == $v) { + $found = true; + } + } + if (!$found) { + echo '<option value="' . intval($this->flux->ttl()) . '" selected="selected">' . intval($this->flux->ttl()) . 's</option>'; + } + ?></select> + </div> + </div> <div class="form-group form-actions"> <div class="group-controls"> <button class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button> diff --git a/app/views/configure/importExport.phtml b/app/views/configure/importExport.phtml deleted file mode 100644 index e2217d9ed..000000000 --- a/app/views/configure/importExport.phtml +++ /dev/null @@ -1,40 +0,0 @@ -<?php -require_once(LIB_PATH . '/lib_opml.php'); -if ($this->req == 'export') { - echo '<?xml version="1.0" encoding="UTF-8" ?>'; -?> -<!-- Generated by <?php echo Minz_Configuration::title (); ?> --> -<opml version="2.0"> - <head> - <title><?php echo Minz_Configuration::title (); ?> OPML Feed</title> - <dateCreated><?php echo date('D, d M Y H:i:s'); ?></dateCreated> - </head> - <body> -<?php echo opml_export ($this->categories); ?> - </body> -</opml> -<?php } else { ?> -<?php $this->partial ('aside_feed'); ?> - -<div class="post "> - <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a> - - <form method="post" action="<?php echo Minz_Url::display (array ('c' => 'configure', 'a' => 'importExport', 'params' => array ('q' => 'import'))); ?>" enctype="multipart/form-data"> - <legend><?php echo Minz_Translate::t ('import_export_opml'); ?></legend> - <div class="form-group"> - <label class="group-name" for="file"><?php echo Minz_Translate::t ('file_to_import'); ?></label> - <div class="group-controls"> - <input type="file" name="file" id="file" /> - </div> - </div> - - <div class="form-group form-actions"> - <div class="group-controls"> - <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('import'); ?></button> - <?php echo Minz_Translate::t ('or'); ?> - <a target="_blank" class="btn btn-important" href="<?php echo _url ('configure', 'importExport', 'q', 'export'); ?>"><?php echo Minz_Translate::t ('export'); ?></a> - </div> - </div> - </form> -</div> -<?php } ?> diff --git a/app/views/configure/queries.phtml b/app/views/configure/queries.phtml new file mode 100644 index 000000000..e778ce078 --- /dev/null +++ b/app/views/configure/queries.phtml @@ -0,0 +1,97 @@ +<?php $this->partial('aside_configure'); ?> + +<div class="post"> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('back_to_rss_feeds'); ?></a> + + <form method="post" action="<?php echo _url('configure', 'queries'); ?>"> + <legend><?php echo _t('queries'); ?></legend> + + <?php foreach ($this->conf->queries as $key => $query) { ?> + <div class="form-group" id="query-group-<?php echo $key; ?>"> + <label class="group-name" for="queries_<?php echo $key; ?>_name"> + <?php echo _t('query_number', $key + 1); ?> + </label> + + <div class="group-controls"> + <input type="hidden" id="queries_<?php echo $key; ?>_search" name="queries[<?php echo $key; ?>][search]" value="<?php echo isset($query['search']) ? $query['search'] : ""; ?>"/> + <input type="hidden" id="queries_<?php echo $key; ?>_state" name="queries[<?php echo $key; ?>][state]" value="<?php echo isset($query['state']) ? $query['state'] : ""; ?>"/> + <input type="hidden" id="queries_<?php echo $key; ?>_order" name="queries[<?php echo $key; ?>][order]" value="<?php echo isset($query['order']) ? $query['order'] : ""; ?>"/> + <input type="hidden" id="queries_<?php echo $key; ?>_get" name="queries[<?php echo $key; ?>][get]" value="<?php echo isset($query['get']) ? $query['get'] : ""; ?>"/> + + <div class="stick"> + <input class="extend" + type="text" + id="queries_<?php echo $key; ?>_name" + name="queries[<?php echo $key; ?>][name]" + value="<?php echo $query['name']; ?>" + /> + + <a class="btn" href="<?php echo $query['url']; ?>"> + <?php echo _i('link'); ?> + </a> + + <a class="btn btn-attention remove" href="#" data-remove="query-group-<?php echo $key; ?>"> + <?php echo _i('close'); ?> + </a> + </div> + + <?php + $exist = (isset($query['search']) ? 1 : 0) + + (isset($query['state']) ? 1 : 0) + + (isset($query['order']) ? 1 : 0) + + (isset($query['get']) ? 1 : 0); + // If the only filter is "all" articles, we consider there is no filter + $exist = ($exist === 1 && isset($query['get']) && $query['get'] === 'a') ? 0 : $exist; + + $deprecated = (isset($this->query_get[$key]) && + $this->query_get[$key]['deprecated']); + ?> + + <?php if ($exist === 0) { ?> + <div class="alert alert-warn"> + <div class="alert-head"><?php echo _t('no_query_filter'); ?></div> + </div> + <?php } elseif ($deprecated) { ?> + <div class="alert alert-error"> + <div class="alert-head"><?php echo _t('query_deprecated'); ?></div> + </div> + <?php } else { ?> + <div class="alert alert-success"> + <div class="alert-head"><?php echo _t('query_filter'); ?></div> + + <ul> + <?php if (isset($query['search'])) { ?> + <li class="item"><?php echo _t('query_search', $query['search']); ?></li> + <?php } ?> + + <?php if (isset($query['state'])) { ?> + <li class="item"><?php echo _t('query_state_' . $query['state']); ?></li> + <?php } ?> + + <?php if (isset($query['order'])) { ?> + <li class="item"><?php echo _t('query_order_' . strtolower($query['order'])); ?></li> + <?php } ?> + + <?php if (isset($query['get'])) { ?> + <li class="item"><?php echo _t('query_get_' . $this->query_get[$key]['type'], $this->query_get[$key]['name']); ?></li> + <?php } ?> + </ul> + </div> + <?php } ?> + </div> + </div> + <?php } ?> + + <?php if (count($this->conf->queries) > 0) { ?> + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo _t('save'); ?></button> + <button type="reset" class="btn"><?php echo _t('cancel'); ?></button> + </div> + </div> + <?php } else { ?> + <p class="alert alert-warn"><span class="alert-head"><?php echo _t('damn'); ?></span> <?php echo _t('no_query'); ?></p> + <?php } ?> + </form> + +</div>
\ No newline at end of file diff --git a/app/views/configure/reading.phtml b/app/views/configure/reading.phtml new file mode 100644 index 000000000..8b2da2a28 --- /dev/null +++ b/app/views/configure/reading.phtml @@ -0,0 +1,158 @@ +<?php $this->partial ('aside_configure'); ?> + +<div class="post"> + <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a> + + <form method="post" action="<?php echo _url ('configure', 'reading'); ?>"> + <legend><?php echo Minz_Translate::t ('reading_configuration'); ?></legend> + + <div class="form-group"> + <label class="group-name" for="posts_per_page"><?php echo Minz_Translate::t ('articles_per_page'); ?></label> + <div class="group-controls"> + <input type="number" id="posts_per_page" name="posts_per_page" value="<?php echo $this->conf->posts_per_page; ?>" min="5" max="50" /> + <?php echo _i('help'); ?> <?php echo _t('number_divided_when_reader'); ?> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="sort_order"><?php echo Minz_Translate::t ('sort_order'); ?></label> + <div class="group-controls"> + <select name="sort_order" id="sort_order"> + <option value="DESC"<?php echo $this->conf->sort_order === 'DESC' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('newer_first'); ?></option> + <option value="ASC"<?php echo $this->conf->sort_order === 'ASC' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('older_first'); ?></option> + </select> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="view_mode"><?php echo Minz_Translate::t ('default_view'); ?></label> + <div class="group-controls"> + <select name="view_mode" id="view_mode"> + <option value="normal"<?php echo $this->conf->view_mode === 'normal' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('normal_view'); ?></option> + <option value="reader"<?php echo $this->conf->view_mode === 'reader' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('reader_view'); ?></option> + <option value="global"<?php echo $this->conf->view_mode === 'global' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('global_view'); ?></option> + </select> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="view_mode"><?php echo _t('articles_to_display'); ?></label> + <div class="group-controls"> + <select name="default_view" id="default_view"> + <option value="<?php echo FreshRSS_Entry::STATE_NOT_READ; ?>"<?php echo $this->conf->default_view === FreshRSS_Entry::STATE_NOT_READ ? ' selected="selected"' : ''; ?>><?php echo _t('show_adaptive'); ?></option> + <option value="<?php echo FreshRSS_Entry::STATE_ALL; ?>"<?php echo $this->conf->default_view === FreshRSS_Entry::STATE_ALL ? ' selected="selected"' : ''; ?>><?php echo _t('show_all_articles'); ?></option> + <option value="<?php echo FreshRSS_Entry::STATE_STRICT + FreshRSS_Entry::STATE_NOT_READ; ?>"<?php echo $this->conf->default_view === FreshRSS_Entry::STATE_STRICT + FreshRSS_Entry::STATE_NOT_READ ? ' selected="selected"' : ''; ?>><?php echo _t('show_not_reads'); ?></option> + </select> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="hide_read_feeds"> + <input type="checkbox" name="hide_read_feeds" id="hide_read_feeds" value="1"<?php echo $this->conf->hide_read_feeds ? ' checked="checked"' : ''; ?> /> + <?php echo Minz_Translate::t('hide_read_feeds'); ?> + </label> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="display_posts"> + <input type="checkbox" name="display_posts" id="display_posts" value="1"<?php echo $this->conf->display_posts ? ' checked="checked"' : ''; ?> /> + <?php echo Minz_Translate::t ('display_articles_unfolded'); ?> + <noscript> — <strong><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></strong></noscript> + </label> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="display_categories"> + <input type="checkbox" name="display_categories" id="display_categories" value="1"<?php echo $this->conf->display_categories ? ' checked="checked"' : ''; ?> /> + <?php echo Minz_Translate::t ('display_categories_unfolded'); ?> + <noscript> — <strong><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></strong></noscript> + </label> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="sticky_post"> + <input type="checkbox" name="sticky_post" id="sticky_post" value="1"<?php echo $this->conf->sticky_post ? ' checked="checked"' : ''; ?> /> + <?php echo Minz_Translate::t ('sticky_post'); ?> + <noscript> — <strong><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></strong></noscript> + </label> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="auto_load_more"> + <input type="checkbox" name="auto_load_more" id="auto_load_more" value="1"<?php echo $this->conf->auto_load_more ? ' checked="checked"' : ''; ?> /> + <?php echo Minz_Translate::t ('auto_load_more'); ?> + <noscript> — <strong><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></strong></noscript> + </label> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="lazyload"> + <input type="checkbox" name="lazyload" id="lazyload" value="1"<?php echo $this->conf->lazyload ? ' checked="checked"' : ''; ?> /> + <?php echo Minz_Translate::t ('img_with_lazyload'); ?> + <noscript> — <strong><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></strong></noscript> + </label> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="reading_confirm"> + <input type="checkbox" name="reading_confirm" id="reading_confirm" value="1"<?php echo $this->conf->reading_confirm ? ' checked="checked"' : ''; ?> /> + <?php echo Minz_Translate::t ('reading_confirm'); ?> + <noscript> — <strong><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></strong></noscript> + </label> + </div> + </div> + + <div class="form-group"> + <label class="group-name"><?php echo Minz_Translate::t ('auto_read_when'); ?></label> + <div class="group-controls"> + <label class="checkbox" for="check_open_article"> + <input type="checkbox" name="mark_open_article" id="check_open_article" value="1"<?php echo $this->conf->mark_when['article'] ? ' checked="checked"' : ''; ?> /> + <?php echo Minz_Translate::t('article_viewed'); ?> + </label> + <label class="checkbox" for="check_open_site"> + <input type="checkbox" name="mark_open_site" id="check_open_site" value="1"<?php echo $this->conf->mark_when['site'] ? ' checked="checked"' : ''; ?> /> + <?php echo Minz_Translate::t ('article_open_on_website'); ?> + </label> + <label class="checkbox" for="check_scroll"> + <input type="checkbox" name="mark_scroll" id="check_scroll" value="1"<?php echo $this->conf->mark_when['scroll'] ? ' checked="checked"' : ''; ?> /> + <?php echo Minz_Translate::t ('scroll'); ?> + </label> + <label class="checkbox" for="check_reception"> + <input type="checkbox" name="mark_upon_reception" id="check_reception" value="1"<?php echo $this->conf->mark_when['reception'] ? ' checked="checked"' : ''; ?> /> + <?php echo Minz_Translate::t ('upon_reception'); ?> + </label> + </div> + </div> + + <div class="form-group"> + <label class="group-name"><?php echo Minz_Translate::t ('after_onread'); ?></label> + <div class="group-controls"> + <label class="checkbox" for="onread_jump_next"> + <input type="checkbox" name="onread_jump_next" id="onread_jump_next" value="1"<?php echo $this->conf->onread_jump_next ? ' checked="checked"' : ''; ?> /> + <?php echo Minz_Translate::t ('jump_next'); ?> + </label> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button> + <button type="reset" class="btn"><?php echo Minz_Translate::t ('cancel'); ?></button> + </div> + </div> + + </form> +</div> diff --git a/app/views/configure/sharing.phtml b/app/views/configure/sharing.phtml index e3ea11665..02ce331da 100644 --- a/app/views/configure/sharing.phtml +++ b/app/views/configure/sharing.phtml @@ -3,54 +3,49 @@ <div class="post"> <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a> - <form method="post" action="<?php echo _url ('configure', 'sharing'); ?>"> + <form method="post" action="<?php echo _url ('configure', 'sharing'); ?>" + data-simple='<div class="form-group" id="group-share-##key##"><label class="group-name">##label##</label><div class="group-controls"><a href="#" class="remove btn btn-attention" data-remove="group-share-##key##"><?php echo FreshRSS_Themes::icon('close'); ?></a> + <input type="hidden" id="share_##key##_type" name="share[##key##][type]" value="##type##" /></div></div>' + data-advanced='<div class="form-group" id="group-share-##key##"><label class="group-name">##label##</label><div class="group-controls"> + <input type="hidden" id="share_##key##_type" name="share[##key##][type]" value="##type##" /> + <div class="stick"> + <input type="text" id="share_##key##_name" name="share[##key##][name]" class="extend" value="" placeholder="<?php echo Minz_Translate::t ('share_name'); ?>" size="64" /> + <input type="url" id="share_##key##_url" name="share[##key##][url]" class="extend" value="" placeholder="<?php echo Minz_Translate::t ('share_url'); ?>" size="64" /> + <a href="#" class="remove btn btn-attention" data-remove="group-share-##key##"><?php echo FreshRSS_Themes::icon('close'); ?></a></div> + <a target="_blank" class="btn" title="<?php echo Minz_Translate::t('more_information'); ?>" href="##help##"><?php echo FreshRSS_Themes::icon('help'); ?></a> + </div></div>'> <legend><?php echo Minz_Translate::t ('sharing'); ?></legend> - <div class="form-group"> - <label class="group-name" for="shaarli"> - <?php echo Minz_Translate::t ('your_shaarli'); ?> - </label> - <div class="group-controls"> - <input type="url" id="shaarli" name="shaarli" class="extend" value="<?php echo $this->conf->sharing ('shaarli'); ?>" placeholder="<?php echo Minz_Translate::t ('blank_to_disable'); ?>" size="64" /> - - <?php echo FreshRSS_Themes::icon('help'); ?> <a target="_blank" href="http://sebsauvage.net/wiki/doku.php?id=php:shaarli"><?php echo Minz_Translate::t ('more_information'); ?></a> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="wallabag"> - <?php echo Minz_Translate::t ('your_wallabag'); ?> - </label> - <div class="group-controls"> - <input type="url" id="wallabag" name="wallabag" class="extend" value="<?php echo $this->conf->sharing ('wallabag'); ?>" placeholder="<?php echo Minz_Translate::t ('blank_to_disable'); ?>" size="64" /> - - <?php echo FreshRSS_Themes::icon('help'); ?> <a target="_blank" href="http://www.wallabag.org"><?php echo Minz_Translate::t ('more_information'); ?></a> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="diaspora"> - <?php echo Minz_Translate::t ('your_diaspora_pod'); ?> - </label> - <div class="group-controls"> - <input type="url" id="diaspora" name="diaspora" class="extend" value="<?php echo $this->conf->sharing ('diaspora'); ?>" placeholder="<?php echo Minz_Translate::t ('blank_to_disable'); ?>" size="64" /> - - <?php echo FreshRSS_Themes::icon('help'); ?> <a target="_blank" href="https://diasporafoundation.org/"><?php echo Minz_Translate::t ('more_information'); ?></a> + <?php foreach ($this->conf->sharing as $key => $sharing): ?> + <?php $share = $this->conf->shares[$sharing['type']]; ?> + <div class="form-group" id="group-share-<?php echo $key; ?>"> + <label class="group-name"> + <?php echo Minz_Translate::t ($sharing['type']); ?> + </label> + <div class="group-controls"> + <input type='hidden' id='share_<?php echo $key;?>_type' name="share[<?php echo $key;?>][type]" value='<?php echo $sharing['type']?>' /> + <?php if ($share['form'] === 'advanced') { ?> + <div class="stick"> + <input type="text" id="share_<?php echo $key;?>_name" name="share[<?php echo $key;?>][name]" class="extend" value="<?php echo $sharing['name']?>" placeholder="<?php echo Minz_Translate::t ('share_name'); ?>" size="64" /> + <input type="url" id="share_<?php echo $key;?>_url" name="share[<?php echo $key;?>][url]" class="extend" value="<?php echo $sharing['url']?>" placeholder="<?php echo Minz_Translate::t ('share_url'); ?>" size="64" /> + <a href='#' class='remove btn btn-attention' data-remove="group-share-<?php echo $key; ?>"><?php echo FreshRSS_Themes::icon('close'); ?></a> + </div> + + <a target="_blank" class="btn" title="<?php echo Minz_Translate::t('more_information'); ?>" href="<?php echo $share['help']?>"><?php echo FreshRSS_Themes::icon('help'); ?></a> + <?php } else { ?> + <a href='#' class='remove btn btn-attention' data-remove="group-share-<?php echo $key; ?>"><?php echo FreshRSS_Themes::icon('close'); ?></a> + <?php } ?> + </div> </div> - </div> + <?php endforeach;?> <div class="form-group"> - <label class="group-name"><?php echo Minz_Translate::t ('activate_sharing'); ?></label> <div class="group-controls"> - <?php - $services = array ('twitter', 'g+', 'facebook', 'email', 'print'); - - foreach ($services as $service) { - ?> - <label class="checkbox" for="<?php echo $service; ?>"> - <input type="checkbox" name="<?php echo $service; ?>" id="<?php echo $service; ?>" value="1"<?php echo $this->conf->sharing($service) ? ' checked="checked"' : ''; ?> /> - <?php echo Minz_Translate::t ($service); ?> - </label> - <?php } ?> + <select> + <?php foreach($this->conf->shares as $key => $params):?> + <option value='<?php echo $key?>' data-form='<?php echo $params['form']?>' data-help='<?php if (!empty($params['help'])) {echo $params['help'];}?>'><?php echo Minz_Translate::t($key) ?></option> + <?php endforeach; ?> + </select> + <a href='#' class='share add btn'><?php echo FreshRSS_Themes::icon('add'); ?></a> </div> </div> diff --git a/app/views/configure/shortcut.phtml b/app/views/configure/shortcut.phtml index 748a65d17..a4029b676 100644 --- a/app/views/configure/shortcut.phtml +++ b/app/views/configure/shortcut.phtml @@ -12,7 +12,7 @@ <?php $s = $this->conf->shortcuts; ?> <form method="post" action="<?php echo _url ('configure', 'shortcut'); ?>"> - <legend><?php echo Minz_Translate::t ('shortcuts_management'); ?></legend> + <legend><?php echo Minz_Translate::t ('shortcuts'); ?></legend> <noscript><p class="alert alert-error"><?php echo Minz_Translate::t ('javascript_for_shortcuts'); ?></p></noscript> @@ -96,6 +96,28 @@ </div> </div> + <div class="form-group"> + <label class="group-name" for="focus_search_shortcut"><?php echo Minz_Translate::t ('focus_search'); ?></label> + <div class="group-controls"> + <input type="text" id="focus_search_shortcut" name="shortcuts[focus_search]" list="keys" value="<?php echo $s['focus_search']; ?>" /> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="user_filter_shortcut"><?php echo Minz_Translate::t ('user_filter'); ?></label> + <div class="group-controls"> + <input type="text" id="user_filter_shortcut" name="shortcuts[user_filter]" list="keys" value="<?php echo $s['user_filter']; ?>" /> + <?php echo Minz_Translate::t ('user_filter_help'); ?> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="help_shortcut"><?php echo Minz_Translate::t ('help'); ?></label> + <div class="group-controls"> + <input type="text" id="help_shortcut" name="shortcuts[help]" list="keys" value="<?php echo $s['help']; ?>" /> + </div> + </div> + <div class="form-group form-actions"> <div class="group-controls"> <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button> diff --git a/app/views/configure/users.phtml b/app/views/configure/users.phtml index 1305feac9..272896fb2 100644 --- a/app/views/configure/users.phtml +++ b/app/views/configure/users.phtml @@ -20,11 +20,26 @@ <div class="form-group"> <label class="group-name" for="passwordPlain"><?php echo Minz_Translate::t('password_form'); ?></label> <div class="group-controls"> - <input type="password" id="passwordPlain" name="passwordPlain" autocomplete="off" pattern=".{7,}" /> + <div class="stick"> + <input type="password" id="passwordPlain" name="passwordPlain" autocomplete="off" pattern=".{7,}" <?php echo cryptAvailable() ? '' : 'disabled="disabled" '; ?>/> + <a class="btn toggle-password"><?php echo FreshRSS_Themes::icon('key'); ?></a> + </div> <noscript><b><?php echo Minz_Translate::t('javascript_should_be_activated'); ?></b></noscript> </div> </div> + <?php if (Minz_Configuration::apiEnabled()) { ?> + <div class="form-group"> + <label class="group-name" for="apiPasswordPlain"><?php echo Minz_Translate::t('password_api'); ?></label> + <div class="group-controls"> + <div class="stick"> + <input type="password" id="apiPasswordPlain" name="apiPasswordPlain" autocomplete="off" pattern=".{7,}" <?php echo cryptAvailable() ? '' : 'disabled="disabled" '; ?>/> + <a class="btn toggle-password"><?php echo FreshRSS_Themes::icon('key'); ?></a> + </div> + </div> + </div> + <?php } ?> + <div class="form-group"> <label class="group-name" for="mail_login"><?php echo Minz_Translate::t('persona_connection_email'); ?></label> <?php $mail = $this->conf->mail_login; ?> @@ -52,7 +67,7 @@ <?php if (!in_array(Minz_Configuration::authType(), array('form', 'persona', 'http_auth', 'none'))) { ?> <option selected="selected"></option> <?php } ?> - <option value="form"<?php echo Minz_Configuration::authType() === 'form' ? ' selected="selected"' : '', version_compare(PHP_VERSION, '5.3', '<') ? ' disabled="disabled"' : ''; ?>><?php echo Minz_Translate::t('auth_form'); ?></option> + <option value="form"<?php echo Minz_Configuration::authType() === 'form' ? ' selected="selected"' : '', cryptAvailable() ? '' : ' disabled="disabled"'; ?>><?php echo Minz_Translate::t('auth_form'); ?></option> <option value="persona"<?php echo Minz_Configuration::authType() === 'persona' ? ' selected="selected"' : '', $this->conf->mail_login == '' ? ' disabled="disabled"' : ''; ?>><?php echo Minz_Translate::t('auth_persona'); ?></option> <option value="http_auth"<?php echo Minz_Configuration::authType() === 'http_auth' ? ' selected="selected"' : '', httpAuthUser() == '' ? ' disabled="disabled"' : ''; ?>><?php echo Minz_Translate::t('http_auth'); ?> (REMOTE_USER = '<?php echo httpAuthUser(); ?>')</option> <option value="none"<?php echo Minz_Configuration::authType() === 'none' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t('auth_none'); ?></option> @@ -80,18 +95,39 @@ </div> </div> + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="unsafe_autologin"> + <input type="checkbox" name="unsafe_autologin" id="unsafe_autologin" value="1"<?php echo Minz_Configuration::unsafeAutologinEnabled() ? ' checked="checked"' : '', + Minz_Configuration::canLogIn() ? '' : ' disabled="disabled"'; ?> /> + <?php echo Minz_Translate::t('unsafe_autologin'); ?> + <kbd>p/i/?a=formLogin&u=Alice&p=1234</kbd> + </label> + </div> + </div> + <?php if (Minz_Configuration::canLogIn()) { ?> <div class="form-group"> <label class="group-name" for="token"><?php echo Minz_Translate::t('auth_token'); ?></label> <?php $token = $this->conf->token; ?> <div class="group-controls"> - <input type="text" id="token" name="token" value="<?php echo $token; ?>" placeholder="<?php echo Minz_Translate::t('blank_to_disable'); ?>"<?php + <input type="text" id="token" name="token" value="<?php echo $token; ?>" placeholder="<?php echo Minz_Translate::t('blank_to_disable'); ?>"<?php echo Minz_Configuration::canLogIn() ? '' : ' disabled="disabled"'; ?> /> <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t('explain_token', Minz_Url::display(null, 'html', true), $token); ?> </div> </div> <?php } ?> + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="api_enabled"> + <input type="checkbox" name="api_enabled" id="api_enabled" value="1"<?php echo Minz_Configuration::apiEnabled() ? ' checked="checked"' : '', + Minz_Configuration::needsLogin() ? '' : ' disabled="disabled"'; ?> /> + <?php echo Minz_Translate::t('api_enabled'); ?> + </label> + </div> + </div> + <div class="form-group form-actions"> <div class="group-controls"> <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t('save'); ?></button> @@ -146,7 +182,10 @@ <div class="form-group"> <label class="group-name" for="new_user_passwordPlain"><?php echo Minz_Translate::t('password_form'); ?></label> <div class="group-controls"> - <input type="password" id="new_user_passwordPlain" name="new_user_passwordPlain" autocomplete="off" pattern=".{7,}" /> + <div class="stick"> + <input type="password" id="new_user_passwordPlain" name="new_user_passwordPlain" autocomplete="off" pattern=".{7,}" /> + <a class="btn toggle-password"><?php echo FreshRSS_Themes::icon('key'); ?></a> + </div> <noscript><b><?php echo Minz_Translate::t('javascript_should_be_activated'); ?></b></noscript> </div> </div> diff --git a/app/views/error/index.phtml b/app/views/error/index.phtml index 6a09c3aa2..ef4fbd39d 100644 --- a/app/views/error/index.phtml +++ b/app/views/error/index.phtml @@ -1,18 +1,9 @@ <div class="post"> <div class="alert alert-error"> <h1 class="alert-head"><?php echo $this->code; ?></h1> - <p> - <?php - switch(Minz_Request::param ('code')) { - case 403: - echo Minz_Translate::t ('forbidden_access'); - break; - case 404: - default: - echo Minz_Translate::t ('page_not_found'); - } ?><br /> - <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a> + <?php echo $this->errorMessage; ?><br /> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo Minz_Translate::t('back_to_rss_feeds'); ?></a> </p> </div> </div> diff --git a/app/views/feed/add.phtml b/app/views/feed/add.phtml new file mode 100644 index 000000000..849dacac6 --- /dev/null +++ b/app/views/feed/add.phtml @@ -0,0 +1,91 @@ +<?php if ($this->feed) { ?> +<div class="post"> + <h1><?php echo Minz_Translate::t ('add_rss_feed'); ?></h1> + + <?php if (!$this->load_ok) { ?> + <p class="alert alert-error"><span class="alert-head"><?php echo Minz_Translate::t('damn'); ?></span> <?php echo Minz_Translate::t('internal_problem_feed', _url('index', 'logs')); ?></p> + <?php } ?> + + <form method="post" action="<?php echo _url('feed', 'add'); ?>" autocomplete="off"> + <legend><?php echo Minz_Translate::t('informations'); ?></legend> + <?php if ($this->load_ok) { ?> + <div class="form-group"> + <label class="group-name"><?php echo Minz_Translate::t('title'); ?></label> + <div class="group-controls"> + <label><?php echo $this->feed->name() ; ?></label> + </div> + </div> + + <?php $desc = $this->feed->description(); if ($desc != '') { ?> + <div class="form-group"> + <label class="group-name"><?php echo Minz_Translate::t('feed_description'); ?></label> + <div class="group-controls"> + <label><?php echo htmlspecialchars($desc, ENT_NOQUOTES, 'UTF-8'); ?></label> + </div> + </div> + <?php } ?> + + <div class="form-group"> + <label class="group-name"><?php echo Minz_Translate::t('website_url'); ?></label> + <div class="group-controls"> + <?php echo $this->feed->website(); ?> + <a class="btn" target="_blank" href="<?php echo $this->feed->website(); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a> + </div> + </div> + <?php } ?> + + <div class="form-group"> + <label class="group-name" for="url"><?php echo Minz_Translate::t('feed_url'); ?></label> + <div class="group-controls"> + <div class="stick"> + <input type="text" name="url_rss" id="url" class="extend" value="<?php echo $this->feed->url(); ?>" /> + <a class="btn" target="_blank" href="<?php echo $this->feed->url(); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a> + </div> + <a class="btn" target="_blank" href="http://validator.w3.org/feed/check.cgi?url=<?php echo $this->feed->url(); ?>"><?php echo Minz_Translate::t('feed_validator'); ?></a> + </div> + </div> + <div class="form-group"> + <label class="group-name" for="category"><?php echo Minz_Translate::t('category'); ?></label> + <div class="group-controls"> + <select name="category" id="category"> + <?php foreach ($this->categories as $cat) { ?> + <option value="<?php echo $cat->id(); ?>"<?php echo $cat->id() == 1 ? ' selected="selected"' : ''; ?>> + <?php echo $cat->name(); ?> + </option> + <?php } ?> + <option value="nc"><?php echo Minz_Translate::t('new_category'); ?></option> + </select> + + <span style="display: none;"> + <input type="text" name="new_category[name]" id="new_category_name" autocomplete="off" placeholder="<?php echo Minz_Translate::t('new_category'); ?>" /> + </span> + </div> + </div> + + <legend><?php echo Minz_Translate::t('http_authentication'); ?></legend> + <?php $auth = $this->feed->httpAuth(false); ?> + <div class="form-group"> + <label class="group-name" for="http_user"><?php echo Minz_Translate::t('http_username'); ?></label> + <div class="group-controls"> + <input type="text" name="http_user" id="http_user" class="extend" value="<?php echo $auth['username']; ?>" autocomplete="off" /> + </div> + + <label class="group-name" for="http_pass"><?php echo Minz_Translate::t('http_password'); ?></label> + <div class="group-controls"> + <input type="password" name="http_pass" id="http_pass" class="extend" value="<?php echo $auth['password']; ?>" autocomplete="off" /> + </div> + + <div class="group-controls"> + <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t('access_protected_feeds'); ?> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t('save'); ?></button> + <button type="reset" class="btn"><?php echo Minz_Translate::t('cancel'); ?></button> + </div> + </div> + </form> +</div> +<?php } ?> diff --git a/app/views/helpers/export/articles.phtml b/app/views/helpers/export/articles.phtml new file mode 100644 index 000000000..ffdca1daa --- /dev/null +++ b/app/views/helpers/export/articles.phtml @@ -0,0 +1,47 @@ +<?php + $username = Minz_Session::param('currentUser', '_'); + + $articles = array( + 'id' => 'user/' . str_replace('/', '', $username) . '/state/org.freshrss/' . $this->type, + 'title' => $this->list_title, + 'author' => $username, + 'items' => array() + ); + + foreach ($this->entries as $entry) { + if (!isset($this->feed)) { + $feed = FreshRSS_CategoryDAO::findFeed($this->categories, $entry->feed ()); + } else { + $feed = $this->feed; + } + + $articles['items'][] = array( + 'id' => $entry->guid(), + 'categories' => array_values($entry->tags()), + 'title' => $entry->title(), + 'author' => $entry->author(), + 'published' => $entry->date(true), + 'updated' => $entry->date(true), + 'alternate' => array(array( + 'href' => $entry->link(), + 'type' => 'text/html' + )), + 'content' => array( + 'content' => $entry->content() + ), + 'origin' => array( + 'streamId' => $feed->id(), + 'title' => $feed->name(), + 'htmlUrl' => $feed->website(), + 'feedUrl' => $feed->url() + ) + ); + } + + $options = 0; + if (version_compare(PHP_VERSION, '5.4.0') >= 0) { + $options = JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE; + } + + echo json_encode($articles, $options); +?> diff --git a/app/views/helpers/export/opml.phtml b/app/views/helpers/export/opml.phtml new file mode 100644 index 000000000..8622d9144 --- /dev/null +++ b/app/views/helpers/export/opml.phtml @@ -0,0 +1,28 @@ +<?php + +$opml_array = array( + 'head' => array( + 'title' => Minz_Configuration::title(), + 'dateCreated' => date('D, d M Y H:i:s') + ), + 'body' => array() +); + +foreach ($this->categories as $key => $cat) { + $opml_array['body'][$key] = array( + 'text' => $cat['name'], + '@outlines' => array() + ); + + foreach ($cat['feeds'] as $feed) { + $opml_array['body'][$key]['@outlines'][] = array( + 'text' => htmlspecialchars_decode($feed->name()), + 'type' => 'rss', + 'xmlUrl' => htmlspecialchars_decode($feed->url()), + 'htmlUrl' => htmlspecialchars_decode($feed->website()), + 'description' => htmlspecialchars_decode($feed->description()), + ); + } +} + +echo libopml_render($opml_array); diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml index 3d7c8a98f..1139eb446 100644 --- a/app/views/helpers/javascript_vars.phtml +++ b/app/views/helpers/javascript_vars.phtml @@ -4,13 +4,15 @@ echo '"use strict";', "\n"; $mark = $this->conf->mark_when; echo 'var ', - 'hide_posts=', ($this->conf->display_posts || Minz_Request::param('output') === 'reader') ? 'false' : 'true', + 'help_url="', FRESHRSS_WIKI, '"', + ',hide_posts=', ($this->conf->display_posts || Minz_Request::param('output') === 'reader') ? 'false' : 'true', + ',display_order="', Minz_Request::param('order', $this->conf->sort_order), '"', ',auto_mark_article=', $mark['article'] ? 'true' : 'false', ',auto_mark_site=', $mark['site'] ? 'true' : 'false', ',auto_mark_scroll=', $mark['scroll'] ? 'true' : 'false', ',auto_load_more=', $this->conf->auto_load_more ? 'true' : 'false', - ',full_lazyload=', $this->conf->lazyload && ($this->conf->display_posts || Minz_Request::param('output') === 'reader') ? 'true' : 'false', - ',does_lazyload=', $this->conf->lazyload ? 'true' : 'false'; + ',does_lazyload=', $this->conf->lazyload ? 'true' : 'false', + ',sticky_post=', $this->conf->sticky_post ? 'true' : 'false'; $s = $this->conf->shortcuts; echo ',shortcuts={', @@ -23,7 +25,10 @@ echo ',shortcuts={', 'last_entry:"', $s['last_entry'], '",', 'collapse_entry:"', $s['collapse_entry'], '",', 'load_more:"', $s['load_more'], '",', - 'auto_share:"', $s['auto_share'], '"', + 'auto_share:"', $s['auto_share'], '",', + 'focus_search:"', $s['focus_search'], '",', + 'user_filter:"', $s['user_filter'], '",', + 'help:"', $s['help'], '"', "},\n"; if (Minz_Request::param ('output') === 'global') { @@ -46,7 +51,11 @@ echo 'authType="', $authType, '",', 'url_login="', _url ('index', 'login'), '",', 'url_logout="', _url ('index', 'logout'), '",'; -echo 'str_confirmation="', Minz_Translate::t('confirm_action'), '"', ",\n"; +echo 'str_confirmation_default="', Minz_Translate::t('confirm_action'), '"', ",\n"; +echo 'str_notif_title_articles="', Minz_Translate::t('notif_title_new_articles'), '"', ",\n"; +echo 'str_notif_body_articles="', Minz_Translate::t('notif_body_new_articles'), '"', ",\n"; +echo 'html5_notif_timeout=', $this->conf->html5_notif_timeout,",\n"; + $autoActualise = Minz_Session::param('actualize_feeds', false); echo 'auto_actualize_feeds=', $autoActualise ? 'true' : 'false', ";\n"; diff --git a/app/views/helpers/pagination.phtml b/app/views/helpers/pagination.phtml index d4983a32e..cea338364 100755 --- a/app/views/helpers/pagination.phtml +++ b/app/views/helpers/pagination.phtml @@ -1,26 +1,37 @@ <?php - $c = Minz_Request::controllerName (); - $a = Minz_Request::actionName (); - $params = Minz_Request::params (); - $markReadUrl = Minz_Session::param ('markReadUrl'); - Minz_Session::_param ('markReadUrl', false); + $c = Minz_Request::controllerName(); + $a = Minz_Request::actionName(); + $params = Minz_Request::params(); + $markReadUrl = Minz_Session::param('markReadUrl'); + Minz_Session::_param('markReadUrl', false); ?> +<form id="mark-read-pagination" method="post" style="display: none"></form> + <ul class="pagination"> <li class="item pager-next"> <?php if (!empty($this->nextId)) { ?> - <?php $params['next'] = $this->nextId; ?> - <a id="load_more" href="<?php echo Minz_Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo Minz_Translate::t ('load_more'); ?></a> + <?php + $params['next'] = $this->nextId; + $params['ajax'] = 1; + ?> + <a id="load_more" href="<?php echo Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)); ?>"> + <?php echo _t('load_more'); ?> + </a> <?php } elseif ($markReadUrl) { ?> - <a id="bigMarkAsRead" href="<?php echo $markReadUrl; ?>"> - <?php echo Minz_Translate::t ('nothing_to_load'); ?><br /> - <span class="bigTick">✔</span><br /> - <?php echo Minz_Translate::t ('mark_all_read'); ?> - </a> + <button id="bigMarkAsRead" + class="as-link <?php echo $this->conf->reading_confirm ? 'confirm' : ''; ?>" + form="mark-read-pagination" + formaction="<?php echo $markReadUrl; ?>" + type="submit"> + <?php echo _t('nothing_to_load'); ?><br /> + <span class="bigTick">✓</span><br /> + <?php echo _t('mark_all_read'); ?> + </button> <?php } else { ?> - <a id="bigMarkAsRead" href="."> - <?php echo Minz_Translate::t ('nothing_to_load'); ?><br /> - </a> + <a id="bigMarkAsRead" href="."> + <?php echo _t('nothing_to_load'); ?><br /> + </a> <?php } ?> </li> </ul> diff --git a/app/views/helpers/view/global_view.phtml b/app/views/helpers/view/global_view.phtml index db937eeae..72bcf4c73 100644 --- a/app/views/helpers/view/global_view.phtml +++ b/app/views/helpers/view/global_view.phtml @@ -1,5 +1,6 @@ <?php $this->partial ('nav_menu'); ?> +<?php if (!empty($this->entries)) { ?> <div id="stream" class="global categories"> <?php $arUrl = array('c' => 'index', 'a' => 'index', 'params' => array()); @@ -43,3 +44,10 @@ <div id="panel"<?php echo $this->conf->display_posts ? '' : ' class="hide_posts"'; ?>> <a class="close" href="#"><?php echo FreshRSS_Themes::icon('close'); ?></a> </div> + +<?php } else { ?> +<div id="stream" class="prompt alert alert-warn global"> + <h2><?php echo _t('no_feed_to_display'); ?></h2> + <a href="<?php echo _url('configure', 'feed'); ?>"><?php echo _t('think_to_add'); ?></a><br /><br /> +</div> +<?php } ?> diff --git a/app/views/helpers/view/normal_view.phtml b/app/views/helpers/view/normal_view.phtml index ae93b627c..1dbf14f4c 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,17 +20,17 @@ 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; + + $content_width = $this->conf->content_width; ?> <div id="stream" class="normal<?php echo $hidePosts ? ' hide_posts' : ''; ?>"><?php ?><div id="new-article"> - <a href="<?php echo _url('index', 'index'); ?>"><?php echo Minz_Translate::t ('new_article'); ?></a> + <a href="<?php echo Minz_Url::display ($this->url); ?>"><?php echo Minz_Translate::t ('new_article'); ?></a> </div><?php foreach ($this->entries as $item) { if ($display_today && $item->isDay (FreshRSS_Days::TODAY, $this->today)) { @@ -90,7 +81,12 @@ if (!empty($this->entries)) { } } $feed = FreshRSS_CategoryDAO::findFeed($this->cat_aside, $item->feed ()); //We most likely already have the feed object in cache - if (empty($feed)) $feed = $item->feed (true); + if ($feed == null) { + $feed = $item->feed(true); + if ($feed == null) { + $feed = FreshRSS_Feed::example(); + } + } ?><li class="item website"><a href="<?php echo _url ('index', 'index', 'get', 'f_' . $feed->id ()); ?>"><img class="favicon" src="<?php echo $feed->favicon (); ?>" alt="✇" /> <span><?php echo $feed->name(); ?></span></a></li> <li class="item title"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo $item->title (); ?></a></li> <?php if ($topline_date) { ?><li class="item date"><?php echo $item->date (); ?> </li><?php } ?> @@ -98,16 +94,12 @@ if (!empty($this->entries)) { </ul> <div class="flux_content"> - <div class="content"> - <h1 class="title"><?php echo $item->title (); ?></h1> + <div class="content <?php echo $content_width; ?>"> + <h1 class="title"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo $item->title (); ?></a></h1> <?php - $author = $item->author (); - echo $author != '' ? '<div class="author">' . Minz_Translate::t ('by_author', $author) . '</div>' : ''; - if ($lazyload) { - echo $hidePosts ? lazyIframe(lazyimg($item->content())) : lazyimg($item->content()); - } else { - echo $item->content(); - } + $author = $item->author(); + echo $author != '' ? '<div class="author">' . Minz_Translate::t('by_author', $author) . '</div>' : '', + $lazyload && $hidePosts ? lazyimg($item->content()) : $item->content(); ?> </div> <ul class="horizontal-list bottom"><?php @@ -146,55 +138,13 @@ if (!empty($this->entries)) { <ul class="dropdown-menu"> <li class="dropdown-close"><a href="#close">❌</a></li> - <?php if ($shaarli) { ?> - <li class="item share"> - <a target="_blank" href="<?php echo $shaarli . '?post=' . $link . '&title=' . $title . '&source=FreshRSS'; ?>"> - <?php echo Minz_Translate::t ('shaarli'); ?> - </a> - </li> - <?php } if ($wallabag) { ?> - <li class="item share"> - <a target="_blank" href="<?php echo $wallabag . '?action=add&url=' . base64_encode (urldecode($link)); ?>"> - <?php echo Minz_Translate::t ('wallabag'); ?> - </a> - </li> - <?php } if ($diaspora) { ?> - <li class="item share"> - <a target="_blank" href="<?php echo $diaspora . '/bookmarklet?url=' . $link . '&title=' . $title; ?>"> - <?php echo Minz_Translate::t ('diaspora'); ?> - </a> - </li> - <?php } if ($twitter) { ?> - <li class="item share"> - <a target="_blank" href="https://twitter.com/share?url=<?php echo $link; ?>&text=<?php echo $title; ?>"> - <?php echo Minz_Translate::t ('twitter'); ?> - </a> - </li> - <?php } if ($google_plus) { ?> - <li class="item share"> - <a target="_blank" href="https://plus.google.com/share?url=<?php echo $link; ?>"> - <?php echo Minz_Translate::t ('g+'); ?> - </a> - </li> - <?php } if ($facebook) { ?> - <li class="item share"> - <a target="_blank" href="https://www.facebook.com/sharer.php?u=<?php echo $link; ?>&t=<?php echo $title; ?>"> - <?php echo Minz_Translate::t ('facebook'); ?> - </a> - </li> - <?php } if ($email) { ?> - <li class="item share"> - <a href="mailto:?subject=<?php echo urldecode($title); ?>&body=<?php echo $link; ?>"> - <?php echo Minz_Translate::t ('by_email'); ?> - </a> - </li> - <?php } if ($print) { ?> - <li class="item share"> - <a href="#" class="print-article"> - <?php echo Minz_Translate::t ('print'); ?> - </a> - </li> - <?php } ?> + <?php foreach ($sharing as $share) :?> + <li class="item share"> + <a target="_blank" href="<?php echo FreshRSS_Share::generateUrl($this->conf->shares, $share, $item->link(), $item->title() . ' . ' . $feed->name())?>"> + <?php echo Minz_Translate::t ($share['name']);?> + </a> + </li> + <?php endforeach;?> </ul> </div> <?php } ?> @@ -233,8 +183,8 @@ if (!empty($this->entries)) { <?php $this->partial ('nav_entries'); ?> <?php } else { ?> -<div id="stream" class="alert alert-warn normal"> - <span class="alert-head"><?php echo Minz_Translate::t ('no_feed_to_display'); ?></span> - <?php echo Minz_Translate::t ('think_to_add'); ?> +<div id="stream" class="prompt alert alert-warn normal"> + <h2><?php echo _t('no_feed_to_display'); ?></h2> + <a href="<?php echo _url('configure', 'feed'); ?>"><?php echo _t('think_to_add'); ?></a><br /><br /> </div> <?php } ?> diff --git a/app/views/helpers/view/reader_view.phtml b/app/views/helpers/view/reader_view.phtml index bda96e86d..c80dca519 100644 --- a/app/views/helpers/view/reader_view.phtml +++ b/app/views/helpers/view/reader_view.phtml @@ -3,6 +3,7 @@ $this->partial ('nav_menu'); if (!empty($this->entries)) { $lazyload = $this->conf->lazyload; + $content_width = $this->conf->content_width; ?> <div id="stream" class="reader"> @@ -10,7 +11,7 @@ if (!empty($this->entries)) { <div class="flux<?php echo !$item->isRead () ? ' not_read' : ''; ?><?php echo $item->isFavorite () ? ' favorite' : ''; ?>" id="flux_<?php echo $item->id (); ?>"> <div class="flux_content"> - <div class="content"> + <div class="content <?php echo $content_width; ?>"> <?php $feed = FreshRSS_CategoryDAO::findFeed($this->cat_aside, $item->feed ()); //We most likely already have the feed object in cache if (empty($feed)) $feed = $item->feed (true); @@ -20,19 +21,13 @@ if (!empty($this->entries)) { </a> <h1 class="title"><?php echo $item->title (); ?></h1> - <div class="author"> - <?php $author = $item->author (); ?> - <?php echo $author != '' ? Minz_Translate::t ('by_author', $author) . ' — ' : ''; ?> - <?php echo $item->date (); ?> - </div> + <div class="author"><?php + $author = $item->author(); + echo $author != '' ? Minz_Translate::t('by_author', $author) . ' — ' : '', + $item->date(); + ?></div> - <?php - if ($lazyload) { - echo lazyimg($item->content ()); - } else { - echo $item->content(); - } - ?> + <?php echo $item->content(); ?> </div> </div> </div> @@ -42,8 +37,8 @@ if (!empty($this->entries)) { </div> <?php } else { ?> -<div id="stream" class="alert alert-warn reader"> - <span class="alert-head"><?php echo Minz_Translate::t ('no_feed_to_display'); ?></span> - <?php echo Minz_Translate::t ('think_to_add'); ?> +<div id="stream" class="prompt alert alert-warn reader"> + <h2><?php echo _t('no_feed_to_display'); ?></h2> + <a href="<?php echo _url('configure', 'feed'); ?>"><?php echo _t('think_to_add'); ?></a><br /><br /> </div> <?php } ?> 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 @@ <description><?php echo Minz_Translate::t ('rss_feeds_of', $this->rss_title); ?></description> <pubDate><?php echo date('D, d M Y H:i:s O'); ?></pubDate> <lastBuildDate><?php echo gmdate('D, d M Y H:i:s'); ?> GMT</lastBuildDate> - <atom:link href="<?php echo Minz_Url::display ($this->rss_url, 'html', true); ?>" rel="self" type="application/rss+xml" /> + <atom:link href="<?php echo Minz_Url::display ($this->url, 'html', true); ?>" rel="self" type="application/rss+xml" /> <?php foreach ($this->entries as $item) { ?> diff --git a/app/views/importExport/export.phtml b/app/views/importExport/export.phtml new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/app/views/importExport/export.phtml diff --git a/app/views/importExport/index.phtml b/app/views/importExport/index.phtml new file mode 100644 index 000000000..35371faca --- /dev/null +++ b/app/views/importExport/index.phtml @@ -0,0 +1,61 @@ +<?php $this->partial('aside_feed'); ?> + +<div class="post "> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('back_to_rss_feeds'); ?></a> + + <form method="post" action="<?php echo _url('importExport', 'import'); ?>" enctype="multipart/form-data"> + <legend><?php echo _t('import'); ?></legend> + <div class="form-group"> + <label class="group-name" for="file"> + <?php echo extension_loaded('zip') ? _t('file_to_import') : _t('file_to_import_no_zip'); ?> + </label> + <div class="group-controls"> + <input type="file" name="file" id="file" /> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo _t('import'); ?></button> + </div> + </div> + </form> + + <?php if (count($this->feeds) > 0) { ?> + <form method="post" action="<?php echo _url('importExport', 'export'); ?>"> + <legend><?php echo _t('export'); ?></legend> + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="export_opml"> + <input type="checkbox" name="export_opml" id="export_opml" value="1" checked="checked" /> + <?php echo _t('export_opml'); ?> + </label> + + <label class="checkbox" for="export_starred"> + <input type="checkbox" name="export_starred" id="export_starred" value="1" <?php echo extension_loaded('zip') ? 'checked="checked"' : ''; ?> /> + <?php echo _t('export_starred'); ?> + </label> + + <?php + $select_args = ''; + if (extension_loaded('zip')) { + $select_args = ' size="' . min(10, count($this->feeds)) .'" multiple="multiple"'; + } + ?> + <select name="export_feeds[]"<?php echo $select_args; ?>> + <?php echo extension_loaded('zip') ? '' : '<option></option>'; ?> + <?php foreach ($this->feeds as $feed) { ?> + <option value="<?php echo $feed->id(); ?>"><?php echo $feed->name(); ?></option> + <?php } ?> + </select> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo _t('export'); ?></button> + </div> + </div> + </form> + <?php } ?> +</div> diff --git a/app/views/index/formLogin.phtml b/app/views/index/formLogin.phtml index cc925ea59..b05cdced4 100644 --- a/app/views/index/formLogin.phtml +++ b/app/views/index/formLogin.phtml @@ -1,32 +1,46 @@ <div class="prompt"> - <h1><?php echo Minz_Translate::t('login'); ?></h1><?php + <h1><?php echo _t('login'); ?></h1><?php switch (Minz_Configuration::authType()) { case 'form': - ?><form id="loginForm" method="post" action="<?php echo _url('index', 'formLogin'); ?>"> + ?><form id="crypto-form" method="post" action="<?php echo _url('index', 'formLogin'); ?>"> <div> - <label for="username"><?php echo Minz_Translate::t('username'); ?></label> + <label for="username"><?php echo _t('username'); ?></label> <input type="text" id="username" name="username" size="16" required="required" maxlength="16" pattern="[0-9a-zA-Z]{1,16}" autofocus="autofocus" /> </div> <div> - <label for="passwordPlain"><?php echo Minz_Translate::t('password'); ?></label> + <label for="passwordPlain"><?php echo _t('password'); ?></label> <input type="password" id="passwordPlain" required="required" /> <input type="hidden" id="challenge" name="challenge" /><br /> - <noscript><strong><?php echo Minz_Translate::t('javascript_should_be_activated'); ?></strong></noscript> + <noscript><strong><?php echo _t('javascript_should_be_activated'); ?></strong></noscript> </div> <div> - <button id="loginButton" type="submit" class="btn btn-important"><?php echo Minz_Translate::t('login'); ?></button> + <label class="checkbox" for="keep_logged_in"> + <input type="checkbox" name="keep_logged_in" id="keep_logged_in" value="1" /> + <?php echo _t('keep_logged_in'); ?> + </label> + <br /> + </div> + <div> + <button id="loginButton" type="submit" class="btn btn-important"><?php echo _t('login'); ?></button> </div> </form><?php break; case 'persona': ?><p> - <?php echo FreshRSS_Themes::icon('login'); ?> - <a class="signin" href="#"><?php echo Minz_Translate::t('login_with_persona'); ?></a> + <a class="signin btn btn-important" href="#"> + <?php echo _i('login'); ?> + <?php echo _t('login_with_persona'); ?> + </a><br /><br /> + + <?php echo _i('help'); ?> + <small> + <a href="<?php echo _url('index', 'resetAuth'); ?>"><?php echo _t('login_persona_problem'); ?></a> + </small> </p><?php break; } ?> - <p><a href="<?php echo _url('index', 'about'); ?>"><?php echo Minz_Translate::t('about_freshrss'); ?></a></p> + <p><a href="<?php echo _url('index', 'about'); ?>"><?php echo _t('about_freshrss'); ?></a></p> </div> diff --git a/app/views/index/resetAuth.phtml b/app/views/index/resetAuth.phtml new file mode 100644 index 000000000..6d4282c14 --- /dev/null +++ b/app/views/index/resetAuth.phtml @@ -0,0 +1,33 @@ +<div class="prompt"> + <h1><?php echo _t('auth_reset'); ?></h1> + + <?php if (!empty($this->message)) { ?> + <p class="alert <?php echo $this->message['status'] === 'bad' ? 'alert-error' : 'alert-warn'; ?>"> + <span class="alert-head"><?php echo $this->message['title']; ?></span><br /> + <?php echo $this->message['body']; ?> + </p> + <?php } ?> + + <?php if (!$this->no_form) { ?> + <form id="crypto-form" method="post" action="<?php echo _url('index', 'resetAuth'); ?>"> + <p class="alert alert-warn"> + <span class="alert-head"><?php echo _t('attention'); ?></span><br /> + <?php echo _t('auth_will_reset'); ?> + </p> + + <div> + <label for="username"><?php echo _t('username_admin'); ?></label> + <input type="text" id="username" name="username" size="16" required="required" maxlength="16" pattern="[0-9a-zA-Z]{1,16}" autofocus="autofocus" /> + </div> + <div> + <label for="passwordPlain"><?php echo _t('password'); ?></label> + <input type="password" id="passwordPlain" required="required" /> + <input type="hidden" id="challenge" name="challenge" /><br /> + <noscript><strong><?php echo _t('javascript_should_be_activated'); ?></strong></noscript> + </div> + <div> + <button id="loginButton" type="submit" class="btn btn-important"><?php echo _t('submit'); ?></button> + </div> + </form> + <?php } ?> +</div> diff --git a/app/views/javascript/actualize.phtml b/app/views/javascript/actualize.phtml index 3b12ad774..74cef4998 100644 --- a/app/views/javascript/actualize.phtml +++ b/app/views/javascript/actualize.phtml @@ -1,30 +1,30 @@ "use strict"; -var feeds = [<?php - foreach ($this->feeds as $feed) { - echo "'", Minz_Url::display(array('c' => 'feed', 'a' => 'actualize', 'params' => array('id' => $feed->id(), 'ajax' => '1')), 'php'), "',\n"; - } - ?>], +var feeds = [<?php foreach ($this->feeds as $feed) { ?>{<?php + ?>url: "<?php echo Minz_Url::display(array('c' => 'feed', 'a' => 'actualize', 'params' => array('id' => $feed->id(), 'ajax' => '1')), 'php'); ?>",<?php + ?>title: "<?php echo $feed->name(); ?>"<?php +?>},<?php } ?>], feed_processed = 0, feed_count = feeds.length; function initProgressBar(init) { if (init) { - $("body").after("\<div id=\"actualizeProgress\" class=\"actualizeProgress\">\ - <?php echo Minz_Translate::t ('refresh'); ?> <span class=\"progress\">0 / " + feed_count + "</span><br />\ - <progress id=\"actualizeProgressBar\" value=\"0\" max=\"" + feed_count + "\"></progress>\ + $("body").after("\<div id=\"actualizeProgress\" class=\"notification good\">\ + <?php echo _t('refresh'); ?><br /><span class=\"title\">/</span><br />\ + <span class=\"progress\">0 / " + feed_count + "</span>\ </div>"); } else { window.location.reload(); } } -function updateProgressBar(i) { - $("#actualizeProgressBar").val(i); +function updateProgressBar(i, title_feed) { $("#actualizeProgress .progress").html(i + " / " + feed_count); + $("#actualizeProgress .title").html(title_feed); } function updateFeeds() { if (feed_count === 0) { - openNotification("<?php echo Minz_Translate::t ('no_feed_to_refresh'); ?>", "good"); + openNotification("<?php echo _t('no_feed_to_refresh'); ?>", "good"); + ajax_loading = false; return; } initProgressBar(true); @@ -39,12 +39,13 @@ function updateFeed() { if (feed == undefined) { return; } + $.ajax({ type: 'POST', - url: feed, + url: feed['url'], }).complete(function (data) { feed_processed++; - updateProgressBar(feed_processed); + updateProgressBar(feed_processed, feed['title']); if (feed_processed === feed_count) { initProgressBar(false); diff --git a/app/views/stats/idle.phtml b/app/views/stats/idle.phtml new file mode 100644 index 000000000..6f3d4a117 --- /dev/null +++ b/app/views/stats/idle.phtml @@ -0,0 +1,48 @@ +<?php $this->partial('aside_stats'); ?> + +<div class="post"> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('back_to_rss_feeds'); ?></a> + + <h1><?php echo _t('stats_idle'); ?></h1> + + <?php + $current_url = urlencode(Minz_Url::display( + array('c' => 'stats', 'a' => 'idle'), + 'php', true + )); + $nothing = true; + foreach ($this->idleFeeds as $period => $feeds) { + if (!empty($feeds)) { + $nothing = false; + ?> + <div class="stat"> + <h2><?php echo _t($period); ?></h2> + + <form id="form-delete" method="post" style="display: none"></form> + + <?php foreach ($feeds as $feed) { ?> + <ul class="horizontal-list"> + <li class="item"> + <div class="stick"> + <a class="btn" href="<?php echo _url('index', 'index', 'get', 'f_' . $feed['id']); ?>"><?php echo _i('link'); ?> <?php echo _t('filter'); ?></a> + <a class="btn" href="<?php echo _url('configure', 'feed', 'id', $feed['id']); ?>"><?php echo _i('configure'); ?> <?php echo _t('administration'); ?></a> + <button class="btn btn-attention confirm" form="form-delete" formaction="<?php echo _url('feed', 'delete', 'id', $feed['id'], 'r', $current_url); ?>"><?php echo _t('delete'); ?></button> + </div> + </li> + <li class="item"> + <span title="<?php echo timestamptodate($feed['last_date'], false); ?>"><?php echo $feed['name']; ?> (<?php echo _t('number_articles', $feed['nb_articles']); ?>)</span> + </li> + </ul> + <?php } ?> + </div> + <?php + } + } + + if ($nothing) { + ?> + <p class="alert alert-warn"> + <span class="alert-head"><?php echo _t('stats_no_idle'); ?></span> + </p> + <?php } ?> +</div> diff --git a/app/views/index/stats.phtml b/app/views/stats/index.phtml index b5c18813d..412e77e16 100644 --- a/app/views/index/stats.phtml +++ b/app/views/stats/index.phtml @@ -1,74 +1,59 @@ -<div class="post content"> - <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a> - - <h1><?php echo Minz_Translate::t ('stats'); ?></h1> - - <div class="stat"> - <h2><?php echo Minz_Translate::t ('stats_entry_repartition'); ?></h2> +<?php $this->partial('aside_stats'); ?> + +<div class="post"> + <a href="<?php echo _url ('index', 'index'); ?>"><?php echo _t ('back_to_rss_feeds'); ?></a> + + <h1><?php echo _t ('stats_main'); ?></h1> + + <div class="stat half"> + <h2><?php echo _t ('stats_entry_repartition'); ?></h2> <table> <thead> <tr> <th> </th> - <th><?php echo Minz_Translate::t ('main_stream'); ?></th> - <th><?php echo Minz_Translate::t ('all_feeds'); ?></th> + <th><?php echo _t ('main_stream'); ?></th> + <th><?php echo _t ('all_feeds'); ?></th> </tr> </thead> <tbody> <tr> - <th><?php echo Minz_Translate::t ('status_total'); ?></th> + <th><?php echo _t ('status_total'); ?></th> <td class="numeric"><?php echo formatNumber($this->repartition['main_stream']['total']); ?></td> <td class="numeric"><?php echo formatNumber($this->repartition['all_feeds']['total']); ?></td> </tr> <tr> - <th><?php echo Minz_Translate::t ('status_read'); ?></th> + <th><?php echo _t ('status_read'); ?></th> <td class="numeric"><?php echo formatNumber($this->repartition['main_stream']['read']); ?></td> <td class="numeric"><?php echo formatNumber($this->repartition['all_feeds']['read']); ?></td> </tr> <tr> - <th><?php echo Minz_Translate::t ('status_unread'); ?></th> + <th><?php echo _t ('status_unread'); ?></th> <td class="numeric"><?php echo formatNumber($this->repartition['main_stream']['unread']); ?></td> <td class="numeric"><?php echo formatNumber($this->repartition['all_feeds']['unread']); ?></td> </tr> <tr> - <th><?php echo Minz_Translate::t ('status_favorites'); ?></th> + <th><?php echo _t ('status_favorites'); ?></th> <td class="numeric"><?php echo formatNumber($this->repartition['main_stream']['favorite']); ?></td> <td class="numeric"><?php echo formatNumber($this->repartition['all_feeds']['favorite']); ?></td> </tr> </tbody> </table> - </div> - - <div class="stat"> - <h2><?php echo Minz_Translate::t ('stats_entry_per_day'); ?></h2> - <div id="statsEntryPerDay" style="height: 300px"></div> - </div> - - <div class="stat"> - <h2><?php echo Minz_Translate::t ('stats_feed_per_category'); ?></h2> - <div id="statsFeedPerCategory" style="height: 300px"></div> - <div id="statsFeedPerCategoryLegend"></div> - </div> - - <div class="stat"> - <h2><?php echo Minz_Translate::t ('stats_entry_per_category'); ?></h2> - <div id="statsEntryPerCategory" style="height: 300px"></div> - <div id="statsEntryPerCategoryLegend"></div> - </div> - - <div class="stat"> - <h2><?php echo Minz_Translate::t ('stats_top_feed'); ?></h2> + </div><!-- + + --><div class="stat half"> + <h2><?php echo _t ('stats_top_feed'); ?></h2> <table> <thead> <tr> - <th><?php echo Minz_Translate::t ('feed'); ?></th> - <th><?php echo Minz_Translate::t ('category'); ?></th> - <th><?php echo Minz_Translate::t ('stats_entry_count'); ?></th> + <th><?php echo _t ('feed'); ?></th> + <th><?php echo _t ('category'); ?></th> + <th><?php echo _t ('stats_entry_count'); ?></th> </tr> </thead> <tbody> <?php foreach ($this->topFeed as $feed): ?> <tr> - <td><?php echo $feed['name']; ?></td> + <td><a href="<?php echo _url('stats', 'repartition', 'id', $feed['id']); ?>"><?php echo $feed['name']; ?></a></td> <td><?php echo $feed['category']; ?></td> <td class="numeric"><?php echo formatNumber($feed['count']); ?></td> </tr> @@ -76,6 +61,23 @@ </tbody> </table> </div> + + <div class="stat"> + <h2><?php echo _t ('stats_entry_per_day'); ?></h2> + <div id="statsEntryPerDay" style="height: 300px"></div> + </div> + + <div class="stat half"> + <h2><?php echo _t ('stats_feed_per_category'); ?></h2> + <div id="statsFeedPerCategory" style="height: 300px"></div> + <div id="statsFeedPerCategoryLegend"></div> + </div><!-- + + --><div class="stat half"> + <h2><?php echo _t ('stats_entry_per_category'); ?></h2> + <div id="statsEntryPerCategory" style="height: 300px"></div> + <div id="statsEntryPerCategoryLegend"></div> + </div> </div> <script> diff --git a/app/views/stats/repartition.phtml b/app/views/stats/repartition.phtml new file mode 100644 index 000000000..b425c1458 --- /dev/null +++ b/app/views/stats/repartition.phtml @@ -0,0 +1,150 @@ +<?php $this->partial('aside_stats'); ?> + +<div class="post "> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('back_to_rss_feeds'); ?></a> + + <h1><?php echo _t('stats_repartition'); ?></h1> + + <select id="feed_select"> + <option data-url="<?php echo _url('stats', 'repartition')?>"><?php echo _t('all_feeds')?></option> + <?php foreach ($this->categories as $category) { + $feeds = $category->feeds(); + if (!empty($feeds)) { + echo '<optgroup label="', $category->name(), '">'; + foreach ($feeds as $feed) { + if ($this->feed && $feed->id() == $this->feed->id()){ + echo '<option value="', $feed->id(), '" selected="selected" data-url="', _url('stats', 'repartition', 'id', $feed->id()), '">', $feed->name(), '</option>'; + } else { + echo '<option value="', $feed->id(), '" data-url="', _url('stats', 'repartition', 'id', $feed->id()), '">', $feed->name(), '</option>'; + } + } + echo '</optgroup>'; + } + }?> + </select> + + <?php if ($this->feed) {?> + <a class="btn" href="<?php echo _url('configure', 'feed', 'id', $this->feed->id()); ?>"> + <?php echo _i('configure'); ?> <?php echo _t('administration'); ?> + </a> + <?php }?> + + <div class="stat"> + <h2><?php echo _t('stats_entry_per_hour'); ?></h2> + <div id="statsEntryPerHour" style="height: 300px"></div> + </div> + + <div class="stat half"> + <h2><?php echo _t('stats_entry_per_day_of_week'); ?></h2> + <div id="statsEntryPerDayOfWeek" style="height: 300px"></div> + </div><!-- + + --><div class="stat half"> + <h2><?php echo _t('stats_entry_per_month'); ?></h2> + <div id="statsEntryPerMonth" style="height: 300px"></div> + </div> +</div> + +<script> +"use strict"; +function initStats() { + if (!window.Flotr) { + if (window.console) { + console.log('FreshRSS waiting for Flotr…'); + } + window.setTimeout(initStats, 50); + return; + } + // Entry per hour + var avg_h = []; + for (var i = -1; i <= 24; i++) { + avg_h.push([i, <?php echo $this->averageHour?>]); + } + Flotr.draw(document.getElementById('statsEntryPerHour'), + [{ + data: <?php echo $this->repartitionHour ?>, + bars: {horizontal: false, show: true} + }, { + data: avg_h, + lines: {show: true}, + label: <?php echo $this->averageHour?>, + yaxis: 2 + }], + { + grid: {verticalLines: false}, + xaxis: {noTicks: 23, + tickFormatter: function(x) { + var x = parseInt(x); + return x + 1; + }, + min: -0.9, + max: 23.9, + tickDecimals: 0}, + yaxis: {min: 0}, + y2axis: {showLabels: false}, + mouse: {relative: true, track: true, trackDecimals: 0, trackFormatter: function(obj) {return numberFormat(obj.y);}} + }); + // Entry per day of week + var avg_dow = []; + for (var i = -1; i <= 7; i++) { + avg_dow.push([i, <?php echo $this->averageDayOfWeek?>]); + } + Flotr.draw(document.getElementById('statsEntryPerDayOfWeek'), + [{ + data: <?php echo $this->repartitionDayOfWeek ?>, + bars: {horizontal: false, show: true} + }, { + data: avg_dow, + lines: {show: true}, + label: <?php echo $this->averageDayOfWeek?>, + yaxis: 2 + }], + { + grid: {verticalLines: false}, + xaxis: {noTicks: 6, + tickFormatter: function(x) { + var x = parseInt(x), + days = <?php echo $this->days?>; + return days[x]; + }, + min: -0.9, + max: 6.9, + tickDecimals: 0}, + yaxis: {min: 0}, + y2axis: {showLabels: false}, + mouse: {relative: true, track: true, trackDecimals: 0, trackFormatter: function(obj) {return numberFormat(obj.y);}} + }); + // Entry per month + var avg_m = []; + for (var i = 0; i <= 13; i++) { + avg_m.push([i, <?php echo $this->averageMonth?>]); + } + Flotr.draw(document.getElementById('statsEntryPerMonth'), + [{ + data: <?php echo $this->repartitionMonth ?>, + bars: {horizontal: false, show: true} + }, { + data: avg_m, + lines: {show: true}, + label: <?php echo $this->averageMonth?>, + yaxis: 2 + }], + { + grid: {verticalLines: false}, + xaxis: {noTicks: 12, + tickFormatter: function(x) { + var x = parseInt(x), + months = <?php echo $this->months?>; + return months[(x - 1)]; + }, + min: 0.1, + max: 12.9, + tickDecimals: 0}, + yaxis: {min: 0}, + y2axis: {showLabels: false}, + mouse: {relative: true, track: true, trackDecimals: 0, trackFormatter: function(obj) {return numberFormat(obj.y);}} + }); + +} +initStats(); +</script> diff --git a/app/views/update/apply.phtml b/app/views/update/apply.phtml new file mode 100644 index 000000000..30566c7ab --- /dev/null +++ b/app/views/update/apply.phtml @@ -0,0 +1,9 @@ +<?php $this->partial('aside_configure'); ?> + +<div class="post"> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('back_to_rss_feeds'); ?></a> + + <h1><?php echo _t('update_system'); ?></h1> + + <?php ask_info_update(); ?> +</div> diff --git a/app/views/update/index.phtml b/app/views/update/index.phtml new file mode 100644 index 000000000..401f6acd6 --- /dev/null +++ b/app/views/update/index.phtml @@ -0,0 +1,36 @@ +<?php $this->partial('aside_configure'); ?> + +<div class="post"> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('back_to_rss_feeds'); ?></a> + + <h1><?php echo _t('update_system'); ?></h1> + + <p> + <?php echo _i('help'); ?> <?php echo _t('update_last', $this->last_update_time); ?> + </p> + + <?php if (!empty($this->message)) { ?> + <p class="alert <?php echo $this->message['status'] === 'bad' ? 'alert-error' : 'alert-warn'; ?>"> + <span class="alert-head"><?php echo $this->message['title']; ?></span> + <?php echo $this->message['body']; ?> + </p> + <?php } elseif ($this->check_last_hour) { ?> + <p class="alert alert-warn"> + <span class="alert-head"><?php echo _t('damn'); ?></span> + <?php echo _t('no_update'); ?> + </p> + <?php } ?> + + <?php + if (!$this->check_last_hour && + (empty($this->message) || $this->message['status'] !== 'good')) { + ?> + <p> + <a href="<?php echo _url('update', 'check'); ?>" class="btn"><?php echo _t('update_check'); ?></a> + </p> + <?php } ?> + + <?php if ($this->update_to_apply) { ?> + <a class="btn btn-important" href="<?php echo _url('update', 'apply'); ?>"><?php echo _t('update_apply'); ?></a> + <?php } ?> +</div> diff --git a/constants.php b/constants.php index 6af1c5738..4c515d121 100644 --- a/constants.php +++ b/constants.php @@ -1,6 +1,11 @@ <?php -define('FRESHRSS_VERSION', '0.7.1'); +define('FRESHRSS_VERSION', '0.8-dev'); define('FRESHRSS_WEBSITE', 'http://freshrss.org'); +define('FRESHRSS_UPDATE_WEBSITE', 'https://update.freshrss.org?v=' . FRESHRSS_VERSION); +define('FRESHRSS_WIKI', 'http://doc.freshrss.org'); + +// PHP text output compression http://php.net/ob_gzhandler (better to do it at Web server level) +define('PHP_COMPRESSION', false); // Constantes de chemins define('FRESHRSS_PATH', dirname(__FILE__)); @@ -10,11 +15,11 @@ define('FRESHRSS_PATH', dirname(__FILE__)); define('PUBLIC_RELATIVE', '..'); define('DATA_PATH', FRESHRSS_PATH . '/data'); + define('UPDATE_FILENAME', DATA_PATH . '/update.php'); define('LOG_PATH', DATA_PATH . '/log'); define('CACHE_PATH', DATA_PATH . '/cache'); define('LIB_PATH', FRESHRSS_PATH . '/lib'); define('APP_PATH', FRESHRSS_PATH . '/app'); -//define('TMP_PATH', sys_get_temp_dir()); // need more tests so... -define('TMP_PATH', DATA_PATH); // ... we use DATA_PATH for the 0.7.1 +define('TMP_PATH', sys_get_temp_dir()); diff --git a/data/.gitignore b/data/.gitignore index afb16d9aa..325fa75c6 100644 --- a/data/.gitignore +++ b/data/.gitignore @@ -6,3 +6,5 @@ touch.txt no-cache.txt *.bak.php *.lock.txt +last_update.txt +update.php diff --git a/data/do-install.txt b/data/do-install.txt new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/data/do-install.txt 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 @@ +<?php + +/* + * This is a configuration file. You shouldn't modify it unless you know what + * you are doing. If you want to add a share type, this is where you need to do + * it. + * + * For each share there is different configuration options. Here is the description + * of those options: + * - url is a mandatory option. It is a string representing the share URL. It + * supports 3 different placeholders for custom data. The ~URL~ placeholder + * represents the URL of the system used to share, it is configured by the + * user. The ~LINK~ placeholder represents the link of the shared article. + * The ~TITLE~ placeholder represents the title of the shared article. + * - transform is an array of transformation to apply on links and titles + * - help is a URL to a help page + */ + +return array( + 'shaarli' => 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/data/tokens/.gitignore b/data/tokens/.gitignore new file mode 100644 index 000000000..2211df63d --- /dev/null +++ b/data/tokens/.gitignore @@ -0,0 +1 @@ +*.txt diff --git a/data/tokens/index.html b/data/tokens/index.html new file mode 100644 index 000000000..85faaa37e --- /dev/null +++ b/data/tokens/index.html @@ -0,0 +1,13 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-GB" lang="en-GB"> +<head> +<meta charset="UTF-8" /> +<meta http-equiv="Refresh" content="0; url=/" /> +<title>Redirection</title> +<meta name="robots" content="noindex" /> +</head> + +<body> +<p><a href="/">Redirection</a></p> +</body> +</html> diff --git a/lib/Minz/ActionController.php b/lib/Minz/ActionController.php index 409d9611f..b47c54554 100644 --- a/lib/Minz/ActionController.php +++ b/lib/Minz/ActionController.php @@ -8,16 +8,12 @@ * La classe ActionController représente le contrôleur de l'application */ class Minz_ActionController { - protected $router; protected $view; /** * Constructeur - * @param $controller nom du controller - * @param $action nom de l'action à lancer */ - public function __construct ($router) { - $this->router = $router; + public function __construct () { $this->view = new Minz_View (); $this->view->attributeParams (); } diff --git a/lib/Minz/Cache.php b/lib/Minz/Cache.php deleted file mode 100644 index fcb627eb2..000000000 --- a/lib/Minz/Cache.php +++ /dev/null @@ -1,116 +0,0 @@ -<?php -/** - * MINZ - Copyright 2011 Marien Fressinaud - * Sous licence AGPL3 <http://www.gnu.org/licenses/> -*/ - -/** - * La classe Cache permet de gérer facilement les pages en cache - */ -class Minz_Cache { - /** - * $expire timestamp auquel expire le cache de $url - */ - private $expire = 0; - - /** - * $file est le nom du fichier de cache - */ - private $file = ''; - - /** - * $enabled permet de déterminer si le cache est activé - */ - private static $enabled = true; - - /** - * Constructeur - */ - public function __construct () { - $this->_fileName (); - $this->_expire (); - } - - /** - * Setteurs - */ - public function _fileName () { - $file = md5 (Minz_Request::getURI ()); - - $this->file = CACHE_PATH . '/'.$file; - } - - public function _expire () { - if ($this->exist ()) { - $this->expire = filemtime ($this->file) - + Minz_Configuration::delayCache (); - } - } - - /** - * Permet de savoir si le cache est activé - * @return true si activé, false sinon - */ - public static function isEnabled () { - return Minz_Configuration::cacheEnabled () && self::$enabled; - } - - /** - * Active / désactive le cache - */ - public static function switchOn () { - self::$enabled = true; - } - public static function switchOff () { - self::$enabled = false; - } - - /** - * Détermine si le cache de $url a expiré ou non - * @return true si il a expiré, false sinon - */ - public function expired () { - return time () > $this->expire; - } - - /** - * Affiche le contenu du cache - * @print le code html du cache - */ - public function render () { - if ($this->exist ()) { - include ($this->file); - } - } - - /** - * Enregistre $html en cache - * @param $html le html à mettre en cache - */ - public function cache ($html) { - file_put_contents ($this->file, $html); - } - - /** - * Permet de savoir si le cache existe - * @return true si il existe, false sinon - */ - public function exist () { - return file_exists ($this->file); - } - - /** - * Nettoie le cache en supprimant tous les fichiers - */ - public static function clean () { - $files = opendir (CACHE_PATH); - - while ($fic = readdir ($files)) { - if ($fic != '.' && $fic != '..') { - unlink (CACHE_PATH.'/'.$fic); - } - } - - closedir ($files); - } -} diff --git a/lib/Minz/Configuration.php b/lib/Minz/Configuration.php index b3de9e39e..4e9da58b4 100644 --- a/lib/Minz/Configuration.php +++ b/lib/Minz/Configuration.php @@ -30,12 +30,9 @@ class Minz_Configuration { * définition des variables de configuration * $salt une chaîne de caractères aléatoires (obligatoire) * $environment gère le niveau d'affichage pour log et erreurs - * $use_url_rewriting indique si on utilise l'url_rewriting * $base_url le chemin de base pour accéder à l'application * $title le nom de l'application * $language la langue par défaut de l'application - * $cacheEnabled permet de savoir si le cache doit être activé - * $delayCache la limite de cache * $db paramètres pour la base de données (tableau) * - host le serveur de la base * - user nom d'utilisateur @@ -45,15 +42,14 @@ class Minz_Configuration { private static $salt = ''; private static $environment = Minz_Configuration::PRODUCTION; private static $base_url = ''; - private static $use_url_rewriting = false; private static $title = ''; private static $language = 'en'; - private static $cache_enabled = false; - private static $delay_cache = 3600; private static $default_user = ''; private static $allow_anonymous = false; private static $allow_anonymous_refresh = false; private static $auth_type = 'none'; + private static $api_enabled = false; + private static $unsafe_autologin_enabled = false; private static $db = array ( 'type' => 'mysql', @@ -92,21 +88,12 @@ class Minz_Configuration { public static function baseUrl () { return self::$base_url; } - public static function useUrlRewriting () { - return self::$use_url_rewriting; - } public static function title () { return self::$title; } public static function language () { return self::$language; } - public static function cacheEnabled () { - return self::$cache_enabled; - } - public static function delayCache () { - return self::$delay_cache; - } public static function dataBase () { return self::$db; } @@ -131,6 +118,12 @@ class Minz_Configuration { public static function canLogIn() { return self::$auth_type === 'form' || self::$auth_type === 'persona'; } + public static function apiEnabled() { + return self::$api_enabled; + } + public static function unsafeAutologinEnabled() { + return self::$unsafe_autologin_enabled; + } public static function _allowAnonymous($allow = false) { self::$allow_anonymous = ((bool)$allow) && self::canLogIn(); @@ -151,6 +144,13 @@ class Minz_Configuration { self::_allowAnonymous(self::$allow_anonymous); } + public static function _enableApi($value = false) { + self::$api_enabled = (bool)$value; + } + public static function _enableAutologin($value = false) { + self::$unsafe_autologin_enabled = (bool)$value; + } + /** * Initialise les variables de configuration * @exception Minz_FileNotExistException si le CONF_PATH_NAME n'existe pas @@ -171,7 +171,6 @@ class Minz_Configuration { $ini_array = array( 'general' => array( 'environment' => self::environment(true), - 'use_url_rewriting' => self::$use_url_rewriting, 'salt' => self::$salt, 'base_url' => self::$base_url, 'title' => self::$title, @@ -179,6 +178,8 @@ class Minz_Configuration { 'allow_anonymous' => self::$allow_anonymous, 'allow_anonymous_refresh' => self::$allow_anonymous_refresh, 'auth_type' => self::$auth_type, + 'api_enabled' => self::$api_enabled, + 'unsafe_autologin_enabled' => self::$unsafe_autologin_enabled, ), 'db' => self::$db, ); @@ -255,9 +256,6 @@ class Minz_Configuration { if (isset ($general['base_url'])) { self::$base_url = $general['base_url']; } - if (isset ($general['use_url_rewriting'])) { - self::$use_url_rewriting = $general['use_url_rewriting']; - } if (isset ($general['title'])) { self::$title = $general['title']; @@ -265,18 +263,6 @@ class Minz_Configuration { if (isset ($general['language'])) { self::$language = $general['language']; } - if (isset ($general['cache_enabled'])) { - self::$cache_enabled = $general['cache_enabled']; - if (CACHE_PATH === false && self::$cache_enabled) { - throw new FileNotExistException ( - 'CACHE_PATH', - Minz_Exception::ERROR - ); - } - } - if (isset ($general['delay_cache'])) { - self::$delay_cache = inval($general['delay_cache']); - } if (isset ($general['default_user'])) { self::$default_user = $general['default_user']; } @@ -295,45 +281,77 @@ class Minz_Configuration { ($general['allow_anonymous_refresh'] !== 'no') ); } + if (isset ($general['api_enabled'])) { + self::$api_enabled = ( + ((bool)($general['api_enabled'])) && + ($general['api_enabled'] !== 'no') + ); + } + if (isset ($general['unsafe_autologin_enabled'])) { + self::$unsafe_autologin_enabled = ( + ((bool)($general['unsafe_autologin_enabled'])) && + ($general['unsafe_autologin_enabled'] !== 'no') + ); + } // Base de données if (isset ($ini_array['db'])) { $db = $ini_array['db']; - if (empty($db['host'])) { + if (empty($db['type'])) { throw new Minz_BadConfigurationException ( - 'host', + 'type', Minz_Exception::ERROR ); } - if (empty($db['user'])) { - throw new Minz_BadConfigurationException ( - 'user', - Minz_Exception::ERROR - ); - } - if (!isset ($db['password'])) { - throw new Minz_BadConfigurationException ( - 'password', - Minz_Exception::ERROR - ); - } - if (empty($db['base'])) { - throw new Minz_BadConfigurationException ( - 'base', - Minz_Exception::ERROR - ); - } - - if (!empty($db['type'])) { - self::$db['type'] = $db['type']; - } - self::$db['host'] = $db['host']; - self::$db['user'] = $db['user']; - self::$db['password'] = $db['password']; - self::$db['base'] = $db['base']; - if (isset($db['prefix'])) { - self::$db['prefix'] = $db['prefix']; + switch ($db['type']) { + case 'mysql': + if (empty($db['host'])) { + throw new Minz_BadConfigurationException ( + 'host', + Minz_Exception::ERROR + ); + } + if (empty($db['user'])) { + throw new Minz_BadConfigurationException ( + 'user', + Minz_Exception::ERROR + ); + } + if (!isset($db['password'])) { + throw new Minz_BadConfigurationException ( + 'password', + Minz_Exception::ERROR + ); + } + if (empty($db['base'])) { + throw new Minz_BadConfigurationException ( + 'base', + Minz_Exception::ERROR + ); + } + self::$db['host'] = $db['host']; + self::$db['user'] = $db['user']; + self::$db['password'] = $db['password']; + self::$db['base'] = $db['base']; + if (isset($db['prefix'])) { + self::$db['prefix'] = $db['prefix']; + } + break; + case 'sqlite': + self::$db['host'] = ''; + self::$db['user'] = ''; + self::$db['password'] = ''; + self::$db['base'] = ''; + self::$db['prefix'] = ''; + break; + default: + throw new Minz_BadConfigurationException ( + 'type', + Minz_Exception::ERROR + ); + break; } + self::$db['type'] = $db['type']; } } diff --git a/lib/Minz/Dispatcher.php b/lib/Minz/Dispatcher.php index 71dfe8ac6..f62a92911 100644 --- a/lib/Minz/Dispatcher.php +++ b/lib/Minz/Dispatcher.php @@ -14,85 +14,55 @@ class Minz_Dispatcher { /* singleton */ private static $instance = null; + private static $needsReset; - private $router; private $controller; /** * Récupère l'instance du Dispatcher */ - public static function getInstance ($router) { + public static function getInstance () { if (self::$instance === null) { - self::$instance = new Minz_Dispatcher ($router); + self::$instance = new Minz_Dispatcher (); } return self::$instance; } /** - * Constructeur - */ - private function __construct ($router) { - $this->router = $router; - } - - /** * Lance le controller indiqué dans Request * Remplit le body de Response à partir de la Vue * @exception Minz_Exception */ - public function run ($ob = true) { - $cache = new Minz_Cache(); - // Le ob_start est dupliqué : sans ça il y a un bug sous Firefox - // ici on l'appelle avec 'ob_gzhandler', après sans. - // Vraisemblablement la compression fonctionne mais c'est sale - // J'ignore les effets de bord :( - if ($ob) { - ob_start ('ob_gzhandler'); - } + public function run () { + do { + self::$needsReset = false; - if (Minz_Cache::isEnabled () && !$cache->expired ()) { - if ($ob) { - ob_start (); - } - $cache->render (); - if ($ob) { - $text = ob_get_clean(); - } - } else { - $text = ''; //TODO: Clean this code - while (Minz_Request::$reseted) { - Minz_Request::$reseted = false; - - try { - $this->createController ('FreshRSS_' . Minz_Request::controllerName () . '_Controller'); - $this->controller->init (); - $this->controller->firstAction (); + try { + $this->createController ('FreshRSS_' . Minz_Request::controllerName () . '_Controller'); + $this->controller->init (); + $this->controller->firstAction (); + if (!self::$needsReset) { $this->launchAction ( Minz_Request::actionName () . 'Action' ); - $this->controller->lastAction (); - - if (!Minz_Request::$reseted) { - if ($ob) { - ob_start (); - } - $this->controller->view ()->build (); - if ($ob) { - $text = ob_get_clean(); - } - } - } catch (Minz_Exception $e) { - throw $e; } - } + $this->controller->lastAction (); - if (Minz_Cache::isEnabled ()) { - $cache->cache ($text); + if (!self::$needsReset) { + $this->controller->view ()->build (); + } + } catch (Minz_Exception $e) { + throw $e; } - } + } while (self::$needsReset); + } - Minz_Response::setBody ($text); + /** + * Informe le contrôleur qu'il doit recommancer car la requête a été modifiée + */ + public static function reset() { + self::$needsReset = true; } /** @@ -112,7 +82,7 @@ class Minz_Dispatcher { Minz_Exception::ERROR ); } - $this->controller = new $controller_name ($this->router); + $this->controller = new $controller_name (); if (! ($this->controller instanceof Minz_ActionController)) { throw new Minz_ControllerNotActionControllerException ( @@ -129,21 +99,19 @@ class Minz_Dispatcher { * le controller */ private function launchAction ($action_name) { - if (!Minz_Request::$reseted) { - if (!is_callable (array ( - $this->controller, - $action_name - ))) { - throw new Minz_ActionException ( - get_class ($this->controller), - $action_name, - Minz_Exception::ERROR - ); - } - call_user_func (array ( - $this->controller, - $action_name - )); + if (!is_callable (array ( + $this->controller, + $action_name + ))) { + throw new Minz_ActionException ( + get_class ($this->controller), + $action_name, + Minz_Exception::ERROR + ); } + call_user_func (array ( + $this->controller, + $action_name + )); } } diff --git a/lib/Minz/Error.php b/lib/Minz/Error.php index 337ab6c0a..c8222a430 100644 --- a/lib/Minz/Error.php +++ b/lib/Minz/Error.php @@ -23,13 +23,32 @@ class Minz_Error { $logs = self::processLogs ($logs); $error_filename = APP_PATH . '/Controllers/errorController.php'; + switch ($code) { + case 200 : + header('HTTP/1.1 200 OK'); + break; + case 403 : + header('HTTP/1.1 403 Forbidden'); + break; + case 404 : + header('HTTP/1.1 404 Not Found'); + break; + case 500 : + header('HTTP/1.1 500 Internal Server Error'); + break; + case 503 : + header('HTTP/1.1 503 Service Unavailable'); + break; + default : + header('HTTP/1.1 500 Internal Server Error'); + } + if (file_exists ($error_filename)) { $params = array ( 'code' => $code, 'logs' => $logs ); - Minz_Response::setHeader ($code); if ($redirect) { Minz_Request::forward (array ( 'c' => 'error' @@ -41,19 +60,16 @@ class Minz_Error { ), false); } } else { - $text = '<h1>An error occured</h1>'."\n"; + echo '<h1>An error occured</h1>' . "\n"; if (!empty ($logs)) { - $text .= '<ul>'."\n"; + echo '<ul>' . "\n"; foreach ($logs as $log) { - $text .= '<li>' . $log . '</li>'."\n"; + echo '<li>' . $log . '</li>' . "\n"; } - $text .= '</ul>'."\n"; + echo '</ul>' . "\n"; } - Minz_Response::setHeader ($code); - Minz_Response::setBody ($text); - Minz_Response::send (); exit (); } } diff --git a/lib/Minz/FrontController.php b/lib/Minz/FrontController.php index 80eda8877..f13882801 100644 --- a/lib/Minz/FrontController.php +++ b/lib/Minz/FrontController.php @@ -24,13 +24,10 @@ */ class Minz_FrontController { protected $dispatcher; - protected $router; - - private $useOb = true; /** * Constructeur - * Initialise le router et le dispatcher + * Initialise le dispatcher, met à jour la Request */ public function __construct () { if (LOG_PATH === false) { @@ -42,29 +39,50 @@ class Minz_FrontController { Minz_Request::init (); - $this->router = new Minz_Router (); - $this->router->init (); - } catch (Minz_RouteNotFoundException $e) { - Minz_Log::record ($e->getMessage (), Minz_Log::ERROR); - Minz_Error::error ( - 404, - array ('error' => array ($e->getMessage ())) + $url = $this->buildUrl(); + $url['params'] = array_merge ( + $url['params'], + Minz_Request::fetchPOST () ); + Minz_Request::forward ($url); } catch (Minz_Exception $e) { Minz_Log::record ($e->getMessage (), Minz_Log::ERROR); $this->killApp ($e->getMessage ()); } - $this->dispatcher = Minz_Dispatcher::getInstance ($this->router); + $this->dispatcher = Minz_Dispatcher::getInstance(); } /** - * Démarre l'application (lance le dispatcher et renvoie la réponse + * Retourne un tableau représentant l'url passée par la barre d'adresses + * @return tableau représentant l'url + */ + private function buildUrl() { + $url = array (); + + $url['c'] = Minz_Request::fetchGET ( + 'c', + Minz_Request::defaultControllerName () + ); + $url['a'] = Minz_Request::fetchGET ( + 'a', + Minz_Request::defaultActionName () + ); + $url['params'] = Minz_Request::fetchGET (); + + // post-traitement + unset ($url['params']['c']); + unset ($url['params']['a']); + + return $url; + } + + /** + * Démarre l'application (lance le dispatcher et renvoie la réponse) */ public function run () { try { - $this->dispatcher->run ($this->useOb); - Minz_Response::send (); + $this->dispatcher->run(); } catch (Minz_Exception $e) { try { Minz_Log::record ($e->getMessage (), Minz_Log::ERROR); @@ -96,15 +114,4 @@ class Minz_FrontController { } exit ('### Application problem ###<br />'."\n".$txt); } - - public function useOb() { - return $this->useOb; - } - - /** - * Use ob_start('ob_gzhandler') or not. - */ - public function _useOb($ob) { - return $this->useOb = (bool)$ob; - } } diff --git a/lib/Minz/Helper.php b/lib/Minz/Helper.php index b058211d3..f4a547c4e 100644 --- a/lib/Minz/Helper.php +++ b/lib/Minz/Helper.php @@ -12,11 +12,22 @@ class Minz_Helper { * Annule les effets des magic_quotes pour une variable donnée * @param $var variable à traiter (tableau ou simple variable) */ - public static function stripslashes_r ($var) { - if (is_array ($var)){ - return array_map (array ('Helper', 'stripslashes_r'), $var); + public static function stripslashes_r($var) { + if (is_array($var)){ + return array_map(array('Minz_Helper', 'stripslashes_r'), $var); } else { return stripslashes($var); } } + + /** + * Wrapper for htmlspecialchars. + * Force UTf-8 value and can be used on array too. + */ + public static function htmlspecialchars_utf8($var) { + if (is_array($var)) { + return array_map(array('Minz_Helper', 'htmlspecialchars_utf8'), $var); + } + return htmlspecialchars($var, ENT_COMPAT, 'UTF-8'); + } } 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); + } } diff --git a/lib/Minz/ModelPdo.php b/lib/Minz/ModelPdo.php index 831df13a2..b4bfca746 100644 --- a/lib/Minz/ModelPdo.php +++ b/lib/Minz/ModelPdo.php @@ -16,6 +16,7 @@ class Minz_ModelPdo { public static $useSharedBd = true; private static $sharedBd = null; private static $sharedPrefix; + protected static $sharedDbType; /** * $bd variable représentant la base de données @@ -24,46 +25,64 @@ class Minz_ModelPdo { protected $prefix; + public function dbType() { + return self::$sharedDbType; + } + /** * Créé la connexion à la base de données à l'aide des variables * HOST, BASE, USER et PASS définies dans le fichier de configuration */ - public function __construct () { - if (self::$useSharedBd && self::$sharedBd != null) { + public function __construct($currentUser = null) { + if (self::$useSharedBd && self::$sharedBd != null && $currentUser === null) { $this->bd = self::$sharedBd; $this->prefix = self::$sharedPrefix; return; } - $db = Minz_Configuration::dataBase (); - $driver_options = null; + $db = Minz_Configuration::dataBase(); + + if ($currentUser === null) { + $currentUser = Minz_Session::param('currentUser', '_'); + } try { $type = $db['type']; - if($type == 'mysql') { - $string = $type - . ':host=' . $db['host'] + if ($type === 'mysql') { + $string = 'mysql:host=' . $db['host'] . ';dbname=' . $db['base'] . ';charset=utf8'; $driver_options = array( - PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8' + PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8', + ); + $this->prefix = $db['prefix'] . $currentUser . '_'; + } elseif ($type === 'sqlite') { + $string = 'sqlite:' . DATA_PATH . '/' . $currentUser . '.sqlite'; + $driver_options = array( + //PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, + ); + $this->prefix = ''; + } else { + throw new Minz_PDOConnectionException( + 'Invalid database type!', + $db['user'], Minz_Exception::ERROR ); - } elseif($type == 'sqlite') { - $string = $type . ':/' . DATA_PATH . $db['base'] . '.sqlite'; //TODO: DEBUG UTF-8 http://www.siteduzero.com/forum/sujet/sqlite-connexion-utf-8-18797 } + self::$sharedDbType = $type; + self::$sharedPrefix = $this->prefix; - $this->bd = new FreshPDO ( + $this->bd = new MinzPDO( $string, $db['user'], $db['password'], $driver_options ); + if ($type === 'sqlite') { + $this->bd->exec('PRAGMA foreign_keys = ON;'); + } self::$sharedBd = $this->bd; - - $this->prefix = $db['prefix'] . Minz_Session::param('currentUser', '_') . '_'; - self::$sharedPrefix = $this->prefix; } catch (Exception $e) { - throw new Minz_PDOConnectionException ( + throw new Minz_PDOConnectionException( $string, $db['user'], Minz_Exception::ERROR ); @@ -80,40 +99,26 @@ class Minz_ModelPdo { $this->bd->rollBack(); } - public function size($all = false) { - $db = Minz_Configuration::dataBase (); - $sql = 'SELECT SUM(data_length + index_length) FROM information_schema.TABLES WHERE table_schema = ?'; - $values = array ($db['base']); - if (!$all) { - $sql .= ' AND table_name LIKE ?'; - $values[] = $this->prefix . '%'; - } - $stm = $this->bd->prepare ($sql); - $stm->execute ($values); - $res = $stm->fetchAll(PDO::FETCH_COLUMN, 0); - return $res[0]; - } - public static function clean() { self::$sharedBd = null; self::$sharedPrefix = ''; } } -class FreshPDO extends PDO { +class MinzPDO extends PDO { private static function check($statement) { if (preg_match('/^(?:UPDATE|INSERT|DELETE)/i', $statement)) { invalidateHttpCache(); } } - public function prepare ($statement, $driver_options = array()) { - FreshPDO::check($statement); + public function prepare($statement, $driver_options = array()) { + MinzPDO::check($statement); return parent::prepare($statement, $driver_options); } - public function exec ($statement) { - FreshPDO::check($statement); + public function exec($statement) { + MinzPDO::check($statement); return parent::exec($statement); } } diff --git a/lib/Minz/Request.php b/lib/Minz/Request.php index 282d47a77..f7a24c026 100644 --- a/lib/Minz/Request.php +++ b/lib/Minz/Request.php @@ -10,68 +10,61 @@ class Minz_Request { private static $controller_name = ''; private static $action_name = ''; - private static $params = array (); + private static $params = array(); private static $default_controller_name = 'index'; private static $default_action_name = 'index'; - public static $reseted = true; - /** * Getteurs */ - public static function controllerName () { + public static function controllerName() { return self::$controller_name; } - public static function actionName () { + public static function actionName() { return self::$action_name; } - public static function params () { + public static function params() { return self::$params; } - static function htmlspecialchars_utf8 ($p) { - return htmlspecialchars($p, ENT_COMPAT, 'UTF-8'); - } - public static function param ($key, $default = false, $specialchars = false) { - if (isset (self::$params[$key])) { + public static function param($key, $default = false, $specialchars = false) { + if (isset(self::$params[$key])) { $p = self::$params[$key]; - if(is_object($p) || $specialchars) { + if (is_object($p) || $specialchars) { return $p; - } elseif(is_array($p)) { - return array_map('self::htmlspecialchars_utf8', $p); } else { - return self::htmlspecialchars_utf8($p); + return Minz_Helper::htmlspecialchars_utf8($p); } } else { return $default; } } - public static function defaultControllerName () { + public static function defaultControllerName() { return self::$default_controller_name; } - public static function defaultActionName () { + public static function defaultActionName() { return self::$default_action_name; } /** * Setteurs */ - public static function _controllerName ($controller_name) { + public static function _controllerName($controller_name) { self::$controller_name = $controller_name; } - public static function _actionName ($action_name) { + public static function _actionName($action_name) { self::$action_name = $action_name; } - public static function _params ($params) { + public static function _params($params) { if (!is_array($params)) { - $params = array ($params); + $params = array($params); } self::$params = $params; } - public static function _param ($key, $value = false) { + public static function _param($key, $value = false) { if ($value === false) { - unset (self::$params[$key]); + unset(self::$params[$key]); } else { self::$params[$key] = $value; } @@ -80,14 +73,14 @@ class Minz_Request { /** * Initialise la Request */ - public static function init () { - self::magicQuotesOff (); + public static function init() { + self::magicQuotesOff(); } /** * Retourn le nom de domaine du site */ - public static function getDomainName () { + public static function getDomainName() { return $_SERVER['HTTP_HOST']; } @@ -95,7 +88,7 @@ class Minz_Request { * Détermine la base de l'url * @return la base de l'url */ - public static function getBaseUrl () { + public static function getBaseUrl() { $defaultBaseUrl = Minz_Configuration::baseUrl(); if (!empty($defaultBaseUrl)) { return $defaultBaseUrl; @@ -110,13 +103,13 @@ class Minz_Request { * Récupère l'URI de la requête * @return l'URI */ - public static function getURI () { - if (isset ($_SERVER['REQUEST_URI'])) { - $base_url = self::getBaseUrl (); + public static function getURI() { + if (isset($_SERVER['REQUEST_URI'])) { + $base_url = self::getBaseUrl(); $uri = $_SERVER['REQUEST_URI']; - $len_base_url = strlen ($base_url); - $real_uri = substr ($uri, $len_base_url); + $len_base_url = strlen($base_url); + $real_uri = substr($uri, $len_base_url); } else { $real_uri = ''; } @@ -130,24 +123,53 @@ class Minz_Request { * @param $redirect si vrai, force la redirection http * > sinon, le dispatcher recharge en interne */ - public static function forward ($url = array (), $redirect = false) { - $url = Minz_Url::checkUrl ($url); + public static function forward($url = array(), $redirect = false) { + if (!is_array($url)) { + header('Location: ' . $url); + exit(); + } + + $url = Minz_Url::checkUrl($url); if ($redirect) { - header ('Location: ' . Minz_Url::display ($url, 'php')); - exit (); + header('Location: ' . Minz_Url::display($url, 'php')); + exit(); } else { - self::$reseted = true; - - self::_controllerName ($url['c']); - self::_actionName ($url['a']); - self::_params (array_merge ( + self::_controllerName($url['c']); + self::_actionName($url['a']); + self::_params(array_merge( self::$params, $url['params'] )); + Minz_Dispatcher::reset(); } } + + /** + * Wrappers good notifications + redirection + * @param $msg notification content + * @param $url url array to where we should be forwarded + */ + public static function good($msg, $url = array()) { + Minz_Session::_param('notification', array( + 'type' => 'good', + 'content' => $msg + )); + + Minz_Request::forward($url, true); + } + + public static function bad($msg, $url = array()) { + Minz_Session::_param('notification', array( + 'type' => 'bad', + 'content' => $msg + )); + + Minz_Request::forward($url, true); + } + + /** * Permet de récupérer une variable de type $_GET * @param $param nom de la variable @@ -156,10 +178,10 @@ class Minz_Request { * $_GET si $param = false * $default si $_GET[$param] n'existe pas */ - public static function fetchGET ($param = false, $default = false) { + public static function fetchGET($param = false, $default = false) { if ($param === false) { return $_GET; - } elseif (isset ($_GET[$param])) { + } elseif (isset($_GET[$param])) { return $_GET[$param]; } else { return $default; @@ -174,10 +196,10 @@ class Minz_Request { * $_POST si $param = false * $default si $_POST[$param] n'existe pas */ - public static function fetchPOST ($param = false, $default = false) { + public static function fetchPOST($param = false, $default = false) { if ($param === false) { return $_POST; - } elseif (isset ($_POST[$param])) { + } elseif (isset($_POST[$param])) { return $_POST[$param]; } else { return $default; @@ -190,15 +212,16 @@ class Minz_Request { * $_POST * $_COOKIE */ - private static function magicQuotesOff () { - if (get_magic_quotes_gpc ()) { - $_GET = Minz_Helper::stripslashes_r ($_GET); - $_POST = Minz_Helper::stripslashes_r ($_POST); - $_COOKIE = Minz_Helper::stripslashes_r ($_COOKIE); + private static function magicQuotesOff() { + if (get_magic_quotes_gpc()) { + $_GET = Minz_Helper::stripslashes_r($_GET); + $_POST = Minz_Helper::stripslashes_r($_POST); + $_COOKIE = Minz_Helper::stripslashes_r($_COOKIE); } } - public static function isPost () { - return $_SERVER['REQUEST_METHOD'] === 'POST'; + public static function isPost() { + return isset($_SERVER['REQUEST_METHOD']) && + $_SERVER['REQUEST_METHOD'] === 'POST'; } } diff --git a/lib/Minz/Response.php b/lib/Minz/Response.php deleted file mode 100644 index f8ea3d946..000000000 --- a/lib/Minz/Response.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php -/** - * MINZ - Copyright 2011 Marien Fressinaud - * Sous licence AGPL3 <http://www.gnu.org/licenses/> -*/ - -/** - * Response représente la requête http renvoyée à l'utilisateur - */ -class Minz_Response { - private static $header = 'HTTP/1.0 200 OK'; - private static $body = ''; - - /** - * Mets à jour le body de la Response - * @param $text le texte à incorporer dans le body - */ - public static function setBody ($text) { - self::$body = $text; - } - - /** - * Mets à jour le header de la Response - * @param $code le code HTTP, valeurs possibles - * - 200 (OK) - * - 403 (Forbidden) - * - 404 (Forbidden) - * - 500 (Forbidden) -> par défaut si $code erroné - * - 503 (Forbidden) - */ - public static function setHeader ($code) { - switch ($code) { - case 200 : - self::$header = 'HTTP/1.0 200 OK'; - break; - case 403 : - self::$header = 'HTTP/1.0 403 Forbidden'; - break; - case 404 : - self::$header = 'HTTP/1.0 404 Not Found'; - break; - case 500 : - self::$header = 'HTTP/1.0 500 Internal Server Error'; - break; - case 503 : - self::$header = 'HTTP/1.0 503 Service Unavailable'; - break; - default : - self::$header = 'HTTP/1.0 500 Internal Server Error'; - } - } - - /** - * Envoie la Response à l'utilisateur - */ - public static function send () { - header (self::$header); - echo self::$body; - } -} diff --git a/lib/Minz/RouteNotFoundException.php b/lib/Minz/RouteNotFoundException.php deleted file mode 100644 index dc4f6fbad..000000000 --- a/lib/Minz/RouteNotFoundException.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php -class Minz_RouteNotFoundException extends Minz_Exception { - private $route; - - public function __construct ($route, $code = self::ERROR) { - $this->route = $route; - - $message = 'Route `' . $route . '` not found'; - - parent::__construct ($message, $code); - } - - public function route () { - return $this->route; - } -} diff --git a/lib/Minz/Router.php b/lib/Minz/Router.php deleted file mode 100644 index 1ccd72597..000000000 --- a/lib/Minz/Router.php +++ /dev/null @@ -1,209 +0,0 @@ -<?php -/** - * MINZ - Copyright 2011 Marien Fressinaud - * Sous licence AGPL3 <http://www.gnu.org/licenses/> -*/ - -/** - * La classe Router gère le routage de l'application - * Les routes sont définies dans APP_PATH.'/configuration/routes.php' - */ -class Minz_Router { - const ROUTES_PATH_NAME = '/configuration/routes.php'; - - private $routes = array (); - - /** - * Constructeur - * @exception FileNotExistException si ROUTES_PATH_NAME n'existe pas - * et que l'on utilise l'url rewriting - */ - public function __construct () { - if (Minz_Configuration::useUrlRewriting ()) { - if (file_exists (APP_PATH . self::ROUTES_PATH_NAME)) { - $routes = include ( - APP_PATH . self::ROUTES_PATH_NAME - ); - - if (!is_array ($routes)) { - $routes = array (); - } - - $this->routes = array_map ( - array ('Url', 'checkUrl'), - $routes - ); - } else { - throw new Minz_FileNotExistException ( - self::ROUTES_PATH_NAME, - Minz_Exception::ERROR - ); - } - } - } - - /** - * Initialise le Router en déterminant le couple Controller / Action - * Mets à jour la Request - * @exception RouteNotFoundException si l'uri n'est pas présente dans - * > la table de routage - */ - public function init () { - $url = array (); - - if (Minz_Configuration::useUrlRewriting ()) { - try { - $url = $this->buildWithRewriting (); - } catch (Minz_RouteNotFoundException $e) { - throw $e; - } - } else { - $url = $this->buildWithoutRewriting (); - } - - $url['params'] = array_merge ( - $url['params'], - Minz_Request::fetchPOST () - ); - - Minz_Request::forward ($url); - } - - /** - * Retourne un tableau représentant l'url passée par la barre d'adresses - * Ne se base PAS sur la table de routage - * @return tableau représentant l'url - */ - public function buildWithoutRewriting () { - $url = array (); - - $url['c'] = Minz_Request::fetchGET ( - 'c', - Minz_Request::defaultControllerName () - ); - $url['a'] = Minz_Request::fetchGET ( - 'a', - Minz_Request::defaultActionName () - ); - $url['params'] = Minz_Request::fetchGET (); - - // post-traitement - unset ($url['params']['c']); - unset ($url['params']['a']); - - return $url; - } - - /** - * Retourne un tableau représentant l'url passée par la barre d'adresses - * Se base sur la table de routage - * @return tableau représentant l'url - * @exception RouteNotFoundException si l'uri n'est pas présente dans - * > la table de routage - */ - public function buildWithRewriting () { - $url = array (); - $uri = Minz_Request::getURI (); - $find = false; - - foreach ($this->routes as $route) { - $regex = '*^' . $route['route'] . '$*'; - if (preg_match ($regex, $uri, $matches)) { - $url['c'] = $route['controller']; - $url['a'] = $route['action']; - $url['params'] = $this->getParams ( - $route['params'], - $matches - ); - $find = true; - break; - } - } - - if (!$find && $uri != '/') { - throw new Minz_RouteNotFoundException ( - $uri, - Minz_Exception::ERROR - ); - } - - // post-traitement - $url = Minz_Url::checkUrl ($url); - - return $url; - } - - /** - * Retourne l'uri d'une url en se basant sur la table de routage - * @param l'url sous forme de tableau - * @return l'uri formatée (string) selon une route trouvée - */ - public function printUriRewrited ($url) { - $route = $this->searchRoute ($url); - - if ($route !== false) { - return $this->replaceParams ($route, $url['params']); - } - - return ''; - } - - /** - * Recherche la route correspondante à une url - * @param l'url sous forme de tableau - * @return la route telle que spécifiée dans la table de routage, - * false si pas trouvée - */ - public function searchRoute ($url) { - foreach ($this->routes as $route) { - if ($route['controller'] == $url['c'] - && $route['action'] == $url['a']) { - // calcule la différence des tableaux de params - $params = array_flip ($route['params']); - $difference_params = array_diff_key ( - $params, - $url['params'] - ); - - // vérifie que pas de différence - // et le cas où $params est vide et pas $url['params'] - if (empty ($difference_params) - && (!empty ($params) || empty ($url['params']))) { - return $route; - } - } - } - - return false; - } - - /** - * Récupère un tableau dont - * - les clés sont définies dans $params_route - * - les valeurs sont situées dans $matches - * Le tableau $matches est décalé de +1 par rapport à $params_route - */ - private function getParams($params_route, $matches) { - $params = array (); - - for ($i = 0; $i < count ($params_route); $i++) { - $param = $params_route[$i]; - $params[$param] = $matches[$i + 1]; - } - - return $params; - } - - /** - * Remplace les éléments de la route par les valeurs contenues dans $params - */ - private function replaceParams ($route, $params_replace) { - $uri = $route['route']; - $params = array(); - foreach($route['params'] as $param) { - $uri = preg_replace('#\((.+)\)#U', $params_replace[$param], $uri, 1); - } - - return stripslashes($uri); - } -} diff --git a/lib/Minz/Session.php b/lib/Minz/Session.php index ddabc4658..af4de75bb 100644 --- a/lib/Minz/Session.php +++ b/lib/Minz/Session.php @@ -2,28 +2,20 @@ /** * La classe Session gère la session utilisateur - * C'est un singleton */ class Minz_Session { /** - * $session stocke les variables de session - */ - private static $session = array (); //TODO: Try to avoid having another local copy - - /** * Initialise la session, avec un nom - * Le nom de session est utilisé comme nom pour les cookies et les URLs (i.e. PHPSESSID). + * Le nom de session est utilisé comme nom pour les cookies et les URLs(i.e. PHPSESSID). * Il ne doit contenir que des caractères alphanumériques ; il doit être court et descriptif */ - public static function init ($name) { - // démarre la session - session_name ($name); - session_set_cookie_params (0, dirname(empty($_SERVER['REQUEST_URI']) ? '/' : dirname($_SERVER['REQUEST_URI'])), null, false, true); - session_start (); + public static function init($name) { + $cookie = session_get_cookie_params(); + self::keepCookie($cookie['lifetime']); - if (isset ($_SESSION)) { - self::$session = $_SESSION; - } + // démarre la session + session_name($name); + session_start(); } @@ -32,8 +24,8 @@ class Minz_Session { * @param $p le paramètre à récupérer * @return la valeur de la variable de session, false si n'existe pas */ - public static function param ($p, $default = false) { - return isset(self::$session[$p]) ? self::$session[$p] : $default; + public static function param($p, $default = false) { + return isset($_SESSION[$p]) ? $_SESSION[$p] : $default; } @@ -42,13 +34,11 @@ class Minz_Session { * @param $p le paramètre à créer ou modifier * @param $v la valeur à attribuer, false pour supprimer */ - public static function _param ($p, $v = false) { + public static function _param($p, $v = false) { if ($v === false) { - unset ($_SESSION[$p]); - unset (self::$session[$p]); + unset($_SESSION[$p]); } else { $_SESSION[$p] = $v; - self::$session[$p] = $v; } } @@ -57,15 +47,47 @@ class Minz_Session { * Permet d'effacer une session * @param $force si à false, n'efface pas le paramètre de langue */ - public static function unset_session ($force = false) { - $language = self::param ('language'); + public static function unset_session($force = false) { + $language = self::param('language'); session_destroy(); - self::$session = array (); + $_SESSION = array(); if (!$force) { - self::_param ('language', $language); - Minz_Translate::reset (); + self::_param('language', $language); + Minz_Translate::reset(); } } + + + /** + * Spécifie la durée de vie des cookies + * @param $l la durée de vie + */ + public static function keepCookie($l) { + $cookie_dir = empty($_SERVER['REQUEST_URI']) ? '' : $_SERVER['REQUEST_URI']; + session_set_cookie_params($l, $cookie_dir, '', false, true); + } + + + /** + * Régénère un id de session. + * Utile pour appeler session_set_cookie_params après session_start() + */ + public static function regenerateID() { + session_regenerate_id(true); + } + + public static function deleteLongTermCookie($name) { + setcookie($name, '', 1, '', '', false, true); + } + + public static function setLongTermCookie($name, $value, $expire) { + setcookie($name, $value, $expire, '', '', false, true); + } + + public static function getLongTermCookie($name) { + return isset($_COOKIE[$name]) ? $_COOKIE[$name] : null; + } + } diff --git a/lib/Minz/Translate.php b/lib/Minz/Translate.php index e14f783f7..8c2f90041 100644 --- a/lib/Minz/Translate.php +++ b/lib/Minz/Translate.php @@ -18,28 +18,28 @@ class Minz_Translate { * $translates est le tableau de correspondance * $key => $traduction */ - private static $translates = array (); + private static $translates = array(); /** * Inclus le fichier de langue qui va bien * l'enregistre dans $translates */ - public static function init () { - $l = Minz_Configuration::language (); - self::$language = Minz_Session::param ('language', $l); + public static function init() { + $l = Minz_Configuration::language(); + self::$language = Minz_Session::param('language', $l); $l_path = APP_PATH . '/i18n/' . self::$language . '.php'; - if (file_exists ($l_path)) { - self::$translates = include ($l_path); + if (file_exists($l_path)) { + self::$translates = include($l_path); } } /** * Alias de init */ - public static function reset () { - self::init (); + public static function reset() { + self::init(); } /** @@ -48,24 +48,32 @@ class Minz_Translate { * @return la valeur correspondante à la clé * > si non présente dans le tableau, on retourne la clé elle-même */ - public static function t ($key) { + public static function t($key) { $translate = $key; - if (isset (self::$translates[$key])) { + if (isset(self::$translates[$key])) { $translate = self::$translates[$key]; } - $args = func_get_args (); + $args = func_get_args(); unset($args[0]); - return vsprintf ($translate, $args); + return vsprintf($translate, $args); } /** * Retourne la langue utilisée actuellement * @return la langue */ - public static function language () { + public static function language() { return self::$language; } } + +function _t($key) { + $args = func_get_args(); + unset($args[0]); + array_unshift($args, $key); + + return call_user_func_array('Minz_Translate::t', $args); +} diff --git a/lib/Minz/Url.php b/lib/Minz/Url.php index 17f1ddece..e9f9a69ba 100644 --- a/lib/Minz/Url.php +++ b/lib/Minz/Url.php @@ -5,8 +5,7 @@ */ class Minz_Url { /** - * Affiche une Url formatée selon que l'on utilise l'url_rewriting ou non - * si oui, on cherche dans la table de routage la correspondance pour formater + * Affiche une Url formatée * @param $url l'url à formater définie comme un tableau : * $url['c'] = controller * $url['a'] = action @@ -39,13 +38,7 @@ class Minz_Url { } if ($isArray) { - $router = new Minz_Router (); - - if (Minz_Configuration::useUrlRewriting ()) { - $url_string .= $router->printUriRewrited ($url); - } else { - $url_string .= self::printUri ($url, $encodage); - } + $url_string .= self::printUri ($url, $encodage); } else { $url_string .= $url; } @@ -54,14 +47,14 @@ class Minz_Url { } /** - * Construit l'URI d'une URL sans url rewriting + * Construit l'URI d'une URL * @param l'url sous forme de tableau * @param $encodage pour indiquer comment encoder les & (& ou & pour html) * @return l'uri sous la forme ?key=value&key2=value2 */ private static function printUri ($url, $encodage) { $uri = ''; - $separator = '/?'; + $separator = '?'; if($encodage == 'html') { $and = '&'; diff --git a/lib/Minz/View.php b/lib/Minz/View.php index e170bd406..a0dec1824 100644 --- a/lib/Minz/View.php +++ b/lib/Minz/View.php @@ -26,12 +26,19 @@ class Minz_View { * Détermine si on utilise un layout ou non */ public function __construct () { + $this->change_view(Minz_Request::controllerName(), + Minz_Request::actionName()); + self::$title = Minz_Configuration::title (); + } + + /** + * Change le fichier de vue en fonction d'un controller / action + */ + public function change_view($controller_name, $action_name) { $this->view_filename = APP_PATH . self::VIEWS_PATH_NAME . '/' - . Minz_Request::controllerName () . '/' - . Minz_Request::actionName () . '.phtml'; - - self::$title = Minz_Configuration::title (); + . $controller_name . '/' + . $action_name . '.phtml'; } /** @@ -103,6 +110,16 @@ class Minz_View { } /** + * Retourne renderHelper() dans une chaîne + * @param $helper l'élément à traîter + */ + public function helperToString($helper) { + ob_start(); + $this->renderHelper($helper); + return ob_get_clean(); + } + + /** * Permet de choisir si on souhaite utiliser le layout * @param $use true si on souhaite utiliser le layout, false sinon */ diff --git a/lib/SimplePie/SimplePie.php b/lib/SimplePie/SimplePie.php index d7aaeb0c5..06c100f59 100644 --- a/lib/SimplePie/SimplePie.php +++ b/lib/SimplePie/SimplePie.php @@ -446,6 +446,13 @@ class SimplePie public $feed_url; /** + * @var string Original feed URL, or new feed URL iff HTTP 301 Moved Permanently + * @see SimplePie::subscribe_url() + * @access private + */ + public $permanent_url = null; //FreshRSS + + /** * @var object Instance of SimplePie_File to use as a feed * @see SimplePie::set_file() * @access private @@ -735,6 +742,7 @@ class SimplePie else { $this->feed_url = $this->registry->call('Misc', 'fix_protocol', array($url, 1)); + $this->permanent_url = $this->feed_url; //FreshRSS } } @@ -749,6 +757,7 @@ class SimplePie if ($file instanceof SimplePie_File) { $this->feed_url = $file->url; + $this->permanent_url = $this->feed_url; //FreshRSS $this->file =& $file; return true; } @@ -1331,7 +1340,7 @@ class SimplePie // First check to see if input has been overridden. if ($this->input_encoding !== false) { - $encodings[] = strtoupper($this->input_encoding); //FreshRSS + $encodings[] = strtoupper($this->input_encoding); } $application_types = array('application/xml', 'application/xml-dtd', 'application/xml-external-parsed-entity'); @@ -1355,7 +1364,7 @@ class SimplePie { if (isset($headers['content-type']) && preg_match('/;\x20?charset=([^;]*)/i', $headers['content-type'], $charset)) { - $encodings[] = strtoupper($charset[1]); //FreshRSS + $encodings[] = strtoupper($charset[1]); } else { @@ -1602,7 +1611,7 @@ class SimplePie } $this->raw_data = $file->body; - + $this->permanent_url = $file->permanent_url; //FreshRSS $headers = $file->headers; $sniffer = $this->registry->create('Content_Type_Sniffer', array(&$file)); $sniffed = $sniffer->get_type(); @@ -1788,26 +1797,39 @@ class SimplePie /** * Get the URL for the feed + * + * When the 'permanent' mode is enabled, returns the original feed URL, + * except in the case of an `HTTP 301 Moved Permanently` status response, + * in which case the location of the first redirection is returned. * - * May or may not be different from the URL passed to {@see set_feed_url()}, + * When the 'permanent' mode is disabled (default), + * may or may not be different from the URL passed to {@see set_feed_url()}, * depending on whether auto-discovery was used. * * @since Preview Release (previously called `get_feed_url()` since SimplePie 0.8.) - * @todo If we have a perm redirect we should return the new URL - * @todo When we make the above change, let's support <itunes:new-feed-url> as well + * @todo Support <itunes:new-feed-url> * @todo Also, |atom:link|@rel=self + * @param bool $permanent Permanent mode to return only the original URL or the first redirection + * iff it is a 301 redirection * @return string|null */ - public function subscribe_url() + public function subscribe_url($permanent = false) { - if ($this->feed_url !== null) + if ($permanent) //FreshRSS { - return $this->sanitize($this->feed_url, SIMPLEPIE_CONSTRUCT_IRI); + if ($this->permanent_url !== null) + { + return $this->sanitize($this->permanent_url, SIMPLEPIE_CONSTRUCT_IRI); + } } else { - return null; + if ($this->feed_url !== null) + { + return $this->sanitize($this->feed_url, SIMPLEPIE_CONSTRUCT_IRI); + } } + return null; } /** diff --git a/lib/SimplePie/SimplePie/File.php b/lib/SimplePie/SimplePie/File.php index faf5dd1f1..b1bbe4420 100644 --- a/lib/SimplePie/SimplePie/File.php +++ b/lib/SimplePie/SimplePie/File.php @@ -64,6 +64,7 @@ class SimplePie_File var $redirects = 0; var $error; var $method = SIMPLEPIE_FILE_SOURCE_NONE; + var $permanent_url; //FreshRSS public function __construct($url, $timeout = 10, $redirects = 5, $headers = null, $useragent = null, $force_fsockopen = false) { @@ -74,6 +75,7 @@ class SimplePie_File $url = SimplePie_Misc::compress_parse_url($parsed['scheme'], $idn->encode($parsed['authority']), $parsed['path'], $parsed['query'], $parsed['fragment']); } $this->url = $url; + $this->permanent_url = $url; //FreshRSS $this->useragent = $useragent; if (preg_match('/^http(s)?:\/\//i', $url)) { @@ -142,7 +144,10 @@ class SimplePie_File { $this->redirects++; $location = SimplePie_Misc::absolutize_url($this->headers['location'], $url); - return $this->__construct($location, $timeout, $redirects, $headers, $useragent, $force_fsockopen); + $previousStatusCode = $this->status_code; + $this->__construct($location, $timeout, $redirects, $headers, $useragent, $force_fsockopen); + $this->permanent_url = ($previousStatusCode == 301) ? $location : $url; //FreshRSS + return; } } } @@ -224,7 +229,10 @@ class SimplePie_File { $this->redirects++; $location = SimplePie_Misc::absolutize_url($this->headers['location'], $url); - return $this->__construct($location, $timeout, $redirects, $headers, $useragent, $force_fsockopen); + $previousStatusCode = $this->status_code; + $this->__construct($location, $timeout, $redirects, $headers, $useragent, $force_fsockopen); + $this->permanent_url = ($previousStatusCode == 301) ? $location : $url; //FreshRSS + return; } if (isset($this->headers['content-encoding'])) { diff --git a/lib/SimplePie/SimplePie/Parser.php b/lib/SimplePie/SimplePie/Parser.php index 9300b4ba9..7fb7bd9be 100644 --- a/lib/SimplePie/SimplePie/Parser.php +++ b/lib/SimplePie/SimplePie/Parser.php @@ -142,7 +142,7 @@ class SimplePie_Parser $dom = new DOMDocument(); $dom->recover = true; $dom->strictErrorChecking = false; - $dom->loadXML($data); + @$dom->loadXML($data); $this->encoding = $encoding = $dom->encoding = 'UTF-8'; $data2 = $dom->saveXML(); if (function_exists('mb_convert_encoding')) diff --git a/lib/lib_date.php b/lib/lib_date.php new file mode 100644 index 000000000..9533711e3 --- /dev/null +++ b/lib/lib_date.php @@ -0,0 +1,131 @@ +<?php +/** + * Author: Alexandre Alapetite http://alexandre.alapetite.fr + * 2014-06-01 + * License: GNU AGPLv3 http://www.gnu.org/licenses/agpl-3.0.html + * + * Parser of ISO 8601 time intervals http://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * Examples: "2014-02/2014-04", "2014-02/04", "2014-06", "P1M" + */ + +/* +example('2014-03'); +example('201403'); +example('2014-03-30'); +example('2014-05-30T13'); +example('2014-05-30T13:30'); +example('2014-02/2014-04'); +example('2014-02--2014-04'); +example('2014-02/04'); +example('2014-02-03/05'); +example('2014-02-03T22:00/22:15'); +example('2014-02-03T22:00/15'); +example('2014-03/'); +example('/2014-03'); +example('2014-03/P1W'); +example('P1W/2014-05-25T23:59:59'); +example('P1Y/'); +example('P1Y'); +example('P2M/'); +example('P3W/'); +example('P4D/'); +example('PT5H/'); +example('PT6M/'); +example('PT7S/'); +example('P1DT1H/'); + +function example($dateInterval) { + $dateIntervalArray = parseDateInterval($dateInterval); + echo $dateInterval, "\t=>\t", + $dateIntervalArray[0] == null ? 'null' : @date('c', $dateIntervalArray[0]), '/', + $dateIntervalArray[1] == null ? 'null' : @date('c', $dateIntervalArray[1]), "\n"; +} +*/ + +function _dateFloor($isoDate) { + $x = explode('T', $isoDate, 2); + $t = isset($x[1]) ? str_pad($x[1], 6, '0') : '000000'; + return str_pad($x[0], 8, '01') . 'T' . $t; +} + +function _dateCeiling($isoDate) { + $x = explode('T', $isoDate, 2); + $t = isset($x[1]) && strlen($x[1]) > 1 ? str_pad($x[1], 6, '59') : '235959'; + switch (strlen($x[0])) { + case 4: + return $x[0] . '1231T' . $t; + case 6: + $d = @strtotime($x[0] . '01'); + return $x[0] . date('t', $d) . 'T' . $t; + default: + return $x[0] . 'T' . $t; + } +} + +function _noDelimit($isoDate) { + return $isoDate === null || $isoDate === '' ? null : + str_replace(array('-', ':'), '', $isoDate); //FIXME: Bug with negative time zone +} + +function _dateRelative($d1, $d2) { + if ($d2 === null) { + return $d1 !== null && $d1[0] !== 'P' ? $d1 : null; + } elseif ($d2 !== '' && $d2[0] != 'P' && $d1 !== null && $d1[0] !== 'P') { + $y2 = substr($d2, 0, 4); + if (strlen($y2) < 4 || !ctype_digit($y2)) { //Does not start by a year + $d2 = _noDelimit($d2); + return substr($d1, 0, -strlen($d2)) . $d2; //Add prefix from $d1 + } + } + return _noDelimit($d2); +} + +/** + * Parameter $dateInterval is a string containing an ISO 8601 time interval. + * Returns an array with the minimum and maximum Unix timestamp of this interval, + * or null if open interval, or false if error. + */ +function parseDateInterval($dateInterval) { + $dateInterval = trim($dateInterval); + $dateInterval = str_replace('--', '/', $dateInterval); + $dateInterval = strtoupper($dateInterval); + $min = null; + $max = null; + $x = explode('/', $dateInterval, 2); + $d1 = _noDelimit($x[0]); + $d2 = _dateRelative($d1, count($x) > 1 ? $x[1] : null); + if ($d1 !== null && $d1[0] !== 'P') { + $min = @strtotime(_dateFloor($d1)); + } + if ($d2 !== null) { + if ($d2[0] === 'P') { + try { + $di2 = new DateInterval($d2); + $dt1 = @date_create(); //new DateTime() would create an Exception if the default time zone is not defined + if ($min !== null && $min !== false) { + $dt1->setTimestamp($min); + } + $max = $dt1->add($di2)->getTimestamp() - 1; + } catch (Exception $e) { + $max = false; + } + } elseif ($d1 === null || $d1[0] !== 'P') { + $max = @strtotime(_dateCeiling($d2)); + } else { + $max = @strtotime($d2); + } + } + if ($d1 !== null && $d1[0] === 'P') { + try { + $di1 = new DateInterval($d1); + $dt2 = @date_create(); + if ($max !== null && $max !== false) { + $dt2->setTimestamp($max); + } + $min = $dt2->sub($di1)->getTimestamp() + 1; + } catch (Exception $e) { + $min = false; + } + } + return array($min, $max); +} diff --git a/lib/lib_opml.php b/lib/lib_opml.php index 9feb12ae0..16a9921ea 100644 --- a/lib/lib_opml.php +++ b/lib/lib_opml.php @@ -1,23 +1,86 @@ <?php -function opml_export ($cats) { - $txt = ''; - foreach ($cats as $cat) { - $txt .= '<outline text="' . $cat['name'] . '">' . "\n"; - - foreach ($cat['feeds'] as $feed) { - $txt .= "\t" . '<outline text="' . $feed->name () . '" type="rss" xmlUrl="' . $feed->url () . '" htmlUrl="' . $feed->website () . '" description="' . htmlspecialchars($feed->description(), ENT_COMPAT, 'UTF-8') . '" />' . "\n"; +/* * + * lib_opml is a free library to manage OPML format in PHP. + * It takes in consideration only version 2.0 (http://dev.opml.org/spec2.html). + * Basically it means "text" attribute for outline elements is required. + * + * lib_opml requires SimpleXML (http://php.net/manual/en/book.simplexml.php) + * + * Usages: + * > include('lib_opml.php'); + * > $filename = 'my_opml_file.xml'; + * > $opml_array = libopml_parse_file($filename); + * > print_r($opml_array); + * + * > $opml_string = [...]; + * > $opml_array = libopml_parse_string($opml_string); + * > print_r($opml_array); + * + * > $opml_array = [...]; + * > $opml_string = libopml_render($opml_array); + * > $opml_object = libopml_render($opml_array, true); + * > echo $opml_string; + * > print_r($opml_object); + * + * If parsing fails for any reason (e.g. not an XML string, does not match with + * the specifications), a LibOPML_Exception is raised. + * + * Author: Marien Fressinaud <dev@marienfressinaud.fr> + * Url: https://github.com/marienfressinaud/lib_opml + * Version: 0.1 + * Date: 2014-03-29 + * License: public domain + * + * */ + +class LibOPML_Exception extends Exception {} + + +// These elements are optional +define('HEAD_ELEMENTS', serialize(array( + 'title', 'dateCreated', 'dateModified', 'ownerName', 'ownerEmail', + 'ownerId', 'docs', 'expansionState', 'vertScrollState', 'windowTop', + 'windowLeft', 'windowBottom', 'windowRight' +))); + + +function libopml_parse_outline($outline_xml) { + $outline = array(); + + // An outline may contain any kind of attributes but "text" attribute is + // required ! + $text_is_present = false; + foreach ($outline_xml->attributes() as $key => $value) { + $outline[$key] = (string)$value; + + if ($key === 'text') { + $text_is_present = true; } + } - $txt .= '</outline>' . "\n"; + if (!$text_is_present) { + throw new LibOPML_Exception( + 'Outline does not contain any text attribute' + ); } - return $txt; + foreach ($outline_xml->children() as $key => $value) { + // An outline may contain any number of outline children + if ($key === 'outline') { + $outline['@outlines'][] = libopml_parse_outline($value); + } else { + throw new LibOPML_Exception( + 'Body can contain only outline elements' + ); + } + } + + return $outline; } -function opml_import ($xml) { - $xml = html_only_entity_decode($xml); //!\ Assume UTF-8 +function libopml_parse_string($xml) { $dom = new DOMDocument(); $dom->recover = true; $dom->strictErrorChecking = false; @@ -27,94 +90,142 @@ function opml_import ($xml) { $opml = simplexml_import_dom($dom); if (!$opml) { - throw new FreshRSS_Opml_Exception (); + throw new LibOPML_Exception(); } - $catDAO = new FreshRSS_CategoryDAO(); - $catDAO->checkDefault(); - $defCat = $catDAO->getDefault(); + $array = array( + 'version' => (string)$opml['version'], + 'head' => array(), + 'body' => array() + ); + + // First, we get all "head" elements. Head is required but its sub-elements + // are optional. + foreach ($opml->head->children() as $key => $value) { + if (in_array($key, unserialize(HEAD_ELEMENTS), true)) { + $array['head'][$key] = (string)$value; + } else { + throw new LibOPML_Exception( + $key . 'is not part of OPML format' + ); + } + } - $categories = array (); - $feeds = array (); + // Then, we get body oulines. Body must contain at least one outline + // element. + $at_least_one_outline = false; + foreach ($opml->body->children() as $key => $value) { + if ($key === 'outline') { + $at_least_one_outline = true; + $array['body'][] = libopml_parse_outline($value); + } else { + throw new LibOPML_Exception( + 'Body can contain only outline elements' + ); + } + } + + if (!$at_least_one_outline) { + throw new LibOPML_Exception( + 'Body must contain at least one outline element' + ); + } - foreach ($opml->body->outline as $outline) { - if (!isset ($outline['xmlUrl'])) { - // Catégorie - $title = ''; + return $array; +} - if (isset ($outline['text'])) { - $title = (string) $outline['text']; - } elseif (isset ($outline['title'])) { - $title = (string) $outline['title']; - } - if ($title) { - // Permet d'éviter les soucis au niveau des id : - // ceux-ci sont générés en fonction de la date, - // un flux pourrait être dans une catégorie X avec l'id Y - // alors qu'il existe déjà la catégorie X mais avec l'id Z - // Y ne sera pas ajouté et le flux non plus vu que l'id - // de sa catégorie n'exisera pas - $title = htmlspecialchars($title, ENT_COMPAT, 'UTF-8'); - $catDAO = new FreshRSS_CategoryDAO (); - $cat = $catDAO->searchByName ($title); - if ($cat === false) { - $cat = new FreshRSS_Category ($title); - $values = array ( - 'name' => $cat->name () - ); - $cat->_id ($catDAO->addCategory ($values)); - } - - $feeds = array_merge ($feeds, getFeedsOutline ($outline, $cat->id ())); +function libopml_parse_file($filename) { + $file_content = file_get_contents($filename); + + if ($file_content === false) { + throw new LibOPML_Exception( + $filename . ' cannot be found' + ); + } + + return libopml_parse_string($file_content); +} + + +function libopml_render_outline($parent_elt, $outline) { + // Outline MUST be an array! + if (!is_array($outline)) { + throw new LibOPML_Exception( + 'Outline element must be defined as array' + ); + } + + $outline_elt = $parent_elt->addChild('outline'); + $text_is_present = false; + foreach ($outline as $key => $value) { + // Only outlines can be an array and so we consider children are also + // outline elements. + if ($key === '@outlines' && is_array($value)) { + foreach ($value as $outline_child) { + libopml_render_outline($outline_elt, $outline_child); } + } elseif (is_array($value)) { + throw new LibOPML_Exception( + 'Type of outline elements cannot be array: ' . $key + ); } else { - // Flux rss sans catégorie, on récupère l'ajoute dans la catégorie par défaut - $feeds[] = getFeed ($outline, $defCat->id()); + // Detect text attribute is present, that's good :) + if ($key === 'text') { + $text_is_present = true; + } + + $outline_elt->addAttribute($key, $value); } } - return array ($categories, $feeds); + if (!$text_is_present) { + throw new LibOPML_Exception( + 'You must define at least a text element for all outlines' + ); + } } -/** - * import all feeds of a given outline tag - */ -function getFeedsOutline ($outline, $cat_id) { - $feeds = array (); - foreach ($outline->children () as $child) { - if (isset ($child['xmlUrl'])) { - $feeds[] = getFeed ($child, $cat_id); - } else { - $feeds = array_merge( - $feeds, - getFeedsOutline ($child, $cat_id) - ); +function libopml_render($array, $as_xml_object = false) { + $opml = new SimpleXMLElement('<opml version="2.0"></opml>'); + + // Create head element. $array['head'] is optional but head element will + // exist in the final XML object. + $head = $opml->addChild('head'); + if (isset($array['head'])) { + foreach ($array['head'] as $key => $value) { + if (in_array($key, unserialize(HEAD_ELEMENTS), true)) { + $head->addChild($key, $value); + } } } - return $feeds; -} + // Check body is set and contains at least one element + if (!isset($array['body'])) { + throw new LibOPML_Exception( + '$array must contain a body element' + ); + } + if (count($array['body']) <= 0) { + throw new LibOPML_Exception( + 'Body element must contain at least one element (array)' + ); + } -function getFeed ($outline, $cat_id) { - $url = (string) $outline['xmlUrl']; - $url = htmlspecialchars($url, ENT_COMPAT, 'UTF-8'); - $title = ''; - if (isset ($outline['text'])) { - $title = (string) $outline['text']; - } elseif (isset ($outline['title'])) { - $title = (string) $outline['title']; - } - $title = htmlspecialchars($title, ENT_COMPAT, 'UTF-8'); - $feed = new FreshRSS_Feed ($url); - $feed->_category ($cat_id); - $feed->_name ($title); - if (isset($outline['htmlUrl'])) { - $feed->_website(htmlspecialchars((string)$outline['htmlUrl'], ENT_COMPAT, 'UTF-8')); - } - if (isset($outline['description'])) { - $feed->_description(sanitizeHTML((string)$outline['description'])); - } - return $feed; + // Create outline elements + $body = $opml->addChild('body'); + foreach ($array['body'] as $outline) { + libopml_render_outline($body, $outline); + } + + // And return the final result + if ($as_xml_object) { + return $opml; + } else { + $dom = dom_import_simplexml($opml)->ownerDocument; + $dom->formatOutput = true; + $dom->encoding = 'UTF-8'; + return $dom->saveXML(); + } } diff --git a/lib/lib_rss.php b/lib/lib_rss.php index a13d9e951..31c9cdbc1 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -27,7 +27,7 @@ function classAutoloader($class) { include(APP_PATH . '/Models/' . $components[1] . '.php'); return; case 3: //Controllers, Exceptions - include(APP_PATH . '/' . $components[2] . 's/' . $components[1] . $components[2] . '.php'); + @include(APP_PATH . '/' . $components[2] . 's/' . $components[1] . $components[2] . '.php'); return; } } elseif (strpos($class, 'Minz') === 0) { @@ -56,12 +56,6 @@ function checkUrl($url) { } } -// tiré de Shaarli de Seb Sauvage //Format RFC 4648 base64url -function small_hash ($txt) { - $t = rtrim (base64_encode (hash ('crc32', $txt, true)), '='); - return strtr ($t, '+/', '-_'); -} - function formatNumber($n, $precision = 0) { return str_replace(' ', ' ', //Espace insécable //TODO: remplacer par une espace _fine_ insécable number_format($n, $precision, '.', ' ')); //number_format does not seem to be Unicode-compatible @@ -115,7 +109,7 @@ function customSimplePie() { $simplePie = new SimplePie(); $simplePie->set_useragent(Minz_Translate::t('freshrss') . '/' . FRESHRSS_VERSION . ' (' . PHP_OS . '; ' . FRESHRSS_WEBSITE . ') ' . SIMPLEPIE_NAME . '/' . SIMPLEPIE_VERSION); $simplePie->set_cache_location(CACHE_PATH); - $simplePie->set_cache_duration(1500); + $simplePie->set_cache_duration(800); $simplePie->strip_htmltags(array( 'base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', @@ -127,10 +121,10 @@ function customSimplePie() { 'onmouseover', 'onmousemove', 'onmouseout', 'onfocus', 'onblur', 'onkeypress', 'onkeydown', 'onkeyup', 'onselect', 'onchange', 'seamless'))); $simplePie->add_attributes(array( - 'img' => array('lazyload' => ''), //http://www.w3.org/TR/resource-priorities/ - 'audio' => array('preload' => 'none'), - 'iframe' => array('postpone' => '', 'sandbox' => 'allow-scripts allow-same-origin'), - 'video' => array('postpone' => '', 'preload' => 'none'), + 'img' => array('lazyload' => '', 'postpone' => ''), //http://www.w3.org/TR/resource-priorities/ + 'audio' => array('lazyload' => '', 'postpone' => '', 'preload' => 'none'), + 'iframe' => array('lazyload' => '', 'postpone' => '', 'sandbox' => 'allow-scripts allow-same-origin'), + 'video' => array('lazyload' => '', 'postpone' => '', 'preload' => 'none'), )); $simplePie->set_url_replacements(array( 'a' => 'href', @@ -189,16 +183,8 @@ function get_content_by_parsing ($url, $path) { */ function lazyimg($content) { return preg_replace( - '/<img([^>]+?)src=[\'"]([^"\']+)[\'"]([^>]*)>/i', - '<img$1src="' . Minz_Url::display('/themes/icons/grey.gif') . '" data-original="$2"$3>', - $content - ); -} - -function lazyIframe($content) { - return preg_replace( - '/<iframe([^>]+?)src=[\'"]([^"\']+)[\'"]([^>]*)>/i', - '<iframe$1src="about:blank" data-original="$2"$3>', + '/<((?:img|iframe)[^>]+?)src=[\'"]([^"\']+)[\'"]([^>]*)>/i', + '<$1src="' . Minz_Url::display('/themes/icons/grey.gif') . '" data-original="$2"$3>', $content ); } @@ -219,7 +205,7 @@ function invalidateHttpCache() { } function usernameFromPath($userPath) { - if (preg_match('%/([a-z0-9]{1,16})_user\.php$%', $userPath, $matches)) { + if (preg_match('%/([A-Za-z0-9]{1,16})_user\.php$%', $userPath, $matches)) { return $matches[1]; } else { return ''; @@ -233,3 +219,28 @@ function listUsers() { function httpAuthUser() { return isset($_SERVER['REMOTE_USER']) ? $_SERVER['REMOTE_USER'] : ''; } + +function cryptAvailable() { + if (version_compare(PHP_VERSION, '5.3.3', '>=')) { + try { + $hash = '$2y$04$usesomesillystringfore7hnbRJHxXVLeakoG8K30oukPsA.ztMG'; + return $hash === @crypt('password', $hash); + } catch (Exception $e) { + } + } + return false; +} + +function is_referer_from_same_domain() { + if (empty($_SERVER['HTTP_REFERER'])) { + return false; + } + $host = parse_url(((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') ? 'https://' : 'http://') . + (empty($_SERVER['HTTP_HOST']) ? $_SERVER['SERVER_NAME'] : $_SERVER['HTTP_HOST'])); + $referer = parse_url($_SERVER['HTTP_REFERER']); + if (empty($host['scheme']) || empty($referer['scheme']) || $host['scheme'] !== $referer['scheme'] || + empty($host['host']) || empty($referer['host']) || $host['host'] !== $referer['host']) { + return false; + } + return (isset($host['port']) ? $host['port'] : 0) === (isset($referer['port']) ? $referer['port'] : 0); +} 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 @@ +<IfModule mod_rewrite.c> + RewriteEngine on + RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] +</IfModule> diff --git a/p/api/greader.php b/p/api/greader.php new file mode 100644 index 000000000..5a6fdad7d --- /dev/null +++ b/p/api/greader.php @@ -0,0 +1,649 @@ +<?php +/** +== Description == +Server-side API compatible with Google Reader API layer 2 + for the FreshRSS project http://freshrss.org + +== Credits == +* 2014-03: Released by Alexandre Alapetite http://alexandre.alapetite.fr + under GNU AGPL 3 license http://www.gnu.org/licenses/agpl-3.0.html + +== Documentation == +* http://code.google.com/p/pyrfeed/wiki/GoogleReaderAPI +* http://web.archive.org/web/20130718025427/http://undoc.in/ +* http://ranchero.com/downloads/GoogleReaderAPI-2009.pdf +* http://code.google.com/p/google-reader-api/w/list +* http://blog.martindoms.com/2009/10/16/using-the-google-reader-api-part-2/ +* https://github.com/noinnion/newsplus/blob/master/extensions/GoogleReaderCloneExtension/src/com/noinnion/android/newsplus/extension/google_reader/GoogleReaderClient.java +* https://github.com/ericmann/gReader-Library/blob/master/greader.class.php +* https://github.com/devongovett/reader +* https://github.com/theoldreader/api +*/ + +require('../../constants.php'); +require(LIB_PATH . '/lib_rss.php'); //Includes class autoloader + +$ORIGINAL_INPUT = file_get_contents('php://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); + } + function hex2dec($hex) { + return gmp_strval(gmp_init($hex, 16), 10); + } +} else { //64-bit + function dec2hex($dec) { //http://code.google.com/p/google-reader-api/wiki/ItemId + return str_pad(dechex($dec), 16, '0', STR_PAD_LEFT); + } + function hex2dec($hex) { + return hexdec($hex); + } +} + +function headerVariable($headerName, $varName) { + $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($header, $pairs); + return isset($pairs[$varName]) ? $pairs[$varName] : null; +} + +function multiplePosts($name) { //https://bugs.php.net/bug.php?id=51633 + global $ORIGINAL_INPUT; + $inputs = explode('&', $ORIGINAL_INPUT); + $result = array(); + $prefix = $name . '='; + $prefixLength = strlen($prefix); + foreach ($inputs as $input) { + if (strpos($input, $prefix) === 0) { + $result[] = urldecode(substr($input, $prefixLength)); + } + } + return $result; +} + +class MyPDO extends Minz_ModelPdo { + function prepare($sql) { + return $this->bd->prepare(str_replace('%_', $this->prefix, $sql)); + } +} + +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!'); +} + +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'); + die('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!'); +} + +function serviceUnavailable() { + logMe("serviceUnavailable()\n"); + header('HTTP/1.1 503 Service Unavailable'); + header('Content-Type: text/plain; charset=UTF-8'); + die('Service Unavailable!'); +} + +function checkCompatibility() { + logMe("checkCompatibility()\n"); + header('Content-Type: text/plain; charset=UTF-8'); + if (PHP_INT_SIZE < 8 && !function_exists('gmp_init')) { + die('FAIL 64-bit or GMP extension!'); + } + 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 + (empty($_SERVER['SERVER_SOFTWARE']) || (stripos($_SERVER['SERVER_SOFTWARE'], 'lighttpd') === false)) && //lighttpd should be fine + ((!function_exists('getallheaders')) || (stripos(php_sapi_name(), 'cgi') !== false))) { //Main problem is Apache/CGI mode + die('FAIL getallheaders! (probably)'); + } + echo 'PASS'; + exit(); +} + +function authorizationToUserConf() { + $headerAuth = headerVariable('Authorization', 'GoogleLogin_auth'); //Input is 'GoogleLogin auth', but PHP replaces spaces by '_' http://php.net/language.variables.external + if ($headerAuth != '') { + $headerAuthX = explode('/', $headerAuth, 2); + if (count($headerAuthX) === 2) { + $user = $headerAuthX[0]; + if (ctype_alnum($user)) { + try { + $conf = new FreshRSS_Configuration($user); + } catch (Exception $e) { + logMe($e->getMessage() . "\n"); + unauthorized(); + } + if ($headerAuthX[1] === sha1(Minz_Configuration::salt() . $conf->user . $conf->apiPasswordHash)) { + return $conf; + } else { + logMe('Invalid API authorisation for user ' . $user . ': ' . $headerAuthX[1] . "\n"); + Minz_Log::record('Invalid API authorisation for user ' . $user . ': ' . $headerAuthX[1], Minz_Log::WARNING); + unauthorized(); + } + } else { + badRequest(); + } + } + } + return null; +} + +function clientLogin($email, $pass) { //http://web.archive.org/web/20130604091042/http://undoc.in/clientLogin.html + logMe('clientLogin(' . $email . ")\n"); + if (ctype_alnum($email)) { + if (!function_exists('password_verify')) { + include_once(LIB_PATH . '/password_compat.php'); + } + try { + $conf = new FreshRSS_Configuration($email); + } catch (Exception $e) { + logMe($e->getMessage() . "\n"); + Minz_Log::record('Invalid API user ' . $email, Minz_Log::WARNING); + unauthorized(); + } + if ($conf->apiPasswordHash != '' && password_verify($pass, $conf->apiPasswordHash)) { + header('Content-Type: text/plain; charset=UTF-8'); + $auth = $email . '/' . sha1(Minz_Configuration::salt() . $conf->user . $conf->apiPasswordHash); + echo 'SID=', $auth, "\n", + 'Auth=', $auth, "\n"; + exit(); + } else { + Minz_Log::record('Password API mismatch for user ' . $email, Minz_Log::WARNING); + unauthorized(); + } + } else { + badRequest(); + } + die(); +} + +function token($conf) { +//http://blog.martindoms.com/2009/08/15/using-the-google-reader-api-part-1/ +//https://github.com/ericmann/gReader-Library/blob/master/greader.class.php + logMe('token('. $conf->user . ")\n"); //TODO: Implement real token that expires + $token = str_pad(sha1(Minz_Configuration::salt() . $conf->user . $conf->apiPasswordHash), 57, 'Z'); //Must have 57 characters + echo $token, "\n"; + exit(); +} + +function checkToken($conf, $token) { +//http://code.google.com/p/google-reader-api/wiki/ActionToken + logMe('checkToken(' . $token . ")\n"); + if ($token === str_pad(sha1(Minz_Configuration::salt() . $conf->user . $conf->apiPasswordHash), 57, 'Z')) { + return true; + } + unauthorized(); +} + +function tagList() { + logMe("tagList()\n"); + header('Content-Type: application/json; charset=UTF-8'); + + $pdo = new MyPDO(); + $stm = $pdo->prepare('SELECT c.name FROM `%_category` c'); + $stm->execute(); + $res = $stm->fetchAll(PDO::FETCH_COLUMN, 0); + + $tags = array( + array('id' => 'user/-/state/com.google/starred'), + //array('id' => 'user/-/state/com.google/broadcast', 'sortid' => '2'), + ); + + foreach ($res as $cName) { + $tags[] = array( + 'id' => 'user/-/label/' . $cName, + //'sortid' => $cName, + ); + } + + echo json_encode(array('tags' => $tags)), "\n"; + exit(); +} + +function subscriptionList() { + logMe("subscriptionList()\n"); + header('Content-Type: application/json; charset=UTF-8'); + + $pdo = new MyPDO(); + $stm = $pdo->prepare('SELECT f.id, f.name, f.url, f.website, c.id as c_id, c.name as c_name FROM `%_feed` f + INNER JOIN `%_category` c ON c.id = f.category'); + $stm->execute(); + $res = $stm->fetchAll(PDO::FETCH_ASSOC); + + $subscriptions = array(); + + foreach ($res as $line) { + $subscriptions[] = array( + 'id' => 'feed/' . $line['id'], + 'title' => $line['name'], + 'categories' => array( + array( + 'id' => 'user/-/label/' . $line['c_name'], + 'label' => $line['c_name'], + ), + ), + //'sortid' => $line['name'], + //'firstitemmsec' => 0, + 'url' => $line['url'], + 'htmlUrl' => $line['website'], + //'iconUrl' => '', + ); + } + + echo json_encode(array('subscriptions' => $subscriptions)), "\n"; + exit(); +} + +function unreadCount() { //http://blog.martindoms.com/2009/10/16/using-the-google-reader-api-part-2/#unread-count + logMe("unreadCount()\n"); + header('Content-Type: application/json; charset=UTF-8'); + + $totalUnreads = 0; + $totalLastUpdate = 0; + + $categoryDAO = new FreshRSS_CategoryDAO(); + foreach ($categoryDAO->listCategories(true, true) as $cat) { + $catLastUpdate = 0; + foreach ($cat->feeds() as $feed) { + $lastUpdate = $feed->lastUpdate(); + $unreadcounts[] = array( + 'id' => 'feed/' . $feed->id(), + 'count' => $feed->nbNotRead(), + 'newestItemTimestampUsec' => $lastUpdate . '000000', + ); + if ($catLastUpdate < $lastUpdate) { + $catLastUpdate = $lastUpdate; + } + } + $unreadcounts[] = array( + 'id' => 'user/-/label/' . $cat->name(), + 'count' => $cat->nbNotRead(), + 'newestItemTimestampUsec' => $catLastUpdate . '000000', + ); + $totalUnreads += $cat->nbNotRead(); + if ($totalLastUpdate < $catLastUpdate) { + $totalLastUpdate = $catLastUpdate; + } + } + + $unreadcounts[] = array( + 'id' => 'user/-/state/com.google/reading-list', + 'count' => $totalUnreads, + 'newestItemTimestampUsec' => $totalLastUpdate . '000000', + ); + + echo json_encode(array( + 'max' => $totalUnreads, + 'unreadcounts' => $unreadcounts, + )), "\n"; + exit(); +} + +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($path, $include_target, $start_time, $count, $order, $exclude_target, $continuation)\n"); + header('Content-Type: application/json; charset=UTF-8'); + + $feedDAO = FreshRSS_Factory::createFeedDao(); + $arrayFeedCategoryNames = $feedDAO->arrayFeedCategoryNames(); + + switch ($path) { + case 'reading-list': + $type = 'A'; + break; + case 'starred': + $type = 's'; + break; + case 'feed': + $type = 'f'; + break; + case 'label': + $type = 'c'; + $categoryDAO = new FreshRSS_CategoryDAO(); + $cat = $categoryDAO->searchByName($include_target); + $include_target = $cat == null ? -1 : $cat->id(); + break; + default: + $type = 'A'; + break; + } + + switch ($exclude_target) { + case 'user/-/state/com.google/read': + $state = FreshRSS_Entry::STATE_NOT_READ; + break; + default: + $state = FreshRSS_Entry::STATE_ALL; + break; + } + + if (!empty($continuation)) { + $count++; //Shift by one element + } + + $entryDAO = FreshRSS_Factory::createEntryDao(); + $entries = $entryDAO->listWhere($type, $include_target, $state, $order === 'o' ? 'ASC' : 'DESC', $count, $continuation, '', $start_time); + + $items = array(); + foreach ($entries as $entry) { + $f_id = $entry->feed(); + if (isset($arrayFeedCategoryNames[$f_id])) { + $c_name = $arrayFeedCategoryNames[$f_id]['c_name']; + $f_name = $arrayFeedCategoryNames[$f_id]['name']; + } else { + $c_name = '_'; + $f_name = '_'; + } + $item = array( + 'id' => /*'tag:google.com,2005:reader/item/' .*/ dec2hex($entry->id()), //64-bit hexa http://code.google.com/p/google-reader-api/wiki/ItemId + 'crawlTimeMsec' => substr($entry->id(), 0, -3), + 'timestampUsec' => $entry->id(), //EasyRSS + 'published' => $entry->date(true), + 'title' => $entry->title(), + 'summary' => array('content' => $entry->content()), + 'alternate' => array( + array('href' => $entry->link()), + ), + 'categories' => array( + 'user/-/state/com.google/reading-list', + 'user/-/label/' . $c_name, + ), + 'origin' => array( + 'streamId' => 'feed/' . $f_id, + 'title' => $f_name, //EasyRSS + //'htmlUrl' => $line['f_website'], + ), + ); + if ($entry->author() != '') { + $item['author'] = $entry->author(); + } + if ($entry->isRead()) { + $item['categories'][] = 'user/-/state/com.google/read'; + } + if ($entry->isFavorite()) { + $item['categories'][] = 'user/-/state/com.google/starred'; + } + $items[] = $item; + } + + if (!empty($continuation)) { + array_shift($items); //Discard first element that was already sent in the previous response + } + + $response = array( + 'id' => 'user/-/state/com.google/reading-list', + 'updated' => time(), + 'items' => $items, + ); + if ((count($entries) >= $count) && (!empty($entry))) { + $response['continuation'] = $entry->id(); + } + + echo json_encode($response), "\n"; + exit(); +} + +function streamContentsItemsIds($streamId, $start_time, $count, $order, $exclude_target) { +//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, $start_time, $count, $order, $exclude_target)\n"); + + $type = 'A'; + $id = ''; + if ($streamId === 'user/-/state/com.google/reading-list') { + $type = 'A'; + } elseif ('user/-/state/com.google/starred') { + $type = 's'; + } elseif (strpos($streamId, 'feed/') === 0) { + $type = 'f'; + $id = basename($streamId); + } elseif (strpos($streamId, 'user/-/label/') === 0) { + $type = 'c'; + $c_name = basename($streamId); + $categoryDAO = new FreshRSS_CategoryDAO(); + $cat = $categoryDAO->searchByName($c_name); + $id = $cat == null ? -1 : $cat->id(); + } + + switch ($exclude_target) { + case 'user/-/state/com.google/read': + $state = FreshRSS_Entry::STATE_NOT_READ; + break; + default: + $state = FreshRSS_Entry::STATE_ALL; + break; + } + + $entryDAO = FreshRSS_Factory::createEntryDao(); + $ids = $entryDAO->listIdsWhere($type, $id, $state, $order === 'o' ? 'ASC' : 'DESC', $count, '', '', $start_time); + + $itemRefs = array(); + foreach ($ids as $id) { + $itemRefs[] = array( + 'id' => $id, //64-bit decimal + ); + } + + echo json_encode(array( + 'itemRefs' => $itemRefs, + )), "\n"; + exit(); +} + +function editTag($e_ids, $a, $r) { + logMe("editTag()\n"); + + foreach ($e_ids as $i => $e_id) { + $e_ids[$i] = hex2dec(basename($e_id)); //Strip prefix 'tag:google.com,2005:reader/item/' + } + + $entryDAO = FreshRSS_Factory::createEntryDao(); + + switch ($a) { + case 'user/-/state/com.google/read': + $entryDAO->markRead($e_ids, true); + break; + case 'user/-/state/com.google/starred': + $entryDAO->markFavorite($e_ids, true); + break; + /*case 'user/-/state/com.google/tracking-kept-unread': + break; + case 'user/-/state/com.google/like': + break; + case 'user/-/state/com.google/broadcast': + break;*/ + } + switch ($r) { + case 'user/-/state/com.google/read': + $entryDAO->markRead($e_ids, false); + break; + case 'user/-/state/com.google/starred': + $entryDAO->markFavorite($e_ids, false); + break; + } + + echo 'OK'; + exit(); +} + +function markAllAsRead($streamId, $olderThanId) { + logMe("markAllAsRead($streamId, $olderThanId)\n"); + $entryDAO = FreshRSS_Factory::createEntryDao(); + if (strpos($streamId, 'feed/') === 0) { + $f_id = basename($streamId); + $entryDAO->markReadFeed($f_id, $olderThanId); + } elseif (strpos($streamId, 'user/-/label/') === 0) { + $c_name = basename($streamId); + $categoryDAO = new FreshRSS_CategoryDAO(); + $cat = $categoryDAO->searchByName($c_name); + $entryDAO->markReadCat($cat === null ? -1 : $cat->id(), $olderThanId); + } elseif ($streamId === 'user/-/state/com.google/reading-list') { + $entryDAO->markReadEntries($olderThanId, false, -1); + } + + echo 'OK'; + exit(); +} + +logMe('----------------------------------------------------------------'."\n"); +//logMe(debugInfo()); + +$pathInfo = empty($_SERVER['PATH_INFO']) ? '/Error' : urldecode($_SERVER['PATH_INFO']); +$pathInfos = explode('/', $pathInfo); + +Minz_Configuration::init(); + +if (!Minz_Configuration::apiEnabled()) { + serviceUnavailable(); +} + +Minz_Session::init('FreshRSS'); + +$conf = authorizationToUserConf(); +$user = $conf == null ? '' : $conf->user; + +logMe('User => ' . $user . "\n"); + +Minz_Session::_param('currentUser', $user); + +if (count($pathInfos) < 3) { + badRequest(); +} +elseif ($pathInfos[1] === 'accounts') { + if (($pathInfos[2] === 'ClientLogin') && isset($_REQUEST['Email']) && isset($_REQUEST['Passwd'])) { + clientLogin($_REQUEST['Email'], $_REQUEST['Passwd']); + } +} +elseif ($pathInfos[1] === 'reader' && $pathInfos[2] === 'api' && isset($pathInfos[3]) && $pathInfos[3] === '0' && isset($pathInfos[4])) { + if ($user == '') { + unauthorized(); + } + $timestamp = isset($_GET['ck']) ? intval($_GET['ck']) : 0; //ck=[unix timestamp] : Use the current Unix time here, helps Google with caching. + switch ($pathInfos[4]) { + case 'stream': + $exclude_target = isset($_GET['xt']) ? $_GET['xt'] : ''; //xt=[exclude target] : Used to exclude certain items from the feed. For example, using xt=user/-/state/com.google/read will exclude items that the current user has marked as read, or xt=feed/[feedurl] will exclude items from a particular feed (obviously not useful in this request, but xt appears in other listing requests). + $count = isset($_GET['n']) ? intval($_GET['n']) : 20; //n=[integer] : The maximum number of results to return. + $order = isset($_GET['r']) ? $_GET['r'] : 'd'; //r=[d|n|o] : Sort order of item results. d or n gives items in descending date order, o in ascending order. + $start_time = isset($_GET['ot']) ? intval($_GET['ot']) : 0; //ot=[unix timestamp] : The time from which you want to retrieve items. Only items that have been crawled by Google Reader after this time will be returned. + $continuation = isset($_GET['c']) ? $_GET['c'] : ''; //Continuation token. If a StreamContents response does not represent all items in a timestamp range, it will have a continuation attribute. The same request can be re-issued with the value of that attribute put in this parameter to get more items + if (isset($pathInfos[5]) && $pathInfos[5] === 'contents' && isset($pathInfos[6])) { + if (isset($pathInfos[7])) { + if ($pathInfos[6] === 'feed') { + $include_target = $pathInfos[7]; + StreamContents($pathInfos[6], $include_target, $start_time, $count, $order, $exclude_target, $continuation); + } elseif ($pathInfos[6] === 'user' && isset($pathInfos[8]) && isset($pathInfos[9])) { + if ($pathInfos[8] === 'state') { + if ($pathInfos[9] === 'com.google' && isset($pathInfos[10])) { + if ($pathInfos[10] === 'reading-list' || $pathInfos[10] === 'starred') { + $include_target = ''; + streamContents($pathInfos[10], $include_target, $start_time, $count, $order, $exclude_target, $continuation); + } + } + } elseif ($pathInfos[8] === 'label') { + $include_target = $pathInfos[9]; + streamContents($pathInfos[8], $include_target, $start_time, $count, $order, $exclude_target, $continuation); + } + } + } else { //EasyRSS + $include_target = ''; + streamContents('reading-list', $include_target, $start_time, $count, $order, $exclude_target, $continuation); + } + } elseif ($pathInfos[5] === 'items') { + if ($pathInfos[6] === 'ids' && isset($_GET['s'])) { + $streamId = $_GET['s']; //StreamId for which to fetch the item IDs. The parameter may be repeated to fetch the item IDs from multiple streams at once (more efficient from a backend perspective than multiple requests). + streamContentsItemsIds($streamId, $start_time, $count, $order, $exclude_target); + } + } + break; + case 'tag': + if (isset($pathInfos[5]) && $pathInfos[5] === 'list') { + $output = isset($_GET['output']) ? $_GET['output'] : ''; + if ($output !== 'json') notImplemented(); + tagList($_GET['output']); + } + break; + case 'subscription': + if (isset($pathInfos[5]) && $pathInfos[5] === 'list') { + $output = isset($_GET['output']) ? $_GET['output'] : ''; + if ($output !== 'json') notImplemented(); + subscriptionList($_GET['output']); + } + break; + case 'unread-count': + $output = isset($_GET['output']) ? $_GET['output'] : ''; + if ($output !== 'json') notImplemented(); + $all = isset($_GET['all']) ? $_GET['all'] : ''; + unreadCount($all); + break; + case 'edit-tag': //http://blog.martindoms.com/2010/01/20/using-the-google-reader-api-part-3/ + $token = isset($_POST['T']) ? trim($_POST['T']) : ''; + checkToken($conf, $token); + $a = isset($_POST['a']) ? $_POST['a'] : ''; //Add: user/-/state/com.google/read user/-/state/com.google/starred + $r = isset($_POST['r']) ? $_POST['r'] : ''; //Remove: user/-/state/com.google/read user/-/state/com.google/starred + $e_ids = multiplePosts('i'); //item IDs + editTag($e_ids, $a, $r); + break; + case 'mark-all-as-read': + $token = isset($_POST['T']) ? trim($_POST['T']) : ''; + checkToken($conf, $token); + $streamId = $_POST['s']; //StreamId + $ts = isset($_POST['ts']) ? $_POST['ts'] : '0'; //Older than timestamp in nanoseconds + if (!ctype_digit($ts)) { + $ts = '0'; + } + markAllAsRead($streamId, $ts); + break; + case 'token': + Token($conf); + break; + } +} elseif ($pathInfos[1] === 'check' && $pathInfos[2] === 'compatibility') { + checkCompatibility(); +} + +badRequest(); diff --git a/p/api/index.html b/p/api/index.html new file mode 100644 index 000000000..8da0bcb58 --- /dev/null +++ b/p/api/index.html @@ -0,0 +1,20 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-GB" lang="en-GB"> +<head> +<meta charset="UTF-8" /> +<title>FreshRSS API</title> +<meta name="robots" content="noindex" /> +<link rel="start" href="../i/" /> +</head> + +<body> +<h1>FreshRSS API</h1> + +<h2>Google Reader compatible API</h2> +<ul> +<li><a href="greader.php/check%2Fcompatibility" rel="nofollow">Check full server configuration (with <code>%2F</code> support)</a></li> +<li><a href="greader.php/check/compatibility" rel="nofollow">Check partial server configuration (without <code>%2F</code> support)</a></li> +</ul> + +</body> +</html> diff --git a/p/i/.gitignore b/p/i/.gitignore new file mode 100644 index 000000000..03c88fd7a --- /dev/null +++ b/p/i/.gitignore @@ -0,0 +1 @@ +.htaccess diff --git a/p/i/index.php b/p/i/index.php index 187bbabe8..7b34eefd1 100755 --- a/p/i/index.php +++ b/p/i/index.php @@ -18,12 +18,12 @@ # # ***** END LICENSE BLOCK ***** -if (file_exists ('install.php')) { - require('install.php'); -} else { - require('../../constants.php'); - require(LIB_PATH . '/lib_rss.php'); //Includes class autoloader +require('../../constants.php'); +require(LIB_PATH . '/lib_rss.php'); //Includes class autoloader +if (file_exists(DATA_PATH . '/do-install.txt')) { + require(APP_PATH . '/install.php'); +} else { session_cache_limiter(''); Minz_Session::init('FreshRSS'); Minz_Session::_param('keepAlive', 1); //For Persona @@ -35,18 +35,18 @@ if (file_exists ('install.php')) { @filemtime(LOG_PATH . '/' . $currentUser . '.log'), @filemtime(DATA_PATH . '/config.php') ); - if (httpConditional($dateLastModification, 0, 0, false, false, true)) { + if (httpConditional($dateLastModification, 0, 0, false, PHP_COMPRESSION, true)) { exit(); //No need to send anything } } try { $front_controller = new FreshRSS(); - $front_controller->init (); - $front_controller->run (); + $front_controller->init(); + $front_controller->run(); } catch (Exception $e) { echo '### Fatal error! ###<br />', "\n"; - Minz_Log::record ($e->getMessage (), Minz_Log::ERROR); + Minz_Log::record($e->getMessage(), Minz_Log::ERROR); echo 'See logs files.'; } } diff --git a/p/i/install.php b/p/i/install.php deleted file mode 100644 index 90ee0b8a9..000000000 --- a/p/i/install.php +++ /dev/null @@ -1,1082 +0,0 @@ -<?php -if (function_exists('opcache_reset')) { - opcache_reset(); -} - -require('../../constants.php'); -define('BCRYPT_COST', 9); - -include(LIB_PATH . '/lib_rss.php'); - -session_name('FreshRSS'); -session_set_cookie_params(0, dirname(empty($_SERVER['REQUEST_URI']) ? '/' : dirname($_SERVER['REQUEST_URI'])), null, false, true); -session_start(); - -if (isset ($_GET['step'])) { - define ('STEP', $_GET['step']); -} else { - define ('STEP', 1); -} - -define('SQL_CREATE_DB', 'CREATE DATABASE IF NOT EXISTS %1$s DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); - -include(APP_PATH . '/sql.php'); - -//<updates> -define('SQL_SHOW_TABLES', 'SHOW tables;'); - -define('SQL_BACKUP006', 'RENAME TABLE `%1$scategory` TO `%1$scategory006`, `%1$sfeed` TO `%1$sfeed006`, `%1$sentry` TO `%1$sentry006`;'); - -define('SQL_SHOW_COLUMNS_UPDATEv006', 'SHOW columns FROM `%1$sentry006` LIKE "id2";'); - -define('SQL_UPDATEv006', ' -ALTER TABLE `%1$scategory006` ADD id2 SMALLINT; - -SET @i = 0; -UPDATE `%1$scategory006` SET id2=(@i:=@i+1) ORDER BY id; - -ALTER TABLE `%1$sfeed006` ADD id2 SMALLINT, ADD category2 SMALLINT; - -SET @i = 0; -UPDATE `%1$sfeed006` SET id2=(@i:=@i+1) ORDER BY name; - -UPDATE `%1$sfeed006` f -INNER JOIN `%1$scategory006` c ON f.category = c.id -SET f.category2 = c.id2; - -INSERT IGNORE INTO `%2$scategory` (name) -SELECT name -FROM `%1$scategory006` -ORDER BY id2; - -INSERT IGNORE INTO `%2$sfeed` (url, category, name, website, description, priority, pathEntries, httpAuth, keep_history) -SELECT url, category2, name, website, description, priority, pathEntries, httpAuth, IF(keep_history = 1, -1, -2) -FROM `%1$sfeed006` -ORDER BY id2; - -ALTER TABLE `%1$sentry006` ADD id2 bigint; - -UPDATE `%1$sentry006` SET id2 = ((date * 1000000) + (rand() * 100000000)); - -INSERT IGNORE INTO `%2$sentry` (id, guid, title, author, link, date, is_read, is_favorite, id_feed, tags) -SELECT e0.id2, e0.guid, e0.title, e0.author, e0.link, e0.date, e0.is_read, e0.is_favorite, f0.id2, e0.tags -FROM `%1$sentry006` e0 -INNER JOIN `%1$sfeed006` f0 ON e0.id_feed = f0.id; -'); - -define('SQL_CONVERT_SELECTv006', ' -SELECT e0.id2, e0.content -FROM `%1$sentry006` e0 -INNER JOIN `%2$sentry` e1 ON e0.id2 = e1.id -WHERE e1.content_bin IS NULL'); - -define('SQL_CONVERT_UPDATEv006', 'UPDATE `%1$sentry` SET content_bin=COMPRESS(?) WHERE id=?;'); - -define('SQL_DROP_BACKUPv006', 'DROP TABLE IF EXISTS `%1$sentry006`, `%1$sfeed006`, `%1$scategory006`;'); - -define('SQL_UPDATE_CACHED_VALUES', ' -UPDATE `%1$sfeed` f -INNER JOIN ( - SELECT e.id_feed, - COUNT(CASE WHEN e.is_read = 0 THEN 1 END) AS nbUnreads, - COUNT(e.id) AS nbEntries - FROM `%1$sentry` e - GROUP BY e.id_feed -) x ON x.id_feed=f.id -SET f.cache_nbEntries=x.nbEntries, f.cache_nbUnreads=x.nbUnreads -'); - -define('SQL_UPDATE_HISTORYv007b', 'UPDATE `%1$sfeed` SET keep_history = CASE WHEN keep_history = 0 THEN -2 WHEN keep_history = 1 THEN -1 ELSE keep_history END;'); - -define('SQL_GET_FEEDS', 'SELECT id, url, website FROM `%1$sfeed`;'); -//</updates> - -// gestion internationalisation -$translates = array (); -$actual = 'en'; -function initTranslate () { - global $translates; - global $actual; - - $actual = isset($_SESSION['language']) ? $_SESSION['language'] : getBetterLanguage('en'); - - $file = APP_PATH . '/i18n/' . $actual . '.php'; - if (file_exists($file)) { - $translates = array_merge($translates, include($file)); - } - - $file = APP_PATH . '/i18n/install.' . $actual . '.php'; - if (file_exists($file)) { - $translates = array_merge($translates, include($file)); - } -} - -function getBetterLanguage ($fallback) { - $available = availableLanguages (); - $accept = $_SERVER['HTTP_ACCEPT_LANGUAGE']; - $language = strtolower (substr ($accept, 0, 2)); - - if (isset ($available[$language])) { - return $language; - } else { - return $fallback; - } -} -function availableLanguages () { - return array ( - 'en' => 'English', - 'fr' => 'Français' - ); -} -function _t ($key) { - global $translates; - $translate = $key; - if (isset ($translates[$key])) { - $translate = $translates[$key]; - } - - $args = func_get_args (); - unset($args[0]); - - return vsprintf ($translate, $args); -} - -/*** SAUVEGARDES ***/ -function saveLanguage () { - if (!empty ($_POST)) { - if (!isset ($_POST['language'])) { - return false; - } - - $_SESSION['language'] = $_POST['language']; - - header ('Location: index.php?step=1'); - } -} -function saveStep2 () { - if (!empty ($_POST)) { - if (empty ($_POST['title']) || - empty ($_POST['old_entries']) || - empty ($_POST['auth_type']) || - empty ($_POST['default_user'])) { - return false; - } - - $_SESSION['salt'] = sha1(uniqid(mt_rand(), true).implode('', stat(__FILE__))); - $_SESSION['title'] = substr(trim($_POST['title']), 0, 25); - $_SESSION['old_entries'] = $_POST['old_entries']; - if ((!ctype_digit($_SESSION['old_entries'])) || ($_SESSION['old_entries'] < 1)) { - $_SESSION['old_entries'] = 3; - } - $_SESSION['mail_login'] = filter_var($_POST['mail_login'], FILTER_VALIDATE_EMAIL); - $_SESSION['default_user'] = substr(preg_replace('/[^a-zA-Z0-9]/', '', $_POST['default_user']), 0, 16); - $_SESSION['auth_type'] = $_POST['auth_type']; - if (!empty($_POST['passwordPlain'])) { - if (!function_exists('password_hash')) { - include_once(LIB_PATH . '/password_compat.php'); - } - $passwordHash = password_hash($_POST['passwordPlain'], PASSWORD_BCRYPT, array('cost' => BCRYPT_COST)); - $passwordHash = preg_replace('/^\$2[xy]\$/', '\$2a\$', $passwordHash); //Compatibility with bcrypt.js - $_SESSION['passwordHash'] = $passwordHash; - } - - $token = ''; - if ($_SESSION['mail_login']) { - $token = sha1($_SESSION['salt'] . $_SESSION['mail_login']); - } - - $config_array = array ( - 'language' => $_SESSION['language'], - 'theme' => $_SESSION['theme'], - 'old_entries' => $_SESSION['old_entries'], - 'mail_login' => $_SESSION['mail_login'], - 'passwordHash' => $_SESSION['passwordHash'], - 'token' => $token, - ); - - $configPath = DATA_PATH . '/' . $_SESSION['default_user'] . '_user.php'; - @unlink($configPath); //To avoid access-rights problems - file_put_contents($configPath, "<?php\n return " . var_export($config_array, true) . ';'); - - if ($_SESSION['mail_login'] != '') { - $personaFile = DATA_PATH . '/persona/' . $_SESSION['mail_login'] . '.txt'; - @unlink($personaFile); - file_put_contents($personaFile, $_SESSION['default_user']); - } - - header ('Location: index.php?step=3'); - } -} - -function saveStep3 () { - if (!empty ($_POST)) { - if (empty ($_POST['type']) || - empty ($_POST['host']) || - empty ($_POST['user']) || - empty ($_POST['base'])) { - $_SESSION['bd_error'] = 'Missing parameters!'; - } - - $_SESSION['bd_type'] = isset ($_POST['type']) ? $_POST['type'] : 'mysql'; - $_SESSION['bd_host'] = $_POST['host']; - $_SESSION['bd_user'] = $_POST['user']; - $_SESSION['bd_password'] = $_POST['pass']; - $_SESSION['bd_base'] = substr($_POST['base'], 0, 64); - $_SESSION['bd_prefix'] = substr($_POST['prefix'], 0, 16); - $_SESSION['bd_prefix_user'] = $_SESSION['bd_prefix'] . (empty($_SESSION['default_user']) ? '' : ($_SESSION['default_user'] . '_')); - - $ini_array = array( - 'general' => array( - 'environment' => empty($_SESSION['environment']) ? 'production' : $_SESSION['environment'], - 'use_url_rewriting' => false, - 'salt' => $_SESSION['salt'], - 'base_url' => '', - 'title' => $_SESSION['title'], - 'default_user' => $_SESSION['default_user'], - 'auth_type' => $_SESSION['auth_type'], - 'allow_anonymous' => isset($_SESSION['allow_anonymous']) ? $_SESSION['allow_anonymous'] : false, - ), - 'db' => array( - 'type' => $_SESSION['bd_type'], - 'host' => $_SESSION['bd_host'], - 'user' => $_SESSION['bd_user'], - 'password' => $_SESSION['bd_password'], - 'base' => $_SESSION['bd_base'], - 'prefix' => $_SESSION['bd_prefix'], - ), - ); - - @unlink(DATA_PATH . '/config.php'); //To avoid access-rights problems - file_put_contents(DATA_PATH . '/config.php', "<?php\n return " . var_export($ini_array, true) . ';'); - - if (file_exists(DATA_PATH . '/config.php') && file_exists(DATA_PATH . '/application.ini')) { - @unlink(DATA_PATH . '/application.ini'); //v0.6 - } - - $res = checkBD (); - - if ($res) { - $_SESSION['bd_error'] = ''; - header ('Location: index.php?step=4'); - } elseif (empty($_SESSION['bd_error'])) { - $_SESSION['bd_error'] = 'Unknown error!'; - } - } - invalidateHttpCache(); -} - -function updateDatabase($perform = false) { - $needs = array('bd_type', 'bd_host', 'bd_base', 'bd_user', 'bd_password', 'bd_prefix', 'bd_prefix_user'); - foreach ($needs as $need) { - if (!isset($_SESSION[$need])) { - return false; - } - } - - try { - $str = ''; - switch ($_SESSION['bd_type']) { - case 'mysql': - $str = 'mysql:host=' . $_SESSION['bd_host'] . ';dbname=' . $_SESSION['bd_base']; - $driver_options = array( - PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8', - ); - break; - case 'sqlite': - $str = 'sqlite:' . DATA_PATH . $_SESSION['bd_base'] . '.sqlite'; - $driver_options = null; - break; - default: - return false; - } - - $c = new PDO($str, $_SESSION['bd_user'], $_SESSION['bd_password'], $driver_options); - - $stm = $c->prepare(SQL_SHOW_TABLES); - $stm->execute(); - $res = $stm->fetchAll(PDO::FETCH_COLUMN, 0); - if (!in_array($_SESSION['bd_prefix'] . 'entry006', $res)) { - return false; - } - - $sql = sprintf(SQL_SHOW_COLUMNS_UPDATEv006, $_SESSION['bd_prefix']); - $stm = $c->prepare($sql); - $stm->execute(); - $res = $stm->fetchAll(PDO::FETCH_COLUMN, 0); - if (!in_array('id2', $res)) { - if (!$perform) { - return true; - } - $sql = sprintf(SQL_UPDATEv006, $_SESSION['bd_prefix'], $_SESSION['bd_prefix_user']); - $stm = $c->prepare($sql, array(PDO::ATTR_EMULATE_PREPARES => true)); - $stm->execute(); - } - - $sql = sprintf(SQL_CONVERT_SELECTv006, $_SESSION['bd_prefix'], $_SESSION['bd_prefix_user']); - if (!$perform) { - $sql .= ' LIMIT 1'; - } - $stm = $c->prepare($sql); - $stm->execute(); - if (!$perform) { - $res = $stm->fetchAll(PDO::FETCH_COLUMN, 0); - return count($res) > 0; - } else { - @set_time_limit(300); - } - - $c2 = new PDO($str, $_SESSION['bd_user'], $_SESSION['bd_password'], $driver_options); - $sql = sprintf(SQL_CONVERT_UPDATEv006, $_SESSION['bd_prefix_user']); - $stm2 = $c2->prepare($sql); - while ($row = $stm->fetch(PDO::FETCH_ASSOC)) { - $id = $row['id2']; - $content = unserialize(gzinflate(base64_decode($row['content']))); - $stm2->execute(array($content, $id)); - } - - return true; - } catch (PDOException $e) { - return false; - } - return false; -} - -function newPdo() { - switch ($_SESSION['bd_type']) { - case 'mysql': - $str = 'mysql:host=' . $_SESSION['bd_host'] . ';dbname=' . $_SESSION['bd_base']; - $driver_options = array( - PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8', - ); - break; - case 'sqlite': - $str = 'sqlite:' . DATA_PATH . $_SESSION['bd_base'] . '.sqlite'; - $driver_options = null; - break; - default: - return false; - } - return new PDO($str, $_SESSION['bd_user'], $_SESSION['bd_password'], $driver_options); -} - -function postUpdate() { - $c = newPdo(); - - $sql = sprintf(SQL_UPDATE_HISTORYv007b, $_SESSION['bd_prefix_user']); - $stm = $c->prepare($sql); - $stm->execute(); - - $sql = sprintf(SQL_UPDATE_CACHED_VALUES, $_SESSION['bd_prefix_user']); - $stm = $c->prepare($sql); - $stm->execute(); - - //<favicons> - $sql = sprintf(SQL_GET_FEEDS, $_SESSION['bd_prefix_user']); - $stm = $c->prepare($sql); - $stm->execute(); - $res = $stm->fetchAll(PDO::FETCH_ASSOC); - foreach ($res as $feed) { - if (empty($feed['url'])) { - continue; - } - $hash = hash('crc32b', $_SESSION['salt'] . $feed['url']); - @file_put_contents(DATA_PATH . '/favicons/' . $hash . '.txt', - empty($feed['website']) ? $feed['url'] : $feed['website']); - } - //</favicons> -} - -function deleteInstall () { - $res = unlink (INDEX_PATH . '/install.php'); - if ($res) { - header ('Location: index.php'); - } - - $needs = array('bd_type', 'bd_host', 'bd_base', 'bd_user', 'bd_password', 'bd_prefix'); - foreach ($needs as $need) { - if (!isset($_SESSION[$need])) { - return false; - } - } - - try { - $c = newPdo(); - $sql = sprintf(SQL_DROP_BACKUPv006, $_SESSION['bd_prefix']); - $stm = $c->prepare($sql); - $stm->execute(); - - return true; - } catch (PDOException $e) { - return false; - } - return false; -} - -function moveOldFiles() { - $mvs = array( - '/app/configuration/application.ini' => '/data/application.ini', //v0.6 - '/public/data/Configuration.array.php' => '/data/Configuration.array.php', //v0.6 - ); - $ok = true; - foreach ($mvs as $fFrom => $fTo) { - if (file_exists(FRESHRSS_PATH . $fFrom)) { - if (copy(FRESHRSS_PATH . $fFrom, FRESHRSS_PATH . $fTo)) { - @unlink(FRESHRSS_PATH . $fFrom); - } else { - $ok = false; - } - } - } - return $ok; -} - -function delTree($dir) { //http://php.net/rmdir#110489 - if (!is_dir($dir)) { - return true; - } - $files = array_diff(scandir($dir), array('.', '..')); - foreach ($files as $file) { - $f = $dir . '/' . $file; - if (is_dir($f)) { - @chmod($f, 0777); - delTree($f); - } - else unlink($f); - } - return rmdir($dir); -} - -/*** VÉRIFICATIONS ***/ -function checkStep () { - $s0 = checkStep0 (); - $s1 = checkStep1 (); - $s2 = checkStep2 (); - $s3 = checkStep3 (); - if (STEP > 0 && $s0['all'] != 'ok') { - header ('Location: index.php?step=0'); - } elseif (STEP > 1 && $s1['all'] != 'ok') { - header ('Location: index.php?step=1'); - } elseif (STEP > 2 && $s2['all'] != 'ok') { - header ('Location: index.php?step=2'); - } elseif (STEP > 3 && $s3['all'] != 'ok') { - header ('Location: index.php?step=3'); - } - $_SESSION['actualize_feeds'] = true; -} -function checkStep0 () { - moveOldFiles(); - - if (file_exists(DATA_PATH . '/config.php')) { - $ini_array = include(DATA_PATH . '/config.php'); - } elseif (file_exists(DATA_PATH . '/application.ini')) { //v0.6 - $ini_array = parse_ini_file(DATA_PATH . '/application.ini', true); - $ini_array['general']['title'] = empty($ini_array['general']['title']) ? '' : stripslashes($ini_array['general']['title']); - } else { - $ini_array = null; - } - - if ($ini_array) { - $ini_general = isset($ini_array['general']) ? $ini_array['general'] : null; - if ($ini_general) { - $keys = array('environment', 'salt', 'title', 'default_user', 'allow_anonymous', 'auth_type'); - foreach ($keys as $key) { - if ((empty($_SESSION[$key])) && isset($ini_general[$key])) { - $_SESSION[$key] = $ini_general[$key]; - } - } - } - $ini_db = isset($ini_array['db']) ? $ini_array['db'] : null; - if ($ini_db) { - $keys = array('type', 'host', 'user', 'password', 'base', 'prefix'); - foreach ($keys as $key) { - if ((!isset($_SESSION['bd_' . $key])) && isset($ini_db[$key])) { - $_SESSION['bd_' . $key] = $ini_db[$key]; - } - } - } - } - - if (isset($_SESSION['default_user']) && file_exists(DATA_PATH . '/' . $_SESSION['default_user'] . '_user.php')) { - $userConfig = include(DATA_PATH . '/' . $_SESSION['default_user'] . '_user.php'); - } elseif (file_exists(DATA_PATH . '/Configuration.array.php')) { - $userConfig = include(DATA_PATH . '/Configuration.array.php'); //v0.6 - if (empty($_SESSION['auth_type'])) { - $_SESSION['auth_type'] = empty($userConfig['mail_login']) ? 'none' : 'persona'; - } - if (!isset($_SESSION['allow_anonymous'])) { - $_SESSION['allow_anonymous'] = empty($userConfig['anon_access']) ? false : ($userConfig['anon_access'] === 'yes'); - } - } else { - $userConfig = array(); - } - if (empty($_SESSION['auth_type'])) { //v0.7b - $_SESSION['auth_type'] = ''; - } - - $keys = array('language', 'theme', 'old_entries', 'mail_login', 'passwordHash'); - foreach ($keys as $key) { - if ((!isset($_SESSION[$key])) && isset($userConfig[$key])) { - $_SESSION[$key] = $userConfig[$key]; - } - } - - $languages = availableLanguages (); - $language = isset ($_SESSION['language']) && - isset ($languages[$_SESSION['language']]); - - if (empty($_SESSION['passwordHash'])) { //v0.7b - $_SESSION['passwordHash'] = ''; - } - if (empty($_SESSION['theme'])) { - $_SESSION['theme'] = 'Origine'; - } else { - switch (strtolower($_SESSION['theme'])) { - case 'default': //v0.7b - $_SESSION['theme'] = 'Origine'; - break; - case 'flat-design': //v0.7b - $_SESSION['theme'] = 'Flat'; - break; - case 'default_dark': //v0.7b - $_SESSION['theme'] = 'Dark'; - break; - } - } - - return array ( - 'language' => $language ? 'ok' : 'ko', - 'all' => $language ? 'ok' : 'ko' - ); -} - -function checkStep1 () { - $php = version_compare (PHP_VERSION, '5.2.1') >= 0; - $minz = file_exists (LIB_PATH . '/Minz'); - $curl = extension_loaded ('curl'); - $pdo = extension_loaded ('pdo_mysql'); - $pcre = extension_loaded ('pcre'); - $ctype = extension_loaded ('ctype'); - $dom = class_exists('DOMDocument'); - $data = DATA_PATH && is_writable (DATA_PATH); - $cache = CACHE_PATH && is_writable (CACHE_PATH); - $log = LOG_PATH && is_writable (LOG_PATH); - $favicons = is_writable (DATA_PATH . '/favicons'); - $persona = is_writable (DATA_PATH . '/persona'); - - return array ( - 'php' => $php ? 'ok' : 'ko', - 'minz' => $minz ? 'ok' : 'ko', - 'curl' => $curl ? 'ok' : 'ko', - 'pdo-mysql' => $pdo ? 'ok' : 'ko', - 'pcre' => $pcre ? 'ok' : 'ko', - 'ctype' => $ctype ? 'ok' : 'ko', - 'dom' => $dom ? 'ok' : 'ko', - 'data' => $data ? 'ok' : 'ko', - 'cache' => $cache ? 'ok' : 'ko', - 'log' => $log ? 'ok' : 'ko', - 'favicons' => $favicons ? 'ok' : 'ko', - 'persona' => $persona ? 'ok' : 'ko', - 'all' => $php && $minz && $curl && $pdo && $pcre && $ctype && $dom && $data && $cache && $log && $favicons && $persona ? 'ok' : 'ko' - ); -} - -function checkStep2 () { - $conf = !empty($_SESSION['salt']) && - !empty($_SESSION['title']) && - !empty($_SESSION['old_entries']) && - isset($_SESSION['mail_login']) && - !empty($_SESSION['default_user']); - $defaultUser = empty($_POST['default_user']) ? null : $_POST['default_user']; - if ($defaultUser === null) { - $defaultUser = empty($_SESSION['default_user']) ? '' : $_SESSION['default_user']; - } - $data = is_writable(DATA_PATH . '/' . $defaultUser . '_user.php'); - if ($data) { - @unlink(DATA_PATH . '/Configuration.array.php'); //v0.6 - } - - return array ( - 'conf' => $conf ? 'ok' : 'ko', - 'data' => $data ? 'ok' : 'ko', - 'all' => $conf && $data ? 'ok' : 'ko' - ); -} -function checkStep3 () { - $conf = is_writable(DATA_PATH . '/config.php'); - - $bd = isset ($_SESSION['bd_type']) && - isset ($_SESSION['bd_host']) && - isset ($_SESSION['bd_user']) && - isset ($_SESSION['bd_password']) && - isset ($_SESSION['bd_base']) && - isset ($_SESSION['bd_prefix']) && - isset ($_SESSION['bd_error']); - $conn = empty($_SESSION['bd_error']); - - return array ( - 'bd' => $bd ? 'ok' : 'ko', - 'conn' => $conn ? 'ok' : 'ko', - 'conf' => $conf ? 'ok' : 'ko', - 'all' => $bd && $conn && $conf ? 'ok' : 'ko' - ); -} - -function checkBD () { - $ok = false; - - try { - $str = ''; - $driver_options = null; - switch ($_SESSION['bd_type']) { - case 'mysql': - $driver_options = array( - PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8' - ); - - try { // on ouvre une connexion juste pour créer la base si elle n'existe pas - $str = 'mysql:host=' . $_SESSION['bd_host'] . ';'; - $c = new PDO ($str, $_SESSION['bd_user'], $_SESSION['bd_password'], $driver_options); - $sql = sprintf (SQL_CREATE_DB, $_SESSION['bd_base']); - $res = $c->query ($sql); - } catch (PDOException $e) { - } - - // on écrase la précédente connexion en sélectionnant la nouvelle BDD - $str = 'mysql:host=' . $_SESSION['bd_host'] . ';dbname=' . $_SESSION['bd_base']; - break; - case 'sqlite': - $str = 'sqlite:' . DATA_PATH . $_SESSION['bd_base'] . '.sqlite'; - break; - default: - return false; - } - - $c = new PDO ($str, $_SESSION['bd_user'], $_SESSION['bd_password'], $driver_options); - - $stm = $c->prepare(SQL_SHOW_TABLES); - $stm->execute(); - $res = $stm->fetchAll(PDO::FETCH_COLUMN, 0); - if (in_array($_SESSION['bd_prefix'] . 'entry', $res) && !in_array($_SESSION['bd_prefix'] . 'entry006', $res)) { - $sql = sprintf(SQL_BACKUP006, $_SESSION['bd_prefix']); //v0.6 - $res = $c->query($sql); //Backup tables - } - - $sql = sprintf(SQL_CREATE_TABLES, $_SESSION['bd_prefix_user']); - $stm = $c->prepare($sql, array(PDO::ATTR_EMULATE_PREPARES => true)); - $values = array( - 'catName' => _t('default_category'), - ); - $ok = $stm->execute($values); - } catch (PDOException $e) { - $ok = false; - $_SESSION['bd_error'] = $e->getMessage(); - } - - if (!$ok) { - @unlink(DATA_PATH . '/config.php'); - } - - return $ok; -} - -/*** AFFICHAGE ***/ -function printStep0 () { - global $actual; -?> - <?php $s0 = checkStep0 (); if ($s0['all'] == 'ok') { ?> - <p class="alert alert-success"><span class="alert-head"><?php echo _t ('ok'); ?></span> <?php echo _t ('language_defined'); ?></p> - <?php } ?> - - <form action="index.php?step=0" method="post"> - <legend><?php echo _t ('choose_language'); ?></legend> - <div class="form-group"> - <label class="group-name" for="language"><?php echo _t ('language'); ?></label> - <div class="group-controls"> - <select name="language" id="language"> - <?php $languages = availableLanguages (); ?> - <?php foreach ($languages as $short => $lib) { ?> - <option value="<?php echo $short; ?>"<?php echo $actual == $short ? ' selected="selected"' : ''; ?>><?php echo $lib; ?></option> - <?php } ?> - </select> - </div> - </div> - - <div class="form-group form-actions"> - <div class="group-controls"> - <button type="submit" class="btn btn-important"><?php echo _t ('save'); ?></button> - <button type="reset" class="btn"><?php echo _t ('cancel'); ?></button> - <?php if ($s0['all'] == 'ok') { ?> - <a class="btn btn-important next-step" href="?step=1"><?php echo _t ('next_step'); ?></a> - <?php } ?> - </div> - </div> - </form> -<?php -} - -function printStep1 () { - $res = checkStep1 (); -?> - <noscript><p class="alert alert-warn"><span class="alert-head"><?php echo _t ('attention'); ?></span> <?php echo _t ('javascript_is_better'); ?></p></noscript> - - <?php if ($res['php'] == 'ok') { ?> - <p class="alert alert-success"><span class="alert-head"><?php echo _t ('ok'); ?></span> <?php echo _t ('php_is_ok', PHP_VERSION); ?></p> - <?php } else { ?> - <p class="alert alert-error"><span class="alert-head"><?php echo _t ('damn'); ?></span> <?php echo _t ('php_is_nok', PHP_VERSION, '5.2.1'); ?></p> - <?php } ?> - - <?php if ($res['minz'] == 'ok') { ?> - <p class="alert alert-success"><span class="alert-head"><?php echo _t ('ok'); ?></span> <?php echo _t ('minz_is_ok'); ?></p> - <?php } else { ?> - <p class="alert alert-error"><span class="alert-head"><?php echo _t ('damn'); ?></span> <?php echo _t ('minz_is_nok', LIB_PATH . '/Minz'); ?></p> - <?php } ?> - - <?php if ($res['pdo-mysql'] == 'ok') { ?> - <p class="alert alert-success"><span class="alert-head"><?php echo _t ('ok'); ?></span> <?php echo _t ('pdomysql_is_ok'); ?></p> - <?php } else { ?> - <p class="alert alert-error"><span class="alert-head"><?php echo _t ('damn'); ?></span> <?php echo _t ('pdomysql_is_nok'); ?></p> - <?php } ?> - - <?php if ($res['curl'] == 'ok') { ?> - <?php $version = curl_version(); ?> - <p class="alert alert-success"><span class="alert-head"><?php echo _t ('ok'); ?></span> <?php echo _t ('curl_is_ok', $version['version']); ?></p> - <?php } else { ?> - <p class="alert alert-error"><span class="alert-head"><?php echo _t ('damn'); ?></span> <?php echo _t ('curl_is_nok'); ?></p> - <?php } ?> - - <?php if ($res['pcre'] == 'ok') { ?> - <p class="alert alert-success"><span class="alert-head"><?php echo _t ('ok'); ?></span> <?php echo _t ('pcre_is_ok'); ?></p> - <?php } else { ?> - <p class="alert alert-error"><span class="alert-head"><?php echo _t ('damn'); ?></span> <?php echo _t ('pcre_is_nok'); ?></p> - <?php } ?> - - <?php if ($res['ctype'] == 'ok') { ?> - <p class="alert alert-success"><span class="alert-head"><?php echo _t ('ok'); ?></span> <?php echo _t ('ctype_is_ok'); ?></p> - <?php } else { ?> - <p class="alert alert-error"><span class="alert-head"><?php echo _t ('damn'); ?></span> <?php echo _t ('ctype_is_nok'); ?></p> - <?php } ?> - - <?php if ($res['dom'] == 'ok') { ?> - <p class="alert alert-success"><span class="alert-head"><?php echo _t ('ok'); ?></span> <?php echo _t ('dom_is_ok'); ?></p> - <?php } else { ?> - <p class="alert alert-error"><span class="alert-head"><?php echo _t ('damn'); ?></span> <?php echo _t ('dom_is_nok'); ?></p> - <?php } ?> - - <?php if ($res['data'] == 'ok') { ?> - <p class="alert alert-success"><span class="alert-head"><?php echo _t ('ok'); ?></span> <?php echo _t ('data_is_ok'); ?></p> - <?php } else { ?> - <p class="alert alert-error"><span class="alert-head"><?php echo _t ('damn'); ?></span> <?php echo _t ('file_is_nok', DATA_PATH); ?></p> - <?php } ?> - - <?php if ($res['cache'] == 'ok') { ?> - <p class="alert alert-success"><span class="alert-head"><?php echo _t ('ok'); ?></span> <?php echo _t ('cache_is_ok'); ?></p> - <?php } else { ?> - <p class="alert alert-error"><span class="alert-head"><?php echo _t ('damn'); ?></span> <?php echo _t ('file_is_nok', CACHE_PATH); ?></p> - <?php } ?> - - <?php if ($res['log'] == 'ok') { ?> - <p class="alert alert-success"><span class="alert-head"><?php echo _t ('ok'); ?></span> <?php echo _t ('log_is_ok'); ?></p> - <?php } else { ?> - <p class="alert alert-error"><span class="alert-head"><?php echo _t ('damn'); ?></span> <?php echo _t ('file_is_nok', LOG_PATH); ?></p> - <?php } ?> - - <?php if ($res['favicons'] == 'ok') { ?> - <p class="alert alert-success"><span class="alert-head"><?php echo _t ('ok'); ?></span> <?php echo _t ('favicons_is_ok'); ?></p> - <?php } else { ?> - <p class="alert alert-error"><span class="alert-head"><?php echo _t ('damn'); ?></span> <?php echo _t ('file_is_nok', DATA_PATH . '/favicons'); ?></p> - <?php } ?> - - <?php if ($res['persona'] == 'ok') { ?> - <p class="alert alert-success"><span class="alert-head"><?php echo _t ('ok'); ?></span> <?php echo _t ('persona_is_ok'); ?></p> - <?php } else { ?> - <p class="alert alert-error"><span class="alert-head"><?php echo _t ('damn'); ?></span> <?php echo _t ('file_is_nok', DATA_PATH . '/persona'); ?></p> - <?php } ?> - - <?php if ($res['all'] == 'ok') { ?> - <a class="btn btn-important next-step" href="?step=2"><?php echo _t ('next_step'); ?></a> - <?php } else { ?> - <p class="alert alert-error"><?php echo _t ('fix_errors_before'); ?></p> - <?php } ?> -<?php -} - -function printStep2 () { -?> - <?php $s2 = checkStep2 (); if ($s2['all'] == 'ok') { ?> - <p class="alert alert-success"><span class="alert-head"><?php echo _t ('ok'); ?></span> <?php echo _t ('general_conf_is_ok'); ?></p> - <?php } ?> - - <form action="index.php?step=2" method="post"> - <legend><?php echo _t ('general_configuration'); ?></legend> - - <div class="form-group"> - <label class="group-name" for="title"><?php echo _t ('title'); ?></label> - <div class="group-controls"> - <input type="text" id="title" name="title" value="<?php echo isset ($_SESSION['title']) ? $_SESSION['title'] : _t ('freshrss'); ?>" /> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="old_entries"><?php echo _t ('delete_articles_every'); ?></label> - <div class="group-controls"> - <input type="number" id="old_entries" name="old_entries" required="required" min="1" max="1200" value="<?php echo isset ($_SESSION['old_entries']) ? $_SESSION['old_entries'] : '3'; ?>" /> <?php echo _t ('month'); ?> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="default_user"><?php echo _t ('default_user'); ?></label> - <div class="group-controls"> - <input type="text" id="default_user" name="default_user" required="required" size="16" maxlength="16" pattern="[0-9a-zA-Z]{1,16}" value="<?php echo isset ($_SESSION['default_user']) ? $_SESSION['default_user'] : ''; ?>" placeholder="<?php echo httpAuthUser() == '' ? 'user1' : httpAuthUser(); ?>" /> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="auth_type"><?php echo _t('auth_type'); ?></label> - <div class="group-controls"> - <select id="auth_type" name="auth_type" required="required"> - <?php if (!in_array($_SESSION['auth_type'], array('form', 'persona', 'http_auth', 'none'))) { ?> - <option selected="selected"></option> - <?php } ?> - <option value="form"<?php echo $_SESSION['auth_type'] === 'form' ? ' selected="selected"' : '', version_compare(PHP_VERSION, '5.3', '<') ? ' disabled="disabled"' : ''; ?>><?php echo _t('auth_form'); ?></option> - <option value="persona"<?php echo $_SESSION['auth_type'] === 'persona' ? ' selected="selected"' : ''; ?>><?php echo _t('auth_persona'); ?></option> - <option value="http_auth"<?php echo $_SESSION['auth_type'] === 'http_auth' ? ' selected="selected"' : '', httpAuthUser() == '' ? ' disabled="disabled"' : ''; ?>><?php echo _t('http_auth'); ?> (REMOTE_USER = '<?php echo httpAuthUser(); ?>')</option> - <option value="none"<?php echo $_SESSION['auth_type'] === 'none' ? ' selected="selected"' : ''; ?>><?php echo _t('auth_none'); ?></option> - </select> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="passwordPlain"><?php echo _t('password_form'); ?></label> - <div class="group-controls"> - <input type="password" id="passwordPlain" name="passwordPlain" pattern=".{7,}" autocomplete="off" /> - <noscript><b><?php echo _t('javascript_should_be_activated'); ?></b></noscript> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="mail_login"><?php echo _t ('persona_connection_email'); ?></label> - <div class="group-controls"> - <input type="email" id="mail_login" name="mail_login" value="<?php echo isset ($_SESSION['mail_login']) ? $_SESSION['mail_login'] : ''; ?>" placeholder="alice@example.net" /> - <noscript><b><?php echo _t ('javascript_should_be_activated'); ?></b></noscript> - </div> - </div> - - <div class="form-group form-actions"> - <div class="group-controls"> - <button type="submit" class="btn btn-important"><?php echo _t ('save'); ?></button> - <button type="reset" class="btn"><?php echo _t ('cancel'); ?></button> - <?php if ($s2['all'] == 'ok') { ?> - <a class="btn btn-important next-step" href="?step=3"><?php echo _t ('next_step'); ?></a> - <?php } ?> - </div> - </div> - </form> -<?php -} - -function printStep3 () { -?> - <?php $s3 = checkStep3 (); if ($s3['all'] == 'ok') { ?> - <p class="alert alert-success"><span class="alert-head"><?php echo _t ('ok'); ?></span> <?php echo _t ('bdd_conf_is_ok'); ?></p> - <?php } elseif ($s3['conn'] == 'ko') { ?> - <p class="alert alert-error"><span class="alert-head"><?php echo _t ('damn'); ?></span> <?php echo _t ('bdd_conf_is_ko'), (empty($_SESSION['bd_error']) ? '' : ' : ' . $_SESSION['bd_error']); ?></p> - <?php } ?> - - <form action="index.php?step=3" method="post"> - <legend><?php echo _t ('bdd_configuration'); ?></legend> - <div class="form-group"> - <label class="group-name" for="type"><?php echo _t ('bdd_type'); ?></label> - <div class="group-controls"> - <select name="type" id="type"> - <option value="mysql" - <?php echo (isset($_SESSION['bd_type']) && $_SESSION['bd_type'] === 'mysql') ? 'selected="selected"' : ''; ?>> - MySQL - </option> - <!-- TODO : l'utilisation de SQLite n'est pas encore possible. Pour tester tout de même, décommentez ce bloc - <option value="sqlite" - <?php echo (isset($_SESSION['bd_type']) && $_SESSION['bd_type'] === 'sqlite') ? 'selected="selected"' : ''; ?>> - SQLite - </option>--> - </select> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="host"><?php echo _t ('host'); ?></label> - <div class="group-controls"> - <input type="text" id="host" name="host" pattern="[0-9A-Za-z_.-]{1,64}" value="<?php echo isset ($_SESSION['bd_host']) ? $_SESSION['bd_host'] : 'localhost'; ?>" /> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="user"><?php echo _t ('username'); ?></label> - <div class="group-controls"> - <input type="text" id="user" name="user" maxlength="16" pattern="[0-9A-Za-z_]{1,16}" value="<?php echo isset ($_SESSION['bd_user']) ? $_SESSION['bd_user'] : ''; ?>" /> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="pass"><?php echo _t ('password'); ?></label> - <div class="group-controls"> - <input type="password" id="pass" name="pass" value="<?php echo isset ($_SESSION['bd_password']) ? $_SESSION['bd_password'] : ''; ?>" /> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="base"><?php echo _t ('bdd'); ?></label> - <div class="group-controls"> - <input type="text" id="base" name="base" maxlength="64" pattern="[0-9A-Za-z_]{1,64}" value="<?php echo isset ($_SESSION['bd_base']) ? $_SESSION['bd_base'] : ''; ?>" placeholder="freshrss" /> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="prefix"><?php echo _t ('prefix'); ?></label> - <div class="group-controls"> - <input type="text" id="prefix" name="prefix" maxlength="16" pattern="[0-9A-Za-z_]{1,16}" value="<?php echo isset ($_SESSION['bd_prefix']) ? $_SESSION['bd_prefix'] : 'freshrss_'; ?>" /> - </div> - </div> - - <div class="form-group form-actions"> - <div class="group-controls"> - <button type="submit" class="btn btn-important"><?php echo _t ('save'); ?></button> - <button type="reset" class="btn"><?php echo _t ('cancel'); ?></button> - <?php if ($s3['all'] == 'ok') { ?> - <a class="btn btn-important next-step" href="?step=4"><?php echo _t ('next_step'); ?></a> - <?php } ?> - </div> - </div> - </form> -<?php -} - -function printStep4 () { -?> - <form action="index.php?step=4" method="post"> - <legend><?php echo _t ('version_update'); ?></legend> - - <?php if (updateDatabase(false)) { ?> - <p class="alert alert-warn"><?php echo _t ('update_long'); ?></p> - - <div class="form-group form-actions"> - <div class="group-controls"> - <input type="hidden" name="updateDatabase" value="1" /> - <button type="submit" class="btn btn-important"><?php echo _t ('update_start'); ?></button> - </div> - </div> - - <?php } else { ?> - <p class="alert alert-warn"><?php echo _t ('update_end'); ?></p> - - <div class="form-group form-actions"> - <div class="group-controls"> - <a class="btn btn-important next-step" href="?step=5"><?php echo _t ('next_step'); ?></a> - </div> - </div> - <?php } ?> - </form> -<?php -} - -function printStep5 () { -?> - <p class="alert alert-success"><span class="alert-head"><?php echo _t ('congratulations'); ?></span> <?php echo _t ('installation_is_ok'); ?></p> - <a class="btn btn-important next-step" href="?step=6"><?php echo _t ('finish_installation'); ?></a> -<?php -} - -function printStep6 () { -?> - <p class="alert alert-error"><span class="alert-head"><?php echo _t ('oops'); ?></span> <?php echo _t ('install_not_deleted', INDEX_PATH . '/install.php'); ?></p> -<?php -} - -checkStep (); - -initTranslate (); - -switch (STEP) { -case 0: -default: - saveLanguage (); - break; -case 1: - break; -case 2: - saveStep2 (); - break; -case 3: - saveStep3 (); - break; -case 4: - if (!empty($_POST['updateDatabase'])) { - updateDatabase(true); - } - break; -case 5: - postUpdate(); - break; -case 6: - deleteInstall (); - break; -} -?> -<!DOCTYPE html> -<html lang="fr"> - <head> - <meta charset="utf-8"> - <meta name="viewport" content="initial-scale=1.0"> - <title><?php echo _t ('freshrss_installation'); ?></title> - <link rel="stylesheet" type="text/css" media="all" href="../themes/Origine/global.css" /> - <link rel="stylesheet" type="text/css" media="all" href="../themes/Origine/freshrss.css" /> - </head> - <body> - -<div class="header"> - <div class="item title"> - <h1><a href="index.php"><?php echo _t ('freshrss'); ?></a></h1> - <h2><?php echo _t ('installation_step', STEP); ?></h2> - </div> -</div> - -<div id="global"> - <ul class="nav nav-list aside"> - <li class="nav-header"><?php echo _t ('steps'); ?></li> - <li class="item<?php echo STEP == 0 ? ' active' : ''; ?>"><a href="?step=0"><?php echo _t ('language'); ?></a></li> - <li class="item<?php echo STEP == 1 ? ' active' : ''; ?>"><a href="?step=1"><?php echo _t ('checks'); ?></a></li> - <li class="item<?php echo STEP == 2 ? ' active' : ''; ?>"><a href="?step=2"><?php echo _t ('general_configuration'); ?></a></li> - <li class="item<?php echo STEP == 3 ? ' active' : ''; ?>"><a href="?step=3"><?php echo _t ('bdd_configuration'); ?></a></li> - <li class="item<?php echo STEP == 4 ? ' active' : ''; ?>"><a href="?step=4"><?php echo _t ('version_update'); ?></a></li> - <li class="item<?php echo STEP == 5 ? ' active' : ''; ?>"><a href="?step=5"><?php echo _t ('this_is_the_end'); ?></a></li> - </ul> - - <div class="post"> - <?php - switch (STEP) { - case 0: - default: - printStep0 (); - break; - case 1: - printStep1 (); - break; - case 2: - printStep2 (); - break; - case 3: - printStep3 (); - break; - case 4: - printStep4 (); - break; - case 5: - printStep5 (); - break; - case 6: - printStep6 (); - break; - } - ?> - </div> -</div> - </body> -</html> diff --git a/p/scripts/jquery.lazyload.min.js b/p/scripts/jquery.lazyload.min.js deleted file mode 100644 index 8dd097dc3..000000000 --- a/p/scripts/jquery.lazyload.min.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Lazy Load - jQuery plugin for lazy loading images - * - * Copyright (c) 2007-2013 Mika Tuupola - * - * Licensed under the MIT license: - * http://www.opensource.org/licenses/mit-license.php - * - * Project home: - * http://www.appelsiini.net/projects/lazyload - * - * Version: 1.9.0 - * - */ -!function(a,b,c,d){var e=a(b);a.fn.lazyload=function(f){function g(){var b=0;i.each(function(){var c=a(this);if(!j.skip_invisible||c.is(":visible"))if(a.abovethetop(this,j)||a.leftofbegin(this,j));else if(a.belowthefold(this,j)||a.rightoffold(this,j)){if(++b>j.failure_limit)return!1}else c.trigger("appear"),b=0})}var h,i=this,j={threshold:0,failure_limit:0,event:"scroll",effect:"show",container:b,data_attribute:"original",skip_invisible:!0,appear:null,load:null,placeholder:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC"};return f&&(d!==f.failurelimit&&(f.failure_limit=f.failurelimit,delete f.failurelimit),d!==f.effectspeed&&(f.effect_speed=f.effectspeed,delete f.effectspeed),a.extend(j,f)),h=j.container===d||j.container===b?e:a(j.container),0===j.event.indexOf("scroll")&&h.bind(j.event,function(){return g()}),this.each(function(){var b=this,c=a(b);b.loaded=!1,(c.attr("src")===d||c.attr("src")===!1)&&c.attr("src",j.placeholder),c.one("appear",function(){if(!this.loaded){if(j.appear){var d=i.length;j.appear.call(b,d,j)}a("<img />").bind("load",function(){var d=c.data(j.data_attribute);c.hide(),c.is("img")?c.attr("src",d):c.css("background-image","url('"+d+"')"),c[j.effect](j.effect_speed),b.loaded=!0;var e=a.grep(i,function(a){return!a.loaded});if(i=a(e),j.load){var f=i.length;j.load.call(b,f,j)}}).attr("src",c.data(j.data_attribute))}}),0!==j.event.indexOf("scroll")&&c.bind(j.event,function(){b.loaded||c.trigger("appear")})}),e.bind("resize",function(){g()}),/iphone|ipod|ipad.*os 5/gi.test(navigator.appVersion)&&e.bind("pageshow",function(b){b.originalEvent&&b.originalEvent.persisted&&i.each(function(){a(this).trigger("appear")})}),a(c).ready(function(){g()}),this},a.belowthefold=function(c,f){var g;return g=f.container===d||f.container===b?(b.innerHeight?b.innerHeight:e.height())+e.scrollTop():a(f.container).offset().top+a(f.container).height(),g<=a(c).offset().top-f.threshold},a.rightoffold=function(c,f){var g;return g=f.container===d||f.container===b?e.width()+e.scrollLeft():a(f.container).offset().left+a(f.container).width(),g<=a(c).offset().left-f.threshold},a.abovethetop=function(c,f){var g;return g=f.container===d||f.container===b?e.scrollTop():a(f.container).offset().top,g>=a(c).offset().top+f.threshold+a(c).height()},a.leftofbegin=function(c,f){var g;return g=f.container===d||f.container===b?e.scrollLeft():a(f.container).offset().left,g>=a(c).offset().left+f.threshold+a(c).width()},a.inviewport=function(b,c){return!(a.rightoffold(b,c)||a.leftofbegin(b,c)||a.belowthefold(b,c)||a.abovethetop(b,c))},a.extend(a.expr[":"],{"below-the-fold":function(b){return a.belowthefold(b,{threshold:0})},"above-the-top":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-screen":function(b){return a.rightoffold(b,{threshold:0})},"left-of-screen":function(b){return!a.rightoffold(b,{threshold:0})},"in-viewport":function(b){return a.inviewport(b,{threshold:0})},"above-the-fold":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-fold":function(b){return a.rightoffold(b,{threshold:0})},"left-of-fold":function(b){return!a.rightoffold(b,{threshold:0})}})}(jQuery,window,document);
\ No newline at end of file diff --git a/p/scripts/jquery.min.js b/p/scripts/jquery.min.js index cbe6abe59..e5ace116b 100644 --- a/p/scripts/jquery.min.js +++ b/p/scripts/jquery.min.js @@ -1,4 +1,4 @@ -/*! jQuery v2.1.0 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ -!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k="".trim,l={},m=a.document,n="2.1.0",o=function(a,b){return new o.fn.init(a,b)},p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};o.fn=o.prototype={jquery:n,constructor:o,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=o.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return o.each(this,a,b)},map:function(a){return this.pushStack(o.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},o.extend=o.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||o.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(o.isPlainObject(d)||(e=o.isArray(d)))?(e?(e=!1,f=c&&o.isArray(c)?c:[]):f=c&&o.isPlainObject(c)?c:{},g[b]=o.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},o.extend({expando:"jQuery"+(n+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===o.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return a-parseFloat(a)>=0},isPlainObject:function(a){if("object"!==o.type(a)||a.nodeType||o.isWindow(a))return!1;try{if(a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(b){return!1}return!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=o.trim(a),a&&(1===a.indexOf("use strict")?(b=m.createElement("script"),b.text=a,m.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":k.call(a)},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?o.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),o.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||o.guid++,f):void 0},now:Date.now,support:l}),o.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=o.type(a);return"function"===c||o.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s="sizzle"+-new Date,t=a.document,u=0,v=0,w=eb(),x=eb(),y=eb(),z=function(a,b){return a===b&&(j=!0),0},A="undefined",B=1<<31,C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=D.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",M=L.replace("w","w#"),N="\\["+K+"*("+L+")"+K+"*(?:([*^$|!~]?=)"+K+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+M+")|)|)"+K+"*\\]",O=":("+L+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+N.replace(3,8)+")*)|.*)\\)|)",P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(O),U=new RegExp("^"+M+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L.replace("w","w*")+")"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=/'|\\/g,ab=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),bb=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{G.apply(D=H.call(t.childNodes),t.childNodes),D[t.childNodes.length].nodeType}catch(cb){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function db(a,b,d,e){var f,g,h,i,j,m,p,q,u,v;if((b?b.ownerDocument||b:t)!==l&&k(b),b=b||l,d=d||[],!a||"string"!=typeof a)return d;if(1!==(i=b.nodeType)&&9!==i)return[];if(n&&!e){if(f=Z.exec(a))if(h=f[1]){if(9===i){if(g=b.getElementById(h),!g||!g.parentNode)return d;if(g.id===h)return d.push(g),d}else if(b.ownerDocument&&(g=b.ownerDocument.getElementById(h))&&r(b,g)&&g.id===h)return d.push(g),d}else{if(f[2])return G.apply(d,b.getElementsByTagName(a)),d;if((h=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(h)),d}if(c.qsa&&(!o||!o.test(a))){if(q=p=s,u=b,v=9===i&&a,1===i&&"object"!==b.nodeName.toLowerCase()){m=ob(a),(p=b.getAttribute("id"))?q=p.replace(_,"\\$&"):b.setAttribute("id",q),q="[id='"+q+"'] ",j=m.length;while(j--)m[j]=q+pb(m[j]);u=$.test(a)&&mb(b.parentNode)||b,v=m.join(",")}if(v)try{return G.apply(d,u.querySelectorAll(v)),d}catch(w){}finally{p||b.removeAttribute("id")}}}return xb(a.replace(P,"$1"),b,d,e)}function eb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function fb(a){return a[s]=!0,a}function gb(a){var b=l.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function hb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function ib(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||B)-(~a.sourceIndex||B);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function jb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function kb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function lb(a){return fb(function(b){return b=+b,fb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function mb(a){return a&&typeof a.getElementsByTagName!==A&&a}c=db.support={},f=db.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},k=db.setDocument=function(a){var b,e=a?a.ownerDocument||a:t,g=e.defaultView;return e!==l&&9===e.nodeType&&e.documentElement?(l=e,m=e.documentElement,n=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){k()},!1):g.attachEvent&&g.attachEvent("onunload",function(){k()})),c.attributes=gb(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=gb(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(e.getElementsByClassName)&&gb(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=gb(function(a){return m.appendChild(a).id=s,!e.getElementsByName||!e.getElementsByName(s).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==A&&n){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){var c=typeof a.getAttributeNode!==A&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==A?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==A&&n?b.getElementsByClassName(a):void 0},p=[],o=[],(c.qsa=Y.test(e.querySelectorAll))&&(gb(function(a){a.innerHTML="<select t=''><option selected=''></option></select>",a.querySelectorAll("[t^='']").length&&o.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||o.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll(":checked").length||o.push(":checked")}),gb(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&o.push("name"+K+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||o.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),o.push(",.*:")})),(c.matchesSelector=Y.test(q=m.webkitMatchesSelector||m.mozMatchesSelector||m.oMatchesSelector||m.msMatchesSelector))&&gb(function(a){c.disconnectedMatch=q.call(a,"div"),q.call(a,"[s!='']:x"),p.push("!=",O)}),o=o.length&&new RegExp(o.join("|")),p=p.length&&new RegExp(p.join("|")),b=Y.test(m.compareDocumentPosition),r=b||Y.test(m.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},z=b?function(a,b){if(a===b)return j=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===t&&r(t,a)?-1:b===e||b.ownerDocument===t&&r(t,b)?1:i?I.call(i,a)-I.call(i,b):0:4&d?-1:1)}:function(a,b){if(a===b)return j=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],k=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:i?I.call(i,a)-I.call(i,b):0;if(f===g)return ib(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)k.unshift(c);while(h[d]===k[d])d++;return d?ib(h[d],k[d]):h[d]===t?-1:k[d]===t?1:0},e):l},db.matches=function(a,b){return db(a,null,null,b)},db.matchesSelector=function(a,b){if((a.ownerDocument||a)!==l&&k(a),b=b.replace(S,"='$1']"),!(!c.matchesSelector||!n||p&&p.test(b)||o&&o.test(b)))try{var d=q.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return db(b,l,null,[a]).length>0},db.contains=function(a,b){return(a.ownerDocument||a)!==l&&k(a),r(a,b)},db.attr=function(a,b){(a.ownerDocument||a)!==l&&k(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!n):void 0;return void 0!==f?f:c.attributes||!n?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},db.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},db.uniqueSort=function(a){var b,d=[],e=0,f=0;if(j=!c.detectDuplicates,i=!c.sortStable&&a.slice(0),a.sort(z),j){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return i=null,a},e=db.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=db.selectors={cacheLength:50,createPseudo:fb,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ab,bb),a[3]=(a[4]||a[5]||"").replace(ab,bb),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||db.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&db.error(a[0]),a},PSEUDO:function(a){var b,c=!a[5]&&a[2];return V.CHILD.test(a[0])?null:(a[3]&&void 0!==a[4]?a[2]=a[4]:c&&T.test(c)&&(b=ob(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ab,bb).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=w[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&w(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==A&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=db.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),t=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&t){k=q[s]||(q[s]={}),j=k[a]||[],n=j[0]===u&&j[1],m=j[0]===u&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[u,n,m];break}}else if(t&&(j=(b[s]||(b[s]={}))[a])&&j[0]===u)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(t&&((l[s]||(l[s]={}))[a]=[u,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||db.error("unsupported pseudo: "+a);return e[s]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?fb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:fb(function(a){var b=[],c=[],d=g(a.replace(P,"$1"));return d[s]?fb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:fb(function(a){return function(b){return db(a,b).length>0}}),contains:fb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:fb(function(a){return U.test(a||"")||db.error("unsupported lang: "+a),a=a.replace(ab,bb).toLowerCase(),function(b){var c;do if(c=n?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===m},focus:function(a){return a===l.activeElement&&(!l.hasFocus||l.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:lb(function(){return[0]}),last:lb(function(a,b){return[b-1]}),eq:lb(function(a,b,c){return[0>c?c+b:c]}),even:lb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:lb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:lb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:lb(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=jb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=kb(b);function nb(){}nb.prototype=d.filters=d.pseudos,d.setFilters=new nb;function ob(a,b){var c,e,f,g,h,i,j,k=x[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=Q.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=R.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(P," ")}),h=h.slice(c.length));for(g in d.filter)!(e=V[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?db.error(a):x(a,i).slice(0)}function pb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function qb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=v++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[u,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[s]||(b[s]={}),(h=i[d])&&h[0]===u&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function rb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function sb(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function tb(a,b,c,d,e,f){return d&&!d[s]&&(d=tb(d)),e&&!e[s]&&(e=tb(e,f)),fb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||wb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:sb(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=sb(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?I.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=sb(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ub(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],i=g||d.relative[" "],j=g?1:0,k=qb(function(a){return a===b},i,!0),l=qb(function(a){return I.call(b,a)>-1},i,!0),m=[function(a,c,d){return!g&&(d||c!==h)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>j;j++)if(c=d.relative[a[j].type])m=[qb(rb(m),c)];else{if(c=d.filter[a[j].type].apply(null,a[j].matches),c[s]){for(e=++j;f>e;e++)if(d.relative[a[e].type])break;return tb(j>1&&rb(m),j>1&&pb(a.slice(0,j-1).concat({value:" "===a[j-2].type?"*":""})).replace(P,"$1"),c,e>j&&ub(a.slice(j,e)),f>e&&ub(a=a.slice(e)),f>e&&pb(a))}m.push(c)}return rb(m)}function vb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,i,j,k){var m,n,o,p=0,q="0",r=f&&[],s=[],t=h,v=f||e&&d.find.TAG("*",k),w=u+=null==t?1:Math.random()||.1,x=v.length;for(k&&(h=g!==l&&g);q!==x&&null!=(m=v[q]);q++){if(e&&m){n=0;while(o=a[n++])if(o(m,g,i)){j.push(m);break}k&&(u=w)}c&&((m=!o&&m)&&p--,f&&r.push(m))}if(p+=q,c&&q!==p){n=0;while(o=b[n++])o(r,s,g,i);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=E.call(j));s=sb(s)}G.apply(j,s),k&&!f&&s.length>0&&p+b.length>1&&db.uniqueSort(j)}return k&&(u=w,h=t),r};return c?fb(f):f}g=db.compile=function(a,b){var c,d=[],e=[],f=y[a+" "];if(!f){b||(b=ob(a)),c=b.length;while(c--)f=ub(b[c]),f[s]?d.push(f):e.push(f);f=y(a,vb(e,d))}return f};function wb(a,b,c){for(var d=0,e=b.length;e>d;d++)db(a,b[d],c);return c}function xb(a,b,e,f){var h,i,j,k,l,m=ob(a);if(!f&&1===m.length){if(i=m[0]=m[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&c.getById&&9===b.nodeType&&n&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(ab,bb),b)||[])[0],!b)return e;a=a.slice(i.shift().value.length)}h=V.needsContext.test(a)?0:i.length;while(h--){if(j=i[h],d.relative[k=j.type])break;if((l=d.find[k])&&(f=l(j.matches[0].replace(ab,bb),$.test(i[0].type)&&mb(b.parentNode)||b))){if(i.splice(h,1),a=f.length&&pb(i),!a)return G.apply(e,f),e;break}}}return g(a,m)(f,b,!n,e,$.test(a)&&mb(b.parentNode)||b),e}return c.sortStable=s.split("").sort(z).join("")===s,c.detectDuplicates=!!j,k(),c.sortDetached=gb(function(a){return 1&a.compareDocumentPosition(l.createElement("div"))}),gb(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||hb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&gb(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||hb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),gb(function(a){return null==a.getAttribute("disabled")})||hb(J,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),db}(a);o.find=t,o.expr=t.selectors,o.expr[":"]=o.expr.pseudos,o.unique=t.uniqueSort,o.text=t.getText,o.isXMLDoc=t.isXML,o.contains=t.contains;var u=o.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(o.isFunction(b))return o.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return o.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return o.filter(b,a,c);b=o.filter(b,a)}return o.grep(a,function(a){return g.call(b,a)>=0!==c})}o.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?o.find.matchesSelector(d,a)?[d]:[]:o.find.matches(a,o.grep(b,function(a){return 1===a.nodeType}))},o.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(o(a).filter(function(){for(b=0;c>b;b++)if(o.contains(e[b],this))return!0}));for(b=0;c>b;b++)o.find(a,e[b],d);return d=this.pushStack(c>1?o.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?o(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=o.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof o?b[0]:b,o.merge(this,o.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:m,!0)),v.test(c[1])&&o.isPlainObject(b))for(c in b)o.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=m.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=m,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):o.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(o):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),o.makeArray(a,this))};A.prototype=o.fn,y=o(m);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};o.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&o(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),o.fn.extend({has:function(a){var b=o(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(o.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?o(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&o.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?o.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(o(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(o.unique(o.merge(this.get(),o(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}o.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return o.dir(a,"parentNode")},parentsUntil:function(a,b,c){return o.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return o.dir(a,"nextSibling")},prevAll:function(a){return o.dir(a,"previousSibling")},nextUntil:function(a,b,c){return o.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return o.dir(a,"previousSibling",c)},siblings:function(a){return o.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return o.sibling(a.firstChild)},contents:function(a){return a.contentDocument||o.merge([],a.childNodes)}},function(a,b){o.fn[a]=function(c,d){var e=o.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=o.filter(d,e)),this.length>1&&(C[a]||o.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return o.each(a.match(E)||[],function(a,c){b[c]=!0}),b}o.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):o.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){o.each(b,function(b,c){var d=o.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&o.each(arguments,function(a,b){var c;while((c=o.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?o.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},o.extend({Deferred:function(a){var b=[["resolve","done",o.Callbacks("once memory"),"resolved"],["reject","fail",o.Callbacks("once memory"),"rejected"],["notify","progress",o.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return o.Deferred(function(c){o.each(b,function(b,f){var g=o.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&o.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?o.extend(a,d):d}},e={};return d.pipe=d.then,o.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&o.isFunction(a.promise)?e:0,g=1===f?a:o.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&o.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;o.fn.ready=function(a){return o.ready.promise().done(a),this},o.extend({isReady:!1,readyWait:1,holdReady:function(a){a?o.readyWait++:o.ready(!0)},ready:function(a){(a===!0?--o.readyWait:o.isReady)||(o.isReady=!0,a!==!0&&--o.readyWait>0||(H.resolveWith(m,[o]),o.fn.trigger&&o(m).trigger("ready").off("ready")))}});function I(){m.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),o.ready()}o.ready.promise=function(b){return H||(H=o.Deferred(),"complete"===m.readyState?setTimeout(o.ready):(m.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},o.ready.promise();var J=o.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===o.type(c)){e=!0;for(h in c)o.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,o.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(o(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};o.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=o.expando+Math.random()}K.uid=1,K.accepts=o.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,o.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(o.isEmptyObject(f))o.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,o.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{o.isArray(b)?d=b.concat(b.map(o.camelCase)):(e=o.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!o.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?o.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}o.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b)},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),o.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length; -while(c--)d=g[c].name,0===d.indexOf("data-")&&(d=o.camelCase(d.slice(5)),P(f,d,e[d]));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=o.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),o.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||o.isArray(c)?d=L.access(a,b,o.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=o.queue(a,b),d=c.length,e=c.shift(),f=o._queueHooks(a,b),g=function(){o.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:o.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),o.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?o.queue(this[0],a):void 0===b?this:this.each(function(){var c=o.queue(this,a,b);o._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&o.dequeue(this,a)})},dequeue:function(a){return this.each(function(){o.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=o.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=L.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var Q=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,R=["Top","Right","Bottom","Left"],S=function(a,b){return a=b||a,"none"===o.css(a,"display")||!o.contains(a.ownerDocument,a)},T=/^(?:checkbox|radio)$/i;!function(){var a=m.createDocumentFragment(),b=a.appendChild(m.createElement("div"));b.innerHTML="<input type='radio' checked='checked' name='t'/>",l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";l.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return m.activeElement}catch(a){}}o.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=o.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof o!==U&&o.event.triggered!==b.type?o.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],n=q=h[1],p=(h[2]||"").split(".").sort(),n&&(l=o.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=o.event.special[n]||{},k=o.extend({type:n,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&o.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(n,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),o.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],n=q=h[1],p=(h[2]||"").split(".").sort(),n){l=o.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||o.removeEvent(a,n,r.handle),delete i[n])}else for(n in i)o.event.remove(a,n+b[j],c,d,!0);o.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,p=[d||m],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||m,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+o.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[o.expando]?b:new o.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:o.makeArray(c,[b]),n=o.event.special[q]||{},e||!n.trigger||n.trigger.apply(d,c)!==!1)){if(!e&&!n.noBubble&&!o.isWindow(d)){for(i=n.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||m)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:n.bindType||q,l=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),l&&l.apply(g,c),l=k&&g[k],l&&l.apply&&o.acceptData(g)&&(b.result=l.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||n._default&&n._default.apply(p.pop(),c)!==!1||!o.acceptData(d)||k&&o.isFunction(d[q])&&!o.isWindow(d)&&(h=d[k],h&&(d[k]=null),o.event.triggered=q,d[q](),o.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=o.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=o.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=o.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((o.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?o(e,this).index(i)>=0:o.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||m,d=c.documentElement,e=c.body,a.pageX=b.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0),a.pageY=b.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},fix:function(a){if(a[o.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=W.test(e)?this.mouseHooks:V.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new o.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=m),3===a.target.nodeType&&(a.target=a.target.parentNode),g.filter?g.filter(a,f):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==_()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===_()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&o.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return o.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=o.extend(new o.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?o.event.trigger(e,null,b):o.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},o.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)},o.Event=function(a,b){return this instanceof o.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.getPreventDefault&&a.getPreventDefault()?Z:$):this.type=a,b&&o.extend(this,b),this.timeStamp=a&&a.timeStamp||o.now(),void(this[o.expando]=!0)):new o.Event(a,b)},o.Event.prototype={isDefaultPrevented:$,isPropagationStopped:$,isImmediatePropagationStopped:$,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=Z,a&&a.preventDefault&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=Z,a&&a.stopPropagation&&a.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z,this.stopPropagation()}},o.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){o.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!o.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),l.focusinBubbles||o.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){o.event.simulate(b,a.target,o.event.fix(a),!0)};o.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=L.access(d,b);e||d.addEventListener(a,c,!0),L.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=L.access(d,b)-1;e?L.access(d,b,e):(d.removeEventListener(a,c,!0),L.remove(d,b))}}}),o.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(g in a)this.on(g,b,c,a[g],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=$;else if(!d)return this;return 1===e&&(f=d,d=function(a){return o().off(a),f.apply(this,arguments)},d.guid=f.guid||(f.guid=o.guid++)),this.each(function(){o.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,o(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=$),this.each(function(){o.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){o.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?o.event.trigger(a,b,c,!0):void 0}});var ab=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bb=/<([\w:]+)/,cb=/<|&#?\w+;/,db=/<(?:script|style|link)/i,eb=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/^$|\/(?:java|ecma)script/i,gb=/^true\/(.*)/,hb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ib={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ib.optgroup=ib.option,ib.tbody=ib.tfoot=ib.colgroup=ib.caption=ib.thead,ib.th=ib.td;function jb(a,b){return o.nodeName(a,"table")&&o.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function kb(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function lb(a){var b=gb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function mb(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function nb(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)o.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=o.extend({},h),M.set(b,i))}}function ob(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&o.nodeName(a,b)?o.merge([a],c):c}function pb(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}o.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=o.contains(a.ownerDocument,a);if(!(l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||o.isXMLDoc(a)))for(g=ob(h),f=ob(a),d=0,e=f.length;e>d;d++)pb(f[d],g[d]);if(b)if(c)for(f=f||ob(a),g=g||ob(h),d=0,e=f.length;e>d;d++)nb(f[d],g[d]);else nb(a,h);return g=ob(h,"script"),g.length>0&&mb(g,!i&&ob(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,n=a.length;n>m;m++)if(e=a[m],e||0===e)if("object"===o.type(e))o.merge(l,e.nodeType?[e]:e);else if(cb.test(e)){f=f||k.appendChild(b.createElement("div")),g=(bb.exec(e)||["",""])[1].toLowerCase(),h=ib[g]||ib._default,f.innerHTML=h[1]+e.replace(ab,"<$1></$2>")+h[2],j=h[0];while(j--)f=f.lastChild;o.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===o.inArray(e,d))&&(i=o.contains(e.ownerDocument,e),f=ob(k.appendChild(e),"script"),i&&mb(f),c)){j=0;while(e=f[j++])fb.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f,g,h=o.event.special,i=0;void 0!==(c=a[i]);i++){if(o.acceptData(c)&&(f=c[L.expando],f&&(b=L.cache[f]))){if(d=Object.keys(b.events||{}),d.length)for(g=0;void 0!==(e=d[g]);g++)h[e]?o.event.remove(c,e):o.removeEvent(c,e,b.handle);L.cache[f]&&delete L.cache[f]}delete M.cache[c[M.expando]]}}}),o.fn.extend({text:function(a){return J(this,function(a){return void 0===a?o.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?o.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||o.cleanData(ob(c)),c.parentNode&&(b&&o.contains(c.ownerDocument,c)&&mb(ob(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(o.cleanData(ob(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return o.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!db.test(a)&&!ib[(bb.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(ab,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(o.cleanData(ob(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,o.cleanData(ob(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,k=this.length,m=this,n=k-1,p=a[0],q=o.isFunction(p);if(q||k>1&&"string"==typeof p&&!l.checkClone&&eb.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(k&&(c=o.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=o.map(ob(c,"script"),kb),g=f.length;k>j;j++)h=c,j!==n&&(h=o.clone(h,!0,!0),g&&o.merge(f,ob(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,o.map(f,lb),j=0;g>j;j++)h=f[j],fb.test(h.type||"")&&!L.access(h,"globalEval")&&o.contains(i,h)&&(h.src?o._evalUrl&&o._evalUrl(h.src):o.globalEval(h.textContent.replace(hb,"")))}return this}}),o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){o.fn[a]=function(a){for(var c,d=[],e=o(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),o(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qb,rb={};function sb(b,c){var d=o(c.createElement(b)).appendTo(c.body),e=a.getDefaultComputedStyle?a.getDefaultComputedStyle(d[0]).display:o.css(d[0],"display");return d.detach(),e}function tb(a){var b=m,c=rb[a];return c||(c=sb(a,b),"none"!==c&&c||(qb=(qb||o("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=qb[0].contentDocument,b.write(),b.close(),c=sb(a,b),qb.detach()),rb[a]=c),c}var ub=/^margin/,vb=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),wb=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)};function xb(a,b,c){var d,e,f,g,h=a.style;return c=c||wb(a),c&&(g=c.getPropertyValue(b)||c[b]),c&&(""!==g||o.contains(a.ownerDocument,a)||(g=o.style(a,b)),vb.test(g)&&ub.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function yb(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d="padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box",e=m.documentElement,f=m.createElement("div"),g=m.createElement("div");g.style.backgroundClip="content-box",g.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===g.style.backgroundClip,f.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",f.appendChild(g);function h(){g.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%",e.appendChild(f);var d=a.getComputedStyle(g,null);b="1%"!==d.top,c="4px"===d.width,e.removeChild(f)}a.getComputedStyle&&o.extend(l,{pixelPosition:function(){return h(),b},boxSizingReliable:function(){return null==c&&h(),c},reliableMarginRight:function(){var b,c=g.appendChild(m.createElement("div"));return c.style.cssText=g.style.cssText=d,c.style.marginRight=c.style.width="0",g.style.width="1px",e.appendChild(f),b=!parseFloat(a.getComputedStyle(c,null).marginRight),e.removeChild(f),g.innerHTML="",b}})}(),o.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var zb=/^(none|table(?!-c[ea]).+)/,Ab=new RegExp("^("+Q+")(.*)$","i"),Bb=new RegExp("^([+-])=("+Q+")","i"),Cb={position:"absolute",visibility:"hidden",display:"block"},Db={letterSpacing:0,fontWeight:400},Eb=["Webkit","O","Moz","ms"];function Fb(a,b){if(b in a)return b;var c=b[0].toUpperCase()+b.slice(1),d=b,e=Eb.length;while(e--)if(b=Eb[e]+c,b in a)return b;return d}function Gb(a,b,c){var d=Ab.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Hb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=o.css(a,c+R[f],!0,e)),d?("content"===c&&(g-=o.css(a,"padding"+R[f],!0,e)),"margin"!==c&&(g-=o.css(a,"border"+R[f]+"Width",!0,e))):(g+=o.css(a,"padding"+R[f],!0,e),"padding"!==c&&(g+=o.css(a,"border"+R[f]+"Width",!0,e)));return g}function Ib(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=wb(a),g="border-box"===o.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=xb(a,b,f),(0>e||null==e)&&(e=a.style[b]),vb.test(e))return e;d=g&&(l.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Hb(a,b,c||(g?"border":"content"),d,f)+"px"}function Jb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=L.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&S(d)&&(f[g]=L.access(d,"olddisplay",tb(d.nodeName)))):f[g]||(e=S(d),(c&&"none"!==c||!e)&&L.set(d,"olddisplay",e?c:o.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}o.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=xb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=o.camelCase(b),i=a.style;return b=o.cssProps[h]||(o.cssProps[h]=Fb(i,h)),g=o.cssHooks[b]||o.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=Bb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(o.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||o.cssNumber[h]||(c+="px"),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]="",i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=o.camelCase(b);return b=o.cssProps[h]||(o.cssProps[h]=Fb(a.style,h)),g=o.cssHooks[b]||o.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=xb(a,b,d)),"normal"===e&&b in Db&&(e=Db[b]),""===c||c?(f=parseFloat(e),c===!0||o.isNumeric(f)?f||0:e):e}}),o.each(["height","width"],function(a,b){o.cssHooks[b]={get:function(a,c,d){return c?0===a.offsetWidth&&zb.test(o.css(a,"display"))?o.swap(a,Cb,function(){return Ib(a,b,d)}):Ib(a,b,d):void 0},set:function(a,c,d){var e=d&&wb(a);return Gb(a,c,d?Hb(a,b,d,"border-box"===o.css(a,"boxSizing",!1,e),e):0)}}}),o.cssHooks.marginRight=yb(l.reliableMarginRight,function(a,b){return b?o.swap(a,{display:"inline-block"},xb,[a,"marginRight"]):void 0}),o.each({margin:"",padding:"",border:"Width"},function(a,b){o.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+R[d]+b]=f[d]||f[d-2]||f[0];return e}},ub.test(a)||(o.cssHooks[a+b].set=Gb)}),o.fn.extend({css:function(a,b){return J(this,function(a,b,c){var d,e,f={},g=0;if(o.isArray(b)){for(d=wb(a),e=b.length;e>g;g++)f[b[g]]=o.css(a,b[g],!1,d);return f}return void 0!==c?o.style(a,b,c):o.css(a,b)},a,b,arguments.length>1)},show:function(){return Jb(this,!0)},hide:function(){return Jb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){S(this)?o(this).show():o(this).hide()})}});function Kb(a,b,c,d,e){return new Kb.prototype.init(a,b,c,d,e)}o.Tween=Kb,Kb.prototype={constructor:Kb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(o.cssNumber[c]?"":"px")},cur:function(){var a=Kb.propHooks[this.prop];return a&&a.get?a.get(this):Kb.propHooks._default.get(this)},run:function(a){var b,c=Kb.propHooks[this.prop];return this.pos=b=this.options.duration?o.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Kb.propHooks._default.set(this),this}},Kb.prototype.init.prototype=Kb.prototype,Kb.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=o.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){o.fx.step[a.prop]?o.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[o.cssProps[a.prop]]||o.cssHooks[a.prop])?o.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Kb.propHooks.scrollTop=Kb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},o.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},o.fx=Kb.prototype.init,o.fx.step={};var Lb,Mb,Nb=/^(?:toggle|show|hide)$/,Ob=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),Pb=/queueHooks$/,Qb=[Vb],Rb={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=Ob.exec(b),f=e&&e[3]||(o.cssNumber[a]?"":"px"),g=(o.cssNumber[a]||"px"!==f&&+d)&&Ob.exec(o.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,o.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function Sb(){return setTimeout(function(){Lb=void 0}),Lb=o.now()}function Tb(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=R[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ub(a,b,c){for(var d,e=(Rb[b]||[]).concat(Rb["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Vb(a,b,c){var d,e,f,g,h,i,j,k=this,l={},m=a.style,n=a.nodeType&&S(a),p=L.get(a,"fxshow");c.queue||(h=o._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,k.always(function(){k.always(function(){h.unqueued--,o.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[m.overflow,m.overflowX,m.overflowY],j=o.css(a,"display"),"none"===j&&(j=tb(a.nodeName)),"inline"===j&&"none"===o.css(a,"float")&&(m.display="inline-block")),c.overflow&&(m.overflow="hidden",k.always(function(){m.overflow=c.overflow[0],m.overflowX=c.overflow[1],m.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],Nb.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(n?"hide":"show")){if("show"!==e||!p||void 0===p[d])continue;n=!0}l[d]=p&&p[d]||o.style(a,d)}if(!o.isEmptyObject(l)){p?"hidden"in p&&(n=p.hidden):p=L.access(a,"fxshow",{}),f&&(p.hidden=!n),n?o(a).show():k.done(function(){o(a).hide()}),k.done(function(){var b;L.remove(a,"fxshow");for(b in l)o.style(a,b,l[b])});for(d in l)g=Ub(n?p[d]:0,d,k),d in p||(p[d]=g.start,n&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function Wb(a,b){var c,d,e,f,g;for(c in a)if(d=o.camelCase(c),e=b[d],f=a[c],o.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=o.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function Xb(a,b,c){var d,e,f=0,g=Qb.length,h=o.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Lb||Sb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:o.extend({},b),opts:o.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:Lb||Sb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=o.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(Wb(k,j.opts.specialEasing);g>f;f++)if(d=Qb[f].call(j,a,k,j.opts))return d;return o.map(k,Ub,j),o.isFunction(j.opts.start)&&j.opts.start.call(a,j),o.fx.timer(o.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}o.Animation=o.extend(Xb,{tweener:function(a,b){o.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],Rb[c]=Rb[c]||[],Rb[c].unshift(b)},prefilter:function(a,b){b?Qb.unshift(a):Qb.push(a)}}),o.speed=function(a,b,c){var d=a&&"object"==typeof a?o.extend({},a):{complete:c||!c&&b||o.isFunction(a)&&a,duration:a,easing:c&&b||b&&!o.isFunction(b)&&b};return d.duration=o.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in o.fx.speeds?o.fx.speeds[d.duration]:o.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){o.isFunction(d.old)&&d.old.call(this),d.queue&&o.dequeue(this,d.queue)},d},o.fn.extend({fadeTo:function(a,b,c,d){return this.filter(S).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=o.isEmptyObject(a),f=o.speed(b,c,d),g=function(){var b=Xb(this,o.extend({},a),f);(e||L.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=o.timers,g=L.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Pb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&o.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=L.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=o.timers,g=d?d.length:0;for(c.finish=!0,o.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),o.each(["toggle","show","hide"],function(a,b){var c=o.fn[b];o.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(Tb(b,!0),a,d,e)}}),o.each({slideDown:Tb("show"),slideUp:Tb("hide"),slideToggle:Tb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){o.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),o.timers=[],o.fx.tick=function(){var a,b=0,c=o.timers;for(Lb=o.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||o.fx.stop(),Lb=void 0},o.fx.timer=function(a){o.timers.push(a),a()?o.fx.start():o.timers.pop()},o.fx.interval=13,o.fx.start=function(){Mb||(Mb=setInterval(o.fx.tick,o.fx.interval))},o.fx.stop=function(){clearInterval(Mb),Mb=null},o.fx.speeds={slow:600,fast:200,_default:400},o.fn.delay=function(a,b){return a=o.fx?o.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a=m.createElement("input"),b=m.createElement("select"),c=b.appendChild(m.createElement("option"));a.type="checkbox",l.checkOn=""!==a.value,l.optSelected=c.selected,b.disabled=!0,l.optDisabled=!c.disabled,a=m.createElement("input"),a.value="t",a.type="radio",l.radioValue="t"===a.value}();var Yb,Zb,$b=o.expr.attrHandle;o.fn.extend({attr:function(a,b){return J(this,o.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){o.removeAttr(this,a)})}}),o.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===U?o.prop(a,b,c):(1===f&&o.isXMLDoc(a)||(b=b.toLowerCase(),d=o.attrHooks[b]||(o.expr.match.bool.test(b)?Zb:Yb)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=o.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void o.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=o.propFix[c]||c,o.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&o.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),Zb={set:function(a,b,c){return b===!1?o.removeAttr(a,c):a.setAttribute(c,c),c}},o.each(o.expr.match.bool.source.match(/\w+/g),function(a,b){var c=$b[b]||o.find.attr;$b[b]=function(a,b,d){var e,f; -return d||(f=$b[b],$b[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,$b[b]=f),e}});var _b=/^(?:input|select|textarea|button)$/i;o.fn.extend({prop:function(a,b){return J(this,o.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[o.propFix[a]||a]})}}),o.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!o.isXMLDoc(a),f&&(b=o.propFix[b]||b,e=o.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){return a.hasAttribute("tabindex")||_b.test(a.nodeName)||a.href?a.tabIndex:-1}}}}),l.optSelected||(o.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null}}),o.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){o.propFix[this.toLowerCase()]=this});var ac=/[\t\r\n\f]/g;o.fn.extend({addClass:function(a){var b,c,d,e,f,g,h="string"==typeof a&&a,i=0,j=this.length;if(o.isFunction(a))return this.each(function(b){o(this).addClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ac," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=o.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0===arguments.length||"string"==typeof a&&a,i=0,j=this.length;if(o.isFunction(a))return this.each(function(b){o(this).removeClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ac," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?o.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(o.isFunction(a)?function(c){o(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=o(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===U||"boolean"===c)&&(this.className&&L.set(this,"__className__",this.className),this.className=this.className||a===!1?"":L.get(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(ac," ").indexOf(b)>=0)return!0;return!1}});var bc=/\r/g;o.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=o.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,o(this).val()):a,null==e?e="":"number"==typeof e?e+="":o.isArray(e)&&(e=o.map(e,function(a){return null==a?"":a+""})),b=o.valHooks[this.type]||o.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=o.valHooks[e.type]||o.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(bc,""):null==c?"":c)}}}),o.extend({valHooks:{select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(l.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&o.nodeName(c.parentNode,"optgroup"))){if(b=o(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=o.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=o.inArray(o(d).val(),f)>=0)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),o.each(["radio","checkbox"],function(){o.valHooks[this]={set:function(a,b){return o.isArray(b)?a.checked=o.inArray(o(a).val(),b)>=0:void 0}},l.checkOn||(o.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})}),o.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){o.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),o.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var cc=o.now(),dc=/\?/;o.parseJSON=function(a){return JSON.parse(a+"")},o.parseXML=function(a){var b,c;if(!a||"string"!=typeof a)return null;try{c=new DOMParser,b=c.parseFromString(a,"text/xml")}catch(d){b=void 0}return(!b||b.getElementsByTagName("parsererror").length)&&o.error("Invalid XML: "+a),b};var ec,fc,gc=/#.*$/,hc=/([?&])_=[^&]*/,ic=/^(.*?):[ \t]*([^\r\n]*)$/gm,jc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,kc=/^(?:GET|HEAD)$/,lc=/^\/\//,mc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,nc={},oc={},pc="*/".concat("*");try{fc=location.href}catch(qc){fc=m.createElement("a"),fc.href="",fc=fc.href}ec=mc.exec(fc.toLowerCase())||[];function rc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(o.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function sc(a,b,c,d){var e={},f=a===oc;function g(h){var i;return e[h]=!0,o.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function tc(a,b){var c,d,e=o.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&o.extend(!0,a,d),a}function uc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function vc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}o.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:fc,type:"GET",isLocal:jc.test(ec[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":pc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":o.parseJSON,"text xml":o.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?tc(tc(a,o.ajaxSettings),b):tc(o.ajaxSettings,a)},ajaxPrefilter:rc(nc),ajaxTransport:rc(oc),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=o.ajaxSetup({},b),l=k.context||k,m=k.context&&(l.nodeType||l.jquery)?o(l):o.event,n=o.Deferred(),p=o.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!f){f={};while(b=ic.exec(e))f[b[1].toLowerCase()]=b[2]}b=f[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?e:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return c&&c.abort(b),x(0,b),this}};if(n.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||fc)+"").replace(gc,"").replace(lc,ec[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=o.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(h=mc.exec(k.url.toLowerCase()),k.crossDomain=!(!h||h[1]===ec[1]&&h[2]===ec[2]&&(h[3]||("http:"===h[1]?"80":"443"))===(ec[3]||("http:"===ec[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=o.param(k.data,k.traditional)),sc(nc,k,b,v),2===t)return v;i=k.global,i&&0===o.active++&&o.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!kc.test(k.type),d=k.url,k.hasContent||(k.data&&(d=k.url+=(dc.test(d)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=hc.test(d)?d.replace(hc,"$1_="+cc++):d+(dc.test(d)?"&":"?")+"_="+cc++)),k.ifModified&&(o.lastModified[d]&&v.setRequestHeader("If-Modified-Since",o.lastModified[d]),o.etag[d]&&v.setRequestHeader("If-None-Match",o.etag[d])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+pc+"; q=0.01":""):k.accepts["*"]);for(j in k.headers)v.setRequestHeader(j,k.headers[j]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(j in{success:1,error:1,complete:1})v[j](k[j]);if(c=sc(oc,k,b,v)){v.readyState=1,i&&m.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,c.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,f,h){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),c=void 0,e=h||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,f&&(u=uc(k,v,f)),u=vc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(o.lastModified[d]=w),w=v.getResponseHeader("etag"),w&&(o.etag[d]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?n.resolveWith(l,[r,x,v]):n.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,i&&m.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),i&&(m.trigger("ajaxComplete",[v,k]),--o.active||o.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return o.get(a,b,c,"json")},getScript:function(a,b){return o.get(a,void 0,b,"script")}}),o.each(["get","post"],function(a,b){o[b]=function(a,c,d,e){return o.isFunction(c)&&(e=e||d,d=c,c=void 0),o.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),o.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){o.fn[b]=function(a){return this.on(b,a)}}),o._evalUrl=function(a){return o.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},o.fn.extend({wrapAll:function(a){var b;return o.isFunction(a)?this.each(function(b){o(this).wrapAll(a.call(this,b))}):(this[0]&&(b=o(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return this.each(o.isFunction(a)?function(b){o(this).wrapInner(a.call(this,b))}:function(){var b=o(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=o.isFunction(a);return this.each(function(c){o(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){o.nodeName(this,"body")||o(this).replaceWith(this.childNodes)}).end()}}),o.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0},o.expr.filters.visible=function(a){return!o.expr.filters.hidden(a)};var wc=/%20/g,xc=/\[\]$/,yc=/\r?\n/g,zc=/^(?:submit|button|image|reset|file)$/i,Ac=/^(?:input|select|textarea|keygen)/i;function Bc(a,b,c,d){var e;if(o.isArray(b))o.each(b,function(b,e){c||xc.test(a)?d(a,e):Bc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==o.type(b))d(a,b);else for(e in b)Bc(a+"["+e+"]",b[e],c,d)}o.param=function(a,b){var c,d=[],e=function(a,b){b=o.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=o.ajaxSettings&&o.ajaxSettings.traditional),o.isArray(a)||a.jquery&&!o.isPlainObject(a))o.each(a,function(){e(this.name,this.value)});else for(c in a)Bc(c,a[c],b,e);return d.join("&").replace(wc,"+")},o.fn.extend({serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=o.prop(this,"elements");return a?o.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!o(this).is(":disabled")&&Ac.test(this.nodeName)&&!zc.test(a)&&(this.checked||!T.test(a))}).map(function(a,b){var c=o(this).val();return null==c?null:o.isArray(c)?o.map(c,function(a){return{name:b.name,value:a.replace(yc,"\r\n")}}):{name:b.name,value:c.replace(yc,"\r\n")}}).get()}}),o.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(a){}};var Cc=0,Dc={},Ec={0:200,1223:204},Fc=o.ajaxSettings.xhr();a.ActiveXObject&&o(a).on("unload",function(){for(var a in Dc)Dc[a]()}),l.cors=!!Fc&&"withCredentials"in Fc,l.ajax=Fc=!!Fc,o.ajaxTransport(function(a){var b;return l.cors||Fc&&!a.crossDomain?{send:function(c,d){var e,f=a.xhr(),g=++Cc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)f.setRequestHeader(e,c[e]);b=function(a){return function(){b&&(delete Dc[g],b=f.onload=f.onerror=null,"abort"===a?f.abort():"error"===a?d(f.status,f.statusText):d(Ec[f.status]||f.status,f.statusText,"string"==typeof f.responseText?{text:f.responseText}:void 0,f.getAllResponseHeaders()))}},f.onload=b(),f.onerror=b("error"),b=Dc[g]=b("abort"),f.send(a.hasContent&&a.data||null)},abort:function(){b&&b()}}:void 0}),o.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return o.globalEval(a),a}}}),o.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),o.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(d,e){b=o("<script>").prop({async:!0,charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&e("error"===a.type?404:200,a.type)}),m.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Gc=[],Hc=/(=)\?(?=&|$)|\?\?/;o.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Gc.pop()||o.expando+"_"+cc++;return this[a]=!0,a}}),o.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Hc.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Hc.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=o.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Hc,"$1"+e):b.jsonp!==!1&&(b.url+=(dc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||o.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Gc.push(e)),g&&o.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),o.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||m;var d=v.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=o.buildFragment([a],b,e),e&&e.length&&o(e).remove(),o.merge([],d.childNodes))};var Ic=o.fn.load;o.fn.load=function(a,b,c){if("string"!=typeof a&&Ic)return Ic.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=a.slice(h),a=a.slice(0,h)),o.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&o.ajax({url:a,type:e,dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?o("<div>").append(o.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,f||[a.responseText,b,a])}),this},o.expr.filters.animated=function(a){return o.grep(o.timers,function(b){return a===b.elem}).length};var Jc=a.document.documentElement;function Kc(a){return o.isWindow(a)?a:9===a.nodeType&&a.defaultView}o.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=o.css(a,"position"),l=o(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=o.css(a,"top"),i=o.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),o.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},o.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){o.offset.setOffset(this,a,b)});var b,c,d=this[0],e={top:0,left:0},f=d&&d.ownerDocument;if(f)return b=f.documentElement,o.contains(b,d)?(typeof d.getBoundingClientRect!==U&&(e=d.getBoundingClientRect()),c=Kc(f),{top:e.top+c.pageYOffset-b.clientTop,left:e.left+c.pageXOffset-b.clientLeft}):e},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===o.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),o.nodeName(a[0],"html")||(d=a.offset()),d.top+=o.css(a[0],"borderTopWidth",!0),d.left+=o.css(a[0],"borderLeftWidth",!0)),{top:b.top-d.top-o.css(c,"marginTop",!0),left:b.left-d.left-o.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||Jc;while(a&&!o.nodeName(a,"html")&&"static"===o.css(a,"position"))a=a.offsetParent;return a||Jc})}}),o.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(b,c){var d="pageYOffset"===c;o.fn[b]=function(e){return J(this,function(b,e,f){var g=Kc(b);return void 0===f?g?g[c]:b[e]:void(g?g.scrollTo(d?a.pageXOffset:f,d?f:a.pageYOffset):b[e]=f)},b,e,arguments.length,null)}}),o.each(["top","left"],function(a,b){o.cssHooks[b]=yb(l.pixelPosition,function(a,c){return c?(c=xb(a,b),vb.test(c)?o(a).position()[b]+"px":c):void 0})}),o.each({Height:"height",Width:"width"},function(a,b){o.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){o.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return J(this,function(b,c,d){var e;return o.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?o.css(b,c,g):o.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),o.fn.size=function(){return this.length},o.fn.andSelf=o.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return o});var Lc=a.jQuery,Mc=a.$;return o.noConflict=function(b){return a.$===o&&(a.$=Mc),b&&a.jQuery===o&&(a.jQuery=Lc),o},typeof b===U&&(a.jQuery=a.$=o),o}); +/*! jQuery v2.1.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ +!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.1",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="<select msallowclip=''><option selected=''></option></select>",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=lb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=mb(b);function pb(){}pb.prototype=d.filters=d.pseudos,d.setFilters=new pb,g=fb.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fb.error(a):z(a,i).slice(0)};function qb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+Math.random()}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b) +},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=L.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var Q=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,R=["Top","Right","Bottom","Left"],S=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)},T=/^(?:checkbox|radio)$/i;!function(){var a=l.createDocumentFragment(),b=a.appendChild(l.createElement("div")),c=l.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||l,d=c.documentElement,e=c.body,a.pageX=b.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0),a.pageY=b.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},fix:function(a){if(a[n.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=W.test(e)?this.mouseHooks:V.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new n.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=l),3===a.target.nodeType&&(a.target=a.target.parentNode),g.filter?g.filter(a,f):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==_()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===_()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&n.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=n.extend(new n.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?n.event.trigger(e,null,b):n.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?Z:$):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={isDefaultPrevented:$,isPropagationStopped:$,isImmediatePropagationStopped:$,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=Z,a&&a.preventDefault&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=Z,a&&a.stopPropagation&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=Z,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!n.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.focusinBubbles||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a),!0)};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=L.access(d,b);e||d.addEventListener(a,c,!0),L.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=L.access(d,b)-1;e?L.access(d,b,e):(d.removeEventListener(a,c,!0),L.remove(d,b))}}}),n.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(g in a)this.on(g,b,c,a[g],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=$;else if(!d)return this;return 1===e&&(f=d,d=function(a){return n().off(a),f.apply(this,arguments)},d.guid=f.guid||(f.guid=n.guid++)),this.each(function(){n.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=$),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});var ab=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bb=/<([\w:]+)/,cb=/<|&#?\w+;/,db=/<(?:script|style|link)/i,eb=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/^$|\/(?:java|ecma)script/i,gb=/^true\/(.*)/,hb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ib={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ib.optgroup=ib.option,ib.tbody=ib.tfoot=ib.colgroup=ib.caption=ib.thead,ib.th=ib.td;function jb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function kb(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function lb(a){var b=gb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function mb(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function nb(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function ob(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pb(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=ob(h),f=ob(a),d=0,e=f.length;e>d;d++)pb(f[d],g[d]);if(b)if(c)for(f=f||ob(a),g=g||ob(h),d=0,e=f.length;e>d;d++)nb(f[d],g[d]);else nb(a,h);return g=ob(h,"script"),g.length>0&&mb(g,!i&&ob(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(cb.test(e)){f=f||k.appendChild(b.createElement("div")),g=(bb.exec(e)||["",""])[1].toLowerCase(),h=ib[g]||ib._default,f.innerHTML=h[1]+e.replace(ab,"<$1></$2>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=ob(k.appendChild(e),"script"),i&&mb(f),c)){j=0;while(e=f[j++])fb.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(ob(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&mb(ob(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(ob(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!db.test(a)&&!ib[(bb.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(ab,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ob(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(ob(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&eb.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(ob(c,"script"),kb),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,ob(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,lb),j=0;g>j;j++)h=f[j],fb.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(hb,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qb,rb={};function sb(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function tb(a){var b=l,c=rb[a];return c||(c=sb(a,b),"none"!==c&&c||(qb=(qb||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=qb[0].contentDocument,b.write(),b.close(),c=sb(a,b),qb.detach()),rb[a]=c),c}var ub=/^margin/,vb=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),wb=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)};function xb(a,b,c){var d,e,f,g,h=a.style;return c=c||wb(a),c&&(g=c.getPropertyValue(b)||c[b]),c&&(""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),vb.test(g)&&ub.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function yb(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d=l.documentElement,e=l.createElement("div"),f=l.createElement("div");if(f.style){f.style.backgroundClip="content-box",f.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===f.style.backgroundClip,e.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",e.appendChild(f);function g(){f.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",f.innerHTML="",d.appendChild(e);var g=a.getComputedStyle(f,null);b="1%"!==g.top,c="4px"===g.width,d.removeChild(e)}a.getComputedStyle&&n.extend(k,{pixelPosition:function(){return g(),b},boxSizingReliable:function(){return null==c&&g(),c},reliableMarginRight:function(){var b,c=f.appendChild(l.createElement("div"));return c.style.cssText=f.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",c.style.marginRight=c.style.width="0",f.style.width="1px",d.appendChild(e),b=!parseFloat(a.getComputedStyle(c,null).marginRight),d.removeChild(e),b}})}}(),n.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var zb=/^(none|table(?!-c[ea]).+)/,Ab=new RegExp("^("+Q+")(.*)$","i"),Bb=new RegExp("^([+-])=("+Q+")","i"),Cb={position:"absolute",visibility:"hidden",display:"block"},Db={letterSpacing:"0",fontWeight:"400"},Eb=["Webkit","O","Moz","ms"];function Fb(a,b){if(b in a)return b;var c=b[0].toUpperCase()+b.slice(1),d=b,e=Eb.length;while(e--)if(b=Eb[e]+c,b in a)return b;return d}function Gb(a,b,c){var d=Ab.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Hb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+R[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+R[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+R[f]+"Width",!0,e))):(g+=n.css(a,"padding"+R[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+R[f]+"Width",!0,e)));return g}function Ib(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=wb(a),g="border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=xb(a,b,f),(0>e||null==e)&&(e=a.style[b]),vb.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Hb(a,b,c||(g?"border":"content"),d,f)+"px"}function Jb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=L.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&S(d)&&(f[g]=L.access(d,"olddisplay",tb(d.nodeName)))):(e=S(d),"none"===c&&e||L.set(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=xb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;return b=n.cssProps[h]||(n.cssProps[h]=Fb(i,h)),g=n.cssHooks[b]||n.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=Bb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(n.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||n.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Fb(a.style,h)),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=xb(a,b,d)),"normal"===e&&b in Db&&(e=Db[b]),""===c||c?(f=parseFloat(e),c===!0||n.isNumeric(f)?f||0:e):e}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?zb.test(n.css(a,"display"))&&0===a.offsetWidth?n.swap(a,Cb,function(){return Ib(a,b,d)}):Ib(a,b,d):void 0},set:function(a,c,d){var e=d&&wb(a);return Gb(a,c,d?Hb(a,b,d,"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),n.cssHooks.marginRight=yb(k.reliableMarginRight,function(a,b){return b?n.swap(a,{display:"inline-block"},xb,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+R[d]+b]=f[d]||f[d-2]||f[0];return e}},ub.test(a)||(n.cssHooks[a+b].set=Gb)}),n.fn.extend({css:function(a,b){return J(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=wb(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return Jb(this,!0)},hide:function(){return Jb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){S(this)?n(this).show():n(this).hide()})}});function Kb(a,b,c,d,e){return new Kb.prototype.init(a,b,c,d,e)}n.Tween=Kb,Kb.prototype={constructor:Kb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=Kb.propHooks[this.prop];return a&&a.get?a.get(this):Kb.propHooks._default.get(this)},run:function(a){var b,c=Kb.propHooks[this.prop];return this.pos=b=this.options.duration?n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Kb.propHooks._default.set(this),this}},Kb.prototype.init.prototype=Kb.prototype,Kb.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[n.cssProps[a.prop]]||n.cssHooks[a.prop])?n.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Kb.propHooks.scrollTop=Kb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},n.fx=Kb.prototype.init,n.fx.step={};var Lb,Mb,Nb=/^(?:toggle|show|hide)$/,Ob=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),Pb=/queueHooks$/,Qb=[Vb],Rb={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=Ob.exec(b),f=e&&e[3]||(n.cssNumber[a]?"":"px"),g=(n.cssNumber[a]||"px"!==f&&+d)&&Ob.exec(n.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,n.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function Sb(){return setTimeout(function(){Lb=void 0}),Lb=n.now()}function Tb(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=R[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ub(a,b,c){for(var d,e=(Rb[b]||[]).concat(Rb["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Vb(a,b,c){var d,e,f,g,h,i,j,k,l=this,m={},o=a.style,p=a.nodeType&&S(a),q=L.get(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,l.always(function(){l.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=n.css(a,"display"),k="none"===j?L.get(a,"olddisplay")||tb(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(o.display="inline-block")),c.overflow&&(o.overflow="hidden",l.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],Nb.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}m[d]=q&&q[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(m))"inline"===("none"===j?tb(a.nodeName):j)&&(o.display=j);else{q?"hidden"in q&&(p=q.hidden):q=L.access(a,"fxshow",{}),f&&(q.hidden=!p),p?n(a).show():l.done(function(){n(a).hide()}),l.done(function(){var b;L.remove(a,"fxshow");for(b in m)n.style(a,b,m[b])});for(d in m)g=Ub(p?q[d]:0,d,l),d in q||(q[d]=g.start,p&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function Wb(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function Xb(a,b,c){var d,e,f=0,g=Qb.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Lb||Sb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:Lb||Sb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(Wb(k,j.opts.specialEasing);g>f;f++)if(d=Qb[f].call(j,a,k,j.opts))return d;return n.map(k,Ub,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(Xb,{tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],Rb[c]=Rb[c]||[],Rb[c].unshift(b)},prefilter:function(a,b){b?Qb.unshift(a):Qb.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(S).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=Xb(this,n.extend({},a),f);(e||L.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=L.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Pb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=L.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(Tb(b,!0),a,d,e)}}),n.each({slideDown:Tb("show"),slideUp:Tb("hide"),slideToggle:Tb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=0,c=n.timers;for(Lb=n.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||n.fx.stop(),Lb=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){Mb||(Mb=setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){clearInterval(Mb),Mb=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(a,b){return a=n.fx?n.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a=l.createElement("input"),b=l.createElement("select"),c=b.appendChild(l.createElement("option"));a.type="checkbox",k.checkOn=""!==a.value,k.optSelected=c.selected,b.disabled=!0,k.optDisabled=!c.disabled,a=l.createElement("input"),a.value="t",a.type="radio",k.radioValue="t"===a.value}();var Yb,Zb,$b=n.expr.attrHandle;n.fn.extend({attr:function(a,b){return J(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===U?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),d=n.attrHooks[b]||(n.expr.match.bool.test(b)?Zb:Yb)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=n.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void n.removeAttr(a,b)) +},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),Zb={set:function(a,b,c){return b===!1?n.removeAttr(a,c):a.setAttribute(c,c),c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=$b[b]||n.find.attr;$b[b]=function(a,b,d){var e,f;return d||(f=$b[b],$b[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,$b[b]=f),e}});var _b=/^(?:input|select|textarea|button)$/i;n.fn.extend({prop:function(a,b){return J(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[n.propFix[a]||a]})}}),n.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!n.isXMLDoc(a),f&&(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){return a.hasAttribute("tabindex")||_b.test(a.nodeName)||a.href?a.tabIndex:-1}}}}),k.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var ac=/[\t\r\n\f]/g;n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h="string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ac," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=n.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0===arguments.length||"string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ac," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?n.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(n.isFunction(a)?function(c){n(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=n(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===U||"boolean"===c)&&(this.className&&L.set(this,"__className__",this.className),this.className=this.className||a===!1?"":L.get(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(ac," ").indexOf(b)>=0)return!0;return!1}});var bc=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(bc,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=n.inArray(d.value,f)>=0)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>=0:void 0}},k.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var cc=n.now(),dc=/\?/;n.parseJSON=function(a){return JSON.parse(a+"")},n.parseXML=function(a){var b,c;if(!a||"string"!=typeof a)return null;try{c=new DOMParser,b=c.parseFromString(a,"text/xml")}catch(d){b=void 0}return(!b||b.getElementsByTagName("parsererror").length)&&n.error("Invalid XML: "+a),b};var ec,fc,gc=/#.*$/,hc=/([?&])_=[^&]*/,ic=/^(.*?):[ \t]*([^\r\n]*)$/gm,jc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,kc=/^(?:GET|HEAD)$/,lc=/^\/\//,mc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,nc={},oc={},pc="*/".concat("*");try{fc=location.href}catch(qc){fc=l.createElement("a"),fc.href="",fc=fc.href}ec=mc.exec(fc.toLowerCase())||[];function rc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(n.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function sc(a,b,c,d){var e={},f=a===oc;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function tc(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&n.extend(!0,a,d),a}function uc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function vc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:fc,type:"GET",isLocal:jc.test(ec[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":pc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?tc(tc(a,n.ajaxSettings),b):tc(n.ajaxSettings,a)},ajaxPrefilter:rc(nc),ajaxTransport:rc(oc),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=n.ajaxSetup({},b),l=k.context||k,m=k.context&&(l.nodeType||l.jquery)?n(l):n.event,o=n.Deferred(),p=n.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!f){f={};while(b=ic.exec(e))f[b[1].toLowerCase()]=b[2]}b=f[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?e:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return c&&c.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||fc)+"").replace(gc,"").replace(lc,ec[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=n.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(h=mc.exec(k.url.toLowerCase()),k.crossDomain=!(!h||h[1]===ec[1]&&h[2]===ec[2]&&(h[3]||("http:"===h[1]?"80":"443"))===(ec[3]||("http:"===ec[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=n.param(k.data,k.traditional)),sc(nc,k,b,v),2===t)return v;i=k.global,i&&0===n.active++&&n.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!kc.test(k.type),d=k.url,k.hasContent||(k.data&&(d=k.url+=(dc.test(d)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=hc.test(d)?d.replace(hc,"$1_="+cc++):d+(dc.test(d)?"&":"?")+"_="+cc++)),k.ifModified&&(n.lastModified[d]&&v.setRequestHeader("If-Modified-Since",n.lastModified[d]),n.etag[d]&&v.setRequestHeader("If-None-Match",n.etag[d])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+pc+"; q=0.01":""):k.accepts["*"]);for(j in k.headers)v.setRequestHeader(j,k.headers[j]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(j in{success:1,error:1,complete:1})v[j](k[j]);if(c=sc(oc,k,b,v)){v.readyState=1,i&&m.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,c.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,f,h){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),c=void 0,e=h||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,f&&(u=uc(k,v,f)),u=vc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(n.lastModified[d]=w),w=v.getResponseHeader("etag"),w&&(n.etag[d]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,i&&m.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),i&&(m.trigger("ajaxComplete",[v,k]),--n.active||n.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){var b;return n.isFunction(a)?this.each(function(b){n(this).wrapAll(a.call(this,b))}):(this[0]&&(b=n(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return this.each(n.isFunction(a)?function(b){n(this).wrapInner(a.call(this,b))}:function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var wc=/%20/g,xc=/\[\]$/,yc=/\r?\n/g,zc=/^(?:submit|button|image|reset|file)$/i,Ac=/^(?:input|select|textarea|keygen)/i;function Bc(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||xc.test(a)?d(a,e):Bc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Bc(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Bc(c,a[c],b,e);return d.join("&").replace(wc,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&Ac.test(this.nodeName)&&!zc.test(a)&&(this.checked||!T.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(yc,"\r\n")}}):{name:b.name,value:c.replace(yc,"\r\n")}}).get()}}),n.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(a){}};var Cc=0,Dc={},Ec={0:200,1223:204},Fc=n.ajaxSettings.xhr();a.ActiveXObject&&n(a).on("unload",function(){for(var a in Dc)Dc[a]()}),k.cors=!!Fc&&"withCredentials"in Fc,k.ajax=Fc=!!Fc,n.ajaxTransport(function(a){var b;return k.cors||Fc&&!a.crossDomain?{send:function(c,d){var e,f=a.xhr(),g=++Cc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)f.setRequestHeader(e,c[e]);b=function(a){return function(){b&&(delete Dc[g],b=f.onload=f.onerror=null,"abort"===a?f.abort():"error"===a?d(f.status,f.statusText):d(Ec[f.status]||f.status,f.statusText,"string"==typeof f.responseText?{text:f.responseText}:void 0,f.getAllResponseHeaders()))}},f.onload=b(),f.onerror=b("error"),b=Dc[g]=b("abort");try{f.send(a.hasContent&&a.data||null)}catch(h){if(b)throw h}},abort:function(){b&&b()}}:void 0}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(d,e){b=n("<script>").prop({async:!0,charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&e("error"===a.type?404:200,a.type)}),l.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Gc=[],Hc=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Gc.pop()||n.expando+"_"+cc++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Hc.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Hc.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Hc,"$1"+e):b.jsonp!==!1&&(b.url+=(dc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Gc.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||l;var d=v.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=n.buildFragment([a],b,e),e&&e.length&&n(e).remove(),n.merge([],d.childNodes))};var Ic=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&Ic)return Ic.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=n.trim(a.slice(h)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e,dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,f||[a.responseText,b,a])}),this},n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};var Jc=a.document.documentElement;function Kc(a){return n.isWindow(a)?a:9===a.nodeType&&a.defaultView}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d=this[0],e={top:0,left:0},f=d&&d.ownerDocument;if(f)return b=f.documentElement,n.contains(b,d)?(typeof d.getBoundingClientRect!==U&&(e=d.getBoundingClientRect()),c=Kc(f),{top:e.top+c.pageYOffset-b.clientTop,left:e.left+c.pageXOffset-b.clientLeft}):e},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===n.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(d=a.offset()),d.top+=n.css(a[0],"borderTopWidth",!0),d.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-d.top-n.css(c,"marginTop",!0),left:b.left-d.left-n.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||Jc;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Jc})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(b,c){var d="pageYOffset"===c;n.fn[b]=function(e){return J(this,function(b,e,f){var g=Kc(b);return void 0===f?g?g[c]:b[e]:void(g?g.scrollTo(d?a.pageXOffset:f,d?f:a.pageYOffset):b[e]=f)},b,e,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=yb(k.pixelPosition,function(a,c){return c?(c=xb(a,b),vb.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return J(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var Lc=a.jQuery,Mc=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=Mc),b&&a.jQuery===n&&(a.jQuery=Lc),n},typeof b===U&&(a.jQuery=a.$=n),n}); diff --git a/p/scripts/main.js b/p/scripts/main.js index 34042c945..f6d5d2907 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -1,6 +1,8 @@ "use strict"; var $stream = null, - isCollapsed = true; + isCollapsed = true, + shares = 0, + ajax_loading = false; function is_normal_mode() { return $stream.hasClass('normal'); @@ -53,9 +55,11 @@ function numberFormat(nStr) { return x1 + x2; } -function incLabel(p, inc) { +function incLabel(p, inc, spaceAfter) { var i = str2int(p) + inc; - return i > 0 ? ' (' + numberFormat(i) + ')' : ''; + return i > 0 + ? ((spaceAfter ? '' : ' ') + '(' + numberFormat(i) + ')' + (spaceAfter ? ' ' : '')) + : ''; } function incUnreadsFeed(article, feed_id, nb) { @@ -65,6 +69,10 @@ function incUnreadsFeed(article, feed_id, nb) { feed_priority = elem ? str2int(elem.getAttribute('data-priority')) : 0; if (elem) { elem.setAttribute('data-unread', numberFormat(feed_unreads + nb)); + elem = $(elem).closest('li').get(0); + if (elem) { + elem.setAttribute('data-unread', feed_unreads + nb); + } } //Update unread: category @@ -72,6 +80,10 @@ function incUnreadsFeed(article, feed_id, nb) { feed_unreads = elem ? str2int(elem.getAttribute('data-unread')) : 0; if (elem) { elem.setAttribute('data-unread', numberFormat(feed_unreads + nb)); + elem = $(elem).closest('li').get(0); + if (elem) { + elem.setAttribute('data-unread', feed_unreads + nb); + } } //Update unread: all @@ -94,13 +106,16 @@ function incUnreadsFeed(article, feed_id, nb) { var isCurrentView = false; //Update unread: title - document.title = document.title.replace(/((?: \([ 0-9]+\))?)( · .*?)((?: \([ 0-9]+\))?)$/, function (m, p1, p2, p3) { + document.title = document.title.replace(/^((?:\([ 0-9]+\) )?)/, function (m, p1) { var $feed = $('#' + feed_id); if (article || ($feed.closest('.active').length > 0 && $feed.siblings('.active').length === 0)) { isCurrentView = true; - return incLabel(p1, nb) + p2 + incLabel(p3, feed_priority > 0 ? nb : 0); + return incLabel(p1, nb, true); + } else if ($('.all.active').length > 0) { + isCurrentView = feed_priority > 0; + return incLabel(p1, feed_priority > 0 ? nb : 0, true); } else { - return p1 + p2 + incLabel(p3, feed_priority > 0 ? nb : 0); + return p1; } }); return isCurrentView; @@ -145,6 +160,7 @@ function mark_read(active, only_not_read) { $r.find('.icon').replaceWith(data.icon); incUnreadsFeed(active, feed_id, inc); + faviconNbUnread(); pending_feeds.splice(index_pending, 1); }); @@ -189,7 +205,7 @@ function mark_favorite(active) { var favourites = $('.favorites>a').contents().last().get(0); if (favourites && favourites.textContent) { favourites.textContent = favourites.textContent.replace(/((?: \([ 0-9]+\))?\s*)$/, function (m, p1) { - return incLabel(p1, inc); + return incLabel(p1, inc, false); }); } @@ -206,14 +222,10 @@ function mark_favorite(active) { } function toggleContent(new_active, old_active) { - old_active.removeClass("active"); - if (new_active.length === 0) { return; } - old_active.removeClass("current"); - if (does_lazyload) { new_active.find('img[data-original], iframe[data-original]').each(function () { this.setAttribute('src', this.getAttribute('data-original')); @@ -225,7 +237,10 @@ function toggleContent(new_active, old_active) { if (isCollapsed) { new_active.addClass("active"); } + old_active.removeClass("active current"); new_active.addClass("current"); + } else { + new_active.toggleClass('active'); } var box_to_move = "html,body", @@ -235,31 +250,35 @@ function toggleContent(new_active, old_active) { relative_move = true; } - var new_pos = new_active.position().top, - old_scroll = $(box_to_move).scrollTop(); - if (hide_posts) { - - new_pos = new_active.position().top; - old_scroll = $(box_to_move).scrollTop(); + if (sticky_post) { + var prev_article = new_active.prevAll('.flux'), + new_pos = new_active.position().top, + old_scroll = $(box_to_move).scrollTop(); - if (relative_move) { - new_pos += old_scroll; + if (prev_article.length > 0 && new_pos - prev_article.position().top <= 150) { + new_pos = prev_article.position().top; } - if (old_active[0] !== new_active[0]) { - new_active.children(".flux_content").first().each(function () { - $(box_to_move).scrollTop(new_pos).scrollTop(); - }); - } - } else { - if (relative_move) { - new_pos += old_scroll; - } + if (hide_posts) { + if (relative_move) { + new_pos += old_scroll; + } - $(box_to_move).scrollTop(new_pos).scrollTop(); + if (old_active[0] !== new_active[0]) { + new_active.children(".flux_content").first().each(function () { + $(box_to_move).scrollTop(new_pos).scrollTop(); + }); + } + } else { + if (relative_move) { + new_pos += old_scroll; + } + + $(box_to_move).scrollTop(new_pos).scrollTop(); + } } - if (auto_mark_article) { + if (auto_mark_article && new_active.hasClass('active')) { mark_read(new_active, true); } } @@ -275,18 +294,15 @@ 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(); } } function prev_feed() { var active_feed = $("#aside_flux .feeds li.active"); if (active_feed.length > 0) { - active_feed.prev().find('a.feed').each(function(){this.click();}); + active_feed.prevAll(':visible:first').find('a.feed').each(function(){this.click();}); } else { last_feed(); } @@ -295,21 +311,21 @@ function prev_feed() { function next_feed() { var active_feed = $("#aside_flux .feeds li.active"); if (active_feed.length > 0) { - active_feed.next().find('a.feed').each(function(){this.click();}); + active_feed.nextAll(':visible:first').find('a.feed').each(function(){this.click();}); } else { first_feed(); } } function first_feed() { - var feed = $("#aside_flux .feeds.active li:first"); + var feed = $("#aside_flux .feeds.active li:visible:first"); if (feed.length > 0) { feed.find('a')[1].click(); } } function last_feed() { - var feed = $("#aside_flux .feeds.active li:last"); + var feed = $("#aside_flux .feeds.active li:visible:last"); if (feed.length > 0) { feed.find('a')[1].click(); } @@ -319,7 +335,7 @@ function prev_category() { var active_cat = $("#aside_flux .category.stick.active"); if (active_cat.length > 0) { - var prev_cat = active_cat.parent('li').prev().find('.category.stick a.btn'); + var prev_cat = active_cat.parent('li').prevAll(':visible:first').find('.category.stick a.btn'); if (prev_cat.length > 0) { prev_cat[0].click(); } @@ -333,7 +349,7 @@ function next_category() { var active_cat = $("#aside_flux .category.stick.active"); if (active_cat.length > 0) { - var next_cat = active_cat.parent('li').next().find('.category.stick a.btn'); + var next_cat = active_cat.parent('li').nextAll(':visible:first').find('.category.stick a.btn'); if (next_cat.length > 0) { next_cat[0].click(); } @@ -344,14 +360,14 @@ function next_category() { } function first_category() { - var cat = $("#aside_flux .category.stick:first"); + var cat = $("#aside_flux .category.stick:visible:first"); if (cat.length > 0) { cat.find('a.btn')[0].click(); } } function last_category() { - var cat = $("#aside_flux .category.stick:last"); + var cat = $("#aside_flux .category.stick:visible:last"); if (cat.length > 0) { cat.find('a.btn')[0].click(); } @@ -359,7 +375,42 @@ function last_category() { function collapse_entry() { isCollapsed = !isCollapsed; - $(".flux.current").toggleClass("active"); + + var flux_current = $(".flux.current"); + flux_current.toggleClass("active"); + if (isCollapsed && auto_mark_article) { + mark_read(flux_current, true); + } +} + +function user_filter(key) { + console.log('user filter'); + console.warn(key); + var filter = $('#dropdown-query'); + var filters = filter.siblings('.dropdown-menu').find('.item.query a'); + if (typeof key === "undefined") { + if (!filter.length) { + return; + } + // Display the filter div + window.location.hash = filter.attr('id'); + // Force scrolling to the filter div + var scroll = needsScroll($('.header')); + if (scroll !== 0) { + $('html,body').scrollTop(scroll); + } + // Force the key value if there is only one action, so we can trigger it automatically + if (filters.length === 1) { + key = 1; + } else { + return; + } + } + // Trigger selected share action + key = parseInt(key); + if (key <= filters.length) { + filters[key - 1].click(); + } } function auto_share(key) { @@ -405,21 +456,7 @@ function inMarkViewport(flux, box_to_follow, relative_follow) { return (windowBot >= begin && bot >= windowBot); } -function init_lazyload() { - if ($.fn.lazyload) { - if (is_global_mode()) { - $(".flux_content img").lazyload({ - container: $("#panel") - }); - } else { - $(".flux_content img").lazyload(); - } - } -} - function init_posts() { - init_lazyload(); - var box_to_follow = $(window), relative_follow = false; if (is_global_mode()) { @@ -452,6 +489,7 @@ function init_posts() { load_more_posts(); } }); + box_to_follow.scroll(); } } @@ -500,8 +538,14 @@ function init_shortcuts() { }); shortcut.add("shift+" + shortcuts.mark_read, function () { // on marque tout comme lu - var url = $(".nav_menu a.read_all").attr("href"); - redirect(url, false); + var btn = $(".nav_menu .read_all"); + if (btn.hasClass('confirm')) { + if (confirm(str_confirmation)) { + btn.click(); + } + } else { + btn.click(); + } }, { 'disable_in_input': true }); @@ -522,9 +566,19 @@ function init_shortcuts() { }, { 'disable_in_input': true }); + + shortcut.add(shortcuts.user_filter, function () { + user_filter(); + }, { + 'disable_in_input': true + }); for(var i = 1; i < 10; i++){ shortcut.add(i.toString(), function (e) { - auto_share(String.fromCharCode(e.keyCode)); + if ($('#dropdown-query').siblings('.dropdown-menu').is(':visible')) { + user_filter(String.fromCharCode(e.keyCode)); + } else { + auto_share(String.fromCharCode(e.keyCode)); + } }, { 'disable_in_input': true }); @@ -585,7 +639,7 @@ function init_shortcuts() { }); shortcut.add(shortcuts.go_website, function () { - var url_website = $(".flux.current .link a").attr("href"); + var url_website = $('.flux.current > .flux_header > .title > a').attr("href"); if (auto_mark_site) { $(".flux.current").each(function () { @@ -603,11 +657,24 @@ function init_shortcuts() { }, { 'disable_in_input': true }); + + shortcut.add(shortcuts.focus_search, function () { + focus_search(); + }, { + 'disable_in_input': true + }); + + shortcut.add(shortcuts.help, function () { + redirect(help_url, true); + }, { + 'disable_in_input': true + }); + } function init_stream(divStream) { - divStream.on('click', '.flux_header', function (e) { //flux_header_toggle - if ($(e.target).closest('.item.website, .item.link').length > 0) { + divStream.on('click', '.flux_header,.flux_content', function (e) { //flux_toggle + if ($(e.target).closest('.content, .item.website, .item.link').length > 0) { return; } var old_active = $(".flux.current"), @@ -635,11 +702,25 @@ function init_stream(divStream) { }); divStream.on('click', '.item.title > a', function (e) { + // Allow default control-click behaviour such as open in backround-tab. + return e.ctrlKey; + }); + divStream.on('mouseup', '.item.title > a', function (e) { + // Mouseup enables us to catch middle click. if (e.ctrlKey) { - return true; //Allow default control-click behaviour such as open in backround-tab + // CTRL+click, it will be manage by previous rule. + return; + } + + if (e.which == 2) { + // If middle click, we want same behaviour as CTRL+click. + var e = jQuery.Event("click"); + e.ctrlKey = true; + $(this).trigger(e); + } else if(e.which == 1) { + // Normal click, just toggle article. + $(this).parent().click(); } - $(this).parent().click(); //Will perform toggle flux_content - return false; }); divStream.on('click', '.flux .content a', function () { @@ -647,8 +728,14 @@ function init_stream(divStream) { }); if (auto_mark_site) { - divStream.on('click', '.flux .link > a', function () { - mark_read($(this).parent().parent().parent(), true); + // catch mouseup instead of click so we can have the correct behaviour + // with middle button click (scroll button). + divStream.on('mouseup', '.flux .link > a', function (e) { + if (e.which == 3) { + return; + } + + mark_read($(this).parents(".flux"), true); }); } } @@ -681,14 +768,22 @@ function init_actualize() { var auto = false; $("#actualize").click(function () { + if (ajax_loading) { + return false; + } + + ajax_loading = true; + $.getScript('./?c=javascript&a=actualize').done(function () { if (auto && feed_count < 1) { auto = false; - return; + ajax_loading = false; + return false; } updateFeeds(); }); + return false; }); @@ -712,11 +807,12 @@ function openNotification(msg, status) { notification_working = true; notification.removeClass(); + notification.addClass("notification"); notification.addClass(status); notification.find(".msg").html(msg); notification.fadeIn(300); - notification_interval = window.setInterval(closeNotification, 4000); + notification_interval = window.setTimeout(closeNotification, 4000); } function closeNotification() { @@ -739,23 +835,78 @@ function init_notifications() { if (notification.find(".msg").html().length > 0) { notification_working = true; - notification_interval = window.setInterval(closeNotification, 4000); + notification_interval = window.setTimeout(closeNotification, 4000); } } // </notification> +// <notifs html5> +var notifs_html5_permission = 'denied'; + +function notifs_html5_is_supported() { + return window.Notification !== undefined; +} + +function notifs_html5_ask_permission() { + window.Notification.requestPermission(function () { + notifs_html5_permission = window.Notification.permission; + }); +} + +function notifs_html5_show(nb) { + if (notifs_html5_permission !== "granted") { + return + } + + var notification = new window.Notification(str_notif_title_articles, { + icon: "../themes/icons/favicon-256.png", + body: str_notif_body_articles.replace("\d", nb), + tag: "freshRssNewArticles" + }); + + notification.onclick = function() { + window.location.reload(); + } + + if (html5_notif_timeout !== 0){ + setTimeout(function() { + notification.close(); + }, html5_notif_timeout * 1000); + } +} + +function init_notifs_html5() { + if (!notifs_html5_is_supported()) { + return; + } + + notifs_html5_permission = notifs_html5_ask_permission(); +} +// </notifs html5> + function refreshUnreads() { $.getJSON('./?c=javascript&a=nbUnreadsPerFeed').done(function (data) { - var isAll = $('.category.all > .active').length > 0; + var isAll = $('.category.all > .active').length > 0, + new_articles = false; + $.each(data, function(feed_id, nbUnreads) { feed_id = 'f_' + feed_id; var elem = $('#' + feed_id + '>.feed').get(0), feed_unreads = elem ? str2int(elem.getAttribute('data-unread')) : 0; + if ((incUnreadsFeed(null, feed_id, nbUnreads - feed_unreads) || isAll) && //Update of current view? (nbUnreads - feed_unreads > 0)) { $('#new-article').show(); + new_articles = true; }; }); + + var nb_unreads = str2int($('.category.all>a').attr('data-unread')); + + if (nb_unreads > 0 && new_articles) { + faviconNbUnread(nb_unreads); + notifs_html5_show(nb_unreads); + } }); } @@ -774,7 +925,15 @@ function load_more_posts() { $.get(url_load_more, function (data) { box_load_more.children('.flux:last').after($('#stream', data).children('.flux, .day')); $('.pagination').replaceWith($('.pagination', data)); - $('#bigMarkAsRead').attr('href', $('#nav_menu_read_all>a').attr('href')); + if (display_order === 'ASC') { + $('#nav_menu_read_all > .read_all').attr( + 'formaction', $('#bigMarkAsRead').attr('formaction') + ); + } else { + $('#bigMarkAsRead').attr( + 'formaction', $('#nav_menu_read_all > .read_all').attr('formaction') + ); + } $('[id^=day_]').each(function (i) { var ids = $('[id="' + this.id + '"]'); @@ -784,16 +943,25 @@ function load_more_posts() { }); init_load_more(box_load_more); - init_lazyload(); $('#load_more').removeClass('loading'); load_more = false; }); } +function focus_search() { + $('#search').focus(); +} + function init_load_more(box) { box_load_more = box; + if (!does_lazyload) { + $('img[postpone], audio[postpone], iframe[postpone], video[postpone]').each(function () { + this.removeAttribute('postpone'); + }); + } + var $next_link = $("#load_more"); if (!$next_link.length) { // no more article to load @@ -816,7 +984,7 @@ function init_load_more(box) { } //</endless_mode> -//<Web login form> +//<crypto form (Web login)> function poormanSalt() { //If crypto.getRandomValues is not available var text = '$2a$04$', base = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ.0123456789/abcdefghijklmnopqrstuvwxyz'; @@ -826,20 +994,24 @@ function poormanSalt() { //If crypto.getRandomValues is not available return text; } -function init_loginForm() { - var $loginForm = $('#loginForm'); - if ($loginForm.length === 0) { +function init_crypto_form() { + var $crypto_form = $('#crypto-form'); + if ($crypto_form.length === 0) { return; } + if (!(window.dcodeIO)) { if (window.console) { console.log('FreshRSS waiting for bcrypt.js…'); } - window.setTimeout(init_loginForm, 100); + window.setTimeout(init_crypto_form, 100); return; } - $loginForm.on('submit', function() { - $('#loginButton').attr('disabled', ''); + + $crypto_form.on('submit', function() { + var $submit_button = $(this).find('button[type="submit"]'); + $submit_button.attr('disabled', ''); + var success = false; $.ajax({ url: './?c=javascript&a=nonce&user=' + $('#username').val(), @@ -847,7 +1019,7 @@ function init_loginForm() { async: false }).done(function (data) { if (data.salt1 == '' || data.nonce == '') { - alert('Invalid user!'); + openNotification('Invalid user!', 'bad'); } else { try { var strong = window.Uint32Array && window.crypto && (typeof window.crypto.getRandomValues === 'function'), @@ -855,22 +1027,23 @@ function init_loginForm() { c = dcodeIO.bcrypt.hashSync(data.nonce + s, strong ? 4 : poormanSalt()); $('#challenge').val(c); if (s == '' || c == '') { - alert('Crypto error!'); + openNotification('Crypto error!', 'bad'); } else { success = true; } } catch (e) { - alert('Crypto exception! ' + e); + openNotification('Crypto exception! ' + e, 'bad'); } } }).fail(function() { - alert('Communication error!'); + openNotification('Communication error!', 'bad'); }); - $('#loginButton').removeAttr('disabled'); + + $submit_button.removeAttr('disabled'); return success; }); } -//</Web login form> +//</crypto form (Web login)> //<persona> function init_persona() { @@ -935,13 +1108,18 @@ function init_persona() { //</persona> function init_confirm_action() { - $('.confirm').click(function () { + $('body').on('click', '.confirm', function () { + var str_confirmation = $(this).attr('data-str-confirm'); + if (!str_confirmation) { + str_confirmation = str_confirmation_default; + } + return confirm(str_confirmation); }); } function init_print_action() { - $('.print-article').click(function () { + $('.item.share > a[href="#"]').click(function () { var content = "<html><head><style>" + "body { font-family: Serif; text-align: justify; }" + "a { color: #000; text-decoration: none; }" @@ -961,8 +1139,109 @@ function init_print_action() { }); } +function init_share_observers() { + shares = $('.form-group:not(".form-actions")').length; + + $('.share.add').on('click', function(e) { + var opt = $(this).siblings('select').find(':selected'); + var row = $(this).parents('form').data(opt.data('form')); + row = row.replace('##label##', opt.html(), 'g'); + row = row.replace('##type##', opt.val(), 'g'); + row = row.replace('##help##', opt.data('help'), 'g'); + row = row.replace('##key##', shares, 'g'); + $(this).parents('.form-group').before(row); + shares++; + + return false; + }); +} + +function init_stats_observers() { + $('#feed_select').on('change', function(e) { + redirect($(this).find(':selected').data('url')); + }); +} + +function init_remove_observers() { + $('.post').on('click', 'a.remove', function(e) { + var remove_what = $(this).attr('data-remove'); + + if (remove_what !== undefined) { + var remove_obj = $('#' + remove_what); + remove_obj.remove(); + } + + return false; + }); +} + +function init_feed_observers() { + $('select[id="category"]').on('change', function() { + var detail = $('#new_category_name').parent(); + if ($(this).val() === 'nc') { + detail.show(); + detail.find('input').focus(); + } else { + detail.hide(); + } + }); +} + +function init_password_observers() { + $('input[type="password"] + a.btn.toggle-password').on('click', function(e) { + var button = $(this); + var passwordField = $(this).siblings('input[type="password"]'); + + passwordField.attr('type', 'text'); + button.addClass('active'); + + setTimeout(function() { + passwordField.attr('type', 'password'); + button.removeClass('active'); + }, 2000); + + return false; + }); +} + +function faviconNbUnread(n) { + if (typeof n === 'undefined') { + n = str2int($('.category.all>a').attr('data-unread')); + } + //http://remysharp.com/2010/08/24/dynamic-favicons/ + var canvas = document.createElement('canvas'), + link = document.getElementById('favicon').cloneNode(true); + if (canvas.getContext && link) { + canvas.height = canvas.width = 16; + var img = document.createElement('img'); + img.onload = function () { + var ctx = canvas.getContext('2d'); + ctx.drawImage(this, 0, 0, canvas.width, canvas.height); + if (n > 0) { + var text = ''; + if (n < 1000) { + text = n; + } else if (n < 100000) { + text = Math.floor(n / 1000) + 'k'; + } else { + text = 'E' + Math.floor(Math.log10(n)); + } + ctx.font = 'bold 9px "Arial", sans-serif'; + ctx.fillStyle = 'rgba(255, 255, 255, 0.8)'; + ctx.fillRect(0, 7, ctx.measureText(text).width, 9); + ctx.fillStyle = '#F00'; + ctx.fillText(text, 0, canvas.height - 1); + } + link.href = canvas.toDataURL('image/png'); + $('link[rel~=icon]').remove(); + document.head.appendChild(link); + }; + img.src = '../favicon.ico'; + } +} + function init_all() { - if (!(window.$ && window.url_freshrss && ((!full_lazyload) || $.fn.lazyload))) { + if (!(window.$ && window.url_freshrss)) { if (window.console) { console.log('FreshRSS waiting for JS…'); } @@ -971,9 +1250,6 @@ function init_all() { } init_notifications(); switch (authType) { - case 'form': - init_loginForm(); - break; case 'persona': init_persona(); break; @@ -988,8 +1264,17 @@ function init_all() { init_stream($stream); init_nav_entries(); init_shortcuts(); + faviconNbUnread(); init_print_action(); + init_notifs_html5(); window.setInterval(refreshUnreads, 120000); + } else { + init_crypto_form(); + init_share_observers(); + init_remove_observers(); + init_feed_observers(); + init_password_observers(); + init_stats_observers(); } if (window.console) { diff --git a/p/themes/Dark/dark.css b/p/themes/Dark/dark.css new file mode 100644 index 000000000..10f6e655b --- /dev/null +++ b/p/themes/Dark/dark.css @@ -0,0 +1,995 @@ +@charset "UTF-8"; + +/*=== FONTS */ +@font-face { + font-family: "OpenSans"; + src: url("../fonts/openSans.woff") format("woff"); +} + +/*=== GENERAL */ +/*============*/ +html, body { + height: 100%; + font-family: "OpenSans", "Cantarell", "Helvetica", "Arial", sans-serif; + background: #1c1c1c; + color: #888; +} + +/*=== Links */ +a, button.as-link { + color: #6986B2; + outline: none; +} + +/*=== Images */ +img.favicon { + background: #fff; + border-radius: 2px; +} + +/*=== Forms */ +legend { + margin: 20px 0 5px; + padding: 5px 0; + font-size: 1.4em; + border-bottom: 1px solid #2f2f2f; +} +label { + min-height: 25px; + padding: 5px 0; + cursor: pointer; +} +textarea { + width: 360px; + height: 100px; +} +input, select, textarea { + min-height: 25px; + padding: 5px; + line-height: 25px; + vertical-align: middle; + background: #333; + border: 1px solid #000; + border-radius: 3px; + color: #999; + box-shadow: 0 2px 2px #1d1d1d inset; +} +option { + padding: 0 .5em; +} +input:focus, select:focus, textarea:focus { + color: #6986b2; + border-color: #2f2f2f; +} +input:invalid, select:invalid { + border-color: #f00; + box-shadow: 0 0 2px 1px #f00; +} +input:disabled, select:disabled { + background: #666; + color: #aaa; +} +input.extend { + transition: width 200ms linear; + -moz-transition: width 200ms linear; + -webkit-transition: width 200ms linear; + -o-transition: width 200ms linear; + -ms-transition: width 200ms linear; +} + +/*=== Tables */ +table { + border-collapse: collapse; +} + +tr, th, td { + padding: 0.5em; + border: 1px solid #333; +} +th { + background: #222; +} +form td, +form th { + font-weight: normal; + text-align: center; +} + +/*=== COMPONENTS */ +/*===============*/ +/*=== Forms */ +.form-group.form-actions { + padding: 5px 0; + background: #1a1a1a; + border-top: 1px solid #2f2f2f; +} +.form-group.form-actions .btn { + margin: 0 10px; +} +.form-group .group-name { + padding: 10px 0; + text-align: right; +} +.form-group .group-controls { + min-height: 25px; + padding: 5px 0; +} +.form-group table { + margin: 10px 0 0 220px; +} + +/*=== Buttons */ +.stick { + vertical-align: middle; + font-size: 0; +} +.stick input, +.stick .btn { + border-radius: 0; +} +.stick .btn:first-child, +.stick input:first-child { + border-radius: 3px 0 0 3px; +} +.stick .btn-important:first-child { + border-right: 1px solid #000; +} +.stick .btn:last-child, +.stick input:last-child { + border-radius: 0 3px 3px 0; +} +.stick .btn + .btn, +.stick .btn + input, +.stick .btn + .dropdown > .btn, +.stick input + .btn, +.stick input + input, +.stick input + .dropdown > .btn, +.stick .dropdown + .btn, +.stick .dropdown + input, +.stick .dropdown + .dropdown > .btn { + border-left: none; +} +.stick input:focus+input { + border-left: 1px solid #000; +} +.stick input+input:focus { + border-left: 1px solid #333; +} +.stick .btn + .dropdown > .btn { + border-left: none; + border-radius: 0 3px 3px 0; +} + +.btn { + display: inline-block; + min-height: 37px; + min-width: 15px; + margin: 0; + padding: 5px 10px; + font-size: 0.9rem; + vertical-align: middle; + cursor: pointer; + overflow: hidden; + background: #111; + border-radius: 3px; + border: 1px solid #000; + color: #888; +} +a.btn { + min-height: 25px; + line-height: 25px; +} +.btn:hover { + text-decoration: none; + background: -moz-linear-gradient(top, #4A5D7A 0%, #26303F 100%); + background: -moz-linear-gradient(top, #4A5D7A 0%, #26303F 100%); + background: -webkit-linear-gradient(top, #4A5D7A 0%, #26303F 100%); + background: -o-linear-gradient(top, #4A5D7A 0%, #26303F 100%); + background: -ms-linear-gradient(top, #4A5D7A 0%, #26303F 100%); +} +.btn.active, +.dropdown-target:target ~ .btn.dropdown-toggle { + background: #333; +} +.btn:active { + background: #26303F; +} + +.btn-important { + font-weight: normal; + background: #26303F; +} +.btn-important:hover { + background: linear-gradient(top, #4A5D7A 0%, #26303F 100%); + background: -moz-linear-gradient(top, #4A5D7A 0%, #26303F 100%); + background: -webkit-linear-gradient(top, #4A5D7A 0%, #26303F 100%); + background: -o-linear-gradient(top, #4A5D7A 0%, #26303F 100%); + background: -ms-linear-gradient(top, #4A5D7A 0%, #26303F 100%); +} +.btn-important:active { + background: #26303F; +} + +.btn-attention { + background: #880011; +} +.btn-attention:hover { + background: linear-gradient(top, #cc0044 0%, #880011 100%); + background: -moz-linear-gradient(top, #cc0044 0%, #880011 100%); + background: -webkit-linear-gradient(top, #cc0044 0%, #880011 100%); + background: -o-linear-gradient(top, #cc0044 0%, #880011 100%); + background: -ms-linear-gradient(top, #cc0044 0%, #880011 100%); +} +.btn-attention:active { + background: #880011; +} + +/*=== Navigation */ +.nav-list .nav-header, +.nav-list .item { + height: 2.5em; + line-height: 2.5em; + font-size: 0.9rem; +} +.nav-list .item:hover { + background: #26303F; +} +.nav-list .item.active { + background: #333; +} +.nav-list .item:hover a, +.nav-list .item.active a { + color: #888; +} +.nav-list .disable { + text-align: center; + color: #aaa; + background: #fafafa; +} +.nav-list .item > a { + padding: 0 10px; +} +.nav-list a:hover { + text-decoration: none; +} +.nav-list .item.empty a { + color: #c95; +} +.nav-list .item:hover.empty a, +.nav-list .item.active.empty a { + color: #fff; + background: #c95; +} +.nav-list .item.error a { + color: #a44; +} +.nav-list .item:hover.error a, +.nav-list .item.active.error a { + color: #fff; + background: #a44; +} + +.nav-list .nav-header { + padding: 0 10px; + font-weight: bold; + background: #111; + border-bottom: 1px solid #333; +} + +.nav-list .nav-form { + padding: 3px; + text-align: center; +} + +.nav-head { + margin: 0; + text-align: right; + background: #1c1c1c; + border-bottom: 1px solid #333; +} +.nav-head .item { + padding: 5px 10px; + font-size: 0.9rem; + line-height: 1.5rem; +} + +/*=== Horizontal-list */ +.horizontal-list { + margin: 0; + padding: 0; +} +.horizontal-list .item { + vertical-align: middle; +} + +/*=== Dropdown */ +.dropdown-menu { + margin: 5px 0 0; + padding: 5px 0; + font-size: 0.8rem; + text-align: left; + background: #1a1a1a; + border: 1px solid #888; + border-radius: 5px; +} +.dropdown-menu:after { + content: ""; + position: absolute; + top: -6px; + right: 13px; + width: 10px; + height: 10px; + z-index: -10; + transform: rotate(45deg); + -moz-transform: rotate(45deg); + -webkit-transform: rotate(45deg); + -ms-transform: rotate(45deg); + background: #1a1a1a; + border-top: 1px solid #888; + border-left: 1px solid #888; +} +.dropdown-header { + padding: 0 5px 5px; + font-weight: bold; + text-align: left; + color: #888; +} +.dropdown-menu > .item > a { + padding: 0 25px; + line-height: 2.5em; +} +.dropdown-menu > .item > span, +.dropdown-menu > .item > .as-link { + padding: 0 22px; + line-height: 2em; +} +.dropdown-menu > .item:hover { + background: #26303F; + color: #888; +} +.dropdown-menu > .item[aria-checked="true"] > a:before { + font-weight: bold; + margin: 0 0 0 -14px; +} +.dropdown-menu > .item:hover > a { + text-decoration: none; + color: #888; +} +.dropdown-menu .input select, +.dropdown-menu .input input { + margin: 0 auto 5px; + padding: 2px 5px; + border-radius: 3px; +} + +.separator { + margin: 5px 0; + border-bottom: 1px solid #333; +} + +/*=== Alerts */ +.alert { + margin: 15px auto; + padding: 10px 15px; + font-size: 0.9em; + background: #111; + border: 1px solid #888; + border-radius: 5px; + color: #aaa; +} +.alert-head { + font-size: 1.15em; +} +.alert > a { + text-decoration: underline; + color: inherit; +} +.alert-warn { + border: 1px solid #c95; + color: #c95; +} +.alert-success { + border: 1px solid #484; + color: #484; +} +.alert-error { + border: 1px solid #a44; + color: #a44; +} + +/*=== Pagination */ +.pagination { + text-align: center; + font-size: 0.8em; + background: #1c1c1c; + color: #888; +} +.content .pagination { + margin: 0; + padding: 0; +} +.pagination .item.pager-current { + font-weight: bold; + font-size: 1.5em; + background: #111; +} +.pagination .item a { + display: block; + font-style: italic; + line-height: 3em; + text-decoration: none; + color: #666; +} +.pagination .item a:hover { + background-color: #111; +} +.pagination:first-child .item { + border-bottom: 1px solid #333; +} +.pagination:last-child .item { + border-top: 1px solid #333; +} + +.pagination .loading, +.pagination a:hover.loading { + font-size: 0; +} + +/*=== STRUCTURE */ +/*===============*/ +/*=== Header */ +.header { + height: 85px; +} +.header > .item { + padding: 10px; + vertical-align: middle; + text-align: center; + border-bottom: 1px solid #333; +} +.header > .item.title{ + width: 230px; +} +.header > .item.title h1 { + margin: 0.5em 0; +} +.header > .item.title h1 a { + text-decoration: none; +} +.header > .item.search input { + width: 230px; +} +.header .item.search input:focus { + width: 350px; +} + +/*=== Body */ +#global { + height: calc(100% - 85px); +} +.aside { + border-right: 1px solid #333; + background: #1c1c1c; +} +.aside.aside_flux { + padding: 10px 0 50px; + border-right: 1px solid #333; + background: #1c1c1c; +} + +/*=== Aside main page (categories) */ +.categories { + text-align: center; +} +.category { + width: 235px; + margin: 10px auto; + text-align: left; +} +.category .btn:first-child { + position: relative; + width: 213px; +} +.category.stick .btn:first-child { + width: 176px; +} +.category .btn:first-child:not([data-unread="0"]):after { + position: absolute; + top: 3px; right: 3px; + padding: 1px 5px; + background: #111; + color: #888; + border: 1px solid #000; + border-radius: 5px; +} + +/*=== Aside main page (feeds) */ +.categories .feeds .item.active { + background: #333; +} +.categories .feeds .item.active .feed { + color: #888; +} +.categories .feeds .item.empty .feed { + color: #c95; +} +.categories .feeds .item.empty.active { + background: #c95; +} +.categories .feeds .item.error .feed { + color: #a44; +} +.categories .feeds .item.error.active { + background: #a44; +} +.categories .feeds .item.empty.active .feed, +.categories .feeds .item.error.active .feed { + color: #fff; +} +.categories .feeds .item .feed { + margin: 0; + width: 165px; + line-height: 3em; + font-size: 0.8em; + text-align: left; + text-decoration: none; +} +.categories .feeds .feed:not([data-unread="0"]) { + font-weight: bold; +} +.categories .feeds .dropdown-menu:after { + left: 2px; +} +.categories .feeds .item .dropdown-target:target ~ .dropdown-toggle > .icon, +.categories .feeds .item:hover .dropdown-toggle > .icon, +.categories .feeds .item.active .dropdown-toggle > .icon { + vertical-align: middle; + background-color: #111; + border-radius: 3px; +} + +/*=== Configuration pages */ +.post { + padding: 10px 50px; + font-size: 0.9em; +} +.post form { + margin: 10px 0; +} +.post.content { + max-width: 550px; +} + +/*=== Prompt (centered) */ +.prompt { + text-align: center; +} +.prompt label { + text-align: left; +} +.prompt form { + margin: 10px auto 20px auto; + width: 200px; +} +.prompt input { + margin: 5px auto; + width: 100%; +} +.prompt p { + margin: 20px 0; +} + +/*=== New article notification */ +#new-article { + text-align: center; + font-size: 0.9em; + background: #26303F; +} +#new-article:hover { + background: #4A5D7A; +} +#new-article > a { + line-height: 3em; + font-weight: bold; + color: #fff; +} +#new-article > a:hover { + text-decoration: none; +} + +/*=== Day indication */ +.day { + padding: 0 10px; + font-weight: bold; + line-height: 3em; + border-top: 1px solid #333; + border-bottom: 1px solid #333; +} +.day .name { + padding: 0 10px 0 0; + font-size: 1.8em; + opacity: 0.3; + font-style: italic; + text-align: right; + color: #aab; + text-shadow: 0px -1px 0px #333; +} + +/*=== Index menu */ +.nav_menu { + text-align: center; + padding: 5px 0; + border-bottom: 1px solid #2f2f2f; +} + +/*=== Feed articles */ +.flux { + border-left: 2px solid #2f2f2f; +} +.flux:hover { + background: #111; +} +.flux.current { + border-left: 2px solid #0062BE; + background: #111; +} +.flux.not_read { + border-left: 2px solid #FF5300; +} +.flux.favorite { + border-left: 2px solid #FFC300; +} + + +.flux_header { + font-size: 0.8rem; + cursor: pointer; +} +.flux_header .title { + font-size: 0.9rem; +} +.flux_header .item.title a { + color: #888; +} +.flux .website .favicon { + margin: 5px; +} +.flux .date { + font-size: 0.7rem; + color: #666; +} +.flux:not(.current):hover .item.title { + background: #111; +} + +.flux .bottom { + font-size: 0.8rem; + text-align: center; +} + +/*=== Content of feed articles */ +.content { + padding: 20px 10px; +} +.content > h1.title > a { + color: #888; +} + +.content hr { + margin: 30px 10px; + height: 1px; + background: #666; + border: 0; + box-shadow: 0 2px 5px #666; +} + +.content pre { + margin: 10px auto; + padding: 10px 20px; + overflow: auto; + background: #222; + color: #fff; + border: 1px solid #000; + font-size: 0.9rem; + border-radius: 3px; +} +.content code { + padding: 2px 5px; + color: #dd1144; + background: #000; + border: 1px solid #333; + border-radius: 3px; +} +.content pre code { + background: transparent; + color: #fff; + border: none; +} + +.content blockquote { + display: block; + margin: 0; + padding: 5px 20px; + border-top: 1px solid #444; + border-bottom: 1px solid #444; + background: #222; + color: #999; +} +.content blockquote p { + margin: 0; +} + +/*=== Notification and actualize notification */ +.notification { + padding: 0 0 0 5px; + text-align: center; + font-weight: bold; + font-size: 0.9em; + line-height: 3em; + z-index: 10; + vertical-align: middle; + border-radius: 5px; + box-shadow: 0 0 5px #666; + background: #111; + color: #c95; + border: 1px solid #c95; +} +.notification.good { + border-color: #484; + color: #484; +} +.notification.bad { + border-color: #a44; + color: #a44; +} +.notification a.close { + padding: 0 15px; + line-height: 3em; +} +.notification a.close:hover { + background: #222; + border-radius: 0 3px 3px 0; +} +.notification.good a.close:hover { + background: #484; +} +.notification.bad a.close:hover { + background: #a44; +} + +.notification#actualizeProgress { + line-height: 2em; +} + +/*=== "Load more" part */ +#bigMarkAsRead { + text-align: center; + text-decoration: none; +} +#bigMarkAsRead:hover { + background: #111; + color: #aaa; +} + +/*=== Navigation menu (for articles) */ +#nav_entries { + margin: 0; + text-align: center; + line-height: 3em; + table-layout: fixed; + background: #111; + border-top: 1px solid #333; +} + +/*=== READER VIEW */ +/*================*/ +#stream.reader .flux { + padding: 0 0 50px; + border: none; + background: #111; +} +#stream.reader .flux .author { + margin: 0 0 10px; + font-size: 90%; + color: #666; +} + +/*=== GLOBAL VIEW */ +/*================*/ +#stream.global .box-category { + text-align: left; + background: #1a1a1a; + border: 1px solid #000; + border-radius: 5px; + text-align: left; +} +#stream.global .category { + margin: 0; +} +#stream.global .btn { + width: auto; + height: 2em; + margin: 0; + padding: 0 10px; + line-height: 2em; + font-size: 1.2rem; + background: #26303F; + border: none; + border-bottom: 1px solid #000; + border-radius: 5px 5px 0 0; +} +#stream.global .btn:not([data-unread="0"]) { + font-weight: bold; + background: #34495e; + color: #fff; +} +#stream.global .btn:first-child:not([data-unread="0"]):after { + top: 0; right: 5px; + font-weight: bold; + border: 0; + background: none; + color: #fff; +} +#stream.global .box-category .feeds { + max-height: 250px; +} +#stream.global .box-category .feeds .item { + padding: 2px 10px; + font-size: 0.9rem; +} + +/*=== Panel */ +#panel { + background: #1c1c1c; + border: 1px solid #666; + border-radius: 3px; +} + +/*=== DIVERS */ +/*===========*/ +.aside.aside_feed .nav-form input, +.aside.aside_feed .nav-form select { + width: 140px; +} +.aside.aside_feed .nav-form .dropdown .dropdown-menu { + right: -20px; +} +.aside.aside_feed .nav-form .dropdown .dropdown-menu:after { + right: 33px; +} + +/*=== STATISTICS */ +/*===============*/ +.stat { + margin: 10px 0 20px; +} + +.stat th, +.stat td, +.stat tr { + border: none; +} +.stat > table td, +.stat > table th { + border-bottom: 1px solid #333; +} + +.stat > .horizontal-list { + margin: 0 0 5px; +} +.stat > .horizontal-list .item { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} +.stat > .horizontal-list .item:first-child { + width: 270px; +} + +/*=== LOGS */ +/*=========*/ +.logs { + overflow: hidden; + border: 1px solid #333; +} +.log { + padding: 5px 10px; + font-size: 0.8rem; + background: #111; + color: #888; +} +.log+.log { + border-top: 1px solid #333; +} +.log .date { + display: block; + font-weight: bold; +} +.log.error { + background: #a44; + color: #fff; +} +.log.warning { + background: #c95; + color: #fff; +} +.log.notice { + background: #ec9; + color: #000; +} +.log.debug { + background: #111; + color: #eee; +} + +/*=== MOBILE */ +/*===========*/ +@media(max-width: 840px) { + .aside { + transition: width 200ms linear; + -moz-transition: width 200ms linear; + -webkit-transition: width 200ms linear; + -o-transition: width 200ms linear; + -ms-transition: width 200ms linear; + } + .aside .toggle_aside, + #panel .close { + position: absolute; + display: block; + top: 0; right: 0; + width: 30px; + height: 30px; + line-height: 30px; + text-align: center; + background: #111; + border-left: 1px solid #333; + border-bottom: 1px solid #333; + border-radius: 0 0 0 5px; + } + + .nav_menu .btn { + margin: 5px 10px; + } + .nav_menu .stick { + margin: 0 10px; + } + .nav_menu .stick .btn { + margin: 5px 0; + } + .nav_menu .search { + display: inline-block; + max-width: 97%; + } + .nav_menu .search input { + max-width: 97%; + width: 90px; + } + .nav_menu .search input:focus { + width: 400px; + } + + .day .name { + font-size: 1.1rem; + } + + .pagination { + margin: 0 0 3.5em; + } + + .notification { + border-top: none; + border-right: none; + border-left: none; + border-radius: 0; + } + .notification a.close { + display: block; + left: 0; + } + .notification a.close:hover { + opacity: 0.5; + } + .notification a.close .icon { + display: none; + } +} diff --git a/p/themes/Dark/freshrss.css b/p/themes/Dark/freshrss.css deleted file mode 100644 index f6577c645..000000000 --- a/p/themes/Dark/freshrss.css +++ /dev/null @@ -1,927 +0,0 @@ -@charset "UTF-8"; - -/* STRUCTURE */ -.header { - display: table; - width: 100%; - background: #1c1c1c; - table-layout: fixed; -} - .header > .item { - display: table-cell; - padding: 10px 0; - border-bottom: 1px solid #2f2f2f; - vertical-align: middle; - text-align: center; - } - .header > .item.title { - width: 250px; - white-space: nowrap; - } - .logo { - display: inline-block; - font-size: 48px; - height: 32px; - width: 32px; - padding: 10px; - } - .header > .item.title h1 { - display: inline-block; - margin: 0; - } - .header > .item.search input { - width: 230px; - } - .header .item.search input:focus { - width: 330px; - } - .header > .item.configure { - width: 100px; - } - -.item a:hover { - text-decoration: none; -} - -#global { - display: table; - width: 100%; - height: 100%; - background: #1c1c1c; - table-layout: fixed; -} - .aside { - display: table-cell; - height: 100%; - width: 250px; - vertical-align: top; - border-right: 1px solid #2f2f2f; - background: #1c1c1c; - } - .aside .nav-form input { - width: 180px; - } - .aside.aside_flux { - padding: 10px 0 40px; - } - .aside.aside_feed .nav-form input { - width: 140px; - } - .aside.aside_feed .nav-form .dropdown .dropdown-menu { - right: -20px; - } - .aside.aside_feed .nav-form .dropdown .dropdown-menu:after { - right: 33px; - } - - .nav-login { - display: none; - } - - .nav_menu { - width: 100%; - background: #1c1c1c; - border-bottom: 1px solid #2f2f2f; - text-align: center; - padding: 5px 0; - } - .nav_menu .search { - display:none; - } - -.favicon { - height: 16px; - width: 16px; -} - -.categories { - margin: 0; - padding: 0; - text-align: center; - list-style: none; -} - .category { - display: block; - width: 220px; - margin: 10px auto; - text-align: left; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - } - .category .btn:first-child { - width: 195px; - position: relative; - } - .category.stick .btn:first-child { - width:160px; - } - .category .btn:first-child:not([data-unread="0"]):after { - content: attr(data-unread); - position: absolute; - top: 3px; right: 3px; - padding: 1px 5px; - background: #1a1a1a; - color: #888; - font-size: 90%; - border: 1px solid #000; - border-radius: 5px; - } - .category + .feeds:not(.active) { - display:none; - } - .categories .feeds { - width: 100%; - margin: 0; - list-style: none; - } - .categories .feeds .item.active { - background: #26303F; - } - .categories .feeds .item.active .feed { - color: #888; - } - .categories .feeds .item.empty .feed { - color: #e67e22; - } - .categories .feeds .item.empty.active { - background: #e67e22; - } - .categories .feeds .item.empty.active .feed { - color: #fff; - } - .categories .feeds .item.error .feed { - color: #BD362F; - } - .categories .feeds .item .feed { - display: inline-block; - margin: 0; - width: 165px; - line-height: 35px; - font-size: 90%; - vertical-align: middle; - text-align: left; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - } - .feed:not([data-unread="0"]):before { - content: "(" attr(data-unread) ") "; - } - .categories .feeds .dropdown-menu { - left: 0; - } - .categories .feeds .dropdown-menu:after { - left: 2px; - } - .categories .feeds .item .dropdown-toggle > .icon { - visibility: hidden; - cursor: pointer; - } - .categories .feeds .item .dropdown-target:target ~ .dropdown-toggle > .icon, - .categories .feeds .item:hover .dropdown-toggle > .icon, - .categories .feeds .item.active .dropdown-toggle > .icon { - background-color: #1c1c1c; - border-radius: 3px; - visibility: visible; - } - -.post { - padding: 10px 50px; -} - .post form { - margin: 10px 0; - } - -.day { - min-height: 50px; - padding: 0 10px; - font-size: 130%; - font-weight: bold; - line-height: 50px; - background: #1c1c1c; - border-top: 1px solid #2f2f2f; -} - #new-article + .day { - border-top: none; - } - .day .name { - position: absolute; - right: 0; - width: 50%; - height: 1.5em; - padding: 0 10px 0 0; - overflow: hidden; - color: #aab; - font-size: 1.8em; - opacity: .3; - text-shadow: 0px -1px 0px #333; - font-style: italic; - white-space: nowrap; - text-overflow: ellipsis; - text-align: right; - } - -#new-article { - display: none; - min-height: 40px; - background: #26303F; - text-align: center; -} - #new-article:hover { - background: #4A5D7A; - } - #new-article > a { - display: block; - line-height: 40px; - color: #fff; - font-weight: bold; - } - #new-article > a:hover { - text-decoration: none; - } - -.flux { - border-left: 3px solid #2f2f2f; - background: #1c1c1c; -} - .flux.not_read { - border-left: 3px solid #FF5300; - background: #1c1c1c; - } - .flux.favorite { - border-left: 3px solid #FFC300; - background: #1c1c1c; - } - .flux.current { - border-left: 3px solid #0062BE; - background: #1a1a1a; - } - - .horizontal-list > .item:not(.title):not(.website) > a { - display: block; - } - - .flux_header { - background: inherit; - height: 25px; - font-size: 12px; - border-top: 1px solid #2f2f2f; - cursor: pointer; - } - .flux .item { - line-height: 40px; - white-space: nowrap; - } - .flux_header > .item { - overflow: hidden; - text-overflow: ellipsis; - } - .flux .item.manage { - width: 40px; - text-align: center; - } - .flux .item.website { - width: 200px; - } - .website .favicon { - padding: 5px; - } - .flux .item.title { - background: inherit; - } - .flux .item.title a { - color: #888; - outline: none; - } - .flux.not_read .item.title, - .flux.current .item.title { - font-weight: bold; - } - .flux .item.date { - width: 145px; - padding:0 5px 0 0; - text-align: right; - font-size: 10px; - color: #666; - } - .link { - width: 40px; - text-align: center; - } - -#stream.reader .flux { - padding: 0 0 30px; - border: none; - background: #1c1c1c; - color: #888; -} - #stream.reader .flux .author { - margin: 0 0 10px; - font-size: 90%; - color: #666; - } - -#stream.global { - text-align: center; -} - #stream.global .box-category { - display: inline-block; - width: 280px; - margin: 20px 10px; - vertical-align: top; - background: #1a1a1a; - border: 1px solid #000; - border-radius: 5px; - text-align: left; - box-shadow: 0 0 5px #2f2f2f; - } - #stream.global .category { - width: 100%; - margin: 0; - } - #stream.global .btn { - display: block; - width: auto; - height: 35px; - margin: 0; - padding: 0 10px; - background: #26303F; - border: none; - border-bottom: 1px solid #2f2f2f; - border-radius: 5px 5px 0 0; - line-height: 35px; - font-size: 120%; - } - #stream.global .btn:not([data-unread="0"]) { - background: #34495e; - color: #fff; - font-weight: bold; - } - #stream.global .btn:first-child:not([data-unread="0"]):after { - top: 0; right: 5px; - border: 0; - background: none; - color: #fff; - font-weight: bold; - box-shadow: none; - } - #stream.global .box-category .feeds { - display: block; - max-height: 250px; - margin: 0; - list-style: none; - overflow: auto; - } - #stream.global .box-category .feeds .item { - padding: 2px 10px; - font-size: 90%; - } - #stream.global .box-category .feed { - width: 220px; - } - -.content { - min-height: 150px; - max-width: 550px; - margin: 0 auto; - padding: 20px 10px; - line-height: 170%; - word-wrap: break-word; -} - .content h1, .content h2, .content h3 { - margin: 20px 0 5px; - } - .content > .title { - font-size: x-large; - margin: 0; - } - - .content p { - margin: 0 0 20px; - } - img.big { - display: block; - margin: 10px auto; - } - figure img.big { - margin: 0; - } - .content hr { - margin: 30px 0; - height: 1px; - background: #ddd; - border: 0; - } - .content pre { - margin: 10px auto; - padding: 10px; - overflow: auto; - background: #000; - color: #fff; - font-size: 110%; - } - .content q, .content blockquote { - display: block; - margin: 5px 0; - padding: 5px 20px; - font-style: italic; - border-left: 4px solid #ccc; - color: #666; - } - .content blockquote p { - margin: 0; - } - -#panel { - display: none; - position: fixed; - top: 10px; bottom: 10px; - left: 100px; right: 100px; - overflow: auto; - background: #1c1c1c; - border: 1px solid #95a5a6; - border-radius: 5px; -} - #panel .close { - position: fixed; - top: 10px; right: 0; - display: inline-block; - width: 26px; - height: 26px; - margin: 0 10px 0 0; - border: 1px solid #ccc; - border-radius: 20px; - text-align: center; - line-height: 26px; - background: #fff; - } - -#overlay { - display: none; - position: fixed; - top: 0; bottom: 0; - left: 0; right: 0; - background: rgba(0, 0, 0, 0.9); -} - -.flux_content .bottom { - font-size: 90%; - text-align: center; -} - -.hide_posts > :not(.active) > .flux_content { - display:none; -} - -/*** PAGINATION ***/ -.pagination { - display: table; - width: 100%; - margin: 0; - background: #1a1a1a; - text-align: center; - color: #888; - font-size: 80%; - line-height: 200%; - table-layout: fixed; -} - .pagination .item { - display: table-cell; - line-height: 40px; - } - .pagination .item.pager-current { - font-weight: bold; - font-size: 140%; - } - .pagination .pager-first, - .pagination .pager-previous, - .pagination .pager-next, - .pagination .pager-last { - width: 100px; - } - .pagination .item a { - display: block; - color: #333; - font-style: italic; - } - .pagination:first-child .item { - border-bottom: 1px solid #aaa; - } - .pagination:last-child .item { - border-top: 1px solid #aaa; - } - -#nav_entries { - display: table; - width: 250px; - height: 40px; - position: fixed; - bottom: 0; - left: 0; - margin: 0; - background: #1c1c1c; - border-top: 1px solid #2f2f2f; - text-align: center; - line-height: 40px; - table-layout: fixed; -} - #nav_entries .item { - display: table-cell; - width: 30%; - } - #nav_entries a { - display: block; - } - #nav_entries .i_up { - margin: 5px 0 0; - vertical-align: top; - } - -.loading { - background: url("loader.gif") center center no-repeat; - font-size: 0; -} - -#bigMarkAsRead { - display: block; - font-style: normal; - padding: 32px 0 64px 0; - text-align: center; - text-decoration: none; -} - #bigMarkAsRead:hover { - background: #1c1c1c; - color: #888; - } - .bigTick { - font-size: 72pt; - line-height: 1.6em; - } - -/*** NOTIFICATION ***/ -#notification { - position: absolute; - top: 10px; - left: 25%; right: 25%; - min-height: 30px; - padding: 10px; - line-height: 30px; - text-align: center; - border-radius: 5px; - box-shadow: 0 0 5px #666; - background: #1a1a1a; - color: #888; - border: 1px solid #f4f899; - font-weight: bold; - z-index: 10; -} - #notification.closed { - display: none; - } - #notification a.close { - position: absolute; - top: -10px; right: -10px; - display: inline-block; - width: 16px; - height: 16px; - padding: 5px; - background: #1a1a1a; - border-radius: 50px; - line-height: 16px; - border:1px solid #f4f899; - } - -.toggle_aside, .btn.toggle_aside { - display: none; -} - -.actualizeProgress { - position: fixed; - top: 10px; - left: 25%; right: 25%; - padding: 5px; - background: #1a1a1a; - text-align: center; - border: 1px solid #2f2f2f; - border-radius: 5px; -} - .actualizeProgress progress { - max-width: 100%; - vertical-align: middle; - } - .actualizeProgress .progress { - color: #888; - font-size: 90%; - vertical-align: middle; - } - -.logs { - border: 1px solid #aaa; -} - .log { - padding: 5px 2%; - overflow: auto; - background: #fafafa; - border-bottom: 1px solid #999; - color: #333; - font-size: 90%; - } - .log .date { - display: block; - } - .log.error { - background: #fdd; - color: #844; - } - .log.warning { - background: #ffe; - color: #c95; - } - .log.notice { - background: #f4f4f4; - color: #aaa; - } - .log.debug { - background: #111; - color: #eee; - } - -.form-group table { - border-collapse:collapse; - margin:10px 0 0 220px; - text-align:center; -} - -.form-group tr, .form-group th, .form-group td { - border:1px solid #2f2f2f; - font-weight:normal; - padding:.5em; -} - -select.number option { - text-align:right; -} - -@media(min-width: 841px) { - .flux:not(.current):hover .item.title { - max-width: calc(100% - 580px); - padding-right: 1.5em; - position: absolute; - } -} - -@media(max-width: 840px) { - .header, - .aside .btn-important, - .aside .feeds .dropdown, - .flux_header .item.website span, - .item.date { - display: none; - } - .flux_header .item.website { - width: 40px; - text-align: center; - } - .flux_header .item.website .favicon { - padding: 12px; - } - - .nav-login { - display: block; - } - - .pagination { - margin: 0 0 40px; - } - .pagination .pager-previous, .pagination .pager-next { - width: 100px; - } - - .toggle_aside, .btn.toggle_aside { - display: inline-block; - } - .aside { - position: fixed; - top: 0; left: 0; - width: 0; - overflow: hidden; - border-right: none; - z-index: 10; - transition: width 200ms linear; - } - .aside.aside_flux { - padding: 10px 0 0; - } - .aside:target { - width: 80%; - border-right: 1px solid #aaa; - overflow: auto; - } - .aside .toggle_aside { - position: absolute; - right: 0; - display: inline-block; - width: 26px; - height: 26px; - margin: 0 10px 0 0; - border: 1px solid #ccc; - border-radius: 20px; - text-align: center; - line-height: 26px; - } - .aside .categories { - margin: 30px 0; - } - - #nav_entries { - width: 100%; - } - - .nav_menu .btn { - margin: 5px 10px; - } - .nav_menu .stick { - margin: 0 10px; - } - .nav_menu .stick .btn { - margin: 5px 0; - } - .nav_menu .search { - display: inline-block; - max-width: 97%; - } - .nav_menu .search input { - max-width: 97%; - width: 90px; - } - .nav_menu .search input:focus { - width: 400px; - } - - #panel { - left: 5px; right: 5px; - } - - .day .date { - display: none; - } - .day .name { - height: 2.6em; - font-size: 1em; - text-shadow: none; - } - - #notification, - .actualizeProgress { - top: 0; - left: 0; - right: 0; - border-radius: 0; - border: none; - border-bottom: 1px solid #f4f899; - } - #notification a.close { - left: 0; right: 0; - top: 0; bottom: 0; - width: auto; - height: auto; - background: transparent; - border: none; - } - #notification a.close .icon { - display: none; - } -} - -/*** FALLBACK ***/ -.btn { - background: #1c1c1c; -} - .btn:hover { - background: -moz-linear-gradient(top, #4A5D7A 0%, #26303F 100%); - background: -webkit-linear-gradient(top, #4A5D7A 0%, #26303F 100%); - background: -o-linear-gradient(top, #4A5D7A 0%, #26303F 100%); - background: -ms-linear-gradient(top, #4A5D7A 0%, #26303F 100%); - } - .btn-important { - background: #26303F; - } - .btn-important:hover { - background: -moz-linear-gradient(top, #4A5D7A 0%, #26303F 100%); - background: -webkit-linear-gradient(top, #4A5D7A 0%, #26303F 100%); - background: -o-linear-gradient(top, #4A5D7A 0%, #26303F 100%); - background: -ms-linear-gradient(top, #4A5D7A 0%, #26303F 100%); - } - .btn-attention { - background: #880011; - } - .btn-attention:hover { - background: -moz-linear-gradient(top, #cc0044 0%, #880011 100%); - background: -webkit-linear-gradient(top, #cc0044 0%, #880011 100%); - background: -o-linear-gradient(top, #cc0044 0%, #880011 100%); - background: -ms-linear-gradient(top, #cc0044 0%, #880011 100%); - } - -.dropdown-menu:after { - -moz-transform: rotate(45deg); - -webkit-transform: rotate(45deg); - -ms-transform: rotate(45deg); -} - -.nav-head { - background: #1c1c1c; -} - -input.extend { - -moz-transition: width 200ms linear; - -webkit-transition: width 200ms linear; - -o-transition: width 200ms linear; - -ms-transition: width 200ms linear; -} - -@media(max-width: 840px) { - .aside { - -moz-transition: width 200ms linear; - -webkit-transition: width 200ms linear; - -o-transition: width 200ms linear; - -ms-transition: width 200ms linear; - } -} - -@media print { - .header, - .aside, - .nav_menu, - .day, - .flux_header, - .flux_content .bottom, - .pagination { - display: none; - } - - html, body { - background: #fff; - color: #000; - font-family: Serif; - font-size: 12pt; - } - - #global, - .flux_content { - display: block !important; - } - - .flux_content .content { - width: 100% !important; - text-align: justify; - } - - .flux_content .content a { - color: #000; - } - .flux_content .content a:after { - content: " (" attr(href) ") "; - text-decoration: underline; - } -} - -.stat { - border:1px solid #2f2f2f; - border-radius:10px; - margin:10px 0; - padding:0 5px; -} -.stat > h2 { - border-bottom:1px solid #2f2f2f; - margin:0 -5px; - padding-left:5px; -} -.stat > div { - margin:5px 0; -} -.stat > table { - border-collapse:collapse; - margin:5px 0; - width:100%; -} -.stat > table > thead > tr { - border-bottom:2px solid #2f2f2f; -} -.stat > table > tbody > tr { - border-bottom:1px solid #2f2f2f; -} -.stat > table > tbody > tr:last-child { - border-bottom:0; -} -.stat > table th, .stat > table td { - border-left:2px solid #2f2f2f; - padding:5px; -} -.stat > table th:first-child, .stat > table td:first-child { - border-left:0; -} -.stat > table td.numeric{ - margin:5px 0; - text-align:center; -} diff --git a/p/themes/Dark/global.css b/p/themes/Dark/global.css deleted file mode 100644 index e296f2188..000000000 --- a/p/themes/Dark/global.css +++ /dev/null @@ -1,531 +0,0 @@ -@charset "UTF-8"; - -/* FONTS */ -@font-face { - font-family: "OpenSans"; - src: url("../fonts/openSans.woff") format("woff"); -} - - -* { - margin: 0; - padding: 0; -} -html, body { - height: 100%; - font-size: 95%; - font-family: "OpenSans", "Cantarell", "Helvetica", "Arial", sans-serif; - color: #888; -} - -/* LIENS */ -a { - color: #6986B2; - text-decoration: none; -} - a:hover { - text-decoration: underline; - } - -/* LISTES */ -ul, ol, dl { - margin: 10px 0 10px 30px; - line-height: 190%; -} - dd { - margin: 0 0 10px 30px; - } - -/* TITRES */ -h1, h2, h3 { - min-height: 40px; - margin: 15px 0 5px; - line-height: 40px; -} - -/* IMG */ -figure { - margin: 5px 0 10px; - text-align: center; -} - figcaption { - display: inline-block; - padding: 3px 20px; - color: #999; - font-style: italic; - border-bottom: 1px solid #ccc; - } -img { - height: auto; - max-width: 100%; - vertical-align: middle; -} - a img { - border: none; - } - -/* VIDEOS */ -iframe, embed, object, video { - max-width: 100%; -} - -/* FORMULAIRES */ -legend { - display: block; - width: 100%; - margin: 20px 0 5px; - padding: 5px 0; - border-bottom: 1px solid #2f2f2f; - font-size: 150%; - clear: both; -} -label { - display: block; - min-height: 25px; - padding: 5px 0; - font-size: 14px; - line-height: 25px; - cursor: pointer; -} -input { - width: 180px; -} -textarea { - width: 360px; - height: 100px; -} -input, select, textarea { - display: inline-block; - max-width: 100%; - min-height: 25px; - padding: 5px; - background: #333; - border: 1px solid #000; - border-radius: 3px; - color: #999; - line-height: 25px; - vertical-align: middle; - box-shadow: 0 2px 2px #1d1d1d inset; -} - option { - padding:0 .5em 0 .5em; - } - input[type="radio"], - input[type="checkbox"] { - width: 15px !important; - min-height: 15px !important; - } - input:focus, select:focus, textarea:focus { - color: #6986b2; - border-color: #2f2f2f; - } - input:invalid, select:invalid { - border-color: red; - box-shadow: 0 0 2px 1px red; - } - input:focus.extend { - width: 300px; - transition: width 200ms linear; - } - -.form-group { - margin: 0; -} - .form-group:after { - content: ""; - display: block; - clear: both; - } - .form-group.form-actions { - min-width: 250px; - padding: 5px 0; - background: #1a1a1a; - border-top: 1px solid #2f2f2f; - } - .form-group.form-actions .btn { - margin: 0 10px; - } - .form-group .group-name { - display: block; - float: left; - width: 200px; - padding: 10px 0; - text-align: right; - } - .form-group .group-controls { - min-width: 250px; - min-height: 25px; - margin: 0 0 0 220px; - padding: 5px 0; - } - .form-group .group-controls .control { - display: block; - min-height: 30px; - padding: 5px 0; - line-height: 25px; - font-size: 14px; - } - -.stick { - display: inline-block; - white-space: nowrap; - font-size: 0px; - vertical-align: middle; -} - .stick input, - .stick .btn { - border-radius: 0; - font-size: 14px; - } - .stick .btn:first-child, - .stick input:first-child { - border-radius: 3px 0 0 3px; - } - .stick .btn-important:first-child { - border-right: 1px solid #000; - } - .stick .btn:last-child, - .stick input:last-child { - border-radius: 0 3px 3px 0; - } - .stick .btn + .btn, - .stick .btn + input, - .stick .btn + .dropdown > .btn, - .stick input + .btn, - .stick input + input, - .stick input + .dropdown > .btn, - .stick .dropdown + .btn, - .stick .dropdown + input, - .stick .dropdown + .dropdown > .btn { - border-left: none; - } - .stick .btn + .dropdown > .btn { - border-left: none; - border-radius: 0 3px 3px 0; - } - .stick .btn + .dropdown a { - font-size: 12px; - } - -.btn { - display: inline-block; - min-height: 37px; - min-width: 15px; - padding: 5px 10px; - background: linear-gradient(to bottom, #fff 0%, #eee 100%); - border-radius: 3px; - border: 1px solid #000; - color: #888; - line-height: 20px; - vertical-align: middle; - cursor: pointer; - overflow: hidden; -} - a.btn { - min-height: 25px; - line-height: 25px; - } - .btn:hover { - background: linear-gradient(to bottom, #4A5D7A, #26303F); - text-decoration: none; - } - .btn.active, - .btn:active, - .dropdown-target:target ~ .btn.dropdown-toggle { - background: #26303F; - } - - .btn-important { - background: linear-gradient(to bottom, #0084CC, #0045CC); - color: #888888; - border: 1px solid #000000; - } - .btn-important:hover { - background: linear-gradient(to bottom, #0066CC, #0045CC); - } - .btn-important:active { - background: #0044CB; - box-shadow: none; - } - - .btn-attention { - background: linear-gradient(to bottom, #E95B57, #BD362F); - color: #888888; - border: 1px solid #000000; - } - .btn-attention:hover { - background: linear-gradient(to bottom, #D14641, #BD362F); - } - .btn-attention:active { - background: #BD362F; - box-shadow: none; - } - -/* NAVIGATION */ -.nav-list .nav-header, -.nav-list .item { - display: block; - height: 35px; - line-height: 35px; -} - .nav-list .item:hover { - background: #1a1a1a; - } - .nav-list .item:hover a { - color: #26303F; - } - .nav-list .item.active { - background: #26303F; - color: #1a1a1a; - } - .nav-list .item.active a { - color: #888; - } - .nav-list .disable { - color: #aaa; - background: #fafafa; - text-align: center; - } - .nav-list .item > * { - display: block; - padding: 0 10px; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - } - .nav-list a:hover { - text-decoration: none; - } - .nav-list .item.error a { - color: #BD362F; - } - .nav-list .item.active.error a { - color: #fff; - background: #BD362F; - } - .nav-list .item.empty a { - color: #f39c12; - } - .nav-list .item.active.empty a { - color: #fff; - background: #f39c12; - } - - .nav-list .nav-header { - padding: 0 10px; - background: #1a1a1a; - border-bottom: 1px solid #2f2f2f; - font-weight: bold; - } - .nav-list .separator { - display: block; - height: 0; - margin: 5px 0; - border-bottom: 1px solid #2f2f2f; - } - - .nav-list .nav-form { - padding: 3px; - text-align: center; - } - -.nav-head { - display: block; - margin: 0; - background: linear-gradient(to bottom, #fff, #f0f0f0); - border-bottom: 1px solid #2f2f2f; - text-align: right; -} - .nav-head .item { - display: inline-block; - padding: 5px 10px; - } - -/* HORIZONTAL-LIST */ -.horizontal-list { - display: table; - table-layout: fixed; - margin: 0; - padding: 0; - width: 100%; -} - .horizontal-list .item { - display: table-cell; - vertical-align: middle; - } - -/* DROPDOWN */ -.dropdown { - position: relative; - display: inline-block; -} - .dropdown-target { - display: none; - } - - .dropdown-menu { - display: none; - min-width: 200px; - margin: 5px 0 0; - padding: 5px 0; - position: absolute; - right: 0px; - background: #1a1a1a; - border: 1px solid #888; - border-radius: 5px; - text-align: left; - } - .dropdown-menu:after { - content: ""; - position: absolute; - top: -6px; - right: 13px; - width: 10px; - height: 10px; - background: #1a1a1a; - border-top: 1px solid #888; - border-left: 1px solid #888; - z-index: -10; - transform: rotate(45deg); - } - .dropdown-header { - display: block; - padding: 0 5px; - color: #888; - font-weight: bold; - font-size: 14px; - line-height: 30px; - } - .dropdown-menu .item { - display: block; - height: 30px; - font-size: 90%; - line-height: 30px; - } - .dropdown-menu > .item > a { - display: block; - padding: 0 25px; - line-height: 30px; - } - .dropdown-menu > .item.share > a { - display: list-item; - list-style-position:inside; - list-style-type:decimal; - } - .dropdown-menu > .item:hover { - background: #26303F; - color: #888; - } - .dropdown-menu > .item[aria-checked="true"] > a:before { - content: '✓ '; - font-weight: bold; - margin: 0 0 0 -1.2em; - padding: 0 0.2em 0 0; - } - .dropdown-menu > .item:hover > a { - color: #888; - text-decoration: none; - } - .dropdown-menu .input { - display: block; - height: 40px; - font-size: 90%; - line-height: 30px; - } - .dropdown-menu .input select, - .dropdown-menu .input input { - display: block; - height: 20px; - width: 95%; - margin: auto; - padding: 2px 5px; - border-radius: 3px; - } - .dropdown-menu .input select { - width: 70%; - height: auto; - } - .dropdown-menu .separator { - display: block; - height: 0; - margin: 5px 0; - border-bottom: 1px solid #888; - } - .dropdown-target:target ~ .dropdown-menu { - display: block; - z-index: 10; - } - .dropdown-close { - display: inline; - } - .dropdown-close a { - font-size: 0; - position: fixed; - top: 0; bottom: 0; - left: 0; right: 0; - display: block; - z-index: -10; - } - -/* ALERTS */ -.alert { - display: block; - width: 90%; - margin: 15px auto; - padding: 10px 15px; - background: #1a1a1a; - border: 1px solid #ccc; - border-right: 1px solid #aaa; - border-bottom: 1px solid #aaa; - border-radius: 5px; - color: #aaa; -} - .alert-head { - margin: 0; - font-weight: bold; - font-size: 110%; - } - .alert > a { - color: inherit; - text-decoration: underline; - } - .alert-warn { - border: 1px solid #c95; - color: #c95; - } - .alert-success { - border: 1px solid #484; - color: #484; - } - .alert-error { - border: 1px solid #844; - color: #844; - } - -/* ICÔNES */ -.icon { - display: inline-block; - width: 16px; - height: 16px; - vertical-align: middle; - line-height: 16px; -} - -/* Prompt (centré) */ -.prompt { - text-align: center; -} - .prompt label { - text-align: left; - } - .prompt form { - margin: 1em auto 2.5em auto; - width: 10em; - } - .prompt input { - margin: .4em auto 1.1em auto; - width: 100%; - } - .prompt p { - margin: 20px 0; - } diff --git a/p/themes/Dark/icons/icon.svg b/p/themes/Dark/icons/icon.svg new file mode 100644 index 000000000..4eb53dda9 --- /dev/null +++ b/p/themes/Dark/icons/icon.svg @@ -0,0 +1,12 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"> + <title>Logo FreshRSS</title> + <circle fill="#6986B2" cx="128" cy="128" r="33"/> + <g fill="none" stroke="#6986B2" stroke-width="24"> + <g stroke-opacity="0.3"> + <path d="M12,128 A116,116 0 1,1 128,244"/> + <path d="M54,128 A74,74 0 1,1 128,202"/> + </g> + <path d="M128,12 A116,116 0 0,1 244,128"/> + <path d="M128,54 A74,74 0 0,1 202,128"/> + </g> +</svg> diff --git a/p/themes/Dark/metadata.json b/p/themes/Dark/metadata.json index 27cae27df..bdc068c2e 100644 --- a/p/themes/Dark/metadata.json +++ b/p/themes/Dark/metadata.json @@ -2,6 +2,6 @@ "name": "Dark", "author": "AD", "description": "Le coté obscur du thème “Origine”", - "version": 0.1, - "files": ["global.css", "freshrss.css"] + "version": 0.2, + "files": ["_template.css", "dark.css"] } diff --git a/p/themes/Flat/flat.css b/p/themes/Flat/flat.css new file mode 100644 index 000000000..484cee9f3 --- /dev/null +++ b/p/themes/Flat/flat.css @@ -0,0 +1,977 @@ +@charset "UTF-8"; + +/*=== FONTS */ +@font-face { + font-family: "OpenSans"; + src: url("../fonts/openSans.woff") format("woff"); +} + +/*=== GENERAL */ +/*============*/ +html, body { + height: 100%; + font-family: "OpenSans", "Cantarell", "Helvetica", "Arial", sans-serif; + background: #fafafa; +} + +/*=== Links */ +a, button.as-link { + color: #2980b9; + outline: none; +} + +/*=== Forms */ +legend { + display: inline-block; + width: auto; + margin: 20px 0 5px; + padding: 5px 20px; + font-size: 1.4em; + clear: both; + background: #ecf0f1; + border-radius: 20px; +} +label { + min-height: 25px; + padding: 5px 0; + cursor: pointer; + color: #444; +} +textarea { + width: 360px; + height: 100px; +} +input, select, textarea { + min-height: 25px; + padding: 5px; + line-height: 25px; + vertical-align: middle; + background: #fff; + border: none; + border-bottom: 3px solid #ddd; + border-left-color: #ddd; + color: #666; + border-radius: 5px; +} +option { + padding: 0 .5em; +} +input:focus, select:focus, textarea:focus { + color: #333; + border-color: #2980b9; +} +input:invalid, select:invalid { + color: #f00; + border-color: #f00; + box-shadow: none; +} +input:disabled, select:disabled { + background: #eee; +} +input.extend { + transition: width 200ms linear; + -moz-transition: width 200ms linear; + -webkit-transition: width 200ms linear; + -o-transition: width 200ms linear; + -ms-transition: width 200ms linear; +} + +/*=== Tables */ +table { + border-collapse: collapse; +} + +tr, th, td { + padding: 0.5em; + border: 1px solid #ddd; +} +th { + background: #f6f6f6; +} +form td, +form th { + font-weight: normal; + text-align: center; +} + +/*=== COMPONENTS */ +/*===============*/ +/*=== Forms */ +.form-group { + padding: 5px; + border: 1px solid transparent; + border-radius: 3px; +} +.form-group:after { + content: ""; + display: block; + clear: both; +} +.form-group:hover { + background: #fff; + border: 1px solid #eee; + border-radius: 3px; + border: 1px solid #eee; +} +.form-group.form-actions { + margin: 15px 0 25px; + padding: 5px 0; + background: #ecf0f1; + border-top: 3px solid #bdc3c7; + border-radius: 5px 5px 0 0; +} +.form-group.form-actions .btn { + margin: 0 10px; +} +.form-group .group-name { + padding: 10px 0; + text-align: right; +} +.form-group .group-controls { + min-height: 25px; + padding: 5px 0; +} +.form-group .group-controls .control { + line-height: 2.0em; +} +.form-group table { + margin: 10px 0 0 220px; +} + +/*=== Buttons */ +.stick { + vertical-align: middle; + font-size: 0; +} +.stick input, +.stick .btn { + border-radius: 0; +} +.stick .btn:first-child, +.stick input:first-child { + border-radius: 5px 0 0 5px; +} +.stick .btn:last-child, +.stick input:last-child, +.stick .btn + .dropdown > .btn { + border-radius: 0 5px 5px 0; +} +.stick .btn + .btn, +.stick .btn + input, +.stick .btn + .dropdown > .btn, +.stick input + .btn, +.stick input + input, +.stick input + .dropdown > .btn, +.stick .dropdown + .btn, +.stick .dropdown + input, +.stick .dropdown + .dropdown > .btn { + border-left-width: 1px; + border-left-style: solid; +} + +.btn { + display: inline-block; + min-height: 38px; + min-width: 15px; + margin: 0; + padding: 5px 10px; + font-size: 0.9rem; + vertical-align: middle; + cursor: pointer; + overflow: hidden; + background: #3498db; + border-radius: 5px; + border: none; + border-bottom: 3px solid #2980b9; + border-left-color: #2980b9; + color: #fff; +} +a.btn { + min-height: 25px; + line-height: 25px; +} +.btn:hover { + text-decoration: none; +} +.btn.active, +.btn:active, +.btn:hover, +.dropdown-target:target ~ .btn.dropdown-toggle { + background: #2980b9; +} + +.btn-important { + font-weight: normal; + background: #e67e22; + color: #fff; + border-bottom: 3px solid #d35400; + border-left-color: #d35400; +} +.btn-important:hover, +.btn-important:active { + background: #d35400; +} + +.btn-attention { + background: #e74c3c; + color: #fff; + border-bottom: 3px solid #c0392b; + border-left-color: #c0392b; +} +.btn-attention:hover, +.btn-attention:active { + background: #c0392b; +} + +/*=== Navigation */ +.nav-list .nav-header, +.nav-list .item { + height: 2.5em; + line-height: 2.5em; + font-size: 0.9rem; +} +.nav-list .item:hover, +.nav-list .item.active { + background: #2980b9; + color: #fff; +} +.nav-list .item:hover a, +.nav-list .item.active a { + color: #fff; +} +.nav-list .disable { + text-align: center; + background: #fafafa; + color: #aaa; +} +.nav-list .item > a { + padding: 0 10px; +} +.nav-list a:hover { + text-decoration: none; +} +.nav-list .item.empty a { + color: #f39c12; +} +.nav-list .item:hover.empty a, +.nav-list .item.active.empty a { + color: #fff; + background: #f39c12; +} +.nav-list .item.error a { + color: #bd362f; +} +.nav-list .item:hover.error a, +.nav-list .item.active.error a { + color: #fff; + background: #bd362f; +} + +.nav-list .nav-header { + padding: 0 10px; + font-weight: bold; + background: #34495e; + color: #fff; +} + +.nav-list .nav-form { + padding: 3px; + text-align: center; +} + +.nav-head { + margin: 0; + text-align: right; + background: #34495e; + color: #fff; +} +.nav-head a { + color: #fff; +} +.nav-head .item { + padding: 5px 10px; + font-size: 0.9rem; + line-height: 1.5rem; +} + +/*=== Horizontal-list */ +.horizontal-list { + margin: 0; + padding: 0; +} +.horizontal-list .item { + vertical-align: middle; +} + +/*=== Dropdown */ +.dropdown-menu { + margin: 5px 0 0; + padding: 5px 0; + font-size: 0.8rem; + text-align: left; + border: 1px solid #95a5a6; + border-radius: 3px; +} +.dropdown-menu:after { + content: ""; + position: absolute; + top: -6px; + right: 13px; + width: 10px; + height: 10px; + z-index: -10; + transform: rotate(45deg); + -moz-transform: rotate(45deg); + -webkit-transform: rotate(45deg); + -ms-transform: rotate(45deg); + background: #fff; + border-top: 1px solid #95a5a6; + border-left: 1px solid #95a5a6; +} +.dropdown-header { + padding: 0 5px 5px; + font-weight: bold; + text-align: left; + color: #34495e; +} +.dropdown-menu > .item > a { + padding: 0 25px; + line-height: 2.5em; +} +.dropdown-menu > .item > span, +.dropdown-menu > .item > .as-link { + padding: 0 22px; + line-height: 2em; +} +.dropdown-menu > .item:hover { + background: #2980b9; + color: #fff; +} +.dropdown-menu > .item[aria-checked="true"] > a:before { + font-weight: bold; + margin: 0 0 0 -14px; +} +.dropdown-menu > .item:hover > a { + text-decoration: none; + color: #fff; +} +.dropdown-menu .input select, +.dropdown-menu .input input { + margin: 0 auto 5px; + padding: 2px 5px; + border-radius: 3px; +} + +.separator { + margin: 5px 0; + border-bottom: 1px solid #ddd; +} + +/*=== Alerts */ +.alert { + margin: 15px auto; + padding: 10px 15px; + font-size: 0.9em; + background: #f4f4f4; + border: 1px solid #ccc; + border-right: 1px solid #aaa; + border-bottom: 1px solid #aaa; + border-radius: 5px; + color: #aaa; + text-shadow: 0 0 1px #eee; +} +.alert-head { + font-size: 1.15em; +} +.alert > a { + text-decoration: underline; + color: inherit; +} +.alert-warn { + background: #ffe; + border: 1px solid #eeb; + color: #c95; +} +.alert-success { + background: #dfd; + border: 1px solid #cec; + color: #484; +} +.alert-error { + background: #fdd; + border: 1px solid #ecc; + color: #844; +} + +/*=== Pagination */ +.pagination { + text-align: center; + font-size: 0.8em; + background: #ecf0f1; + color: #000; +} +.content .pagination { + margin: 0; + padding: 0; +} +.pagination .item.pager-current { + font-weight: bold; + font-size: 1.5em; + background: #34495e; + color: #ecf0f1; +} +.pagination .item a { + display: block; + font-style: italic; + line-height: 3em; + text-decoration: none; + color: #000; +} +.pagination .item a:hover { + background: #34495e; + color: #ecf0f1; +} + +.pagination .loading, +.pagination a:hover.loading { + font-size: 0; + background: url("loader.gif") center center no-repeat #34495e; +} + +/*=== STRUCTURE */ +/*===============*/ +/*=== Header */ +.header { + height: 85px; + background: #ecf0f1; +} +.header > .item { + padding: 10px; + vertical-align: middle; + text-align: center; +} +.header > .item.title{ + width: 230px; +} +.header > .item.title h1 { + margin: 0.5em 0; +} +.header > .item.title h1 a { + text-decoration: none; +} +.header > .item.search input { + width: 230px; +} +.header .item.search input:focus { + width: 350px; +} + +/*=== Body */ +#global { + height: calc(100% - 85px); +} +.aside { + background: #ecf0f1; +} +.aside.aside_flux { + padding: 10px 0 50px; + background: #ecf0f1; +} + +/*=== Aside main page (categories) */ +.categories { + text-align: center; +} +.category { + width: 233px; + margin: 10px auto; + text-align: left; +} +.category .btn:first-child { + position: relative; + width: 212px; +} +.category.stick .btn:first-child { + width: 175px; +} +.category .btn:first-child:not([data-unread="0"]):after { + position: absolute; + top: 5px; right: 5px; + padding: 1px 5px; + background: #3498DB; + color: #fff; + border-radius: 5px; +} + +/*=== Aside main page (feeds) */ +.categories .feeds .item.active { + background: #2980b9; +} +.categories .feeds .item.empty.active { + background: #f39c12; +} +.categories .feeds .item.error.active { + background: #bd362f; +} +.categories .feeds .item.empty .feed { + color: #e67e22; +} +.categories .feeds .item.error .feed { + color: #bd362f; +} +.categories .feeds .item.active .feed, +.categories .feeds .item.empty.active .feed, +.categories .feeds .item.error.active .feed { + color: #fff; +} +.categories .feeds .item .feed { + margin: 0; + width: 165px; + line-height: 3em; + font-size: 0.8em; + text-align: left; + text-decoration: none; +} +.categories .feeds .feed:not([data-unread="0"]) { + font-weight: bold; +} +.categories .feeds .dropdown-menu:after { + left: 2px; +} +.categories .feeds .item .dropdown-target:target ~ .dropdown-toggle > .icon, +.categories .feeds .item:hover .dropdown-toggle > .icon, +.categories .feeds .item.active .dropdown-toggle > .icon { + vertical-align: middle; + background-color: #95a5a6; + border-radius: 3px; +} + +/*=== Configuration pages */ +.post { + padding: 10px 50px; + font-size: 0.9em; +} +.post form { + margin: 10px 0; +} +.post.content { + max-width: 550px; +} + +/*=== Prompt (centered) */ +.prompt { + text-align: center; +} +.prompt label { + text-align: left; +} +.prompt form { + margin: 10px auto 20px auto; + width: 200px; +} +.prompt input { + margin: 5px auto; + width: 100%; +} +.prompt p { + margin: 20px 0; +} + +/*=== New article notification */ +#new-article { + text-align: center; + font-size: 0.9em; + background: #3498db; +} +#new-article:hover { + background: #2980b9; +} +#new-article > a { + line-height: 3em; + font-weight: bold; + color: #fff; +} +#new-article > a:hover { + text-decoration: none; +} + +/*=== Day indication */ +.day { + padding: 0 10px; + font-weight: bold; + line-height: 3em; + border-left: 2px solid #ecf0f1; +} +.day .name { + padding: 0 10px 0 0; + font-size: 1.8em; + opacity: 0.3; + font-style: italic; + text-align: right; + color: #aab; +} + +/*=== Index menu */ +.nav_menu { + text-align: center; + padding: 5px 0; +} + +/*=== Feed articles */ +.flux { + border-left: 2px solid #ecf0f1; +} +.flux:hover { + background: #fff; +} +.flux.current { + border-left-color: #3498db; +} +.flux.not_read { + background: #FFF3ED; + border-left-color: #FF5300; +} +.flux.not_read:not(.current):hover .item.title { + background: #FFF3ED; +} +.flux.favorite { + background: #FFF6DA; + border-left-color: #FFC300; +} +.flux.favorite:not(.current):hover .item.title { + background: #FFF6DA; +} +.flux.current { + background: #fff; +} + + +.flux_header { + font-size: 0.8rem; + cursor: pointer; + border-top: 1px solid #ecf0f1; +} +.flux_header .title { + font-size: 0.9rem; +} +.flux .website .favicon { + padding: 5px; +} +.flux .date { + font-size: 0.7rem; + color: #666; +} + +.flux .bottom { + font-size: 0.8rem; + text-align: center; +} + +/*=== Content of feed articles */ +.content { + padding: 20px 10px; +} +.content > h1.title > a { + color: #000; +} + +.content hr { + margin: 30px 10px; + height: 1px; + background: #ddd; + border: 0; + box-shadow: 0 2px 5px #ccc; +} + +.content pre { + margin: 10px auto; + padding: 10px 20px; + overflow: auto; + background: #222; + color: #fff; + font-size: 0.9rem; + border-radius: 3px; +} +.content code { + padding: 2px 5px; + color: #dd1144; + background: #fafafa; + border: 1px solid #eee; + border-radius: 3px; +} +.content pre code { + background: transparent; + color: #fff; + border: none; +} + +.content blockquote { + display: block; + margin: 0; + padding: 5px 20px; + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + background: #fafafa; + color: #333; +} +.content blockquote p { + margin: 0; +} + +/*=== Notification and actualize notification */ +.notification { + padding: 0 0 0 5px; + text-align: center; + font-weight: bold; + font-size: 0.9em; + line-height: 3em; + z-index: 10; + vertical-align: middle; + background: #ddd; + color: #666; + border-radius: 3px; + border: none; +} +.notification.good { + background: #1abc9c; + color: #fff; +} +.notification.bad { + background: #e74c3c; + color: #fff; +} +.notification a.close { + padding: 0 15px; + line-height: 3em; + border-radius: 0 3px 3px 0; +} +.notification.good a.close:hover { + background: #16a085; +} +.notification.bad a.close:hover { + background: #c0392b; +} + +.notification#actualizeProgress { + line-height: 2em; +} + +/*=== "Load more" part */ +#bigMarkAsRead { + text-align: center; + text-decoration: none; + background: #ecf0f1; +} +#bigMarkAsRead:hover { + background: #34495e; + color: #fff; +} + +/*=== Navigation menu (for articles) */ +#nav_entries { + margin: 0; + text-align: center; + line-height: 3em; + table-layout: fixed; + background: #34495e; +} + +/*=== READER VIEW */ +/*================*/ +#stream.reader .flux { + padding: 0 0 50px; + background: #ecf0f1; + color: #34495e; + border: none; +} +#stream.reader .flux .author { + margin: 0 0 10px; + font-size: 90%; + color: #999; +} + +/*=== GLOBAL VIEW */ +/*================*/ +#stream.global .box-category { + text-align: left; + border: 1px solid #ddd; + border-radius: 5px; +} +#stream.global .category { + margin: 0; +} +#stream.global .btn { + width: auto; + height: 2em; + margin: 0; + padding: 0 10px; + line-height: 2em; + font-size: 1.2rem; + background: #ecf0f1; + color: #333; + border-bottom: 1px solid #ddd; + border-radius: 5px 5px 0 0; +} +#stream.global .btn:not([data-unread="0"]) { + font-weight: bold; + background: #3498db; + color: #fff; +} +#stream.global .btn:first-child:not([data-unread="0"]):after { + top: 0; right: 5px; + font-weight: bold; + background: none; + border: 0; + color: #fff; +} +#stream.global .box-category .feeds { + max-height: 250px; +} +#stream.global .box-category .feeds .item { + padding: 2px 10px; + font-size: 0.9rem; +} + +/*=== DIVERS */ +/*===========*/ +.aside.aside_feed .nav-form input, +.aside.aside_feed .nav-form select { + width: 140px; +} +.aside.aside_feed .nav-form .dropdown .dropdown-menu { + right: -20px; +} +.aside.aside_feed .nav-form .dropdown .dropdown-menu:after { + right: 33px; +} + +/*=== STATISTICS */ +/*===============*/ +.stat { + margin: 10px 0 20px; +} + +.stat th, +.stat td, +.stat tr { + border: none; +} +.stat > table td, +.stat > table th { + border-bottom: 1px solid #ddd; +} + +.stat > .horizontal-list { + margin: 0 0 5px; +} +.stat > .horizontal-list .item { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} +.stat > .horizontal-list .item:first-child { + width: 270px; +} + +/*=== LOGS */ +/*=========*/ +.logs { + overflow: hidden; + border: 1px solid #aaa; +} +.log { + margin: 10px 0; + padding: 5px 2%; + overflow: auto; + font-size: 0.8rem; + background: #fafafa; + color: #666; +} + +.log > .date { + margin: 0 10px 0 0; + padding: 5px 10px; + border-radius: 20px; +} +.log.error > .date { + background: #e74c3c; + color: #fff; +} +.log.warning > .date { + background: #f39c12; +} +.log.notice > .date { + background: #ecf0f1; +} +.log.debug > .date { + background: #111; + color: #eee; +} + +/*=== MOBILE */ +/*===========*/ +@media(max-width: 840px) { + .aside { + transition: width 200ms linear; + -moz-transition: width 200ms linear; + -webkit-transition: width 200ms linear; + -o-transition: width 200ms linear; + -ms-transition: width 200ms linear; + } + .aside .toggle_aside, + #panel .close { + position: absolute; + display: block; + top: 0; right: 0; + width: 32px; + height: 32px; + line-height: 30px; + text-align: center; + background: #34495e; + border-radius: 0 0 0 5px; + } + + .nav_menu .btn { + margin: 5px 10px; + } + .nav_menu .stick { + margin: 0 10px; + } + .nav_menu .stick .btn { + margin: 5px 0; + } + .nav_menu .search { + display: inline-block; + max-width: 97%; + } + .nav_menu .search input { + max-width: 97%; + width: 90px; + } + .nav_menu .search input:focus { + width: 400px; + } + + .day .name { + font-size: 1.1rem; + } + + .pagination { + margin: 0 0 3.5em; + } + + .notification { + border-radius: 0; + } + .notification a.close { + display: block; + left: 0; + background: transparent; + } + .notification a.close:hover { + opacity: 0.5; + } + .notification a.close .icon { + display: none; + } +} diff --git a/p/themes/Flat/freshrss.css b/p/themes/Flat/freshrss.css deleted file mode 100644 index 1d551d8fb..000000000 --- a/p/themes/Flat/freshrss.css +++ /dev/null @@ -1,905 +0,0 @@ -@charset "UTF-8"; - -/* STRUCTURE */ -body { - background: #fafafa; -} - -.header { - display: table; - width: 100%; - table-layout: fixed; - background: #ecf0f1; -} - .header > .item { - display: table-cell; - padding: 10px 0; - vertical-align: middle; - text-align: center; - } - .header > .item.title { - width: 250px; - white-space: nowrap; - } - .logo { - display: inline-block; - font-size: 48px; - height: 32px; - width: 32px; - padding: 10px; - } - .header > .item.title h1 { - display: inline-block; - margin: 0; - } - .header > .item.search input { - width: 230px; - } - .header .item.search input:focus { - width: 330px; - } - .header > .item.configure { - width: 100px; - } - -.item a:hover { - text-decoration: none; -} - -#global { - display: table; - width: 100%; - height: 100%; - table-layout: fixed; -} - .aside { - display: table-cell; - height: 100%; - width: 250px; - vertical-align: top; - background: #ecf0f1; - } - .aside .nav-form input { - width: 180px; - } - .aside.aside_flux { - padding: 10px 0 40px; - } - .aside.aside_feed .nav-form input { - width: 140px; - } - .aside.aside_feed .nav-form .dropdown-menu { - right: -20px; - } - .aside.aside_feed .nav-form .dropdown-menu:after { - right: 33px; - } - - .nav-login { - display: none; - } - - .nav_menu { - width: 100%; - text-align: center; - padding: 5px 0; - } - .nav_menu .search { - display:none; - } - -.favicon { - height: 16px; - width: 16px; -} - -.categories { - margin: 0; - padding: 0; - text-align: center; - list-style: none; -} - .category { - display: block; - width: 220px; - margin: 10px auto; - text-align: left; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - } - .category .btn:first-child { - width: 195px; - position: relative; - } - .category.stick .btn:first-child { - width:160px; - } - .category .btn:first-child:not([data-unread="0"]):after { - content: attr(data-unread); - position: absolute; - top: 5px; right: 5px; - padding: 0 5px; - color: #fff; - font-size: 90%; - background: #3498DB; - border-radius: 5px; - } - .category + .feeds:not(.active) { - display:none; - } - .categories .feeds { - width: 100%; - margin: 0 auto; - list-style: none; - } - .categories .feeds .item.active:after { - content: "⇢"; - line-height: 35px; - float: right; - } - .categories .feeds .item.empty .feed { - color: #e67e22; - } - .categories .feeds .item.error .feed { - color: #BD362F; - } - .categories .feeds .item .feed { - display: inline-block; - margin: 0; - width: 165px; - line-height: 35px; - font-size: 90%; - vertical-align: middle; - text-align: left; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - } - .feed:not([data-unread="0"]) { - font-weight:bold; - } - .feed:not([data-unread="0"]):before { - content: "(" attr(data-unread) ") "; - } - .categories .feeds .dropdown-menu { - left: 0; - } - .categories .feeds .dropdown-menu:after { - left: 2px; - } - .categories .feeds .item .dropdown-toggle > .icon { - visibility: hidden; - cursor: pointer; - } - .categories .feeds .item .dropdown-target:target ~ .dropdown-toggle > .icon, - .categories .feeds .item:hover .dropdown-toggle > .icon, - .categories .feeds .item.active .dropdown-toggle > .icon { - background-color: #95a5a6; - border-radius: 3px; - visibility: visible; - } - .categories .btn:hover .notRead, - .categories .btn.active .notRead { - background: #2980B9; - border-left: 3px solid #3498DB; - } - -.post { - padding: 10px 50px; -} - .post form { - margin: 10px 0; - } - -.day { - padding: 5px 15px; - font-size: 130%; - font-weight: bold; - line-height: 50px; - border-left: 3px solid #ecf0f1; -} - .day .name { - position: absolute; - right: 0; - width: 50%; - height: 1.5em; - padding: 0 10px 0 0; - overflow: hidden; - color: #aab; - font-size: 1.8em; - opacity: .3; - font-style: italic; - text-align: right; - white-space: nowrap; - text-overflow: ellipsis; - z-index: -10; - } - -#new-article { - display: none; - min-height: 40px; - background: #3498db; - text-align: center; -} - #new-article:hover { - background: #2980b9; - } - #new-article > a { - display: block; - line-height: 40px; - color: #fff; - font-weight: bold; - } - #new-article > a:hover { - text-decoration: none; - } - -.flux { - border-left: 3px solid #ecf0f1; -} - .flux:hover { - background: #fff; - } - .flux.not_read { - border-left-color: #FF5300; - background: #FFF3ED; - } - .flux.favorite { - border-left-color: #FFC300; - background: #FFF6DA; - } - .flux.current { - border-left-color: #3498db; - background: #fff; - } - - .horizontal-list > .item:not(.title):not(.website) > a { - display: block; - } - - .flux_header { - background: inherit; - height: 25px; - font-size: 12px; - border-top: 1px solid #ecf0f1; - cursor: pointer; - } - .flux .item { - line-height: 40px; - white-space: nowrap; - } - .flux_header > .item { - overflow: hidden; - text-overflow: ellipsis; - } - .flux .item.manage { - width: 40px; - text-align: center; - } - .flux .item.website { - width: 200px; - } - .website .favicon { - padding: 5px; - } - .flux .item.title { - background: inherit; - } - .flux .item.title a { - color: #333; - outline: none; - } - .flux.current .item.title, - .flux.not_read .item.title { - font-weight: bold; - } - .flux .item.date { - width: 145px; - padding:0 5px 0 0; - text-align: right; - font-size: 10px; - color: #666; - } - .link { - width: 40px; - text-align: center; - } - -#stream.reader .flux { - position: relative; - padding: 0 0 30px; - border: none; - background: #ecf0f1; - color: #34495e; - font-size: 120%; -} - #stream.reader .flux .author { - margin: 0 0 10px; - font-size: 90%; - color: #aaa; - } - -#stream.global { - text-align: center; -} - #stream.global .box-category { - display: inline-block; - width: 280px; - margin: 20px 10px; - vertical-align: top; - border: 1px solid #ddd; - border-radius: 5px; - text-align: left; - } - #stream.global .category { - width: 100%; - margin: 0; - } - #stream.global .btn { - display: block; - width: auto; - height: 35px; - margin: 0; - padding: 0 10px; - background: #ecf0f1; - color: #333; - border-bottom: 1px solid #ddd; - border-radius: 5px 5px 0 0; - line-height: 35px; - font-size: 120%; - } - #stream.global .btn:not([data-unread="0"]) { - background: #3498db; - color: #fff; - font-weight: bold; - } - #stream.global .btn:first-child:not([data-unread="0"]):after { - top: 0; right: 5px; - border: 0; - background: none; - color: #fff; - font-weight: bold; - box-shadow: none; - } - #stream.global .box-category .feeds { - display: block; - max-height: 250px; - margin: 0; - list-style: none; - overflow: auto; - } - #stream.global .box-category .feeds .item { - padding: 2px 10px; - font-size: 90%; - } - #stream.global .box-category .feed { - width: 220px; - } - -.content { - min-height: 150px; - max-width: 550px; - margin: 0 auto; - padding: 20px 10px; - line-height: 170%; - word-wrap: break-word; -} - .content h1, .content h2, .content h3 { - margin: 20px 0 5px; - } - .content > .title { - font-size: x-large; - margin: 0; - } - - .content p { - margin: 0 0 20px; - } - img.big { - display: block; - margin: 10px auto; - } - figure img.big { - margin: 0; - } - .content hr { - margin: 30px 0; - height: 1px; - background: #ddd; - border: 0; - } - .content pre { - margin: 10px auto; - padding: 10px; - overflow: auto; - background: #000; - color: #fff; - font-size: 110%; - } - .content q, .content blockquote { - display: block; - margin: 5px 0; - padding: 5px 20px; - font-style: italic; - border-left: 4px solid #ccc; - color: #666; - } - .content blockquote p { - margin: 0; - } - -#panel { - display: none; - position: fixed; - top: 10px; bottom: 10px; - left: 100px; right: 100px; - overflow: auto; - background: #fff; - border: 1px solid #95a5a6; - border-radius: 5px; -} - #panel .close { - position: fixed; - top: 10px; right: 0px; - display: inline-block; - width: 26px; - height: 26px; - margin: 0 10px 0 0; - border-radius: 3px; - text-align: center; - line-height: 24px; - background: #95a5a6; - } - #panel .close:hover { - background: #7f8c8d; - } - -#overlay { - display: none; - position: fixed; - top: 0; bottom: 0; - left: 0; right: 0; - background: rgba(0, 0, 0, 0.9); -} - -.flux_content .bottom { - font-size: 90%; - text-align: center; -} - -.hide_posts > :not(.active) > .flux_content { - display:none; -} - -/*** PAGINATION ***/ -.pagination { - display: table; - width: 100%; - margin: 0; - background: #ecf0f1; - text-align: center; - color: #000; - font-size: 80%; - line-height: 200%; - table-layout: fixed; - font-weight: bold; -} - .pagination .item { - display: table-cell; - line-height: 40px; - vertical-align: top; - } - .pagination .item.pager-current { - font-weight: bold; - font-size: 140%; - color: #ecf0f1; - background: #34495e; - } - .pagination .item.pager-first, - .pagination .item.pager-previous, - .pagination .item.pager-next, - .pagination .item.pager-last { - width: 100px; - } - .pagination .item a { - display: block; - color: #000; - font-weight: bold; - line-height: 40px; - } - .pagination .item a:hover { - color: #ecf0f1; - background: #34495e; - } - -#nav_entries { - display: table; - width: 250px; - height: 40px; - position: fixed; - bottom: 0; - left: 0; - margin: 0; - background: #34495e; - text-align: center; - line-height: 40px; - table-layout: fixed; -} - #nav_entries .item { - display: table-cell; - width: 30%; - } - #nav_entries a { - display: block; - } - #nav_entries .i_up { - margin: 5px 0 0; - vertical-align: top; - } - -.pagination .loading, -.pagination a:hover.loading { - background: url("loader.gif") center center no-repeat #34495e; - font-size: 0; -} - -#bigMarkAsRead { - background: #ecf0f1; - display: block; - font-style: normal; - padding: 32px 0 64px 0; - text-align: center; - text-decoration: none; - text-shadow: 0 -1px 0 #aaa; -} - #bigMarkAsRead:hover { - background: #34495e; - color: #fff; - } - .bigTick { - font-size: 72pt; - line-height: 1.6em; - } - -/*** NOTIFICATION ***/ -#notification { - position: absolute; - top: 10px; - left: 25%; right: 25%; - min-height: 30px; - padding: 10px; - line-height: 30px; - text-align: center; - border-radius: 3px; - background: #ddd; - color: #666; - font-weight: bold; - z-index: 10; -} - #notification.closed { - display: none; - } - #notification.good { - background: #1abc9c; - color: #fff; - } - #notification.bad { - background: #e74c3c; - color: #fff; - } - #notification a.close { - position: absolute; - top: -6px; right: -6px; - display: inline-block; - width: 16px; - height: 16px; - padding: 5px; - border-radius: 3px; - line-height: 16px; - } - #notification.good a.close { - background: #1abc9c; - } - #notification.bad a.close { - background: #e74c3c; - } - -.toggle_aside, .btn.toggle_aside { - display: none; -} - -.actualizeProgress { - position: fixed; - top: 10px; - left: 25%; right: 25%; - padding: 5px; - background: #3498db; - color: #fff; - text-align: center; - border-radius: 3px; - font-weight: bold; -} - .actualizeProgress progress { - max-width: 100%; - width: 250px; - height: 15px; - vertical-align: middle; - background: #fff; - border: none; - } - .actualizeProgress .progress { - color: #ecf0f1; - } - -.logs { - border: 1px solid #34495e; -} - .log { - margin: 10px 0; - padding: 5px 2%; - overflow: auto; - background: #fafafa; - color: #666; - font-size: 90%; - } - .log>.date { - margin: 0 10px 0 0; - padding: 5px 10px; - border-radius: 20px; - } - .log.error>.date { - background: #e74c3c; - color: #fff; - } - .log.warning>.date { - background: #f39c12; - } - .log.notice>.date { - background: #ecf0f1; - } - .log.debug>.date { - background: #111; - color: #eee; - } - -.form-group table { - border-collapse:collapse; - margin:10px 0 0 220px; - text-align:center; -} - -.form-group tr, .form-group th, .form-group td { - font-weight:normal; - padding:.5em; -} - -select.number option { - text-align:right; -} - -@media(min-width: 841px) { - .flux:not(.current):hover .item.title { - max-width: calc(100% - 580px); - padding-right: 1.5em; - position: absolute; - } -} - -@media(max-width: 840px) { - .header, - .aside .btn-important, - .aside .feeds .dropdown, - .flux_header .item.website span, - .item.date { - display: none; - } - .flux_header .item.website { - width: 40px; - text-align: center; - } - .flux_header .item.website .favicon { - padding: 12px; - } - - .nav-login { - display: block; - } - - .pagination { - margin: 0 0 40px; - } - .pagination .pager-previous, .pagination .pager-next { - width: 100px; - } - - .toggle_aside, .btn.toggle_aside { - display: inline-block; - } - .aside { - position: fixed; - top: 0; left: 0; - width: 0; - overflow: hidden; - z-index: 10; - transition: width 200ms linear; - background: #ecf0f1; - } - .aside.aside_flux { - padding: 10px 0 0; - } - .aside:target { - width: 80%; - border-right: 1px solid #aaa; - overflow: auto; - } - .aside .toggle_aside { - position: absolute; - right: 10px; - display: inline-block; - width: 26px; - height: 26px; - margin: 0 10px 0 0; - border-radius: 3px; - text-align: center; - line-height: 24px; - background: #95a5a6; - } - .aside .toggle_aside:hover { - background: #7f8c8d; - } - .aside .categories { - margin: 30px 0; - } - - #nav_entries { - width: 100%; - } - - .nav_menu .btn { - margin: 5px 10px; - } - .nav_menu .stick { - margin: 0 10px; - } - .nav_menu .stick .btn { - margin: 5px 0; - } - .nav_menu .search { - display: inline-block; - max-width: 97%; - } - .nav_menu .search input { - max-width: 97%; - width: 90px; - } - .nav_menu .search input:focus { - width: 400px; - } - - #panel { - left: 5px; right: 5px; - } - - .day .date { - display: none; - } - .day .name { - height: 2.6em; - font-size: 1em; - text-shadow: none; - } - - #notification, - .actualizeProgress { - top: 0; - left: 0; - right: 0; - border-radius: 0; - } - #notification a.close, - #notification.good a.close, - #notification.bad a.close { - left: 0; right: 0; - top: 0; bottom: 0; - width: auto; - height: auto; - background: transparent; - border: none; - } - #notification a.close .icon { - display: none; - } -} - -/*** FALLBACK ***/ -.dropdown-menu:after { - -moz-transform: rotate(45deg); - -webkit-transform: rotate(45deg); - -ms-transform: rotate(45deg); -} - -input.extend { - -moz-transition: width 200ms linear; - -webkit-transition: width 200ms linear; - -o-transition: width 200ms linear; - -ms-transition: width 200ms linear; -} - -@media print { - .header, - .aside, - .nav_menu, - .day, - .flux_header, - .flux_content .bottom, - .pagination { - display: none; - } - - html, body { - background: #fff; - color: #000; - font-family: Serif; - font-size: 12pt; - } - - #global, - .flux_content { - display: block !important; - } - - .flux_content .content { - width: 100% !important; - text-align: justify; - } - - .flux_content .content a { - color: #000; - } - .flux_content .content a:after { - content: " (" attr(href) ") "; - text-decoration: underline; - } -} - -.stat { - border:1px solid #aaa; - border-radius:10px; - box-shadow:2px 2px 5px #aaa; - margin:10px 0; - padding:0 5px; -} -.stat > h2 { - border-bottom:1px solid #aaa; - margin:0 -5px; - padding-left:5px; -} -.stat > div { - margin:5px 0; -} -.stat > table { - border-collapse:collapse; - margin:5px 0; - width:100%; -} -.stat > table > thead > tr { - border-bottom:2px solid #aaa; -} -.stat > table > tbody > tr { - border-bottom:1px solid #aaa; -} -.stat > table > tbody > tr:last-child { - border-bottom:0; -} -.stat > table th, .stat > table td { - border-left:2px solid #aaa; - padding:5px; -} -.stat > table th:first-child, .stat > table td:first-child { - border-left:0; -} -.stat > table td.numeric{ - margin:5px 0; - text-align:center; -}
\ No newline at end of file diff --git a/p/themes/Flat/global.css b/p/themes/Flat/global.css deleted file mode 100644 index 4044dd781..000000000 --- a/p/themes/Flat/global.css +++ /dev/null @@ -1,534 +0,0 @@ -@charset "UTF-8"; - -/* FONTS */ -@font-face { - font-family: "OpenSans"; - src: url("../fonts/openSans.woff") format("woff"); -} - - -* { - margin: 0; - padding: 0; -} -html, body { - height: 100%; - font-size: 95%; - font-family: "OpenSans", "Cantarell", "Helvetica", "Arial", sans-serif; -} - -/* LIENS */ -a { - color: #2980b9; - text-decoration: none; -} - a:hover { - text-decoration: underline; - } - -/* LISTES */ -ul, ol, dl { - margin: 10px 0 10px 30px; - line-height: 190%; -} - dd { - margin: 0 0 10px 30px; - } - -/* TITRES */ -h1, h2, h3 { - min-height: 40px; - margin: 15px 0 5px; - line-height: 40px; -} - -/* IMG */ -figure { - margin: 5px 0 10px; - text-align: center; -} - figcaption { - display: inline-block; - padding: 3px 20px; - color: #999; - font-style: italic; - border-bottom: 1px solid #ccc; - } -img { - height: auto; - max-width: 100%; - vertical-align: middle; -} - a img { - border: none; - } - -/* VIDEOS */ -iframe, embed, object, video { - max-width: 100%; -} - -/* FORMULAIRES */ -legend { - display: inline-block; - margin: 20px 0 5px; - padding: 5px 20px; - font-size: 150%; - clear: both; - background: #ecf0f1; - border-radius: 20px; -} -label { - display: block; - min-height: 25px; - padding: 5px 0; - font-size: 12px; - line-height: 25px; - cursor: pointer; - font-weight: bold; - color: #444; -} -input { - width: 180px; -} -textarea { - width: 360px; - height: 100px; -} -input, select, textarea { - display: inline-block; - max-width: 100%; - min-height: 25px; - padding: 5px; - background: #FFF; - border: none; - border-bottom: 3px solid #ddd; - color: #666; - line-height: 25px; - vertical-align: middle; - border-radius: 5px; -} - option { - padding:0 .5em 0 .5em; - } - input[type="radio"], - input[type="checkbox"] { - width: 15px !important; - min-height: 15px !important; - } - input:focus, select:focus, textarea:focus { - color: #333; - border-color: #2980b9; - } - input:invalid, select:invalid { - border-color: red; - box-shadow: 0 0 2px 1px red; - } - input:focus.extend { - width: 300px; - transition: width 200ms linear; - } - -.form-group { - margin: 5px 0; - border: 1px solid transparent; -} - .form-group:after { - content: ""; - display: block; - clear: both; - } - .form-group:hover { - background: #fff; - border: 1px solid #eee; - border-radius: 3px; - } - .form-group.form-actions { - min-width: 250px; - margin: 20px 0; - padding: 5px 0; - background: #ecf0f1; - border-top: 3px solid #bdc3c7; - border-radius: 5px 5px 0 0; - } - .form-group.form-actions .btn { - margin: 0 10px; - } - .form-group .group-name { - display: block; - float: left; - width: 200px; - padding: 10px 0; - text-align: right; - } - .form-group .group-controls { - min-width: 250px; - min-height: 25px; - margin: 0 0 0 220px; - padding: 5px 0; - } - .form-group .group-controls label { - font-weight: normal; - font-size: 14px; - color: #000; - } - .form-group .group-controls .control { - display: block; - min-height: 30px; - padding: 5px 0; - line-height: 25px; - font-size: 14px; - } - -.stick { - display: inline-block; - white-space: nowrap; - font-size: 0px; - vertical-align: middle; -} - .stick .btn, - .stick input { - font-size: 14px; - border-radius: 0; - } - .stick .btn:first-child, - .stick input:first-child { - border-radius: 5px 0 0 5px; - } - .stick .btn:last-child, - .stick input:last-child, - .stick .btn + .dropdown > .btn { - border-radius: 0 5px 5px 0; - } - .stick .btn + .dropdown a { - font-size: 12px; - } - -.btn { - display: inline-block; - min-height: 38px; - min-width: 18px; - padding: 5px 10px; - background: #3498db; - border-radius: 5px; - border: none; - border-bottom: 3px solid #2980b9; - color: #fff; - line-height: 20px; - vertical-align: middle; - cursor: pointer; - overflow: hidden; -} - a.btn { - min-height: 25px; - line-height: 25px; - } - .btn.active, - .btn:active, - .btn:hover, - .dropdown-target:target ~ .btn.dropdown-toggle { - background: #2980b9; - text-decoration: none; - } - - .btn-important { - background: #e67e22; - color: #fff; - border-bottom: 3px solid #d35400; - } - .btn-important:active, - .btn-important:hover { - background: #d35400; - } - - .btn-attention { - background: #e74c3c; - color: #fff; - border-bottom: 3px solid #c0392b; - } - .btn-attention:hover, - .btn-attention:active { - background: #c0392b; - } - -/* NAVIGATION */ -.nav-list { - border-right: 1px solid #ecf0f1; -} -.nav-list .nav-header, -.nav-list .item { - display: block; - height: 35px; - line-height: 35px; - margin: 5px 0; -} - .nav-list .item:hover, - .nav-list .item.active { - background: #2980b9; - color: #fff; - } - .nav-list .item:hover a, - .nav-list .item.active a { - color: #fff; - } - .nav-list .disable { - color: #aaa; - background: #fafafa; - text-align: center; - } - .nav-list .item > * { - display: block; - padding: 0 10px; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - } - .nav-list a:hover { - text-decoration: none; - } - .nav-list .item.error a { - color: #BD362F; - } - .nav-list .item:hover.error a, - .nav-list .item.active.error a { - color: #fff; - background: #BD362F; - } - .nav-list .item.empty a { - color: #f39c12; - } - .nav-list .item:hover.empty a, - .nav-list .item.active.empty a { - color: #fff; - background: #f39c12; - } - - .nav-list .nav-header { - padding: 0 10px; - margin: 0; - color: #fff; - background: #34495e; - font-weight: bold; - } - .nav-list .separator { - display: block; - height: 0; - margin: 5px 0; - border-bottom: 1px solid #ddd; - } - - .nav-list .nav-form { - padding: 3px; - text-align: center; - } - -.nav-head { - display: block; - margin: 0; - background: #34495e; - color: #fff; - text-align: right; -} - .nav-head a { - color: #fff; - } - .nav-head .item { - display: inline-block; - padding: 5px 10px; - } - -/* HORIZONTAL-LIST */ -.horizontal-list { - display: table; - table-layout: fixed; - margin: 0; - padding: 0; - width: 100%; -} - .horizontal-list .item { - display: table-cell; - vertical-align: middle; - } - -/* DROPDOWN */ -.dropdown { - position: relative; - display: inline-block; -} - .dropdown-target { - display: none; - } - - .dropdown-menu { - display: none; - min-width: 200px; - margin: 5px 0 0; - padding: 5px 0; - position: absolute; - right: 0px; - background: #fff; - border: 1px solid #95a5a6; - border-radius: 3px; - text-align: left; - } - .dropdown-menu:after { - content: ""; - position: absolute; - top: -6px; - right: 13px; - width: 10px; - height: 10px; - background: #fff; - border-top: 1px solid #95a5a6; - border-left: 1px solid #95a5a6; - z-index: -10; - transform: rotate(45deg); - } - .dropdown-header { - display: block; - padding: 0 5px; - color: #34495e; - font-weight: bold; - font-size: 14px; - line-height: 30px; - } - .dropdown-menu > .item { - display: block; - height: 30px; - font-size: 90%; - line-height: 30px; - } - .dropdown-menu > .item > a { - display: block; - padding: 0 25px; - line-height: 30px; - } - .dropdown-menu > .item.share > a { - display: list-item; - list-style-position:inside; - list-style-type:decimal; - } - .dropdown-menu > .item:hover > a { - background: #2980b9; - color: #fff; - } - .dropdown-menu > .item[aria-checked="true"] > a:before { - content: '✓ '; - font-weight: bold; - margin: 0 0 0 -1.2em; - padding: 0 0.2em 0 0; - } - .dropdown-menu > .item:hover > a { - color: #fff; - text-decoration: none; - } - .dropdown-menu .input { - display: block; - height: 40px; - font-size: 90%; - line-height: 30px; - } - .dropdown-menu label { - font-weight: normal; - } - .dropdown-menu .input select, - .dropdown-menu .input input { - display: block; - height: 20px; - width: 95%; - margin: auto; - padding: 2px 5px; - border-radius: 3px; - } - .dropdown-menu .input select { - width: 70%; - height: auto; - } - .dropdown-menu .separator { - display: block; - height: 0; - margin: 5px 0; - border-bottom: 1px solid #95a5a6; - } - .dropdown-target:target ~ .dropdown-menu { - display: block; - z-index: 10; - } - .dropdown-close { - display: inline; - } - .dropdown-close a { - font-size: 0; - position: fixed; - top: 0; bottom: 0; - left: 0; right: 0; - display: block; - z-index: -10; - } - -/* ALERTS */ -.alert { - display: block; - width: 90%; - margin: 15px auto; - padding: 10px 15px; - background: #f4f4f4; - border: 1px solid #ccc; - border-right: 1px solid #aaa; - border-bottom: 1px solid #aaa; - border-radius: 5px; - color: #aaa; - text-shadow: 0 0 1px #eee; -} - .alert-head { - margin: 0; - font-weight: bold; - font-size: 110%; - } - .alert > a { - color: inherit; - text-decoration: underline; - } - .alert-warn { - background: #ffe; - border: 1px solid #eeb; - color: #c95; - } - .alert-success { - background: #dfd; - border: 1px solid #cec; - color: #484; - } - .alert-error { - background: #fdd; - border: 1px solid #ecc; - color: #844; - } - -/* ICÔNES */ -.icon { - display: inline-block; - width: 16px; - height: 16px; - vertical-align: middle; - line-height: 16px; -} - -/* Prompt (centré) */ -.prompt { - text-align: center; -} - .prompt label { - text-align: left; - } - .prompt form { - margin: 1em auto 2.5em auto; - width: 10em; - } - .prompt input { - margin: .4em auto 1.1em auto; - width: 100%; - } - .prompt p { - margin: 20px 0; - } diff --git a/p/themes/Flat/icons/icon.svg b/p/themes/Flat/icons/icon.svg new file mode 100644 index 000000000..9657d020c --- /dev/null +++ b/p/themes/Flat/icons/icon.svg @@ -0,0 +1,12 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"> + <title>Logo FreshRSS</title> + <circle fill="#2980b9" cx="128" cy="128" r="33"/> + <g fill="none" stroke="#2980b9" stroke-width="24"> + <g stroke-opacity="0.3"> + <path d="M12,128 A116,116 0 1,1 128,244"/> + <path d="M54,128 A74,74 0 1,1 128,202"/> + </g> + <path d="M128,12 A116,116 0 0,1 244,128"/> + <path d="M128,54 A74,74 0 0,1 202,128"/> + </g> +</svg> diff --git a/p/themes/Flat/icons/key.svg b/p/themes/Flat/icons/key.svg new file mode 100644 index 000000000..77d0218e5 --- /dev/null +++ b/p/themes/Flat/icons/key.svg @@ -0,0 +1,7 @@ +<svg xmlns="http://www.w3.org/2000/svg"> +<g transform="translate(-340.99994,-257)" fill="#ffffff"> +<path style="block-progression:tb;color:#000000;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" d="m346,260c-2.7496,0-5,2.2504-5,5s2.2504,5,5,5c1.5862,0,2.9034-0.84459,3.8125-2h4.8438,0.75l0.21875-0.75,1.0312-4,0.3125-1.25h-1.2812-5.875c-0.90914-1.1554-2.2263-2-3.8125-2zm0,2c1.1158,0,2.0379,0.59507,2.5625,1.5l0.3125,0.5h0.5625,4.9688l-0.53125,2h-4.4375-0.5625l-0.3125,0.5c-0.52462,0.90493-1.4466,1.5-2.5625,1.5-1.6687,0-3-1.3313-3-3s1.3313-3,3-3z"/> +<path opacity="0.35" style="enable-background:accumulate;color:#000000;" d="M355.5,265,350,265,349.44,267,355,267z" fill-rule="nonzero"/> +<path style="enable-background:accumulate;color:#000000;" d="m346,265c0,0.55228-0.44772,1-1,1s-1-0.44772-1-1,0.44772-1,1-1,1,0.44772,1,1z" fill-rule="nonzero"/> +</g> +</svg> diff --git a/p/themes/Flat/icons/rss.svg b/p/themes/Flat/icons/rss.svg new file mode 100644 index 000000000..4d4faf7ae --- /dev/null +++ b/p/themes/Flat/icons/rss.svg @@ -0,0 +1,6 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g fill-rule="nonzero" transform="translate(-561,-301.00012)" fill="#fff"> +<path style="enable-background:new;color:#000000;" d="m325.06,97.188c0,1.7872-0.89543,3.2361-2,3.2361s-2-1.4488-2-3.2361c0-1.7872,0.89543-3.2361,2-3.2361s2,1.4488,2,3.2361z" transform="matrix(1.0000007,0,0,0.61803426,241.93747,252.93479)"/> +<path style="enable-background:new;color:#000000;" d="m563,303,0,1c0,0.55016,0.45347,1,1,1,4.9706,0,9,4.0294,9,9,0,0.55016,0.45347,1,1,1h1v-1c0-6.0751-4.9249-11-11-11h-1zm0,4,0,1c0,0.55016,0.45347,1,1,1,2.7614,0,5,2.2386,5,5,0,0.55016,0.45347,1,1,1h1v-1c0-3.866-3.134-7-7-7h-1z"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/Flat/icons/view-global.svg b/p/themes/Flat/icons/view-global.svg new file mode 100644 index 000000000..9d2cd0f32 --- /dev/null +++ b/p/themes/Flat/icons/view-global.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><g transform="translate(-61-867)" fill="#fff" color="#000"><rect height="2" rx=".385" ry=".379" width="2" x="64" y="870"/><rect height="2" rx=".385" ry=".379" width="2" x="68" y="870"/><rect height="2" rx=".385" ry=".379" width="2" x="72" y="870"/><rect height="2" rx=".385" ry=".379" width="2" x="64" y="874.02"/><rect height="2" rx=".385" ry=".379" width="2" x="68" y="874.02"/><rect height="2" rx=".385" ry=".379" width="2" x="72" y="874.02"/><rect height="2" rx=".385" ry=".379" width="2" x="64" y="878"/><rect height="2" rx=".385" ry=".379" width="2" x="68" y="878"/><rect height="2" rx=".385" ry=".379" width="2" x="72" y="878"/></g></svg>
\ No newline at end of file diff --git a/p/themes/Flat/icons/view-normal.svg b/p/themes/Flat/icons/view-normal.svg new file mode 100644 index 000000000..8eda2047e --- /dev/null +++ b/p/themes/Flat/icons/view-normal.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><g transform="translate(-40-746)" fill="#fff" color="#fff"><path d="m43 749h10v2h-10z"/><path d="m43 753h10v2h-10z"/><path d="m43 757h10v2h-10z"/></g></svg>
\ No newline at end of file diff --git a/p/themes/Flat/icons/view-reader.svg b/p/themes/Flat/icons/view-reader.svg new file mode 100644 index 000000000..0e4f60a1a --- /dev/null +++ b/p/themes/Flat/icons/view-reader.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><g transform="translate(-181-867)" fill="#fff" color="#fff"><path d="m 181,868 0,1 0,11 0,1 1,0 5,0 c 0.1754,0 0.52538,0.15166 0.8125,0.34375 0.28712,0.19209 0.46875,0.375 0.46875,0.375 L 189,882.4375 l 0.71875,-0.75 c 0,0 0.8963,-0.6875 1.28125,-0.6875 l 5,0 1,0 0,-1 0,-11 0,-1 -1,0 -5,0 c -0.87652,0 -1.56017,0.34756 -2.03125,0.6875 -0.0301,-0.0207 -0.031,-0.0105 -0.0625,-0.0312 C 188.44557,868.35254 187.82811,868 187,868 l -5,0 -1,0 z m 2,2 4,0 c 0.13821,0 0.51476,0.14746 0.8125,0.34375 0.29774,0.19629 0.5,0.375 0.5,0.375 l 0.71875,0.6875 0.6875,-0.71875 c 0,0 0.89975,-0.6875 1.28125,-0.6875 l 4,0 0,9 -4,0 c -0.87693,0 -1.56008,0.34735 -2.03125,0.6875 -0.0196,-0.0135 -0.011,-0.0177 -0.0312,-0.0312 C 188.47725,879.34834 187.83512,879 187,879 l -4,0 0,-9 z"/><g transform="scale(-1 1)"><rect height="2" rx=".375" width="3" x="-187" y="872"/><rect height="2" rx=".375" width="3" x="-187" y="875"/><rect height="2" rx=".375" width="3" x="-194" y="872"/><rect height="2" rx=".375" width="3" x="-194" y="875"/></g></g></svg>
\ No newline at end of file diff --git a/p/themes/Flat/metadata.json b/p/themes/Flat/metadata.json index 6b94d11c2..3afdc98af 100644 --- a/p/themes/Flat/metadata.json +++ b/p/themes/Flat/metadata.json @@ -2,6 +2,6 @@ "name": "Flat design", "author": "Marien Fressinaud", "description": "Thème plat pour FreshRSS", - "version": 0.1, - "files": ["global.css", "freshrss.css"] + "version": 0.2, + "files": ["_template.css", "flat.css"] }
\ No newline at end of file diff --git a/p/themes/Origine/freshrss.css b/p/themes/Origine/freshrss.css deleted file mode 100644 index 86bd508df..000000000 --- a/p/themes/Origine/freshrss.css +++ /dev/null @@ -1,961 +0,0 @@ -@charset "UTF-8"; - -/* STRUCTURE */ -.header { - display: table; - width: 100%; - background: #f4f4f4; - table-layout: fixed; -} - .header > .item { - display: table-cell; - padding: 10px 0; - border-bottom: 1px solid #aaa; - vertical-align: middle; - text-align: center; - } - .header > .item.title { - width: 250px; - white-space: nowrap; - } - .logo { - display: inline-block; - font-size: 48px; - height: 32px; - width: 32px; - padding: 10px; - } - .header > .item.title h1 { - display: inline-block; - margin: 0; - text-shadow: 1px -1px 0 #ccc; - } - .header > .item.search input { - width: 230px; - } - .header .item.search input:focus { - width: 330px; - } - .header > .item.configure { - width: 100px; - } - -.item a:hover { - text-decoration: none; -} - -#global { - display: table; - width: 100%; - height: 100%; - background: #fafafa; - table-layout: fixed; -} - .aside { - display: table-cell; - height: 100%; - width: 250px; - vertical-align: top; - border-right: 1px solid #aaa; - background: #fff; - } - .aside .nav-form input { - width: 180px; - } - .aside.aside_flux { - padding: 10px 0 40px; - } - .aside.aside_feed .nav-form input { - width: 140px; - } - .aside.aside_feed .nav-form .dropdown .dropdown-menu { - right: -20px; - } - .aside.aside_feed .nav-form .dropdown .dropdown-menu:after { - right: 33px; - } - - .nav-login { - display: none; - } - - .nav_menu { - width: 100%; - background: #fafafa; - border-bottom: 1px solid #aaa; - text-align: center; - padding: 5px 0; - } - .nav_menu .search { - display:none; - } - -.favicon { - height: 16px; - width: 16px; -} - -.categories { - margin: 0; - padding: 0; - text-align: center; - list-style: none; -} - .category { - display: block; - width: 220px; - margin: 10px auto; - text-align: left; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - } - .category .btn:first-child { - width: 195px; - position: relative; - } - .category.stick .btn:first-child { - width:160px; - } - .category .btn:first-child:not([data-unread="0"]):after { - content: attr(data-unread); - position: absolute; - top: 3px; right: 3px; - padding: 1px 5px; - background: #ccc; - color: #fff; - font-size: 90%; - border: 1px solid #bbb; - border-radius: 5px; - box-shadow: 1px 3px 3px #aaa inset; - text-shadow: 0 0 1px #aaa; - } - .category + .feeds:not(.active) { - display:none; - } - .categories .feeds { - width: 100%; - margin: 0; - list-style: none; - } - .categories .feeds .item.active { - background: #0062BE; - } - .categories .feeds .item.active .feed { - color: #fff; - } - .categories .feeds .item.empty .feed { - color: #e67e22; - } - .categories .feeds .item.empty.active { - background: #e67e22; - } - .categories .feeds .item.empty.active .feed { - color: #fff; - } - .categories .feeds .item.error .feed { - color: #BD362F; - } - .categories .feeds .item .feed { - display: inline-block; - margin: 0; - width: 165px; - line-height: 35px; - font-size: 90%; - vertical-align: middle; - text-align: left; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - } - .feed:not([data-unread="0"]) { - font-weight:bold; - } - .feed:not([data-unread="0"]):before { - content: "(" attr(data-unread) ") "; - } - .categories .feeds .dropdown-menu { - left: 0; - } - .categories .feeds .dropdown-menu:after { - left: 2px; - } - .categories .feeds .item .dropdown-toggle > .icon { - visibility: hidden; - cursor: pointer; - } - .categories .feeds .item .dropdown-target:target ~ .dropdown-toggle > .icon, - .categories .feeds .item:hover .dropdown-toggle > .icon, - .categories .feeds .item.active .dropdown-toggle > .icon { - background-color: #fff; - border-radius: 3px; - visibility: visible; - } - -.post { - padding: 10px 50px; -} - .post form { - margin: 10px 0; - } - -.day { - min-height: 50px; - padding: 0 10px; - font-size: 130%; - font-weight: bold; - line-height: 50px; - background: #fff; - border-top: 1px solid #aaa; - border-bottom: 1px solid #aaa; -} - #new-article + .day { - border-top: none; - } - .day .name { - position: absolute; - right: 0; - width: 50%; - height: 1.5em; - padding: 0 10px 0 0; - overflow: hidden; - color: #aab; - font-size: 1.8em; - opacity: .3; - text-shadow: 0px -1px 0px #333; - font-style: italic; - white-space: nowrap; - text-overflow: ellipsis; - text-align: right; - } - -#new-article { - display: none; - min-height: 40px; - background: #0084CC; - text-align: center; -} - #new-article:hover { - background: #0066CC; - } - #new-article > a { - display: block; - line-height: 40px; - color: #fff; - font-weight: bold; - } - #new-article > a:hover { - text-decoration: none; - } - -.flux { - border-left: 3px solid #aaa; - background: #fafafa; -} - .flux:hover { - background: #fff; - } - .flux.not_read { - border-left: 3px solid #FF5300; - background: #FFF3ED; - } - .flux.favorite { - border-left: 3px solid #FFC300; - background: #FFF6DA; - } - .flux.current { - border-left: 3px solid #0062BE; - background: #fff; - } - - .horizontal-list > .item:not(.title):not(.website) > a { - display: block; - } - - .flux_header { - background: inherit; - height: 25px; - font-size: 12px; - border-top: 1px solid #ddd; - cursor: pointer; - } - .flux .item { - line-height: 40px; - white-space: nowrap; - } - .flux_header > .item { - overflow: hidden; - text-overflow: ellipsis; - } - .flux .item.manage { - width: 40px; - text-align: center; - } - .flux .item.website { - width: 200px; - } - .website .favicon { - padding: 5px; - } - .flux .item.title { - background: inherit; - } - .flux .item.title a { - color: #000; - outline: none; - } - .flux.not_read .item.title, - .flux.current .item.title { - font-weight: bold; - } - .flux .item.date { - width: 145px; - padding:0 5px 0 0; - text-align: right; - font-size: 10px; - color: #666; - } - .link { - width: 40px; - text-align: center; - } - -#stream.reader .flux { - padding: 0 0 30px; - border: none; - background: #f0f0f0; - color: #333; -} - #stream.reader .flux .author { - margin: 0 0 10px; - font-size: 90%; - color: #666; - } - -#stream.global { - text-align: center; -} - #stream.global .box-category { - display: inline-block; - width: 280px; - margin: 20px 10px; - vertical-align: top; - background: #fff; - border: 1px solid #aaa; - border-radius: 5px; - text-align: left; - box-shadow: 0 0 5px #bbb; - } - #stream.global .category { - width: 100%; - margin: 0; - } - #stream.global .btn { - display: block; - width: auto; - height: 35px; - margin: 0; - padding: 0 10px; - background: #eee; - border: none; - border-bottom: 1px solid #aaa; - border-radius: 5px 5px 0 0; - line-height: 35px; - font-size: 120%; - } - #stream.global .btn:not([data-unread="0"]) { - background: #0084CC; - color: #fff; - font-weight: bold; - text-shadow: none; - } - #stream.global .btn:first-child:not([data-unread="0"]):after { - top: 0; right: 5px; - border: 0; - background: none; - color: #fff; - font-weight: bold; - box-shadow: none; - text-shadow: none; - } - #stream.global .box-category .feeds { - display: block; - max-height: 250px; - margin: 0; - list-style: none; - overflow: auto; - } - #stream.global .box-category .feeds .item { - padding: 2px 10px; - font-size: 90%; - } - #stream.global .box-category .feed { - width: 220px; - } - -.content { - min-height: 150px; - max-width: 550px; - margin: 0 auto; - padding: 20px 10px; - line-height: 170%; - word-wrap: break-word; -} - .content h1, .content h2, .content h3 { - margin: 20px 0 5px; - } - .content > .title { - font-size: x-large; - margin: 0; - } - - .content p { - margin: 0 0 20px; - } - img.big { - display: block; - margin: 10px auto; - } - figure img.big { - margin: 0; - } - .content hr { - margin: 30px 0; - height: 1px; - background: #ddd; - border: 0; - } - .content pre { - margin: 10px auto; - padding: 10px; - overflow: auto; - background: #000; - color: #fff; - font-size: 110%; - } - .content q, .content blockquote { - display: block; - margin: 5px 0; - padding: 5px 20px; - font-style: italic; - border-left: 4px solid #ccc; - color: #666; - } - .content blockquote p { - margin: 0; - } - -#panel { - display: none; - position: fixed; - top: 10px; bottom: 10px; - left: 100px; right: 100px; - overflow: auto; - background: #fff; - border: 1px solid #95a5a6; - border-radius: 5px; -} - #panel .close { - position: fixed; - top: 10px; right: 0; - display: inline-block; - width: 26px; - height: 26px; - margin: 0 10px 0 0; - border: 1px solid #ccc; - border-radius: 20px; - text-align: center; - line-height: 26px; - background: #fff; - } - -#overlay { - display: none; - position: fixed; - top: 0; bottom: 0; - left: 0; right: 0; - background: rgba(0, 0, 0, 0.9); -} - -.flux_content .bottom { - font-size: 90%; - text-align: center; -} - -.hide_posts > :not(.active) > .flux_content { - display:none; -} - -/*** PAGINATION ***/ -.pagination { - display: table; - width: 100%; - margin: 0; - background: #fafafa; - text-align: center; - color: #333; - font-size: 80%; - line-height: 200%; - table-layout: fixed; -} - .pagination .item { - display: table-cell; - line-height: 40px; - } - .pagination .item.pager-current { - font-weight: bold; - font-size: 140%; - } - .pagination .pager-first, - .pagination .pager-previous, - .pagination .pager-next, - .pagination .pager-last { - width: 100px; - } - .pagination .item a { - display: block; - color: #333; - font-style: italic; - } - .pagination:first-child .item { - border-bottom: 1px solid #aaa; - } - .pagination:last-child .item { - border-top: 1px solid #aaa; - } - -#nav_entries { - display: table; - width: 250px; - height: 40px; - position: fixed; - bottom: 0; - left: 0; - margin: 0; - background: #fff; - border-top: 1px solid #ddd; - text-align: center; - line-height: 40px; - table-layout: fixed; -} - #nav_entries .item { - display: table-cell; - width: 30%; - } - #nav_entries a { - display: block; - } - #nav_entries .i_up { - margin: 5px 0 0; - vertical-align: top; - } - -.loading { - background: url("loader.gif") center center no-repeat; - font-size: 0; -} - -#bigMarkAsRead { - display: block; - font-style: normal; - padding: 32px 0 64px 0; - text-align: center; - text-decoration: none; - text-shadow: 0 -1px 0 #aaa; -} - #bigMarkAsRead:hover { - background: #333; - color: #fff; - } - .bigTick { - font-size: 72pt; - line-height: 1.6em; - } - -/*** NOTIFICATION ***/ -#notification { - position: absolute; - top: 10px; - left: 25%; right: 25%; - min-height: 30px; - padding: 10px; - line-height: 30px; - text-align: center; - border-radius: 5px; - box-shadow: 0 0 5px #666; - background: #ddd; - color: #666; - font-weight: bold; - z-index: 10; -} - #notification.closed { - display: none; - } - #notification.good { - background: #f4f899; - } - #notification.bad { - background: #f4a899; - } - #notification a.close { - position: absolute; - top: -10px; right: -10px; - display: inline-block; - width: 16px; - height: 16px; - padding: 5px; - background: #fff; - border-radius: 50px; - border: 1px solid #aaa; - line-height: 16px; - } - -.toggle_aside, .btn.toggle_aside { - display: none; -} - -.actualizeProgress { - position: fixed; - top: 10px; - left: 25%; right: 25%; - padding: 5px; - background: #fff; - text-align: center; - border: 1px solid #ddd; - border-radius: 5px; -} - .actualizeProgress progress { - max-width: 100%; - vertical-align: middle; - } - .actualizeProgress .progress { - color: #999; - font-size: 90%; - vertical-align: middle; - } - -.logs { - border: 1px solid #aaa; -} - .log { - padding: 5px 2%; - overflow: auto; - background: #fafafa; - border-bottom: 1px solid #999; - color: #333; - font-size: 90%; - } - .log .date { - display: block; - } - .log.error { - background: #fdd; - color: #844; - } - .log.warning { - background: #ffe; - color: #c95; - } - .log.notice { - background: #f4f4f4; - color: #aaa; - } - .log.debug { - background: #111; - color: #eee; - } - -.form-group table { - border-collapse:collapse; - margin:10px 0 0 220px; - text-align:center; -} - -.form-group tr, .form-group th, .form-group td { - border:1px solid #DDD; - font-weight:normal; - padding:.5em; -} - -select.number option { - text-align:right; -} - -@media(min-width: 841px) { - .flux:not(.current):hover .item.title { - max-width: calc(100% - 580px); - padding-right: 1.5em; - position: absolute; - } -} - -@media(max-width: 840px) { - .header, - .aside .btn-important, - .aside .feeds .dropdown, - .flux_header .item.website span, - .item.date { - display: none; - } - .flux_header .item.website { - width: 40px; - text-align: center; - } - .flux_header .item.website .favicon { - padding: 12px; - } - - .nav-login { - display: block; - } - - .pagination { - margin: 0 0 40px; - } - .pagination .pager-previous, .pagination .pager-next { - width: 100px; - } - - .toggle_aside, .btn.toggle_aside { - display: inline-block; - } - .aside { - position: fixed; - top: 0; left: 0; - width: 0; - overflow: hidden; - border-right: none; - z-index: 10; - transition: width 200ms linear; - } - .aside.aside_flux { - padding: 10px 0 0; - } - .aside:target { - width: 80%; - border-right: 1px solid #aaa; - overflow: auto; - } - .aside .toggle_aside { - position: absolute; - right: 0; - display: inline-block; - width: 26px; - height: 26px; - margin: 0 10px 0 0; - border: 1px solid #ccc; - border-radius: 20px; - text-align: center; - line-height: 26px; - } - .aside .categories { - margin: 30px 0; - } - - #nav_entries { - width: 100%; - } - - .nav_menu .btn { - margin: 5px 10px; - } - .nav_menu .stick { - margin: 0 10px; - } - .nav_menu .stick .btn { - margin: 5px 0; - } - .nav_menu .search { - display: inline-block; - max-width: 97%; - } - .nav_menu .search input { - max-width: 97%; - width: 90px; - } - .nav_menu .search input:focus { - width: 400px; - } - - #panel { - left: 5px; right: 5px; - } - - .day .date { - display: none; - } - .day .name { - height: 2.6em; - font-size: 1em; - text-shadow: none; - } - - #notification, - .actualizeProgress { - top: 0; - left: 0; - right: 0; - border-radius: 0; - } - #notification a.close { - left: 0; right: 0; - top: 0; bottom: 0; - width: auto; - height: auto; - background: transparent; - border: none; - } - #notification a.close .icon { - display: none; - } -} - -/*** FALLBACK ***/ -.btn { - background: #fff; - background: -moz-linear-gradient(top, #fff 0%, #eee 100%); - background: -webkit-linear-gradient(top, #fff 0%, #eee 100%); - background: -o-linear-gradient(top, #fff 0%, #eee 100%); - background: -ms-linear-gradient(top, #fff 0%, #eee 100%); -} - .btn:hover { - background: #f0f0f0; - background: -moz-linear-gradient(top, #f8f8f8 0%, #f0f0f0 100%); - background: -webkit-linear-gradient(top, #f8f8f8 0%, #f0f0f0 100%); - background: -o-linear-gradient(top, #f8f8f8 0%, #f0f0f0 100%); - background: -ms-linear-gradient(top, #f8f8f8 0%, #f0f0f0 100%); - } - .btn-important { - background: #0084CC; - background: -moz-linear-gradient(top, #0084CC 0%, #0045CC 100%); - background: -webkit-linear-gradient(top, #0084CC 0%, #0045CC 100%); - background: -o-linear-gradient(top, #0084CC 0%, #0045CC 100%); - background: -ms-linear-gradient(top, #0084CC 0%, #0045CC 100%); - } - .btn-important:hover { - background: -moz-linear-gradient(top, #0066CC 0%, #0045CC 100%); - background: -webkit-linear-gradient(top, #0066CC 0%, #0045CC 100%); - background: -o-linear-gradient(top, #0066CC 0%, #0045CC 100%); - background: -ms-linear-gradient(top, #0066CC 0%, #0045CC 100%); - } - .btn-attention { - background: #E95B57; - background: -moz-linear-gradient(top, #E95B57 0%, #BD362F 100%); - background: -webkit-linear-gradient(top, #E95B57 0%, #BD362F 100%); - background: -o-linear-gradient(top, #E95B57 0%, #BD362F 100%); - background: -ms-linear-gradient(top, #E95B57 0%, #BD362F 100%); - } - .btn-attention:hover { - background: -moz-linear-gradient(top, #D14641 0%, #BD362F 100%); - background: -webkit-linear-gradient(top, #D14641 0%, #BD362F 100%); - background: -o-linear-gradient(top, #D14641 0%, #BD362F 100%); - background: -ms-linear-gradient(top, #D14641 0%, #BD362F 100%); - } - -.dropdown-menu:after { - -moz-transform: rotate(45deg); - -webkit-transform: rotate(45deg); - -ms-transform: rotate(45deg); -} - -.nav-head { - background: #fff; - background: -moz-linear-gradient(top, #fff 0%, #f0f0f0 100%); - background: -webkit-linear-gradient(top, #fff 0%, #f0f0f0 100%); - background: -o-linear-gradient(top, #fff 0%, #f0f0f0 100%); - background: -ms-linear-gradient(top, #fff 0%, #f0f0f0 100%); -} - -input.extend { - -moz-transition: width 200ms linear; - -webkit-transition: width 200ms linear; - -o-transition: width 200ms linear; - -ms-transition: width 200ms linear; -} - -@media(max-width: 840px) { - .aside { - -moz-transition: width 200ms linear; - -webkit-transition: width 200ms linear; - -o-transition: width 200ms linear; - -ms-transition: width 200ms linear; - } -} - -@media print { - .header, - .aside, - .nav_menu, - .day, - .flux_header, - .flux_content .bottom, - .pagination { - display: none; - } - - html, body { - background: #fff; - color: #000; - font-family: Serif; - font-size: 12pt; - } - - #global, - .flux_content { - display: block !important; - } - - .flux_content .content { - width: 100% !important; - text-align: justify; - } - - .flux_content .content a { - color: #000; - } - .flux_content .content a:after { - content: " (" attr(href) ") "; - text-decoration: underline; - } -} - -.stat { - border:1px solid #aaa; - border-radius:10px; - box-shadow:2px 2px 5px #aaa; - margin:10px 0; - padding:0 5px; -} -.stat > h2 { - border-bottom:1px solid #aaa; - margin:0 -5px; - padding-left:5px; -} -.stat > div { - margin:5px 0; -} -.stat > table { - border-collapse:collapse; - margin:5px 0; - width:100%; -} -.stat > table > thead > tr { - border-bottom:2px solid #aaa; -} -.stat > table > tbody > tr { - border-bottom:1px solid #aaa; -} -.stat > table > tbody > tr:last-child { - border-bottom:0; -} -.stat > table th, .stat > table td { - border-left:2px solid #aaa; - padding:5px; -} -.stat > table th:first-child, .stat > table td:first-child { - border-left:0; -} -.stat > table td.numeric{ - margin:5px 0; - text-align:center; -}
\ No newline at end of file diff --git a/p/themes/Origine/global.css b/p/themes/Origine/global.css deleted file mode 100644 index 5792c9e4d..000000000 --- a/p/themes/Origine/global.css +++ /dev/null @@ -1,547 +0,0 @@ -@charset "UTF-8"; - -/* FONTS */ -@font-face { - font-family: "OpenSans"; - src: url("../fonts/openSans.woff") format("woff"); -} - - -* { - margin: 0; - padding: 0; -} -html, body { - height: 100%; - font-size: 95%; - font-family: "OpenSans", "Cantarell", "Helvetica", "Arial", sans-serif; -} - -/* LIENS */ -a { - color: #0062BE; - text-decoration: none; -} - a:hover { - text-decoration: underline; - } - -/* LISTES */ -ul, ol, dl { - margin: 10px 0 10px 30px; - line-height: 190%; -} - dd { - margin: 0 0 10px 30px; - } - -/* TITRES */ -h1, h2, h3 { - min-height: 40px; - margin: 15px 0 5px; - line-height: 40px; -} - -/* IMG */ -figure { - margin: 5px 0 10px; - text-align: center; -} - figcaption { - display: inline-block; - padding: 3px 20px; - color: #999; - font-style: italic; - border-bottom: 1px solid #ccc; - } -img { - height: auto; - max-width: 100%; - vertical-align: middle; -} - a img { - border: none; - } - -/* VIDEOS */ -iframe, embed, object, video { - max-width: 100%; -} - -/* FORMULAIRES */ -legend { - display: block; - width: 100%; - margin: 20px 0 5px; - padding: 5px 0; - border-bottom: 1px solid #ddd; - font-size: 150%; - clear: both; -} -label { - display: block; - min-height: 25px; - padding: 5px 0; - font-size: 14px; - line-height: 25px; - cursor: pointer; -} -input { - width: 180px; -} -textarea { - width: 360px; - height: 100px; -} -input, select, textarea { - display: inline-block; - max-width: 100%; - min-height: 25px; - padding: 5px; - background: #fdfdfd; - border: 1px solid #bbb; - border-radius: 3px; - color: #666; - line-height: 25px; - vertical-align: middle; - box-shadow: 0 2px 2px #eee inset; -} - option { - padding:0 .5em 0 .5em; - } - input[type="radio"], - input[type="checkbox"] { - width: 15px !important; - min-height: 15px !important; - } - input:focus, select:focus, textarea:focus { - color: #0062BE; - border-color: #33BBFF; - box-shadow: 0 2px 2px #DDDDFF inset; - } - input:invalid, select:invalid { - border-color: red; - box-shadow: 0 0 2px 1px red; - } - input:focus.extend { - width: 300px; - transition: width 200ms linear; - } - -.form-group { - margin: 0; -} - .form-group:after { - content: ""; - display: block; - clear: both; - } - .form-group.form-actions { - min-width: 250px; - padding: 5px 0; - background: #f4f4f4; - border-top: 1px solid #ddd; - } - .form-group.form-actions .btn { - margin: 0 10px; - } - .form-group .group-name { - display: block; - float: left; - width: 200px; - padding: 10px 0; - text-align: right; - } - .form-group .group-controls { - min-width: 250px; - min-height: 25px; - margin: 0 0 0 220px; - padding: 5px 0; - } - .form-group .group-controls .control { - display: block; - min-height: 30px; - padding: 5px 0; - line-height: 25px; - font-size: 14px; - } - -.stick { - display: inline-block; - white-space: nowrap; - font-size: 0px; - vertical-align: middle; -} - .stick input, - .stick .btn { - border-radius: 0; - font-size: 14px; - } - .stick .btn:first-child, - .stick input:first-child { - border-radius: 3px 0 0 3px; - } - .stick .btn-important:first-child { - border-right: 1px solid #06f; - } - .stick .btn:last-child, - .stick input:last-child { - border-radius: 0 3px 3px 0; - } - .stick .btn + .btn, - .stick .btn + input, - .stick .btn + .dropdown > .btn, - .stick input + .btn, - .stick input + input, - .stick input + .dropdown > .btn, - .stick .dropdown + .btn, - .stick .dropdown + input, - .stick .dropdown + .dropdown > .btn { - border-left: none; - } - .stick input + .btn { - border-top: 1px solid #bbb; - } - .stick .btn + .dropdown > .btn { - border-left: none; - border-radius: 0 3px 3px 0; - } - .stick .btn + .dropdown a { - font-size: 12px; - } - -.btn { - display: inline-block; - min-height: 37px; - min-width: 15px; - padding: 5px 10px; - background: linear-gradient(to bottom, #fff 0%, #eee 100%); - border-radius: 3px; - border: 1px solid #ddd; - border-bottom: 1px solid #aaa; - border-right: 1px solid #aaa; - color: #666; - text-shadow: 0px -1px 0 #ddd; - line-height: 20px; - vertical-align: middle; - cursor: pointer; - overflow: hidden; -} - a.btn { - min-height: 25px; - line-height: 25px; - } - .btn:hover { - background: linear-gradient(to bottom, #f8f8f8, #f0f0f0); - text-decoration: none; - } - .btn.active, - .btn:active, - .dropdown-target:target ~ .btn.dropdown-toggle { - box-shadow: 0px 2px 4px #e0e0e0 inset, 0px 1px 2px #fafafa; - background: #eee; - } - - .btn-important { - background: linear-gradient(to bottom, #0084CC, #0045CC); - color: #fff; - border: 1px solid #0062B7; - text-shadow: 0px -1px 0 #aaa; - } - .btn-important:hover { - background: linear-gradient(to bottom, #0066CC, #0045CC); - } - .btn-important:active { - background: #0044CB; - box-shadow: none; - } - - .btn-attention { - background: linear-gradient(to bottom, #E95B57, #BD362F); - color: #fff; - border: 1px solid #C44742; - text-shadow: 0px -1px 0px #666; - } - .btn-attention:hover { - background: linear-gradient(to bottom, #D14641, #BD362F); - } - .btn-attention:active { - background: #BD362F; - box-shadow: none; - } - -/* NAVIGATION */ -.nav-list .nav-header, -.nav-list .item { - display: block; - height: 35px; - line-height: 35px; -} - .nav-list .item:hover { - background: #fafafa; - } - .nav-list .item:hover a { - color: #003388; - } - .nav-list .item.active { - background: #0062BE; - color: #fff; - } - .nav-list .item.active a { - color: #fff; - } - .nav-list .disable { - color: #aaa; - background: #fafafa; - text-align: center; - } - .nav-list .item > * { - display: block; - padding: 0 10px; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - } - .nav-list a:hover { - text-decoration: none; - } - .nav-list .item.error a { - color: #BD362F; - } - .nav-list .item.active.error a { - color: #fff; - background: #BD362F; - } - .nav-list .item.empty a { - color: #f39c12; - } - .nav-list .item.active.empty a { - color: #fff; - background: #f39c12; - } - - .nav-list .nav-header { - padding: 0 10px; - color: #888; - background: #f4f4f4; - border-bottom: 1px solid #ddd; - font-weight: bold; - text-shadow: 0 0 1px #ddd; - } - .nav-list .separator { - display: block; - height: 0; - margin: 5px 0; - border-bottom: 1px solid #ddd; - } - - .nav-list .nav-form { - padding: 3px; - text-align: center; - } - -.nav-head { - display: block; - margin: 0; - background: linear-gradient(to bottom, #fff, #f0f0f0); - border-bottom: 1px solid #ddd; - text-align: right; -} - .nav-head .item { - display: inline-block; - padding: 5px 10px; - } - -/* HORIZONTAL-LIST */ -.horizontal-list { - display: table; - table-layout: fixed; - margin: 0; - padding: 0; - width: 100%; -} - .horizontal-list .item { - display: table-cell; - vertical-align: middle; - } - -/* DROPDOWN */ -.dropdown { - position: relative; - display: inline-block; -} - .dropdown-target { - display: none; - } - - .dropdown-menu { - display: none; - min-width: 200px; - margin: 5px 0 0; - padding: 5px 0; - position: absolute; - right: 0px; - background: #fff; - border: 1px solid #ddd; - border-radius: 5px; - text-align: left; - box-shadow: 3px 3px 3px #ddd; - } - .dropdown-menu:after { - content: ""; - position: absolute; - top: -6px; - right: 13px; - width: 10px; - height: 10px; - background: #fff; - border-top: 1px solid #ddd; - border-left: 1px solid #ddd; - z-index: -10; - transform: rotate(45deg); - } - .dropdown-header { - display: block; - padding: 0 5px; - color: #888; - font-weight: bold; - font-size: 14px; - line-height: 30px; - } - .dropdown-menu > .item { - display: block; - height: 30px; - font-size: 90%; - line-height: 30px; - } - .dropdown-menu > .item > a { - display: block; - padding: 0 25px; - line-height: 30px; - } - .dropdown-menu > .item.share > a { - display: list-item; - list-style-position:inside; - list-style-type:decimal; - } - .dropdown-menu > .item:hover { - background: #0062BE; - color: #fff; - } - .dropdown-menu > .item[aria-checked="true"] > a:before { - content: '✓ '; - font-weight: bold; - margin: 0 0 0 -1.2em; - padding: 0 0.2em 0 0; - } - .dropdown-menu > .item:hover > a { - color: #fff; - text-decoration: none; - } - .dropdown-menu .input { - display: block; - height: 40px; - font-size: 90%; - line-height: 30px; - } - .dropdown-menu .input select, - .dropdown-menu .input input { - display: block; - height: 20px; - width: 95%; - margin: auto; - padding: 2px 5px; - border-radius: 3px; - } - .dropdown-menu .input select { - width: 70%; - height: auto; - } - .dropdown-menu .separator { - display: block; - height: 0; - margin: 5px 0; - border-bottom: 1px solid #ddd; - } - .dropdown-target:target ~ .dropdown-menu { - display: block; - z-index: 10; - } - .dropdown-close { - display: inline; - } - .dropdown-close a { - font-size: 0; - position: fixed; - top: 0; bottom: 0; - left: 0; right: 0; - display: block; - z-index: -10; - } - -/* ALERTS */ -.alert { - display: block; - width: 90%; - margin: 15px auto; - padding: 10px 15px; - background: #f4f4f4; - border: 1px solid #ccc; - border-right: 1px solid #aaa; - border-bottom: 1px solid #aaa; - border-radius: 5px; - color: #aaa; - text-shadow: 0 0 1px #eee; -} - .alert-head { - margin: 0; - font-weight: bold; - font-size: 110%; - } - .alert > a { - color: inherit; - text-decoration: underline; - } - .alert-warn { - background: #ffe; - border: 1px solid #eeb; - color: #c95; - } - .alert-success { - background: #dfd; - border: 1px solid #cec; - color: #484; - } - .alert-error { - background: #fdd; - border: 1px solid #ecc; - color: #844; - } - -/* ICÔNES */ -.icon { - display: inline-block; - width: 16px; - height: 16px; - vertical-align: middle; - line-height: 16px; -} - -/* Prompt (centré) */ -.prompt { - text-align: center; -} - .prompt label { - text-align: left; - } - .prompt form { - margin: 1em auto 2.5em auto; - width: 10em; - } - .prompt input { - margin: .4em auto 1.1em auto; - width: 100%; - } - .prompt p { - margin: 20px 0; - } diff --git a/p/themes/Origine/metadata.json b/p/themes/Origine/metadata.json index f93dcbc3f..774320eb4 100644 --- a/p/themes/Origine/metadata.json +++ b/p/themes/Origine/metadata.json @@ -2,6 +2,6 @@ "name": "Origine", "author": "Marien Fressinaud", "description": "Le thème par défaut pour FreshRSS", - "version": 0.1, - "files": ["global.css", "freshrss.css"] + "version": 0.2, + "files": ["_template.css", "origine.css"] } diff --git a/p/themes/Origine/origine.css b/p/themes/Origine/origine.css new file mode 100644 index 000000000..08fc08379 --- /dev/null +++ b/p/themes/Origine/origine.css @@ -0,0 +1,1034 @@ +@charset "UTF-8"; + +/*=== FONTS */ +@font-face { + font-family: "OpenSans"; + src: url("../fonts/openSans.woff") format("woff"); +} + +/*=== GENERAL */ +/*============*/ +html, body { + height: 100%; + font-family: "OpenSans", "Cantarell", "Helvetica", "Arial", sans-serif; + background: #fafafa; +} + +/*=== Links */ +a, button.as-link { + color: #0062be; + outline: none; +} + +/*=== Forms */ +legend { + margin: 20px 0 5px; + padding: 5px 0; + border-bottom: 1px solid #ddd; + font-size: 1.4em; +} +label { + min-height: 25px; + padding: 5px 0; + cursor: pointer; +} +textarea { + width: 360px; + height: 100px; +} +input, select, textarea { + min-height: 25px; + padding: 5px; + background: #fdfdfd; + border: 1px solid #bbb; + border-radius: 3px; + color: #666; + line-height: 25px; + vertical-align: middle; + box-shadow: 0 2px 2px #eee inset; +} +option { + padding: 0 .5em; +} +input:focus, select:focus, textarea:focus { + color: #0062be; + border-color: #33bbff; + box-shadow: 0 2px 2px #ddddff inset; +} +input:invalid, select:invalid { + border-color: #f00; + box-shadow: 0 0 2px 2px #fdd inset; +} +input:disabled, select:disabled { + background: #eee; +} +input.extend { + transition: width 200ms linear; + -moz-transition: width 200ms linear; + -webkit-transition: width 200ms linear; + -o-transition: width 200ms linear; + -ms-transition: width 200ms linear; +} + +/*=== Tables */ +table { + border-collapse: collapse; +} + +tr, th, td { + padding: 0.5em; + border: 1px solid #ddd; +} +th { + background: #f6f6f6; +} +form td, +form th { + font-weight: normal; + text-align: center; +} + +/*=== COMPONENTS */ +/*===============*/ +/*=== Forms */ +.form-group.form-actions { + padding: 5px 0; + background: #f4f4f4; + border-top: 1px solid #ddd; +} +.form-group.form-actions .btn { + margin: 0 10px; +} +.form-group .group-name { + padding: 10px 0; + text-align: right; +} +.form-group .group-controls { + min-height: 25px; + padding: 5px 0; +} +.form-group table { + margin: 10px 0 0 220px; +} + +/*=== Buttons */ +.stick { + vertical-align: middle; + font-size: 0; +} +.stick input, +.stick .btn { + border-radius: 0; +} +.stick .btn:first-child, +.stick input:first-child { + border-radius: 3px 0 0 3px; +} +.stick .btn-important:first-child { + border-right: 1px solid #06f; +} +.stick .btn:last-child, +.stick input:last-child { + border-radius: 0 3px 3px 0; +} +.stick .btn + .btn, +.stick .btn + input, +.stick .btn + .dropdown > .btn, +.stick input + .btn, +.stick input + input, +.stick input + .dropdown > .btn, +.stick .dropdown + .btn, +.stick .dropdown + input, +.stick .dropdown + .dropdown > .btn { + border-left: none; +} +.stick input + .btn { + border-top: 1px solid #bbb; +} +.stick .btn + .dropdown > .btn { + border-left: none; + border-radius: 0 3px 3px 0; +} + +.btn { + display: inline-block; + min-height: 37px; + min-width: 15px; + margin: 0; + padding: 5px 10px; + background: #fff; + background: linear-gradient(to bottom, #fff 0%, #eee 100%); + background: -moz-linear-gradient(top, #fff 0%, #eee 100%); + background: -webkit-linear-gradient(top, #fff 0%, #eee 100%); + background: -o-linear-gradient(top, #fff 0%, #eee 100%); + background: -ms-linear-gradient(top, #fff 0%, #eee 100%); + border-radius: 3px; + border: 1px solid #ddd; + border-bottom: 1px solid #aaa; + border-right: 1px solid #aaa; + color: #666; + text-shadow: 0px -1px 0 #ddd; + font-size: 0.9rem; + vertical-align: middle; + cursor: pointer; + overflow: hidden; +} +a.btn { + min-height: 25px; + line-height: 25px; +} +.btn:hover { + background: #f0f0f0; + background: linear-gradient(to bottom, #f8f8f8, #f0f0f0); + background: -moz-linear-gradient(top, #f8f8f8 0%, #f0f0f0 100%); + background: -webkit-linear-gradient(top, #f8f8f8 0%, #f0f0f0 100%); + background: -o-linear-gradient(top, #f8f8f8 0%, #f0f0f0 100%); + background: -ms-linear-gradient(top, #f8f8f8 0%, #f0f0f0 100%); + text-decoration: none; +} +.btn.active, +.btn:active, +.dropdown-target:target ~ .btn.dropdown-toggle { + box-shadow: 0px 2px 4px #e0e0e0 inset, 0px 1px 2px #fafafa; + background: #eee; +} + +.btn-important { + background: #0084CC; + background: linear-gradient(to bottom, #0084CC, #0045CC); + background: -moz-linear-gradient(top, #0084CC 0%, #0045CC 100%); + background: -webkit-linear-gradient(top, #0084CC 0%, #0045CC 100%); + background: -o-linear-gradient(top, #0084CC 0%, #0045CC 100%); + background: -ms-linear-gradient(top, #0084CC 0%, #0045CC 100%); + color: #fff; + border: 1px solid #0062B7; + text-shadow: 0px -1px 0 #aaa; + font-weight: normal; +} +.btn-important:hover { + background: linear-gradient(to bottom, #0066CC, #0045CC); + background: -moz-linear-gradient(top, #0066CC 0%, #0045CC 100%); + background: -webkit-linear-gradient(top, #0066CC 0%, #0045CC 100%); + background: -o-linear-gradient(top, #0066CC 0%, #0045CC 100%); + background: -ms-linear-gradient(top, #0066CC 0%, #0045CC 100%); +} +.btn-important:active { + background: #0044CB; + box-shadow: none; +} + +.btn-attention { + background: #E95B57; + background: linear-gradient(to bottom, #E95B57, #BD362F); + background: -moz-linear-gradient(top, #E95B57 0%, #BD362F 100%); + background: -webkit-linear-gradient(top, #E95B57 0%, #BD362F 100%); + background: -o-linear-gradient(top, #E95B57 0%, #BD362F 100%); + background: -ms-linear-gradient(top, #E95B57 0%, #BD362F 100%); + color: #fff; + border: 1px solid #C44742; + text-shadow: 0px -1px 0px #666; +} +.btn-attention:hover { + background: linear-gradient(to bottom, #D14641, #BD362F); + background: -moz-linear-gradient(top, #D14641 0%, #BD362F 100%); + background: -webkit-linear-gradient(top, #D14641 0%, #BD362F 100%); + background: -o-linear-gradient(top, #D14641 0%, #BD362F 100%); + background: -ms-linear-gradient(top, #D14641 0%, #BD362F 100%); +} +.btn-attention:active { + background: #BD362F; + box-shadow: none; +} + +/*=== Navigation */ +.nav-list .nav-header, +.nav-list .item { + height: 2.5em; + line-height: 2.5em; + font-size: 0.9rem; +} +.nav-list .item:hover { + background: #fafafa; +} +.nav-list .item:hover a { + color: #003388; +} +.nav-list .item.active { + background: #0062BE; + color: #fff; +} +.nav-list .item.active a { + color: #fff; +} +.nav-list .disable { + color: #aaa; + background: #fafafa; + text-align: center; +} +.nav-list .item > a { + padding: 0 10px; +} +.nav-list a:hover { + text-decoration: none; +} +.nav-list .item.empty a { + color: #f39c12; +} +.nav-list .item.active.empty a { + color: #fff; + background: #f39c12; +} +.nav-list .item.error a { + color: #BD362F; +} +.nav-list .item.active.error a { + color: #fff; + background: #BD362F; +} + +.nav-list .nav-header { + padding: 0 10px; + color: #888; + background: #f4f4f4; + border-bottom: 1px solid #ddd; + font-weight: bold; + text-shadow: 0 0 1px #ddd; +} + +.nav-list .nav-form { + padding: 3px; + text-align: center; +} + +.nav-head { + margin: 0; + background: #fff; + background: linear-gradient(to bottom, #fff, #f0f0f0); + background: -moz-linear-gradient(top, #fff 0%, #f0f0f0 100%); + background: -webkit-linear-gradient(top, #fff 0%, #f0f0f0 100%); + background: -o-linear-gradient(top, #fff 0%, #f0f0f0 100%); + background: -ms-linear-gradient(top, #fff 0%, #f0f0f0 100%); + border-bottom: 1px solid #ddd; + text-align: right; +} +.nav-head .item { + padding: 5px 10px; + font-size: 0.9rem; + line-height: 1.5rem; +} + +/*=== Horizontal-list */ +.horizontal-list { + margin: 0; + padding: 0; +} +.horizontal-list .item { + vertical-align: middle; +} + +/*=== Dropdown */ +.dropdown-menu { + margin: 5px 0 0; + padding: 5px 0; + border: 1px solid #ddd; + border-radius: 5px; + box-shadow: 3px 3px 3px #ddd; + font-size: 0.8rem; + text-align: left; +} +.dropdown-menu:after { + content: ""; + position: absolute; + top: -6px; + right: 13px; + width: 10px; + height: 10px; + background: #fff; + border-top: 1px solid #ddd; + border-left: 1px solid #ddd; + z-index: -10; + transform: rotate(45deg); + -moz-transform: rotate(45deg); + -webkit-transform: rotate(45deg); + -ms-transform: rotate(45deg); +} +.dropdown-header { + padding: 0 5px 5px; + color: #888; + font-weight: bold; + text-align: left; +} +.dropdown-menu > .item { +} +.dropdown-menu > .item > a { + padding: 0 25px; + line-height: 2.5em; +} +.dropdown-menu > .item > span, +.dropdown-menu > .item > .as-link { + padding: 0 22px; + line-height: 2em; +} +.dropdown-menu > .item:hover { + background: #0062BE; + color: #fff; +} +.dropdown-menu > .item[aria-checked="true"] > a:before { + font-weight: bold; + margin: 0 0 0 -14px; +} +.dropdown-menu > .item:hover > a { + color: #fff; + text-decoration: none; +} +.dropdown-menu .input select, +.dropdown-menu .input input { + margin: 0 auto 5px; + padding: 2px 5px; + border-radius: 3px; +} + +.separator { + margin: 5px 0; + border-bottom: 1px solid #ddd; +} + +/*=== Alerts */ +.alert { + margin: 15px auto; + padding: 10px 15px; + background: #f4f4f4; + border: 1px solid #ccc; + border-right: 1px solid #aaa; + border-bottom: 1px solid #aaa; + border-radius: 5px; + color: #aaa; + text-shadow: 0 0 1px #eee; + font-size: 0.9em; +} +.alert-head { + font-size: 1.15em; +} +.alert > a { + color: inherit; + text-decoration: underline; +} +.alert-warn { + background: #ffe; + border: 1px solid #eeb; + color: #c95; +} +.alert-success { + background: #dfd; + border: 1px solid #cec; + color: #484; +} +.alert-error { + background: #fdd; + border: 1px solid #ecc; + color: #844; +} + +/*=== Pagination */ +.pagination { + background: #fafafa; + text-align: center; + color: #333; + font-size: 0.8em; +} +.content .pagination { + margin: 0; + padding: 0; +} +.pagination .item.pager-current { + font-weight: bold; + font-size: 1.5em; +} +.pagination .item a { + display: block; + color: #333; + font-style: italic; + line-height: 3em; + text-decoration: none; +} +.pagination .item a:hover { + background: #ddd; +} +.pagination:first-child .item { + border-bottom: 1px solid #aaa; +} +.pagination:last-child .item { + border-top: 1px solid #aaa; +} + +.pagination .loading, +.pagination a:hover.loading { + background: url("loader.gif") center center no-repeat #fff; + font-size: 0; +} + +/*=== STRUCTURE */ +/*===============*/ +/*=== Header */ +.header { + height: 85px; + background: #f4f4f4; +} +.header > .item { + padding: 10px; + border-bottom: 1px solid #aaa; + vertical-align: middle; + text-align: center; +} +.header > .item.title{ + width: 230px; +} +.header > .item.title h1 { + margin: 0.5em 0; + text-shadow: 1px -1px 0 #ccc; +} +.header > .item.title h1 a { + text-decoration: none; +} +.header > .item.search input { + width: 230px; +} +.header .item.search input:focus { + width: 350px; +} + +/*=== Body */ +#global { + height: calc(100% - 85px); +} +.aside { + border-right: 1px solid #aaa; + background: #fff; +} +.aside.aside_flux { + padding: 10px 0 50px; +} + +/*=== Aside main page (categories) */ +.categories { + text-align: center; +} +.category { + width: 235px; + margin: 10px auto; + text-align: left; +} +.category .btn:first-child { + position: relative; + width: 213px; +} +.category.stick .btn:first-child { + width: 176px; +} +.category .btn:first-child:not([data-unread="0"]):after { + position: absolute; + top: 3px; right: 3px; + padding: 1px 5px; + background: #ccc; + color: #fff; + border: 1px solid #bbb; + border-radius: 5px; + box-shadow: 1px 3px 3px #aaa inset; + text-shadow: 0 0 1px #aaa; +} + +/*=== Aside main page (feeds) */ +.categories .feeds .item.active { + background: #0062BE; +} +.categories .feeds .item.empty.active { + background: #e67e22; +} +.categories .feeds .item.error.active { + background: #BD362F; +} +.categories .feeds .item.empty .feed { + color: #e67e22; +} +.categories .feeds .item.error .feed { + color: #BD362F; +} +.categories .feeds .item.active .feed, +.categories .feeds .item.empty.active .feed, +.categories .feeds .item.error.active .feed { + color: #fff; +} +.categories .feeds .item .feed { + margin: 0; + width: 165px; + line-height: 3em; + font-size: 0.8em; + text-align: left; + text-decoration: none; +} +.categories .feeds .feed:not([data-unread="0"]) { + font-weight: bold; +} +.categories .feeds .dropdown-menu:after { + left: 2px; +} +.categories .feeds .item .dropdown-target:target ~ .dropdown-toggle > .icon, +.categories .feeds .item:hover .dropdown-toggle > .icon, +.categories .feeds .item.active .dropdown-toggle > .icon { + background-color: #fff; + border-radius: 3px; + vertical-align: middle; +} + +/*=== Configuration pages */ +.post { + padding: 10px 50px; + font-size: 0.9em; +} +.post form { + margin: 10px 0; +} +.post.content { + max-width: 550px; +} + +/*=== Prompt (centered) */ +.prompt { + text-align: center; +} +.prompt label { + text-align: left; +} +.prompt form { + margin: 10px auto 20px auto; + width: 200px; +} +.prompt input { + margin: 5px auto; + width: 100%; +} +.prompt p { + margin: 20px 0; +} + +/*=== New article notification */ +#new-article { + background: #0084CC; + text-align: center; + font-size: 0.9em; +} +#new-article:hover { + background: #0066CC; +} +#new-article > a { + line-height: 3em; + color: #fff; + font-weight: bold; +} +#new-article > a:hover { + text-decoration: none; +} + +/*=== Day indication */ +.day { + padding: 0 10px; + font-weight: bold; + line-height: 3em; + background: #fff; + border-top: 1px solid #aaa; + border-bottom: 1px solid #aaa; +} +#new-article + .day { + border-top: none; +} +.day .name { + padding: 0 10px 0 0; + color: #aab; + font-size: 1.8em; + opacity: 0.3; + text-shadow: 0px -1px 0px #666; + font-style: italic; + text-align: right; +} + +/*=== Index menu */ +.nav_menu { + background: #fafafa; + border-bottom: 1px solid #aaa; + text-align: center; + padding: 5px 0; +} + +/*=== Feed articles */ +.flux { + border-left: 2px solid #aaa; + background: #fafafa; +} +.flux:hover { + background: #fff; +} +.flux.current { + border-left: 2px solid #0062BE; +} +.flux.not_read { + border-left: 2px solid #FF5300; + background: #FFF3ED; +} +.flux.not_read:not(.current):hover .item.title { + background: #FFF3ED; +} +.flux.favorite { + border-left: 2px solid #FFC300; + background: #FFF6DA; +} +.flux.favorite:not(.current):hover .item.title { + background: #FFF6DA; +} +.flux.current { + background: #fff; +} + + +.flux_header { + border-top: 1px solid #ddd; + font-size: 0.8rem; + cursor: pointer; +} +.flux_header .title { + font-size: 0.9rem; +} +.flux .website .favicon { + padding: 5px; +} +.flux .date { + color: #666; + font-size: 0.7rem; +} + +.flux .bottom { + font-size: 0.8rem; + text-align: center; +} + +/*=== Content of feed articles */ +.content { + padding: 20px 10px; +} +.content > h1.title > a { + color: #000; +} + +.content hr { + margin: 30px 10px; + height: 1px; + background: #ddd; + border: 0; + box-shadow: 0 2px 5px #ccc; +} + +.content pre { + margin: 10px auto; + padding: 10px 20px; + overflow: auto; + background: #222; + color: #fff; + font-size: 0.9rem; + border-radius: 3px; +} +.content code { + padding: 2px 5px; + color: #dd1144; + background: #fafafa; + border: 1px solid #eee; + border-radius: 3px; +} +.content pre code { + background: transparent; + color: #fff; + border: none; +} + +.content blockquote { + display: block; + margin: 0; + padding: 5px 20px; + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + background: #fafafa; + color: #333; +} +.content blockquote p { + margin: 0; +} + +/*=== Notification and actualize notification */ +.notification { + padding: 0 0 0 5px; + text-align: center; + border: 1px solid #eeb; + border-radius: 3px; + box-shadow: 0 0 5px #ddd; + font-weight: bold; + font-size: 0.9em; + line-height: 3em; + z-index: 10; + vertical-align: middle; +} +.notification.good { + background: #ffe; + border: 1px solid #eeb; + color: #c95; +} +.notification.bad { + background: #fdd; + border: 1px solid #ecc; + color: #844; +} +.notification a.close { + padding: 0 15px; + line-height: 3em; +} +.notification.good a.close:hover { + background: #eeb; +} +.notification.bad a.close:hover { + background: #ecc; +} + +.notification#actualizeProgress { + line-height: 2em; +} + +/*=== "Load more" part */ +#bigMarkAsRead { + text-align: center; + text-decoration: none; + text-shadow: 0 -1px 0 #aaa; + color: #666; + background: #fafafa; +} +#bigMarkAsRead:hover { + color: #0062be; + background: #fff; + box-shadow: 0 -5px 10px #eee inset; +} +#bigMarkAsRead:hover .bigTick { + text-shadow: 0 0 5px #0062be; +} + +/*=== Navigation menu (for articles) */ +#nav_entries { + margin: 0; + background: #fff; + border-top: 1px solid #ddd; + text-align: center; + line-height: 3em; + table-layout: fixed; +} + +/*=== READER VIEW */ +/*================*/ +#stream.reader .flux { + padding: 0 0 50px; + border: none; + background: #f0f0f0; + color: #333; +} +#stream.reader .flux .author { + margin: 0 0 10px; + font-size: 90%; + color: #666; +} + +/*=== GLOBAL VIEW */ +/*================*/ +#stream.global .box-category { + background: #fff; + border-radius: 5px; + text-align: left; + box-shadow: 0 0 3px #bbb; +} +#stream.global .category { + margin: 0; +} +#stream.global .btn { + width: auto; + height: 2em; + margin: 0; + padding: 0 10px; + background: #f6f6f6; + border: none; + border-bottom: 1px solid #ddd; + border-radius: 5px 5px 0 0; + line-height: 2em; + font-size: 1.2rem; +} +#stream.global .btn:not([data-unread="0"]) { + background: #0084CC; + color: #fff; + font-weight: bold; + text-shadow: none; +} +#stream.global .btn:first-child:not([data-unread="0"]):after { + top: 0; right: 5px; + border: 0; + background: none; + color: #fff; + font-weight: bold; + box-shadow: none; + text-shadow: none; +} +#stream.global .box-category .feeds { + max-height: 250px; +} +#stream.global .box-category .feeds .item { + padding: 2px 10px; + font-size: 0.9rem; +} + +/*=== DIVERS */ +/*===========*/ +.aside.aside_feed .nav-form input, +.aside.aside_feed .nav-form select { + width: 140px; +} +.aside.aside_feed .nav-form .dropdown .dropdown-menu { + right: -20px; +} +.aside.aside_feed .nav-form .dropdown .dropdown-menu:after { + right: 33px; +} + +/*=== STATISTICS */ +/*===============*/ +.stat { + margin: 10px 0 20px; +} + +.stat th, +.stat td, +.stat tr { + border: none; +} +.stat > table td, +.stat > table th { + border-bottom: 1px solid #ddd; +} + +.stat > .horizontal-list { + margin: 0 0 5px; +} +.stat > .horizontal-list .item { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} +.stat > .horizontal-list .item:first-child { + width: 270px; +} + +/*=== LOGS */ +/*=========*/ +.logs { + border: 1px solid #aaa; + border-radius: 5px; + overflow: hidden; +} +.log { + padding: 5px 10px; + background: #fafafa; + color: #333; + font-size: 0.8rem; +} +.log+.log { + border-top: 1px solid #aaa; +} +.log .date { + display: block; + font-weight: bold; +} +.log.error { + background: #fdd; + color: #844; +} +.log.warning { + background: #ffe; + color: #c95; +} +.log.notice { + background: #f4f4f4; + color: #aaa; +} +.log.debug { + background: #333; + color: #eee; +} + +/*=== MOBILE */ +/*===========*/ +@media(max-width: 840px) { + .aside { + box-shadow: 3px 0 3px #aaa; + transition: width 200ms linear; + -moz-transition: width 200ms linear; + -webkit-transition: width 200ms linear; + -o-transition: width 200ms linear; + -ms-transition: width 200ms linear; + } + .aside .toggle_aside, + #panel .close { + position: absolute; + display: block; + top: 0; right: 0; + width: 30px; + height: 30px; + line-height: 30px; + text-align: center; + background: #f6f6f6; + border-left: 1px solid #ddd; + border-bottom: 1px solid #ddd; + border-radius: 0 0 0 5px; + } + + .nav_menu .btn { + margin: 5px 10px; + } + .nav_menu .stick { + margin: 0 10px; + } + .nav_menu .stick .btn { + margin: 5px 0; + } + .nav_menu .search { + display: inline-block; + max-width: 97%; + } + .nav_menu .search input { + max-width: 97%; + width: 90px; + } + .nav_menu .search input:focus { + width: 400px; + } + + .day .name { + font-size: 1.1rem; + text-shadow: none; + } + + .pagination { + margin: 0 0 3.5em; + } + + .notification a.close { + display: block; + left: 0; + background: transparent; + } + .notification a.close:hover { + opacity: 0.5; + } + .notification a.close .icon { + display: none; + } +} diff --git a/p/themes/Pafat/README.md b/p/themes/Pafat/README.md new file mode 100644 index 000000000..adddc1bf0 --- /dev/null +++ b/p/themes/Pafat/README.md @@ -0,0 +1,4 @@ +Pafat +===== + +Thème Pafat pour FreshRSS diff --git a/p/themes/Pafat/icons/all.svg b/p/themes/Pafat/icons/all.svg new file mode 100644 index 000000000..14fa80366 --- /dev/null +++ b/p/themes/Pafat/icons/all.svg @@ -0,0 +1,7 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-40.0002,-746)" fill="#FFF"> +<rect style="color:#FFF;" height="2.0002" width="9.9996" y="749" x="43"/> +<rect style="color:#FFF;" height="2.0002" width="9.9996" y="753" x="43"/> +<rect style="color:#FFF;" height="2.0002" width="9.9996" y="757" x="43"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/Pafat/icons/bookmark.svg b/p/themes/Pafat/icons/bookmark.svg new file mode 100644 index 000000000..70d0c81fb --- /dev/null +++ b/p/themes/Pafat/icons/bookmark.svg @@ -0,0 +1,5 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-41.000202,-397)"> +<path style="enable-background:accumulate;color:#000000;" d="m530.95,186.71c-0.77941,0.55189-3.1576-1.906-4.1125-1.9179-0.95532-0.0119-3.3949,2.3858-4.161,1.8149-0.76573-0.57072,0.83698-3.592,0.55319-4.5039-0.2839-0.91223-3.3182-2.4915-3.0119-3.3965,0.30617-0.90461,3.6749-0.31399,4.4544-0.86567,0.77986-0.5519,1.3442-3.9257,2.2995-3.914,0.95494,0.0116,1.4342,3.398,2.1998,3.9689,0.76588,0.57114,4.1489,0.0653,4.4331,0.97746,0.28402,0.9118-2.7885,2.414-3.0949,3.3186-0.30652,0.90489,1.22,3.966,0.44027,4.5182z" fill-rule="nonzero" transform="matrix(1.0472113,-0.00871584,0.00871584,1.0472113,-504.35434,220.15425)" fill="#FFF"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/Pafat/icons/down.svg b/p/themes/Pafat/icons/down.svg new file mode 100644 index 000000000..050d6b969 --- /dev/null +++ b/p/themes/Pafat/icons/down.svg @@ -0,0 +1,5 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-181.0002,-747)"> +<path style="block-progression:tb;color:#bebebe;direction:ltr;text-indent:0;text-align:start;enable-background:new;text-transform:none;" d="m195.03,751,0,1c-0.00091,0.0111,0.00059,0.021-0.00009,0.0312-0.0112,0.25496-0.12835,0.50994-0.31251,0.6875l-5.7188,6.2977-5.7188-6.2977c-0.18821-0.1881-0.28121-0.45346-0.28122-0.71875v-1h1c0.26531,0.00007,0.53059,0.0931,0.71873,0.28131l4.2812,4.829,4.2813-4.829c0.19464-0.21073,0.46925-0.30315,0.74998-0.2813z" fill-rule="nonzero" fill="#666"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/Pafat/icons/icon.svg b/p/themes/Pafat/icons/icon.svg new file mode 100644 index 000000000..b489e18da --- /dev/null +++ b/p/themes/Pafat/icons/icon.svg @@ -0,0 +1,12 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"> + <title>Logo FreshRSS</title> + <circle fill="#C5C6CA" cx="128" cy="128" r="33"/> + <g fill="none" stroke="#C5C6CA" stroke-width="24"> + <g stroke-opacity="0.3"> + <path d="M12,128 A116,116 0 1,1 128,244"/> + <path d="M54,128 A74,74 0 1,1 128,202"/> + </g> + <path d="M128,12 A116,116 0 0,1 244,128"/> + <path d="M128,54 A74,74 0 0,1 202,128"/> + </g> +</svg> diff --git a/p/themes/Pafat/icons/link.svg b/p/themes/Pafat/icons/link.svg new file mode 100644 index 000000000..cc30f9f8b --- /dev/null +++ b/p/themes/Pafat/icons/link.svg @@ -0,0 +1,7 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16.004" width="16"> +<g fill="#666" transform="translate(-183,-529)"> +<path style="enable-background:accumulate;color:#000000;" d="m191,533.85,0,10.38-2.344-2.2882-1.3394,2.7346c-0.32808,0.73962-2.0337,0.14492-1.5487-0.84412l1.3255-2.8393h-2.9579l6.8645-7.1436z" fill-rule="nonzero" display="block"/> +<path d="m190.16,530.06c-3.8266,0.46006-6.5788,3.9578-6.0938,7.7812,0.13127,1.0347,0.29377,1.3818,0.29377,1.3818l1.675-1.6318c-0.33104-2.7534,1.6216-5.2315,4.375-5.5625,2.7534-0.33104,5.2315,1.6216,5.5625,4.375,0.31355,2.608-1.3913,5.0249-3.9688,5.5312l0.0312,2s0.52086-0.1059,0.62354-0.13097c3.4156-0.83385,5.7063-4.1273,5.2827-7.6503-0.46006-3.8266-3.9547-6.5538-7.7812-6.0938z" style="baseline-shift:baseline;block-progression:tb;color:#666;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;"/> +<path opacity="0.3" style="enable-background:accumulate;color:#666;" d="m187.11,536.81,0-0.20574-0.19826,0.0186c0.0165-0.13095,0.0329-0.26167,0.0496-0.3926h-0.11578l-0.11556,0.14959-0.11578,0.0559-0.1653-0.0932-0.0165-0.20575,0.0331-0.22438,0.24798-0.18688h0.19826l0.0329-0.11229,0.24786,0.0559,0.18183,0.2246,0.0331-0.37419,0.31401-0.26167,0.11567-0.28055,0.23133-0.0934,0.1322-0.18688,0.29738-0.0564,0.14885-0.22415h-0.44623l0.28094-0.13095h0.19814l0.28106-0.0937,0.0331-0.11186-0.0992-0.0937-0.11567-0.0375,0.0331-0.11208-0.0826-0.16822-0.19837,0.0746,0.0331-0.14947-0.23134-0.13096-0.18171,0.3177,0.0165,0.11229-0.18171,0.075-0.11578,0.24302-0.0495-0.22438-0.31402-0.13095-0.0496-0.16822,0.41315-0.24325,0.18182-0.16822,0.0165-0.20563-0.0991-0.0562-0.13219-0.0188-0.0826,0.20575s-0.1382,0.0271-0.17373,0.0358c-0.45378,0.41804-1.3707,1.3204-1.5837,3.024,0.008,0.0395,0.15441,0.26854,0.15441,0.26854l0.347,0.20552,0.347,0.0937m3.9661-4.3003-0.4298-0.16833-0.49552,0.0561-0.61161,0.16822-0.11567,0.11229,0.38008,0.26167,0,0.14959-0.14875,0.14959,0.19846,0.39294,0.13188-0.075,0.16561-0.26168c0.2553-0.0789,0.4842-0.16833,0.72686-0.28053l0.19846-0.5048m2.5292,0.34192-0.375,0.0937-0.21875,0.15625,0,0.125-0.375,0.25,0.0937,0.34375,0.21875-0.15625,0.125,0.15625,0.15625,0.0937,0.0937-0.28125-0.0625-0.15625,0.0625-0.0937,0.21875-0.1875,0.0937,0-0.0937,0.21875,0,0.1875c0.0892-0.0242,0.1588-0.051,0.25-0.0625l-0.25,0.1875v0.125l-0.3125,0.21875-0.28125-0.0625v-0.15625l-0.125,0.0625,0.0625,0.15625h-0.21875l-0.125,0.21875-0.15625,0.15625-0.0937,0.0312v0.1875l0.0312,0.15625h-0.0312v0.53125l0.0625-0.0312,0.0937-0.21875,0.1875-0.125,0.0312-0.0937,0.28125-0.0625,0.15625,0.1875,0.1875,0.0937-0.0937,0.1875,0.15625-0.0312,0.0625-0.21875-0.1875-0.21875h0.0625l0.21875,0.15625,0.0312,0.21875,0.15625,0.21875,0.0625-0.3125,0.0937-0.0312c0.0959,0.0996,0.1692,0.23163,0.25,0.34375h0.28125l0.1875,0.125-0.0937,0.0937-0.15625,0.15625h-0.25l-0.34375-0.0937h-0.1875l-0.125,0.15625-0.34375-0.375-0.25-0.0625-0.375,0.0625-0.15625,0.0937v2.4062l0.0312,0.0312,0.25-0.15625,0.0937,0.0937h0.28125l0.125,0.15625-0.0937,0.3125,0.1875,0.1875v0.375l0.125,0.25-0.0937,0.25c-0.009,0.16159,0,0.30714,0,0.46875,0.0795,0.21894,0.14355,0.43575,0.21875,0.65625l0.0625,0.34375v0.1875h0.125l0.21875-0.125h0.25l0.375-0.4375-0.0312-0.15625,0.25-0.21875-0.1875-0.1875,0.21875-0.1875,0.21875-0.125,0.0937-0.125-0.0625-0.25v-0.59375l0.1875-0.375,0.1875-0.25,0.25-0.5625v-0.15625c-0.11654,0.0146-0.22972,0.0231-0.34375,0.0312-0.0722,0.005-0.14446,0-0.21875,0-0.12359-0.25961-0.2183-0.50966-0.3125-0.78125l-0.15625-0.1875-0.0937-0.3125,0.0625-0.0625,0.21875,0.25,0.25,0.5625,0.15625,0.15625-0.0625,0.21875,0.15625,0.15625,0.25-0.25,0.3125-0.21875,0.15625-0.1875v-0.21875c-0.0389-0.0732-0.0547-0.14545-0.0937-0.21875l-0.15625,0.1875-0.125-0.15625-0.1875-0.125v-0.28125l0.21875,0.21875,0.21875-0.0312c0.10166,0.0923,0.19205,0.20751,0.28125,0.3125l0.15625-0.1875c0-0.17463-0.19976-1.0204-0.625-1.75-0.42526-0.72932-1.1562-1.4062-1.1562-1.4062l-0.0625,0.0937-0.21875,0.21875-0.25-0.25h0.25l0.125-0.125-0.46875-0.0937-0.25-0.0937z" fill-rule="nonzero"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/Pafat/icons/login.svg b/p/themes/Pafat/icons/login.svg new file mode 100644 index 000000000..cf2b347ad --- /dev/null +++ b/p/themes/Pafat/icons/login.svg @@ -0,0 +1,6 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-181.0002,-237)" fill="#666"> +<path style="color:#666;" d="m184,244c-0.554,0-1,0.446-1,1v0.53125,5.4688h12v-5.4688-0.53c0-0.554-0.446-1-1-1h-10z" fill-rule="nonzero"/> +<path style="baseline-shift:baseline;block-progression:tb;color:#bebebe;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" d="m188,238c-1.6447,0-3,1.3553-3,3v7c0,1.6447,1.3553,3,3,3h2c1.6447,0,3-1.3553,3-3v-7c0-1.6447-1.3553-3-3-3h-2zm0,2,2,0c0.5713,0,1,0.4287,1,1v7c0,0.5713-0.4287,1-1,1h-2c-0.5713,0-1-0.4287-1-1v-7c0-0.5713,0.4287-1,1-1z"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/Pafat/icons/logout.svg b/p/themes/Pafat/icons/logout.svg new file mode 100644 index 000000000..ac2d180d8 --- /dev/null +++ b/p/themes/Pafat/icons/logout.svg @@ -0,0 +1,6 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-201.0002,-237)" fill="#666"> +<path style="color:#666;" d="m204,246c-0.554,0-1,0.446-1,1v0.53125,5.4688h12v-5.4688-0.53c0-0.554-0.446-1-1-1h-10z" fill-rule="nonzero"/> +<path style="baseline-shift:baseline;block-progression:tb;color:#bebebe;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" d="m208,237c-1.6447,0-3,1.3553-3,3v3h2v-3c0-0.57129,0.42873-1,1-1h2c0.57127,0,1,0.42871,1,1v7h2v-7c0-1.6447-1.3553-3-3-3h-2z"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/Pafat/icons/next.svg b/p/themes/Pafat/icons/next.svg new file mode 100644 index 000000000..59d512450 --- /dev/null +++ b/p/themes/Pafat/icons/next.svg @@ -0,0 +1,5 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-121.0002,-747)"> +<path style="block-progression:tb;color:#bebebe;direction:ltr;text-indent:0;text-align:start;enable-background:new;text-transform:none;" d="m125,749,1,0c0.0104-0.00012,0.0208-0.00046,0.0313,0,0.25495,0.0112,0.50987,0.12858,0.6875,0.3125l6.2977,5.7188-6.2977,5.7188c-0.18816,0.18819-0.45346,0.28125-0.71875,0.28125h-1v-1c0-0.26529,0.0931-0.53058,0.28125-0.71875l4.829-4.2812-4.829-4.2812c-0.21074-0.19463-0.30316-0.46925-0.28125-0.75z" fill-rule="nonzero" fill="#666"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/Pafat/icons/non-starred.svg b/p/themes/Pafat/icons/non-starred.svg new file mode 100644 index 000000000..e019daffd --- /dev/null +++ b/p/themes/Pafat/icons/non-starred.svg @@ -0,0 +1,5 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-61.000202,-397)"> +<path style="baseline-shift:baseline;block-progression:tb;color:#000000;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" fill="#666" d="m69.003,398.01c-0.2659-0.00099-0.49859,0.1006-0.6647,0.2393-0.16611,0.13869-0.27742,0.32137-0.38968,0.50028-0.22453,0.35782-0.39269,0.76873-0.56546,1.2036-0.17277,0.43483-0.34713,0.88766-0.5046,1.2323-0.15747,0.34465-0.3456,0.57871-0.35862,0.58776-0.01287,0.009-0.30722,0.117-0.69576,0.15181-0.38855,0.0348-0.88122,0.0492-1.3632,0.0694-0.48202,0.0202-0.9703,0.0362-1.393,0.12817-0.21138,0.046-0.4154,0.10148-0.60434,0.20956s-0.36689,0.28631-0.45004,0.53002-0.04901,0.50627,0.03636,0.70157c0.08537,0.19531,0.22656,0.36514,0.3682,0.52344,0.2833,0.31663,0.6327,0.60557,1.0079,0.89849s0.77671,0.55926,1.0678,0.81027c0.29104,0.25101,0.45422,0.50796,0.45912,0.52271,0.0048,0.0146,0.03119,0.33498-0.05456,0.70231-0.08575,0.36732-0.2238,0.81174-0.35282,1.2603-0.12902,0.44861-0.25176,0.90196-0.2917,1.3184-0.01997,0.20819-0.04285,0.40729,0.0053,0.61409,0.04814,0.20679,0.1845,0.43007,0.39902,0.58168,0.21451,0.15161,0.44936,0.1881,0.66823,0.1701s0.43535-0.0703,0.63515-0.15132c0.39961-0.16214,0.80177-0.42851,1.2064-0.68231,0.40465-0.2538,0.80822-0.52155,1.1456-0.71107,0.33734-0.18952,0.6484-0.2686,0.66445-0.26854,0.01586,0.00006,0.30338,0.0951,0.63894,0.28732,0.33556,0.19221,0.72532,0.46503,1.1276,0.72205,0.40229,0.25702,0.81996,0.49752,1.218,0.66284,0.19903,0.0827,0.38893,0.15086,0.60762,0.17059,0.2187,0.0197,0.47978-0.031,0.69551-0.18105,0.21572-0.15001,0.33928-0.35235,0.38918-0.55877s0.04291-0.43517,0.02476-0.64358c-0.03632-0.41683-0.15899-0.86394-0.2841-1.3137-0.12511-0.44978-0.26165-0.88661-0.34421-1.2548-0.08256-0.36813-0.07169-0.68662-0.06666-0.70133,0.005-0.0145,0.18746-0.25247,0.4806-0.50101,0.29313-0.24854,0.67599-0.53755,1.0536-0.82731,0.37764-0.28976,0.76716-0.57158,1.0531-0.88579,0.14298-0.1571,0.2418-0.33444,0.32882-0.52904s0.136-0.42874,0.05481-0.67306-0.27108-0.41314-0.45912-0.52272-0.36679-0.18158-0.57782-0.22931c-0.42206-0.0955-0.91359-0.14009-1.3956-0.16426-0.48198-0.0242-0.94584-0.039-1.3342-0.077s-0.71565-0.13122-0.72859-0.14037c-0.01279-0.009-0.18402-0.23636-0.3384-0.58217s-0.32658-0.78819-0.49548-1.2243c-0.1689-0.4361-0.33477-0.86429-0.55609-1.2238-0.11067-0.17977-0.23335-0.35397-0.39826-0.49396s-0.40309-0.25684-0.66899-0.25783zm0.0086,0.99424c0.0422,0.0358,0.10671,0.13602,0.1841,0.26173,0.15477,0.25141,0.33068,0.6272,0.49397,1.0488,0.16329,0.42163,0.31905,0.88645,0.49598,1.2828,0.17693,0.39633,0.31456,0.73379,0.6753,0.98889,0.36072,0.25509,0.77019,0.29763,1.2152,0.34118,0.44506,0.0435,0.92882,0.0532,1.3948,0.0765,0.46599,0.0234,0.91824,0.0697,1.2135,0.13647,0.14763,0.0334,0.25558,0.0572,0.30381,0.0853-0.02227,0.0498-0.07958,0.15478-0.17956,0.26464-0.19997,0.21973-0.53749,0.48746-0.90261,0.7676-0.36511,0.28015-0.77804,0.57219-1.114,0.85704-0.33595,0.28485-0.63992,0.53221-0.77987,0.94209-0.13995,0.40986-0.05396,0.77681,0.04065,1.1987s0.25406,0.87813,0.37502,1.313c0.12096,0.43486,0.22688,0.84692,0.25228,1.1385,0.01156,0.13264-0.01699,0.23485-0.02778,0.29267-0.05993-0.008-0.1764-0.0324-0.30381-0.0853-0.27836-0.11561-0.64649-0.32808-1.0354-0.57657-0.38894-0.24849-0.8039-0.53053-1.1885-0.75081-0.38457-0.22028-0.70791-0.39837-1.1551-0.40015-0.44722-0.002-0.79205,0.17245-1.1786,0.38965-0.38659,0.21719-0.78438,0.49517-1.1756,0.74055-0.39123,0.24538-0.77636,0.4507-1.0559,0.56412-0.13977,0.0567-0.24616,0.0856-0.3023,0.0902-0.01026-0.0578-0.01522-0.16008-0.0025-0.29243,0.02793-0.29118,0.13818-0.70893,0.26291-1.1426,0.12473-0.43372,0.25404-0.89785,0.35232-1.3188,0.09828-0.42099,0.18672-0.78846,0.05027-1.1994-0.13644-0.41097-0.43218-0.64202-0.76571-0.92967-0.33353-0.28766-0.70551-0.58555-1.0683-0.86876-0.36275-0.2832-0.7178-0.56075-0.91597-0.78224-0.09908-0.11075-0.16221-0.21163-0.1841-0.26173,0.04834-0.0276,0.15448-0.058,0.3023-0.0902,0.29562-0.0643,0.74518-0.10714,1.2112-0.1267,0.46603-0.0196,0.94824-0.0298,1.3935-0.0697,0.44531-0.0399,0.84679-0.0499,1.2097-0.30216,0.36289-0.25221,0.5383-0.60511,0.71876-1.0001,0.18046-0.39497,0.33731-0.84115,0.50435-1.2616,0.16704-0.42041,0.31848-0.83556,0.47556-1.0859,0.07853-0.12515,0.16751-0.20007,0.21012-0.23565z"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/Pafat/icons/prev.svg b/p/themes/Pafat/icons/prev.svg new file mode 100644 index 000000000..000ecb10d --- /dev/null +++ b/p/themes/Pafat/icons/prev.svg @@ -0,0 +1,5 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-301.0002,-747)"> +<path style="block-progression:tb;color:#666;direction:ltr;text-indent:0;text-align:start;enable-background:new;text-transform:none;" d="m313.01,749-1,0c-0.0104-0.00012-0.0208-0.00046-0.0313,0-0.25495,0.0112-0.50987,0.12858-0.6875,0.3125l-6.2977,5.7188,6.2977,5.7188c0.18816,0.18819,0.45346,0.28125,0.71875,0.28125h1v-1c0-0.26529-0.0931-0.53058-0.28125-0.71875l-4.829-4.2812,4.829-4.2812c0.21074-0.19463,0.30316-0.46925,0.28125-0.75z" fill-rule="nonzero" fill="#666"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/Pafat/icons/read.svg b/p/themes/Pafat/icons/read.svg new file mode 100644 index 000000000..f3ce7532d --- /dev/null +++ b/p/themes/Pafat/icons/read.svg @@ -0,0 +1,5 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16.001" width="16"> +<g transform="translate(-60.99995,-296.9989)"> +<path opacity="1" style="baseline-shift:baseline;block-progression:tb;color:#000000;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" fill="#666" d="m68.875,297a1.0001,1.0001,0,0,0,-0.5,0.25l-4.9062,4a1.0001,1.0001,0,0,0,-0.0625,0.0312s-0.32587,0.29728-0.65625,0.75c-0.22334,0.30605-0.3527,0.8316-0.5,1.3125a1.0001,1.0001,0,0,0,-0.03125,0.0312,1.0001,1.0001,0,0,0,-0.21875,0.5625c-0.00051,0.0118,0.00036,0.0195,0,0.0312a1.0001,1.0001,0,0,0,0,0.0312,1.0001,1.0001,0,0,0,0,0.15625v7.8438a1.0001,1.0001,0,0,0,1,1h12a1.0001,1.0001,0,0,0,1,-1v-7.8438a1.0001,1.0001,0,0,0,0,-0.15625,1.0001,1.0001,0,0,0,-0.21875,-0.65625,1.0001,1.0001,0,0,0,-0.03125,-0.0312c-0.32774-1.1879-1.125-2-1.125-2a1.0001,1.0001,0,0,0,-0.0312,-0.0312l-4.969-4.02a1.0001,1.0001,0,0,0,-0.65625,-0.25,1.0001,1.0001,0,0,0,-0.0937,0zm0.125,2.2812,4.3125,3.5312,0.0312,0.0312c0.021,0.0255,0.18032,0.24952,0.34375,0.5l-4.6874,3.5312-4.6875-3.5312c0.0259-0.0394,0.0349-0.0872,0.0625-0.125,0.1908-0.26146,0.31874-0.41421,0.34375-0.4375l0.03125-0.0312,4.25-3.4688zm-5,5.0938,4.6875,3.5312,0.3125,0.21875,0.3125-0.21875,4.6875-3.5312,0,6.625-10,0,0-6.625z"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/Pafat/icons/share.svg b/p/themes/Pafat/icons/share.svg new file mode 100644 index 000000000..5010082cb --- /dev/null +++ b/p/themes/Pafat/icons/share.svg @@ -0,0 +1,8 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g fill="#666" transform="translate(-581.0002,-196)"> +<path style="enable-background:new;color:#000000;" d="m291,178.03c0,1.0873-0.88144,1.9688-1.9688,1.9688-1.0873,0-1.9688-0.88144-1.9688-1.9688,0-1.0873,0.88144-1.9688,1.9688-1.9688,1.0873,0,1.9688,0.88144,1.9688,1.9688z" fill-rule="nonzero" transform="matrix(1.5079365,0,0,1.5079365,148.15963,-64.49107)"/> +<path style="enable-background:new;color:#000000;" d="m291,178.03c0,1.0873-0.88144,1.9688-1.9688,1.9688-1.0873,0-1.9688-0.88144-1.9688-1.9688,0-1.0873,0.88144-1.9688,1.9688-1.9688,1.0873,0,1.9688,0.88144,1.9688,1.9688z" fill-rule="nonzero" transform="matrix(1.5079365,0,0,1.5079365,158.12818,-59.49107)"/> +<path style="enable-background:new;color:#000000;" d="m291,178.03c0,1.0873-0.88144,1.9688-1.9688,1.9688-1.0873,0-1.9688-0.88144-1.9688-1.9688,0-1.0873,0.88144-1.9688,1.9688-1.9688,1.0873,0,1.9688,0.88144,1.9688,1.9688z" fill-rule="nonzero" transform="matrix(1.5079365,0,0,1.5079365,158.12818,-69.49107)"/> +<path style="baseline-shift:baseline;block-progression:tb;color:#000000;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" d="m593.62,198.16-10.062,4.875-1.8125,0.90625,1.8125,0.90625,10.031,5.0625,0.90625-1.8125-8.2188-4.1562,8.2188-4-0.875-1.7812z"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/Pafat/icons/starred.svg b/p/themes/Pafat/icons/starred.svg new file mode 100644 index 000000000..b9ab2f9f7 --- /dev/null +++ b/p/themes/Pafat/icons/starred.svg @@ -0,0 +1,5 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-41.000202,-397)"> +<path style="enable-background:accumulate;color:#000000;" d="m530.95,186.71c-0.77941,0.55189-3.1576-1.906-4.1125-1.9179-0.95532-0.0119-3.3949,2.3858-4.161,1.8149-0.76573-0.57072,0.83698-3.592,0.55319-4.5039-0.2839-0.91223-3.3182-2.4915-3.0119-3.3965,0.30617-0.90461,3.6749-0.31399,4.4544-0.86567,0.77986-0.5519,1.3442-3.9257,2.2995-3.914,0.95494,0.0116,1.4342,3.398,2.1998,3.9689,0.76588,0.57114,4.1489,0.0653,4.4331,0.97746,0.28402,0.9118-2.7885,2.414-3.0949,3.3186-0.30652,0.90489,1.22,3.966,0.44027,4.5182z" fill-rule="nonzero" transform="matrix(1.0472113,-0.00871584,0.00871584,1.0472113,-504.35434,220.15425)" fill="#666"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/Pafat/icons/tag.svg b/p/themes/Pafat/icons/tag.svg new file mode 100644 index 000000000..9908d4665 --- /dev/null +++ b/p/themes/Pafat/icons/tag.svg @@ -0,0 +1,5 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-141.0002,-807)"> +<path d="m149,809,0,13,4-4,4,4c0.0525-6.8494-0.0285-10.584,0-13z" fill="#666"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/Pafat/icons/unread.svg b/p/themes/Pafat/icons/unread.svg new file mode 100644 index 000000000..77ce9c8b4 --- /dev/null +++ b/p/themes/Pafat/icons/unread.svg @@ -0,0 +1,6 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-40.99995,-297)" fill="#666"> +<path style="block-progression:tb;color:#000000;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" d="m43.781,301a1.0001,1.0001,0,0,0,-0.40625,1.7812l5,4,0.625,0.5,0.625-0.5,5-4a1.0005,1.0005,0,1,0,-1.25,-1.5625l-4.375,3.5-4.375-3.5a1.0001,1.0001,0,0,0,-0.844,-0.22z"/> +<path style="block-progression:tb;color:#000000;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" d="M42.906,300a1.0001,1.0001,0,0,0,-0.906,1v9a1.0001,1.0001,0,0,0,1,1h12a1.0001,1.0001,0,0,0,1,-1v-9a1.0001,1.0001,0,0,0,-1,-1h-12a1.0001,1.0001,0,0,0,-0.09375,0zm1.094,2h10v7h-10v-7z"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/Pafat/icons/up.svg b/p/themes/Pafat/icons/up.svg new file mode 100644 index 000000000..bd9be09e9 --- /dev/null +++ b/p/themes/Pafat/icons/up.svg @@ -0,0 +1,5 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-201.0002,-747)"> +<path style="block-progression:tb;color:#666;direction:ltr;text-indent:0;text-align:start;enable-background:new;text-transform:none;" d="m215.03,759,0-1c-0.00091-0.0111,0.00059-0.021-0.00009-0.0312-0.0112-0.25496-0.12835-0.50994-0.31251-0.6875l-5.7188-6.2977-5.7188,6.2977c-0.18821,0.1881-0.28121,0.45346-0.28122,0.71875v1h1c0.26531-0.00007,0.53059-0.0931,0.71873-0.28131l4.2812-4.829,4.2813,4.829c0.19464,0.21073,0.46925,0.30315,0.74998,0.2813z" fill-rule="nonzero" fill="#666"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/Pafat/loader.gif b/p/themes/Pafat/loader.gif Binary files differnew file mode 100644 index 000000000..a3d327a18 --- /dev/null +++ b/p/themes/Pafat/loader.gif diff --git a/p/themes/Pafat/metadata.json b/p/themes/Pafat/metadata.json new file mode 100644 index 000000000..ba82e0a09 --- /dev/null +++ b/p/themes/Pafat/metadata.json @@ -0,0 +1,7 @@ +{ + "name": "Pafat", + "author": "Plopoyop", + "description": "Un thème pour FreshRSS", + "version": 0.2, + "files": ["_template.css", "pafat.css"] +} diff --git a/p/themes/Pafat/pafat.css b/p/themes/Pafat/pafat.css new file mode 100644 index 000000000..a35ac861d --- /dev/null +++ b/p/themes/Pafat/pafat.css @@ -0,0 +1,1084 @@ +@charset "UTF-8"; + +/*=== FONTS */ +@font-face { + font-family: "OpenSans"; + src: url("../fonts/openSans.woff") format("woff"); +} + +/*=== GENERAL */ +/*============*/ +html, body { + height: 100%; + font-family: "OpenSans", "Cantarell", "Helvetica", "Arial", sans-serif; + background: #fafafa; + color : #666; +} + +/*=== Links */ +a { + color: #2980b9; + outline: none; +} + +/*=== Forms */ +legend { + margin: 20px 0 5px; + padding: 5px 0; + border-bottom: 1px solid #ddd; + font-size: 1.4em; +} +label { + min-height: 25px; + padding: 5px 0; + cursor: pointer; +} +textarea { + width: 360px; + height: 100px; +} +input, select, textarea { + min-height: 25px; + padding: 1px; + background: #fdfdfd; + border: 1px solid #bbb; + border-radius: 3px; + color: #666; + line-height: 21px; + vertical-align: middle; +} + +select{ + height:29px; +} +option { + padding: 0 .5em; +} +input:focus, select:focus, textarea:focus { + outline-color: #aaa; +} + +input:invalid, select:invalid { + border-color: #f00; + box-shadow: 0 0 2px 2px #fdd inset; + outline-color: #fdd; +} +input:disabled, select:disabled { + background: #eee; +} +input.extend { + transition: width 200ms linear; + -moz-transition: width 200ms linear; + -webkit-transition: width 200ms linear; + -o-transition: width 200ms linear; + -ms-transition: width 200ms linear; +} + +/*=== Tables */ +table { + border-collapse: collapse; +} + +tr, th, td { + padding: 0.5em; + border: 1px solid #ddd; +} +th { + background: #f6f6f6; +} +form td, +form th { + font-weight: normal; + text-align: center; +} + +/*=== COMPONENTS */ +/*===============*/ +/*=== Forms */ +.form-group.form-actions { + padding: 5px 0; + background: #f4f4f4; + border-top: 1px solid #ddd; +} +.form-group.form-actions .btn { + margin: 0 10px; +} +.form-group .group-name { + padding: 10px 0; + text-align: right; +} +.form-group .group-controls { + min-height: 25px; + padding: 5px 0; + margin : 10px 0 10px 220px; + +} +.form-group table { + margin: 10px 0 0 220px; +} + +/*=== Buttons */ +.stick { + vertical-align: middle; + font-size: 0; + min-width: 215px; +} +.stick input, +.stick .btn { + border-radius: 0; +} +.stick .btn:first-child, +.stick input:first-child { + border-radius: 3px 0 0 3px; +} +.stick .btn-important:first-child { + width:176px; +} +.stick .btn:last-child, +.stick input:last-child { + border-radius: 0 3px 3px 0; +} +.stick .btn + .btn, +.stick .btn + input, +.stick .btn + .dropdown > .btn, +.stick input + .btn, +.stick input + input, +.stick input + .dropdown > .btn, +.stick .dropdown + .btn, +.stick .dropdown + input, +.stick .dropdown + .dropdown > .btn { + border-left: none; + +} + +.stick .btn + .dropdown > .btn { + border-left: none; + border-radius: 0 3px 3px 0; +} + +.btn { + display: inline-block; + min-height: 29px; + min-width: 15px; + margin: 0; + padding: 1px 5px; + background: #fff; + border-radius: 3px; + border: 1px solid #aaa; + color: #666; + font-size: 0.9rem; + vertical-align: middle; + cursor: pointer; + overflow: hidden; +} + +a.btn { + min-height: 25px; + line-height: 25px; +} + + +a.btn { + min-height: 25px; + line-height: 25px; +} + +.read_all.btn { + height:29px; +} + +.btn:hover { + background: #f0f0f0; + text-decoration: none; +} + + +.category.stick .btn { + background:#5bc0de; + color : #FFF; + border-color :#5bc0de; +} + +.category.stick .btn:first-child:hover, .category.stick .btn:last-child:hover, .category.stick .btn.active:first-child, .category.stick.active .btn:last-child { + background:#39b3d7; + border-color : #39b3d7; +} + + +.btn.active, +.btn:active, +.dropdown-target:target ~ .btn.dropdown-toggle { + background: #eee; +} + +.category.all > .btn { + background: #428bca; + color : #FFF; + border-color : #428bca; +} + +.category.all > .btn:hover { + background: #3276b1; + border-color : #3276b1; +} + +.category.favorites > .btn { + background:#f0ad4e; + border-color: #f0ad4e; + color : #fff; +} + +.category.favorites > .btn:hover { + background: #ed9c28; + border-color : #ed9c28; + color : white; +} + +.btn-important { + background: #5cb85c; + color: #fff; + border-color: #5cb85c; + font-weight: normal; +} +.btn-important:hover, .btn-important:active { + background:#47a447; + border-color : #47a447; + box-shadow: none; +} + +.btn-attention { + background: #d9534f; + color: #fff; + border: 1px solid #d9534f; + outline-color : #aaa; +} +.btn-attention:hover { + background: #d2322d; + border-color : #d2322d; +} +.btn-attention:active { + background: #d2322d; + box-shadow: none; +} + +/*=== Navigation */ +.nav-list .nav-header, +.nav-list .item { + height: 2.5em; + line-height: 2.5em; + font-size: 0.9rem; +} +.nav-list .item:hover { + background: #fafafa; +} +.nav-list .item:hover a { + color: #003388; +} +.nav-list .item.active { + background: #3498DB; + color: #fff; +} +.nav-list .item.active a { + color: #fff; +} +.nav-list .disable { + color: #aaa; + background: #fafafa; + text-align: center; +} +.nav-list .item > a { + padding: 0 10px; +} +.nav-list a:hover { + text-decoration: none; +} +.nav-list .item.empty a { + color: #f39c12; +} +.nav-list .item.active.empty a { + color: #fff; + background: #f39c12; +} +.nav-list .item.error a { + color: #BD362F; +} +.nav-list .item.active.error a { + color: #fff; + background: #BD362F; +} + +.nav-list .nav-header { + padding: 0 10px; + color: #888; + background: #f4f4f4; + border-bottom: 1px solid #ddd; + font-weight: bold; +} + +.nav-list .nav-form { + padding: 3px; + text-align: center; +} + +.nav-head { + margin: 0; + background: #fff; + background: linear-gradient(to bottom, #fff, #f0f0f0); + background: -moz-linear-gradient(top, #fff 0%, #f0f0f0 100%); + background: -webkit-linear-gradient(top, #fff 0%, #f0f0f0 100%); + background: -o-linear-gradient(top, #fff 0%, #f0f0f0 100%); + background: -ms-linear-gradient(top, #fff 0%, #f0f0f0 100%); + border-bottom: 1px solid #ddd; + text-align: right; +} +.nav-head .item { + padding: 5px 10px; + font-size: 0.9rem; + line-height: 1.5rem; +} + +/*=== Horizontal-list */ +.horizontal-list { + margin: 0; + padding: 0; +} +.horizontal-list .item { + vertical-align: middle; +} + +/*=== Dropdown */ +.dropdown-menu { + margin: 5px 0 0; + padding: 5px 0; + border: 1px solid #aaa; + border-radius: 5px; + font-size: 0.8rem; + text-align: left; +} +.dropdown-menu:after { + content: ""; + position: absolute; + top: -6px; + right: 13px; + width: 10px; + height: 10px; + background: #fff; + border-top: 1px solid #aaa; + border-left: 1px solid #aaa; + z-index: -10; + transform: rotate(45deg); + -moz-transform: rotate(45deg); + -webkit-transform: rotate(45deg); + -ms-transform: rotate(45deg); +} +.dropdown-header { + padding: 0 5px 5px; + color: #888; + font-weight: bold; + text-align: left; +} +.dropdown-menu > .item { +} + +.dropdown-menu > .item > a { + padding: 0 22px; + line-height: 2.5em; + color: #666; + font-size: 0.8rem; +} + +.dropdown-menu > .item > span, +.dropdown-menu > .item > .as-link { + padding: 0 22px; + line-height: 2em; + font-size: 0.8rem; +} + +.dropdown-menu > .item:hover { + background: #eee; + color: #666; +} +.dropdown-menu > .item[aria-checked="true"] > a:before { + font-weight: bold; + margin: 0 0 0 -14px; +} +.dropdown-menu > .item:hover > a { + color: #666; + text-decoration: none; +} +.dropdown-menu .input select, +.dropdown-menu .input input { + margin: 0 auto 5px; + padding: 2px 5px; + border-radius: 3px; +} + +.separator { + margin: 5px 0; + border-bottom: 1px solid #ddd; +} + +/*=== Alerts */ +.alert { + margin: 15px auto; + padding: 10px 15px; + background: #f4f4f4; + border: 1px solid #ccc; + border-right: 1px solid #aaa; + border-bottom: 1px solid #aaa; + border-radius: 5px; + color: #aaa; + font-size: 0.9em; +} +.alert-head { + font-size: 1.15em; +} +.alert > a { + color: inherit; + text-decoration: underline; +} +.alert-warn { + background: #ffe; + border: 1px solid #eeb; + color: #c95; +} +.alert-success { + background: #dfd; + border: 1px solid #cec; + color: #484; +} +.alert-error { + background: #fdd; + border: 1px solid #ecc; + color: #844; +} + +/*=== Pagination */ +.pagination { + background: #fff; + text-align: center; + color: #41444f; + font-size: 0.8em; +} +.content .pagination { + margin: 0; + padding: 0; +} +.pagination .item.pager-current { + font-weight: bold; + font-size: 1.5em; +} +.pagination .item a { + display: block; + color: #41444f; + font-style: italic; + line-height: 3em; + text-decoration: none; +} +.pagination .item a:hover { + background: #ddd; +} +.pagination:first-child .item { + border-bottom: 1px solid #aaa; +} +.pagination:last-child .item { + border-top: 1px solid #aaa; +} + +.pagination .loading, +.pagination a:hover.loading { + background: url("loader.gif") center center no-repeat #fff; + font-size: 0; +} + +/*=== STRUCTURE */ +/*===============*/ +/*=== Header */ +.header { + height: 85px; + background: #41444f; +} +.header > .item { + padding: 10px; + border-bottom: 1px solid #aaa; + vertical-align: middle; + text-align: center; +} +.header > .item.title{ + width: 230px; +} +.header > .item.title h1 { + margin: 0.5em 0; +} + +.header > .item.title h1 a, a.signin { + text-decoration: none; + color : #C5C6CA; +} + +.header > .item.search input { + width: 230px; + height : 29px; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; +} + +.header > .item.search button { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; + height : 29px; +} + +.header .item.search input:focus { + width: 350px; +} + +/*=== Body */ +#global { + height: calc(100% - 85px); +} +.aside { + border-right: 1px solid #aaa; + background: #fff; +} +.aside.aside_flux { + padding: 10px 0 50px; +} + +/*=== Aside main page (categories) */ +.categories { + text-align: center; +} +.category { + width: 215px; + margin: 10px auto; + text-align: left; +} +.category .btn:first-child { + position: relative; + width: 203px; +} +.category.stick .btn:first-child { + width: 176px; +} +.category .btn:first-child:not([data-unread="0"]):after { + position: absolute; + top: 2px; right: 3px; + padding: 0px 3px; + border: 1px solid ; + border-radius: 3px; + font-size:10pt; + line-height : 20px; +} + +/*=== Aside main page (feeds) */ +.categories .feeds .item.active { + background: #5cb85c; +} +.categories .feeds .item.active .feed { + color: #fff; +} +.categories .feeds .item.empty .feed { + color: #e67e22; +} +.categories .feeds .item.empty.active { + background: #e67e22; +} +.categories .feeds .item.empty.active .feed { + color: #fff; +} +.categories .feeds .item.error .feed { + color: #BD362F; +} +.categories .feeds .item .feed { + margin: 0; + width: 165px; + line-height: 3em; + font-size: 0.8em; + text-align: left; + text-decoration: none; +} +.categories .feeds .feed:not([data-unread="0"]) { + font-weight: bold; +} +.categories .feeds .dropdown-menu:after { + left: 2px; +} +.categories .feeds .item .dropdown-target:target ~ .dropdown-toggle > .icon, +.categories .feeds .item:hover .dropdown-toggle > .icon, +.categories .feeds .item.active .dropdown-toggle > .icon { + background-color: #fff; + border-radius: 3px; + vertical-align: middle; +} + +/*=== Configuration pages */ +.post { + padding: 10px 50px; + font-size: 0.9em; +} +.post form { + margin: 10px 0; +} +.post.content { + max-width: 550px; +} + +/*=== Prompt (centered) */ +.prompt { + text-align: center; +} +.prompt label { + text-align: left; +} +.prompt form { + margin: 10px auto 20px auto; + width: 200px; +} +.prompt input { + margin: 5px auto; + width: 100%; +} +.prompt p { + margin: 20px 0; +} + +/*=== New article notification */ +#new-article { + background: #428bca; + text-align: center; + font-size: 0.9em; +} +#new-article:hover { + background: #3276b1; +} +#new-article > a { + line-height: 3em; + color: #fff; + font-weight: bold; +} +#new-article > a:hover { + text-decoration: none; +} + +/*=== Day indication */ +.day { + padding: 0 10px; + font-weight: bold; + line-height: 3em; + background: #fff; + border-top: 1px solid #aaa; + border-bottom: 1px solid #aaa; + color : #666; +} +#new-article + .day { + border-top: none; +} +.day .name { + padding: 0 10px 0 0; + color : #666; + font-size: 1.8em; + opacity: 0.3; + font-style: italic; + text-align: right; +} + +/*=== Index menu */ +.nav_menu { + background: #fafafa; + border-bottom: 1px solid #aaa; + text-align: center; + padding: 5px 0; +} + +/*=== Feed articles */ +.flux { + border-left: 3px solid #5cb85c; + background: #fafafa; +} +.flux:hover { + background: #fff; +} +.flux.current { + border-left: 3px solid #39b3d7; +} +.flux.not_read { + border-left: 3px solid #d9534f; +} +.flux .item.title a, .flux.not_read:not(.current):hover .item.title { + color : #333; +} +.flux.favorite { + border-left: 2px solid #428bca; + background: #FFF6DA; +} +.flux.favorite:not(.current):hover .item.title { + background: #FFF6DA; +} +.flux.current { + background: #fff; +} + + +.flux_header { + border-top: 1px solid #ddd; + font-size: 0.8rem; + cursor: pointer; +} +.flux_header .title { + font-size: 0.9rem; +} +.flux .website .favicon { + padding: 5px; +} +.flux .date { + color: #666; + font-size: 0.7rem; +} + +.flux .bottom { + font-size: 0.8rem; + text-align: center; +} + +/*=== Content of feed articles */ +.content { + padding: 20px 10px; +} +.content > h1.title > a { + color: #333; +} + +.content hr { + margin: 30px 10px; + height: 1px; + background: #ddd; + border: 0; + box-shadow: 0 2px 5px #ccc; +} + +.content pre { + margin: 10px auto; + padding: 10px 20px; + overflow: auto; + background: #222; + color: #fff; + font-size: 0.9rem; + border-radius: 3px; +} +.content code { + padding: 2px 5px; + color: #dd1144; + background: #fafafa; + border: 1px solid #eee; + border-radius: 3px; +} +.content pre code { + background: transparent; + color: #fff; + border: none; +} + +.content blockquote { + display: block; + margin: 0; + padding: 5px 20px; + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + background: #fafafa; + color: #41444f; +} +.content blockquote p { + margin: 0; +} + +/*=== Notification and actualize notification */ +.notification { + padding: 0 0 0 5px; + text-align: center; + border: 1px solid #eeb; + border-radius: 3px; + box-shadow: 0 0 5px #ddd; + font-weight: bold; + font-size: 0.9em; + line-height: 3em; + z-index: 10; + vertical-align: middle; +} +.notification.good { + background: #ffe; + border: 1px solid #eeb; + color: #c95; +} +.notification.bad { + background: #fdd; + border: 1px solid #ecc; + color: #844; +} +.notification a.close { + padding: 0 15px; + line-height: 3em; +} +.notification.good a.close:hover { + background: #eeb; +} +.notification.bad a.close:hover { + background: #ecc; +} + +.notification#actualizeProgress { + line-height: 2em; +} + +/*=== "Load more" part */ +#bigMarkAsRead { + text-align: center; + text-decoration: none; + color: #666; + background: #fafafa; +} +#bigMarkAsRead:hover { + color: #000; + background: #f0f0f0; +} + +#bigMarkAsRead:hover .bigTick { +/* text-shadow: 0 0 10px #666;*/ +} + +/*=== Navigation menu (for articles) */ +#nav_entries { + margin: 0; + background: #fff; + border-top: 1px solid #ddd; + text-align: center; + line-height: 3em; + table-layout: fixed; +} + +#nav_entries .item:hover { + background:#eee ; +} +/*=== READER VIEW */ +/*================*/ +#stream.reader .flux { + padding: 0 0 50px; + border: none; + background: #f0f0f0; + color: #41444f; +} +#stream.reader .flux .author { + margin: 0 0 10px; + font-size: 90%; + color: #666; +} + +/*=== GLOBAL VIEW */ +/*================*/ +#stream.global .box-category { + background: #fff; + border:none; + text-align: left; +} + +#stream.global .category { + margin: 0; +} + +#stream.global .category:first-child { + margin: 0; +} + + +#stream.global .btn { + width: auto; + height: 2em; + margin: 0; + padding: 0 10px; + background: #f6f6f6; + border-bottom: 1px solid #aaa; + border-radius: 5px 5px 0 0; + line-height: 2em; + font-size: 1.2rem; +} + +#stream.global .btn:not([data-unread="0"]) { + background: #5bc0de; + border-color : #5bc0de; + color: #fff; + font-weight: bold; + text-shadow: none; + +} + + +#stream.global .btn:first-child:not([data-unread="0"]):after { + top: 0; right: 5px; + border: 0; + background: none; + color: #fff; + font-weight: bold; + box-shadow: none; + text-shadow: none; +} + +#stream.global .box-category .feeds { + max-height: 250px; + width: 302px; + border : solid #aaa 1px; + border-top : none; +} + +#stream.global .box-category .feeds .item { + padding: 2px 10px; + font-size: 0.9rem; +} + +/*=== DIVERS */ +/*===========*/ +.aside.aside_feed .nav-form input, +.aside.aside_feed .nav-form select { + width: 140px; +} +.aside.aside_feed .nav-form .dropdown .dropdown-menu { + right: -20px; +} +.aside.aside_feed .nav-form .dropdown .dropdown-menu:after { + right: 33px; +} + +/*=== STATISTICS */ +/*===============*/ +.stat { + margin: 10px 0 20px; +} + +.stat th, +.stat td, +.stat tr { + border: none; +} +.stat > table td, +.stat > table th { + border-bottom: 1px solid #ddd; + text-align: center; +} +.stat > .horizontal-list { + margin: 0 0 5px; +} +.stat > .horizontal-list .item { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} +.stat > .horizontal-list .item:first-child { + width: 250px; +} + +/*=== LOGS */ +/*=========*/ +.logs { + border: 1px solid #aaa; + border-radius: 5px; + overflow: hidden; +} +.log { + padding: 5px 10px; + background: #fafafa; + color: #41444f; + font-size: 0.8rem; +} +.log+.log { + border-top: 1px solid #aaa; +} +.log .date { + display: block; + font-weight: bold; +} +.log.error { + background: #fdd; + color: #844; +} +.log.warning { + background: #ffe; + color: #c95; +} +.log.notice { + background: #f4f4f4; + color: #aaa; +} +.log.debug { + background: #41444f; + color: #eee; +} + +/*=== MOBILE */ +/*===========*/ +@media(max-width: 840px) { + .aside { + box-shadow: 3px 0 3px #aaa; + transition: width 200ms linear; + -moz-transition: width 200ms linear; + -webkit-transition: width 200ms linear; + -o-transition: width 200ms linear; + -ms-transition: width 200ms linear; + } + .aside .toggle_aside, + #panel .close { + position: absolute; + display: block; + top: 0; right: 0; + width: 30px; + height: 30px; + line-height: 30px; + text-align: center; + background: #f6f6f6; + border-left: 1px solid #ddd; + border-bottom: 1px solid #ddd; + border-radius: 0 0 0 5px; + } + + .nav_menu .btn { + margin: 5px 10px; + } + .nav_menu .stick { + margin: 0 10px; + } + .nav_menu .stick .btn { + margin: 5px 0; + } + .nav_menu .search { + display: inline-block; + max-width: 97%; + } + .nav_menu .search input { + max-width: 97%; + width: 90px; + } + .nav_menu .search input:focus { + width: 400px; + } + + .day .name { + font-size: 1.1rem; + text-shadow: none; + } + + .pagination { + margin: 0 0 3.5em; + } + + .notification a.close { + display: block; + left: 0; + background: transparent; + } + .notification a.close:hover { + opacity: 0.5; + } + .notification a.close .icon { + display: none; + } +}
\ No newline at end of file diff --git a/p/themes/Screwdriver/README.md b/p/themes/Screwdriver/README.md new file mode 100644 index 000000000..4b10eb90f --- /dev/null +++ b/p/themes/Screwdriver/README.md @@ -0,0 +1,36 @@ +Screwdriver +======= + +**C'est un cocktail! C'est chaud mais "fresh" à la fois. C'est... c'est... un thème pour l'agrégateur de flux RSS<a href="https://github.com/marienfressinaud/FreshRSS/" target="blank">FreshRSS</a>!!** +En toute modestie, ce thème tue du chaton. + + + + +Installation +----------------- +1. Placez le dossier du thème dans ledossier /FreshRSS/p/themes/Screwdriver de votre FreshRSS; +2. Allez dans les paramètres d'Affichage et changez de thème; +3. Profitez de votre Screwdriver! +4. Remontez les problèmes sur Github (facultatif mais fortement apprécié) + + + +Screwdriver est distribué sous license BeerWare: +----------------- + +« LICENCE BEERWARE » (Révision 42): + +mister.air@gmail.com a créé ce fichier. Tant que vous conservez cet avertissement, + +vous pouvez faire ce que vous voulez de ce truc. Si on se rencontre un jour et + +que vous pensez que ce truc vaut le coup, vous pouvez me payer une bière en retour. + +*Mister aiR* + + + + + + diff --git a/p/themes/Screwdriver/icons/bookmark.svg b/p/themes/Screwdriver/icons/bookmark.svg new file mode 100644 index 000000000..edf5a02db --- /dev/null +++ b/p/themes/Screwdriver/icons/bookmark.svg @@ -0,0 +1,5 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-41.000202,-397)"> +<path style="color:#000000;enable-background:accumulate;" d="m530.95,186.71c-0.77941,0.55189-3.1576-1.906-4.1125-1.9179-0.95532-0.0119-3.3949,2.3858-4.161,1.8149-0.76573-0.57072,0.83698-3.592,0.55319-4.5039-0.2839-0.91223-3.3182-2.4915-3.0119-3.3965,0.30617-0.90461,3.6749-0.31399,4.4544-0.86567,0.77986-0.5519,1.3442-3.9257,2.2995-3.914,0.95494,0.0116,1.4342,3.398,2.1998,3.9689,0.76588,0.57114,4.1489,0.0653,4.4331,0.97746,0.28402,0.9118-2.7885,2.414-3.0949,3.3186-0.30652,0.90489,1.22,3.966,0.44027,4.5182z" fill-rule="nonzero" transform="matrix(1.0472113,-0.00871584,0.00871584,1.0472113,-504.35434,220.15425)" fill="#d18104"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/Screwdriver/icons/read.svg b/p/themes/Screwdriver/icons/read.svg new file mode 100644 index 000000000..5e454e36b --- /dev/null +++ b/p/themes/Screwdriver/icons/read.svg @@ -0,0 +1,3 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16.001" width="16"> +<path fill="#CCC" d="m8.0005,3.2833c-3.4339,0-6.4103,1.9996-7.8729,4.9206,1.4626,2.9209,4.439,4.9206,7.8729,4.9206,3.4338,0,6.4102-1.9996,7.8729-4.9206-1.462-2.9204-4.439-4.9201-7.8725-4.9201zm3.8819,2.6095c0.9251,0.59007,1.709,1.3804,2.2978,2.3111-0.58881,0.93063-1.3727,1.721-2.2978,2.3111-1.1624,0.7414-2.5047,1.1333-3.8818,1.1333s-2.7195-0.39189-3.8819-1.1333c-0.92507-0.59004-1.709-1.3804-2.2978-2.3111,0.58881-0.93066,1.3727-1.721,2.2978-2.3111,0.06025-0.038442,0.12111-0.075682,0.18234-0.11225-0.15312,0.42021-0.23692,0.87374-0.23692,1.3469,0,2.174,1.7624,3.9364,3.9364,3.9364s3.9365-1.7624,3.9365-3.9364c0-0.4732-0.0838-0.92673-0.23692-1.347,0.0612,0.036566,0.12206,0.073839,0.18234,0.11228zm-3.8815,0.7427c0,0.81528-0.66089,1.4762-1.4762,1.4762-0.81528,0-1.4762-0.66089-1.4762-1.4762,0-0.81528,0.66089-1.4762,1.4762-1.4762,0.81527,0,1.4762,0.66089,1.4762,1.4762z"/> +</svg>
\ No newline at end of file diff --git a/p/themes/Screwdriver/icons/starred.svg b/p/themes/Screwdriver/icons/starred.svg new file mode 100644 index 000000000..cd06525fd --- /dev/null +++ b/p/themes/Screwdriver/icons/starred.svg @@ -0,0 +1,5 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-41.000202,-397)"> +<path style="color:#000000;enable-background:accumulate;" d="m530.95,186.71c-0.77941,0.55189-3.1576-1.906-4.1125-1.9179-0.95532-0.0119-3.3949,2.3858-4.161,1.8149-0.76573-0.57072,0.83698-3.592,0.55319-4.5039-0.2839-0.91223-3.3182-2.4915-3.0119-3.3965,0.30617-0.90461,3.6749-0.31399,4.4544-0.86567,0.77986-0.5519,1.3442-3.9257,2.2995-3.914,0.95494,0.0116,1.4342,3.398,2.1998,3.9689,0.76588,0.57114,4.1489,0.0653,4.4331,0.97746,0.28402,0.9118-2.7885,2.414-3.0949,3.3186-0.30652,0.90489,1.22,3.966,0.44027,4.5182z" fill-rule="nonzero" transform="matrix(1.0472113,-0.00871584,0.00871584,1.0472113,-504.35434,220.15425)" fill="#eaa904"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/Screwdriver/icons/unread.svg b/p/themes/Screwdriver/icons/unread.svg new file mode 100644 index 000000000..a27acf2b6 --- /dev/null +++ b/p/themes/Screwdriver/icons/unread.svg @@ -0,0 +1,3 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<path fill="#666" d="m7.9824,3.529c-3.4339,0-6.4103,1.9996-7.8729,4.9206,1.4626,2.9214,4.439,4.9204,7.8729,4.9204,3.4338,0,6.4102-1.9996,7.8729-4.9206-1.462-2.9207-4.439-4.9204-7.8726-4.9204zm3.8819,2.6095c0.9251,0.59007,1.709,1.3804,2.2978,2.3111-0.58881,0.93063-1.3727,1.721-2.2978,2.3111-1.1624,0.7414-2.5047,1.1333-3.8818,1.1333s-2.7195-0.39189-3.8819-1.1333c-0.9248-0.59-1.7087-1.3807-2.2975-2.3114,0.5888-0.9307,1.3727-1.721,2.2978-2.3111,0.0602-0.0384,0.1211-0.0757,0.1823-0.1122-0.15312,0.42021-0.23692,0.87374-0.23692,1.3469,0,2.174,1.7624,3.9364,3.9365,3.9364,2.174,0,3.9365-1.7624,3.9365-3.9364,0-0.4732-0.0838-0.92673-0.23692-1.347,0.0612,0.036566,0.12206,0.073839,0.18234,0.11228zm-3.8816,0.7427c0,0.81528-0.66089,1.4762-1.4762,1.4762-0.81528,0-1.4762-0.66089-1.4762-1.4762,0-0.81528,0.66089-1.4762,1.4762-1.4762,0.81527,0,1.4762,0.66089,1.4762,1.4762z"/> +</svg>
\ No newline at end of file diff --git a/p/themes/Screwdriver/loader.gif b/p/themes/Screwdriver/loader.gif Binary files differnew file mode 100644 index 000000000..5ff26f0e3 --- /dev/null +++ b/p/themes/Screwdriver/loader.gif diff --git a/p/themes/Screwdriver/metadata.json b/p/themes/Screwdriver/metadata.json new file mode 100644 index 000000000..46095e507 --- /dev/null +++ b/p/themes/Screwdriver/metadata.json @@ -0,0 +1,7 @@ +{ + "name": "Screwdriver", + "author": "Mister aiR", + "description": "C'est un cocktail ! C'est chaud mais « fresh » à la fois. Ce thème tue du chaton.", + "version": 1.1, + "files": ["_template.css","screwdriver.css"] +} diff --git a/p/themes/Screwdriver/screwdriver.css b/p/themes/Screwdriver/screwdriver.css new file mode 100644 index 000000000..37fa18e10 --- /dev/null +++ b/p/themes/Screwdriver/screwdriver.css @@ -0,0 +1,1183 @@ +@charset "UTF-8"; + +/*=== FONTS */ +@font-face { + font-family: "OpenSans"; + src: url("../fonts/openSans.woff") format("woff"); +} + +/*=== GENERAL */ +/*============*/ +html, body { + height: 100%; + font-family: "OpenSans", "Cantarell", "Helvetica", "Arial", sans-serif; + background: #fafafa; + font-size: 92%; +} + +/*=== Links */ +a, button.as-link { + color: #D18114; + outline: none; +} + +/*=== Forms */ +.form-group{ + width: 100%; + float: left; + height: auto; + display: inline-block; +} +legend { + margin: 20px 0 5px; + padding: 5px 0; + border-bottom: 1px solid #ddd; + font-size: 1.4em; +} +label { + min-height: 25px; + padding: 5px 0; + cursor: pointer; +} +textarea { + width: 360px; + height: 100px; +} +input, select, textarea { + min-height: 25px; + padding: 5px; + background: #fff; + border: 1px solid #ccc; + border-radius: 3px; + color: #222; + line-height: 25px; + vertical-align: middle; + box-shadow: 0 2px 2px #eee inset, 0 1px #fff; +} +option { + padding: 0 .5em; +} +input:focus, select:focus, textarea:focus { + color: #0F0F0F; + box-shadow: 0 0 3px #E7AB34; + border: solid 1px #E7AB34; +} +input:invalid, select:invalid { + border-color: #f00; + box-shadow: 0 0 2px 2px #fdd inset; +} +input:disabled, select:disabled { + background: #eee; +} +input.extend { + transition: width 200ms linear; + -moz-transition: width 200ms linear; + -webkit-transition: width 200ms linear; + -o-transition: width 200ms linear; + -ms-transition: width 200ms linear; +} + +/*=== Tables */ +table { + border-collapse: collapse; +} + +tr, th, td { + padding: 0.5em; + border: 1px solid #ddd; +} +th { + background: #f6f6f6; +} +form td, +form th { + font-weight: normal; + text-align: center; +} + +/*=== COMPONENTS */ +/*===============*/ +/*=== Forms */ +.form-group.form-actions { + padding: 5px 0; + background: #f4f4f4; + border-top: 1px solid #ddd; +} +.form-group.form-actions .btn { + margin: 0 10px; + border-radius: 4px; + box-shadow:0 1px rgba(255,255,255,0.08) inset; +} +.form-group .group-name { + padding: 10px 0; + text-align: right; +} +.form-group .group-controls { + min-height: 25px; + padding: 5px 0; +} +.form-group table { + margin: 10px 0 0 220px; +} + +/*=== Buttons */ +form#add_rss .stick input, .dropdown-menu select{ + background:#393939; + box-shadow: 0 2px 2px #171717 inset,0 1px rgba(255,255,255,0.08); + border-left:solid 1px #171717; + border-top:solid 1px #171717; + border-bottom:solid 1px #171717; + border-right:none; + color:#fff; +} +form#add_rss .stick .btn{ + background:linear-gradient(180deg, #222 0%, #171717 100%) #171717; + background: -webkit-linear-gradient(top, #222 0%, #171717 100%); + box-shadow:0 1px rgba(255,255,255,0.08), 0px 1px rgba(255, 255, 255, 0.08) inset; + border-right:solid 1px #171717; + border-top:solid 1px #171717; + border-bottom:solid 1px #171717; + border-left:none; +} +form#add_rss .stick .btn.dropdown-toggle{ + border-right:solid 1px #171717; + border-top:solid 1px #171717; + border-bottom:solid 1px #171717; + border-left:solid 1px #171717; +} +.stick { + vertical-align: middle; + font-size: 0; +} +.stick input, +.stick .btn { + border-radius: 0; +} +.stick .btn:first-child,.stick input:first-child { + border-radius: 6px 0 0 6px; +} +.stick .btn-important:first-child { +} +.stick .btn:last-child, .stick input:last-child { + border-radius: 0 6px 6px 0; +} +.stick .btn + .btn, +.stick .btn + input, +.stick .btn + .dropdown > .btn, +.stick input + .btn, +.stick input + input, +.stick input + .dropdown > .btn, +.stick .dropdown + .btn, +.stick .dropdown + input, +.stick .dropdown + .dropdown > .btn { + border-left: none; +} +.stick .btn + .dropdown > .btn { + border-left: none; + border-radius: 0 3px 3px 0; +} + +.btn { + display: inline-block; + min-height: 37px; + min-width: 15px; + margin: 0; + padding: 5px 10px; + color:#222; + border: solid 1px #ccc; + border-radius: 4px; + background: linear-gradient(0deg, #EDE7DE 0%, #FFF 100%) #EDE7DE; + background: -webkit-linear-gradient(bottom, #EDE7DE 0%, #FFF 100%); + text-shadow: 0px -1px rgba(255,255,255,0.08); + font-size: 0.9rem; + vertical-align: middle; + cursor: pointer; + overflow: hidden; +} +a.btn { + min-height: 25px; + line-height: 25px; +} +.btn:hover { + text-shadow: 0 0 2px #fff; + text-decoration:none; +} +.btn.active,.btn:active,.dropdown-target:target ~ .btn.dropdown-toggle { + background: linear-gradient(180deg, #EDE7DE 0%, #FFF 100%) #EDE7DE; + background: -webkit-linear-gradient(top, #EDE7DE 0%, #FFF 100%); +} +#loginButton.btn{ + border:none; + box-shadow: 0px 1px rgba(255, 255, 255, 0.08) inset,0 -1px #171717,0px 1px rgba(255, 255, 255, 0.08); +} +.nav_menu .btn.active, .nav_menu .btn:active, .nav_menu .dropdown-target:target ~ .btn.dropdown-toggle{ + box-shadow: 0px 2px #E2972A; + border-radius: 0; + background:transparent; +} +.nav_menu .btn { + border: 0; + background:transparent; +} + +.read_all { + color:#222; +} +.btn.dropdown-toggle[href="#dropdown-configure"]{ + background: linear-gradient(0deg, #EDE7DE 0%, #FFF 100%) #EDE7DE; + background: -webkit-linear-gradient(bottom, #EDE7DE 0%, #FFF 100%); + border-radius: 4px; + border: solid 1px #ccc; + box-shadow: 0 1px #fff; +} +.btn.dropdown-toggle:active { + background:transparent; +} +.btn-important { + background: linear-gradient(180deg, #E4992C 0%, #D18114 100%) #E4992C; + background: -webkit-linear-gradient(top, #E4992C 0%, #D18114 100%); + color: #FFF; + box-shadow: 0 1px rgba(255,255,255,0.08) inset; + border-radius: 4px; + text-shadow: 0px -1px rgba(255,255,255,0.08); + font-weight: normal; +} +.btn-important:hover { +} +.btn-important:active { + background: linear-gradient(0deg, #E4992C 0%, #D18114 100%) #E4992C; + background: -webkit-linear-gradient(bottom, #E4992C 0%, #D18114 100%); +} + +.btn-attention { + background: #E95B57; + background: linear-gradient(to bottom, #E95B57, #BD362F); + background: -webkit-linear-gradient(top, #E95B57 0%, #BD362F 100%); + color: #fff; + border: 1px solid #C44742; + text-shadow: 0px -1px 0px #666; +} +.btn-attention:hover { + background: linear-gradient(to bottom, #D14641, #BD362F); + background: -webkit-linear-gradient(top, #D14641 0%, #BD362F 100%); +} +.btn-attention:active { + background: #BD362F; + box-shadow: none; +} +.btn[type="reset"]{ + color: #fff; + background:linear-gradient(180deg, #222 0%, #171717 100%) #171717; + background: -webkit-linear-gradient(top, #222 0%, #171717 100%); + box-shadow:0 -1px rgba(255,255,255,0.08) inset; +} +/*=== Navigation */ +.nav-list .nav-header, +.nav-list .item { + height: 2.5em; + line-height: 2.5em; + font-size: 0.9rem; +} +.nav-list .item:hover { + text-shadow: 0 0 2px rgba(255,255,255,0.28); + color:#fff; +} + +.nav-list .item.active { + background: linear-gradient(180deg, #222 0%, #171717 100%) repeat scroll 0% 0% #171717; + background: -webkit-linear-gradient(180deg, #222 0%, #171717 100%); + border-width: medium medium 1px; + border-style: none none solid; + border-color: -moz-use-text-color -moz-use-text-color #171717; + box-shadow: -1px 2px 2px #171717, 0px 1px rgba(255, 255, 255, 0.08) inset; + margin: 0; +} +.nav-list .item.active a { + color: #D18114; +} +.nav-list .disable { + color: #aaa; + background: #fafafa; + text-align: center; +} +.nav-list .item > a { + padding: 0 10px; + color:#ccc; +} +.nav-list a:hover { + text-decoration: none; +} +.nav-list .item.empty a { + color: #f39c12; +} +.nav-list .item.active.empty a { + color: #fff; + background: linear-gradient(180deg, #E4992C 0%, #D18114 100%) #E4992C; + background: -webkit-linear-gradient(180deg, #E4992C 0%, #D18114 100%); +} +.nav-list .item.error a { + color: #BD362F; +} +.nav-list .item.active.error a { + color: #fff; + background: #BD362F; +} + +.nav-list .nav-header { + padding: 0 10px; + color: #222; + background: transparent; +} + +.nav-list .nav-form { + padding: 3px; + text-align: center; +} + +.nav-head { + margin: 0; + background: linear-gradient(0deg, #EDE7DE 0%, #FFF 100%) #EDE7DE; + background: -webkit-linear-gradient(bottom, #EDE7DE 0%, #FFF 100%); + text-align: right; +} +.nav-head .item { + padding: 5px 10px; + font-size: 0.9rem; + line-height: 1.5rem; +} + +/*=== Horizontal-list */ +.horizontal-list { + margin: 0; + padding: 0; +} +.horizontal-list .item { + vertical-align: middle; +} + +/*=== Dropdown */ +.dropdown-menu { + margin: 5px 0 0; + padding: 5px 0; + border: 1px solid #171717; + border-radius: 4px; + box-shadow: 0 0 3px #000; + font-size: 0.8rem; + text-align: left; + background: #222; +} +.dropdown-menu:after { + content: ""; + position: absolute; + top: -6px; + right: 13px; + width: 10px; + height: 10px; + background: #222; + border-top: 1px solid #171717; + border-left: 1px solid #171717; + z-index: -10; + transform: rotate(45deg); + -moz-transform: rotate(45deg); + -webkit-transform: rotate(45deg); + -ms-transform: rotate(45deg); +} +.dropdown-header { + display:none; +} +.dropdown-menu > .item { +} +.dropdown-menu > .item > a { + padding: 0 25px; + line-height: 2.5em; + color: #ccc; +} +.dropdown-menu > .item > span, +.dropdown-menu > .item > .as-link { + padding: 0 22px; + line-height: 2em; + color: #ccc; +} +.dropdown-menu > .item:hover { + background: #171717; + color: #fff; +} +.dropdown-menu > .item[aria-checked="true"] > a:before { + font-weight: bold; + margin: 0 0 0 -14px; +} +.dropdown-menu > .item:hover > a { + color: #fff; + text-decoration: none; +} +.dropdown-menu .input select, +.dropdown-menu .input input { + margin: 0 auto 5px; + padding: 2px 5px; + border-radius: 3px; +} + +.separator { + margin: 5px 0; + border-bottom: 1px solid #171717; + box-shadow: 0 1px rgba(255,255,255,0.08); +} + +/*=== Alerts */ +.alert { + margin: 15px auto; + padding: 10px 15px; + background: #f4f4f4; + border: 1px solid #ccc; + border-right: 1px solid #aaa; + border-bottom: 1px solid #aaa; + border-radius: 5px; + color: #aaa; + text-shadow: 0 0 1px #eee; + font-size: 0.9em; +} +.alert-head { + font-size: 1.15em; +} +.alert > a { + color: inherit; + text-decoration: underline; +} +.alert-warn { + background: #ffe; + border: 1px solid #eeb; + color: #c95; +} +.alert-success { + background: #dfd; + border: 1px solid #cec; + color: #484; +} +.alert-error { + background: #fdd; + border: 1px solid #ecc; + color: #844; +} + +/*=== Pagination */ +.pagination { + background: #fafafa; + text-align: center; + color: #333; + font-size: 0.8em; +} +.content .pagination { + margin: 0; + padding: 0; +} +.pagination .item.pager-current { + font-weight: bold; + font-size: 1.5em; +} +.pagination .item a { + display: block; + color: #333; + font-style: italic; + line-height: 3em; + text-decoration: none; +} +.pagination .item a:hover { + background: #ddd; +} +.pagination:first-child .item { + border-bottom: 1px solid #aaa; +} +.pagination:last-child .item { + border-top: 1px solid #ddd; +} + +.pagination .loading, +.pagination a:hover.loading { + background: url("loader.gif") center center no-repeat #fff; + font-size: 0; +} + +/*=== STRUCTURE */ +/*===============*/ +/*=== Header */ +.header { + height: 55px; + background: linear-gradient(0deg, #EDE7DE 0%, #FFF 100%) #EDE7DE; + background: -webkit-linear-gradient(bottom, #EDE7DE 0%, #FFF 100%); +} +.header > .item { + padding: 0; + vertical-align: middle; + text-align: center; +} +.header > .item.title .logo { + display: none; +} +.header > .item.title{ + width: 250px; +} +.header > .item.title h1 { + margin: 0.5em 0; +} +.header > .item.title h1 a { + text-decoration: none; + font-size: 38px; + color:#ccc; + text-shadow: 0 1px #fff, 0 -1px rgba(162, 162, 162, 1); +} +.header > .item.search input { + width: 230px; +} +.header .item.search input:focus { + width: 350px; +} + +/*=== Body */ +#global { + background:#EDE7DE; + height: calc(100% - 85px); +} +.aside { + border-radius: 0px 12px 0px 0px; + box-shadow: 0px -1px #FFF, 0 2px 2px #171717 inset; + border-top: 1px solid #CCC; + background: #222; + width: 235px; +} +.aside.aside_flux { + padding: 10px 0 50px; + background: #222; +} + +/*=== Aside main page (categories) */ +.categories { + text-align: center; +} +.categories .btn-important { + border: none; +} +.category { + width: 235px; + margin: 10px auto 0; + text-align: left; +} +#aside_flux ul.feeds{ + box-shadow: 0 4px 4px #171717 inset, 0 1px rgba(255,255,255,0.08),0 -1px rgba(255,255,255,0.08); +} +ul.feeds{ + background:#171717; + padding:8px 0; + box-shadow: 0 4px 4px #EDE7DE inset; +} +ul.feeds.active{ + box-shadow: 0 0 0 #171717 inset, 0 -2px 2px #111 inset,0 1px rgba(255,255,255,0.08),0 -1px rgba(255,255,255,0); +} +.category.stick.active{ + background: linear-gradient(180deg, #222 0%, #171717 100%) #171717; + background: -webkit-linear-gradient(top, #222 0%, #171717 100%); + box-shadow: 0px 1px #171717, 0px 1px rgba(255, 255, 255, 0.08) inset; +} +.category .btn { + color: #fff; + border: none; + background: transparent; +} +.category .btn:first-child { + position: relative; + width: 213px; + background: transparent; +} +.category.stick .btn:first-child { + width: 176px; +} +.category .btn:first-child:not([data-unread="0"]):after { + position: absolute; + top: 3px; right: 3px; + padding: 1px 5px; + background: transparent; + color: #fff; + text-shadow: 0 1px rgba(255,255,255,0.08); +} + +/*=== Aside main page (feeds) */ +.categories .feeds .item.active { + background: linear-gradient(180deg, #222 0%, #171717 100%) #171717; + background: -webkit-linear-gradient(top, #222 0%, #171717 100%); + border-radius: 4px; + margin: 0px 8px; + box-shadow: 0px 1px #171717, 0px 1px rgba(255, 255, 255, 0.08) inset, 0 2px 2px #111; +} +.categories .feeds .item.active .feed { + color: #fff; +} +.categories .feeds .item.empty .feed { + color: #e67e22; +} +.categories .feeds .item.empty.active { + background: #e67e22; +} +.categories .feeds .item.empty.active .feed { + color: #fff; +} +.categories .feeds .item.error .feed { + color: #BD362F; +} +.categories .feeds .item .feed { + margin: 0; + width: 165px; + line-height: 3em; + font-size: 0.8em; + text-align: left; + text-decoration: none; + color:#ccc; +} +.categories .feeds .feed:not([data-unread="0"]) { + font-weight: bold; +} +.categories .feeds .dropdown-menu:after { + left: 2px; +} +.categories .feeds .item .dropdown-target:target ~ .dropdown-toggle > .icon, +.categories .feeds .item:hover .dropdown-toggle > .icon, +.categories .feeds .item.active .dropdown-toggle > .icon { + background-color: transparent; + border-radius: 3px; + vertical-align: middle; +} + +/*=== Configuration pages */ +.post { + padding: 10px 50px; + font-size: 0.9em; +} +.post form { + margin: 10px 0; +} +.post.content { + max-width: 550px; +} + +/*=== Prompt (centered) */ +.prompt { + text-align: center; + color: #FFF; + background: #222; + padding: 14px 0px; + box-shadow: 0px -1px #FFF, 0px 1px #FFF, 0px 2px 2px #171717 inset, 0px -2px 2px #171717 inset; + text-shadow: 0 -1px #171717, 0 1px rgba(255,255,255,0.08); +} +.prompt label { + text-align: left; +} +.prompt form { + margin: 10px auto 20px auto; + width: 180px; +} +.prompt input { + margin: 5px auto; + width: 100%; +} +.prompt p { + margin: 20px 0; +} +.prompt input#username,.prompt input#passwordPlain{ + border:none; + box-shadow: 0px 1px rgba(255, 255, 255, 0.08) inset,0 -1px #171717,0px 1px rgba(255, 255, 255, 0.08); + background:#EDE7DE; +} +.prompt input#username:focus,.prompt input#passwordPlain:focus{ + border: solid 1px #E7AB34; + box-shadow: 0 0 3px #E7AB34; +} + +/*=== New article notification */ +#new-article { + background: #0084CC; + text-align: center; + font-size: 0.9em; +} +#new-article:hover { + background: #0066CC; +} +#new-article > a { + line-height: 3em; + color: #fff; + font-weight: bold; +} +#new-article > a:hover { + text-decoration: none; +} + +/*=== Day indication */ +.day { + padding: 0 10px; + font-style:italic; + line-height: 3em; + background: #fff; + text-align: center; +} +#new-article + .day { + border-top: none; +} +.day .name { + display: none; +} + +/*=== Index menu */ +.nav_menu { + background: #EDE7DE; + border-bottom: 1px solid #ccc; + box-shadow:0 -1px #fff inset; + text-align: center; + padding: 5px 0; +} + +/*=== Feed articles */ +.flux_content { + background: #FFF; + border-radius: 10px; +} +.flux { + background: #EDE7DE; +} +.flux:hover { + background: #F9F7F4; +} +.flux:not(.current):hover .item.title { + background: #F9F7F4; +} +.flux.current .flux .item.title a { + text-shadow:0 0 2px #ccc; +} +.flux.not_read:not(.current):hover .item.title { + opacity:0.85; +} +.flux.favorite { + background: #FFF6DA; +} +.flux.favorite:not(.current):hover{ + background: #F9F7F4; +} +.flux.favorite:not(.current):hover .item.title { + background: #F9F7F4; +} +.flux.current { + background: linear-gradient(0deg, #EDE7DE 0%, #FFF 100%) #EDE7DE; + background: -webkit-linear-gradient(bottom, #EDE7DE 0%, #FFF 100%); + box-shadow: 0 -1px #fff inset, 0 2px #ccc; + border-radius: 10px; + margin: 3px 6px; +} + +.flux .item.title { +opacity: 0.35; +} +.flux.favorite .item.title { +opacity: 1; +} +.flux.not_read .item.title { +opacity: 1; +} +.flux.current .item.title a { + color: #0f0f0f; +} +.flux .item.title a { + color: #333; +} + +.flux_header { + border-top: 1px solid #ddd; + font-size: 0.8rem; + cursor: pointer; +} +.flux_header .title { + font-size: 0.9rem; +} +.flux .website .favicon { + padding: 5px; +} +.flux .date { + color: #666; + font-size: 0.7rem; +} + +.flux .bottom { + font-size: 0.8rem; + text-align: center; +} + +/*=== Content of feed articles */ +.content { + padding: 20px 10px; +} +.content > h1.title > a { + color: #000; +} + +.content hr { + margin: 30px 10px; + height: 1px; + background: #ddd; + border: 0; + box-shadow: 0 2px 5px #ccc; +} + +.content pre { + margin: 10px auto; + padding: 10px 20px; + overflow: auto; + background: #222; + color: #fff; + font-size: 0.9rem; + border-radius: 3px; +} +.content code { + padding: 2px 5px; + color: #dd1144; + background: #fafafa; + border: 1px solid #eee; + border-radius: 3px; +} +.content pre code { + background: transparent; + color: #fff; + border: none; +} + +.content blockquote { + display: block; + margin: 0; + padding: 5px 20px; + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + background: #fafafa; + color: #333; +} +.content blockquote p { + margin: 0; +} + +/*=== Notification and actualize notification */ +.notification { + padding: 0 0 0 5px; + text-align: center; + background:#222; + border: none; + border-radius: 0 0 12px 12px; + box-shadow: 0px 0px 4px rgba(0,0,0,0.45), 0 -1px rgba(255,255,255,0.08) inset, 0 2px 2px #171717 inset; + color:#fff; + font-weight: bold; + font-size: 0.9em; + line-height: 3em; + position:absolute; + top:0; + z-index: 10; + vertical-align: middle; +} +.notification.good { + color: #c95; +} +.notification.bad { + background: #fdd; + color: #844; +} +.notification a.close { + padding: 0 15px; + line-height: 3em; +} +.notification#actualizeProgress { + line-height: 2em; +} + +/*=== "Load more" part */ +#bigMarkAsRead { + text-align: center; + text-decoration: none; + text-shadow: 0 -1px 0 #aaa; + color: #666; + background: #EDE7DE; +} +#bigMarkAsRead:hover { + color: #000; + background: #EDE7DE; + background: radial-gradient(circle at 50% -25% , #ccc 0%, #EDE7DE 50%); +} +#bigMarkAsRead:hover .bigTick { + text-shadow: 0 0 10px #666; +} + +/*=== Navigation menu (for articles) */ +#nav_entries { + background: linear-gradient(180deg, #222 0%, #171717 100%) #222; + background: -webkit-linear-gradient(top, #222 0%, #171717 100%); + border-top: 1px solid #171717; + text-align: center; + line-height: 3em; + table-layout: fixed; + box-shadow: 0 1px rgba(255,255,255,0.08) inset, 0 -2px 2px #171717; + width:235px; +} + +/*=== READER VIEW */ +/*================*/ +#stream.reader .flux { + padding: 0 0 50px; + border: none; + background: #f0f0f0; + color: #333; +} +#stream.reader .flux .author { + margin: 0 0 10px; + font-size: 90%; + color: #666; +} + +/*=== GLOBAL VIEW */ +/*================*/ +#stream.global{ + background:#222; + padding: 24px 0; + box-shadow: 0 1px #fff, 0 -2px 2px #171717 inset, 0 2px 2px #171717 inset; +} +#stream.global .box-category { + background: #fff; + border-radius: 4px 4px 0 0; + text-align: left; + box-shadow: 0 0 4px #171717; + overflow:hidden; +} +#stream.global .category { + margin: 0; +} +#stream.global .btn { + width: auto; + height: 2em; + margin: 0; + padding: 0 10px; + background: linear-gradient(0deg, #EDE7DE 0%, #fff 100%) #171717; + background: -webkit-linear-gradient(bottom, #EDE7DE 0%, #fff 100%); + border: none; + box-shadow: 0px -1px #fff inset,0 -2px #ccc inset; + border-radius: none; + line-height: 2em; + font-size: 1.2rem; + color:#888; + text-shadow:0 1px #ccc; +} +#stream.global .btn:not([data-unread="0"]) { + color: #222; + font-weight: bold; +} +#stream.global .btn:first-child:not([data-unread="0"]):after { + top: 0; + right: 5px; + border: 0; + background: none; + color: #222; + font-weight: bold; + box-shadow: none; + text-shadow: none; +} +#stream.global .box-category .feeds { + max-height: 250px; + color:#222; + background:#EDE7DE; +} +#stream.global .box-category .feeds .item { + padding: 2px 10px; + font-size: 0.9rem; + overflow:hidden; +} +#stream.global .box-category .feed { + color:#222; +} +/*=== PANEL */ +/*===========*/ +#panel { + box-shadow: 0px 0px 4px #000; + border-radius: 8px; +} +/*=== DIVERS */ +/*===========*/ +.aside.aside_feed .nav-form input,.aside.aside_feed .nav-form select { + width: 130px; +} +.aside.aside_feed .nav-form .dropdown .dropdown-menu { + right: -20px; +} +.aside.aside_feed .nav-form .dropdown .dropdown-menu:after { + right: 33px; +} + +/*=== STATISTICS */ +/*===============*/ +.stat { + margin: 10px 0 20px; +} + +.stat th, +.stat td, +.stat tr { + border: none; +} +.stat > table td, +.stat > table th { + border-bottom: 1px solid #ccc; + background: rgba(255,255,255,0.38); + box-shadow: 0 1px #fff; +} + +.stat > .horizontal-list { + margin: 0 0 5px; +} +.stat > .horizontal-list .item { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} +.stat > .horizontal-list .item:first-child { + width: 250px; +} + +/*=== LOGS */ +/*=========*/ +.logs { + border: 1px solid #aaa; + border-radius: 5px; + overflow: hidden; +} +.log { + padding: 5px 10px; + background: #fafafa; + color: #333; + font-size: 0.8rem; +} +.log+.log { + border-top: 1px solid #aaa; +} +.log .date { + display: block; + font-weight: bold; +} +.log.error { + background: #fdd; + color: #844; +} +.log.warning { + background: #ffe; + color: #c95; +} +.log.notice { + background: #f4f4f4; + color: #aaa; +} +.log.debug { + background: #333; + color: #eee; +} + +/*=== MOBILE */ +/*===========*/ +@media screen and (max-width: 840px) { + .header { + display: table; + } + .nav-login { + display: none; + } + + .aside { + width: 0; + border-top: none; + box-shadow: 3px 0 3px #000; + transition: width 200ms linear; + -moz-transition: width 200ms linear; + -webkit-transition: width 200ms linear; + -o-transition: width 200ms linear; + -ms-transition: width 200ms linear; + } + .aside:target { + width: 235px; + } + .aside .toggle_aside, + #panel .close { + position: absolute; + display: block; + top: 0; right: 0; + width: 30px; + height: 30px; + line-height: 30px; + text-align: center; + background: #171717; + box-shadow: 0 1px rgba(255,255,255,0.08); + border-radius: 0 8px 0 8px; + } + .aside .btn-important { + display: inline-block; + margin: 20px 0 0; + } + + .nav_menu .btn { + margin: 5px 10px; + } + .nav_menu .stick { + margin: 0 10px; + } + .nav_menu .stick .btn { + margin: 5px 0; + } + .nav_menu .search { + display: inline-block; + max-width: 97%; + } + .nav_menu .search input { + max-width: 97%; + width: 90px; + } + .nav_menu .search input:focus { + width: 400px; + } + + .day .name { + display: none; + } + + .pagination { + margin: 0 0 3.5em; + } + + .notification a.close { + display: block; + left: 0; + background: transparent; + } + .notification a.close:hover { + opacity: 0.5; + } + .notification a.close .icon { + display: none; + } + .nav_menu .search { + display: none; + } + + #nav_entries { + width: 100%; + } +} + +@media (max-width: 700px) { + .header{ + display: none; + } + .nav-login { + display: inline-block; + width: 100%; + } + .nav_menu .search { + display: inline-block; + } + .aside .btn-important { + display: none; + } +} diff --git a/p/themes/base-theme/README.md b/p/themes/base-theme/README.md new file mode 100644 index 000000000..6f186e15c --- /dev/null +++ b/p/themes/base-theme/README.md @@ -0,0 +1,12 @@ +FreshRSS-base-theme +=================== + +A base theme for [FreshRSS](http://freshrss.org) + +1. Custom ```base.css``` file with colors, backgrounds and borders +2. Change information in ```metadata.json``` file (at least, give a name!) +3. Choose your new theme in FreshRSS configuration +4. Enjoy your wonderful theme! + +Don't hesitate to share your theme with us [on Github](https://github.com/marienfressinaud/FreshRSS/issues) :) + diff --git a/p/themes/base-theme/base.css b/p/themes/base-theme/base.css new file mode 100644 index 000000000..ccfab10df --- /dev/null +++ b/p/themes/base-theme/base.css @@ -0,0 +1,777 @@ +@charset "UTF-8"; + +/*=== FONTS */ +@font-face { + font-family: "OpenSans"; + src: url("../fonts/openSans.woff") format("woff"); +} + +/*=== GENERAL */ +/*============*/ +html, body { + height: 100%; + font-family: "OpenSans", "Cantarell", "Helvetica", "Arial", sans-serif; +} + +/*=== Links */ +a, button.as-link { + outline: none; +} + +/*=== Forms */ +legend { + margin: 20px 0 5px; + padding: 5px 0; + font-size: 1.4em; +} +label { + min-height: 25px; + padding: 5px 0; + cursor: pointer; +} +textarea { + width: 360px; + height: 100px; +} +input, select, textarea { + min-height: 25px; + padding: 5px; + line-height: 25px; + vertical-align: middle; +} +option { + padding: 0 .5em; +} +input:focus, select:focus, textarea:focus { +} +input:invalid, select:invalid { +} +input:disabled, select:disabled { +} +input.extend { + transition: width 200ms linear; + -moz-transition: width 200ms linear; + -webkit-transition: width 200ms linear; + -o-transition: width 200ms linear; + -ms-transition: width 200ms linear; +} + +/*=== Tables */ +table { + border-collapse: collapse; +} + +tr, th, td { + padding: 0.5em; +} +th { +} +form td, +form th { + font-weight: normal; + text-align: center; +} + +/*=== COMPONENTS */ +/*===============*/ +/*=== Forms */ +.form-group.form-actions { + padding: 5px 0; +} +.form-group.form-actions .btn { + margin: 0 10px; +} +.form-group .group-name { + padding: 10px 0; + text-align: right; +} +.form-group .group-controls { + min-height: 25px; + padding: 5px 0; +} +.form-group table { + margin: 10px 0 0 220px; +} + +/*=== Buttons */ +.stick { + vertical-align: middle; + font-size: 0; +} +.stick input, +.stick .btn { +} +.stick .btn:first-child, +.stick input:first-child { +} +.stick .btn-important:first-child { +} +.stick .btn:last-child, +.stick input:last-child { +} +.stick .btn + .btn, +.stick .btn + input, +.stick .btn + .dropdown > .btn, +.stick input + .btn, +.stick input + input, +.stick input + .dropdown > .btn, +.stick .dropdown + .btn, +.stick .dropdown + input, +.stick .dropdown + .dropdown > .btn { +} +.stick input + .btn { +} +.stick .btn + .dropdown > .btn { +} + +.btn { + display: inline-block; + min-height: 37px; + min-width: 15px; + margin: 0; + padding: 5px 10px; + font-size: 0.9rem; + vertical-align: middle; + cursor: pointer; + overflow: hidden; +} +a.btn { + min-height: 25px; + line-height: 25px; +} +.btn:hover { + text-decoration: none; +} +.btn.active, +.btn:active, +.dropdown-target:target ~ .btn.dropdown-toggle { +} + +.btn-important { + font-weight: normal; +} +.btn-important:hover { +} +.btn-important:active { +} + +.btn-attention { +} +.btn-attention:hover { +} +.btn-attention:active { +} + +/*=== Navigation */ +.nav-list .nav-header, +.nav-list .item { + height: 2.5em; + line-height: 2.5em; + font-size: 0.9rem; +} +.nav-list .item:hover { +} +.nav-list .item:hover a { +} +.nav-list .item.active { +} +.nav-list .item.active a { +} +.nav-list .disable { + text-align: center; +} +.nav-list .item > a { + padding: 0 10px; +} +.nav-list a:hover { + text-decoration: none; +} +.nav-list .item.empty a { +} +.nav-list .item.active.empty a { +} +.nav-list .item.error a { +} +.nav-list .item.active.error a { +} + +.nav-list .nav-header { + padding: 0 10px; + font-weight: bold; +} + +.nav-list .nav-form { + padding: 3px; + text-align: center; +} + +.nav-head { + margin: 0; + text-align: right; +} +.nav-head .item { + padding: 5px 10px; + font-size: 0.9rem; + line-height: 1.5rem; +} + +/*=== Horizontal-list */ +.horizontal-list { + margin: 0; + padding: 0; +} +.horizontal-list .item { + vertical-align: middle; +} + +/*=== Dropdown */ +.dropdown-menu { + margin: 5px 0 0; + padding: 5px 0; + font-size: 0.8rem; + text-align: left; +} +.dropdown-menu:after { + content: ""; + position: absolute; + top: -6px; + right: 13px; + width: 10px; + height: 10px; + z-index: -10; + transform: rotate(45deg); + -moz-transform: rotate(45deg); + -webkit-transform: rotate(45deg); + -ms-transform: rotate(45deg); +} +.dropdown-header { + padding: 0 5px 5px; + font-weight: bold; + text-align: left; +} +.dropdown-menu > .item { +} +.dropdown-menu > .item > a { + padding: 0 25px; + line-height: 2.5em; +} +.dropdown-menu > .item > span, +.dropdown-menu > .item > .as-link { + padding: 0 22px; + line-height: 2em; +} +.dropdown-menu > .item:hover { +} +.dropdown-menu > .item[aria-checked="true"] > a:before { + font-weight: bold; + margin: 0 0 0 -14px; +} +.dropdown-menu > .item:hover > a { + text-decoration: none; +} +.dropdown-menu .input select, +.dropdown-menu .input input { + margin: 0 auto 5px; + padding: 2px 5px; +} + +.separator { + margin: 5px 0; +} + +/*=== Alerts */ +.alert { + margin: 15px auto; + padding: 10px 15px; + font-size: 0.9em; +} +.alert-head { + font-size: 1.15em; +} +.alert > a { + text-decoration: underline; +} +.alert-warn { +} +.alert-success { +} +.alert-error { +} + +/*=== Pagination */ +.pagination { + text-align: center; + font-size: 0.8em; +} +.content .pagination { + margin: 0; + padding: 0; +} +.pagination .item.pager-current { + font-weight: bold; + font-size: 1.5em; +} +.pagination .item a { + display: block; + font-style: italic; + line-height: 3em; + text-decoration: none; +} +.pagination .item a:hover { +} +.pagination:first-child .item { +} +.pagination:last-child .item { +} + +.pagination .loading, +.pagination a:hover.loading { + font-size: 0; +} + +/*=== STRUCTURE */ +/*===============*/ +/*=== Header */ +.header { + height: 85px; +} +.header > .item { + padding: 10px; + vertical-align: middle; + text-align: center; +} +.header > .item.title{ + width: 230px; +} +.header > .item.title h1 { + margin: 0.5em 0; +} +.header > .item.title h1 a { + text-decoration: none; +} +.header > .item.search input { + width: 230px; +} +.header .item.search input:focus { + width: 350px; +} + +/*=== Body */ +#global { + height: calc(100% - 85px); +} +.aside { +} +.aside.aside_flux { + padding: 10px 0 50px; +} + +/*=== Aside main page (categories) */ +.categories { + text-align: center; +} +.category { + width: 235px; + margin: 10px auto; + text-align: left; +} +.category .btn:first-child { + position: relative; + width: 213px; +} +.category.stick .btn:first-child { + width: 176px; +} +.category .btn:first-child:not([data-unread="0"]):after { + position: absolute; + top: 3px; right: 3px; + padding: 1px 5px; +} + +/*=== Aside main page (feeds) */ +.categories .feeds .item.active { +} +.categories .feeds .item.empty.active { +} +.categories .feeds .item.error.active { +} +.categories .feeds .item.empty .feed { +} +.categories .feeds .item.error .feed { +} +.categories .feeds .item.active .feed, +.categories .feeds .item.empty.active .feed, +.categories .feeds .item.error.active .feed { +} +.categories .feeds .item .feed { + margin: 0; + width: 165px; + line-height: 3em; + font-size: 0.8em; + text-align: left; + text-decoration: none; +} +.categories .feeds .feed:not([data-unread="0"]) { + font-weight: bold; +} +.categories .feeds .dropdown-menu:after { + left: 2px; +} +.categories .feeds .item .dropdown-target:target ~ .dropdown-toggle > .icon, +.categories .feeds .item:hover .dropdown-toggle > .icon, +.categories .feeds .item.active .dropdown-toggle > .icon { + vertical-align: middle; +} + +/*=== Configuration pages */ +.post { + padding: 10px 50px; + font-size: 0.9em; +} +.post form { + margin: 10px 0; +} +.post.content { + max-width: 550px; +} + +/*=== Prompt (centered) */ +.prompt { + text-align: center; +} +.prompt label { + text-align: left; +} +.prompt form { + margin: 10px auto 20px auto; + width: 180px; +} +.prompt input { + margin: 5px auto; + width: 100%; +} +.prompt p { + margin: 20px 0; +} + +/*=== New article notification */ +#new-article { + text-align: center; + font-size: 0.9em; +} +#new-article:hover { +} +#new-article > a { + line-height: 3em; + font-weight: bold; +} +#new-article > a:hover { + text-decoration: none; +} + +/*=== Day indication */ +.day { + padding: 0 10px; + font-weight: bold; + line-height: 3em; +} +#new-article + .day { +} +.day .name { + padding: 0 10px 0 0; + font-size: 1.8em; + opacity: 0.3; + font-style: italic; + text-align: right; +} + +/*=== Index menu */ +.nav_menu { + text-align: center; + padding: 5px 0; +} + +/*=== Feed articles */ +.flux { +} +.flux:hover { +} +.flux.current { +} +.flux.not_read { +} +.flux.not_read:not(.current):hover .item.title { +} +.flux.favorite { +} +.flux.favorite:not(.current):hover .item.title { +} +.flux.current { +} + + +.flux_header { + font-size: 0.8rem; + cursor: pointer; +} +.flux_header .title { + font-size: 0.9rem; +} +.flux .website .favicon { + padding: 5px; +} +.flux .date { + font-size: 0.7rem; +} +.flux:not(.current):hover .item.title { +} + +.flux .bottom { + font-size: 0.8rem; + text-align: center; +} + +/*=== Content of feed articles */ +.content { + padding: 20px 10px; +} +.content > h1.title > a { +} + +.content hr { + margin: 30px 10px; + height: 1px; +} + +.content pre { + margin: 10px auto; + padding: 10px 20px; + overflow: auto; + font-size: 0.9rem; +} +.content code { + padding: 2px 5px; +} +.content pre code { +} + +.content blockquote { + display: block; + margin: 0; + padding: 5px 20px; +} +.content blockquote p { + margin: 0; +} + +/*=== Notification and actualize notification */ +.notification { + padding: 0 0 0 5px; + text-align: center; + font-weight: bold; + font-size: 0.9em; + line-height: 3em; + z-index: 10; + vertical-align: middle; +} +.notification.good { +} +.notification.bad { +} +.notification a.close { + padding: 0 15px; + line-height: 3em; +} +.notification.good a.close:hover { +} +.notification.bad a.close:hover { +} + +.notification#actualizeProgress { + line-height: 2em; +} + +/*=== "Load more" part */ +#bigMarkAsRead { + text-align: center; + text-decoration: none; +} +#bigMarkAsRead:hover { +} +#bigMarkAsRead:hover .bigTick { +} + +/*=== Navigation menu (for articles) */ +#nav_entries { + margin: 0; + text-align: center; + line-height: 3em; + table-layout: fixed; +} + +/*=== READER VIEW */ +/*================*/ +#stream.reader .flux { + padding: 0 0 50px; +} +#stream.reader .flux .author { + margin: 0 0 10px; + font-size: 90%; +} + +/*=== GLOBAL VIEW */ +/*================*/ +#stream.global .box-category { + text-align: left; +} +#stream.global .category { + margin: 0; +} +#stream.global .btn { + width: auto; + height: 2em; + margin: 0; + padding: 0 10px; + line-height: 2em; + font-size: 1.2rem; +} +#stream.global .btn:not([data-unread="0"]) { + font-weight: bold; +} +#stream.global .btn:first-child:not([data-unread="0"]):after { + top: 0; right: 5px; + font-weight: bold; +} +#stream.global .box-category .feeds { + max-height: 250px; +} +#stream.global .box-category .feeds .item { + padding: 2px 10px; + font-size: 0.9rem; +} + +/*=== DIVERS */ +/*===========*/ +.aside.aside_feed .nav-form input, +.aside.aside_feed .nav-form select { + width: 140px; +} +.aside.aside_feed .nav-form .dropdown .dropdown-menu { + right: -20px; +} +.aside.aside_feed .nav-form .dropdown .dropdown-menu:after { + right: 33px; +} + +/*=== STATISTICS */ +/*===============*/ +.stat { + margin: 10px 0 20px; +} + +.stat th, +.stat td, +.stat tr { +} +.stat > table td, +.stat > table th { + text-align: center; +} + +.stat > .horizontal-list { + margin: 0 0 5px; +} +.stat > .horizontal-list .item { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} +.stat > .horizontal-list .item:first-child { + width: 250px; +} + +/*=== LOGS */ +/*=========*/ +.logs { + overflow: hidden; +} +.log { + padding: 5px 10px; + font-size: 0.8rem; +} +.log+.log { +} +.log .date { + display: block; + font-weight: bold; +} +.log.error { +} +.log.warning { +} +.log.notice { +} +.log.debug { +} + +/*=== MOBILE */ +/*===========*/ +@media(max-width: 840px) { + .aside { + transition: width 200ms linear; + -moz-transition: width 200ms linear; + -webkit-transition: width 200ms linear; + -o-transition: width 200ms linear; + -ms-transition: width 200ms linear; + } + .aside .toggle_aside, + #panel .close { + position: absolute; + display: block; + top: 0; right: 0; + width: 30px; + height: 30px; + line-height: 30px; + text-align: center; + } + + .nav_menu .btn { + margin: 5px 10px; + } + .nav_menu .stick { + margin: 0 10px; + } + .nav_menu .stick .btn { + margin: 5px 0; + } + .nav_menu .search { + display: inline-block; + max-width: 97%; + } + .nav_menu .search input { + max-width: 97%; + width: 90px; + } + .nav_menu .search input:focus { + width: 400px; + } + + .day .name { + font-size: 1.1rem; + } + + .pagination { + margin: 0 0 3.5em; + } + + .notification a.close { + display: block; + left: 0; + } + .notification a.close:hover { + opacity: 0.5; + } + .notification a.close .icon { + display: none; + } +} diff --git a/p/themes/base-theme/metadata.json b/p/themes/base-theme/metadata.json new file mode 100644 index 000000000..4d59365a8 --- /dev/null +++ b/p/themes/base-theme/metadata.json @@ -0,0 +1,7 @@ +{ + "name": "", + "author": "Your name", + "description": "A wonderful base theme", + "version": 0.1, + "files": ["template.css", "base.css"] +} diff --git a/p/themes/base-theme/template.css b/p/themes/base-theme/template.css new file mode 100644 index 000000000..dc011503d --- /dev/null +++ b/p/themes/base-theme/template.css @@ -0,0 +1,734 @@ +@charset "UTF-8"; + +/*=== GENERAL */ +/*============*/ +html, body { + margin: 0; + padding: 0; + font-size: 100%; +} + +/*=== Links */ +a { + text-decoration: none; +} +a:hover { + text-decoration: underline; +} + +/*=== Lists */ +ul, ol, dd { + margin: 0; + padding: 0; +} + +/*=== Titles */ +h1 { + margin: 0.6em 0 0.3em; + font-size: 1.5em; + line-height: 1.6em; +} +h2 { + margin: 0.5em 0 0.25em; + font-size: 1.3em; + line-height: 2em; +} +h3 { + margin: 0.5em 0 0.25em; + font-size: 1.1em; + line-height: 2em; +} + +/*=== Paragraphs */ +p { + margin: 1em 0 0.5em; + font-size: 1em; +} + +/*=== Images */ +img { + height: auto; + max-width: 100%; +} +img.favicon { + height: 16px; + width: 16px; + vertical-align: middle; +} + +/*=== Videos */ +iframe, embed, object, video { + max-width: 100%; +} + +/*=== Forms */ +legend { + display: block; + width: 100%; + clear: both; +} +label { + display: block; +} +input { + width: 180px; +} +textarea { + width: 300px; +} +input, select, textarea { + display: inline-block; + max-width: 100%; +} +input[type="radio"], +input[type="checkbox"] { + width: 15px !important; + min-height: 15px !important; +} +input.extend:focus { + width: 300px; +} +button.as-link, +button.as-link:hover, +button.as-link:active { + background: transparent; + border: none; + color: inherit; + cursor: pointer; + font-size: 1.1em; + text-align: left; +} + +/*=== Tables */ +table { + max-width: 100%; +} +th.numeric, +td.numeric { + text-align: center; +} + +/*=== COMPONENTS */ +/*===============*/ +/*=== Forms */ +.form-group:after { + content: ""; + display: block; + clear: both; +} +.form-group.form-actions { + min-width: 250px; +} +.form-group .group-name { + display: block; + float: left; + width: 200px; +} +.form-group .group-controls { + min-width: 250px; + margin: 0 0 0 220px; +} +.form-group .group-controls .control { + display: block; +} + +/*=== Buttons */ +.stick { + display: inline-block; + white-space: nowrap; +} +.btn, +a.btn { + display: inline-block; + cursor: pointer; + overflow: hidden; +} +.btn-important { + font-weight: bold; +} + +/*=== Navigation */ +.nav-list .nav-header, +.nav-list .item { + display: block; +} +.nav-list .item, +.nav-list .item > a { + display: block; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} +.nav-head { + display: block; +} +.nav-head .item { + display: inline-block; +} + +/*=== Horizontal-list */ +.horizontal-list { + display: table; + table-layout: fixed; + width: 100%; +} +.horizontal-list .item { + display: table-cell; +} + +/*=== Dropdown */ +.dropdown { + position: relative; + display: inline-block; +} +.dropdown-target { + display: none; +} +.dropdown-menu { + display: none; + min-width: 200px; + margin: 0; + position: absolute; + right: 0; + background: #fff; + border: 1px solid #aaa; +} +.dropdown-header { + display: block; +} +.dropdown-menu > .item { + display: block; +} +.dropdown-menu > .item > a, +.dropdown-menu > .item > .as-link, +.dropdown-menu > .item > span { + display: block; + min-width: 200px; +} +.dropdown-menu > .item[aria-checked="true"] > a:before { + content: '✓'; +} +.dropdown-menu .input { + display: block; +} +.dropdown-menu .input select, +.dropdown-menu .input input { + display: block; + max-width: 95%; +} +.dropdown-target:target ~ .dropdown-menu { + display: block; + z-index: 10; +} +.dropdown-close { + display: inline; +} +.dropdown-close a { + font-size: 0; + position: fixed; + top: 0; bottom: 0; + left: 0; right: 0; + display: block; + z-index: -10; +} +.separator { + display: block; + height: 0; + border-bottom: 1px solid #aaa; +} + +/*=== Alerts */ +.alert { + display: block; + width: 90%; +} +.group-controls .alert { + width: 100% +} +.alert-head { + margin: 0; + font-weight: bold; +} +.alert ul { + margin: 5px 20px; +} + +/*=== Icons */ +.icon { + display: inline-block; + width: 16px; + height: 16px; + vertical-align: middle; + line-height: 16px; +} + +/*=== Pagination */ +.pagination { + display: table; + width: 100%; + margin: 0; + padding: 0; + table-layout: fixed; +} +.pagination .item { + display: table-cell; +} +.pagination .pager-first, +.pagination .pager-previous, +.pagination .pager-next, +.pagination .pager-last { + width: 100px; +} + +/*=== STRUCTURE */ +/*===============*/ +/*=== Header */ +.header { + display: table; + width: 100%; + table-layout: fixed; +} +.header > .item { + display: table-cell; +} +.header > .item.title { + width: 250px; + white-space: nowrap; +} +.header > .item.title h1 { + display: inline-block; +} +.header > .item.title .logo { + display: inline-block; + height: 32px; + width: 32px; + vertical-align: middle; +} +.header > .item.configure { + width: 100px; +} + +/*=== Body */ +#global { + display: table; + width: 100%; + height: 100%; + table-layout: fixed; +} +.aside { + display: table-cell; + height: 100%; + width: 250px; + vertical-align: top; +} +.aside.aside_flux { + background: #fff; +} + +/*=== Aside main page (categories) */ +.categories { + list-style: none; + margin: 0; +} +.state_unread li:not(.active)[data-unread="0"] { + display: none; +} +.category { + display: block; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} +.category .btn:not([data-unread="0"]):after { + content: attr(data-unread); +} + +/*=== Aside main page (feeds) */ +.categories .feeds { + width: 100%; + list-style: none; +} +.categories .feeds:not(.active) { + display: none; +} +.categories .feeds .feed { + display: inline-block; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + vertical-align: middle; +} +.categories .feeds .feed:not([data-unread="0"]):before { + content: "(" attr(data-unread) ") "; +} +.categories .feeds .dropdown-menu { + left: 0; +} +.categories .feeds .item .dropdown-toggle > .icon { + visibility: hidden; + cursor: pointer; + vertical-align: top; +} +.categories .feeds .item .dropdown-target:target ~ .dropdown-toggle > .icon, +.categories .feeds .item:hover .dropdown-toggle > .icon, +.categories .feeds .item.active .dropdown-toggle > .icon { + visibility: visible; +} + +/*=== New article notification */ +#new-article { + display: none; +} +#new-article > a { + display: block; +} + +/*=== Day indication */ +.day .name { + position: absolute; + right: 0; + width: 50%; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +/*=== Feed article header and footer */ +.flux_header { + position: relative; +} +.flux .item { + line-height: 40px; + white-space: nowrap; +} +.flux .item.manage, +.flux .item.link { + width: 40px; + text-align: center; +} +.flux .item.website { + width: 200px; +} +.flux.not_read .item.title, +.flux.current .item.title { + font-weight: bold; +} +.flux:not(.current):hover .item.title { + position: absolute; + max-width: calc(100% - 320px); + background: #fff; +} +.flux .item.title a { + color: #000; + text-decoration: none; +} +.flux .item.date { + width: 145px; + text-align: right; +} +.flux .item > a { + display: block; +} +.flux .item > a { + display: block; + text-decoration: none; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +.flux .item.share > a { + display: list-item; + list-style-position: inside; + list-style-type: decimal; +} + +/*=== Feed article content */ +.hide_posts > .flux:not(.active) > .flux_content { + display: none; +} +.content { + min-height: 20em; + margin: auto; + line-height: 1.7em; + word-wrap: break-word; +} +.content.large { + max-width: 1000px; +} +.content.medium { + max-width: 800px; +} +.content.thin { + max-width: 550px; +} +.content ul, +.content ol, +.content dd { + margin: 0 0 0 15px; + padding: 0 0 5px 15px; +} +.content pre { + overflow: auto; +} +br { + line-height: 1em; +} +br + br + br { + display: none; +} + +/*=== Notification and actualize notification */ +.notification { + position: absolute; + top: 1em; + left: 25%; right: 25%; + z-index: 10; + background: #fff; + border: 1px solid #aaa; +} +.notification.closed { + display: none; +} +.notification a.close { + position: absolute; + top: 0; bottom: 0; + right: 0; + display: inline-block; +} + +#actualizeProgress { + position: fixed; +} +#actualizeProgress progress { + max-width: 100%; + vertical-align: middle; +} +#actualizeProgress .progress { + vertical-align: middle; +} + +/*=== Navigation menu (for articles) */ +#nav_entries { + position: fixed; + bottom: 0; left: 0; + display: table; + width: 250px; + background: #fff; + table-layout: fixed; +} +#nav_entries .item { + display: table-cell; + width: 30%; +} +#nav_entries a { + display: block; +} + +/*=== "Load more" part */ +#load_more { + min-height: 40px; +} +.loading { + background: url("loader.gif") center center no-repeat; + font-size: 0; +} +#bigMarkAsRead { + display: block; + width: 100%; + padding: 1em 0; + text-align: center; + font-size: 1.4em; +} +.bigTick { + font-size: 4em; +} + +/*=== Statistiques */ +.stat { + margin: 15px 0; +} +.stat.half { + display: inline-block; + width: 46%; + padding: 0 2%; +} +.stat > table { + width: 100%; +} + +/*=== GLOBAL VIEW */ +/*================*/ +/*=== Category boxes */ +#stream.global .box-category { + display: inline-block; + width: 19em; + max-width: 95%; + margin: 20px 10px; + border: 1px solid #ccc; + vertical-align: top; +} +#stream.global .category { + width: 100%; +} +#stream.global .btn { + display: block; +} +#stream.global .box-category .feeds { + display: block; + overflow: auto; +} +#stream.global .box-category .feed { + width: 19em; + max-width: 90%; +} + +/*=== Panel */ +#overlay { + display: none; + position: fixed; + top: 0; bottom: 0; + left: 0; right: 0; + background: rgba(0, 0, 0, 0.9); +} +#panel { + display: none; + position: fixed; + top: 1em; bottom: 1em; + left: 2em; right: 2em; + overflow: auto; + background: #fff; +} +#panel .close { + position: fixed; + top: 0; bottom: 0; + left: 0; right: 0; + display: block; +} +#panel .close img { + display: none; +} + +/*=== DIVERS */ +/*===========*/ +.nav-login, +.nav_menu .search, +.nav_menu .toggle_aside { + display: none; +} + +.aside .toggle_aside { + position: absolute; + right: 0; + display: none; + width: 30px; + height: 30px; + line-height: 30px; + text-align: center; +} + +/*=== MOBILE */ +/*===========*/ +@media(max-width: 840px) { + .header, + .aside .btn-important, + .aside .feeds .dropdown, + .flux_header .item.website span, + .item.date, .day .date, + .dropdown-menu > .no-mobile, + .no-mobile { + display: none; + } + .nav-login { + display: block; + } + .nav_menu .toggle_aside, + .aside .toggle_aside, + .nav_menu .search, + #panel .close img { + display: inline-block; + } + + .aside { + position: fixed; + top: 0; bottom: 0; + left: 0; + width: 0; + overflow: hidden; + z-index: 100; + } + .aside:target { + width: 90%; + overflow: auto; + } + .aside .categories { + margin: 10px 0 75px; + } + + .flux_header .item.website { + width: 40px; + } + + .flux:not(.current):hover .item.title { + position: relative; + width: auto; + white-space: nowrap; + } + + .notification { + top: 0; + left: 0; + right: 0; + } + + #nav_entries { + width: 100%; + } + + #stream.global .box-category { + margin: 10px 0; + } + + #panel { + top: 0; bottom: 0; + left: 0; right: 0; + } + #panel .close { + top: 0; right: 0; + left: auto; bottom: auto; + display: inline-block; + width: 30px; + height: 30px; + } +} + +/*=== PRINTER */ +/*============*/ +@media print { + .header, .aside, + .nav_menu, .day, + .flux_header, + .flux_content .bottom, + .pagination, + #nav_entries { + display: none; + } + html, body { + background: #fff; + color: #000; + font-family: Serif; + } + #global, + .flux_content { + display: block !important; + } + .flux_content .content { + width: 100% !important; + } + .flux_content .content a { + color: #000; + } + .flux_content .content a:after { + content: " [" attr(href) "] "; + font-style: italic; + } +} 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 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:svg='http://www.w3.org/2000/svg' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' id='svg7384' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' version='1.1' inkscape:version='0.47 r22583' height='16' sodipodi:docname='list-add-symbolic.svg' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns='http://www.w3.org/2000/svg' width='16'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:object-paths='true' inkscape:cy='17.83946' inkscape:current-layer='layer12' inkscape:window-width='1920' pagecolor='#555753' showborder='false' showguides='true' inkscape:snap-nodes='false' objecttolerance='10' showgrid='true' inkscape:object-nodes='true' inkscape:pageshadow='2' inkscape:guide-bbox='true' inkscape:window-x='0' inkscape:snap-bbox='true' bordercolor='#666666' id='namedview88' inkscape:window-maximized='1' inkscape:snap-global='true' inkscape:window-y='26' gridtolerance='10' inkscape:zoom='1' inkscape:window-height='1021' borderopacity='1' guidetolerance='10' inkscape:snap-bbox-midpoints='false' inkscape:cx='-2.56708' inkscape:bbox-paths='false' inkscape:snap-grids='true' inkscape:pageopacity='1' inkscape:snap-to-guides='true'> - <inkscape:grid visible='true' spacingx='1px' type='xygrid' spacingy='1px' id='grid4866' empspacing='2' enabled='true' snapvisiblegridlinesonly='true'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g transform='translate(-60.0002,-726)' inkscape:groupmode='layer' id='layer9' inkscape:label='status' style='display:inline'/> - <g transform='translate(-60.0002,-726)' inkscape:groupmode='layer' id='layer10' inkscape:label='devices'/> - <g transform='translate(-60.0002,-726)' inkscape:groupmode='layer' id='layer11' inkscape:label='apps'/> - <g transform='translate(-60.0002,-726)' inkscape:groupmode='layer' id='layer12' inkscape:label='actions'> - - <path d='m 67.0002,729 0,4 -4,0 0,2 4,0 0,4 2,0 0,-4 4,0 0,-2 -4,0 0,-4 -2,0 z' id='rect31992' style='color:#666666;fill:#666666;fill-opacity:1;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible'/> - </g> - <g transform='translate(-60.0002,-726)' inkscape:groupmode='layer' id='layer13' inkscape:label='places'/> - <g transform='translate(-60.0002,-726)' inkscape:groupmode='layer' id='layer14' inkscape:label='mimetypes'/> - <g transform='translate(-60.0002,-726)' inkscape:groupmode='layer' id='layer15' inkscape:label='emblems' style='display:inline'/> - <g transform='translate(-60.0002,-726)' inkscape:groupmode='layer' id='g4953' inkscape:label='categories' style='display:inline'/> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-60.0002,-726)"> +<path style="color:#666666;" fill="#666" d="m67,729,0,4-4,0,0,2,4,0,0,4,2,0,0-4,4,0,0-2-4,0,0-4-2,0z"/> +</g> +</svg>
\ 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 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:svg='http://www.w3.org/2000/svg' id='svg7384' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' sodipodi:docname='view-list-symbolic.svg' version='1.1' inkscape:version='0.48.1 r9760' height='16' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns='http://www.w3.org/2000/svg' width='16'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:cy='71.95215' pagecolor='#555753' borderopacity='1' showborder='false' inkscape:bbox-paths='false' guidetolerance='10' inkscape:object-paths='true' inkscape:window-width='1198' showguides='true' inkscape:object-nodes='true' inkscape:snap-bbox='true' inkscape:pageshadow='2' inkscape:guide-bbox='true' inkscape:snap-nodes='false' bordercolor='#666666' objecttolerance='10' id='namedview88' showgrid='false' inkscape:window-maximized='0' inkscape:window-x='1582' inkscape:snap-global='true' inkscape:window-y='85' gridtolerance='10' inkscape:window-height='1079' inkscape:snap-to-guides='true' inkscape:current-layer='layer12' inkscape:snap-bbox-midpoints='false' inkscape:zoom='1' inkscape:cx='244.57499' inkscape:snap-grids='true' inkscape:pageopacity='1'> - <inkscape:grid spacingx='1px' spacingy='1px' id='grid4866' empspacing='2' enabled='true' type='xygrid' snapvisiblegridlinesonly='true' visible='true'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g inkscape:label='status' transform='translate(-40.0002,-746)' inkscape:groupmode='layer' id='layer9' style='display:inline'/> - <g inkscape:label='devices' transform='translate(-40.0002,-746)' inkscape:groupmode='layer' id='layer10'/> - <g inkscape:label='apps' transform='translate(-40.0002,-746)' inkscape:groupmode='layer' id='layer11'/> - <g inkscape:label='actions' transform='translate(-40.0002,-746)' inkscape:groupmode='layer' id='layer12'> - - <rect inkscape:label='a' x='43.000397' y='748.99976' id='rect7356' height='2.0002136' width='9.9996014' style='color:#bebebe;fill:#bebebe;fill-opacity:1;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible'/> - <rect inkscape:label='a' x='43.000397' y='752.99976' id='rect7358' height='2.0002136' width='9.9996014' style='color:#bebebe;fill:#bebebe;fill-opacity:1;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible'/> - <rect inkscape:label='a' x='43.000397' y='756.99976' id='rect7360' height='2.0002136' width='9.9996014' style='color:#bebebe;fill:#bebebe;fill-opacity:1;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible'/> - </g> - <g inkscape:label='places' transform='translate(-40.0002,-746)' inkscape:groupmode='layer' id='layer13'/> - <g inkscape:label='mimetypes' transform='translate(-40.0002,-746)' inkscape:groupmode='layer' id='layer14'/> - <g inkscape:label='emblems' transform='translate(-40.0002,-746)' inkscape:groupmode='layer' id='layer15' style='display:inline'/> - <g inkscape:label='categories' transform='translate(-40.0002,-746)' inkscape:groupmode='layer' id='g4953' style='display:inline'/> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-40.0002,-746)" fill="#bebebe"> +<rect style="color:#bebebe;" height="2.0002" width="9.9996" y="749" x="43"/> +<rect style="color:#bebebe;" height="2.0002" width="9.9996" y="753" x="43"/> +<rect style="color:#bebebe;" height="2.0002" width="9.9996" y="757" x="43"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/icons/apple-touch-icon.png b/p/themes/icons/apple-touch-icon.png Binary files differnew file mode 100644 index 000000000..0bbab07ea --- /dev/null +++ b/p/themes/icons/apple-touch-icon.png diff --git a/p/themes/icons/bookmark-add.svg b/p/themes/icons/bookmark-add.svg new file mode 100644 index 000000000..51db9c498 --- /dev/null +++ b/p/themes/icons/bookmark-add.svg @@ -0,0 +1,6 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-141.0002,-807)" fill="#bebebe"> +<path d="m143,807,0,13,4-4,4,4,0-4,0-1-2,0,0-4,2,0,0-4z"/> +<path d="m152,810,0,2-2,0,0,2,2,0,0,2,2,0,0-2,2,0,0-2-2,0,0-2-2,0z"/> +</g> +</svg>
\ 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 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:svg='http://www.w3.org/2000/svg' id='svg7384' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' sodipodi:docname='starred-symbolic.svg' version='1.1' inkscape:version='0.48.1 r9760' height='16' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns='http://www.w3.org/2000/svg' width='16'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:cy='0.50817' pagecolor='#555753' borderopacity='1' showborder='false' inkscape:bbox-paths='false' guidetolerance='10' inkscape:object-paths='true' inkscape:window-width='1457' showguides='true' inkscape:object-nodes='true' inkscape:snap-bbox='true' inkscape:pageshadow='2' inkscape:guide-bbox='true' inkscape:snap-nodes='false' bordercolor='#666666' objecttolerance='10' id='namedview88' showgrid='false' inkscape:window-maximized='0' inkscape:window-x='86' inkscape:snap-global='true' inkscape:window-y='51' gridtolerance='10' inkscape:window-height='1093' inkscape:snap-to-guides='true' inkscape:current-layer='layer9' inkscape:snap-bbox-midpoints='false' inkscape:zoom='1' inkscape:cx='19.029058' inkscape:snap-grids='true' inkscape:pageopacity='1'> - <inkscape:grid spacingx='1px' spacingy='1px' id='grid4866' empspacing='2' enabled='true' type='xygrid' snapvisiblegridlinesonly='true' visible='true'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g inkscape:label='status' transform='translate(-41.000202,-397)' inkscape:groupmode='layer' id='layer9' style='display:inline'> - <g inkscape:label='folder-remote' transform='translate(-186.9996,-599)' id='g11910-1'> - - </g> - <path sodipodi:cy='180.96373' sodipodi:r2='3.8276224' transform='matrix(1.0472113,-0.00871584,0.00871584,1.0472113,-504.35434,220.15425)' inkscape:rounded='0.2104596' inkscape:flatsided='false' inkscape:transform-center-x='-0.0094346789' inkscape:transform-center-y='-0.69491065' d='m 530.9488,186.70897 c -0.77941,0.55189 -3.15759,-1.90601 -4.11253,-1.9179 -0.95532,-0.0119 -3.39494,2.38585 -4.16096,1.8149 -0.76573,-0.57072 0.83698,-3.59203 0.55319,-4.50391 -0.2839,-0.91223 -3.31818,-2.49151 -3.01189,-3.39647 0.30617,-0.90461 3.67487,-0.31399 4.45442,-0.86567 0.77986,-0.5519 1.3442,-3.92569 2.29952,-3.91404 0.95494,0.0116 1.43421,3.39798 2.19979,3.9689 0.76588,0.57114 4.14893,0.0653 4.43307,0.97746 0.28402,0.9118 -2.78848,2.41405 -3.09488,3.31858 -0.30652,0.90489 1.21999,3.96605 0.44027,4.51815 z' id='path11922-0' sodipodi:type='star' sodipodi:arg1='0.95492637' sodipodi:r1='7.0383992' style='color:#000000;fill:#f1c40f;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate' sodipodi:arg2='1.5829876' inkscape:randomized='0' sodipodi:cx='526.88293' sodipodi:sides='5'/> - </g> - <g inkscape:label='devices' transform='translate(-41.000202,-397)' inkscape:groupmode='layer' id='layer10'/> - <g inkscape:label='apps' transform='translate(-41.000202,-397)' inkscape:groupmode='layer' id='layer11'/> - <g inkscape:label='actions' transform='translate(-41.000202,-397)' inkscape:groupmode='layer' id='layer12'/> - <g inkscape:label='places' transform='translate(-41.000202,-397)' inkscape:groupmode='layer' id='layer13'/> - <g inkscape:label='mimetypes' transform='translate(-41.000202,-397)' inkscape:groupmode='layer' id='layer14'/> - <g inkscape:label='emblems' transform='translate(-41.000202,-397)' inkscape:groupmode='layer' id='layer15' style='display:inline'/> - <g inkscape:label='categories' transform='translate(-41.000202,-397)' inkscape:groupmode='layer' id='g4953' style='display:inline'/> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-41.000202,-397)"> +<path style="enable-background:accumulate;color:#000000;" d="m530.95,186.71c-0.77941,0.55189-3.1576-1.906-4.1125-1.9179-0.95532-0.0119-3.3949,2.3858-4.161,1.8149-0.76573-0.57072,0.83698-3.592,0.55319-4.5039-0.2839-0.91223-3.3182-2.4915-3.0119-3.3965,0.30617-0.90461,3.6749-0.31399,4.4544-0.86567,0.77986-0.5519,1.3442-3.9257,2.2995-3.914,0.95494,0.0116,1.4342,3.398,2.1998,3.9689,0.76588,0.57114,4.1489,0.0653,4.4331,0.97746,0.28402,0.9118-2.7885,2.414-3.0949,3.3186-0.30652,0.90489,1.22,3.966,0.44027,4.5182z" fill-rule="nonzero" transform="matrix(1.0472113,-0.00871584,0.00871584,1.0472113,-504.35434,220.15425)" fill="#f1c40f"/> +</g> +</svg>
\ 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 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:svg='http://www.w3.org/2000/svg' id='svg7384' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' sodipodi:docname='folder-symbolic.svg' version='1.1' inkscape:version='0.48.0 r9654' height='16' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns='http://www.w3.org/2000/svg' width='16'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:cy='-173.07332' pagecolor='#555753' borderopacity='1' showborder='false' inkscape:bbox-paths='false' guidetolerance='10' inkscape:window-width='1310' showguides='true' inkscape:object-nodes='true' inkscape:snap-bbox='true' inkscape:pageshadow='2' inkscape:guide-bbox='true' inkscape:snap-nodes='true' bordercolor='#FFFFFF' objecttolerance='10' id='namedview88' showgrid='false' inkscape:window-maximized='0' inkscape:window-x='52' inkscape:snap-global='true' inkscape:window-y='24' gridtolerance='10' inkscape:window-height='690' inkscape:snap-to-guides='true' inkscape:current-layer='layer13' inkscape:zoom='1' inkscape:cx='-157.67647' inkscape:snap-grids='true' inkscape:pageopacity='1'> - <inkscape:grid spacingx='1px' spacingy='1px' id='grid4866' empspacing='2' enabled='true' type='xygrid' snapvisiblegridlinesonly='true' visible='true'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g inkscape:label='status' transform='translate(-442,-176)' inkscape:groupmode='layer' id='layer9' style='display:inline'/> - <g inkscape:label='devices' transform='translate(-442,-176)' inkscape:groupmode='layer' id='layer10'/> - <g inkscape:label='apps' transform='translate(-442,-176)' inkscape:groupmode='layer' id='layer11'/> - <g inkscape:label='actions' transform='translate(-442,-176)' inkscape:groupmode='layer' id='layer12'/> - <g inkscape:label='places' transform='translate(-442,-176)' inkscape:groupmode='layer' id='layer13'> - <g transform='translate(234.0002,-820)' id='g14154'> - <path inkscape:connector-curvature='0' d='m 208.53105,997 c -0.28913,0 -0.53125,0.24212 -0.53125,0.53125 l 0,13.93755 c 0,0.2985 0.23264,0.5312 0.53125,0.5312 l 14.9375,0 c 0.2986,0 0.53125,-0.2326 0.53125,-0.5312 l 0,-8.9376 c 0,-0.2891 -0.24212,-0.5312 -0.53125,-0.5312 l -12.46875,0 0,7.5 c 0,0.277 -0.223,0.5 -0.5,0.5 -0.277,0 -0.5,-0.223 -0.5,-0.5 l 0,-8 c 0,-0.277 0.223,-0.5 0.5,-0.5 l 2.96875,0 8.53125,0 0,-1.4062 c 0,-0.3272 -0.26666,-0.5938 -0.59375,-0.5938 l -7.40625,0 0,-1.46875 C 213.9998,997.2421 213.75768,997 213.46855,997 z' id='rect3845' sodipodi:nodetypes='ccccccccccsccccccccccc' style='fill:#FFFFFF;fill-opacity:1;stroke:none;display:inline'/> - - </g> - </g> - <g inkscape:label='mimetypes' transform='translate(-442,-176)' inkscape:groupmode='layer' id='layer14'/> - <g inkscape:label='emblems' transform='translate(-442,-176)' inkscape:groupmode='layer' id='layer15' style='display:inline'/> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-442,-176)"> +<g transform="translate(234.0002,-820)"> +<path d="m208.53,997c-0.28913,0-0.53125,0.24212-0.53125,0.53125v13.938c0,0.2985,0.23264,0.5312,0.53125,0.5312h14.938c0.2986,0,0.53125-0.2326,0.53125-0.5312v-8.9376c0-0.2891-0.24212-0.5312-0.53125-0.5312h-12.469v7.5c0,0.277-0.223,0.5-0.5,0.5s-0.5-0.223-0.5-0.5v-8c0-0.277,0.223-0.5,0.5-0.5h2.9688,8.5312v-1.4062c0-0.3272-0.26666-0.5938-0.59375-0.5938h-7.4062v-1.4688c0-0.39-0.24-0.63-0.53-0.63z" fill="#FFF"/> +</g> +</g> +</svg>
\ 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 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:svg='http://www.w3.org/2000/svg' id='svg7384' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' sodipodi:docname='folder-symbolic.svg' version='1.1' inkscape:version='0.48.0 r9654' height='16' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns='http://www.w3.org/2000/svg' width='16'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:cy='-173.07332' pagecolor='#555753' borderopacity='1' showborder='false' inkscape:bbox-paths='false' guidetolerance='10' inkscape:window-width='1310' showguides='true' inkscape:object-nodes='true' inkscape:snap-bbox='true' inkscape:pageshadow='2' inkscape:guide-bbox='true' inkscape:snap-nodes='true' bordercolor='#666666' objecttolerance='10' id='namedview88' showgrid='false' inkscape:window-maximized='0' inkscape:window-x='52' inkscape:snap-global='true' inkscape:window-y='24' gridtolerance='10' inkscape:window-height='690' inkscape:snap-to-guides='true' inkscape:current-layer='layer13' inkscape:zoom='1' inkscape:cx='-157.67647' inkscape:snap-grids='true' inkscape:pageopacity='1'> - <inkscape:grid spacingx='1px' spacingy='1px' id='grid4866' empspacing='2' enabled='true' type='xygrid' snapvisiblegridlinesonly='true' visible='true'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g inkscape:label='status' transform='translate(-442,-176)' inkscape:groupmode='layer' id='layer9' style='display:inline'/> - <g inkscape:label='devices' transform='translate(-442,-176)' inkscape:groupmode='layer' id='layer10'/> - <g inkscape:label='apps' transform='translate(-442,-176)' inkscape:groupmode='layer' id='layer11'/> - <g inkscape:label='actions' transform='translate(-442,-176)' inkscape:groupmode='layer' id='layer12'/> - <g inkscape:label='places' transform='translate(-442,-176)' inkscape:groupmode='layer' id='layer13'> - <g transform='translate(234.0002,-820)' id='g14154'> - <path inkscape:connector-curvature='0' d='m 208.53105,997 c -0.28913,0 -0.53125,0.24212 -0.53125,0.53125 l 0,13.93755 c 0,0.2985 0.23264,0.5312 0.53125,0.5312 l 14.9375,0 c 0.2986,0 0.53125,-0.2326 0.53125,-0.5312 l 0,-8.9376 c 0,-0.2891 -0.24212,-0.5312 -0.53125,-0.5312 l -12.46875,0 0,7.5 c 0,0.277 -0.223,0.5 -0.5,0.5 -0.277,0 -0.5,-0.223 -0.5,-0.5 l 0,-8 c 0,-0.277 0.223,-0.5 0.5,-0.5 l 2.96875,0 8.53125,0 0,-1.4062 c 0,-0.3272 -0.26666,-0.5938 -0.59375,-0.5938 l -7.40625,0 0,-1.46875 C 213.9998,997.2421 213.75768,997 213.46855,997 z' id='rect3845' sodipodi:nodetypes='ccccccccccsccccccccccc' style='fill:#666666;fill-opacity:1;stroke:none;display:inline'/> - - </g> - </g> - <g inkscape:label='mimetypes' transform='translate(-442,-176)' inkscape:groupmode='layer' id='layer14'/> - <g inkscape:label='emblems' transform='translate(-442,-176)' inkscape:groupmode='layer' id='layer15' style='display:inline'/> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-442,-176)"> +<g transform="translate(234.0002,-820)"> +<path d="m208.53,997c-0.28913,0-0.53125,0.24212-0.53125,0.53125v13.938c0,0.2985,0.23264,0.5312,0.53125,0.5312h14.938c0.2986,0,0.53125-0.2326,0.53125-0.5312v-8.9376c0-0.2891-0.24212-0.5312-0.53125-0.5312h-12.469v7.5c0,0.277-0.223,0.5-0.5,0.5s-0.5-0.223-0.5-0.5v-8c0-0.277,0.223-0.5,0.5-0.5h2.9688,8.5312v-1.4062c0-0.3272-0.26666-0.5938-0.59375-0.5938h-7.4062v-1.4688c0-0.39-0.24-0.63-0.53-0.63z" fill="#666"/> +</g> +</g> +</svg>
\ 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 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:svg='http://www.w3.org/2000/svg' id='svg7384' version='1.1' height='16' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns='http://www.w3.org/2000/svg' width='16'> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <defs id='defs7386'/> - <g transform='translate(-60,-518)' id='layer9' style='display:inline'/> - <g transform='translate(-60,-518)' id='layer10'/> - <g transform='translate(-60,-518)' id='layer11'/> - <g transform='translate(-60,-518)' id='layer12'> - <g transform='translate(19,-242)' id='layer4-4-1' style='display:inline'> - - <path inkscape:connector-curvature='0' d='m 45,764 1,0 c 0.01037,-1.2e-4 0.02079,-4.6e-4 0.03125,0 0.254951,0.0112 0.50987,0.12858 0.6875,0.3125 L 49,766.59375 51.3125,764.3125 C 51.578125,764.082 51.759172,764.007 52,764 l 1,0 0,1 c 0,0.28647 -0.03434,0.55065 -0.25,0.75 l -2.28125,2.28125 2.25,2.25 C 52.906938,770.46942 52.999992,770.7347 53,771 l 0,1 -1,0 c -0.265301,-10e-6 -0.530586,-0.0931 -0.71875,-0.28125 L 49,769.4375 46.71875,771.71875 C 46.530586,771.90694 46.26529,772 46,772 l -1,0 0,-1 c -3e-6,-0.26529 0.09306,-0.53058 0.28125,-0.71875 l 2.28125,-2.25 L 45.28125,765.75 C 45.070508,765.55537 44.97809,765.28075 45,765 l 0,-1 z' id='path10839-9' style='font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;color:#bebebe;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.78124988;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new;font-family:Andale Mono;-inkscape-font-specification:Andale Mono'/> - </g> - </g> - <g transform='translate(-60,-518)' id='layer13'/> - <g transform='translate(-60,-518)' id='layer14'/> - <g transform='translate(-60,-518)' id='layer15'/> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-60,-518)"> +<g transform="translate(19,-242)"> +<path style="block-progression:tb;color:#bebebe;direction:ltr;text-indent:0;text-align:start;enable-background:new;text-transform:none;" d="m45,764,1,0c0.01037-0.00012,0.02079-0.00046,0.03125,0,0.25495,0.0112,0.50987,0.12858,0.6875,0.3125l2.282,2.28,2.312-2.28c0.266-0.23,0.447-0.3,0.688-0.31h1v1c0,0.28647-0.03434,0.55065-0.25,0.75l-2.2812,2.2812,2.25,2.25c0.188,0.19,0.281,0.45,0.281,0.72v1h-1c-0.2653-0.00001-0.53059-0.0931-0.71875-0.28125l-2.281-2.28-2.281,2.28c-0.188,0.19-0.454,0.28-0.719,0.28h-1v-1c-0.000003-0.26529,0.09306-0.53058,0.28125-0.71875l2.2812-2.25-2.281-2.28c-0.21-0.19-0.303-0.47-0.281-0.75v-1z" fill-rule="nonzero" fill="#bebebe"/> +</g> +</g> +</svg>
\ 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 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns='http://www.w3.org/2000/svg' id='svg7384' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:cc='http://creativecommons.org/ns#' xmlns:svg='http://www.w3.org/2000/svg' width='16' sodipodi:docname='emblem-system-symbolic.svg' height='16' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' version='1.1' inkscape:version='0.48.1 r9760'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:window-height='967' inkscape:snap-bbox-midpoints='false' inkscape:snap-grids='true' inkscape:object-paths='false' pagecolor='#555753' inkscape:zoom='1' inkscape:current-layer='layer15' borderopacity='1' inkscape:snap-others='false' inkscape:window-x='2259' inkscape:window-y='356' inkscape:snap-to-guides='true' gridtolerance='10' id='namedview88' inkscape:snap-global='true' inkscape:cx='9.30971' inkscape:cy='-0.23089111' bordercolor='#666666' inkscape:window-width='1226' inkscape:snap-bbox='true' guidetolerance='10' showguides='true' showborder='false' inkscape:guide-bbox='true' inkscape:object-nodes='false' inkscape:pageopacity='1' inkscape:window-maximized='0' objecttolerance='10' showgrid='false' inkscape:snap-nodes='true' inkscape:bbox-paths='false' inkscape:pageshadow='2'> - <inkscape:grid visible='true' spacingx='1px' spacingy='1px' id='grid4866' type='xygrid' empspacing='2' enabled='true' snapvisiblegridlinesonly='true'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g inkscape:label='status' id='layer9' style='display:inline' transform='translate(-441.0002,-400.99999)' inkscape:groupmode='layer'/> - <g inkscape:label='devices' id='layer10' transform='translate(-441.0002,-400.99999)' inkscape:groupmode='layer'/> - <g inkscape:label='apps' id='layer11' transform='translate(-441.0002,-400.99999)' inkscape:groupmode='layer'/> - <g inkscape:label='places' id='layer13' transform='translate(-441.0002,-400.99999)' inkscape:groupmode='layer'/> - <g inkscape:label='mimetypes' id='layer14' transform='translate(-441.0002,-400.99999)' inkscape:groupmode='layer'/> - <g inkscape:label='emblems' id='layer15' style='display:inline' transform='translate(-441.0002,-400.99999)' inkscape:groupmode='layer'> - - <path id='path35543-6-4' d='m 449.0004,402.00002 c -0.22065,0 -0.44081,0.0113 -0.65625,0.0312 l -0.40625,2.09375 c -0.33446,0.0733 -0.66305,0.17589 -0.96875,0.3125 l -1.53125,-1.46875 c -0.38863,0.23011 -0.72695,0.51408 -1.0625,0.8125 l 0.90625,1.90625 c -0.22242,0.24899 -0.42425,0.5225 -0.59375,0.8125 l -2.09375,-0.28125 c -0.17772,0.40877 -0.30872,0.83637 -0.40625,1.28125 l 1.84375,1 c -0.0171,0.16809 -0.0312,0.3274 -0.0312,0.5 0,0.1726 0.0142,0.33191 0.0312,0.5 l -1.84375,1 c 0.0975,0.44488 0.22853,0.87248 0.40625,1.28125 l 2.09375,-0.28125 c 0.1695,0.29 0.37133,0.56351 0.59375,0.8125 l -0.90625,1.90625 c 0.33555,0.29842 0.67387,0.58239 1.0625,0.8125 l 1.53125,-1.46875 c 0.3057,0.13661 0.63429,0.23916 0.96875,0.3125 l 0.40625,2.09375 c 0.21544,0.02 0.4356,0.0312 0.65625,0.0312 0.22065,0 0.44081,-0.0113 0.65625,-0.0312 l 0.40625,-2.09375 c 0.33446,-0.0733 0.66305,-0.17589 0.96875,-0.3125 l 1.53125,1.46875 c 0.38863,-0.23011 0.72695,-0.51408 1.0625,-0.8125 l -0.90625,-1.90625 c 0.22242,-0.24899 0.42425,-0.5225 0.59375,-0.8125 l 2.09375,0.28125 c 0.17772,-0.40877 0.30872,-0.83637 0.40625,-1.28125 l -1.84375,-1 c 0.0171,-0.16809 0.0312,-0.3274 0.0312,-0.5 0,-0.1726 -0.0142,-0.33191 -0.0312,-0.5 l 1.84375,-1 c -0.0975,-0.44488 -0.22853,-0.87248 -0.40625,-1.28125 l -2.09375,0.28125 c -0.1695,-0.29 -0.37133,-0.56351 -0.59375,-0.8125 l 0.90625,-1.90625 c -0.33555,-0.29842 -0.67387,-0.58239 -1.0625,-0.8125 l -1.53125,1.46875 c -0.3057,-0.13661 -0.63429,-0.23916 -0.96875,-0.3125 l -0.40625,-2.09375 c -0.21544,-0.02 -0.4356,-0.0312 -0.65625,-0.0312 z m 0,4 c 1.65685,0 3,1.34315 3,3 0,1.65685 -1.34315,3 -3,3 -1.65685,0 -3,-1.34315 -3,-3 0,-1.65685 1.34315,-3 3,-3 z' style='color:#666666;fill:#666666;fill-opacity:1;fill-rule:nonzero;stroke:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate' inkscape:connector-curvature='0' sodipodi:nodetypes='sccccccccccsccccccccccsccccccccccsccccccccccssssss'/> - </g> - <g inkscape:label='emotes' id='g71291' style='display:inline' transform='translate(-441.0002,-400.99999)' inkscape:groupmode='layer'/> - <g inkscape:label='categories' id='g4953' style='display:inline' transform='translate(-441.0002,-400.99999)' inkscape:groupmode='layer'/> - <g inkscape:label='actions' id='layer12' style='display:inline' transform='translate(-441.0002,-400.99999)' inkscape:groupmode='layer'/> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-441.0002,-400.99999)"> +<path style="color:#666666;enable-background:accumulate;" d="m449,402c-0.22065,0-0.44081,0.0113-0.65625,0.0312l-0.40625,2.0938c-0.33446,0.0733-0.66305,0.17589-0.96875,0.3125l-1.5312-1.4688c-0.38863,0.23011-0.72695,0.51408-1.0625,0.8125l0.90625,1.9062c-0.22242,0.24899-0.42425,0.5225-0.59375,0.8125l-2.0938-0.28125c-0.17772,0.40877-0.30872,0.83637-0.40625,1.2812l1.8438,1c-0.0171,0.16809-0.0312,0.3274-0.0312,0.5s0.0142,0.33191,0.0312,0.5l-1.8438,1c0.0975,0.44488,0.22853,0.87248,0.40625,1.2812l2.0938-0.28125c0.1695,0.29,0.37133,0.56351,0.59375,0.8125l-0.90625,1.9062c0.33555,0.29842,0.67387,0.58239,1.0625,0.8125l1.5312-1.4688c0.3057,0.13661,0.63429,0.23916,0.96875,0.3125l0.40625,2.0938c0.21544,0.02,0.4356,0.0312,0.65625,0.0312s0.44081-0.0113,0.65625-0.0312l0.40625-2.0938c0.33446-0.0733,0.66305-0.17589,0.96875-0.3125l1.5312,1.4688c0.38863-0.23011,0.72695-0.51408,1.0625-0.8125l-0.90625-1.9062c0.22242-0.24899,0.42425-0.5225,0.59375-0.8125l2.0938,0.28125c0.17772-0.40877,0.30872-0.83637,0.40625-1.2812l-1.8438-1c0.0171-0.16809,0.0312-0.3274,0.0312-0.5s-0.0142-0.33191-0.0312-0.5l1.8438-1c-0.0975-0.44488-0.22853-0.87248-0.40625-1.2812l-2.0938,0.28125c-0.1695-0.29-0.37133-0.56351-0.59375-0.8125l0.90625-1.9062c-0.33555-0.29842-0.67387-0.58239-1.0625-0.8125l-1.5312,1.4688c-0.3057-0.13661-0.63429-0.23916-0.96875-0.3125l-0.40625-2.0938c-0.21544-0.02-0.4356-0.0312-0.65625-0.0312zm0,4c1.6568,0,3,1.3432,3,3s-1.3432,3-3,3-3-1.3432-3-3,1.3432-3,3-3z" fill-rule="nonzero" fill="#666"/> +</g> +</svg>
\ 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 @@ -<?xml version='1.0' encoding='UTF-8' standalone='no'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:dc='http://purl.org/dc/elements/1.1/' sodipodi:docname='go-down-symbolic.svg' height='16' id='svg7384' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' xmlns:svg='http://www.w3.org/2000/svg' inkscape:version='0.48.4 r9939' version='1.1' width='16' xmlns='http://www.w3.org/2000/svg'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:bbox-nodes='false' inkscape:bbox-paths='true' bordercolor='#666666' borderopacity='1' inkscape:current-layer='layer12' inkscape:cx='18.648774' inkscape:cy='9.99302' gridtolerance='10' inkscape:guide-bbox='true' guidetolerance='10' id='namedview88' inkscape:object-nodes='false' inkscape:object-paths='false' objecttolerance='10' pagecolor='#3a3b39' inkscape:pageopacity='1' inkscape:pageshadow='2' showborder='false' showgrid='false' showguides='true' inkscape:snap-bbox='true' inkscape:snap-bbox-midpoints='false' inkscape:snap-global='true' inkscape:snap-grids='true' inkscape:snap-nodes='false' inkscape:snap-others='false' inkscape:snap-to-guides='true' inkscape:window-height='1408' inkscape:window-maximized='1' inkscape:window-width='2560' inkscape:window-x='0' inkscape:window-y='0' inkscape:zoom='1'> - <inkscape:grid empspacing='2' enabled='true' id='grid4866' originx='60px' originy='530px' snapvisiblegridlinesonly='true' spacingx='1px' spacingy='1px' type='xygrid' visible='true'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g inkscape:groupmode='layer' id='layer9' inkscape:label='status' style='display:inline' transform='translate(-181.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer10' inkscape:label='devices' transform='translate(-181.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer11' inkscape:label='apps' transform='translate(-181.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer13' inkscape:label='places' transform='translate(-181.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer14' inkscape:label='mimetypes' transform='translate(-181.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer15' inkscape:label='emblems' style='display:inline' transform='translate(-181.0002,-747)'/> - <g inkscape:groupmode='layer' id='g71291' inkscape:label='emotes' style='display:inline' transform='translate(-181.0002,-747)'/> - <g inkscape:groupmode='layer' id='g4953' inkscape:label='categories' style='display:inline' transform='translate(-181.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer12' inkscape:label='actions' style='display:inline' transform='translate(-181.0002,-747)'> - - <path inkscape:connector-curvature='0' d='m 195.03152,751.00323 0,1.00001 c -9.1e-4,0.0111 5.9e-4,0.021 -9e-5,0.0312 -0.0112,0.25496 -0.12835,0.50994 -0.31251,0.6875 l -5.71875,6.29767 -5.71875,-6.29773 c -0.18821,-0.1881 -0.28121,-0.45346 -0.28122,-0.71875 l 0,-1.00001 1,0 c 0.26531,7e-5 0.53059,0.0931 0.71873,0.28131 l 4.28125,4.82896 4.28127,-4.82896 c 0.19464,-0.21073 0.46925,-0.30315 0.74998,-0.2813 z' id='path10839-9-9-5-9-1' sodipodi:nodetypes='ccsccccccccccc' style='font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;color:#bebebe;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.78124988;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new;font-family:Andale Mono;-inkscape-font-specification:Andale Mono'/> - </g> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-181.0002,-747)"> +<path style="block-progression:tb;color:#bebebe;direction:ltr;text-indent:0;text-align:start;enable-background:new;text-transform:none;" d="m195.03,751,0,1c-0.00091,0.0111,0.00059,0.021-0.00009,0.0312-0.0112,0.25496-0.12835,0.50994-0.31251,0.6875l-5.7188,6.2977-5.7188-6.2977c-0.18821-0.1881-0.28121-0.45346-0.28122-0.71875v-1h1c0.26531,0.00007,0.53059,0.0931,0.71873,0.28131l4.2812,4.829,4.2813-4.829c0.19464-0.21073,0.46925-0.30315,0.74998-0.2813z" fill-rule="nonzero" fill="#bebebe"/> +</g> +</svg>
\ 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 @@ -<?xml version="1.0" encoding="UTF-8"?> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"> <title>Logo FreshRSS</title> - <circle fill="#FFF" cx="128" cy="128" r="128"/> - <circle fill="#0062BE" cx="128" cy="128" r="33"/> - <g fill="none" stroke="#0062BE" stroke-width="24"> <g stroke-opacity="0.3"> <path d="M12,128 A116,116 0 1,1 128,244"/> 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 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:svg='http://www.w3.org/2000/svg' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' id='svg7384' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' version='1.1' inkscape:version='0.47 r22583' height='16' sodipodi:docname='help-browser-symbolic.svg' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns='http://www.w3.org/2000/svg' width='16'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:object-paths='true' inkscape:cy='-218.16054' inkscape:current-layer='layer11' inkscape:window-width='1920' pagecolor='#555753' showborder='false' showguides='true' inkscape:snap-nodes='false' objecttolerance='10' showgrid='true' inkscape:object-nodes='true' inkscape:pageshadow='2' inkscape:guide-bbox='true' inkscape:window-x='0' inkscape:snap-bbox='true' bordercolor='#666666' id='namedview88' inkscape:window-maximized='1' inkscape:snap-global='true' inkscape:window-y='26' gridtolerance='10' inkscape:zoom='1' inkscape:window-height='1021' borderopacity='1' guidetolerance='10' inkscape:snap-bbox-midpoints='false' inkscape:cx='-124.56688' inkscape:bbox-paths='false' inkscape:snap-grids='true' inkscape:pageopacity='1' inkscape:snap-to-guides='true'> - <inkscape:grid visible='true' spacingx='1px' type='xygrid' spacingy='1px' id='grid4866' empspacing='2' enabled='true' snapvisiblegridlinesonly='true'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g transform='translate(-182,-490)' inkscape:groupmode='layer' id='layer9' inkscape:label='status' style='display:inline'/> - <g transform='translate(-182,-490)' inkscape:groupmode='layer' id='layer10' inkscape:label='devices'/> - <g transform='translate(-182,-490)' inkscape:groupmode='layer' id='layer11' inkscape:label='apps'> - <path d='m 190,490 c -4.4147,0 -8,3.5853 -8,8 0,4.4147 3.5853,8 8,8 4.4147,0 8,-3.5853 8,-8 0,-4.4147 -3.5853,-8 -8,-8 z m 0,2 c 3.3413,0 6,2.6587 6,6 0,3.3413 -2.6587,6 -6,6 -3.3413,0 -6,-2.6587 -6,-6 0,-3.3413 2.6587,-6 6,-6 z' id='rect11749-5-0-3' style='font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;color:#bebebe;fill:#bebebe;fill-opacity:1;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans'/> - - <path d='M 189.34375,495 C 188.05763,495 187,496.05763 187,497.34375 l 0,1.3125 c 0,1.28612 1.05763,2.34375 2.34375,2.34375 l 1.3125,0 C 191.94237,501 193,499.94237 193,498.65625 l 0,-1.3125 C 193,496.05763 191.94237,495 190.65625,495 l -1.3125,0 z m 0,1 1.3125,0 c 0.74942,0 1.34375,0.59433 1.34375,1.34375 l 0,1.3125 C 192,499.40567 191.40567,500 190.65625,500 l -1.3125,0 C 188.59433,500 188,499.40567 188,498.65625 l 0,-1.3125 C 188,496.59433 188.59433,496 189.34375,496 z' id='rect11749-5-0-3-3' style='font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;color:#bebebe;fill:#bebebe;fill-opacity:1;stroke:none;stroke-width:0.99999994;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans'/> - <path inkscape:connector-curvature='0' d='m 186.71875,491.4375 c -1.51031,0.6073 -2.6811,1.7985 -3.28125,3.3125 l 3.75,1.875 c 0.25196,-0.64029 0.74249,-1.17056 1.375,-1.4375 l -1.84375,-3.75 z m 6.5625,0 -1.84375,3.75 c 0.63251,0.26694 1.12304,0.79721 1.375,1.4375 l 3.75,-1.875 c -0.60015,-1.514 -1.77094,-2.7052 -3.28125,-3.3125 z m -6.09375,8 -3.75,1.875 c 0.60709,1.48862 1.78896,2.64995 3.28125,3.25 l 1.875,-3.75 c -0.62682,-0.25556 -1.14334,-0.75203 -1.40625,-1.375 z m 5.625,0 c -0.26291,0.62297 -0.77943,1.11944 -1.40625,1.375 l 1.875,3.75 c 1.49229,-0.60005 2.67416,-1.76138 3.28125,-3.25 l -3.75,-1.875 z' id='path4624' style='fill:#bebebe;fill-opacity:1;stroke:none'/> - </g> - <g transform='translate(-182,-490)' inkscape:groupmode='layer' id='layer12' inkscape:label='actions'/> - <g transform='translate(-182,-490)' inkscape:groupmode='layer' id='layer13' inkscape:label='places'/> - <g transform='translate(-182,-490)' inkscape:groupmode='layer' id='layer14' inkscape:label='mimetypes'/> - <g transform='translate(-182,-490)' inkscape:groupmode='layer' id='layer15' inkscape:label='emblems' style='display:inline'/> - <g transform='translate(-182,-490)' inkscape:groupmode='layer' id='g4953' inkscape:label='categories' style='display:inline'/> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-182,-490)" fill="#bebebe"> +<path style="block-progression:tb;color:#bebebe;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" d="m190,490c-4.4147,0-8,3.5853-8,8s3.5853,8,8,8,8-3.5853,8-8-3.5853-8-8-8zm0,2c3.3413,0,6,2.6587,6,6s-2.6587,6-6,6-6-2.6587-6-6,2.6587-6,6-6z"/> +<path style="block-progression:tb;color:#bebebe;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" d="M189.34,495c-1.28,0-2.34,1.06-2.34,2.34v1.3125c0,1.2861,1.0576,2.3438,2.3438,2.3438h1.3125c1.29,0.01,2.35-1.05,2.35-2.33v-1.3125c0-1.29-1.06-2.35-2.34-2.35h-1.3125zm0,1,1.3125,0c0.74942,0,1.3438,0.59433,1.3438,1.3438v1.3125c0.01,0.76-0.58,1.35-1.33,1.35h-1.3125c-0.76,0-1.35-0.59-1.35-1.34v-1.3125c0-0.76,0.59-1.35,1.34-1.35z"/> +<path d="m186.72,491.44c-1.5103,0.6073-2.6811,1.7985-3.2812,3.3125l3.75,1.875c0.25196-0.64029,0.74249-1.1706,1.375-1.4375l-1.8438-3.75zm6.5625,0-1.8438,3.75c0.63251,0.26694,1.123,0.79721,1.375,1.4375l3.75-1.875c-0.60015-1.514-1.7709-2.7052-3.2812-3.3125zm-6.0938,8-3.75,1.875c0.60709,1.4886,1.789,2.65,3.2812,3.25l1.875-3.75c-0.62682-0.25556-1.1433-0.75203-1.4062-1.375zm5.625,0c-0.26291,0.62297-0.77943,1.1194-1.4062,1.375l1.875,3.75c1.4923-0.60005,2.6742-1.7614,3.2812-3.25l-3.75-1.875z"/> +</g> +</svg>
\ 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 @@ -<?xml version="1.0" encoding="UTF-8"?> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"> <title>Logo FreshRSS</title> - <circle fill="#0062BE" cx="128" cy="128" r="33"/> - <g fill="none" stroke="#0062BE" stroke-width="24"> <g stroke-opacity="0.3"> <path d="M12,128 A116,116 0 1,1 128,244"/> 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 @@ +<svg xmlns="http://www.w3.org/2000/svg"> +<g transform="translate(-340.99994,-257)" fill="#666666"> +<path style="block-progression:tb;color:#000000;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" d="m346,260c-2.7496,0-5,2.2504-5,5s2.2504,5,5,5c1.5862,0,2.9034-0.84459,3.8125-2h4.8438,0.75l0.21875-0.75,1.0312-4,0.3125-1.25h-1.2812-5.875c-0.90914-1.1554-2.2263-2-3.8125-2zm0,2c1.1158,0,2.0379,0.59507,2.5625,1.5l0.3125,0.5h0.5625,4.9688l-0.53125,2h-4.4375-0.5625l-0.3125,0.5c-0.52462,0.90493-1.4466,1.5-2.5625,1.5-1.6687,0-3-1.3313-3-3s1.3313-3,3-3z"/> +<path opacity="0.35" style="enable-background:accumulate;color:#000000;" d="M355.5,265,350,265,349.44,267,355,267z" fill-rule="nonzero"/> +<path style="enable-background:accumulate;color:#000000;" d="m346,265c0,0.55228-0.44772,1-1,1s-1-0.44772-1-1,0.44772-1,1-1,1,0.44772,1,1z" fill-rule="nonzero"/> +</g> +</svg> 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 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' id='svg7384' sodipodi:docname='web-browser-symbolic.svg' version='1.1' inkscape:version='0.48.1 r9760' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:cc='http://creativecommons.org/ns#' xmlns:svg='http://www.w3.org/2000/svg' width='16' xmlns='http://www.w3.org/2000/svg' height='16.00366'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:object-paths='false' inkscape:current-layer='layer11' inkscape:bbox-paths='false' inkscape:pageshadow='2' inkscape:snap-bbox='true' inkscape:pageopacity='1' inkscape:guide-bbox='true' pagecolor='#555753' bordercolor='#666666' showguides='true' inkscape:snap-bbox-midpoints='false' inkscape:window-maximized='0' inkscape:snap-grids='true' inkscape:window-width='1595' id='namedview88' inkscape:window-x='2191' inkscape:window-y='111' gridtolerance='10' borderopacity='1' showgrid='false' inkscape:cx='21.026784' inkscape:cy='2.9913602' inkscape:snap-nodes='false' inkscape:window-height='1162' inkscape:snap-global='true' inkscape:object-nodes='false' objecttolerance='10' inkscape:snap-others='false' inkscape:zoom='1' guidetolerance='10' inkscape:snap-to-guides='true' showborder='false'> - <inkscape:grid enabled='true' type='xygrid' id='grid4866' visible='true' snapvisiblegridlinesonly='true' empspacing='2' spacingx='1px' spacingy='1px'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g style='display:inline' inkscape:groupmode='layer' id='layer9' inkscape:label='status' transform='translate(-183,-529)'/> - <g inkscape:groupmode='layer' id='layer10' inkscape:label='devices' transform='translate(-183,-529)'/> - <g inkscape:groupmode='layer' id='layer11' inkscape:label='apps' transform='translate(-183,-529)'> - - <path style='color:#000000;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:block;overflow:visible;enable-background:accumulate' sodipodi:nodetypes='cccccccc' id='path6242' inkscape:connector-curvature='0' d='m 191.0002,533.84553 0,10.38049 -2.34399,-2.28818 -1.33941,2.73465 c -0.32808,0.73962 -2.03368,0.14492 -1.5487,-0.84412 l 1.32547,-2.83928 -2.95789,0 6.86452,-7.14356 z'/> - <path style='font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#bebebe;fill-opacity:1;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans' sodipodi:nodetypes='csccssccsssc' id='path23405' inkscape:connector-curvature='0' d='m 190.15645,530.0625 c -3.82659,0.46006 -6.57883,3.95775 -6.09375,7.78125 0.13127,1.03473 0.29377,1.38184 0.29377,1.38184 l 1.67498,-1.63184 c -0.33104,-2.75343 1.62156,-5.23146 4.375,-5.5625 2.75344,-0.33104 5.23146,1.62156 5.5625,4.375 0.31355,2.60795 -1.39127,5.02493 -3.96875,5.53125 l 0.0312,2 c 0,0 0.52086,-0.1059 0.62354,-0.13097 3.41561,-0.83385 5.70627,-4.1273 5.28271,-7.65028 -0.46006,-3.8266 -3.95466,-6.55381 -7.78125,-6.09375 z'/> - <path style='opacity:0.3;color:#000000;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate' id='path11289' inkscape:connector-curvature='0' d='m 187.11293,536.81497 0,-0.20574 -0.19826,0.0186 c 0.0165,-0.13095 0.0329,-0.26167 0.0496,-0.3926 l -0.11578,0 -0.11556,0.14959 -0.11578,0.0559 -0.1653,-0.0932 -0.0165,-0.20575 0.0331,-0.22438 0.24798,-0.18688 0.19826,0 0.0329,-0.11229 0.24786,0.0559 0.18183,0.2246 0.0331,-0.37419 0.31401,-0.26167 0.11567,-0.28055 0.23133,-0.0934 0.1322,-0.18688 0.29738,-0.0564 0.14885,-0.22415 c -0.14874,0 -0.29749,0 -0.44623,0 l 0.28094,-0.13095 0.19814,0 0.28106,-0.0937 0.0331,-0.11186 -0.0992,-0.0937 -0.11567,-0.0375 0.0331,-0.11208 -0.0826,-0.16822 -0.19837,0.0746 0.0331,-0.14947 -0.23134,-0.13096 -0.18171,0.3177 0.0165,0.11229 -0.18171,0.075 -0.11578,0.24302 -0.0495,-0.22438 -0.31402,-0.13095 -0.0496,-0.16822 0.41315,-0.24325 0.18182,-0.16822 0.0165,-0.20563 -0.0991,-0.0562 -0.13219,-0.0188 -0.0826,0.20575 c 0,0 -0.1382,0.0271 -0.17373,0.0358 -0.45378,0.41804 -1.37066,1.32044 -1.58368,3.02405 0.008,0.0395 0.15441,0.26854 0.15441,0.26854 l 0.347,0.20552 0.347,0.0937 m 3.96609,-4.30034 -0.4298,-0.16833 -0.49552,0.0561 -0.61161,0.16822 -0.11567,0.11229 0.38008,0.26167 0,0.14959 -0.14875,0.14959 0.19846,0.39294 0.13188,-0.075 0.16561,-0.26168 c 0.2553,-0.0789 0.4842,-0.16833 0.72686,-0.28053 l 0.19846,-0.5048 m 2.52925,0.34192 -0.375,0.0937 -0.21875,0.15625 0,0.125 -0.375,0.25 0.0937,0.34375 0.21875,-0.15625 0.125,0.15625 0.15625,0.0937 0.0937,-0.28125 -0.0625,-0.15625 0.0625,-0.0937 0.21875,-0.1875 0.0937,0 -0.0937,0.21875 0,0.1875 c 0.0892,-0.0242 0.1588,-0.051 0.25,-0.0625 l -0.25,0.1875 0,0.125 -0.3125,0.21875 -0.28125,-0.0625 0,-0.15625 -0.125,0.0625 0.0625,0.15625 -0.21875,0 -0.125,0.21875 -0.15625,0.15625 -0.0937,0.0312 0,0.1875 0.0312,0.15625 -0.0312,0 0,0.53125 0.0625,-0.0312 0.0937,-0.21875 0.1875,-0.125 0.0312,-0.0937 0.28125,-0.0625 0.15625,0.1875 0.1875,0.0937 -0.0937,0.1875 0.15625,-0.0312 0.0625,-0.21875 -0.1875,-0.21875 0.0625,0 0.21875,0.15625 0.0312,0.21875 0.15625,0.21875 0.0625,-0.3125 0.0937,-0.0312 c 0.0959,0.0996 0.1692,0.23163 0.25,0.34375 l 0.28125,0 0.1875,0.125 -0.0937,0.0937 -0.15625,0.15625 -0.25,0 -0.34375,-0.0937 -0.1875,0 -0.125,0.15625 -0.34375,-0.375 -0.25,-0.0625 -0.375,0.0625 -0.15625,0.0937 0,2.40625 0.0312,0.0312 0.25,-0.15625 0.0937,0.0937 0.28125,0 0.125,0.15625 -0.0937,0.3125 0.1875,0.1875 0,0.375 0.125,0.25 -0.0937,0.25 c -0.009,0.16159 0,0.30714 0,0.46875 0.0795,0.21894 0.14355,0.43575 0.21875,0.65625 l 0.0625,0.34375 0,0.1875 0.125,0 0.21875,-0.125 0.25,0 0.375,-0.4375 -0.0312,-0.15625 0.25,-0.21875 -0.1875,-0.1875 0.21875,-0.1875 0.21875,-0.125 0.0937,-0.125 -0.0625,-0.25 0,-0.59375 0.1875,-0.375 0.1875,-0.25 0.25,-0.5625 0,-0.15625 c -0.11654,0.0146 -0.22972,0.0231 -0.34375,0.0312 -0.0722,0.005 -0.14446,0 -0.21875,0 -0.12359,-0.25961 -0.2183,-0.50966 -0.3125,-0.78125 l -0.15625,-0.1875 -0.0937,-0.3125 0.0625,-0.0625 0.21875,0.25 0.25,0.5625 0.15625,0.15625 -0.0625,0.21875 0.15625,0.15625 0.25,-0.25 0.3125,-0.21875 0.15625,-0.1875 0,-0.21875 c -0.0389,-0.0732 -0.0547,-0.14545 -0.0937,-0.21875 l -0.15625,0.1875 -0.125,-0.15625 -0.1875,-0.125 0,-0.28125 0.21875,0.21875 0.21875,-0.0312 c 0.10166,0.0923 0.19205,0.20751 0.28125,0.3125 l 0.15625,-0.1875 c 0,-0.17463 -0.19976,-1.02044 -0.625,-1.75 -0.42526,-0.72932 -1.15625,-1.40625 -1.15625,-1.40625 l -0.0625,0.0937 -0.21875,0.21875 -0.25,-0.25 0.25,0 0.125,-0.125 -0.46875,-0.0937 -0.25,-0.0937 z'/> - </g> - <g inkscape:groupmode='layer' id='layer13' inkscape:label='places' transform='translate(-183,-529)'/> - <g inkscape:groupmode='layer' id='layer14' inkscape:label='mimetypes' transform='translate(-183,-529)'/> - <g style='display:inline' inkscape:groupmode='layer' id='layer15' inkscape:label='emblems' transform='translate(-183,-529)'/> - <g style='display:inline' inkscape:groupmode='layer' id='g71291' inkscape:label='emotes' transform='translate(-183,-529)'/> - <g style='display:inline' inkscape:groupmode='layer' id='g4953' inkscape:label='categories' transform='translate(-183,-529)'/> - <g style='display:inline' inkscape:groupmode='layer' id='layer12' inkscape:label='actions' transform='translate(-183,-529)'/> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16.004" width="16"> +<g fill="#bebebe" transform="translate(-183,-529)"> +<path style="enable-background:accumulate;color:#000000;" d="m191,533.85,0,10.38-2.344-2.2882-1.3394,2.7346c-0.32808,0.73962-2.0337,0.14492-1.5487-0.84412l1.3255-2.8393h-2.9579l6.8645-7.1436z" fill-rule="nonzero" display="block"/> +<path d="m190.16,530.06c-3.8266,0.46006-6.5788,3.9578-6.0938,7.7812,0.13127,1.0347,0.29377,1.3818,0.29377,1.3818l1.675-1.6318c-0.33104-2.7534,1.6216-5.2315,4.375-5.5625,2.7534-0.33104,5.2315,1.6216,5.5625,4.375,0.31355,2.608-1.3913,5.0249-3.9688,5.5312l0.0312,2s0.52086-0.1059,0.62354-0.13097c3.4156-0.83385,5.7063-4.1273,5.2827-7.6503-0.46006-3.8266-3.9547-6.5538-7.7812-6.0938z" style="baseline-shift:baseline;block-progression:tb;color:#000000;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;"/> +<path opacity="0.3" style="enable-background:accumulate;color:#000000;" d="m187.11,536.81,0-0.20574-0.19826,0.0186c0.0165-0.13095,0.0329-0.26167,0.0496-0.3926h-0.11578l-0.11556,0.14959-0.11578,0.0559-0.1653-0.0932-0.0165-0.20575,0.0331-0.22438,0.24798-0.18688h0.19826l0.0329-0.11229,0.24786,0.0559,0.18183,0.2246,0.0331-0.37419,0.31401-0.26167,0.11567-0.28055,0.23133-0.0934,0.1322-0.18688,0.29738-0.0564,0.14885-0.22415h-0.44623l0.28094-0.13095h0.19814l0.28106-0.0937,0.0331-0.11186-0.0992-0.0937-0.11567-0.0375,0.0331-0.11208-0.0826-0.16822-0.19837,0.0746,0.0331-0.14947-0.23134-0.13096-0.18171,0.3177,0.0165,0.11229-0.18171,0.075-0.11578,0.24302-0.0495-0.22438-0.31402-0.13095-0.0496-0.16822,0.41315-0.24325,0.18182-0.16822,0.0165-0.20563-0.0991-0.0562-0.13219-0.0188-0.0826,0.20575s-0.1382,0.0271-0.17373,0.0358c-0.45378,0.41804-1.3707,1.3204-1.5837,3.024,0.008,0.0395,0.15441,0.26854,0.15441,0.26854l0.347,0.20552,0.347,0.0937m3.9661-4.3003-0.4298-0.16833-0.49552,0.0561-0.61161,0.16822-0.11567,0.11229,0.38008,0.26167,0,0.14959-0.14875,0.14959,0.19846,0.39294,0.13188-0.075,0.16561-0.26168c0.2553-0.0789,0.4842-0.16833,0.72686-0.28053l0.19846-0.5048m2.5292,0.34192-0.375,0.0937-0.21875,0.15625,0,0.125-0.375,0.25,0.0937,0.34375,0.21875-0.15625,0.125,0.15625,0.15625,0.0937,0.0937-0.28125-0.0625-0.15625,0.0625-0.0937,0.21875-0.1875,0.0937,0-0.0937,0.21875,0,0.1875c0.0892-0.0242,0.1588-0.051,0.25-0.0625l-0.25,0.1875v0.125l-0.3125,0.21875-0.28125-0.0625v-0.15625l-0.125,0.0625,0.0625,0.15625h-0.21875l-0.125,0.21875-0.15625,0.15625-0.0937,0.0312v0.1875l0.0312,0.15625h-0.0312v0.53125l0.0625-0.0312,0.0937-0.21875,0.1875-0.125,0.0312-0.0937,0.28125-0.0625,0.15625,0.1875,0.1875,0.0937-0.0937,0.1875,0.15625-0.0312,0.0625-0.21875-0.1875-0.21875h0.0625l0.21875,0.15625,0.0312,0.21875,0.15625,0.21875,0.0625-0.3125,0.0937-0.0312c0.0959,0.0996,0.1692,0.23163,0.25,0.34375h0.28125l0.1875,0.125-0.0937,0.0937-0.15625,0.15625h-0.25l-0.34375-0.0937h-0.1875l-0.125,0.15625-0.34375-0.375-0.25-0.0625-0.375,0.0625-0.15625,0.0937v2.4062l0.0312,0.0312,0.25-0.15625,0.0937,0.0937h0.28125l0.125,0.15625-0.0937,0.3125,0.1875,0.1875v0.375l0.125,0.25-0.0937,0.25c-0.009,0.16159,0,0.30714,0,0.46875,0.0795,0.21894,0.14355,0.43575,0.21875,0.65625l0.0625,0.34375v0.1875h0.125l0.21875-0.125h0.25l0.375-0.4375-0.0312-0.15625,0.25-0.21875-0.1875-0.1875,0.21875-0.1875,0.21875-0.125,0.0937-0.125-0.0625-0.25v-0.59375l0.1875-0.375,0.1875-0.25,0.25-0.5625v-0.15625c-0.11654,0.0146-0.22972,0.0231-0.34375,0.0312-0.0722,0.005-0.14446,0-0.21875,0-0.12359-0.25961-0.2183-0.50966-0.3125-0.78125l-0.15625-0.1875-0.0937-0.3125,0.0625-0.0625,0.21875,0.25,0.25,0.5625,0.15625,0.15625-0.0625,0.21875,0.15625,0.15625,0.25-0.25,0.3125-0.21875,0.15625-0.1875v-0.21875c-0.0389-0.0732-0.0547-0.14545-0.0937-0.21875l-0.15625,0.1875-0.125-0.15625-0.1875-0.125v-0.28125l0.21875,0.21875,0.21875-0.0312c0.10166,0.0923,0.19205,0.20751,0.28125,0.3125l0.15625-0.1875c0-0.17463-0.19976-1.0204-0.625-1.75-0.42526-0.72932-1.1562-1.4062-1.1562-1.4062l-0.0625,0.0937-0.21875,0.21875-0.25-0.25h0.25l0.125-0.125-0.46875-0.0937-0.25-0.0937z" fill-rule="nonzero"/> +</g> +</svg>
\ 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 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:svg='http://www.w3.org/2000/svg' id='svg7384' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' sodipodi:docname='changes-prevent-symbolic.svg' version='1.1' inkscape:version='0.48.1 r9760' height='16' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns='http://www.w3.org/2000/svg' width='16'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:cy='9.416826' pagecolor='#555753' borderopacity='1' showborder='false' inkscape:bbox-paths='false' guidetolerance='10' inkscape:object-paths='true' inkscape:window-width='1296' showguides='true' inkscape:object-nodes='true' inkscape:snap-bbox='true' inkscape:pageshadow='2' inkscape:guide-bbox='true' inkscape:snap-nodes='false' bordercolor='#666666' objecttolerance='10' id='namedview88' showgrid='false' inkscape:window-maximized='0' inkscape:window-x='1941' inkscape:snap-global='true' inkscape:window-y='81' gridtolerance='10' inkscape:window-height='1013' inkscape:snap-to-guides='true' inkscape:current-layer='layer9' inkscape:snap-bbox-midpoints='false' inkscape:zoom='1' inkscape:cx='52.563336' inkscape:snap-grids='true' inkscape:pageopacity='1'> - <inkscape:grid spacingx='1px' spacingy='1px' id='grid4866' empspacing='2' enabled='true' type='xygrid' snapvisiblegridlinesonly='true' visible='true'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g inkscape:label='status' transform='translate(-181.0002,-237)' inkscape:groupmode='layer' id='layer9' style='display:inline'> - <g inkscape:label='lock' transform='translate(161.0002,-39)' id='g4053' style='fill:#bebebe;fill-opacity:1'> - - </g> - <path inkscape:connector-curvature='0' d='m 184,244 c -0.554,0 -1,0.446 -1,1 l 0,0.53125 0,5.46875 12,0 0,-5.46875 L 195,245 c 0,-0.554 -0.446,-1 -1,-1 l -10,0 z' id='rect4063' sodipodi:nodetypes='csccccscc' style='color:#bebebe;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible'/> - <path inkscape:connector-curvature='0' d='m 188,238 c -1.6447,0 -3,1.3553 -3,3 l 0,7 c 0,1.6447 1.3553,3 3,3 l 2,0 c 1.6447,0 3,-1.3553 3,-3 l 0,-7 c 0,-1.6447 -1.3553,-3 -3,-3 l -2,0 z m 0,2 2,0 c 0.5713,0 1,0.4287 1,1 l 0,7 c 0,0.5713 -0.4287,1 -1,1 l -2,0 c -0.5713,0 -1,-0.4287 -1,-1 l 0,-7 c 0,-0.5713 0.4287,-1 1,-1 z' id='rect4291' style='font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#bebebe;fill:#bebebe;fill-opacity:1;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans'/> - </g> - <g inkscape:label='devices' transform='translate(-181.0002,-237)' inkscape:groupmode='layer' id='layer10'/> - <g inkscape:label='apps' transform='translate(-181.0002,-237)' inkscape:groupmode='layer' id='layer11'/> - <g inkscape:label='actions' transform='translate(-181.0002,-237)' inkscape:groupmode='layer' id='layer12'/> - <g inkscape:label='places' transform='translate(-181.0002,-237)' inkscape:groupmode='layer' id='layer13'/> - <g inkscape:label='mimetypes' transform='translate(-181.0002,-237)' inkscape:groupmode='layer' id='layer14'/> - <g inkscape:label='emblems' transform='translate(-181.0002,-237)' inkscape:groupmode='layer' id='layer15' style='display:inline'/> - <g inkscape:label='categories' transform='translate(-181.0002,-237)' inkscape:groupmode='layer' id='g4953' style='display:inline'/> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-181.0002,-237)" fill="#bebebe"> +<path style="color:#bebebe;" d="m184,244c-0.554,0-1,0.446-1,1v0.53125,5.4688h12v-5.4688-0.53c0-0.554-0.446-1-1-1h-10z" fill-rule="nonzero"/> +<path style="baseline-shift:baseline;block-progression:tb;color:#bebebe;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" d="m188,238c-1.6447,0-3,1.3553-3,3v7c0,1.6447,1.3553,3,3,3h2c1.6447,0,3-1.3553,3-3v-7c0-1.6447-1.3553-3-3-3h-2zm0,2,2,0c0.5713,0,1,0.4287,1,1v7c0,0.5713-0.4287,1-1,1h-2c-0.5713,0-1-0.4287-1-1v-7c0-0.5713,0.4287-1,1-1z"/> +</g> +</svg>
\ 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 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:svg='http://www.w3.org/2000/svg' id='svg7384' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' sodipodi:docname='changes-allow-symbolic.svg' version='1.1' inkscape:version='0.48.1 r9760' height='16' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns='http://www.w3.org/2000/svg' width='16'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:cy='9.416826' pagecolor='#555753' borderopacity='1' showborder='false' inkscape:bbox-paths='false' guidetolerance='10' inkscape:object-paths='true' inkscape:window-width='1296' showguides='true' inkscape:object-nodes='true' inkscape:snap-bbox='true' inkscape:pageshadow='2' inkscape:guide-bbox='true' inkscape:snap-nodes='false' bordercolor='#666666' objecttolerance='10' id='namedview88' showgrid='false' inkscape:window-maximized='0' inkscape:window-x='1941' inkscape:snap-global='true' inkscape:window-y='81' gridtolerance='10' inkscape:window-height='1013' inkscape:snap-to-guides='true' inkscape:current-layer='layer9' inkscape:snap-bbox-midpoints='false' inkscape:zoom='1' inkscape:cx='32.563336' inkscape:snap-grids='true' inkscape:pageopacity='1'> - <inkscape:grid spacingx='1px' spacingy='1px' id='grid4866' empspacing='2' enabled='true' type='xygrid' snapvisiblegridlinesonly='true' visible='true'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g inkscape:label='status' transform='translate(-201.0002,-237)' inkscape:groupmode='layer' id='layer9' style='display:inline'> - <g inkscape:label='lock' transform='translate(181.0002,-39)' id='g4053-3' style='fill:#bebebe;fill-opacity:1'> - - </g> - <path inkscape:connector-curvature='0' d='m 204,246 c -0.554,0 -1,0.446 -1,1 l 0,0.53125 0,5.46875 12,0 0,-5.46875 L 215,247 c 0,-0.554 -0.446,-1 -1,-1 l -10,0 z' id='rect4063-6' sodipodi:nodetypes='csccccscc' style='color:#bebebe;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible'/> - <path inkscape:connector-curvature='0' d='m 208.0002,237 c -1.64469,0 -3,1.35529 -3,3 l 0,3 2,0 0,-3 c 0,-0.57129 0.42873,-1 1,-1 l 2,0 c 0.57127,0 1,0.42871 1,1 l 0,7 2,0 0,-7 c 0,-1.64471 -1.35531,-3 -3,-3 l -2,0 z' id='rect4291-4' style='font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#bebebe;fill:#bebebe;fill-opacity:1;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans'/> - </g> - <g inkscape:label='devices' transform='translate(-201.0002,-237)' inkscape:groupmode='layer' id='layer10'/> - <g inkscape:label='apps' transform='translate(-201.0002,-237)' inkscape:groupmode='layer' id='layer11'/> - <g inkscape:label='actions' transform='translate(-201.0002,-237)' inkscape:groupmode='layer' id='layer12'/> - <g inkscape:label='places' transform='translate(-201.0002,-237)' inkscape:groupmode='layer' id='layer13'/> - <g inkscape:label='mimetypes' transform='translate(-201.0002,-237)' inkscape:groupmode='layer' id='layer14'/> - <g inkscape:label='emblems' transform='translate(-201.0002,-237)' inkscape:groupmode='layer' id='layer15' style='display:inline'/> - <g inkscape:label='categories' transform='translate(-201.0002,-237)' inkscape:groupmode='layer' id='g4953' style='display:inline'/> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-201.0002,-237)" fill="#bebebe"> +<path style="color:#bebebe;" d="m204,246c-0.554,0-1,0.446-1,1v0.53125,5.4688h12v-5.4688-0.53c0-0.554-0.446-1-1-1h-10z" fill-rule="nonzero"/> +<path style="baseline-shift:baseline;block-progression:tb;color:#bebebe;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" d="m208,237c-1.6447,0-3,1.3553-3,3v3h2v-3c0-0.57129,0.42873-1,1-1h2c0.57127,0,1,0.42871,1,1v7h2v-7c0-1.6447-1.3553-3-3-3h-2z"/> +</g> +</svg>
\ 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 @@ -<?xml version='1.0' encoding='UTF-8' standalone='no'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:dc='http://purl.org/dc/elements/1.1/' sodipodi:docname='go-next-symbolic.svg' height='16' id='svg7384' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' xmlns:svg='http://www.w3.org/2000/svg' inkscape:version='0.48.4 r9939' version='1.1' width='16' xmlns='http://www.w3.org/2000/svg'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:bbox-nodes='false' inkscape:bbox-paths='true' bordercolor='#666666' borderopacity='1' inkscape:current-layer='layer12' inkscape:cx='78.648774' inkscape:cy='9.99302' gridtolerance='10' inkscape:guide-bbox='true' guidetolerance='10' id='namedview88' inkscape:object-nodes='false' inkscape:object-paths='false' objecttolerance='10' pagecolor='#3a3b39' inkscape:pageopacity='1' inkscape:pageshadow='2' showborder='false' showgrid='false' showguides='true' inkscape:snap-bbox='true' inkscape:snap-bbox-midpoints='false' inkscape:snap-global='true' inkscape:snap-grids='true' inkscape:snap-nodes='false' inkscape:snap-others='false' inkscape:snap-to-guides='true' inkscape:window-height='1408' inkscape:window-maximized='1' inkscape:window-width='2560' inkscape:window-x='0' inkscape:window-y='0' inkscape:zoom='1'> - <inkscape:grid empspacing='2' enabled='true' id='grid4866' originx='120px' originy='530px' snapvisiblegridlinesonly='true' spacingx='1px' spacingy='1px' type='xygrid' visible='true'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g inkscape:groupmode='layer' id='layer9' inkscape:label='status' style='display:inline' transform='translate(-121.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer10' inkscape:label='devices' transform='translate(-121.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer11' inkscape:label='apps' transform='translate(-121.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer13' inkscape:label='places' transform='translate(-121.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer14' inkscape:label='mimetypes' transform='translate(-121.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer15' inkscape:label='emblems' style='display:inline' transform='translate(-121.0002,-747)'/> - <g inkscape:groupmode='layer' id='g71291' inkscape:label='emotes' style='display:inline' transform='translate(-121.0002,-747)'/> - <g inkscape:groupmode='layer' id='g4953' inkscape:label='categories' style='display:inline' transform='translate(-121.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer12' inkscape:label='actions' style='display:inline' transform='translate(-121.0002,-747)'> - - <path inkscape:connector-curvature='0' d='m 125.0004,749 1,0 c 0.0104,-1.2e-4 0.0208,-4.6e-4 0.0313,0 0.25495,0.0112 0.50987,0.12858 0.6875,0.3125 l 6.29767,5.71875 -6.29772,5.71875 c -0.18816,0.18819 -0.45346,0.28125 -0.71875,0.28125 l -1,0 0,-1 c 0,-0.26529 0.0931,-0.53058 0.28125,-0.71875 l 4.82897,-4.28125 -4.82897,-4.28125 c -0.21074,-0.19463 -0.30316,-0.46925 -0.28125,-0.75 z' id='path10839-9-9-5-9' sodipodi:nodetypes='ccsccccccccccc' style='font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;color:#bebebe;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.78124988;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new;font-family:Andale Mono;-inkscape-font-specification:Andale Mono'/> - </g> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-121.0002,-747)"> +<path style="block-progression:tb;color:#bebebe;direction:ltr;text-indent:0;text-align:start;enable-background:new;text-transform:none;" d="m125,749,1,0c0.0104-0.00012,0.0208-0.00046,0.0313,0,0.25495,0.0112,0.50987,0.12858,0.6875,0.3125l6.2977,5.7188-6.2977,5.7188c-0.18816,0.18819-0.45346,0.28125-0.71875,0.28125h-1v-1c0-0.26529,0.0931-0.53058,0.28125-0.71875l4.829-4.2812-4.829-4.2812c-0.21074-0.19463-0.30316-0.46925-0.28125-0.75z" fill-rule="nonzero" fill="#bebebe"/> +</g> +</svg>
\ 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 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:svg='http://www.w3.org/2000/svg' id='svg7384' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' sodipodi:docname='non-starred-symbolic.svg' version='1.1' inkscape:version='0.48.1 r9760' height='16' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns='http://www.w3.org/2000/svg' width='16'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:cy='0.50817' pagecolor='#555753' borderopacity='1' showborder='false' inkscape:bbox-paths='false' guidetolerance='10' inkscape:object-paths='true' inkscape:window-width='1457' showguides='true' inkscape:object-nodes='true' inkscape:snap-bbox='true' inkscape:pageshadow='2' inkscape:guide-bbox='true' inkscape:snap-nodes='false' bordercolor='#666666' objecttolerance='10' id='namedview88' showgrid='false' inkscape:window-maximized='0' inkscape:window-x='86' inkscape:snap-global='true' inkscape:window-y='51' gridtolerance='10' inkscape:window-height='1093' inkscape:snap-to-guides='true' inkscape:current-layer='layer9' inkscape:snap-bbox-midpoints='false' inkscape:zoom='1' inkscape:cx='-0.97094164' inkscape:snap-grids='true' inkscape:pageopacity='1'> - <inkscape:grid spacingx='1px' spacingy='1px' id='grid4866' empspacing='2' enabled='true' type='xygrid' snapvisiblegridlinesonly='true' visible='true'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g inkscape:label='status' transform='translate(-61.000202,-397)' inkscape:groupmode='layer' id='layer9' style='display:inline'> - <g inkscape:label='folder-remote' transform='translate(-166.9996,-599)' id='g5516'> - - </g> - <path inkscape:connector-curvature='0' d='m 69.002994,398.0051 c -0.2659,-9.9e-4 -0.498591,0.1006 -0.664702,0.2393 -0.166111,0.13869 -0.277415,0.32137 -0.389683,0.50028 -0.224526,0.35782 -0.392692,0.76873 -0.565462,1.20357 -0.17277,0.43483 -0.347131,0.88766 -0.504599,1.23232 -0.157468,0.34465 -0.345596,0.57871 -0.35862,0.58776 -0.01287,0.009 -0.307217,0.117 -0.695765,0.15181 -0.388547,0.0348 -0.881219,0.0492 -1.36324,0.0694 -0.482021,0.0202 -0.970296,0.0362 -1.393042,0.12817 -0.211377,0.046 -0.4154,0.10148 -0.604343,0.20956 -0.188943,0.10808 -0.366894,0.28631 -0.450041,0.53002 -0.08315,0.24371 -0.04901,0.50627 0.03636,0.70157 0.08537,0.19531 0.226562,0.36514 0.368205,0.52344 0.283296,0.31663 0.632701,0.60557 1.007899,0.89849 0.375198,0.29292 0.776711,0.55926 1.067753,0.81027 0.291042,0.25101 0.454223,0.50796 0.459122,0.52271 0.0048,0.0146 0.03119,0.33498 -0.05456,0.70231 -0.08575,0.36732 -0.223801,0.81174 -0.352819,1.26034 -0.129019,0.44861 -0.25176,0.90196 -0.291704,1.31835 -0.01997,0.20819 -0.04285,0.40729 0.0053,0.61409 0.04814,0.20679 0.184498,0.43007 0.399016,0.58168 0.214508,0.15161 0.449359,0.1881 0.668233,0.1701 0.218874,-0.018 0.435347,-0.0703 0.635153,-0.15132 0.399612,-0.16214 0.801767,-0.42851 1.206417,-0.68231 0.404649,-0.2538 0.808218,-0.52155 1.145553,-0.71107 0.337335,-0.18952 0.648398,-0.2686 0.66445,-0.26854 0.01586,6e-5 0.303381,0.0951 0.638936,0.28732 0.335555,0.19221 0.725321,0.46503 1.127607,0.72205 0.402287,0.25702 0.819957,0.49752 1.218019,0.66284 0.199027,0.0827 0.388928,0.15086 0.607623,0.17059 0.218695,0.0197 0.479784,-0.031 0.695512,-0.18105 0.215717,-0.15001 0.339276,-0.35235 0.389178,-0.55877 0.0499,-0.20642 0.04291,-0.43517 0.02476,-0.64358 -0.03632,-0.41683 -0.158989,-0.86394 -0.284099,-1.31372 -0.12511,-0.44978 -0.261649,-0.88661 -0.344206,-1.25475 -0.08256,-0.36813 -0.07169,-0.68662 -0.06666,-0.70133 0.005,-0.0145 0.187465,-0.25247 0.480599,-0.50101 0.293134,-0.24854 0.675989,-0.53755 1.053628,-0.82731 0.37764,-0.28976 0.767161,-0.57158 1.053124,-0.88579 0.142977,-0.1571 0.241796,-0.33444 0.32882,-0.52904 0.08702,-0.1946 0.135998,-0.42874 0.05481,-0.67306 -0.08119,-0.24432 -0.271084,-0.41314 -0.459122,-0.52272 -0.188037,-0.10958 -0.366789,-0.18158 -0.577821,-0.22931 -0.422064,-0.0955 -0.913586,-0.14009 -1.395564,-0.16426 -0.481977,-0.0242 -0.945835,-0.039 -1.334196,-0.077 -0.388361,-0.038 -0.715653,-0.13122 -0.728592,-0.14037 -0.01279,-0.009 -0.184019,-0.23636 -0.338404,-0.58217 -0.154385,-0.34581 -0.326584,-0.78819 -0.495481,-1.22429 -0.168896,-0.4361 -0.334766,-0.86429 -0.556091,-1.2238 -0.110668,-0.17977 -0.233352,-0.35397 -0.398259,-0.49396 -0.164907,-0.13999 -0.40309,-0.25684 -0.66899,-0.25783 z m 0.0086,0.99424 c 0.0422,0.0358 0.106711,0.13602 0.184103,0.26173 0.154773,0.25141 0.330675,0.6272 0.493967,1.04883 0.163292,0.42163 0.319052,0.88645 0.495985,1.28277 0.176933,0.39633 0.314564,0.73379 0.675296,0.98889 0.360721,0.25509 0.770187,0.29763 1.215244,0.34118 0.445058,0.0435 0.92882,0.0532 1.394807,0.0765 0.465988,0.0234 0.918236,0.0697 1.213479,0.13647 0.147627,0.0334 0.255581,0.0572 0.303811,0.0853 -0.02227,0.0498 -0.07958,0.15478 -0.179562,0.26464 -0.199968,0.21973 -0.537491,0.48746 -0.902606,0.7676 -0.365114,0.28015 -0.778037,0.57219 -1.113986,0.85704 -0.33595,0.28485 -0.639918,0.53221 -0.779871,0.94209 -0.139952,0.40986 -0.05396,0.77681 0.04065,1.19869 0.09461,0.42189 0.25406,0.87813 0.375016,1.31299 0.120956,0.43486 0.226877,0.84692 0.25228,1.13851 0.01156,0.13264 -0.01699,0.23485 -0.02778,0.29267 -0.05993,-0.008 -0.176402,-0.0324 -0.303811,-0.0853 -0.278362,-0.11561 -0.646494,-0.32808 -1.03543,-0.57657 -0.388935,-0.24849 -0.803899,-0.53053 -1.18847,-0.75081 -0.38457,-0.22028 -0.707909,-0.39837 -1.155138,-0.40015 -0.447219,-0.002 -0.792046,0.17245 -1.178633,0.38965 -0.386587,0.21719 -0.784375,0.49517 -1.175607,0.74055 -0.391232,0.24538 -0.776359,0.4507 -1.055898,0.56412 -0.139769,0.0567 -0.246155,0.0856 -0.302298,0.0902 -0.01026,-0.0578 -0.01522,-0.16008 -0.0025,-0.29243 0.02793,-0.29118 0.138178,-0.70893 0.262912,-1.14264 0.124734,-0.43372 0.254035,-0.89785 0.352315,-1.31883 0.09828,-0.42099 0.186721,-0.78846 0.05027,-1.19943 -0.136442,-0.41097 -0.43218,-0.64202 -0.765707,-0.92967 -0.333527,-0.28766 -0.705509,-0.58555 -1.068257,-0.86876 -0.362749,-0.2832 -0.717797,-0.56075 -0.915974,-0.78224 -0.09908,-0.11075 -0.162208,-0.21163 -0.184103,-0.26173 0.04834,-0.0276 0.154481,-0.058 0.302298,-0.0902 0.295625,-0.0643 0.745175,-0.10714 1.211209,-0.1267 0.466034,-0.0196 0.948238,-0.0298 1.393546,-0.0697 0.445308,-0.0399 0.846793,-0.0499 1.209695,-0.30216 0.362893,-0.25221 0.5383,-0.60511 0.718755,-1.00009 0.180456,-0.39497 0.33731,-0.84115 0.504347,-1.26156 0.167037,-0.42041 0.318485,-0.83556 0.475555,-1.08586 0.07853,-0.12515 0.167511,-0.20007 0.21012,-0.23565 z' id='path5520' style='font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#bebebe;fill-opacity:1;stroke:none;stroke-width:1.04970646;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans'/> - </g> - <g inkscape:label='devices' transform='translate(-61.000202,-397)' inkscape:groupmode='layer' id='layer10'/> - <g inkscape:label='apps' transform='translate(-61.000202,-397)' inkscape:groupmode='layer' id='layer11'/> - <g inkscape:label='actions' transform='translate(-61.000202,-397)' inkscape:groupmode='layer' id='layer12'/> - <g inkscape:label='places' transform='translate(-61.000202,-397)' inkscape:groupmode='layer' id='layer13'/> - <g inkscape:label='mimetypes' transform='translate(-61.000202,-397)' inkscape:groupmode='layer' id='layer14'/> - <g inkscape:label='emblems' transform='translate(-61.000202,-397)' inkscape:groupmode='layer' id='layer15' style='display:inline'/> - <g inkscape:label='categories' transform='translate(-61.000202,-397)' inkscape:groupmode='layer' id='g4953' style='display:inline'/> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-61.000202,-397)"> +<path style="baseline-shift:baseline;block-progression:tb;color:#000000;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" fill="#bebebe" d="m69.003,398.01c-0.2659-0.00099-0.49859,0.1006-0.6647,0.2393-0.16611,0.13869-0.27742,0.32137-0.38968,0.50028-0.22453,0.35782-0.39269,0.76873-0.56546,1.2036-0.17277,0.43483-0.34713,0.88766-0.5046,1.2323-0.15747,0.34465-0.3456,0.57871-0.35862,0.58776-0.01287,0.009-0.30722,0.117-0.69576,0.15181-0.38855,0.0348-0.88122,0.0492-1.3632,0.0694-0.48202,0.0202-0.9703,0.0362-1.393,0.12817-0.21138,0.046-0.4154,0.10148-0.60434,0.20956s-0.36689,0.28631-0.45004,0.53002-0.04901,0.50627,0.03636,0.70157c0.08537,0.19531,0.22656,0.36514,0.3682,0.52344,0.2833,0.31663,0.6327,0.60557,1.0079,0.89849s0.77671,0.55926,1.0678,0.81027c0.29104,0.25101,0.45422,0.50796,0.45912,0.52271,0.0048,0.0146,0.03119,0.33498-0.05456,0.70231-0.08575,0.36732-0.2238,0.81174-0.35282,1.2603-0.12902,0.44861-0.25176,0.90196-0.2917,1.3184-0.01997,0.20819-0.04285,0.40729,0.0053,0.61409,0.04814,0.20679,0.1845,0.43007,0.39902,0.58168,0.21451,0.15161,0.44936,0.1881,0.66823,0.1701s0.43535-0.0703,0.63515-0.15132c0.39961-0.16214,0.80177-0.42851,1.2064-0.68231,0.40465-0.2538,0.80822-0.52155,1.1456-0.71107,0.33734-0.18952,0.6484-0.2686,0.66445-0.26854,0.01586,0.00006,0.30338,0.0951,0.63894,0.28732,0.33556,0.19221,0.72532,0.46503,1.1276,0.72205,0.40229,0.25702,0.81996,0.49752,1.218,0.66284,0.19903,0.0827,0.38893,0.15086,0.60762,0.17059,0.2187,0.0197,0.47978-0.031,0.69551-0.18105,0.21572-0.15001,0.33928-0.35235,0.38918-0.55877s0.04291-0.43517,0.02476-0.64358c-0.03632-0.41683-0.15899-0.86394-0.2841-1.3137-0.12511-0.44978-0.26165-0.88661-0.34421-1.2548-0.08256-0.36813-0.07169-0.68662-0.06666-0.70133,0.005-0.0145,0.18746-0.25247,0.4806-0.50101,0.29313-0.24854,0.67599-0.53755,1.0536-0.82731,0.37764-0.28976,0.76716-0.57158,1.0531-0.88579,0.14298-0.1571,0.2418-0.33444,0.32882-0.52904s0.136-0.42874,0.05481-0.67306-0.27108-0.41314-0.45912-0.52272-0.36679-0.18158-0.57782-0.22931c-0.42206-0.0955-0.91359-0.14009-1.3956-0.16426-0.48198-0.0242-0.94584-0.039-1.3342-0.077s-0.71565-0.13122-0.72859-0.14037c-0.01279-0.009-0.18402-0.23636-0.3384-0.58217s-0.32658-0.78819-0.49548-1.2243c-0.1689-0.4361-0.33477-0.86429-0.55609-1.2238-0.11067-0.17977-0.23335-0.35397-0.39826-0.49396s-0.40309-0.25684-0.66899-0.25783zm0.0086,0.99424c0.0422,0.0358,0.10671,0.13602,0.1841,0.26173,0.15477,0.25141,0.33068,0.6272,0.49397,1.0488,0.16329,0.42163,0.31905,0.88645,0.49598,1.2828,0.17693,0.39633,0.31456,0.73379,0.6753,0.98889,0.36072,0.25509,0.77019,0.29763,1.2152,0.34118,0.44506,0.0435,0.92882,0.0532,1.3948,0.0765,0.46599,0.0234,0.91824,0.0697,1.2135,0.13647,0.14763,0.0334,0.25558,0.0572,0.30381,0.0853-0.02227,0.0498-0.07958,0.15478-0.17956,0.26464-0.19997,0.21973-0.53749,0.48746-0.90261,0.7676-0.36511,0.28015-0.77804,0.57219-1.114,0.85704-0.33595,0.28485-0.63992,0.53221-0.77987,0.94209-0.13995,0.40986-0.05396,0.77681,0.04065,1.1987s0.25406,0.87813,0.37502,1.313c0.12096,0.43486,0.22688,0.84692,0.25228,1.1385,0.01156,0.13264-0.01699,0.23485-0.02778,0.29267-0.05993-0.008-0.1764-0.0324-0.30381-0.0853-0.27836-0.11561-0.64649-0.32808-1.0354-0.57657-0.38894-0.24849-0.8039-0.53053-1.1885-0.75081-0.38457-0.22028-0.70791-0.39837-1.1551-0.40015-0.44722-0.002-0.79205,0.17245-1.1786,0.38965-0.38659,0.21719-0.78438,0.49517-1.1756,0.74055-0.39123,0.24538-0.77636,0.4507-1.0559,0.56412-0.13977,0.0567-0.24616,0.0856-0.3023,0.0902-0.01026-0.0578-0.01522-0.16008-0.0025-0.29243,0.02793-0.29118,0.13818-0.70893,0.26291-1.1426,0.12473-0.43372,0.25404-0.89785,0.35232-1.3188,0.09828-0.42099,0.18672-0.78846,0.05027-1.1994-0.13644-0.41097-0.43218-0.64202-0.76571-0.92967-0.33353-0.28766-0.70551-0.58555-1.0683-0.86876-0.36275-0.2832-0.7178-0.56075-0.91597-0.78224-0.09908-0.11075-0.16221-0.21163-0.1841-0.26173,0.04834-0.0276,0.15448-0.058,0.3023-0.0902,0.29562-0.0643,0.74518-0.10714,1.2112-0.1267,0.46603-0.0196,0.94824-0.0298,1.3935-0.0697,0.44531-0.0399,0.84679-0.0499,1.2097-0.30216,0.36289-0.25221,0.5383-0.60511,0.71876-1.0001,0.18046-0.39497,0.33731-0.84115,0.50435-1.2616,0.16704-0.42041,0.31848-0.83556,0.47556-1.0859,0.07853-0.12515,0.16751-0.20007,0.21012-0.23565z"/> +</g> +</svg>
\ 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 @@ -<?xml version='1.0' encoding='UTF-8' standalone='no'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:dc='http://purl.org/dc/elements/1.1/' sodipodi:docname='go-next-rtl-symbolic.svg' height='16' id='svg7384' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' xmlns:svg='http://www.w3.org/2000/svg' inkscape:version='0.48.4 r9939' version='1.1' width='16' xmlns='http://www.w3.org/2000/svg'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:bbox-nodes='false' inkscape:bbox-paths='true' bordercolor='#666666' borderopacity='1' inkscape:current-layer='layer12' inkscape:cx='-101.35123' inkscape:cy='9.99302' gridtolerance='10' inkscape:guide-bbox='true' guidetolerance='10' id='namedview88' inkscape:object-nodes='false' inkscape:object-paths='false' objecttolerance='10' pagecolor='#3a3b39' inkscape:pageopacity='1' inkscape:pageshadow='2' showborder='false' showgrid='false' showguides='true' inkscape:snap-bbox='true' inkscape:snap-bbox-midpoints='false' inkscape:snap-global='true' inkscape:snap-grids='true' inkscape:snap-nodes='false' inkscape:snap-others='false' inkscape:snap-to-guides='true' inkscape:window-height='1408' inkscape:window-maximized='1' inkscape:window-width='2560' inkscape:window-x='0' inkscape:window-y='0' inkscape:zoom='1'> - <inkscape:grid empspacing='2' enabled='true' id='grid4866' originx='-60px' originy='530px' snapvisiblegridlinesonly='true' spacingx='1px' spacingy='1px' type='xygrid' visible='true'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g inkscape:groupmode='layer' id='layer9' inkscape:label='status' style='display:inline' transform='translate(-301.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer10' inkscape:label='devices' transform='translate(-301.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer11' inkscape:label='apps' transform='translate(-301.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer13' inkscape:label='places' transform='translate(-301.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer14' inkscape:label='mimetypes' transform='translate(-301.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer15' inkscape:label='emblems' style='display:inline' transform='translate(-301.0002,-747)'/> - <g inkscape:groupmode='layer' id='g71291' inkscape:label='emotes' style='display:inline' transform='translate(-301.0002,-747)'/> - <g inkscape:groupmode='layer' id='g4953' inkscape:label='categories' style='display:inline' transform='translate(-301.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer12' inkscape:label='actions' style='display:inline' transform='translate(-301.0002,-747)'> - - <path inkscape:connector-curvature='0' d='m 313.01372,749 -1,0 c -0.0104,-1.2e-4 -0.0208,-4.6e-4 -0.0313,0 -0.25495,0.0112 -0.50987,0.12858 -0.6875,0.3125 l -6.29767,5.71875 6.29772,5.71875 c 0.18816,0.18819 0.45346,0.28125 0.71875,0.28125 l 1,0 0,-1 c 0,-0.26529 -0.0931,-0.53058 -0.28125,-0.71875 l -4.82897,-4.28125 4.82897,-4.28125 c 0.21074,-0.19463 0.30316,-0.46925 0.28125,-0.75 z' id='path5441' sodipodi:nodetypes='ccsccccccccccc' style='font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;color:#bebebe;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.78124988;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new;font-family:Andale Mono;-inkscape-font-specification:Andale Mono'/> - </g> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-301.0002,-747)"> +<path style="block-progression:tb;color:#bebebe;direction:ltr;text-indent:0;text-align:start;enable-background:new;text-transform:none;" d="m313.01,749-1,0c-0.0104-0.00012-0.0208-0.00046-0.0313,0-0.25495,0.0112-0.50987,0.12858-0.6875,0.3125l-6.2977,5.7188,6.2977,5.7188c0.18816,0.18819,0.45346,0.28125,0.71875,0.28125h1v-1c0-0.26529-0.0931-0.53058-0.28125-0.71875l-4.829-4.2812,4.829-4.2812c0.21074-0.19463,0.30316-0.46925,0.28125-0.75z" fill-rule="nonzero" fill="#bebebe"/> +</g> +</svg>
\ 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 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns='http://www.w3.org/2000/svg' id='svg7384' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' width='16' xmlns:cc='http://creativecommons.org/ns#' height='16.001099' sodipodi:docname='mail-read-symbolic.svg' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:svg='http://www.w3.org/2000/svg' inkscape:version='0.48.1 r9760' version='1.1'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:window-width='1226' id='namedview88' showgrid='false' objecttolerance='10' inkscape:pageopacity='1' inkscape:cx='12.92257' inkscape:cy='-1.422716' inkscape:snap-bbox='true' borderopacity='1' inkscape:object-nodes='false' inkscape:current-layer='layer9' inkscape:snap-to-guides='true' inkscape:snap-others='false' inkscape:snap-grids='true' bordercolor='#666666' inkscape:window-height='967' inkscape:snap-bbox-midpoints='false' showborder='false' inkscape:bbox-paths='false' inkscape:guide-bbox='true' inkscape:window-x='2657' inkscape:window-y='338' inkscape:snap-global='true' inkscape:snap-nodes='true' pagecolor='#555753' inkscape:object-paths='false' inkscape:pageshadow='2' inkscape:zoom='1' inkscape:window-maximized='0' gridtolerance='10' guidetolerance='10' showguides='true'> - <inkscape:grid id='grid4866' empspacing='2' type='xygrid' visible='true' snapvisiblegridlinesonly='true' enabled='true' spacingx='1px' spacingy='1px'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g id='layer9' inkscape:groupmode='layer' style='display:inline' transform='translate(-60.99995,-296.9989)' inkscape:label='status'> - - <path id='path35631' style='font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;opacity:0.35;color:#000000;fill:#bebebe;fill-opacity:1;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans' d='m 68.8752,297 a 1.0001,1.0001 0 0 0 -0.5,0.25 l -4.90625,4 a 1.0001,1.0001 0 0 0 -0.0625,0.0312 c 0,0 -0.32587,0.29728 -0.65625,0.75 -0.22334,0.30605 -0.3527,0.8316 -0.5,1.3125 a 1.0001,1.0001 0 0 0 -0.03125,0.0312 1.0001,1.0001 0 0 0 -0.21875,0.5625 c -5.1e-4,0.0118 3.6e-4,0.0195 0,0.0312 a 1.0001,1.0001 0 0 0 0,0.0312 1.0001,1.0001 0 0 0 0,0.15625 l 0,7.84375 a 1.0001,1.0001 0 0 0 1,1 l 12,0 a 1.0001,1.0001 0 0 0 1,-1 l 0,-7.84375 a 1.0001,1.0001 0 0 0 0,-0.15625 1.0001,1.0001 0 0 0 -0.21875,-0.65625 1.0001,1.0001 0 0 0 -0.03125,-0.0312 c -0.32774,-1.18787 -1.125,-2 -1.125,-2 a 1.0001,1.0001 0 0 0 -0.0312,-0.0312 L 69.6252,297.25 a 1.0001,1.0001 0 0 0 -0.65625,-0.25 1.0001,1.0001 0 0 0 -0.0937,0 z m 0.125,2.28125 4.3125,3.53125 0.0312,0.0312 c 0.021,0.0255 0.18032,0.24952 0.34375,0.5 l -4.68745,3.53125 -4.6875,-3.53125 c 0.0259,-0.0394 0.0349,-0.0872 0.0625,-0.125 0.1908,-0.26146 0.31874,-0.41421 0.34375,-0.4375 l 0.03125,-0.0312 4.25,-3.46875 z m -5,5.09375 4.6875,3.53125 0.3125,0.21875 0.3125,-0.21875 4.6875,-3.53125 0,6.625 -10,0 0,-6.625 z' inkscape:connector-curvature='0'/> - </g> - <g id='layer10' inkscape:groupmode='layer' transform='translate(-60.99995,-296.9989)' inkscape:label='devices'/> - <g id='layer11' inkscape:groupmode='layer' transform='translate(-60.99995,-296.9989)' inkscape:label='apps'/> - <g id='layer13' inkscape:groupmode='layer' transform='translate(-60.99995,-296.9989)' inkscape:label='places'/> - <g id='layer14' inkscape:groupmode='layer' transform='translate(-60.99995,-296.9989)' inkscape:label='mimetypes'/> - <g id='layer15' inkscape:groupmode='layer' style='display:inline' transform='translate(-60.99995,-296.9989)' inkscape:label='emblems'/> - <g id='g71291' inkscape:groupmode='layer' style='display:inline' transform='translate(-60.99995,-296.9989)' inkscape:label='emotes'/> - <g id='g4953' inkscape:groupmode='layer' style='display:inline' transform='translate(-60.99995,-296.9989)' inkscape:label='categories'/> - <g id='layer12' inkscape:groupmode='layer' style='display:inline' transform='translate(-60.99995,-296.9989)' inkscape:label='actions'/> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16.001" width="16"> +<g transform="translate(-60.99995,-296.9989)"> +<path opacity="0.35" style="baseline-shift:baseline;block-progression:tb;color:#000000;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" fill="#bebebe" d="m68.875,297a1.0001,1.0001,0,0,0,-0.5,0.25l-4.9062,4a1.0001,1.0001,0,0,0,-0.0625,0.0312s-0.32587,0.29728-0.65625,0.75c-0.22334,0.30605-0.3527,0.8316-0.5,1.3125a1.0001,1.0001,0,0,0,-0.03125,0.0312,1.0001,1.0001,0,0,0,-0.21875,0.5625c-0.00051,0.0118,0.00036,0.0195,0,0.0312a1.0001,1.0001,0,0,0,0,0.0312,1.0001,1.0001,0,0,0,0,0.15625v7.8438a1.0001,1.0001,0,0,0,1,1h12a1.0001,1.0001,0,0,0,1,-1v-7.8438a1.0001,1.0001,0,0,0,0,-0.15625,1.0001,1.0001,0,0,0,-0.21875,-0.65625,1.0001,1.0001,0,0,0,-0.03125,-0.0312c-0.32774-1.1879-1.125-2-1.125-2a1.0001,1.0001,0,0,0,-0.0312,-0.0312l-4.969-4.02a1.0001,1.0001,0,0,0,-0.65625,-0.25,1.0001,1.0001,0,0,0,-0.0937,0zm0.125,2.2812,4.3125,3.5312,0.0312,0.0312c0.021,0.0255,0.18032,0.24952,0.34375,0.5l-4.6874,3.5312-4.6875-3.5312c0.0259-0.0394,0.0349-0.0872,0.0625-0.125,0.1908-0.26146,0.31874-0.41421,0.34375-0.4375l0.03125-0.0312,4.25-3.4688zm-5,5.0938,4.6875,3.5312,0.3125,0.21875,0.3125-0.21875,4.6875-3.5312,0,6.625-10,0,0-6.625z"/> +</g> +</svg>
\ 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 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:svg='http://www.w3.org/2000/svg' xmlns:cc='http://creativecommons.org/ns#' id='svg7384' sodipodi:docname='view-refresh-symbolic.svg' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' xmlns='http://www.w3.org/2000/svg' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' inkscape:version='0.48.1 r9760' version='1.1' width='16' height='16' xmlns:dc='http://purl.org/dc/elements/1.1/'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:zoom='1' inkscape:bbox-paths='false' inkscape:pageopacity='1' guidetolerance='10' inkscape:snap-bbox='true' inkscape:window-height='1162' objecttolerance='10' id='namedview88' showborder='false' inkscape:window-x='2191' inkscape:window-y='111' inkscape:cx='9.3351214' inkscape:cy='10.6119' gridtolerance='10' inkscape:snap-bbox-midpoints='false' showguides='true' inkscape:pageshadow='2' pagecolor='#555753' bordercolor='#666666' inkscape:snap-global='true' inkscape:window-maximized='0' inkscape:object-nodes='false' inkscape:snap-nodes='false' inkscape:guide-bbox='true' inkscape:window-width='1595' inkscape:snap-others='false' borderopacity='1' showgrid='false' inkscape:snap-to-guides='true' inkscape:object-paths='false' inkscape:snap-grids='true' inkscape:current-layer='layer12'> - <inkscape:grid enabled='true' spacingx='1px' spacingy='1px' id='grid4866' visible='true' snapvisiblegridlinesonly='true' empspacing='2' type='xygrid'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g id='layer9' transform='translate(-241.0002,-627)' inkscape:label='status' style='display:inline' inkscape:groupmode='layer'/> - <g id='layer10' transform='translate(-241.0002,-627)' inkscape:label='devices' inkscape:groupmode='layer'/> - <g id='layer11' transform='translate(-241.0002,-627)' inkscape:label='apps' inkscape:groupmode='layer'/> - <g id='layer13' transform='translate(-241.0002,-627)' inkscape:label='places' inkscape:groupmode='layer'/> - <g id='layer14' transform='translate(-241.0002,-627)' inkscape:label='mimetypes' inkscape:groupmode='layer'/> - <g id='layer15' transform='translate(-241.0002,-627)' inkscape:label='emblems' style='display:inline' inkscape:groupmode='layer'/> - <g id='g71291' transform='translate(-241.0002,-627)' inkscape:label='emotes' style='display:inline' inkscape:groupmode='layer'/> - <g id='g4953' transform='translate(-241.0002,-627)' inkscape:label='categories' style='display:inline' inkscape:groupmode='layer'/> - <g id='layer12' transform='translate(-241.0002,-627)' inkscape:label='actions' style='display:inline' inkscape:groupmode='layer'> - - <path id='path4597' d='m 253.90645,628.96875 a 1.0001,1.0001 0 0 0 -0.125,0.0312 1.0001,1.0001 0 0 0 -0.78125,1 l 0,1.6875 c -0.38225,-0.57796 -0.84927,-1.08223 -1.40625,-1.5 -1.15563,-0.86677 -2.53199,-1.25227 -3.875,-1.1875 -0.19186,0.009 -0.37223,0.0353 -0.5625,0.0625 -1.52218,0.21741 -2.97815,1.02304 -3.96875,2.34375 -1.98119,2.64144 -1.42267,6.42505 1.21875,8.40625 2.64147,1.98122 6.42504,1.42267 8.40625,-1.21875 A 1.0063276,1.0063276 0 0 0 253.0002,638 a 1.0063276,1.0063276 0 0 0 0,-0.15625 l 0,-0.84375 -0.8125,0 -0.0937,0 a 1.0063276,1.0063276 0 0 0 -0.0937,0 1.0063276,1.0063276 0 0 0 -0.8125,0.40625 c -1.33265,1.77674 -3.81702,2.11387 -5.59375,0.78125 -1.77674,-1.33264 -2.1139,-3.81699 -0.78125,-5.59375 1.33265,-1.77674 3.817,-2.11389 5.59375,-0.78125 0.42946,0.32212 0.76954,0.73295 1.03125,1.1875 l -1.4375,0 a 1.0001,1.0001 0 0 0 -1,1 1.0001,1.0001 0 0 0 0,0.21875 l 0,0.78125 0.84375,0 0.15625,0 4,0 1,0 0,-1 0,-4 a 1.0001,1.0001 0 0 0 0,-0.1875 l 0,-0.8125 -0.8125,0 a 1.0001,1.0001 0 0 0 -0.28125,-0.0312 z' style='font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#666666;fill:#666666;fill-opacity:1;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans' inkscape:connector-curvature='0'/> - </g> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-241.0002,-627)"> +<path style="baseline-shift:baseline;block-progression:tb;color:#666666;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" fill="#666" d="m253.91,628.97a1.0001,1.0001,0,0,0,-0.125,0.0312,1.0001,1.0001,0,0,0,-0.78125,1v1.6875c-0.38225-0.57796-0.84927-1.0822-1.4062-1.5-1.1556-0.86677-2.532-1.2523-3.875-1.1875-0.19186,0.009-0.37223,0.0353-0.5625,0.0625-1.5222,0.21741-2.9782,1.023-3.9688,2.3438-1.9812,2.6414-1.4227,6.425,1.2188,8.4062s6.425,1.4227,8.4062-1.2188a1.0063,1.0063,0,0,0,0.18,-0.59,1.0063,1.0063,0,0,0,0,-0.15625v-0.84375h-0.8125-0.0937a1.0063,1.0063,0,0,0,-0.0937,0,1.0063,1.0063,0,0,0,-0.8125,0.40625c-1.3326,1.7767-3.817,2.1139-5.5938,0.78125-1.7767-1.3326-2.1139-3.817-0.78125-5.5938,1.3326-1.7767,3.817-2.1139,5.5938-0.78125,0.42946,0.32212,0.76954,0.73295,1.0312,1.1875h-1.4375a1.0001,1.0001,0,0,0,-1,1,1.0001,1.0001,0,0,0,0,0.21875v0.78125h0.84375,0.15625,4,1v-1-4a1.0001,1.0001,0,0,0,0,-0.1875v-0.8125h-0.8125a1.0001,1.0001,0,0,0,-0.28125,-0.0312z"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/icons/rss.svg b/p/themes/icons/rss.svg index ceaddceee..2a8713be3 100644 --- a/p/themes/icons/rss.svg +++ b/p/themes/icons/rss.svg @@ -1,32 +1,6 @@ -<?xml version='1.0' encoding='UTF-8' standalone='no'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:dc='http://purl.org/dc/elements/1.1/' sodipodi:docname='application-rss+xml-symbolic.svg' height='16' id='svg7384' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' xmlns:svg='http://www.w3.org/2000/svg' inkscape:version='0.48.3.1 r9886' version='1.1' width='16' xmlns='http://www.w3.org/2000/svg'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:bbox-paths='false' bordercolor='#666666' borderopacity='1' inkscape:current-layer='layer14' inkscape:cx='27.01134' inkscape:cy='1.367038' gridtolerance='10' inkscape:guide-bbox='true' guidetolerance='10' id='namedview88' inkscape:object-nodes='false' inkscape:object-paths='false' objecttolerance='10' pagecolor='#3a3b39' inkscape:pageopacity='1' inkscape:pageshadow='2' showborder='false' showgrid='false' showguides='true' inkscape:snap-bbox='true' inkscape:snap-bbox-midpoints='false' inkscape:snap-global='true' inkscape:snap-grids='true' inkscape:snap-nodes='false' inkscape:snap-others='false' inkscape:snap-to-guides='true' inkscape:window-height='709' inkscape:window-maximized='1' inkscape:window-width='1366' inkscape:window-x='0' inkscape:window-y='27' inkscape:zoom='1'> - <inkscape:grid empspacing='2' enabled='true' id='grid4866' originx='-319.9998px' originy='84.00012px' snapvisiblegridlinesonly='true' spacingx='1px' spacingy='1px' type='xygrid' visible='true'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g inkscape:groupmode='layer' id='layer9' inkscape:label='status' style='display:inline' transform='translate(-561,-301.00012)'/> - <g inkscape:groupmode='layer' id='layer10' inkscape:label='devices' transform='translate(-561,-301.00012)'/> - <g inkscape:groupmode='layer' id='layer11' inkscape:label='apps' transform='translate(-561,-301.00012)'/> - <g inkscape:groupmode='layer' id='layer13' inkscape:label='places' transform='translate(-561,-301.00012)'/> - <g inkscape:groupmode='layer' id='layer14' inkscape:label='mimetypes' transform='translate(-561,-301.00012)'> - - <path sodipodi:cx='323.0625' sodipodi:cy='97.1875' d='m 325.0625,97.1875 a 2,3.236068 0 1 1 -4,0 2,3.236068 0 1 1 4,0 z' id='path4983' sodipodi:rx='2' sodipodi:ry='3.236068' style='color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.69602728;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new' transform='matrix(1.0000007,0,0,0.61803426,241.93747,252.93479)' sodipodi:type='arc'/> - <path inkscape:connector-curvature='0' d='m 563.0002,303 0,1 c 0,0.55016 0.45347,1 1,1 4.97056,0 9,4.02944 9,9 0,0.55016 0.45347,1 1,1 l 1,0 0,-1 c 0,-6.07513 -4.92487,-11 -11,-11 l -1,0 z m 0,4 0,1 c 0,0.55016 0.45347,1 1,1 2.76143,0 5,2.23857 5,5 0,0.55016 0.45347,1 1,1 l 1,0 0,-1 c 0,-3.866 -3.134,-7 -7,-7 l -1,0 z' id='path5814' style='color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.33333492;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new'/> - </g> - <g inkscape:groupmode='layer' id='layer15' inkscape:label='emblems' style='display:inline' transform='translate(-561,-301.00012)'/> - <g inkscape:groupmode='layer' id='g71291' inkscape:label='emotes' style='display:inline' transform='translate(-561,-301.00012)'/> - <g inkscape:groupmode='layer' id='g4953' inkscape:label='categories' style='display:inline' transform='translate(-561,-301.00012)'/> - <g inkscape:groupmode='layer' id='layer12' inkscape:label='actions' style='display:inline' transform='translate(-561,-301.00012)'/> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g fill-rule="nonzero" transform="translate(-561,-301.00012)" fill="#666"> +<path style="enable-background:new;color:#000000;" d="m325.06,97.188c0,1.7872-0.89543,3.2361-2,3.2361s-2-1.4488-2-3.2361c0-1.7872,0.89543-3.2361,2-3.2361s2,1.4488,2,3.2361z" transform="matrix(1.0000007,0,0,0.61803426,241.93747,252.93479)"/> +<path style="enable-background:new;color:#000000;" d="m563,303,0,1c0,0.55016,0.45347,1,1,1,4.9706,0,9,4.0294,9,9,0,0.55016,0.45347,1,1,1h1v-1c0-6.0751-4.9249-11-11-11h-1zm0,4,0,1c0,0.55016,0.45347,1,1,1,2.7614,0,5,2.2386,5,5,0,0.55016,0.45347,1,1,1h1v-1c0-3.866-3.134-7-7-7h-1z"/> +</g> +</svg>
\ 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 @@ -<?xml version='1.0' encoding='UTF-8' standalone='no'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:dc='http://purl.org/dc/elements/1.1/' sodipodi:docname='folder-saved-search-symbolic.svg' height='16' id='svg7384' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' xmlns:svg='http://www.w3.org/2000/svg' inkscape:version='0.48.2 r9819' version='1.1' width='16.000002' xmlns='http://www.w3.org/2000/svg'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:bbox-paths='false' bordercolor='#666666' borderopacity='1' inkscape:current-layer='layer13' inkscape:cx='-151.02446' inkscape:cy='0.353386' gridtolerance='10' inkscape:guide-bbox='true' guidetolerance='10' id='namedview88' inkscape:object-nodes='false' inkscape:object-paths='false' objecttolerance='10' pagecolor='#555753' inkscape:pageopacity='1' inkscape:pageshadow='2' showborder='false' showgrid='false' showguides='true' inkscape:snap-bbox='true' inkscape:snap-bbox-midpoints='false' inkscape:snap-global='true' inkscape:snap-grids='true' inkscape:snap-nodes='false' inkscape:snap-others='false' inkscape:snap-to-guides='true' inkscape:window-height='1168' inkscape:window-maximized='1' inkscape:window-width='1600' inkscape:window-x='0' inkscape:window-y='0' inkscape:zoom='1'> - <inkscape:grid empspacing='2' enabled='true' id='grid4866' snapvisiblegridlinesonly='true' spacingx='1px' spacingy='1px' type='xygrid' visible='true'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g inkscape:groupmode='layer' id='layer9' inkscape:label='status' style='display:inline' transform='translate(-441.0004,-195)'/> - <g inkscape:groupmode='layer' id='layer10' inkscape:label='devices' transform='translate(-441.0004,-195)'/> - <g inkscape:groupmode='layer' id='layer11' inkscape:label='apps' transform='translate(-441.0004,-195)'/> - <g inkscape:groupmode='layer' id='layer13' inkscape:label='places' transform='translate(-441.0004,-195)'> - <path inkscape:connector-curvature='0' d='m 447.50781,195.99554 c -3.02886,0 -5.51073,2.47905 -5.51073,5.50447 0,3.02541 2.48187,5.50446 5.51073,5.50446 3.02885,0 5.51072,-2.47905 5.51072,-5.50446 0,-3.02542 -2.48187,-5.50447 -5.51072,-5.50447 z m 0,2.00893 c 1.94735,0 3.49951,1.55039 3.49951,3.49554 0,1.94514 -1.55216,3.49553 -3.49951,3.49553 -1.94736,0 -3.49952,-1.55039 -3.49952,-3.49553 0,-1.94515 1.55216,-3.49554 3.49952,-3.49554 z' id='path5079' style='font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#666666;fill:#666666;fill-opacity:1;stroke:none;stroke-width:1.55467153;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new;font-family:Sans;-inkscape-font-specification:Sans'/> - <path inkscape:connector-curvature='0' d='m 450.8125,204 a 1.0001,1.0001 0 0 0 -0.5,1.71875 l 4,4 a 1.0054782,1.0054782 0 1 0 1.40625,-1.4375 l -4,-4 A 1.0001,1.0001 0 0 0 450.8125,204 z' id='path5081' style='font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#666666;fill:#666666;fill-opacity:1;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new;font-family:Sans;-inkscape-font-specification:Sans'/> - - </g> - <g inkscape:groupmode='layer' id='layer14' inkscape:label='mimetypes' transform='translate(-441.0004,-195)'/> - <g inkscape:groupmode='layer' id='layer15' inkscape:label='emblems' style='display:inline' transform='translate(-441.0004,-195)'/> - <g inkscape:groupmode='layer' id='g71291' inkscape:label='emotes' style='display:inline' transform='translate(-441.0004,-195)'/> - <g inkscape:groupmode='layer' id='g4953' inkscape:label='categories' style='display:inline' transform='translate(-441.0004,-195)'/> - <g inkscape:groupmode='layer' id='layer12' inkscape:label='actions' style='display:inline' transform='translate(-441.0004,-195)'/> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g fill="#666" transform="translate(-441.0004,-195)"> +<path style="baseline-shift:baseline;block-progression:tb;color:#666666;direction:ltr;text-indent:0;text-align:start;enable-background:new;text-transform:none;" d="m447.51,196c-3.0289,0-5.5107,2.479-5.5107,5.5045,0,3.0254,2.4819,5.5045,5.5107,5.5045s5.5107-2.479,5.5107-5.5045c0-3.0254-2.4819-5.5045-5.5107-5.5045zm0,2.0089c1.9474,0,3.4995,1.5504,3.4995,3.4955s-1.5522,3.4955-3.4995,3.4955c-1.9474,0-3.4995-1.5504-3.4995-3.4955,0-1.9452,1.5522-3.4955,3.4995-3.4955z"/> +<path style="baseline-shift:baseline;block-progression:tb;color:#666666;direction:ltr;text-indent:0;text-align:start;enable-background:new;text-transform:none;" d="m450.81,204a1.0001,1.0001,0,0,0,-0.5,1.7188l4,4a1.0055,1.0055,0,1,0,1.4062,-1.4375l-4-4a1.0001,1.0001,0,0,0,-0.91,-0.28z"/> +</g> +</svg>
\ 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 @@ -<?xml version='1.0' encoding='UTF-8' standalone='no'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:dc='http://purl.org/dc/elements/1.1/' sodipodi:docname='folder-publicshare-symbolic.svg' height='16' id='svg7384' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' xmlns:svg='http://www.w3.org/2000/svg' inkscape:version='0.48.3.1 r9886' version='1.1' width='16' xmlns='http://www.w3.org/2000/svg'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:bbox-paths='false' bordercolor='#666666' borderopacity='1' inkscape:current-layer='layer13' inkscape:cx='-55.50224' inkscape:cy='-178.38158' gridtolerance='10' inkscape:guide-bbox='true' guidetolerance='10' id='namedview88' inkscape:object-nodes='false' inkscape:object-paths='false' objecttolerance='10' pagecolor='#3a3b39' inkscape:pageopacity='1' inkscape:pageshadow='2' showborder='false' showgrid='false' showguides='true' inkscape:snap-bbox='true' inkscape:snap-bbox-midpoints='false' inkscape:snap-global='true' inkscape:snap-grids='true' inkscape:snap-nodes='false' inkscape:snap-others='false' inkscape:snap-to-guides='true' inkscape:window-height='1381' inkscape:window-maximized='1' inkscape:window-width='2560' inkscape:window-x='1600' inkscape:window-y='27' inkscape:zoom='1'> - <inkscape:grid empspacing='2' enabled='true' id='grid4866' originx='-340px' originy='-20.999999px' snapvisiblegridlinesonly='true' spacingx='1px' spacingy='1px' type='xygrid' visible='true'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g inkscape:groupmode='layer' id='layer9' inkscape:label='status' style='display:inline' transform='translate(-581.0002,-196)'/> - <g inkscape:groupmode='layer' id='layer10' inkscape:label='devices' transform='translate(-581.0002,-196)'/> - <g inkscape:groupmode='layer' id='layer11' inkscape:label='apps' transform='translate(-581.0002,-196)'/> - <g inkscape:groupmode='layer' id='layer13' inkscape:label='places' transform='translate(-581.0002,-196)'> - - <path sodipodi:cx='289.03125' sodipodi:cy='178.03125' d='m 291,178.03125 a 1.96875,1.96875 0 1 1 -3.9375,0 1.96875,1.96875 0 1 1 3.9375,0 z' id='path8192' sodipodi:rx='1.96875' sodipodi:ry='1.96875' style='color:#000000;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.99999994;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new' transform='matrix(1.5079365,0,0,1.5079365,148.15963,-64.49107)' sodipodi:type='arc'/> - <path sodipodi:cx='289.03125' sodipodi:cy='178.03125' d='m 291,178.03125 a 1.96875,1.96875 0 1 1 -3.9375,0 1.96875,1.96875 0 1 1 3.9375,0 z' id='path8194' sodipodi:rx='1.96875' sodipodi:ry='1.96875' style='color:#000000;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.99999994;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new' transform='matrix(1.5079365,0,0,1.5079365,158.12818,-59.49107)' sodipodi:type='arc'/> - <path sodipodi:cx='289.03125' sodipodi:cy='178.03125' d='m 291,178.03125 a 1.96875,1.96875 0 1 1 -3.9375,0 1.96875,1.96875 0 1 1 3.9375,0 z' id='path8196' sodipodi:rx='1.96875' sodipodi:ry='1.96875' style='color:#000000;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.99999994;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new' transform='matrix(1.5079365,0,0,1.5079365,158.12818,-69.49107)' sodipodi:type='arc'/> - <path inkscape:connector-curvature='0' d='m 593.625,198.15625 -10.0625,4.875 -1.8125,0.90625 1.8125,0.90625 10.03125,5.0625 0.90625,-1.8125 -8.21875,-4.15625 8.21875,-4 -0.875,-1.78125 z' id='path8198' style='font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#bebebe;fill-opacity:1;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans'/> - </g> - <g inkscape:groupmode='layer' id='layer14' inkscape:label='mimetypes' transform='translate(-581.0002,-196)'/> - <g inkscape:groupmode='layer' id='layer15' inkscape:label='emblems' style='display:inline' transform='translate(-581.0002,-196)'/> - <g inkscape:groupmode='layer' id='g71291' inkscape:label='emotes' style='display:inline' transform='translate(-581.0002,-196)'/> - <g inkscape:groupmode='layer' id='g4953' inkscape:label='categories' style='display:inline' transform='translate(-581.0002,-196)'/> - <g inkscape:groupmode='layer' id='layer12' inkscape:label='actions' style='display:inline' transform='translate(-581.0002,-196)'/> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g fill="#bebebe" transform="translate(-581.0002,-196)"> +<path style="enable-background:new;color:#000000;" d="m291,178.03c0,1.0873-0.88144,1.9688-1.9688,1.9688-1.0873,0-1.9688-0.88144-1.9688-1.9688,0-1.0873,0.88144-1.9688,1.9688-1.9688,1.0873,0,1.9688,0.88144,1.9688,1.9688z" fill-rule="nonzero" transform="matrix(1.5079365,0,0,1.5079365,148.15963,-64.49107)"/> +<path style="enable-background:new;color:#000000;" d="m291,178.03c0,1.0873-0.88144,1.9688-1.9688,1.9688-1.0873,0-1.9688-0.88144-1.9688-1.9688,0-1.0873,0.88144-1.9688,1.9688-1.9688,1.0873,0,1.9688,0.88144,1.9688,1.9688z" fill-rule="nonzero" transform="matrix(1.5079365,0,0,1.5079365,158.12818,-59.49107)"/> +<path style="enable-background:new;color:#000000;" d="m291,178.03c0,1.0873-0.88144,1.9688-1.9688,1.9688-1.0873,0-1.9688-0.88144-1.9688-1.9688,0-1.0873,0.88144-1.9688,1.9688-1.9688,1.0873,0,1.9688,0.88144,1.9688,1.9688z" fill-rule="nonzero" transform="matrix(1.5079365,0,0,1.5079365,158.12818,-69.49107)"/> +<path style="baseline-shift:baseline;block-progression:tb;color:#000000;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" d="m593.62,198.16-10.062,4.875-1.8125,0.90625,1.8125,0.90625,10.031,5.0625,0.90625-1.8125-8.2188-4.1562,8.2188-4-0.875-1.7812z"/> +</g> +</svg>
\ 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 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:svg='http://www.w3.org/2000/svg' id='svg7384' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' sodipodi:docname='starred-symbolic.svg' version='1.1' inkscape:version='0.48.1 r9760' height='16' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns='http://www.w3.org/2000/svg' width='16'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:cy='0.50817' pagecolor='#555753' borderopacity='1' showborder='false' inkscape:bbox-paths='false' guidetolerance='10' inkscape:object-paths='true' inkscape:window-width='1457' showguides='true' inkscape:object-nodes='true' inkscape:snap-bbox='true' inkscape:pageshadow='2' inkscape:guide-bbox='true' inkscape:snap-nodes='false' bordercolor='#666666' objecttolerance='10' id='namedview88' showgrid='false' inkscape:window-maximized='0' inkscape:window-x='86' inkscape:snap-global='true' inkscape:window-y='51' gridtolerance='10' inkscape:window-height='1093' inkscape:snap-to-guides='true' inkscape:current-layer='layer9' inkscape:snap-bbox-midpoints='false' inkscape:zoom='1' inkscape:cx='19.029058' inkscape:snap-grids='true' inkscape:pageopacity='1'> - <inkscape:grid spacingx='1px' spacingy='1px' id='grid4866' empspacing='2' enabled='true' type='xygrid' snapvisiblegridlinesonly='true' visible='true'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g inkscape:label='status' transform='translate(-41.000202,-397)' inkscape:groupmode='layer' id='layer9' style='display:inline'> - <g inkscape:label='folder-remote' transform='translate(-186.9996,-599)' id='g11910-1'> - - </g> - <path sodipodi:cy='180.96373' sodipodi:r2='3.8276224' transform='matrix(1.0472113,-0.00871584,0.00871584,1.0472113,-504.35434,220.15425)' inkscape:rounded='0.2104596' inkscape:flatsided='false' inkscape:transform-center-x='-0.0094346789' inkscape:transform-center-y='-0.69491065' d='m 530.9488,186.70897 c -0.77941,0.55189 -3.15759,-1.90601 -4.11253,-1.9179 -0.95532,-0.0119 -3.39494,2.38585 -4.16096,1.8149 -0.76573,-0.57072 0.83698,-3.59203 0.55319,-4.50391 -0.2839,-0.91223 -3.31818,-2.49151 -3.01189,-3.39647 0.30617,-0.90461 3.67487,-0.31399 4.45442,-0.86567 0.77986,-0.5519 1.3442,-3.92569 2.29952,-3.91404 0.95494,0.0116 1.43421,3.39798 2.19979,3.9689 0.76588,0.57114 4.14893,0.0653 4.43307,0.97746 0.28402,0.9118 -2.78848,2.41405 -3.09488,3.31858 -0.30652,0.90489 1.21999,3.96605 0.44027,4.51815 z' id='path11922-0' sodipodi:type='star' sodipodi:arg1='0.95492637' sodipodi:r1='7.0383992' style='color:#000000;fill:#f1c40f;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate' sodipodi:arg2='1.5829876' inkscape:randomized='0' sodipodi:cx='526.88293' sodipodi:sides='5'/> - </g> - <g inkscape:label='devices' transform='translate(-41.000202,-397)' inkscape:groupmode='layer' id='layer10'/> - <g inkscape:label='apps' transform='translate(-41.000202,-397)' inkscape:groupmode='layer' id='layer11'/> - <g inkscape:label='actions' transform='translate(-41.000202,-397)' inkscape:groupmode='layer' id='layer12'/> - <g inkscape:label='places' transform='translate(-41.000202,-397)' inkscape:groupmode='layer' id='layer13'/> - <g inkscape:label='mimetypes' transform='translate(-41.000202,-397)' inkscape:groupmode='layer' id='layer14'/> - <g inkscape:label='emblems' transform='translate(-41.000202,-397)' inkscape:groupmode='layer' id='layer15' style='display:inline'/> - <g inkscape:label='categories' transform='translate(-41.000202,-397)' inkscape:groupmode='layer' id='g4953' style='display:inline'/> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-41.000202,-397)"> +<path style="enable-background:accumulate;color:#000000;" d="m530.95,186.71c-0.77941,0.55189-3.1576-1.906-4.1125-1.9179-0.95532-0.0119-3.3949,2.3858-4.161,1.8149-0.76573-0.57072,0.83698-3.592,0.55319-4.5039-0.2839-0.91223-3.3182-2.4915-3.0119-3.3965,0.30617-0.90461,3.6749-0.31399,4.4544-0.86567,0.77986-0.5519,1.3442-3.9257,2.2995-3.914,0.95494,0.0116,1.4342,3.398,2.1998,3.9689,0.76588,0.57114,4.1489,0.0653,4.4331,0.97746,0.28402,0.9118-2.7885,2.414-3.0949,3.3186-0.30652,0.90489,1.22,3.966,0.44027,4.5182z" fill-rule="nonzero" transform="matrix(1.0472113,-0.00871584,0.00871584,1.0472113,-504.35434,220.15425)" fill="#f1c40f"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/icons/stats.svg b/p/themes/icons/stats.svg new file mode 100644 index 000000000..90a23215f --- /dev/null +++ b/p/themes/icons/stats.svg @@ -0,0 +1,6 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-142,-490)" fill="#bebebe"> +<path style="block-progression:tb;color:#bebebe;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" d="M144.19,490c-1.21,0-2.19,1.02-2.19,2.22v10.562c0,1.2008,0.98238,2.2188,2.1875,2.2188h11.625c1.2051,0,2.1875-1.0179,2.1875-2.2188v-10.562c-0.01-1.2-0.99-2.22-2.2-2.22h-11.625zm0,2,11.625,0c0.12026,0,0.1875,0.08,0.1875,0.21875v10.562c-0.01,0.14-0.08,0.22-0.2,0.22h-11.625c-0.12026,0-0.1875-0.08-0.1875-0.21875v-10.562c0.01-0.14,0.08-0.22,0.2-0.22z"/> +<path style="block-progression:tb;color:#000000;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" d="m151.31,493.97a0.50005,0.50005,0,0,0,-0.34375,0.34375l-1.6875,6.0938-0.875-1.1875a0.50005,0.50005,0,0,0,-0.4,-0.21h-2.5-0.5v1h0.5,2.25l1.3125,1.7812a0.50005,0.50005,0,0,0,0.875,-0.15625l1.5312-5.4375,1.0625,3.4688a0.50005,0.50005,0,0,0,0.47,0.35h1.5,0.5v-1h-0.5-1.125l-1.4375-4.6875a0.50005,0.50005,0,0,0,-0.625,-0.34375z"/> +</g> +</svg> 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 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - sodipodi:docname="tag.svg" - height="16" - id="svg7384" - inkscape:version="0.48.4 r9939" - version="1.1" - width="16"> - <metadata - id="metadata90"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview - inkscape:bbox-paths="false" - bordercolor="#666666" - borderopacity="1" - inkscape:current-layer="layer12" - inkscape:cx="63.620645" - inkscape:cy="27.761176" - gridtolerance="10" - inkscape:guide-bbox="true" - guidetolerance="10" - id="namedview88" - inkscape:object-nodes="false" - inkscape:object-paths="false" - objecttolerance="10" - pagecolor="#555753" - inkscape:pageopacity="1" - inkscape:pageshadow="2" - showborder="false" - showgrid="false" - showguides="true" - inkscape:snap-bbox="true" - inkscape:snap-bbox-midpoints="false" - inkscape:snap-global="true" - inkscape:snap-grids="true" - inkscape:snap-nodes="false" - inkscape:snap-others="false" - inkscape:snap-to-guides="true" - inkscape:window-height="709" - inkscape:window-maximized="1" - inkscape:window-width="1366" - inkscape:window-x="0" - inkscape:window-y="27" - inkscape:zoom="4"> - <inkscape:grid - empspacing="2" - enabled="true" - id="grid4866" - snapvisiblegridlinesonly="true" - spacingx="1px" - spacingy="1px" - type="xygrid" - visible="true" /> - </sodipodi:namedview> - <title - id="title9167">Gnome Symbolic Icon Theme</title> - <defs - id="defs7386" /> - <g - inkscape:groupmode="layer" - id="layer9" - inkscape:label="status" - style="display:inline" - transform="translate(-141.0002,-807)" /> - <g - inkscape:groupmode="layer" - id="layer10" - inkscape:label="devices" - transform="translate(-141.0002,-807)" /> - <g - inkscape:groupmode="layer" - id="layer11" - inkscape:label="apps" - transform="translate(-141.0002,-807)" /> - <g - inkscape:groupmode="layer" - id="layer13" - inkscape:label="places" - transform="translate(-141.0002,-807)" /> - <g - inkscape:groupmode="layer" - id="layer14" - inkscape:label="mimetypes" - transform="translate(-141.0002,-807)" /> - <g - inkscape:groupmode="layer" - id="layer15" - inkscape:label="emblems" - style="display:inline" - transform="translate(-141.0002,-807)" /> - <g - inkscape:groupmode="layer" - id="g71291" - inkscape:label="emotes" - style="display:inline" - transform="translate(-141.0002,-807)" /> - <g - inkscape:groupmode="layer" - id="g4953" - inkscape:label="categories" - style="display:inline" - transform="translate(-141.0002,-807)" /> - <g - inkscape:groupmode="layer" - id="layer12" - inkscape:label="actions" - style="display:inline" - transform="translate(-141.0002,-807)"> - <path - inkscape:connector-curvature="0" - d="m 149.0002,809 0,13 4,-4 4,4 c 0.0525,-6.84943 -0.0285,-10.58353 0,-13 z" - id="path12292" - sodipodi:nodetypes="cccccc" - style="fill:#bebebe;fill-opacity:1;stroke:none" /> - </g> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-141.0002,-807)"> +<path d="m149,809,0,13,4-4,4,4c0.0525-6.8494-0.0285-10.584,0-13z" fill="#bebebe"/> +</g> +</svg>
\ 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 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:svg='http://www.w3.org/2000/svg' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' id='svg7384' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' version='1.1' inkscape:version='0.47 r22583' height='16' sodipodi:docname='mail-unread-symbolic.svg' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns='http://www.w3.org/2000/svg' width='16'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:cy='-166.8292' inkscape:current-layer='layer9' inkscape:window-width='1310' pagecolor='#555753' showborder='false' showguides='true' inkscape:snap-nodes='true' objecttolerance='10' showgrid='false' inkscape:object-nodes='true' inkscape:pageshadow='2' inkscape:guide-bbox='true' inkscape:window-x='54' inkscape:snap-bbox='true' bordercolor='#666666' id='namedview88' inkscape:window-maximized='0' inkscape:snap-global='true' inkscape:window-y='25' gridtolerance='10' inkscape:zoom='1' inkscape:window-height='690' borderopacity='1' guidetolerance='10' inkscape:cx='315.82499' inkscape:bbox-paths='false' inkscape:snap-grids='true' inkscape:pageopacity='1' inkscape:snap-to-guides='true'> - <inkscape:grid visible='true' spacingx='1px' type='xygrid' spacingy='1px' id='grid4866' empspacing='2' enabled='true' snapvisiblegridlinesonly='true'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g transform='translate(-40.99995,-297)' inkscape:groupmode='layer' id='layer9' inkscape:label='status' style='display:inline'> - - <path d='m 43.78125,301 a 1.0000999,1.0000999 0 0 0 -0.40625,1.78125 l 5,4 0.625,0.5 0.625,-0.5 5,-4 a 1.0004882,1.0004882 0 1 0 -1.25,-1.5625 l -4.375,3.5 -4.375,-3.5 A 1.0000999,1.0000999 0 0 0 43.78125,301 z' id='path35600' style='font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;color:#000000;fill:#e74c3c;fill-opacity:1;stroke:none;stroke-width:1.99999976;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans'/> - <path d='M 42.90625,300 A 1.0001,1.0001 0 0 0 42,301 l 0,9 a 1.0001,1.0001 0 0 0 1,1 l 12,0 a 1.0001,1.0001 0 0 0 1,-1 l 0,-9 a 1.0001,1.0001 0 0 0 -1,-1 l -12,0 a 1.0001,1.0001 0 0 0 -0.09375,0 z M 44,302 l 10,0 0,7 -10,0 0,-7 z' id='rect35604' style='font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;color:#000000;fill:#e74c3c;fill-opacity:1;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans'/> - </g> - <g transform='translate(-40.99995,-297)' inkscape:groupmode='layer' id='layer10' inkscape:label='devices'/> - <g transform='translate(-40.99995,-297)' inkscape:groupmode='layer' id='layer11' inkscape:label='apps'/> - <g transform='translate(-40.99995,-297)' inkscape:groupmode='layer' id='layer12' inkscape:label='actions'/> - <g transform='translate(-40.99995,-297)' inkscape:groupmode='layer' id='layer13' inkscape:label='places'/> - <g transform='translate(-40.99995,-297)' inkscape:groupmode='layer' id='layer14' inkscape:label='mimetypes'/> - <g transform='translate(-40.99995,-297)' inkscape:groupmode='layer' id='layer15' inkscape:label='emblems' style='display:inline'/> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-40.99995,-297)" fill="#e74c3c"> +<path style="block-progression:tb;color:#000000;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" d="m43.781,301a1.0001,1.0001,0,0,0,-0.40625,1.7812l5,4,0.625,0.5,0.625-0.5,5-4a1.0005,1.0005,0,1,0,-1.25,-1.5625l-4.375,3.5-4.375-3.5a1.0001,1.0001,0,0,0,-0.844,-0.22z"/> +<path style="block-progression:tb;color:#000000;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" d="M42.906,300a1.0001,1.0001,0,0,0,-0.906,1v9a1.0001,1.0001,0,0,0,1,1h12a1.0001,1.0001,0,0,0,1,-1v-9a1.0001,1.0001,0,0,0,-1,-1h-12a1.0001,1.0001,0,0,0,-0.09375,0zm1.094,2h10v7h-10v-7z"/> +</g> +</svg>
\ 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 @@ -<?xml version='1.0' encoding='UTF-8' standalone='no'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:dc='http://purl.org/dc/elements/1.1/' sodipodi:docname='go-up-symbolic.svg' height='16' id='svg7384' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' xmlns:svg='http://www.w3.org/2000/svg' inkscape:version='0.48.4 r9939' version='1.1' width='16' xmlns='http://www.w3.org/2000/svg'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:bbox-nodes='false' inkscape:bbox-paths='true' bordercolor='#666666' borderopacity='1' inkscape:current-layer='layer12' inkscape:cx='-1.351226' inkscape:cy='9.99302' gridtolerance='10' inkscape:guide-bbox='true' guidetolerance='10' id='namedview88' inkscape:object-nodes='false' inkscape:object-paths='false' objecttolerance='10' pagecolor='#3a3b39' inkscape:pageopacity='1' inkscape:pageshadow='2' showborder='false' showgrid='false' showguides='true' inkscape:snap-bbox='true' inkscape:snap-bbox-midpoints='false' inkscape:snap-global='true' inkscape:snap-grids='true' inkscape:snap-nodes='false' inkscape:snap-others='false' inkscape:snap-to-guides='true' inkscape:window-height='1408' inkscape:window-maximized='1' inkscape:window-width='2560' inkscape:window-x='0' inkscape:window-y='0' inkscape:zoom='1'> - <inkscape:grid empspacing='2' enabled='true' id='grid4866' originx='40px' originy='530px' snapvisiblegridlinesonly='true' spacingx='1px' spacingy='1px' type='xygrid' visible='true'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g inkscape:groupmode='layer' id='layer9' inkscape:label='status' style='display:inline' transform='translate(-201.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer10' inkscape:label='devices' transform='translate(-201.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer11' inkscape:label='apps' transform='translate(-201.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer13' inkscape:label='places' transform='translate(-201.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer14' inkscape:label='mimetypes' transform='translate(-201.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer15' inkscape:label='emblems' style='display:inline' transform='translate(-201.0002,-747)'/> - <g inkscape:groupmode='layer' id='g71291' inkscape:label='emotes' style='display:inline' transform='translate(-201.0002,-747)'/> - <g inkscape:groupmode='layer' id='g4953' inkscape:label='categories' style='display:inline' transform='translate(-201.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer12' inkscape:label='actions' style='display:inline' transform='translate(-201.0002,-747)'> - - <path inkscape:connector-curvature='0' d='m 215.03152,758.99677 0,-1.00001 c -9.1e-4,-0.0111 5.9e-4,-0.021 -9e-5,-0.0312 -0.0112,-0.25496 -0.12835,-0.50994 -0.31251,-0.6875 l -5.71875,-6.29767 -5.71875,6.29773 c -0.18821,0.1881 -0.28121,0.45346 -0.28122,0.71875 l 0,1.00001 1,0 c 0.26531,-7e-5 0.53059,-0.0931 0.71873,-0.28131 l 4.28125,-4.82896 4.28127,4.82896 c 0.19464,0.21073 0.46925,0.30315 0.74998,0.2813 z' id='path10839-9-9-5-9-1-0' sodipodi:nodetypes='ccsccccccccccc' style='font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;color:#bebebe;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.78124988;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new;font-family:Andale Mono;-inkscape-font-specification:Andale Mono'/> - </g> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-201.0002,-747)"> +<path style="block-progression:tb;color:#bebebe;direction:ltr;text-indent:0;text-align:start;enable-background:new;text-transform:none;" d="m215.03,759,0-1c-0.00091-0.0111,0.00059-0.021-0.00009-0.0312-0.0112-0.25496-0.12835-0.50994-0.31251-0.6875l-5.7188-6.2977-5.7188,6.2977c-0.18821,0.1881-0.28121,0.45346-0.28122,0.71875v1h1c0.26531-0.00007,0.53059-0.0931,0.71873-0.28131l4.2812-4.829,4.2813,4.829c0.19464,0.21073,0.46925,0.30315,0.74998,0.2813z" fill-rule="nonzero" fill="#bebebe"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/icons/view-global.svg b/p/themes/icons/view-global.svg new file mode 100644 index 000000000..d81e79790 --- /dev/null +++ b/p/themes/icons/view-global.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><g transform="translate(-61-867)" fill="#666" color="#000"><rect height="2" rx=".385" ry=".379" width="2" x="64" y="870"/><rect height="2" rx=".385" ry=".379" width="2" x="68" y="870"/><rect height="2" rx=".385" ry=".379" width="2" x="72" y="870"/><rect height="2" rx=".385" ry=".379" width="2" x="64" y="874.02"/><rect height="2" rx=".385" ry=".379" width="2" x="68" y="874.02"/><rect height="2" rx=".385" ry=".379" width="2" x="72" y="874.02"/><rect height="2" rx=".385" ry=".379" width="2" x="64" y="878"/><rect height="2" rx=".385" ry=".379" width="2" x="68" y="878"/><rect height="2" rx=".385" ry=".379" width="2" x="72" y="878"/></g></svg>
\ No newline at end of file diff --git a/p/themes/icons/view-normal.svg b/p/themes/icons/view-normal.svg new file mode 100644 index 000000000..c35b101df --- /dev/null +++ b/p/themes/icons/view-normal.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><g transform="translate(-40-746)" fill="#666" color="#666"><path d="m43 749h10v2h-10z"/><path d="m43 753h10v2h-10z"/><path d="m43 757h10v2h-10z"/></g></svg>
\ No newline at end of file diff --git a/p/themes/icons/view-reader.svg b/p/themes/icons/view-reader.svg new file mode 100644 index 000000000..3243aed6e --- /dev/null +++ b/p/themes/icons/view-reader.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><g transform="translate(-181-867)" fill="#666" color="#666"><path d="m 181,868 0,1 0,11 0,1 1,0 5,0 c 0.1754,0 0.52538,0.15166 0.8125,0.34375 0.28712,0.19209 0.46875,0.375 0.46875,0.375 L 189,882.4375 l 0.71875,-0.75 c 0,0 0.8963,-0.6875 1.28125,-0.6875 l 5,0 1,0 0,-1 0,-11 0,-1 -1,0 -5,0 c -0.87652,0 -1.56017,0.34756 -2.03125,0.6875 -0.0301,-0.0207 -0.031,-0.0105 -0.0625,-0.0312 C 188.44557,868.35254 187.82811,868 187,868 l -5,0 -1,0 z m 2,2 4,0 c 0.13821,0 0.51476,0.14746 0.8125,0.34375 0.29774,0.19629 0.5,0.375 0.5,0.375 l 0.71875,0.6875 0.6875,-0.71875 c 0,0 0.89975,-0.6875 1.28125,-0.6875 l 4,0 0,9 -4,0 c -0.87693,0 -1.56008,0.34735 -2.03125,0.6875 -0.0196,-0.0135 -0.011,-0.0177 -0.0312,-0.0312 C 188.47725,879.34834 187.83512,879 187,879 l -4,0 0,-9 z"/><g transform="scale(-1 1)"><rect height="2" rx=".375" width="3" x="-187" y="872"/><rect height="2" rx=".375" width="3" x="-187" y="875"/><rect height="2" rx=".375" width="3" x="-194" y="872"/><rect height="2" rx=".375" width="3" x="-194" y="875"/></g></g></svg>
\ No newline at end of file |
