From: Jeremy Benoist Date: Sat, 19 Nov 2016 14:30:49 +0000 (+0100) Subject: Merge remote-tracking branch 'origin/master' into 2.2 X-Git-Tag: 2.2.0~3^2~61 X-Git-Url: https://git.immae.eu/?p=github%2Fwallabag%2Fwallabag.git;a=commitdiff_plain;h=68003139e133835805b143b62c4407f19b495dab;hp=cb1a6590c0e58c56d0612066501b3a586b103ed5 Merge remote-tracking branch 'origin/master' into 2.2 # Conflicts: # .editorconfig # docs/de/index.rst # docs/de/user/import.rst # docs/en/index.rst # docs/en/user/configuration.rst # docs/en/user/import.rst # docs/fr/index.rst # docs/fr/user/import.rst # src/Wallabag/CoreBundle/Command/InstallCommand.php # src/Wallabag/CoreBundle/Resources/translations/messages.da.yml # src/Wallabag/CoreBundle/Resources/translations/messages.de.yml # src/Wallabag/CoreBundle/Resources/translations/messages.en.yml # src/Wallabag/CoreBundle/Resources/translations/messages.es.yml # src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml # src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml # src/Wallabag/CoreBundle/Resources/translations/messages.it.yml # src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml # src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml # src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml # src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml # src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml # src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig # web/bundles/wallabagcore/themes/baggy/css/style.min.css # web/bundles/wallabagcore/themes/baggy/js/baggy.min.js # web/bundles/wallabagcore/themes/material/css/style.min.css # web/bundles/wallabagcore/themes/material/js/material.min.js --- diff --git a/.editorconfig b/.editorconfig index d4ef7349..92c9a4c3 100644 --- a/.editorconfig +++ b/.editorconfig @@ -9,6 +9,6 @@ indent_size = 4 trim_trailing_whitespace = true insert_final_newline = true -[*.css] +[*.{js,css}] indent_style = space indent_size = 2 diff --git a/.eslintrc.json b/.eslintrc.json index 1137e2fc..3aee614f 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -2,7 +2,11 @@ "extends": "airbnb-base", "parser": "babel-eslint", "env": { - "browser": true + "browser": true, + "es6": true + }, + "globals": { + "Routing": true }, "rules": { "import/no-extraneous-dependencies": ["error", {"devDependencies": true, "optionalDependencies": true, "peerDependencies": true}] diff --git a/.gitignore b/.gitignore index 32b0fbbb..84fb95d7 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,8 @@ web/uploads/ !web/bundles web/bundles/* !web/bundles/wallabagcore +/web/assets/images/* +!web/assets/images/.gitkeep # Build /app/build @@ -34,7 +36,6 @@ web/bundles/* /composer.phar # Data for wallabag -data/assets/* data/db/wallabag*.sqlite # Docker container logs and data diff --git a/app/AppKernel.php b/app/AppKernel.php index 52f85558..81b83ef9 100644 --- a/app/AppKernel.php +++ b/app/AppKernel.php @@ -29,8 +29,8 @@ class AppKernel extends Kernel new KPhoen\RulerZBundle\KPhoenRulerZBundle(), new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(), new Craue\ConfigBundle\CraueConfigBundle(), - new Lexik\Bundle\MaintenanceBundle\LexikMaintenanceBundle(), new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(), + new FOS\JsRoutingBundle\FOSJsRoutingBundle(), // wallabag bundles new Wallabag\CoreBundle\WallabagCoreBundle(), diff --git a/app/DoctrineMigrations/Version20160812120952.php b/app/DoctrineMigrations/Version20160812120952.php index 3aafea64..39423e2f 100644 --- a/app/DoctrineMigrations/Version20160812120952.php +++ b/app/DoctrineMigrations/Version20160812120952.php @@ -33,9 +33,11 @@ class Version20160812120952 extends AbstractMigration implements ContainerAwareI case 'sqlite': $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' ADD name longtext DEFAULT NULL'); break; + case 'mysql': $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' ADD name longtext COLLATE \'utf8_unicode_ci\' DEFAULT NULL'); break; + case 'postgresql': $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' ADD name text DEFAULT NULL'); } diff --git a/app/DoctrineMigrations/Version20161001072726.php b/app/DoctrineMigrations/Version20161001072726.php new file mode 100644 index 00000000..237db932 --- /dev/null +++ b/app/DoctrineMigrations/Version20161001072726.php @@ -0,0 +1,63 @@ +container = $container; + } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix') . $tableName; + } + + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + $this->skipIf($this->connection->getDatabasePlatform()->getName() == 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); + + // remove all FK from entry_tag + $query = $this->connection->query("SELECT CONSTRAINT_NAME FROM information_schema.key_column_usage WHERE TABLE_NAME = '".$this->getTable('entry_tag')."' AND CONSTRAINT_NAME LIKE 'FK_%' AND TABLE_SCHEMA = '".$this->connection->getDatabase()."'"); + $query->execute(); + + foreach ($query->fetchAll() as $fk) { + $this->addSql('ALTER TABLE '.$this->getTable('entry_tag').' DROP FOREIGN KEY '.$fk['CONSTRAINT_NAME']); + } + + $this->addSql('ALTER TABLE '.$this->getTable('entry_tag').' ADD CONSTRAINT FK_entry_tag_entry FOREIGN KEY (entry_id) REFERENCES '.$this->getTable('entry').' (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE '.$this->getTable('entry_tag').' ADD CONSTRAINT FK_entry_tag_tag FOREIGN KEY (tag_id) REFERENCES '.$this->getTable('tag').' (id) ON DELETE CASCADE'); + + // remove entry FK from annotation + $query = $this->connection->query("SELECT CONSTRAINT_NAME FROM information_schema.key_column_usage WHERE TABLE_NAME = '".$this->getTable('annotation')."' AND CONSTRAINT_NAME LIKE 'FK_%' and COLUMN_NAME = 'entry_id' AND TABLE_SCHEMA = '".$this->connection->getDatabase()."'"); + $query->execute(); + + foreach ($query->fetchAll() as $fk) { + $this->addSql('ALTER TABLE '.$this->getTable('annotation').' DROP FOREIGN KEY '.$fk['CONSTRAINT_NAME']); + } + + $this->addSql('ALTER TABLE '.$this->getTable('annotation').' ADD CONSTRAINT FK_annotation_entry FOREIGN KEY (entry_id) REFERENCES '.$this->getTable('entry').' (id) ON DELETE CASCADE'); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + throw new SkipMigrationException('Too complex ...'); + } +} diff --git a/app/DoctrineMigrations/Version20161022134138.php b/app/DoctrineMigrations/Version20161022134138.php new file mode 100644 index 00000000..5cce55a5 --- /dev/null +++ b/app/DoctrineMigrations/Version20161022134138.php @@ -0,0 +1,77 @@ +container = $container; + } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix') . $tableName; + } + + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + $this->skipIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'This migration only apply to MySQL'); + + $this->addSql('ALTER DATABASE '.$this->container->getParameter('database_name').' CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;'); + + $this->addSql('ALTER TABLE '.$this->getTable('annotation').' CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'); + $this->addSql('ALTER TABLE '.$this->getTable('entry').' CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'); + $this->addSql('ALTER TABLE '.$this->getTable('tag').' CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'); + $this->addSql('ALTER TABLE '.$this->getTable('user').' CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'); + + $this->addSql('ALTER TABLE '.$this->getTable('annotation').' CHANGE `text` `text` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'); + $this->addSql('ALTER TABLE '.$this->getTable('annotation').' CHANGE `quote` `quote` VARCHAR(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'); + + $this->addSql('ALTER TABLE '.$this->getTable('entry').' CHANGE `title` `title` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'); + $this->addSql('ALTER TABLE '.$this->getTable('entry').' CHANGE `content` `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'); + + $this->addSql('ALTER TABLE '.$this->getTable('tag').' CHANGE `label` `label` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'); + + $this->addSql('ALTER TABLE '.$this->getTable('user').' CHANGE `name` `name` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + $this->skipIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'This migration only apply to MySQL'); + + $this->addSql('ALTER DATABASE '.$this->container->getParameter('database_name').' CHARACTER SET = utf8 COLLATE = utf8_unicode_ci;'); + + $this->addSql('ALTER TABLE '.$this->getTable('annotation').' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); + $this->addSql('ALTER TABLE '.$this->getTable('entry').' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); + $this->addSql('ALTER TABLE '.$this->getTable('tag').' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); + $this->addSql('ALTER TABLE '.$this->getTable('user').' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); + + $this->addSql('ALTER TABLE '.$this->getTable('annotation').' CHANGE `text` `text` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); + $this->addSql('ALTER TABLE '.$this->getTable('annotation').' CHANGE `quote` `quote` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); + + $this->addSql('ALTER TABLE '.$this->getTable('entry').' CHANGE `title` `title` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); + $this->addSql('ALTER TABLE '.$this->getTable('entry').' CHANGE `content` `content` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); + + $this->addSql('ALTER TABLE '.$this->getTable('tag').' CHANGE `label` `label` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); + + $this->addSql('ALTER TABLE '.$this->getTable('user').' CHANGE `name` `name` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); + + } +} diff --git a/app/DoctrineMigrations/Version20161024212538.php b/app/DoctrineMigrations/Version20161024212538.php new file mode 100644 index 00000000..f8e927e4 --- /dev/null +++ b/app/DoctrineMigrations/Version20161024212538.php @@ -0,0 +1,45 @@ +container = $container; + } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix') . $tableName; + } + + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + $this->skipIf($this->connection->getDatabasePlatform()->getName() == 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); + + $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' ADD user_id INT(11) DEFAULT NULL'); + $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' ADD CONSTRAINT FK_clients_user_clients FOREIGN KEY (user_id) REFERENCES '.$this->getTable('user').' (id) ON DELETE CASCADE'); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + + } +} diff --git a/app/DoctrineMigrations/Version20161031132655.php b/app/DoctrineMigrations/Version20161031132655.php new file mode 100644 index 00000000..c7364428 --- /dev/null +++ b/app/DoctrineMigrations/Version20161031132655.php @@ -0,0 +1,44 @@ +container = $container; + } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix') . $tableName; + } + + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + $this->addSql("INSERT INTO \"".$this->getTable('craue_config_setting')."\" (name, value, section) VALUES ('download_images_enabled', 0, 'misc')"); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + $this->abortIf($this->connection->getDatabasePlatform()->getName() == 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); + + $this->addSql("DELETE FROM \"".$this->getTable('craue_config_setting')."\" WHERE name = 'download_images_enabled';"); + } +} diff --git a/app/DoctrineMigrations/Version20161104073720.php b/app/DoctrineMigrations/Version20161104073720.php new file mode 100644 index 00000000..16503b4b --- /dev/null +++ b/app/DoctrineMigrations/Version20161104073720.php @@ -0,0 +1,53 @@ +container = $container; + } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix') . $tableName; + } + + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + switch ($this->connection->getDatabasePlatform()->getName()) { + case 'sqlite': + $this->addSql('CREATE INDEX `created_at` ON `'.$this->getTable('entry').'` (`created_at` DESC)'); + break; + + case 'mysql': + $this->addSql('ALTER TABLE '.$this->getTable('entry').' ADD INDEX created_at (created_at);'); + break; + + case 'postgresql': + $this->addSql('CREATE INDEX created_at ON '.$this->getTable('entry').' (created_at DESC)'); + } + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + + } +} diff --git a/app/DoctrineMigrations/Version20161106113822.php b/app/DoctrineMigrations/Version20161106113822.php new file mode 100644 index 00000000..edca54f5 --- /dev/null +++ b/app/DoctrineMigrations/Version20161106113822.php @@ -0,0 +1,44 @@ +container = $container; + } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix') . $tableName; + } + + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + $this->addSql('ALTER TABLE '.$this->getTable('config').' ADD action_mark_as_read INT DEFAULT 0'); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'sqlite', 'This down migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.'); + + $this->addSql('ALTER TABLE '.$this->getTable('config').' DROP action_mark_as_read'); + } +} diff --git a/app/DoctrineMigrations/Version20161117071626.php b/app/DoctrineMigrations/Version20161117071626.php new file mode 100644 index 00000000..9ae55b5f --- /dev/null +++ b/app/DoctrineMigrations/Version20161117071626.php @@ -0,0 +1,44 @@ +container = $container; + } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix') . $tableName; + } + + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + $this->addSql("INSERT INTO ".$this->getTable('craue_config_setting')." (name, value, section) VALUES ('share_unmark', 0, 'entry')"); + $this->addSql("INSERT INTO ".$this->getTable('craue_config_setting')." (name, value, section) VALUES ('unmark_url', 'https://unmark.it', 'entry')"); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + $this->addSql("DELETE FROM ".$this->getTable('craue_config_setting')." WHERE name = 'share_unmark';"); + $this->addSql("DELETE FROM ".$this->getTable('craue_config_setting')." WHERE name = 'unmark_url';"); + } +} diff --git a/app/DoctrineMigrations/Version20161118134328.php b/app/DoctrineMigrations/Version20161118134328.php new file mode 100644 index 00000000..390e89ce --- /dev/null +++ b/app/DoctrineMigrations/Version20161118134328.php @@ -0,0 +1,47 @@ +container = $container; + } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix') . $tableName; + } + + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + $this->addSql('ALTER TABLE '.$this->getTable('entry').' ADD http_status VARCHAR(3) DEFAULT NULL'); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'sqlite', 'This down migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.'); + + $this->addSql('ALTER TABLE '.$this->getTable('entry').' DROP http_status'); + } +} diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml index 3e11d675..8ee0a303 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml @@ -15,6 +15,7 @@ share_diaspora: Aktiver deling til Diaspora share_mail: Aktiver deling med email share_shaarli: Aktiver deling gennem Shaarli share_twitter: Aktiver deling gennem Twitter +share_unmark: Aktiver deling gennem Unmark.it show_printlink: Vis et link til print-indhold wallabag_support_url: Support-URL for wallabag wallabag_url: URL for *sin* wallabag-installation @@ -29,3 +30,4 @@ piwik_enabled: Aktiver Piwik demo_mode_enabled: "Aktiver demo-indstilling? (anvendes kun til wallabags offentlige demo)" demo_mode_username: "Demobruger" # share_public: Allow public url for entries +# download_images_enabled: Download images locally diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml index c74b5c1f..73a9d640 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml @@ -15,6 +15,7 @@ share_diaspora: Teilen zu Diaspora aktiveren share_mail: Teilen via E-Mail aktiveren share_shaarli: Teilen zu Shaarli aktiveren share_twitter: Teilen zu Twitter aktiveren +share_unmark: Teilen zu Unmark.it aktiveren show_printlink: Link anzeigen, um den Inhalt auszudrucken wallabag_support_url: Support-URL für wallabag wallabag_url: URL von *deiner* wallabag-Instanz @@ -29,3 +30,4 @@ piwik_enabled: Piwik aktivieren demo_mode_enabled: "Test-Modus aktivieren? (nur für die öffentliche wallabag-Demo genutzt)" demo_mode_username: "Test-Benutzer" share_public: Erlaube eine öffentliche URL für Einträge +# download_images_enabled: Download images locally diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml index 77c09db4..c8c13805 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml @@ -15,6 +15,7 @@ share_diaspora: Enable share to Diaspora share_mail: Enable share by email share_shaarli: Enable share to Shaarli share_twitter: Enable share to Twitter +share_unmark: Enable share to Unmark.it show_printlink: Display a link to print content wallabag_support_url: Support URL for wallabag wallabag_url: URL of *your* wallabag instance @@ -29,3 +30,4 @@ piwik_enabled: Enable Piwik demo_mode_enabled: "Enable demo mode ? (only used for the wallabag public demo)" demo_mode_username: "Demo user" share_public: Allow public url for entries +download_images_enabled: Download images locally diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml index baa83849..0ea98d8f 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml @@ -15,6 +15,7 @@ share_diaspora: Activar compartir con Diaspora share_mail: Activar compartir con email share_shaarli: Activar compartir con Shaarli share_twitter: Activar compartir con Twitter +share_unmark: Activar compartir con Unmark.it show_printlink: Mostrar un enlace para imprimir contenido wallabag_support_url: URL de soporte de wallabag wallabag_url: URL de *tu* instancia de wallabag @@ -29,3 +30,4 @@ piwik_enabled: Activar Piwik demo_mode_enabled: "Activar modo demo (sólo usado para la demo de wallabag)" demo_mode_username: "Nombre de usuario demo" # share_public: Allow public url for entries +# download_images_enabled: Download images locally diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml index b394977e..c527b971 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml @@ -15,6 +15,7 @@ share_diaspora: فعال‌سازی هم‌رسانی به Diaspora share_mail: فعال‌سازی هم‌رسانی با ایمیل share_shaarli: فعال‌سازی هم‌رسانی به Shaarli share_twitter: فعال‌سازی هم‌رسانی به Twitter +share_unmark: فعال‌سازی هم‌رسانی به Unmark.it show_printlink: نمایش پیوندی برای چاپ مطلب wallabag_support_url: نشانی صفحهٔ پشتیبانی wallabag wallabag_url: نشانی صفحهٔ wallabag *شما* @@ -29,3 +30,4 @@ modify_settings: "اعمال" # demo_mode_enabled: "Enable demo mode ? (only used for the wallabag public demo)" # demo_mode_username: "Demo user" # share_public: Allow public url for entries +# download_images_enabled: Download images locally diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml index 31a80880..176e7c86 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml @@ -15,6 +15,7 @@ share_diaspora: Activer le partage vers Diaspora share_mail: Activer le partage par email share_shaarli: Activer le partage vers Shaarli share_twitter: Activer le partage vers Twitter +share_unmark: Activer le partage vers Unmark.it show_printlink: Afficher un lien pour imprimer wallabag_support_url: URL de support de wallabag wallabag_url: URL de *votre* instance de wallabag @@ -29,3 +30,4 @@ piwik_enabled: Activer Piwik demo_mode_enabled: "Activer le mode démo ? (utiliser uniquement pour la démo publique de wallabag)" demo_mode_username: "Utilisateur de la démo" share_public: Autoriser une URL publique pour les articles +download_images_enabled: Télécharger les images en local diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml index ba038556..621d4dcd 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml @@ -15,6 +15,7 @@ share_diaspora: Abilita la condivisione con Diaspora share_mail: Abilita la condivisione per email share_shaarli: Abilita la condivisione con Shaarli share_twitter: Abilita la condivisione con Twitter +share_unmark: Abilita la condivisione con Unmark.it show_printlink: Mostra un collegamento per stampare il contenuto wallabag_support_url: URL di supporto per wallabag wallabag_url: URL della *tua* installazione di wallabag @@ -29,3 +30,4 @@ piwik_enabled: Abilita Piwik demo_mode_enabled: "Abilita modalità demo ? (usato solo per la demo pubblica di wallabag)" demo_mode_username: "Utente Demo" # share_public: Allow public url for entries +# download_images_enabled: Download images locally diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml index 55249e33..04accd45 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml @@ -15,6 +15,7 @@ share_diaspora: Activar lo partatge cap a Diaspora share_mail: Activar lo partatge per corrièl share_shaarli: Activar lo partatge cap a Shaarli share_twitter: Activar lo partatge cap a Twitter +share_unmark: Activar lo partatge cap a Unmark.it show_printlink: Afichar un ligam per imprimir wallabag_support_url: URL d'assisténcia de wallabag wallabag_url: URL de *vòstra* instància de wallabag @@ -29,3 +30,4 @@ piwik_enabled: Activar Piwik demo_mode_enabled: "Activar lo mode demostracion ? (utilizar solament per la demostracion publica de wallabag)" demo_mode_username: "Utilizaire de la demostracion" # share_public: Allow public url for entries +# download_images_enabled: Download images locally diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml index 42cc5b52..2f4f3154 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml @@ -15,6 +15,7 @@ share_diaspora: Włącz udostępnianie dla Diaspora share_mail: Włącz udostępnianie przez email share_shaarli: Włącz udostępnianie dla Shaarli share_twitter: Włącz udostępnianie dla Twitter +share_unmark: Włącz udostępnianie dla Unmark.it show_printlink: Pokaż link do wydrukowania zawartości wallabag_support_url: Adres URL wsparcia dla wallabag wallabag_url: Adres *twojej* instacji wallabag @@ -29,3 +30,4 @@ piwik_enabled: Włacz Piwik demo_mode_enabled: "Włacz tryb demo? (używany wyłącznie dla publicznej demonstracji Wallabag)" demo_mode_username: "Użytkownik Demonstracyjny" share_public: Zezwalaj na publiczny adres url dla wpisow +# download_images_enabled: Download images locally diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml index e8260422..5da940e9 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml @@ -14,6 +14,7 @@ share_diaspora: Habilitar compartilhamento para o Diaspora share_mail: Habilitar compartilhamento por e-mail share_shaarli: Habilitar compartilhamento para o Shaarli share_twitter: Habilitar compartilhamento para o Twitter +share_unmark: Habilitar compartilhamento para o Unmark.it show_printlink: Mostrar um link para imprimir o conteúdo wallabag_support_url: URL de Suporte do wallabag wallabag_url: URL de *sua* instância do wallabag diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml index 8e72b955..6d2eaffd 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml @@ -15,6 +15,7 @@ share_diaspora: Permite share către Diaspora share_mail: Permite share prin email share_shaarli: Permite share către Shaarli share_twitter: Permite share către Twitter +share_unmark: Permite share către Unmark.it show_printlink: Afișează un link pentru a printa content-ul wallabag_support_url: URL-ul de suport pentru wallabag wallabag_url: URL-ul instanței tale wallabag @@ -29,3 +30,4 @@ modify_settings: "aplică" # demo_mode_enabled: "Enable demo mode ? (only used for the wallabag public demo)" # demo_mode_username: "Demo user" # share_public: Allow public url for entries +# download_images_enabled: Download images locally diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml index 55f70843..9146bfb6 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml @@ -15,6 +15,7 @@ # share_mail: Enable share by email # share_shaarli: Enable share to Shaarli # share_twitter: Enable share to Twitter +# share_unmark: Enable share to Unmark.it # show_printlink: Display a link to print content # wallabag_support_url: Support URL for wallabag # wallabag_url: URL of *your* wallabag instance @@ -29,3 +30,4 @@ # demo_mode_enabled: "Enable demo mode ? (only used for the wallabag public demo)" # demo_mode_username: "Demo user" # share_public: Allow public url for entries +# download_images_enabled: Download images locally diff --git a/app/Resources/static/themes/_global/img/icons/unmark-icon--black.png b/app/Resources/static/themes/_global/img/icons/unmark-icon--black.png new file mode 100644 index 00000000..45f679ee Binary files /dev/null and b/app/Resources/static/themes/_global/img/icons/unmark-icon--black.png differ diff --git a/app/Resources/static/themes/_global/js/bookmarklet.js b/app/Resources/static/themes/_global/js/bookmarklet.js index 5174ff47..a497628b 100644 --- a/app/Resources/static/themes/_global/js/bookmarklet.js +++ b/app/Resources/static/themes/_global/js/bookmarklet.js @@ -1,4 +1,3 @@ - top['bookmarklet-url@wallabag.org'] = 'bag it!' + '' + diff --git a/data/assets/.gitignore b/app/Resources/static/themes/_global/js/shortcuts/entry.js similarity index 100% rename from data/assets/.gitignore rename to app/Resources/static/themes/_global/js/shortcuts/entry.js diff --git a/app/Resources/static/themes/_global/js/shortcuts/main.js b/app/Resources/static/themes/_global/js/shortcuts/main.js new file mode 100644 index 00000000..ef6a1b84 --- /dev/null +++ b/app/Resources/static/themes/_global/js/shortcuts/main.js @@ -0,0 +1,15 @@ +import Mousetrap from 'mousetrap'; + +/** Shortcuts **/ + +/* Go to */ +Mousetrap.bind('g u', () => { window.location.href = Routing.generate('homepage'); }); +Mousetrap.bind('g s', () => { window.location.href = Routing.generate('starred'); }); +Mousetrap.bind('g r', () => { window.location.href = Routing.generate('archive'); }); +Mousetrap.bind('g a', () => { window.location.href = Routing.generate('all'); }); +Mousetrap.bind('g t', () => { window.location.href = Routing.generate('tag'); }); +Mousetrap.bind('g c', () => { window.location.href = Routing.generate('config'); }); +Mousetrap.bind('g i', () => { window.location.href = Routing.generate('import'); }); +Mousetrap.bind('g d', () => { window.location.href = Routing.generate('developer'); }); +Mousetrap.bind('?', () => { window.location.href = Routing.generate('howto'); }); +Mousetrap.bind('g l', () => { window.location.href = Routing.generate('logout'); }); diff --git a/app/Resources/static/themes/_global/js/tools.js b/app/Resources/static/themes/_global/js/tools.js index ab30deb1..568b2dce 100644 --- a/app/Resources/static/themes/_global/js/tools.js +++ b/app/Resources/static/themes/_global/js/tools.js @@ -1,4 +1,9 @@ -const $ = require('jquery'); +import $ from 'jquery'; +import './shortcuts/main'; +import './shortcuts/entry'; + +/* Allows inline call qr-code call */ +import jrQrcode from 'jr-qrcode'; // eslint-disable-line function supportsLocalStorage() { try { diff --git a/app/Resources/static/themes/baggy/css/main.css b/app/Resources/static/themes/baggy/css/main.css index 4dfa8790..4f48f8ca 100755 --- a/app/Resources/static/themes/baggy/css/main.css +++ b/app/Resources/static/themes/baggy/css/main.css @@ -936,6 +936,11 @@ a.add-to-wallabag-link-after::after { background-image: url("../../_global/img/icons/diaspora-icon--black.png"); } +/* Unmark.it */ +.icon-image--unmark { + background-image: url("../../_global/img/icons/unmark-icon--black.png"); +} + /* shaarli */ .icon-image--shaarli { background-image: url("../../_global/img/icons/shaarli.png"); diff --git a/app/Resources/static/themes/baggy/js/autoCompleteTags.js b/app/Resources/static/themes/baggy/js/autoCompleteTags.js index f287ebfa..64fdaa92 100755 --- a/app/Resources/static/themes/baggy/js/autoCompleteTags.js +++ b/app/Resources/static/themes/baggy/js/autoCompleteTags.js @@ -5,4 +5,4 @@ function extractLast(term) { return split(term).pop(); } -export { split, extractLast }; +export default { split, extractLast }; diff --git a/app/Resources/static/themes/baggy/js/init.js b/app/Resources/static/themes/baggy/js/init.js index dc11043a..05360a28 100755 --- a/app/Resources/static/themes/baggy/js/init.js +++ b/app/Resources/static/themes/baggy/js/init.js @@ -1,11 +1,26 @@ -import { savePercent, retrievePercent } from '../../_global/js/tools'; -import { toggleSaveLinkForm } from './uiTools'; +/* jQuery */ +import $ from 'jquery'; + +/* eslint-disable no-unused-vars */ +/* jquery has default scope */ +import cookie from 'jquery.cookie'; +import ui from 'jquery-ui-browserify'; +/* eslint-enable no-unused-vars */ + +/* Annotations */ +import annotator from 'annotator'; -const $ = global.jquery = require('jquery'); -require('jquery.cookie'); -require('jquery-ui-browserify'); -const annotator = require('annotator'); +/* Shortcuts */ +import './shortcuts/main'; +import './shortcuts/entry'; +import '../../_global/js/shortcuts/main'; +import '../../_global/js/shortcuts/entry'; + +/* Tools */ +import { savePercent, retrievePercent } from '../../_global/js/tools'; +import toggleSaveLinkForm from './uiTools'; +global.jquery = $; $.fn.ready(() => { const $listmode = $('#listmode'); diff --git a/app/Resources/static/themes/baggy/js/shortcuts/entry.js b/app/Resources/static/themes/baggy/js/shortcuts/entry.js new file mode 100644 index 00000000..728df8bd --- /dev/null +++ b/app/Resources/static/themes/baggy/js/shortcuts/entry.js @@ -0,0 +1,22 @@ +import Mousetrap from 'mousetrap'; +import $ from 'jquery'; + +/* Article view */ +Mousetrap.bind('o', () => { + $('div#article_toolbar ul.links a.original')[0].click(); +}); + +/* mark as favorite */ +Mousetrap.bind('s', () => { + $('div#article_toolbar ul.links a.favorite')[0].click(); +}); + +/* mark as read */ +Mousetrap.bind('a', () => { + $('div#article_toolbar ul.links a.markasread')[0].click(); +}); + +/* delete */ +Mousetrap.bind('del', () => { + $('div#article_toolbar ul.links a.delete')[0].click(); +}); diff --git a/app/Resources/static/themes/baggy/js/shortcuts/main.js b/app/Resources/static/themes/baggy/js/shortcuts/main.js new file mode 100644 index 00000000..e69de29b diff --git a/app/Resources/static/themes/baggy/js/uiTools.js b/app/Resources/static/themes/baggy/js/uiTools.js index 900b2707..713c53f7 100644 --- a/app/Resources/static/themes/baggy/js/uiTools.js +++ b/app/Resources/static/themes/baggy/js/uiTools.js @@ -1,4 +1,4 @@ -const $ = require('jquery'); +import $ from 'jquery'; function toggleSaveLinkForm(url, event) { $('#add-link-result').empty(); @@ -32,4 +32,4 @@ function toggleSaveLinkForm(url, event) { plainUrl.focus(); } -export { toggleSaveLinkForm }; +export default toggleSaveLinkForm; diff --git a/app/Resources/static/themes/material/css/main.css b/app/Resources/static/themes/material/css/main.css index 408fe14c..df126fb4 100755 --- a/app/Resources/static/themes/material/css/main.css +++ b/app/Resources/static/themes/material/css/main.css @@ -150,6 +150,11 @@ background-image: url("../../_global/img/icons/diaspora-icon--black.png"); } +/* Unmark.it */ +.icon-image--unmark { + background-image: url("../../_global/img/icons/unmark-icon--black.png"); +} + /* Shaarli */ .icon-image--shaarli { background-image: url("../../_global/img/icons/shaarli.png"); diff --git a/app/Resources/static/themes/material/js/init.js b/app/Resources/static/themes/material/js/init.js index a68269e0..9746224b 100755 --- a/app/Resources/static/themes/material/js/init.js +++ b/app/Resources/static/themes/material/js/init.js @@ -1,10 +1,21 @@ +/* jQuery */ +import $ from 'jquery'; + +/* Annotations */ +import annotator from 'annotator'; + +/* Tools */ import { savePercent, retrievePercent, initFilters, initExport } from '../../_global/js/tools'; -const $ = require('jquery'); +/* Import shortcuts */ +import './shortcuts/main'; +import './shortcuts/entry'; +import '../../_global/js/shortcuts/main'; +import '../../_global/js/shortcuts/entry'; -global.jQuery = $; require('materialize'); // eslint-disable-line -const annotator = require('annotator'); + +global.jQuery = $; $(document).ready(() => { // sideNav diff --git a/app/Resources/static/themes/material/js/shortcuts/entry.js b/app/Resources/static/themes/material/js/shortcuts/entry.js new file mode 100644 index 00000000..357c22fe --- /dev/null +++ b/app/Resources/static/themes/material/js/shortcuts/entry.js @@ -0,0 +1,22 @@ +import Mousetrap from 'mousetrap'; +import $ from 'jquery'; + +/* open original article */ +Mousetrap.bind('o', () => { + $('ul.side-nav a.original i')[0].click(); +}); + +/* mark as favorite */ +Mousetrap.bind('s', () => { + $('ul.side-nav a.favorite i')[0].click(); +}); + +/* mark as read */ +Mousetrap.bind('a', () => { + $('ul.side-nav a.markasread i')[0].click(); +}); + +/* delete */ +Mousetrap.bind('del', () => { + $('ul.side-nav a.delete i')[0].click(); +}); diff --git a/app/Resources/static/themes/material/js/shortcuts/main.js b/app/Resources/static/themes/material/js/shortcuts/main.js new file mode 100644 index 00000000..8514f71e --- /dev/null +++ b/app/Resources/static/themes/material/js/shortcuts/main.js @@ -0,0 +1,70 @@ +import Mousetrap from 'mousetrap'; +import $ from 'jquery'; + +function toggleFocus(cardToToogleFocus) { + if (cardToToogleFocus) { + $(cardToToogleFocus).toggleClass('z-depth-4'); + } +} + +$(document).ready(() => { + let cardIndex = 0; + const cardNumber = $('#content ul.data > li').length; + let card = $('#content ul.data > li')[cardIndex]; + const pagination = $('.pagination'); + + /* Show nothing on quickstart */ + if ($('#content > div.quickstart').length > 0) { + return; + } + + /* If we come from next page */ + if (window.location.hash === '#prev') { + cardIndex = cardNumber - 1; + card = $('ul.data > li')[cardIndex]; + } + + /* Focus current card */ + toggleFocus(card); + + /* Actions */ + Mousetrap.bind('g n', () => { + $('#nav-btn-add').trigger('click'); + }); + + Mousetrap.bind('esc', () => { + $('.close').trigger('click'); + }); + + /* Select right card. If there's a next page, go to next page */ + Mousetrap.bind('right', () => { + if (cardIndex >= 0 && cardIndex < cardNumber - 1) { + toggleFocus(card); + cardIndex += 1; + card = $('ul.data > li')[cardIndex]; + toggleFocus(card); + return; + } + if (pagination.length > 0 && pagination.find('li.next:not(.disabled)').length > 0 && cardIndex === cardNumber - 1) { + window.location.href = window.location.origin + $(pagination).find('li.next a').attr('href'); + } + }); + + /* Select previous card. If there's a previous page, go to next page */ + Mousetrap.bind('left', () => { + if (cardIndex > 0 && cardIndex < cardNumber) { + toggleFocus(card); + cardIndex -= 1; + card = $('ul.data > li')[cardIndex]; + toggleFocus(card); + return; + } + if (pagination.length > 0 && $(pagination).find('li.prev:not(.disabled)').length > 0 && cardIndex === 0) { + window.location.href = `${window.location.origin + $(pagination).find('li.prev a').attr('href')}#prev`; + } + }); + + Mousetrap.bind('enter', () => { + window.location.href = window.location.origin + $(card).find('span.card-title a').attr('href'); + }); +}); diff --git a/app/config/config.yml b/app/config/config.yml index ffc3bb77..48496bc2 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -78,7 +78,7 @@ doctrine: dbname: "%database_name%" user: "%database_user%" password: "%database_password%" - charset: UTF8 + charset: "%database_charset%" path: "%database_path%" unix_socket: "%database_socket%" server_version: 5.6 @@ -115,12 +115,26 @@ swiftmailer: fos_rest: param_fetcher_listener: true body_listener: true - format_listener: true view: + mime_types: + csv: + - 'text/csv' + - 'text/plain' + pdf: + - 'application/pdf' + epub: + - 'application/epub+zip' + mobi: + - 'application/x-mobipocket-ebook' view_response_listener: 'force' formats: xml: true - json : true + json: true + txt: true + csv: true + pdf: true + epub: true + mobi: true templating_formats: html: true force_redirects: @@ -129,10 +143,21 @@ fos_rest: default_engine: twig routing_loader: default_format: json + format_listener: + enabled: true + rules: + - { path: "^/api/entries/([0-9]+)/export.(.*)", priorities: ['epub', 'mobi', 'pdf', 'txt', 'csv'], fallback_format: false, prefer_extension: false } + - { path: "^/api", priorities: ['json', 'xml'], fallback_format: false, prefer_extension: false } + - { path: "^/annotations", priorities: ['json', 'xml'], fallback_format: false, prefer_extension: false } + # for an unknown reason, EACH REQUEST goes to FOS\RestBundle\EventListener\FormatListener + # so we need to add custom rule for custom api export but also for all other routes of the application... + - { path: '^/', priorities: ['text/html', '*/*'], fallback_format: html, prefer_extension: false } nelmio_api_doc: sandbox: enabled: false + cache: + enabled: true name: wallabag API documentation nelmio_cors: @@ -211,16 +236,6 @@ kphoen_rulerz: executors: doctrine: true -lexik_maintenance: - authorized: - ips: ['127.0.0.1'] - driver: - ttl: 3600 - class: 'Lexik\Bundle\MaintenanceBundle\Drivers\DatabaseDriver' - response: - code: 503 - status: "wallabag Service Temporarily Unavailable" - old_sound_rabbit_mq: connections: default: @@ -241,6 +256,11 @@ old_sound_rabbit_mq: exchange_options: name: 'wallabag.import.readability' type: topic + import_pinboard: + connection: default + exchange_options: + name: 'wallabag.import.pinboard' + type: topic import_instapaper: connection: default exchange_options: @@ -291,6 +311,14 @@ old_sound_rabbit_mq: queue_options: name: 'wallabag.import.instapaper' callback: wallabag_import.consumer.amqp.instapaper + import_pinboard: + connection: default + exchange_options: + name: 'wallabag.import.pinboard' + type: topic + queue_options: + name: 'wallabag.import.pinboard' + callback: wallabag_import.consumer.amqp.pinboard import_wallabag_v1: connection: default exchange_options: @@ -323,3 +351,16 @@ old_sound_rabbit_mq: queue_options: name: 'wallabag.import.chrome' callback: wallabag_import.consumer.amqp.chrome + +fos_js_routing: + routes_to_expose: + - homepage + - starred + - archive + - all + - tag + - config + - import + - developer + - howto + - logout diff --git a/app/config/config_test.yml b/app/config/config_test.yml index 3eab6fb2..f5e2c25e 100644 --- a/app/config/config_test.yml +++ b/app/config/config_test.yml @@ -28,7 +28,7 @@ doctrine: dbname: "%test_database_name%" user: "%test_database_user%" password: "%test_database_password%" - charset: UTF8 + charset: "%test_database_charset%" path: "%test_database_path%" orm: metadata_cache_driver: diff --git a/app/config/parameters.yml.dist b/app/config/parameters.yml.dist index ece4903a..7a22cb98 100644 --- a/app/config/parameters.yml.dist +++ b/app/config/parameters.yml.dist @@ -19,16 +19,18 @@ parameters: database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite" database_table_prefix: wallabag_ database_socket: null + # with MySQL, use "utf8mb4" if you got problem with content with emojis + database_charset: utf8 - mailer_transport: smtp - mailer_host: 127.0.0.1 - mailer_user: ~ - mailer_password: ~ + mailer_transport: smtp + mailer_host: 127.0.0.1 + mailer_user: ~ + mailer_password: ~ - locale: en + locale: en # A secret key that's used to generate certain security-related tokens - secret: ovmpmAWXRCabNlMgzlzFXDYmCFfzGv + secret: ovmpmAWXRCabNlMgzlzFXDYmCFfzGv # two factor stuff twofactor_auth: true diff --git a/app/config/parameters_test.yml b/app/config/parameters_test.yml index 2943b27a..5f2e25bb 100644 --- a/app/config/parameters_test.yml +++ b/app/config/parameters_test.yml @@ -6,3 +6,4 @@ parameters: test_database_user: null test_database_password: null test_database_path: '%kernel.root_dir%/../data/db/wallabag_test.sqlite' + test_database_charset: utf8 diff --git a/app/config/routing.yml b/app/config/routing.yml index 750ed435..eedf51d5 100644 --- a/app/config/routing.yml +++ b/app/config/routing.yml @@ -52,3 +52,6 @@ craue_config_settings_modify: path: /settings defaults: _controller: CraueConfigBundle:Settings:modify + +fos_js_routing: + resource: "@FOSJsRoutingBundle/Resources/config/routing/routing.xml" diff --git a/app/config/routing_rest.yml b/app/config/routing_rest.yml index 52d395dd..29f4ab14 100644 --- a/app/config/routing_rest.yml +++ b/app/config/routing_rest.yml @@ -1,4 +1,3 @@ Rest_Wallabag: - type : rest - resource: "@WallabagApiBundle/Resources/config/routing_rest.yml" - + type : rest + resource: "@WallabagApiBundle/Resources/config/routing_rest.yml" diff --git a/app/config/services.yml b/app/config/services.yml index a57ef0f3..9a1ce80b 100644 --- a/app/config/services.yml +++ b/app/config/services.yml @@ -32,13 +32,13 @@ services: - { name: twig.extension } wallabag.locale_listener: - class: Wallabag\CoreBundle\EventListener\LocaleListener + class: Wallabag\CoreBundle\Event\Listener\LocaleListener arguments: ["%kernel.default_locale%"] tags: - { name: kernel.event_subscriber } wallabag.user_locale_listener: - class: Wallabag\CoreBundle\EventListener\UserLocaleListener + class: Wallabag\CoreBundle\Event\Listener\UserLocaleListener arguments: ["@session"] tags: - { name: kernel.event_listener, event: security.interactive_login, method: onInteractiveLogin } diff --git a/app/config/tests/parameters_test.mysql.yml b/app/config/tests/parameters_test.mysql.yml index d8512845..bca2d466 100644 --- a/app/config/tests/parameters_test.mysql.yml +++ b/app/config/tests/parameters_test.mysql.yml @@ -6,3 +6,4 @@ parameters: test_database_user: root test_database_password: ~ test_database_path: ~ + test_database_charset: utf8mb4 diff --git a/app/config/tests/parameters_test.pgsql.yml b/app/config/tests/parameters_test.pgsql.yml index 41383868..3e18d4a0 100644 --- a/app/config/tests/parameters_test.pgsql.yml +++ b/app/config/tests/parameters_test.pgsql.yml @@ -6,3 +6,4 @@ parameters: test_database_user: travis test_database_password: ~ test_database_path: ~ + test_database_charset: utf8 diff --git a/app/config/tests/parameters_test.sqlite.yml b/app/config/tests/parameters_test.sqlite.yml index 1952e3a6..b8a5f41a 100644 --- a/app/config/tests/parameters_test.sqlite.yml +++ b/app/config/tests/parameters_test.sqlite.yml @@ -6,3 +6,4 @@ parameters: test_database_user: ~ test_database_password: ~ test_database_path: "%kernel.root_dir%/../data/db/wallabag_test.sqlite" + test_database_charset: utf8 diff --git a/composer.json b/composer.json index 4f7ad291..6d7a7adf 100644 --- a/composer.json +++ b/composer.json @@ -58,7 +58,7 @@ "jms/serializer-bundle": "~1.1", "nelmio/api-doc-bundle": "~2.7", "mgargano/simplehtmldom": "~1.5", - "tecnickcom/tcpdf": "~6.2", + "tecnickcom/tc-lib-pdf": "dev-master", "simplepie/simplepie": "~1.3.1", "willdurand/hateoas-bundle": "~1.0", "htmlawed/htmlawed": "~1.1.19", @@ -77,12 +77,13 @@ "paragonie/random_compat": "~1.0", "craue/config-bundle": "~1.4", "mnapoli/piwik-twig-extension": "^1.0", - "lexik/maintenance-bundle": "~2.1", "ocramius/proxy-manager": "1.*", "white-october/pagerfanta-bundle": "^1.0", "php-amqplib/rabbitmq-bundle": "^1.8", "predis/predis": "^1.0", - "javibravo/simpleue": "^1.0" + "javibravo/simpleue": "^1.0", + "symfony/dom-crawler": "^3.1", + "friendsofsymfony/jsrouting-bundle": "^1.6" }, "require-dev": { "doctrine/doctrine-fixtures-bundle": "~2.2", @@ -98,6 +99,7 @@ "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters", "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap", "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache", + "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets", "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile" ], "post-install-cmd": [ @@ -113,6 +115,7 @@ "symfony-var-dir": "var", "symfony-web-dir": "web", "symfony-tests-dir": "tests", + "symfony-assets-install": "symlink", "incenteev-parameters": { "file": "app/config/parameters.yml" } diff --git a/docs/de/developer/maintenance.rst b/docs/de/developer/maintenance.rst deleted file mode 100644 index 31343876..00000000 --- a/docs/de/developer/maintenance.rst +++ /dev/null @@ -1,32 +0,0 @@ -Wartungsmodus -============= - -Wenn du längere Aufgaben auf deiner wallabag Instanz ausführen willst, kannst du den Wartungsmodus aktivieren. -Keiner wird dann Zugang zu deiner Instanz haben. - -Aktivieren des Wartungsmodus ----------------------------- - -Um den Wartungsmodus zu aktivieren, führe folgendes Kommando aus: - -:: - - bin/console lexik:maintenance:lock -e=prod --no-interaction - -Du kannst deine IP Adresse in ``app/config/config.yml`` setzen, wenn du Zugriff zu wallabag haben willst, auch wenn der Wartungsmodus aktiv ist. Zum Beispiel: - -:: - - lexik_maintenance: - authorized: - ips: ['127.0.0.1'] - - -Deaktivieren des Wartungsmodus ------------------------- - -Um den Wartungsmodus zu deaktivieren, führe dieses Kommando aus: - -:: - - bin/console lexik:maintenance:unlock -e=prod diff --git a/docs/de/index.rst b/docs/de/index.rst index 28a47200..c1ce7d4b 100644 --- a/docs/de/index.rst +++ b/docs/de/index.rst @@ -48,5 +48,4 @@ Die Dokumentation ist in anderen Sprachen verfügbar : developer/docker developer/documentation developer/translate - developer/maintenance developer/asynchronous diff --git a/docs/de/user/configuration.rst b/docs/de/user/configuration.rst index 3fb501eb..c0a8cd67 100644 --- a/docs/de/user/configuration.rst +++ b/docs/de/user/configuration.rst @@ -27,6 +27,14 @@ Lesegeschwindigkeit wallabag berechnet die Lesezeit für jeden Artikel. Du kannst hier definieren, dank dieser Liste, ob du ein schneller oder langsamer Leser bist. wallabag wird die Lesezeit für jeden Artikel neu berechnen. +Wohin möchtest du weitergeleitet werden, nach dem ein Artikel als gelesen markiert wurde? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Jedes Mal, wenn du eine Aktion ausführst (nach dem Markieren eines Artikels als gelesen oder Favorit, nach dem Löschen eines Artikels oder dem Entfernen eines Tag von einem Eintrag), kannst du weitergeleitet werden: + +- zur Homepage +- zur aktuellen Seite + Sprache ~~~~~~~ diff --git a/docs/de/user/filters.rst b/docs/de/user/filters.rst index c9cda6b6..94b82b24 100644 --- a/docs/de/user/filters.rst +++ b/docs/de/user/filters.rst @@ -30,6 +30,11 @@ Sprache wallabag (via graby) kann die Artikelsprache erkennen. Es ist einfach für dich, Artikel in einer bestimmten Sprache zu filtern. +HTTP status +----------- + +You can retrieve the articles by filtering by their HTTP status code: 200, 404, 500, etc. + Lesezeit -------- diff --git a/docs/de/user/import.rst b/docs/de/user/import.rst index 55ab9291..e657e336 100644 --- a/docs/de/user/import.rst +++ b/docs/de/user/import.rst @@ -42,6 +42,53 @@ Du musst wallabag erlauben, mit deinem Pocketaccount zu interagieren. Deine Daten werden importiert. Datenimport kann ein sehr anspruchsvoller Prozess für deinen Server sein (wir müssen daran arbeiten, um diesen Import zu verbessern). +<<<<<<< HEAD +Von Readability +---------------- + +Exportiere deine Readability Daten +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Auf der Seite Tools (`https://www.readability.com/tools/ `_), klicke auf "Exportiere deine Daten" in dem Abschnitt "Daten Export". Du wirst eine E-Mail empfangen, um eine JSON Datei herunterladen zu können (Datei endet aber nicht auf .json). + +Importiere deine Daten in wallabag 2.x +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Klicke auf den ``Importieren`` Link im Menü, auf ``Importiere Inhalte`` in dem Readability Abschnitt und wähle dann deine JSON Datei aus und lade sie hoch. + +Deine Daten werden importiert. Der Datenimport can ein beanspruchender Prozess für deinen Server sein. + +Von Pinboard +------------- + +Exportiere deine Pinboard Daten +~~~~~~~~~~~~~~~~~~~~~~~~~ + +Auf der Seite Backup (`https://pinboard.in/settings/backup `_), klicke auf "JSON" in dem Abschnitt "Lesezeichen". Eine JSON Datei wird heruntergeladen (z.B. ``pinboard_export``). + +Importiere deine Daten in wallabag 2.x +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Klicke auf den ``Importieren`` Link im Menü, auf ``Importiere Inhalte`` in dem Pinboard Abschnitt und wähle dann deine JSON Datei aus und lade sie hoch. + +Deine Daten werden importiert. Der Datenimport can ein beanspruchender Prozess für deinen Server sein. + +Von Instapaper +--------------- + +Exportiere deine Instapaper Daten +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Auf der Seite Einstellungen (`https://www.instapaper.com/user `_), klicke auf "Download .CSV Datei" in dem Abschnitt "Export". Eine CSV Datei wird heruntergeladen (z.B. ``instapaper-export.csv``). + +Importiere deine Daten in wallabag 2.x +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Klicke auf den ``Importieren`` Link im Menü, auf ``Importiere Inhalte`` in dem Instapaper Abschnitt und wähle dann deine JSON Datei aus und lade sie hoch. + +Deine Daten werden importiert. Der Datenimport can ein beanspruchender Prozess für deinen Server sein. + +======= Readability ----------- @@ -128,6 +175,7 @@ Wenn du alle Artikel als gelesen markieren möchtest, kannst du die ``--markAsRe Um eine wallabag 2.x-Datei zu importieren, musst du die Option ``--importer=v2`` hinzufügen. Als Ergebnis wirst du so etwas erhalten: +>>>>>>> origin/master :: diff --git a/docs/en/developer/maintenance.rst b/docs/en/developer/maintenance.rst deleted file mode 100644 index 6d55ed60..00000000 --- a/docs/en/developer/maintenance.rst +++ /dev/null @@ -1,32 +0,0 @@ -Maintenance mode -================ - -If you have some long tasks to do on your wallabag instance, you can enable a maintenance mode. -Nobody will have access to your instance. - -Enable maintenance mode ------------------------ - -To enable maintenance mode, execute this command: - -:: - - bin/console lexik:maintenance:lock --no-interaction -e=prod - -You can set your IP address in ``app/config/config.yml`` if you want to access to wallabag even if maintenance mode is enabled. For example: - -:: - - lexik_maintenance: - authorized: - ips: ['127.0.0.1'] - - -Disable maintenance mode ------------------------- - -To disable maintenance mode, execute this command: - -:: - - bin/console lexik:maintenance:unlock -e=prod diff --git a/docs/en/index.rst b/docs/en/index.rst index 77425bfa..54a1eef8 100644 --- a/docs/en/index.rst +++ b/docs/en/index.rst @@ -48,5 +48,4 @@ The documentation is available in other languages: developer/docker developer/documentation developer/translate - developer/maintenance developer/asynchronous diff --git a/docs/en/user/configuration.rst b/docs/en/user/configuration.rst index 2c1385a8..a52d3ddd 100644 --- a/docs/en/user/configuration.rst +++ b/docs/en/user/configuration.rst @@ -26,6 +26,15 @@ Reading speed wallabag calculates a reading time for each article. You can define here, thanks to this list, if you are a fast or a slow reader. wallabag will recalculate the reading time for each article. +Where do you want to be redirected after mark an article as read? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Each time you'll do some actions (after marking an article as read/favorite, +after deleting an article, after removing a tag from an entry), you can be redirected: + +- To the homepage +- To the current page + Language ~~~~~~~~ @@ -48,6 +57,8 @@ User information You can change your name, your email address and enable ``Two factor authentication``. +If the wallabag instance has more than one enabled user, you can delete your account here. **Take care, we delete all your data**. + Two factor authentication (2FA) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/en/user/filters.rst b/docs/en/user/filters.rst index 4d1df6eb..aae8a749 100644 --- a/docs/en/user/filters.rst +++ b/docs/en/user/filters.rst @@ -30,6 +30,11 @@ Language wallabag (via graby) can detect article language. It's easy to you to retrieve articles written in a specific language. +HTTP status +----------- + +You can retrieve the articles by filtering by their HTTP status code: 200, 404, 500, etc. + Reading time ------------ diff --git a/docs/en/user/import.rst b/docs/en/user/import.rst index a6754fa0..f420a131 100644 --- a/docs/en/user/import.rst +++ b/docs/en/user/import.rst @@ -1,13 +1,13 @@ Migrate from ... ================ -In wallabag 2.x, you can import data from: +In wallabag 2.x, you can import data from: -- `Pocket <#id1>`_ -- `Readability <#id2>`_ -- `Instapaper <#id4>`_ -- `wallabag 1.x <#id6>`_ -- `wallabag 2.x <#id7>`_ +- `Pocket <#id1>`_ +- `Readability <#id2>`_ +- `Instapaper <#id4>`_ +- `wallabag 1.x <#id6>`_ +- `wallabag 2.x <#id7>`_ We also developed `a script to execute migrations via command-line interface <#import-via-command-line-interface-cli>`_. @@ -57,8 +57,24 @@ and then select your json file and upload it. Your data will be imported. Data import can be a demanding process for your server. -Instapaper ----------- +From Pinboard +------------- + +Export your Pinboard data +~~~~~~~~~~~~~~~~~~~~~~~~~ + +On the backup (`https://pinboard.in/settings/backup `_) page, click on "JSON" in the "Bookmarks" section. A JSON file will be downloaded (like ``pinboard_export``). + +Import your data into wallabag 2.x +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Click on ``Import`` link in the menu, on ``Import contents`` in Pinboard section +and then select your json file and upload it. + +Your data will be imported. Data import can be a demanding process for your server. + +From Instapaper +--------------- Export your Instapaper data ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/en/user/parameters.rst b/docs/en/user/parameters.rst index 2b02a34d..eb312f7e 100644 --- a/docs/en/user/parameters.rst +++ b/docs/en/user/parameters.rst @@ -55,6 +55,7 @@ Meaning of each parameter "database_path", "``""%kernel.root_dir%/../data/db/wallabag.sqlite""``", "only for SQLite, define where to put the database file. Leave it empty for other database" "database_table_prefix", "wallabag_", "all wallabag's tables will be prefixed with that string. You can include a ``_`` for clarity" "database_socket", "null", "If your database is using a socket instead of tcp, put the path of the socket (other connection parameters will then be ignored)" + "database_charset", "utf8mb4", "For PostgreSQL & SQLite you should use utf8, for MySQL use utf8mb4 which handle emoji" .. csv-table:: Configuration to send emails from wallabag :header: "name", "default", "description" diff --git a/docs/fr/developer/maintenance.rst b/docs/fr/developer/maintenance.rst deleted file mode 100644 index 8007a85f..00000000 --- a/docs/fr/developer/maintenance.rst +++ /dev/null @@ -1,33 +0,0 @@ -Mode maintenance -================ - -Si vous devez effectuer de longues tâches sur votre instance de wallabag, vous pouvez activer le mode maintenance. -Plus personne ne pourra accéder à wallabag. - -Activer le mode maintenance ---------------------------- - -Pour activer le mode maintenance, exécutez cette commande : - -:: - - bin/console lexik:maintenance:lock --no-interaction -e=prod - -Vous pouvez spécifier votre adresse IP dans ``app/config/config.yml`` si vous souhaitez accéder à wallabag même si - le mode maintenance est activé. Par exemple : - -:: - - lexik_maintenance: - authorized: - ips: ['127.0.0.1'] - - -Désactiver le mode maintenance ------------------------------- - -Pour désactiver le mode maintenance, exécutez cette commande : - -:: - - bin/console lexik:maintenance:unlock -e=prod diff --git a/docs/fr/index.rst b/docs/fr/index.rst index 564ffe52..8a4c600a 100644 --- a/docs/fr/index.rst +++ b/docs/fr/index.rst @@ -49,5 +49,4 @@ La documentation est disponible dans d'autres langues : developer/docker developer/documentation developer/translate - developer/maintenance developer/asynchronous diff --git a/docs/fr/user/configuration.rst b/docs/fr/user/configuration.rst index 8ee0a49b..5ce80f58 100644 --- a/docs/fr/user/configuration.rst +++ b/docs/fr/user/configuration.rst @@ -26,6 +26,15 @@ Vitesse de lecture wallabag calcule une durée de lecture pour chaque article. Vous pouvez définir ici, grâce à cette liste déroulante, si vous lisez plus ou moins vite. wallabag recalculera la durée de lecture de chaque article. +Où souhaitez-vous être redirigé après avoir marqué un article comme lu ? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Chaque fois que vous ferez certaines actions (après avoir marqué un article comme lu / comme favori, +après avoir supprimé un article, après avoir retiré un tag d'un article), vous pouvez être redirigé : + +- sur la page d'accueil +- sur la page courante + Langue ~~~~~~ @@ -49,6 +58,8 @@ Mon compte Vous pouvez ici modifier votre nom, votre adresse email et activer la ``Double authentification``. +Si l'instance de wallabag compte plus d'un utilisateur actif, vous pouvez supprimer ici votre compte. **Attention, nous supprimons toutes vos données**. + Double authentification (2FA) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/fr/user/filters.rst b/docs/fr/user/filters.rst index 449bf010..5807bdbd 100644 --- a/docs/fr/user/filters.rst +++ b/docs/fr/user/filters.rst @@ -30,6 +30,11 @@ Langage wallabag (via graby) peut détecter la langue dans laquelle l'article est écrit. C'est ainsi facile pour vous de retrouver des articles écrits dans une langue spécifique. +Statut HTTP +----------- + +Vous pouvez retrouver des articles en filtrant par leur code HTTP : 200, 404, 500, etc. + Temps de lecture ---------------- diff --git a/docs/fr/user/import.rst b/docs/fr/user/import.rst index a5d53247..9a2dda8f 100644 --- a/docs/fr/user/import.rst +++ b/docs/fr/user/import.rst @@ -1,13 +1,13 @@ Migrer depuis ... ================= -Dans wallabag 2.x, vous pouvez importer des données depuis : +Dans wallabag 2.x, vous pouvez importer des données depuis : -- `Pocket <#id1>`_ -- `Readability <#id2>`_ -- `Instapaper <#id4>`_ -- `wallabag 1.x <#id6>`_ -- `wallabag 2.x <#id7>`_ +- `Pocket <#id1>`_ +- `Readability <#id2>`_ +- `Instapaper <#id4>`_ +- `wallabag 1.x <#id6>`_ +- `wallabag 2.x <#id7>`_ Nous avons aussi développé `un script pour exécuter des migrations via la ligne de commande <#import-via-la-ligne-de-commande-cli>`_. @@ -58,8 +58,24 @@ la section Readability et ensuite sélectionnez votre fichier json pour l'upload Vos données vont être importées. L'import de données est une action qui peut être couteuse pour votre serveur. -Instapaper ----------- +Depuis Pinboard +--------------- + +Exportez vos données de Pinboard +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Sur la page « Backup » (`https://pinboard.in/settings/backup `_), cliquez sur « JSON » dans la section « Bookmarks ». Un fichier json (sans extension) sera téléchargé (``pinboard_export``). + +Importez vos données dans wallabag 2.x +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Cliquez sur le lien ``Importer`` dans le menu, sur ``Importer les contenus`` dans +la section Pinboard et ensuite sélectionnez votre fichier json pour l'uploader. + +Vos données vont être importées. L'import de données est une action qui peut être couteuse pour votre serveur. + +Depuis Instapaper +----------------- Exportez vos données de Instapaper ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -136,4 +152,4 @@ Vous obtiendrez : Start : 05-04-2016 11:36:07 --- 403 imported 0 already saved - End : 05-04-2016 11:36:09 --- \ No newline at end of file + End : 05-04-2016 11:36:09 --- diff --git a/package.json b/package.json index ace74c7f..209c46c6 100644 --- a/package.json +++ b/package.json @@ -100,5 +100,9 @@ "stylelint": "^7.3.1", "stylelint-config-standard": "^13.0.2", "through": "^2.3.8" + }, + "dependencies": { + "jr-qrcode": "^1.0.5", + "mousetrap": "^1.6.0" } } diff --git a/src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php b/src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php index ad083e31..c13a034f 100644 --- a/src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php +++ b/src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php @@ -3,9 +3,8 @@ namespace Wallabag\AnnotationBundle\Controller; use FOS\RestBundle\Controller\FOSRestController; -use Nelmio\ApiDocBundle\Annotation\ApiDoc; +use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; use Wallabag\AnnotationBundle\Entity\Annotation; use Wallabag\CoreBundle\Entity\Entry; @@ -15,42 +14,35 @@ class WallabagAnnotationController extends FOSRestController /** * Retrieve annotations for an entry. * - * @ApiDoc( - * requirements={ - * {"name"="entry", "dataType"="integer", "requirement"="\w+", "description"="The entry ID"} - * } - * ) + * @param Entry $entry + * + * @see Wallabag\ApiBundle\Controller\WallabagRestController * - * @return Response + * @return JsonResponse */ public function getAnnotationsAction(Entry $entry) { $annotationRows = $this - ->getDoctrine() - ->getRepository('WallabagAnnotationBundle:Annotation') - ->findAnnotationsByPageId($entry->getId(), $this->getUser()->getId()); + ->getDoctrine() + ->getRepository('WallabagAnnotationBundle:Annotation') + ->findAnnotationsByPageId($entry->getId(), $this->getUser()->getId()); $total = count($annotationRows); $annotations = ['total' => $total, 'rows' => $annotationRows]; $json = $this->get('serializer')->serialize($annotations, 'json'); - return $this->renderJsonResponse($json); + return (new JsonResponse())->setJson($json); } /** * Creates a new annotation. * - * @param Entry $entry + * @param Request $request + * @param Entry $entry * - * @ApiDoc( - * requirements={ - * {"name"="ranges", "dataType"="array", "requirement"="\w+", "description"="The range array for the annotation"}, - * {"name"="quote", "dataType"="string", "required"=false, "description"="Optional, quote for the annotation"}, - * {"name"="text", "dataType"="string", "required"=true, "description"=""}, - * } - * ) + * @return JsonResponse * - * @return Response + * @see Wallabag\ApiBundle\Controller\WallabagRestController */ public function postAnnotationAction(Request $request, Entry $entry) { @@ -75,21 +67,20 @@ class WallabagAnnotationController extends FOSRestController $json = $this->get('serializer')->serialize($annotation, 'json'); - return $this->renderJsonResponse($json); + return (new JsonResponse())->setJson($json); } /** * Updates an annotation. * - * @ApiDoc( - * requirements={ - * {"name"="annotation", "dataType"="string", "requirement"="\w+", "description"="The annotation ID"} - * } - * ) + * @see Wallabag\ApiBundle\Controller\WallabagRestController * * @ParamConverter("annotation", class="WallabagAnnotationBundle:Annotation") * - * @return Response + * @param Annotation $annotation + * @param Request $request + * + * @return JsonResponse */ public function putAnnotationAction(Annotation $annotation, Request $request) { @@ -104,21 +95,19 @@ class WallabagAnnotationController extends FOSRestController $json = $this->get('serializer')->serialize($annotation, 'json'); - return $this->renderJsonResponse($json); + return (new JsonResponse())->setJson($json); } /** * Removes an annotation. * - * @ApiDoc( - * requirements={ - * {"name"="annotation", "dataType"="string", "requirement"="\w+", "description"="The annotation ID"} - * } - * ) + * @see Wallabag\ApiBundle\Controller\WallabagRestController * * @ParamConverter("annotation", class="WallabagAnnotationBundle:Annotation") * - * @return Response + * @param Annotation $annotation + * + * @return JsonResponse */ public function deleteAnnotationAction(Annotation $annotation) { @@ -128,19 +117,6 @@ class WallabagAnnotationController extends FOSRestController $json = $this->get('serializer')->serialize($annotation, 'json'); - return $this->renderJsonResponse($json); - } - - /** - * Send a JSON Response. - * We don't use the Symfony JsonRespone, because it takes an array as parameter instead of a JSON string. - * - * @param string $json - * - * @return Response - */ - private function renderJsonResponse($json, $code = 200) - { - return new Response($json, $code, ['application/json']); + return (new JsonResponse())->setJson($json); } } diff --git a/src/Wallabag/AnnotationBundle/Entity/Annotation.php b/src/Wallabag/AnnotationBundle/Entity/Annotation.php index c48d8731..0838f5aa 100644 --- a/src/Wallabag/AnnotationBundle/Entity/Annotation.php +++ b/src/Wallabag/AnnotationBundle/Entity/Annotation.php @@ -82,7 +82,7 @@ class Annotation * @Exclude * * @ORM\ManyToOne(targetEntity="Wallabag\CoreBundle\Entity\Entry", inversedBy="annotations") - * @ORM\JoinColumn(name="entry_id", referencedColumnName="id") + * @ORM\JoinColumn(name="entry_id", referencedColumnName="id", onDelete="cascade") */ private $entry; diff --git a/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php b/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php index 5f7da70e..8d3f07ee 100644 --- a/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php +++ b/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php @@ -50,7 +50,8 @@ class AnnotationRepository extends EntityRepository { return $this->createQueryBuilder('a') ->andWhere('a.id = :annotationId')->setParameter('annotationId', $annotationId) - ->getQuery()->getSingleResult() + ->getQuery() + ->getSingleResult() ; } @@ -67,7 +68,8 @@ class AnnotationRepository extends EntityRepository return $this->createQueryBuilder('a') ->where('a.entry = :entryId')->setParameter('entryId', $entryId) ->andwhere('a.user = :userId')->setParameter('userId', $userId) - ->getQuery()->getResult() + ->getQuery() + ->getResult() ; } @@ -106,4 +108,18 @@ class AnnotationRepository extends EntityRepository ->getQuery() ->getSingleResult(); } + + /** + * Remove all annotations for a user id. + * Used when a user want to reset all informations. + * + * @param int $userId + */ + public function removeAllByUserId($userId) + { + $this->getEntityManager() + ->createQuery('DELETE FROM Wallabag\AnnotationBundle\Entity\Annotation a WHERE a.user = :userId') + ->setParameter('userId', $userId) + ->execute(); + } } diff --git a/src/Wallabag/ApiBundle/Controller/AnnotationRestController.php b/src/Wallabag/ApiBundle/Controller/AnnotationRestController.php new file mode 100644 index 00000000..2dd26c07 --- /dev/null +++ b/src/Wallabag/ApiBundle/Controller/AnnotationRestController.php @@ -0,0 +1,111 @@ +validateAuthentication(); + + return $this->forward('WallabagAnnotationBundle:WallabagAnnotation:getAnnotations', [ + 'entry' => $entry, + ]); + } + + /** + * Creates a new annotation. + * + * @ApiDoc( + * requirements={ + * {"name"="ranges", "dataType"="array", "requirement"="\w+", "description"="The range array for the annotation"}, + * {"name"="quote", "dataType"="string", "required"=false, "description"="Optional, quote for the annotation"}, + * {"name"="text", "dataType"="string", "required"=true, "description"=""}, + * } + * ) + * + * @param Request $request + * @param Entry $entry + * + * @return JsonResponse + */ + public function postAnnotationAction(Request $request, Entry $entry) + { + $this->validateAuthentication(); + + return $this->forward('WallabagAnnotationBundle:WallabagAnnotation:postAnnotation', [ + 'request' => $request, + 'entry' => $entry, + ]); + } + + /** + * Updates an annotation. + * + * @ApiDoc( + * requirements={ + * {"name"="annotation", "dataType"="string", "requirement"="\w+", "description"="The annotation ID"} + * } + * ) + * + * @ParamConverter("annotation", class="WallabagAnnotationBundle:Annotation") + * + * @param Annotation $annotation + * @param Request $request + * + * @return JsonResponse + */ + public function putAnnotationAction(Annotation $annotation, Request $request) + { + $this->validateAuthentication(); + + return $this->forward('WallabagAnnotationBundle:WallabagAnnotation:putAnnotation', [ + 'annotation' => $annotation, + 'request' => $request, + ]); + } + + /** + * Removes an annotation. + * + * @ApiDoc( + * requirements={ + * {"name"="annotation", "dataType"="string", "requirement"="\w+", "description"="The annotation ID"} + * } + * ) + * + * @ParamConverter("annotation", class="WallabagAnnotationBundle:Annotation") + * + * @param Annotation $annotation + * + * @return JsonResponse + */ + public function deleteAnnotationAction(Annotation $annotation) + { + $this->validateAuthentication(); + + return $this->forward('WallabagAnnotationBundle:WallabagAnnotation:deleteAnnotation', [ + 'annotation' => $annotation, + ]); + } +} diff --git a/src/Wallabag/ApiBundle/Controller/DeveloperController.php b/src/Wallabag/ApiBundle/Controller/DeveloperController.php index 5a36a260..550c0608 100644 --- a/src/Wallabag/ApiBundle/Controller/DeveloperController.php +++ b/src/Wallabag/ApiBundle/Controller/DeveloperController.php @@ -19,7 +19,7 @@ class DeveloperController extends Controller */ public function indexAction() { - $clients = $this->getDoctrine()->getRepository('WallabagApiBundle:Client')->findAll(); + $clients = $this->getDoctrine()->getRepository('WallabagApiBundle:Client')->findByUser($this->getUser()->getId()); return $this->render('@WallabagCore/themes/common/Developer/index.html.twig', [ 'clients' => $clients, @@ -38,7 +38,7 @@ class DeveloperController extends Controller public function createClientAction(Request $request) { $em = $this->getDoctrine()->getManager(); - $client = new Client(); + $client = new Client($this->getUser()); $clientForm = $this->createForm(ClientType::class, $client); $clientForm->handleRequest($request); @@ -75,6 +75,10 @@ class DeveloperController extends Controller */ public function deleteClientAction(Client $client) { + if (null === $this->getUser() || $client->getUser()->getId() != $this->getUser()->getId()) { + throw $this->createAccessDeniedException('You can not access this client.'); + } + $em = $this->getDoctrine()->getManager(); $em->remove($client); $em->flush(); diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php index 24fa7b3b..c5bf1df8 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php @@ -10,6 +10,8 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\Tag; +use Wallabag\CoreBundle\Event\EntrySavedEvent; +use Wallabag\CoreBundle\Event\EntryDeletedEvent; class EntryRestController extends WallabagRestController { @@ -148,6 +150,28 @@ class EntryRestController extends WallabagRestController return (new JsonResponse())->setJson($json); } + /** + * Retrieve a single entry as a predefined format. + * + * @ApiDoc( + * requirements={ + * {"name"="entry", "dataType"="integer", "requirement"="\w+", "description"="The entry ID"} + * } + * ) + * + * @return Response + */ + public function getEntryExportAction(Entry $entry, Request $request) + { + $this->validateAuthentication(); + $this->validateUserAccess($entry->getUser()->getId()); + + return $this->get('wallabag_core.helper.entries_export') + ->setEntries($entry) + ->updateTitle('entry') + ->exportAs($request->attributes->get('_format')); + } + /** * Create an entry. * @@ -200,9 +224,11 @@ class EntryRestController extends WallabagRestController $em = $this->getDoctrine()->getManager(); $em->persist($entry); - $em->flush(); + // entry saved, dispatch event about it! + $this->get('event_dispatcher')->dispatch(EntrySavedEvent::NAME, new EntrySavedEvent($entry)); + $json = $this->get('serializer')->serialize($entry, 'json'); return (new JsonResponse())->setJson($json); @@ -279,6 +305,9 @@ class EntryRestController extends WallabagRestController $em->remove($entry); $em->flush(); + // entry deleted, dispatch event about it! + $this->get('event_dispatcher')->dispatch(EntryDeletedEvent::NAME, new EntryDeletedEvent($entry)); + $json = $this->get('serializer')->serialize($entry, 'json'); return (new JsonResponse())->setJson($json); diff --git a/src/Wallabag/ApiBundle/Controller/TagRestController.php b/src/Wallabag/ApiBundle/Controller/TagRestController.php index 4e7ddc66..bc6d4e64 100644 --- a/src/Wallabag/ApiBundle/Controller/TagRestController.php +++ b/src/Wallabag/ApiBundle/Controller/TagRestController.php @@ -131,22 +131,6 @@ class TagRestController extends WallabagRestController return (new JsonResponse())->setJson($json); } - /** - * Retrieve version number. - * - * @ApiDoc() - * - * @return JsonResponse - */ - public function getVersionAction() - { - $version = $this->container->getParameter('wallabag_core.version'); - - $json = $this->get('serializer')->serialize($version, 'json'); - - return (new JsonResponse())->setJson($json); - } - /** * Remove orphan tag in case no entries are associated to it. * diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php index e927a890..b1e08ca4 100644 --- a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php +++ b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php @@ -3,11 +3,27 @@ namespace Wallabag\ApiBundle\Controller; use FOS\RestBundle\Controller\FOSRestController; +use Nelmio\ApiDocBundle\Annotation\ApiDoc; +use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\Exception\AccessDeniedException; -use Wallabag\CoreBundle\Entity\Entry; class WallabagRestController extends FOSRestController { + /** + * Retrieve version number. + * + * @ApiDoc() + * + * @return JsonResponse + */ + public function getVersionAction() + { + $version = $this->container->getParameter('wallabag_core.version'); + $json = $this->get('serializer')->serialize($version, 'json'); + + return (new JsonResponse())->setJson($json); + } + protected function validateAuthentication() { if (false === $this->get('security.authorization_checker')->isGranted('IS_AUTHENTICATED_FULLY')) { diff --git a/src/Wallabag/ApiBundle/Entity/Client.php b/src/Wallabag/ApiBundle/Entity/Client.php index f7898ac8..427a4c7f 100644 --- a/src/Wallabag/ApiBundle/Entity/Client.php +++ b/src/Wallabag/ApiBundle/Entity/Client.php @@ -4,6 +4,7 @@ namespace Wallabag\ApiBundle\Entity; use Doctrine\ORM\Mapping as ORM; use FOS\OAuthServerBundle\Entity\Client as BaseClient; +use Wallabag\UserBundle\Entity\User; /** * @ORM\Table("oauth2_clients") @@ -35,9 +36,15 @@ class Client extends BaseClient */ protected $accessTokens; - public function __construct() + /** + * @ORM\ManyToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="clients") + */ + private $user; + + public function __construct(User $user) { parent::__construct(); + $this->user = $user; } /** @@ -63,4 +70,12 @@ class Client extends BaseClient return $this; } + + /** + * @return User + */ + public function getUser() + { + return $this->user; + } } diff --git a/src/Wallabag/ApiBundle/Resources/config/routing_rest.yml b/src/Wallabag/ApiBundle/Resources/config/routing_rest.yml index c1af9e02..57d37f4b 100644 --- a/src/Wallabag/ApiBundle/Resources/config/routing_rest.yml +++ b/src/Wallabag/ApiBundle/Resources/config/routing_rest.yml @@ -1,9 +1,19 @@ -entries: +entry: type: rest - resource: "WallabagApiBundle:EntryRest" + resource: "WallabagApiBundle:EntryRest" name_prefix: api_ -tags: +tag: type: rest - resource: "WallabagApiBundle:TagRest" + resource: "WallabagApiBundle:TagRest" + name_prefix: api_ + +annotation: + type: rest + resource: "WallabagApiBundle:AnnotationRest" + name_prefix: api_ + +misc: + type: rest + resource: "WallabagApiBundle:WallabagRest" name_prefix: api_ diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php index 2daf2dd8..e95c3a7b 100644 --- a/src/Wallabag/CoreBundle/Command/InstallCommand.php +++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php @@ -40,7 +40,7 @@ class InstallCommand extends ContainerAwareCommand { $this ->setName('wallabag:install') - ->setDescription('Wallabag installer.') + ->setDescription('wallabag installer.') ->addOption( 'reset', null, @@ -55,7 +55,7 @@ class InstallCommand extends ContainerAwareCommand $this->defaultInput = $input; $this->defaultOutput = $output; - $output->writeln('Installing Wallabag...'); + $output->writeln('Installing wallabag...'); $output->writeln(''); $this @@ -65,7 +65,7 @@ class InstallCommand extends ContainerAwareCommand ->setupConfig() ; - $output->writeln('Wallabag has been successfully installed.'); + $output->writeln('wallabag has been successfully installed.'); $output->writeln('Just execute `php bin/console server:run --env=prod` for using wallabag: http://localhost:8000'); } @@ -78,7 +78,7 @@ class InstallCommand extends ContainerAwareCommand // testing if database driver exists $fulfilled = true; - $label = 'PDO Driver'; + $label = 'PDO Driver (%s)'; $status = 'OK!'; $help = ''; @@ -88,7 +88,7 @@ class InstallCommand extends ContainerAwareCommand $help = 'Database driver "'.$this->getContainer()->getParameter('database_driver').'" is not installed.'; } - $rows[] = [$label, $status, $help]; + $rows[] = [sprintf($label, $this->getContainer()->getParameter('database_driver')), $status, $help]; // testing if connection to the database can be etablished $label = 'Database connection'; @@ -96,7 +96,8 @@ class InstallCommand extends ContainerAwareCommand $help = ''; try { - $doctrineManager->getConnection()->connect(); + $conn = $this->getContainer()->get('doctrine')->getManager()->getConnection(); + $conn->connect(); } catch (\Exception $e) { if (false === strpos($e->getMessage(), 'Unknown database') && false === strpos($e->getMessage(), 'database "'.$this->getContainer()->getParameter('database_name').'" does not exist')) { @@ -108,12 +109,25 @@ class InstallCommand extends ContainerAwareCommand $rows[] = [$label, $status, $help]; - // testing if PostgreSQL > 9.1 - $label = 'SGBD version'; + // check MySQL & PostgreSQL version + $label = 'Database version'; $status = 'OK!'; $help = ''; - if ('postgresql' === $doctrineManager->getConnection()->getSchemaManager()->getDatabasePlatform()->getName()) { + // now check if MySQL isn't too old to handle utf8mb4 + if ($conn->isConnected() && 'mysql' === $conn->getDatabasePlatform()->getName()) { + $version = $conn->query('select version()')->fetchColumn(); + $minimalVersion = '5.5.4'; + + if (false === version_compare($version, $minimalVersion, '>')) { + $fulfilled = false; + $status = 'ERROR!'; + $help = 'Your MySQL version ('.$version.') is too old, consider upgrading ('.$minimalVersion.'+).'; + } + } + + // testing if PostgreSQL > 9.1 + if ($conn->isConnected() && 'postgresql' === $conn->getDatabasePlatform()->getName()) { // return version should be like "PostgreSQL 9.5.4 on x86_64-apple-darwin15.6.0, compiled by Apple LLVM version 8.0.0 (clang-800.0.38), 64-bit" $version = $doctrineManager->getConnection()->query('SELECT version();')->fetchColumn(); @@ -152,7 +166,7 @@ class InstallCommand extends ContainerAwareCommand throw new \RuntimeException('Some system requirements are not fulfilled. Please check output messages and fix them.'); } - $this->defaultOutput->writeln('Success! Your system can run Wallabag properly.'); + $this->defaultOutput->writeln('Success! Your system can run wallabag properly.'); $this->defaultOutput->writeln(''); @@ -298,6 +312,16 @@ class InstallCommand extends ContainerAwareCommand 'value' => 'http://diasporapod.com', 'section' => 'entry', ], + [ + 'name' => 'share_unmark', + 'value' => '1', + 'section' => 'entry', + ], + [ + 'name' => 'unmark_url', + 'value' => 'https://unmark.it', + 'section' => 'entry', + ], [ 'name' => 'share_shaarli', 'value' => '1', @@ -375,7 +399,7 @@ class InstallCommand extends ContainerAwareCommand ], [ 'name' => 'wallabag_url', - 'value' => 'http://v2.wallabag.org', + 'value' => '', 'section' => 'misc', ], [ @@ -403,6 +427,11 @@ class InstallCommand extends ContainerAwareCommand 'value' => 'wallabag', 'section' => 'misc', ], + [ + 'name' => 'download_images_enabled', + 'value' => '0', + 'section' => 'misc', + ], ]; foreach ($settings as $setting) { diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php index 46fb9503..52a03070 100644 --- a/src/Wallabag/CoreBundle/Controller/ConfigController.php +++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php @@ -7,6 +7,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; use Wallabag\CoreBundle\Entity\Config; use Wallabag\CoreBundle\Entity\TaggingRule; use Wallabag\CoreBundle\Form\Type\ConfigType; @@ -150,6 +151,10 @@ class ConfigController extends Controller 'token' => $config->getRssToken(), ], 'twofactor_auth' => $this->getParameter('twofactor_auth'), + 'wallabag_url' => $this->get('craue_config')->get('wallabag_url'), + 'enabled_users' => $this->getDoctrine() + ->getRepository('WallabagUserBundle:User') + ->getSumEnabledUsers(), ]); } @@ -222,6 +227,78 @@ class ConfigController extends Controller return $this->redirect($this->generateUrl('config').'?tagging-rule='.$rule->getId().'#set5'); } + /** + * Remove all annotations OR tags OR entries for the current user. + * + * @Route("/reset/{type}", requirements={"id" = "annotations|tags|entries"}, name="config_reset") + * + * @return RedirectResponse + */ + public function resetAction($type) + { + switch ($type) { + case 'annotations': + $this->getDoctrine() + ->getRepository('WallabagAnnotationBundle:Annotation') + ->removeAllByUserId($this->getUser()->getId()); + break; + + case 'tags': + $this->removeAllTagsByUserId($this->getUser()->getId()); + break; + + case 'entries': + // SQLite doesn't care about cascading remove, so we need to manually remove associated stuf + // otherwise they won't be removed ... + if ($this->get('doctrine')->getConnection()->getDriver() instanceof \Doctrine\DBAL\Driver\PDOSqlite\Driver) { + $this->getDoctrine()->getRepository('WallabagAnnotationBundle:Annotation')->removeAllByUserId($this->getUser()->getId()); + } + + // manually remove tags to avoid orphan tag + $this->removeAllTagsByUserId($this->getUser()->getId()); + + $this->getDoctrine() + ->getRepository('WallabagCoreBundle:Entry') + ->removeAllByUserId($this->getUser()->getId()); + } + + $this->get('session')->getFlashBag()->add( + 'notice', + 'flashes.config.notice.'.$type.'_reset' + ); + + return $this->redirect($this->generateUrl('config').'#set3'); + } + + /** + * Remove all tags for a given user and cleanup orphan tags. + * + * @param int $userId + */ + private function removeAllTagsByUserId($userId) + { + $tags = $this->getDoctrine()->getRepository('WallabagCoreBundle:Tag')->findAllTags($userId); + + if (empty($tags)) { + return; + } + + $this->getDoctrine() + ->getRepository('WallabagCoreBundle:Entry') + ->removeTags($userId, $tags); + + // cleanup orphan tags + $em = $this->getDoctrine()->getManager(); + + foreach ($tags as $tag) { + if (count($tag->getEntries()) === 0) { + $em->remove($tag); + } + } + + $em->flush(); + } + /** * Validate that a rule can be edited/deleted by the current user. * @@ -253,4 +330,37 @@ class ConfigController extends Controller return $config; } + + /** + * Delete account for current user. + * + * @Route("/account/delete", name="delete_account") + * + * @param Request $request + * + * @throws AccessDeniedHttpException + * + * @return \Symfony\Component\HttpFoundation\RedirectResponse + */ + public function deleteAccountAction(Request $request) + { + $enabledUsers = $this->getDoctrine() + ->getRepository('WallabagUserBundle:User') + ->getSumEnabledUsers(); + + if ($enabledUsers <= 1) { + throw new AccessDeniedHttpException(); + } + + $user = $this->getUser(); + + // logout current user + $this->get('security.token_storage')->setToken(null); + $request->getSession()->invalidate(); + + $em = $this->get('fos_user.user_manager'); + $em->deleteUser($user); + + return $this->redirect($this->generateUrl('fos_user_security_login')); + } } diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index 97bb3d12..3f4eb17d 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php @@ -13,6 +13,8 @@ use Wallabag\CoreBundle\Form\Type\EntryFilterType; use Wallabag\CoreBundle\Form\Type\EditEntryType; use Wallabag\CoreBundle\Form\Type\NewEntryType; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache; +use Wallabag\CoreBundle\Event\EntrySavedEvent; +use Wallabag\CoreBundle\Event\EntryDeletedEvent; class EntryController extends Controller { @@ -81,6 +83,9 @@ class EntryController extends Controller $em->persist($entry); $em->flush(); + // entry saved, dispatch event about it! + $this->get('event_dispatcher')->dispatch(EntrySavedEvent::NAME, new EntrySavedEvent($entry)); + return $this->redirect($this->generateUrl('homepage')); } @@ -107,6 +112,9 @@ class EntryController extends Controller $em = $this->getDoctrine()->getManager(); $em->persist($entry); $em->flush(); + + // entry saved, dispatch event about it! + $this->get('event_dispatcher')->dispatch(EntrySavedEvent::NAME, new EntrySavedEvent($entry)); } return $this->redirect($this->generateUrl('homepage')); @@ -343,6 +351,9 @@ class EntryController extends Controller $em->persist($entry); $em->flush(); + // entry saved, dispatch event about it! + $this->get('event_dispatcher')->dispatch(EntrySavedEvent::NAME, new EntrySavedEvent($entry)); + return $this->redirect($this->generateUrl('view', ['id' => $entry->getId()])); } @@ -431,6 +442,9 @@ class EntryController extends Controller UrlGeneratorInterface::ABSOLUTE_PATH ); + // entry deleted, dispatch event about it! + $this->get('event_dispatcher')->dispatch(EntryDeletedEvent::NAME, new EntryDeletedEvent($entry)); + $em = $this->getDoctrine()->getManager(); $em->remove($entry); $em->flush(); diff --git a/src/Wallabag/CoreBundle/Controller/TagController.php b/src/Wallabag/CoreBundle/Controller/TagController.php index 707f3bbe..a3e70fd0 100644 --- a/src/Wallabag/CoreBundle/Controller/TagController.php +++ b/src/Wallabag/CoreBundle/Controller/TagController.php @@ -90,15 +90,15 @@ class TagController extends Controller $flatTags = []; - foreach ($tags as $key => $tag) { + foreach ($tags as $tag) { $nbEntries = $this->getDoctrine() ->getRepository('WallabagCoreBundle:Entry') - ->countAllEntriesByUserIdAndTagId($this->getUser()->getId(), $tag['id']); + ->countAllEntriesByUserIdAndTagId($this->getUser()->getId(), $tag->getId()); $flatTags[] = [ - 'id' => $tag['id'], - 'label' => $tag['label'], - 'slug' => $tag['slug'], + 'id' => $tag->getId(), + 'label' => $tag->getLabel(), + 'slug' => $tag->getSlug(), 'nbEntries' => $nbEntries, ]; } diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php index 921c739f..45358022 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php +++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php @@ -21,6 +21,7 @@ class LoadConfigData extends AbstractFixture implements OrderedFixtureInterface $adminConfig->setReadingSpeed(1); $adminConfig->setLanguage('en'); $adminConfig->setPocketConsumerKey('xxxxx'); + $adminConfig->setActionMarkAsRead(0); $manager->persist($adminConfig); @@ -32,6 +33,7 @@ class LoadConfigData extends AbstractFixture implements OrderedFixtureInterface $bobConfig->setReadingSpeed(1); $bobConfig->setLanguage('fr'); $bobConfig->setPocketConsumerKey(null); + $bobConfig->setActionMarkAsRead(1); $manager->persist($bobConfig); @@ -43,6 +45,7 @@ class LoadConfigData extends AbstractFixture implements OrderedFixtureInterface $emptyConfig->setReadingSpeed(1); $emptyConfig->setLanguage('en'); $emptyConfig->setPocketConsumerKey(null); + $emptyConfig->setActionMarkAsRead(0); $manager->persist($emptyConfig); diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php index a5e1be65..1f74891a 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php +++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php @@ -35,6 +35,16 @@ class LoadSettingData extends AbstractFixture implements OrderedFixtureInterface 'value' => 'http://diasporapod.com', 'section' => 'entry', ], + [ + 'name' => 'share_unmark', + 'value' => '1', + 'section' => 'entry', + ], + [ + 'name' => 'unmark_url', + 'value' => 'https://unmark.it', + 'section' => 'entry', + ], [ 'name' => 'share_shaarli', 'value' => '1', @@ -140,6 +150,11 @@ class LoadSettingData extends AbstractFixture implements OrderedFixtureInterface 'value' => 'wallabag', 'section' => 'misc', ], + [ + 'name' => 'download_images_enabled', + 'value' => '0', + 'section' => 'misc', + ], ]; foreach ($settings as $setting) { @@ -158,6 +173,6 @@ class LoadSettingData extends AbstractFixture implements OrderedFixtureInterface */ public function getOrder() { - return 50; + return 29; } } diff --git a/src/Wallabag/CoreBundle/Entity/Config.php b/src/Wallabag/CoreBundle/Entity/Config.php index 69393ac9..e04f0a7b 100644 --- a/src/Wallabag/CoreBundle/Entity/Config.php +++ b/src/Wallabag/CoreBundle/Entity/Config.php @@ -16,6 +16,9 @@ use Wallabag\UserBundle\Entity\User; */ class Config { + const REDIRECT_TO_HOMEPAGE = 0; + const REDIRECT_TO_CURRENT_PAGE = 1; + /** * @var int * @@ -87,6 +90,13 @@ class Config */ private $pocketConsumerKey; + /** + * @var int + * + * @ORM\Column(name="action_mark_as_read", type="integer", nullable=true) + */ + private $actionMarkAsRead; + /** * @ORM\OneToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="config") */ @@ -309,6 +319,26 @@ class Config return $this->pocketConsumerKey; } + /** + * @return int + */ + public function getActionMarkAsRead() + { + return $this->actionMarkAsRead; + } + + /** + * @param int $actionMarkAsRead + * + * @return Config + */ + public function setActionMarkAsRead($actionMarkAsRead) + { + $this->actionMarkAsRead = $actionMarkAsRead; + + return $this; + } + /** * @param TaggingRule $rule * diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index f2da3f4d..3cf9ac1a 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php @@ -19,7 +19,11 @@ use Wallabag\AnnotationBundle\Entity\Annotation; * * @XmlRoot("entry") * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\EntryRepository") - * @ORM\Table(name="`entry`") + * @ORM\Table( + * name="`entry`", + * options={"collate"="utf8mb4_unicode_ci", "charset"="utf8mb4"}, + * indexes={@ORM\Index(name="created_at", columns={"created_at"})} + * ) * @ORM\HasLifecycleCallbacks() * @Hateoas\Relation("self", href = "expr('/api/entries/' ~ object.getId())") */ @@ -176,6 +180,15 @@ class Entry */ private $isPublic; + /** + * @var string + * + * @ORM\Column(name="http_status", type="text", nullable=true) + * + * @Groups({"entries_for_user", "export_all"}) + */ + private $httpStatus; + /** * @Exclude * @@ -190,10 +203,10 @@ class Entry * @ORM\JoinTable( * name="entry_tag", * joinColumns={ - * @ORM\JoinColumn(name="entry_id", referencedColumnName="id") + * @ORM\JoinColumn(name="entry_id", referencedColumnName="id", onDelete="cascade") * }, * inverseJoinColumns={ - * @ORM\JoinColumn(name="tag_id", referencedColumnName="id") + * @ORM\JoinColumn(name="tag_id", referencedColumnName="id", onDelete="cascade") * } * ) */ @@ -665,4 +678,24 @@ class Entry { $this->uuid = null; } + + /** + * @return int + */ + public function getHttpStatus() + { + return $this->httpStatus; + } + + /** + * @param int $httpStatus + * + * @return Entry + */ + public function setHttpStatus($httpStatus) + { + $this->httpStatus = $httpStatus; + + return $this; + } } diff --git a/src/Wallabag/CoreBundle/Event/EntryDeletedEvent.php b/src/Wallabag/CoreBundle/Event/EntryDeletedEvent.php new file mode 100644 index 00000000..e9061d04 --- /dev/null +++ b/src/Wallabag/CoreBundle/Event/EntryDeletedEvent.php @@ -0,0 +1,26 @@ +entry = $entry; + } + + public function getEntry() + { + return $this->entry; + } +} diff --git a/src/Wallabag/CoreBundle/Event/EntrySavedEvent.php b/src/Wallabag/CoreBundle/Event/EntrySavedEvent.php new file mode 100644 index 00000000..5fdb5221 --- /dev/null +++ b/src/Wallabag/CoreBundle/Event/EntrySavedEvent.php @@ -0,0 +1,26 @@ +entry = $entry; + } + + public function getEntry() + { + return $this->entry; + } +} diff --git a/src/Wallabag/CoreBundle/EventListener/LocaleListener.php b/src/Wallabag/CoreBundle/Event/Listener/LocaleListener.php similarity index 96% rename from src/Wallabag/CoreBundle/EventListener/LocaleListener.php rename to src/Wallabag/CoreBundle/Event/Listener/LocaleListener.php index a1c7e5ab..b435d99e 100644 --- a/src/Wallabag/CoreBundle/EventListener/LocaleListener.php +++ b/src/Wallabag/CoreBundle/Event/Listener/LocaleListener.php @@ -1,6 +1,6 @@ em = $em; + $this->downloadImages = $downloadImages; + $this->enabled = $enabled; + $this->logger = $logger; + } + + public static function getSubscribedEvents() + { + return [ + EntrySavedEvent::NAME => 'onEntrySaved', + EntryDeletedEvent::NAME => 'onEntryDeleted', + ]; + } + + /** + * Download images and updated the data into the entry. + * + * @param EntrySavedEvent $event + */ + public function onEntrySaved(EntrySavedEvent $event) + { + if (!$this->enabled) { + $this->logger->debug('DownloadImagesSubscriber: disabled.'); + + return; + } + + $entry = $event->getEntry(); + + $html = $this->downloadImages($entry); + if (false !== $html) { + $this->logger->debug('DownloadImagesSubscriber: updated html.'); + + $entry->setContent($html); + } + + // update preview picture + $previewPicture = $this->downloadPreviewImage($entry); + if (false !== $previewPicture) { + $this->logger->debug('DownloadImagesSubscriber: update preview picture.'); + + $entry->setPreviewPicture($previewPicture); + } + + $this->em->persist($entry); + $this->em->flush(); + } + + /** + * Remove images related to the entry. + * + * @param EntryDeletedEvent $event + */ + public function onEntryDeleted(EntryDeletedEvent $event) + { + if (!$this->enabled) { + $this->logger->debug('DownloadImagesSubscriber: disabled.'); + + return; + } + + $this->downloadImages->removeImages($event->getEntry()->getId()); + } + + /** + * Download all images from the html. + * + * @todo If we want to add async download, it should be done in that method + * + * @param Entry $entry + * + * @return string|false False in case of async + */ + private function downloadImages(Entry $entry) + { + return $this->downloadImages->processHtml( + $entry->getId(), + $entry->getContent(), + $entry->getUrl() + ); + } + + /** + * Download the preview picture. + * + * @todo If we want to add async download, it should be done in that method + * + * @param Entry $entry + * + * @return string|false False in case of async + */ + private function downloadPreviewImage(Entry $entry) + { + return $this->downloadImages->processSingleImage( + $entry->getId(), + $entry->getPreviewPicture(), + $entry->getUrl() + ); + } +} diff --git a/src/Wallabag/CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php b/src/Wallabag/CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php new file mode 100644 index 00000000..3b4c4cf9 --- /dev/null +++ b/src/Wallabag/CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php @@ -0,0 +1,70 @@ +doctrine = $doctrine; + } + + /** + * @return array + */ + public function getSubscribedEvents() + { + return [ + 'preRemove', + ]; + } + + /** + * We removed everything related to the upcoming removed entry because SQLite can't handle it on it own. + * We do it in the preRemove, because we can't retrieve tags in the postRemove (because the entry id is gone). + * + * @param LifecycleEventArgs $args + */ + public function preRemove(LifecycleEventArgs $args) + { + $entity = $args->getEntity(); + + if (!$this->doctrine->getConnection()->getDriver() instanceof \Doctrine\DBAL\Driver\PDOSqlite\Driver || + !$entity instanceof Entry) { + return; + } + + $em = $this->doctrine->getManager(); + + if (null !== $entity->getTags()) { + foreach ($entity->getTags() as $tag) { + $entity->removeTag($tag); + } + } + + if (null !== $entity->getAnnotations()) { + foreach ($entity->getAnnotations() as $annotation) { + $em->remove($annotation); + } + } + + $em->flush(); + } +} diff --git a/src/Wallabag/CoreBundle/Subscriber/TablePrefixSubscriber.php b/src/Wallabag/CoreBundle/Event/Subscriber/TablePrefixSubscriber.php similarity index 91% rename from src/Wallabag/CoreBundle/Subscriber/TablePrefixSubscriber.php rename to src/Wallabag/CoreBundle/Event/Subscriber/TablePrefixSubscriber.php index 0379ad6a..711c3bf8 100644 --- a/src/Wallabag/CoreBundle/Subscriber/TablePrefixSubscriber.php +++ b/src/Wallabag/CoreBundle/Event/Subscriber/TablePrefixSubscriber.php @@ -1,6 +1,6 @@ setTableName($this->prefix.$classMetadata->getTableName()); + $classMetadata->setPrimaryTable(['name' => $this->prefix.$classMetadata->getTableName()]); foreach ($classMetadata->getAssociationMappings() as $fieldName => $mapping) { if ($mapping['type'] === ClassMetadataInfo::MANY_TO_MANY && isset($classMetadata->associationMappings[$fieldName]['joinTable']['name'])) { diff --git a/src/Wallabag/CoreBundle/Form/Type/ConfigType.php b/src/Wallabag/CoreBundle/Form/Type/ConfigType.php index 0bac2874..7e3b9dd4 100644 --- a/src/Wallabag/CoreBundle/Form/Type/ConfigType.php +++ b/src/Wallabag/CoreBundle/Form/Type/ConfigType.php @@ -7,6 +7,7 @@ use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; +use Wallabag\CoreBundle\Entity\Config; class ConfigType extends AbstractType { @@ -48,6 +49,13 @@ class ConfigType extends AbstractType 'config.form_settings.reading_speed.400_word' => '2', ], ]) + ->add('action_mark_as_read', ChoiceType::class, [ + 'label' => 'config.form_settings.action_mark_as_read.label', + 'choices' => [ + 'config.form_settings.action_mark_as_read.redirect_homepage' => Config::REDIRECT_TO_HOMEPAGE, + 'config.form_settings.action_mark_as_read.redirect_current_page' => Config::REDIRECT_TO_CURRENT_PAGE, + ], + ]) ->add('language', ChoiceType::class, [ 'choices' => array_flip($this->languages), 'label' => 'config.form_settings.language_label', diff --git a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php index a3e36fdd..7b02f85c 100644 --- a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php +++ b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php @@ -11,6 +11,7 @@ use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\CheckboxFilterType; use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\ChoiceFilterType; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\HttpFoundation\Response; use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; @@ -95,6 +96,21 @@ class EntryFilterType extends AbstractType }, 'label' => 'entry.filters.domain_label', ]) + ->add('httpStatus', TextFilterType::class, [ + 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { + $value = $values['value']; + if (false === array_key_exists($value, Response::$statusTexts)) { + return; + } + + $paramName = sprintf('%s', str_replace('.', '_', $field)); + $expression = $filterQuery->getExpr()->eq($field, ':'.$paramName); + $parameters = array($paramName => $value); + + return $filterQuery->createCondition($expression, $parameters); + }, + 'label' => 'entry.filters.http_status_label', + ]) ->add('isArchived', CheckboxFilterType::class, [ 'label' => 'entry.filters.archived_label', ]) diff --git a/src/Wallabag/CoreBundle/Form/Type/NewTagType.php b/src/Wallabag/CoreBundle/Form/Type/NewTagType.php index 3db4105f..e830ade4 100644 --- a/src/Wallabag/CoreBundle/Form/Type/NewTagType.php +++ b/src/Wallabag/CoreBundle/Form/Type/NewTagType.php @@ -3,6 +3,7 @@ namespace Wallabag\CoreBundle\Form\Type; use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; @@ -12,7 +13,15 @@ class NewTagType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('label', TextType::class, ['required' => true]) + ->add('label', TextType::class, [ + 'required' => true, + 'attr' => [ + 'placeholder' => 'tag.new.placeholder', + ], + ]) + ->add('add', SubmitType::class, [ + 'label' => 'tag.new.add', + ]) ; } diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php index bbd5db5d..fd059325 100644 --- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php +++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php @@ -3,7 +3,7 @@ namespace Wallabag\CoreBundle\Helper; use Graby\Graby; -use Psr\Log\LoggerInterface as Logger; +use Psr\Log\LoggerInterface; use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\Tag; use Wallabag\CoreBundle\Tools\Utils; @@ -22,7 +22,7 @@ class ContentProxy protected $tagRepository; protected $mimeGuesser; - public function __construct(Graby $graby, RuleBasedTagger $tagger, TagRepository $tagRepository, Logger $logger) + public function __construct(Graby $graby, RuleBasedTagger $tagger, TagRepository $tagRepository, LoggerInterface $logger) { $this->graby = $graby; $this->tagger = $tagger; @@ -69,6 +69,8 @@ class ContentProxy $entry->setUrl($content['url'] ?: $url); $entry->setTitle($title); $entry->setContent($html); + $entry->setHttpStatus(isset($content['status']) ? $content['status'] : ''); + $entry->setLanguage($content['language']); $entry->setMimetype($content['content_type']); $entry->setReadingTime(Utils::getReadingTime($html)); diff --git a/src/Wallabag/CoreBundle/Helper/DownloadImages.php b/src/Wallabag/CoreBundle/Helper/DownloadImages.php new file mode 100644 index 00000000..264bc6a3 --- /dev/null +++ b/src/Wallabag/CoreBundle/Helper/DownloadImages.php @@ -0,0 +1,233 @@ +client = $client; + $this->baseFolder = $baseFolder; + $this->wallabagUrl = rtrim($wallabagUrl, '/'); + $this->logger = $logger; + $this->mimeGuesser = new MimeTypeExtensionGuesser(); + + $this->setFolder(); + } + + /** + * Setup base folder where all images are going to be saved. + */ + private function setFolder() + { + // if folder doesn't exist, attempt to create one and store the folder name in property $folder + if (!file_exists($this->baseFolder)) { + mkdir($this->baseFolder, 0777, true); + } + } + + /** + * Process the html and extract image from it, save them to local and return the updated html. + * + * @param int $entryId ID of the entry + * @param string $html + * @param string $url Used as a base path for relative image and folder + * + * @return string + */ + public function processHtml($entryId, $html, $url) + { + $crawler = new Crawler($html); + $result = $crawler + ->filterXpath('//img') + ->extract(array('src')); + + $relativePath = $this->getRelativePath($entryId); + + // download and save the image to the folder + foreach ($result as $image) { + $imagePath = $this->processSingleImage($entryId, $image, $url, $relativePath); + + if (false === $imagePath) { + continue; + } + + $html = str_replace($image, $imagePath, $html); + } + + return $html; + } + + /** + * Process a single image: + * - retrieve it + * - re-saved it (for security reason) + * - return the new local path. + * + * @param int $entryId ID of the entry + * @param string $imagePath Path to the image to retrieve + * @param string $url Url from where the image were found + * @param string $relativePath Relative local path to saved the image + * + * @return string Relative url to access the image from the web + */ + public function processSingleImage($entryId, $imagePath, $url, $relativePath = null) + { + if (null === $relativePath) { + $relativePath = $this->getRelativePath($entryId); + } + + $this->logger->debug('DownloadImages: working on image: '.$imagePath); + + $folderPath = $this->baseFolder.'/'.$relativePath; + + // build image path + $absolutePath = $this->getAbsoluteLink($url, $imagePath); + if (false === $absolutePath) { + $this->logger->error('DownloadImages: Can not determine the absolute path for that image, skipping.'); + + return false; + } + + try { + $res = $this->client->get($absolutePath); + } catch (\Exception $e) { + $this->logger->error('DownloadImages: Can not retrieve image, skipping.', ['exception' => $e]); + + return false; + } + + $ext = $this->mimeGuesser->guess($res->getHeader('content-type')); + $this->logger->debug('DownloadImages: Checking extension', ['ext' => $ext, 'header' => $res->getHeader('content-type')]); + if (!in_array($ext, ['jpeg', 'jpg', 'gif', 'png'], true)) { + $this->logger->error('DownloadImages: Processed image with not allowed extension. Skipping '.$imagePath); + + return false; + } + $hashImage = hash('crc32', $absolutePath); + $localPath = $folderPath.'/'.$hashImage.'.'.$ext; + + try { + $im = imagecreatefromstring($res->getBody()); + } catch (\Exception $e) { + $im = false; + } + + if (false === $im) { + $this->logger->error('DownloadImages: Error while regenerating image', ['path' => $localPath]); + + return false; + } + + switch ($ext) { + case 'gif': + imagegif($im, $localPath); + $this->logger->debug('DownloadImages: Re-creating gif'); + break; + case 'jpeg': + case 'jpg': + imagejpeg($im, $localPath, self::REGENERATE_PICTURES_QUALITY); + $this->logger->debug('DownloadImages: Re-creating jpg'); + break; + case 'png': + imagepng($im, $localPath, ceil(self::REGENERATE_PICTURES_QUALITY / 100 * 9)); + $this->logger->debug('DownloadImages: Re-creating png'); + } + + imagedestroy($im); + + return $this->wallabagUrl.'/assets/images/'.$relativePath.'/'.$hashImage.'.'.$ext; + } + + /** + * Remove all images for the given entry id. + * + * @param int $entryId ID of the entry + */ + public function removeImages($entryId) + { + $relativePath = $this->getRelativePath($entryId); + $folderPath = $this->baseFolder.'/'.$relativePath; + + $finder = new Finder(); + $finder + ->files() + ->ignoreDotFiles(true) + ->in($folderPath); + + foreach ($finder as $file) { + @unlink($file->getRealPath()); + } + + @rmdir($folderPath); + } + + /** + * Generate the folder where we are going to save images based on the entry url. + * + * @param int $entryId ID of the entry + * + * @return string + */ + private function getRelativePath($entryId) + { + $hashId = hash('crc32', $entryId); + $relativePath = $hashId[0].'/'.$hashId[1].'/'.$hashId; + $folderPath = $this->baseFolder.'/'.$relativePath; + + if (!file_exists($folderPath)) { + mkdir($folderPath, 0777, true); + } + + $this->logger->debug('DownloadImages: Folder used for that Entry id', ['folder' => $folderPath, 'entryId' => $entryId]); + + return $relativePath; + } + + /** + * Make an $url absolute based on the $base. + * + * @see Graby->makeAbsoluteStr + * + * @param string $base Base url + * @param string $url Url to make it absolute + * + * @return false|string + */ + private function getAbsoluteLink($base, $url) + { + if (preg_match('!^https?://!i', $url)) { + // already absolute + return $url; + } + + $base = new \SimplePie_IRI($base); + + // remove '//' in URL path (causes URLs not to resolve properly) + if (isset($base->ipath)) { + $base->ipath = preg_replace('!//+!', '/', $base->ipath); + } + + if ($absolute = \SimplePie_IRI::absolutize($base, $url)) { + return $absolute->get_uri(); + } + + $this->logger->error('DownloadImages: Can not make an absolute link', ['base' => $base, 'url' => $url]); + + return false; + } +} diff --git a/src/Wallabag/CoreBundle/Helper/Redirect.php b/src/Wallabag/CoreBundle/Helper/Redirect.php index c14c79d1..f78b7fe0 100644 --- a/src/Wallabag/CoreBundle/Helper/Redirect.php +++ b/src/Wallabag/CoreBundle/Helper/Redirect.php @@ -3,6 +3,8 @@ namespace Wallabag\CoreBundle\Helper; use Symfony\Component\Routing\Router; +use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; +use Wallabag\CoreBundle\Entity\Config; /** * Manage redirections to avoid redirecting to empty routes. @@ -10,10 +12,12 @@ use Symfony\Component\Routing\Router; class Redirect { private $router; + private $tokenStorage; - public function __construct(Router $router) + public function __construct(Router $router, TokenStorageInterface $tokenStorage) { $this->router = $router; + $this->tokenStorage = $tokenStorage; } /** @@ -24,6 +28,16 @@ class Redirect */ public function to($url, $fallback = '') { + $user = $this->tokenStorage->getToken() ? $this->tokenStorage->getToken()->getUser() : null; + + if (null === $user || !is_object($user)) { + return $url; + } + + if (Config::REDIRECT_TO_HOMEPAGE === $user->getConfig()->getActionMarkAsRead()) { + return $this->router->generate('homepage'); + } + if (null !== $url) { return $url; } diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index 4f03ae0f..61be5220 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -329,4 +329,18 @@ class EntryRepository extends EntityRepository return $qb->getQuery()->getSingleScalarResult(); } + + /** + * Remove all entries for a user id. + * Used when a user want to reset all informations. + * + * @param int $userId + */ + public function removeAllByUserId($userId) + { + $this->getEntityManager() + ->createQuery('DELETE FROM Wallabag\CoreBundle\Entity\Entry e WHERE e.user = :userId') + ->setParameter('userId', $userId) + ->execute(); + } } diff --git a/src/Wallabag/CoreBundle/Repository/TagRepository.php b/src/Wallabag/CoreBundle/Repository/TagRepository.php index e76878d4..81445989 100644 --- a/src/Wallabag/CoreBundle/Repository/TagRepository.php +++ b/src/Wallabag/CoreBundle/Repository/TagRepository.php @@ -34,6 +34,9 @@ class TagRepository extends EntityRepository /** * Find all tags per user. + * Instead of just left joined on the Entry table, we select only id and group by id to avoid tag multiplication in results. + * Once we have all tags id, we can safely request them one by one. + * This'll still be fastest than the previous query. * * @param int $userId * @@ -41,15 +44,20 @@ class TagRepository extends EntityRepository */ public function findAllTags($userId) { - return $this->createQueryBuilder('t') - ->select('t.slug', 't.label', 't.id') + $ids = $this->createQueryBuilder('t') + ->select('t.id') ->leftJoin('t.entries', 'e') ->where('e.user = :userId')->setParameter('userId', $userId) - ->groupBy('t.slug') - ->addGroupBy('t.label') - ->addGroupBy('t.id') + ->groupBy('t.id') ->getQuery() ->getArrayResult(); + + $tags = []; + foreach ($ids as $id) { + $tags[] = $this->find($id); + } + + return $tags; } /** diff --git a/src/Wallabag/CoreBundle/Resources/config/services.yml b/src/Wallabag/CoreBundle/Resources/config/services.yml index ed66d2be..0036f45e 100644 --- a/src/Wallabag/CoreBundle/Resources/config/services.yml +++ b/src/Wallabag/CoreBundle/Resources/config/services.yml @@ -30,7 +30,7 @@ services: - "@doctrine" wallabag_core.subscriber.table_prefix: - class: Wallabag\CoreBundle\Subscriber\TablePrefixSubscriber + class: Wallabag\CoreBundle\Event\Subscriber\TablePrefixSubscriber arguments: - "%database_table_prefix%" tags: @@ -94,6 +94,7 @@ services: class: Wallabag\CoreBundle\Helper\Redirect arguments: - "@router" + - "@security.token_storage" wallabag_core.helper.prepare_pager_for_entries: class: Wallabag\CoreBundle\Helper\PreparePagerForEntries @@ -115,3 +116,31 @@ services: arguments: - '@twig' - '%kernel.debug%' + + wallabag_core.subscriber.sqlite_cascade_delete: + class: Wallabag\CoreBundle\Event\Subscriber\SQLiteCascadeDeleteSubscriber + arguments: + - "@doctrine" + tags: + - { name: doctrine.event_subscriber } + + wallabag_core.subscriber.download_images: + class: Wallabag\CoreBundle\Event\Subscriber\DownloadImagesSubscriber + arguments: + - "@doctrine.orm.default_entity_manager" + - "@wallabag_core.entry.download_images" + - '@=service(''craue_config'').get(''download_images_enabled'')' + - "@logger" + tags: + - { name: kernel.event_subscriber } + + wallabag_core.entry.download_images: + class: Wallabag\CoreBundle\Helper\DownloadImages + arguments: + - "@wallabag_core.entry.download_images.client" + - "%kernel.root_dir%/../web/assets/images" + - '@=service(''craue_config'').get(''wallabag_url'')' + - "@logger" + + wallabag_core.entry.download_images.client: + class: GuzzleHttp\Client diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index a1bee173..b456fff0 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml @@ -70,7 +70,12 @@ config: # 200_word: 'I read ~200 words per minute' # 300_word: 'I read ~300 words per minute' # 400_word: 'I read ~400 words per minute' + action_mark_as_read: + # label: 'Where do you to be redirected after mark an article as read?' + # redirect_homepage: 'To the homepage' + # redirect_current_page: 'To the current page' pocket_consumer_key_label: Brugers nøgle til Pocket for at importere materialer + # android_configuration: Configure your Android application # help_theme: "wallabag is customizable. You can choose your prefered theme here." # help_items_per_page: "You can change the number of articles displayed on each page." # help_reading_speed: "wallabag calculates a reading time for each article. You can define here, thanks to this list, if you are a fast or a slow reader. wallabag will recalculate the reading time for each article." @@ -94,6 +99,18 @@ config: email_label: 'Emailadresse' # twoFactorAuthentication_label: 'Two factor authentication' # help_twoFactorAuthentication: "If you enable 2FA, each time you want to login to wallabag, you'll receive a code by email." + delete: + # title: Delete my account (a.k.a danger zone) + # description: If you remove your account, ALL your articles, ALL your tags, ALL your annotations and your account will be PERMANENTLY removed (it can't be UNDONE). You'll then be logged out. + # confirm: Are you really sure? (THIS CAN'T BE UNDONE) + # button: Delete my account + reset: + # title: Reset area (a.k.a danger zone) + # description: By hiting buttons below you'll have ability to remove some informations from your account. Be aware that these actions are IRREVERSIBLE. + # annotations: Remove ALL annotations + # tags: Remove ALL tags + # entries: Remove ALL entries + # confirm: Are you really really sure? (THIS CAN'T BE UNDONE) form_password: # description: "You can change your password here. Your new password should by at least 8 characters long." old_password_label: 'Gammel adgangskode' @@ -168,6 +185,7 @@ entry: preview_picture_label: 'Har et vist billede' preview_picture_help: 'Forhåndsvis billede' language_label: 'Sprog' + # http_status_label: 'HTTP status' reading_time: label: 'Læsetid i minutter' from: 'fra' @@ -329,6 +347,9 @@ tag: list: # number_on_the_page: '{0} There is no tag.|{1} There is one tag.|]1,Inf[ There are %count% tags.' # see_untagged_entries: 'See untagged entries' + new: + # add: 'Add' + # placeholder: 'You can add several tags, separated by a comma.' import: # page_title: 'Import' @@ -362,6 +383,7 @@ import: # how_to: 'Please select your Readability export and click on the below button to upload and import it.' worker: # enabled: "Import is made asynchronously. Once the import task is started, an external worker will handle jobs one at a time. The current service is:" + # download_images_warning: "You enabled downloading images for your articles. Combined with classic import it can take ages to proceed (or maybe failed). We strongly recommend to enable asynchronous import to avoid errors." # firefox: # page_title: 'Import > Firefox' # description: "This importer will import all your Firefox bookmarks. Just go to your bookmarks (Ctrl+Maj+O), then into \"Import and backup\", choose \"Backup...\". You will obtain a .json file." @@ -374,6 +396,10 @@ import: # page_title: 'Import > Instapaper' # description: 'This importer will import all your Instapaper articles. On the settings (https://www.instapaper.com/user) page, click on "Download .CSV file" in the "Export" section. A CSV file will be downloaded (like "instapaper-export.csv").' # how_to: 'Please select your Instapaper export and click on the below button to upload and import it.' + pinboard: + # page_title: "Import > Pinboard" + # description: 'This importer will import all your Instapaper articles. On the backup (https://pinboard.in/settings/backup) page, click on "JSON" in the "Bookmarks" section. A JSON file will be downloaded (like "pinboard_export").' + # how_to: 'Please select your Pinboard export and click on the below button to upload and import it.' developer: # page_title: 'Developer' @@ -465,8 +491,10 @@ flashes: rss_updated: 'RSS-oplysninger opdateret' # tagging_rules_updated: 'Tagging rules updated' # tagging_rules_deleted: 'Tagging rule deleted' - # user_added: 'User "%username%" added' # rss_token_updated: 'RSS token updated' + # annotations_reset: Annotations reset + # tags_reset: Tags reset + # entries_reset: Entries reset entry: notice: # entry_already_saved: 'Entry already saved on %date%' @@ -496,3 +524,8 @@ flashes: notice: # client_created: 'New client created.' # client_deleted: 'Client deleted' + user: + notice: + # added: 'User "%username%" added' + # updated: 'User "%username%" updated' + # deleted: 'User "%username%" deleted' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml index c9625d06..08ed1a11 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml @@ -70,7 +70,12 @@ config: 200_word: 'Ich lese ~200 Wörter pro Minute' 300_word: 'Ich lese ~300 Wörter pro Minute' 400_word: 'Ich lese ~400 Wörter pro Minute' + action_mark_as_read: + label: 'Wohin soll nach dem Gelesenmarkieren eines Artikels weitergeleitet werden?' + redirect_homepage: 'Zur Homepage' + redirect_current_page: 'Zur aktuellen Seite' pocket_consumer_key_label: Consumer-Key für Pocket, um Inhalte zu importieren + android_configuration: Konfiguriere deine Android Application # help_theme: "wallabag is customizable. You can choose your prefered theme here." # help_items_per_page: "You can change the number of articles displayed on each page." # help_reading_speed: "wallabag calculates a reading time for each article. You can define here, thanks to this list, if you are a fast or a slow reader. wallabag will recalculate the reading time for each article." @@ -94,6 +99,18 @@ config: email_label: 'E-Mail-Adresse' twoFactorAuthentication_label: 'Zwei-Faktor-Authentifizierung' # help_twoFactorAuthentication: "If you enable 2FA, each time you want to login to wallabag, you'll receive a code by email." + delete: + title: Lösche mein Konto (a.k.a Gefahrenzone) + description: Wenn du dein Konto löschst, werden ALL deine Artikel, ALL deine Tags, ALL deine Anmerkungen und dein Konto dauerhaft gelöscht (kann NICHT RÜCKGÄNGIG gemacht werden). Du wirst anschließend ausgeloggt. + confirm: Bist du wirklich sicher? (DIES KANN NICHT RÜCKGÄNGIG GEMACHT WERDEN) + button: Lösche mein Konto + reset: + title: Zurücksetzen (a.k.a Gefahrenzone) + description: Beim Nutzen der folgenden Schaltflächenhast du die Möglichkeit, einige Informationen von deinem Konto zu entfernen. Sei dir bewusst, dass dies NICHT RÜCKGÄNGIG zu machen ist. + annotations: Entferne ALLE Annotationen + tags: Entferne ALLE Tags + entries: Entferne ALLE Einträge + confirm: Bist du wirklich sicher? (DIES KANN NICHT RÜCKGÄNGIG GEMACHT WERDEN) form_password: # description: "You can change your password here. Your new password should by at least 8 characters long." old_password_label: 'Altes Kennwort' @@ -168,6 +185,7 @@ entry: preview_picture_label: 'Vorschaubild vorhanden' preview_picture_help: 'Vorschaubild' language_label: 'Sprache' + # http_status_label: 'HTTP status' reading_time: label: 'Lesezeit in Minuten' from: 'von' @@ -329,6 +347,9 @@ tag: list: number_on_the_page: '{0} Es gibt keine Tags.|{1} Es gibt einen Tag.|]1,Inf[ Es gibt %count% Tags.' see_untagged_entries: 'Zeige nicht getaggte Einträge' + new: + # add: 'Add' + # placeholder: 'You can add several tags, separated by a comma.' import: page_title: 'Importieren' @@ -362,6 +383,7 @@ import: how_to: 'Bitte wähle deinen Readability Export aus und klicke den unteren Button für das Hochladen und Importieren dessen.' worker: enabled: "Der Import erfolgt asynchron. Sobald der Import gestartet ist, wird diese Aufgabe extern abgearbeitet. Der aktuelle Service dafür ist:" + download_images_warning: "Du hast das Herunterladen von Bildern für deine Artikel aktiviert. Verbunden mit dem klassischen Import kann es ewig dauern fortzufahren (oder sogar fehlschlagen). Wir empfehlen den asynchronen Import zu aktivieren, um Fehler zu vermeiden." firefox: page_title: 'Aus Firefox importieren' description: "Dieser Import wird all deine Lesezeichen aus Firefox importieren. Gehe zu deinen Lesezeichen (Strg+Shift+O), dann auf \"Importen und Sichern\", wähle \"Sichern…\". Du erhälst eine .json Datei." @@ -374,6 +396,10 @@ import: page_title: 'Aus Instapaper importieren' description: 'Dieser Import wird all deine Instapaper Artikel importieren. Auf der Einstellungsseite (https://www.instapaper.com/user) klickst du auf "Download .CSV Datei" in dem Abschnitt "Export". Eine CSV Datei wird heruntergeladen (z.B. "instapaper-export.csv").' how_to: "Bitte wähle deine Instapaper Sicherungsdatei aus und klicke den nachfolgenden Button zum Importieren." + pinboard: + page_title: "Aus Pinboard importieren" + description: 'Dieser Import wird all deine Pinboard Artikel importieren. Auf der Seite Backup (https://pinboard.in/settings/backup) klickst du auf "JSON" in dem Abschnitt "Lesezeichen". Eine JSON Datei wird dann heruntergeladen (z.B. "pinboard_export").' + how_to: 'Bitte wähle deinen Pinboard Export aus und klicke den nachfolgenden Button zum Importieren.' developer: page_title: 'Entwickler' @@ -453,7 +479,7 @@ user: back_to_list: Zurück zur Liste error: - # page_title: An error occurred + page_title: Ein Fehler ist aufgetreten flashes: config: @@ -465,8 +491,10 @@ flashes: rss_updated: 'RSS-Informationen aktualisiert' tagging_rules_updated: 'Tagging-Regeln aktualisiert' tagging_rules_deleted: 'Tagging-Regel gelöscht' - user_added: 'Benutzer "%username%" erstellt' rss_token_updated: 'RSS-Token aktualisiert' + annotations_reset: Anmerkungen zurücksetzen + tags_reset: Tags zurücksetzen + entries_reset: Einträge zurücksetzen entry: notice: entry_already_saved: 'Eintrag bereits am %date% gespeichert' @@ -496,3 +524,8 @@ flashes: notice: client_created: 'Neuer Client erstellt.' client_deleted: 'Client gelöscht' + user: + notice: + added: 'Benutzer "%username%" hinzugefügt' + updated: 'Benutzer "%username%" aktualisiert' + deleted: 'Benutzer "%username%" gelöscht' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index 139cdc24..20e83a07 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml @@ -70,7 +70,12 @@ config: 200_word: 'I read ~200 words per minute' 300_word: 'I read ~300 words per minute' 400_word: 'I read ~400 words per minute' + action_mark_as_read: + label: 'Where do you want to be redirected after mark an article as read?' + redirect_homepage: 'To the homepage' + redirect_current_page: 'To the current page' pocket_consumer_key_label: Consumer key for Pocket to import contents + android_configuration: Configure your Android application help_theme: "wallabag is customizable. You can choose your prefered theme here." help_items_per_page: "You can change the number of articles displayed on each page." help_reading_speed: "wallabag calculates a reading time for each article. You can define here, thanks to this list, if you are a fast or a slow reader. wallabag will recalculate the reading time for each article." @@ -94,6 +99,18 @@ config: email_label: 'Email' twoFactorAuthentication_label: 'Two factor authentication' help_twoFactorAuthentication: "If you enable 2FA, each time you want to login to wallabag, you'll receive a code by email." + delete: + title: Delete my account (a.k.a danger zone) + description: If you remove your account, ALL your articles, ALL your tags, ALL your annotations and your account will be PERMANENTLY removed (it can't be UNDONE). You'll then be logged out. + confirm: Are you really sure? (THIS CAN'T BE UNDONE) + button: Delete my account + reset: + title: Reset area (a.k.a danger zone) + description: By hitting buttons below you'll have ability to remove some information from your account. Be aware that these actions are IRREVERSIBLE. + annotations: Remove ALL annotations + tags: Remove ALL tags + entries: Remove ALL entries + confirm: Are you really sure? (THIS CAN'T BE UNDONE) form_password: description: "You can change your password here. Your new password should by at least 8 characters long." old_password_label: 'Current password' @@ -168,6 +185,7 @@ entry: preview_picture_label: 'Has a preview picture' preview_picture_help: 'Preview picture' language_label: 'Language' + http_status_label: 'HTTP status' reading_time: label: 'Reading time in minutes' from: 'from' @@ -329,6 +347,9 @@ tag: list: number_on_the_page: '{0} There are no tags.|{1} There is one tag.|]1,Inf[ There are %count% tags.' see_untagged_entries: 'See untagged entries' + new: + add: 'Add' + placeholder: 'You can add several tags, separated by a comma.' import: page_title: 'Import' @@ -362,6 +383,7 @@ import: how_to: 'Please select your Readability export and click on the below button to upload and import it.' worker: enabled: "Import is made asynchronously. Once the import task is started, an external worker will handle jobs one at a time. The current service is:" + download_images_warning: "You enabled downloading images for your articles. Combined with classic import it can take ages to proceed (or maybe failed). We strongly recommend to enable asynchronous import to avoid errors." firefox: page_title: 'Import > Firefox' description: "This importer will import all your Firefox bookmarks. Just go to your bookmarks (Ctrl+Maj+O), then into \"Import and backup\", choose \"Backup...\". You will obtain a .json file." @@ -374,6 +396,10 @@ import: page_title: 'Import > Instapaper' description: 'This importer will import all your Instapaper articles. On the settings (https://www.instapaper.com/user) page, click on "Download .CSV file" in the "Export" section. A CSV file will be downloaded (like "instapaper-export.csv").' how_to: 'Please select your Instapaper export and click on the below button to upload and import it.' + pinboard: + page_title: "Import > Pinboard" + description: 'This importer will import all your Pinboard articles. On the backup (https://pinboard.in/settings/backup) page, click on "JSON" in the "Bookmarks" section. A JSON file will be downloaded (like "pinboard_export").' + how_to: 'Please select your Pinboard export and click on the below button to upload and import it.' developer: page_title: 'Developer' @@ -466,6 +492,9 @@ flashes: tagging_rules_updated: 'Tagging rules updated' tagging_rules_deleted: 'Tagging rule deleted' rss_token_updated: 'RSS token updated' + annotations_reset: Annotations reset + tags_reset: Tags reset + entries_reset: Entries reset entry: notice: entry_already_saved: 'Entry already saved on %date%' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index 70e64bec..5507ccae 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml @@ -70,7 +70,12 @@ config: 200_word: 'Leo ~200 palabras por minuto' 300_word: 'Leo ~300 palabras por minuto' 400_word: 'Leo ~400 palabras por minuto' + action_mark_as_read: + # label: 'Where do you to be redirected after mark an article as read?' + # redirect_homepage: 'To the homepage' + # redirect_current_page: 'To the current page' # pocket_consumer_key_label: Consumer key for Pocket to import contents + # android_configuration: Configure your Android application # help_theme: "wallabag is customizable. You can choose your prefered theme here." # help_items_per_page: "You can change the number of articles displayed on each page." # help_reading_speed: "wallabag calculates a reading time for each article. You can define here, thanks to this list, if you are a fast or a slow reader. wallabag will recalculate the reading time for each article." @@ -94,6 +99,18 @@ config: email_label: 'Direccion e-mail' twoFactorAuthentication_label: 'Autentificación de dos factores' # help_twoFactorAuthentication: "If you enable 2FA, each time you want to login to wallabag, you'll receive a code by email." + delete: + # title: Delete my account (a.k.a danger zone) + # description: If you remove your account, ALL your articles, ALL your tags, ALL your annotations and your account will be PERMANENTLY removed (it can't be UNDONE). You'll then be logged out. + # confirm: Are you really sure? (THIS CAN'T BE UNDONE) + # button: Delete my account + reset: + # title: Reset area (a.k.a danger zone) + # description: By hiting buttons below you'll have ability to remove some informations from your account. Be aware that these actions are IRREVERSIBLE. + # annotations: Remove ALL annotations + # tags: Remove ALL tags + # entries: Remove ALL entries + # confirm: Are you really really sure? (THIS CAN'T BE UNDONE) form_password: # description: "You can change your password here. Your new password should by at least 8 characters long." old_password_label: 'Contraseña actual' @@ -168,6 +185,7 @@ entry: preview_picture_label: 'Hay una foto' preview_picture_help: 'Foto de preview' language_label: 'Idioma' + # http_status_label: 'HTTP status' reading_time: label: 'Duración de lectura en minutos' from: 'de' @@ -329,6 +347,9 @@ tag: list: number_on_the_page: '{0} No hay ninguna etiqueta.|{1} Hay una etiqueta.|]1,Inf[ Hay %count% etiquetas.' # see_untagged_entries: 'See untagged entries' + new: + # add: 'Add' + # placeholder: 'You can add several tags, separated by a comma.' import: page_title: 'Importar' @@ -362,6 +383,7 @@ import: # how_to: 'Please select your Readability export and click on the below button to upload and import it.' worker: # enabled: "Import is made asynchronously. Once the import task is started, an external worker will handle jobs one at a time. The current service is:" + # download_images_warning: "You enabled downloading images for your articles. Combined with classic import it can take ages to proceed (or maybe failed). We strongly recommend to enable asynchronous import to avoid errors." firefox: page_title: 'Importar > Firefox' # description: "This importer will import all your Firefox bookmarks. Just go to your bookmarks (Ctrl+Maj+O), then into \"Import and backup\", choose \"Backup...\". You will obtain a .json file." @@ -374,6 +396,10 @@ import: page_title: 'Importar > Instapaper' # description: 'This importer will import all your Instapaper articles. On the settings (https://www.instapaper.com/user) page, click on "Download .CSV file" in the "Export" section. A CSV file will be downloaded (like "instapaper-export.csv").' # how_to: 'Please select your Instapaper export and click on the below button to upload and import it.' + pinboard: + page_title: "Importar > Pinboard" + # description: 'This importer will import all your Instapaper articles. On the backup (https://pinboard.in/settings/backup) page, click on "JSON" in the "Bookmarks" section. A JSON file will be downloaded (like "pinboard_export").' + # how_to: 'Please select your Pinboard export and click on the below button to upload and import it.' developer: page_title: 'Promotor' @@ -465,8 +491,10 @@ flashes: rss_updated: 'La configuración de los feeds RSS ha sido actualizada' tagging_rules_updated: 'Regla de etiquetado borrada' tagging_rules_deleted: 'Regla de etiquetado actualizada' - user_added: 'Usuario "%username%" añadido' rss_token_updated: 'RSS token actualizado' + # annotations_reset: Annotations reset + # tags_reset: Tags reset + # entries_reset: Entries reset entry: notice: entry_already_saved: 'Entrada ya guardada por %fecha%' @@ -496,3 +524,8 @@ flashes: notice: client_created: 'Nuevo cliente creado.' client_deleted: 'Cliente suprimido' + user: + notice: + # added: 'User "%username%" added' + # updated: 'User "%username%" updated' + # deleted: 'User "%username%" deleted' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index 75359901..ba8a9c35 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml @@ -70,7 +70,12 @@ config: 200_word: 'من تقریباً ۲۰۰ واژه را در دقیقه می‌خوانم' 300_word: 'من تقریباً ۳۰۰ واژه را در دقیقه می‌خوانم' 400_word: 'من تقریباً ۴۰۰ واژه را در دقیقه می‌خوانم' + action_mark_as_read: + # label: 'Where do you to be redirected after mark an article as read?' + # redirect_homepage: 'To the homepage' + # redirect_current_page: 'To the current page' pocket_consumer_key_label: کلید کاربری Pocket برای درون‌ریزی مطالب + # android_configuration: Configure your Android application # help_theme: "wallabag is customizable. You can choose your prefered theme here." # help_items_per_page: "You can change the number of articles displayed on each page." # help_reading_speed: "wallabag calculates a reading time for each article. You can define here, thanks to this list, if you are a fast or a slow reader. wallabag will recalculate the reading time for each article." @@ -94,6 +99,18 @@ config: email_label: 'نشانی ایمیل' twoFactorAuthentication_label: 'تأیید ۲مرحله‌ای' # help_twoFactorAuthentication: "If you enable 2FA, each time you want to login to wallabag, you'll receive a code by email." + delete: + # title: Delete my account (a.k.a danger zone) + # description: If you remove your account, ALL your articles, ALL your tags, ALL your annotations and your account will be PERMANENTLY removed (it can't be UNDONE). You'll then be logged out. + # confirm: Are you really sure? (THIS CAN'T BE UNDONE) + # button: Delete my account + reset: + # title: Reset area (a.k.a danger zone) + # description: By hiting buttons below you'll have ability to remove some informations from your account. Be aware that these actions are IRREVERSIBLE. + # annotations: Remove ALL annotations + # tags: Remove ALL tags + # entries: Remove ALL entries + # confirm: Are you really really sure? (THIS CAN'T BE UNDONE) form_password: # description: "You can change your password here. Your new password should by at least 8 characters long." old_password_label: 'رمز قدیمی' @@ -168,6 +185,7 @@ entry: preview_picture_label: 'دارای عکس پیش‌نمایش' preview_picture_help: 'پیش‌نمایش عکس' language_label: 'زبان' + # http_status_label: 'HTTP status' reading_time: label: 'زمان خواندن به دقیقه' from: 'از' @@ -279,6 +297,7 @@ quickstart: paragraph_2: 'ادامه دهید!' configure: title: 'برنامه را تنظیم کنید' + # description: 'In order to have an application which suits you, have a look into the configuration of wallabag.' language: 'زبان و نمای برنامه را تغییر دهید' rss: 'خوراک آر-اس-اس را فعال کنید' tagging_rules: 'قانون‌های برچسب‌گذاری خودکار مقاله‌هایتان را تعریف کنید' @@ -328,6 +347,9 @@ tag: list: number_on_the_page: '{0} هیچ برچسبی نیست.|{1} یک برچسب هست.|]1,Inf[ %count% برچسب هست.' # see_untagged_entries: 'See untagged entries' + new: + # add: 'Add' + # placeholder: 'You can add several tags, separated by a comma.' import: page_title: 'درون‌ریزی' @@ -361,6 +383,7 @@ import: # how_to: 'Please select your Readability export and click on the below button to upload and import it.' worker: # enabled: "Import is made asynchronously. Once the import task is started, an external worker will handle jobs one at a time. The current service is:" + # download_images_warning: "You enabled downloading images for your articles. Combined with classic import it can take ages to proceed (or maybe failed). We strongly recommend to enable asynchronous import to avoid errors." firefox: page_title: 'درون‌ریزی > Firefox' # description: "This importer will import all your Firefox bookmarks. Just go to your bookmarks (Ctrl+Maj+O), then into \"Import and backup\", choose \"Backup...\". You will obtain a .json file." @@ -373,6 +396,10 @@ import: page_title: 'درون‌ریزی > Instapaper' # description: 'This importer will import all your Instapaper articles. On the settings (https://www.instapaper.com/user) page, click on "Download .CSV file" in the "Export" section. A CSV file will be downloaded (like "instapaper-export.csv").' # how_to: 'Please select your Instapaper export and click on the below button to upload and import it.' + pinboard: + # page_title: "Import > Pinboard" + # description: 'This importer will import all your Instapaper articles. On the backup (https://pinboard.in/settings/backup) page, click on "JSON" in the "Bookmarks" section. A JSON file will be downloaded (like "pinboard_export").' + # how_to: 'Please select your Pinboard export and click on the below button to upload and import it.' developer: # page_title: 'Developer' @@ -464,8 +491,10 @@ flashes: rss_updated: 'اطلاعات آر-اس-اس به‌روز شد' tagging_rules_updated: 'برچسب‌گذاری خودکار به‌روز شد' tagging_rules_deleted: 'قانون برچسب‌گذاری پاک شد' - user_added: 'کابر "%username%" افزوده شد' rss_token_updated: 'کد آر-اس-اس به‌روز شد' + # annotations_reset: Annotations reset + # tags_reset: Tags reset + # entries_reset: Entries reset entry: notice: entry_already_saved: 'این مقاله در تاریخ %date% ذخیره شده بود' @@ -495,3 +524,8 @@ flashes: notice: # client_created: 'New client created.' # client_deleted: 'Client deleted' + user: + notice: + # added: 'User "%username%" added' + # updated: 'User "%username%" updated' + # deleted: 'User "%username%" deleted' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index f2c9d8db..2932f2fd 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml @@ -70,7 +70,12 @@ config: 200_word: "Je lis environ 200 mots par minute" 300_word: "Je lis environ 300 mots par minute" 400_word: "Je lis environ 400 mots par minute" + action_mark_as_read: + label: 'Où souhaitez-vous être redirigé après avoir marqué un article comme lu ?' + redirect_homepage: "À la page d'accueil" + redirect_current_page: 'À la page courante' pocket_consumer_key_label: Clé d’authentification Pocket pour importer les données + android_configuration: Configurez votre application Android help_theme: "L'affichage de wallabag est personnalisable. C'est ici que vous choisissez le thème que vous préférez." help_items_per_page: "Vous pouvez définir le nombre d'articles affichés sur chaque page." help_reading_speed: "wallabag calcule une durée de lecture pour chaque article. Vous pouvez définir ici, grâce à cette liste déroulante, si vous lisez plus ou moins vite. wallabag recalculera la durée de lecture de chaque article." @@ -94,6 +99,18 @@ config: email_label: "Adresse courriel" twoFactorAuthentication_label: "Double authentification" help_twoFactorAuthentication: "Si vous activez 2FA, à chaque tentative de connexion à wallabag, vous recevrez un code par email." + delete: + title: Supprimer mon compte (attention danger !) + description: Si vous confirmez la suppression de votre compte, TOUS les articles, TOUS les tags, TOUTES les annotations et votre compte seront DÉFINITIVEMENT supprimé (c'est IRRÉVERSIBLE). Vous serez ensuite déconnecté. + confirm: Vous êtes vraiment sûr ? (C'EST IRRÉVERSIBLE) + button: 'Supprimer mon compte' + reset: + title: Réinitialisation (attention danger !) + description: En cliquant sur les boutons ci-dessous vous avez la possibilité de supprimer certaines informations de votre compte. Attention, ces actions sont IRRÉVERSIBLES ! + annotations: Supprimer TOUTES les annotations + tags: Supprimer TOUS les tags + entries: Supprimer TOUS les articles + confirm: Êtes-vous vraiment vraiment sûr ? (C'EST IRRÉVERSIBLE) form_password: description: "Vous pouvez changer ici votre mot de passe. Le mot de passe doit contenir au moins 8 caractères." old_password_label: "Mot de passe actuel" @@ -168,6 +185,7 @@ entry: preview_picture_label: "A une photo" preview_picture_help: "Photo" language_label: "Langue" + http_status_label: 'Statut HTTP' reading_time: label: "Durée de lecture en minutes" from: "de" @@ -329,6 +347,9 @@ tag: list: number_on_the_page: "{0} Il n’y a pas de tag.|{1} Il y a un tag.|]1,Inf[ Il y a %count% tags." see_untagged_entries: "Voir les articles sans tag" + new: + add: 'Ajouter' + placeholder: 'Vous pouvez ajouter plusieurs tags, séparés par une virgule.' import: page_title: "Importer" @@ -362,6 +383,7 @@ import: how_to: "Choisissez le fichier de votre export Readability et cliquez sur le bouton ci-dessous pour l’importer." worker: enabled: "Les imports sont asynchrones. Une fois l’import commencé un worker externe traitera les messages un par un. Le service activé est :" + download_images_warning: "Vous avez configuré le téléchagement des images pour vos articles. Combiné à l'import classique, cette opération peut être très très longue (voire échouer). Nous vous conseillons vivement d'activer les imports asynchrones." firefox: page_title: "Import > Firefox" description: "Cet outil va vous permettre d’importer tous vos marques-pages de Firefox. Ouvrez le panneau des marques-pages (Ctrl+Maj+O), puis dans « Importation et sauvegarde », choisissez « Sauvegarde... ». Vous allez récupérer un fichier .json.

" @@ -374,6 +396,10 @@ import: page_title: "Import > Instapaper" description: "Sur la page des paramètres (https://www.instapaper.com/user), cliquez sur « Download .CSV file » dans la section « Export ». Un fichier CSV sera téléchargé (« instapaper-export.csv »)." how_to: "Choisissez le fichier de votre export Instapaper et cliquez sur le bouton ci-dessous pour l’importer." + pinboard: + page_title: "Import > Pinboard" + description: "Sur la page « Backup » (https://pinboard.in/settings/backup), cliquez sur « JSON » dans la section « Bookmarks ». Un fichier json (sans extension) sera téléchargé (« pinboard_export »)." + how_to: "Choisissez le fichier de votre export Pinboard et cliquez sur le bouton ci-dessous pour l’importer." developer: page_title: "Développeur" @@ -465,8 +491,10 @@ flashes: rss_updated: "La configuration des flux RSS a bien été mise à jour" tagging_rules_updated: "Règles mises à jour" tagging_rules_deleted: "Règle supprimée" - user_added: "Utilisateur \"%username%\" ajouté" rss_token_updated: "Jeton RSS mis à jour" + annotations_reset: Annotations supprimées + tags_reset: Tags supprimés + entries_reset: Articles supprimés entry: notice: entry_already_saved: "Article déjà sauvegardé le %date%" @@ -496,3 +524,8 @@ flashes: notice: client_created: "Nouveau client %name% créé" client_deleted: "Client %name% supprimé" + user: + notice: + added: 'Utilisateur "%username%" ajouté' + updated: 'Utilisateur "%username%" mis à jour' + deleted: 'Utilisateur "%username%" supprimé' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index b7d066ab..538e25a6 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml @@ -70,7 +70,12 @@ config: 200_word: 'Leggo ~200 parole al minuto' 300_word: 'Leggo ~300 parole al minuto' 400_word: 'Leggo ~400 parole al minuto' + action_mark_as_read: + # label: 'Where do you to be redirected after mark an article as read?' + # redirect_homepage: 'To the homepage' + # redirect_current_page: 'To the current page' pocket_consumer_key_label: Consumer key per Pocket per importare i contenuti + # android_configuration: Configure your Android application # help_theme: "wallabag is customizable. You can choose your prefered theme here." # help_items_per_page: "You can change the number of articles displayed on each page." # help_reading_speed: "wallabag calculates a reading time for each article. You can define here, thanks to this list, if you are a fast or a slow reader. wallabag will recalculate the reading time for each article." @@ -94,6 +99,18 @@ config: email_label: 'E-mail' twoFactorAuthentication_label: 'Two factor authentication' # help_twoFactorAuthentication: "If you enable 2FA, each time you want to login to wallabag, you'll receive a code by email." + delete: + # title: Delete my account (a.k.a danger zone) + # description: If you remove your account, ALL your articles, ALL your tags, ALL your annotations and your account will be PERMANENTLY removed (it can't be UNDONE). You'll then be logged out. + # confirm: Are you really sure? (THIS CAN'T BE UNDONE) + # button: Delete my account + reset: + # title: Reset area (a.k.a danger zone) + # description: By hiting buttons below you'll have ability to remove some informations from your account. Be aware that these actions are IRREVERSIBLE. + # annotations: Remove ALL annotations + # tags: Remove ALL tags + # entries: Remove ALL entries + # confirm: Are you really really sure? (THIS CAN'T BE UNDONE) form_password: # description: "You can change your password here. Your new password should by at least 8 characters long." old_password_label: 'Password corrente' @@ -168,6 +185,7 @@ entry: preview_picture_label: "Ha un'immagine di anteprima" preview_picture_help: 'Immagine di anteprima' language_label: 'Lingua' + # http_status_label: 'HTTP status' reading_time: label: 'Tempo di lettura in minuti' from: 'da' @@ -329,6 +347,9 @@ tag: list: number_on_the_page: "{0} Non ci sono tag.|{1} C'è un tag.|]1,Inf[ ci sono %count% tag." # see_untagged_entries: 'See untagged entries' + new: + # add: 'Add' + # placeholder: 'You can add several tags, separated by a comma.' import: page_title: 'Importa' @@ -362,6 +383,7 @@ import: # how_to: 'Please select your Readability export and click on the below button to upload and import it.' worker: # enabled: "Import is made asynchronously. Once the import task is started, an external worker will handle jobs one at a time. The current service is:" + # download_images_warning: "You enabled downloading images for your articles. Combined with classic import it can take ages to proceed (or maybe failed). We strongly recommend to enable asynchronous import to avoid errors." firefox: page_title: 'Importa da > Firefox' # description: "This importer will import all your Firefox bookmarks. Just go to your bookmarks (Ctrl+Maj+O), then into \"Import and backup\", choose \"Backup...\". You will obtain a .json file." @@ -374,6 +396,10 @@ import: page_title: 'Importa da > Instapaper' # description: 'This importer will import all your Instapaper articles. On the settings (https://www.instapaper.com/user) page, click on "Download .CSV file" in the "Export" section. A CSV file will be downloaded (like "instapaper-export.csv").' # how_to: 'Please select your Instapaper export and click on the below button to upload and import it.' + pinboard: + page_title: "Importa da > Pinboard" + # description: 'This importer will import all your Instapaper articles. On the backup (https://pinboard.in/settings/backup) page, click on "JSON" in the "Bookmarks" section. A JSON file will be downloaded (like "pinboard_export").' + # how_to: 'Please select your Pinboard export and click on the below button to upload and import it.' developer: page_title: 'Sviluppatori' @@ -465,8 +491,10 @@ flashes: rss_updated: 'Informazioni RSS aggiornate' tagging_rules_updated: 'Regole di tagging aggiornate' tagging_rules_deleted: 'Regola di tagging aggiornate' - user_added: 'Utente "%username%" aggiunto' rss_token_updated: 'RSS token aggiornato' + # annotations_reset: Annotations reset + # tags_reset: Tags reset + # entries_reset: Entries reset entry: notice: entry_already_saved: 'Contenuto già salvato in data %date%' @@ -496,3 +524,8 @@ flashes: notice: client_created: 'Nuovo client creato.' client_deleted: 'Client eliminato' + user: + notice: + # added: 'User "%username%" added' + # updated: 'User "%username%" updated' + # deleted: 'User "%username%" deleted' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index 16ef1e5d..6f415c3b 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml @@ -25,13 +25,13 @@ menu: internal_settings: 'Configuracion interna' import: 'Importar' howto: 'Ajuda' - developer: 'Desvolopador' + developer: 'Desvolopaire' logout: 'Desconnexion' about: 'A prepaus' search: 'Cercar' save_link: 'Enregistrar un novèl article' back_to_unread: 'Tornar als articles pas legits' - # users_management: 'Users management' + users_management: 'Gestion dels utilizaires' top: add_new_entry: 'Enregistrar un novèl article' search: 'Cercar' @@ -46,7 +46,7 @@ footer: social: 'Social' powered_by: 'propulsat per' about: 'A prepaus' - # stats: Since %user_creation% you read %nb_archives% articles. That is about %per_day% a day! + stats: "Dempuèi %user_creation% avètz legit %nb_archives% articles. Es a l'entorn de %per_day% per jorn !" config: page_title: 'Configuracion' @@ -70,7 +70,12 @@ config: 200_word: "Legissi a l'entorn de 200 mots per minuta" 300_word: "Legissi a l'entorn de 300 mots per minuta" 400_word: "Legissi a l'entorn de 400 mots per minuta" + action_mark_as_read: + # label: 'Where do you to be redirected after mark an article as read?' + # redirect_homepage: 'To the homepage' + # redirect_current_page: 'To the current page' pocket_consumer_key_label: Clau d'autentificacion Pocket per importar las donadas + android_configuration: Configuratz vòstra aplicacion Android # help_theme: "wallabag is customizable. You can choose your prefered theme here." # help_items_per_page: "You can change the number of articles displayed on each page." # help_reading_speed: "wallabag calculates a reading time for each article. You can define here, thanks to this list, if you are a fast or a slow reader. wallabag will recalculate the reading time for each article." @@ -94,6 +99,18 @@ config: email_label: 'Adreça de corrièl' twoFactorAuthentication_label: 'Dobla autentificacion' # help_twoFactorAuthentication: "If you enable 2FA, each time you want to login to wallabag, you'll receive a code by email." + delete: + title: Suprimir mon compte (Mèfi zòna perilhosa) + description: Se confirmatz la supression de vòstre compte, TOTES vòstres articles, TOTAS vòstras etiquetas, TOTAS vòstras anotacions e vòstre compte seràn suprimits per totjorn. E aquò es IRREVERSIBLE. Puèi seretz desconnectat. + confirm: Sètz vertadièrament segur ? (ES IRREVERSIBLE) + button: Suprimir mon compte + reset: + title: Zòna de reïnicializacion (Mèfi zòna perilhosa) + description: En clicant sul boton çai-jos auretz la possibilitat de levar qualques informacions de vòstre compte. Mèfi que totas aquelas accions son IRREVERSIBLAS. + annotations: Levar TOTAS las anotacions + tags: Levar TOTAS las etiquetas + entries: Levar TOTES los articles + confirm: Sètz vertadièrament segur ? (ES IRREVERSIBLE) form_password: # description: "You can change your password here. Your new password should by at least 8 characters long." old_password_label: 'Senhal actual' @@ -103,7 +120,7 @@ config: if_label: 'se' then_tag_as_label: 'alara atribuir las etiquetas' delete_rule_label: 'suprimir' - # edit_rule_label: 'edit' + edit_rule_label: 'modificar' rule_label: 'Règla' tags_label: 'Etiquetas' faq: @@ -168,6 +185,7 @@ entry: preview_picture_label: 'A una fotò' preview_picture_help: 'Fotò' language_label: 'Lenga' + # http_status_label: 'HTTP status' reading_time: label: 'Durada de lectura en minutas' from: 'de' @@ -216,7 +234,7 @@ entry: is_public_label: 'Public' save_label: 'Enregistrar' public: - # shared_by_wallabag: "This article has been shared by wallabag" + shared_by_wallabag: "Aqueste article es estat partejat per wallabag" about: page_title: 'A prepaus' @@ -272,14 +290,14 @@ howto: quickstart: page_title: 'Per ben començar' - # more: 'More…' + more: 'Mai…' intro: title: 'Benvenguda sus wallabag !' paragraph_1: "Anem vos guidar per far lo torn de la proprietat e vos presentar unas fonccionalitats que vos poirián interessar per vos apropriar aquesta aisina." paragraph_2: 'Seguètz-nos ' configure: - title: "Configuratz l'aplicacio" - # description: 'In order to have an application which suits you, have a look into the configuration of wallabag.' + title: "Configuratz l'aplicacion" + description: "Per fin d'aver una aplicacion que vos va ben, anatz veire la configuracion de wallabag." language: "Cambiatz la lenga e l'estil de l'aplicacion" rss: 'Activatz los fluxes RSS' tagging_rules: 'Escrivètz de règlas per classar automaticament vòstres articles' @@ -293,7 +311,7 @@ quickstart: import: 'Configurar los impòrt' first_steps: title: 'Primièrs passes' - # description: "Now wallabag is well configured, it's time to archive the web. You can click on the top right sign + to add a link." + description: "Ara wallabag es ben configurat, es lo moment d'archivar lo web. Podètz clicar sul signe + a man drecha amont per ajustar un ligam." new_article: 'Ajustatz vòstre primièr article' unread_articles: 'E racaptatz-lo !' migrate: @@ -305,14 +323,14 @@ quickstart: readability: 'Migrar dempuèi Readability' instapaper: 'Migrar dempuèi Instapaper' developer: - title: 'Pels desvolopadors' - # description: 'We also thought to the developers: Docker, API, translations, etc.' + title: 'Pels desvolopaires' + description: 'Avèm tanben pensat als desvolopaires : Docker, API, traduccions, etc.' create_application: 'Crear vòstra aplicacion tèrça' - # use_docker: 'Use Docker to install wallabag' + use_docker: 'Utilizar Docker per installar wallabag' docs: title: 'Documentacion complèta' - # description: "There are so much features in wallabag. Don't hesitate to read the manual to know them and to learn how to use them." - annotate: 'Anotatar vòstre article' + description: "I a un fum de fonccionalitats dins wallabag. Esitetz pas a legir lo manual per las conéisser e aprendre a las utilizar." + annotate: 'Anotar vòstre article' export: 'Convertissètz vòstres articles en ePub o en PDF' search_filters: "Aprenètz a utilizar lo motor de recèrca e los filtres per retrobar l'article que vos interèssa" fetching_errors: "Qué far se mon article es pas recuperat coma cal ?" @@ -329,6 +347,9 @@ tag: list: number_on_the_page: "{0} I a pas cap d'etiquetas.|{1} I a una etiqueta.|]1,Inf[ I a %count% etiquetas." see_untagged_entries: "Afichar las entradas sens pas cap d'etiquetas" + new: + # add: 'Add' + # placeholder: 'You can add several tags, separated by a comma.' import: page_title: 'Importar' @@ -362,6 +383,7 @@ import: how_to: "Mercés de seleccionar vòstre Readability fichièr e de clicar sul boton dejós per lo telecargar e l'importar." worker: enabled: "L'importacion se fa de manièra asincròna. Un còp l'importacion lançada, una aisina externa s'ocuparà dels messatges un per un. Lo servici actual es : " + download_images_warning: "Avètz activat lo telecargament de los imatges de vòstres articles. Combinat amb l'importacion classica, aquò pòt tardar un long moment (o benlèu fracassar). Recomandem fòrtament l'activacion de l'importacion asincròna per evitar las errors." firefox: page_title: 'Importar > Firefox' description: "Aquesta aisina importarà totas vòstres favorits de Firefox. Just go to your bookmarks (Ctrl+Maj+O), then into \"Import and backup\", choose \"Backup...\". You will obtain a .json file." @@ -374,6 +396,10 @@ import: page_title: 'Importar > Instapaper' description: "Aquesta aisina importarà totas vòstres articles d'Instapaper. Sus la pagina de paramètres (https://www.instapaper.com/user), clicatz sus \"Download .CSV file\" dins la seccion \"Export\". Un fichièr CSV serà telecargat (aital \"instapaper-export.csv\")." how_to: "Mercés de causir vòstre fichièr Instapaper e de clicar sul boton dejós per lo telecargar e l'importar" + pinboard: + # page_title: "Import > Pinboard" + # description: 'This importer will import all your Instapaper articles. On the backup (https://pinboard.in/settings/backup) page, click on "JSON" in the "Bookmarks" section. A JSON file will be downloaded (like "pinboard_export").' + # how_to: 'Please select your Pinboard export and click on the below button to upload and import it.' developer: page_title: 'Desvolopaire' @@ -397,7 +423,7 @@ developer: warn_message_2: "Se suprimissètz un client, totas las aplicacions que l'emplegan foncionaràn pas mai amb vòstre compte wallabag." action: 'Suprimir aqueste client' client: - page_title: 'Desvlopador > Novèl client' + page_title: 'Desvolopaire > Novèl client' page_description: "Anatz crear un novèl client. Mercés de cumplir l'url de redireccion cap a vòstra aplicacion." form: name_label: "Nom del client" @@ -405,7 +431,7 @@ developer: save_label: 'Crear un novèl client' action_back: 'Retorn' client_parameter: - page_title: 'Desvolopador > Los paramètres de vòstre client' + page_title: 'Desvolopaire > Los paramètres de vòstre client' page_description: 'Vaquí los paramètres de vòstre client' field_name: 'Nom del client' field_id: 'ID Client' @@ -413,7 +439,7 @@ developer: back: 'Retour' read_howto: 'Legir "cossí crear ma primièra aplicacion"' howto: - page_title: 'Desvolopador > Cossí crear ma primièra aplicacion' + page_title: 'Desvolopaire > Cossí crear ma primièra aplicacion' description: paragraph_1: "Las comandas seguentas utilizan la bibliotèca HTTPie. Asseguratz-vos que siasqueòu installadas abans de l'utilizar." paragraph_2: "Vos cal un geton per escambiar entre vòstra aplicacion e l'API de wallabar." @@ -426,34 +452,34 @@ developer: back: 'Retorn' user: - # page_title: Users management - # new_user: Create a new user - # edit_user: Edit an existing user - # description: "Here you can manage all users (create, edit and delete)" - # list: - # actions: Actions - # edit_action: Edit - # yes: Yes - # no: No - # create_new_one: Create a new user + page_title: 'Gestion dels utilizaires' + new_user: 'Crear un novèl utilizaire' + edit_user: 'Modificar un utilizaire existent' + description: "Aquí podètz gerir totes los utilizaires (crear, modificar e suprimir)" + list: + actions: 'Accions' + edit_action: 'Modificar' + yes: 'Òc' + no: 'Non' + create_new_one: 'Crear un novèl utilizaire' form: username_label: "Nom d'utilizaire" - # name_label: 'Name' + name_label: 'Nom' password_label: 'Senhal' repeat_new_password_label: 'Confirmatz vòstre novèl senhal' plain_password_label: 'Senhal en clar' email_label: 'Adreça de corrièl' - # enabled_label: 'Enabled' - # locked_label: 'Locked' - # last_login_label: 'Last login' - # twofactor_label: Two factor authentication - # save: Save - # delete: Delete - # delete_confirm: Are you sure? - # back_to_list: Back to list + enabled_label: 'Actiu' + locked_label: 'Varrolhat' + last_login_label: 'Darrièra connexion' + twofactor_label: 'Autentificacion doble-factor' + save: 'Enregistrar' + delete: 'Suprimir' + delete_confirm: 'Sètz segur ?' + back_to_list: 'Tornar a la lista' error: - # page_title: An error occurred + page_title: Una error s'es produsida flashes: config: @@ -465,8 +491,10 @@ flashes: rss_updated: 'La configuracion dels fluxes RSS es ben estada mesa a jorn' tagging_rules_updated: 'Règlas misa a jorn' tagging_rules_deleted: 'Règla suprimida' - user_added: 'Utilizaire "%username%" apondut' rss_token_updated: 'Geton RSS mes a jorn' + annotations_reset: Anotacions levadas + tags_reset: Etiquetas levadas + entries_reset: Articles levats entry: notice: entry_already_saved: 'Article ja salvargardat lo %date%' @@ -477,12 +505,12 @@ flashes: entry_reloaded_failed: "L'article es estat cargat de nòu mai la recuperacion del contengut a fracassat" entry_archived: 'Article marcat coma legit' entry_unarchived: 'Article marcat coma pas legit' - entry_starred: 'Article apondut dins los favorits' + entry_starred: 'Article ajustat dins los favorits' entry_unstarred: 'Article quitat dels favorits' entry_deleted: 'Article suprimit' tag: notice: - tag_added: 'Etiqueta aponduda' + tag_added: 'Etiqueta ajustada' import: notice: failed: "L'importacion a fracassat, mercés de tornar ensajar" @@ -496,3 +524,8 @@ flashes: notice: client_created: 'Novèl client creat' client_deleted: 'Client suprimit' + user: + notice: + added: 'Utilizaire "%username%" ajustat' + updated: 'Utilizaire "%username%" mes a jorn' + deleted: 'Utilizaire "%username%" suprimit' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index 73250cc0..df5ab7e5 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml @@ -70,7 +70,12 @@ config: 200_word: 'Czytam ~200 słów na minutę' 300_word: 'Czytam ~300 słów na minutę' 400_word: 'Czytam ~400 słów na minutę' + action_mark_as_read: + label: 'Gdzie zostaniesz przekierowany po oznaczeniu artukuły jako przeczytanego' + redirect_homepage: 'do strony głównej' + redirect_current_page: 'do bieżącej strony' pocket_consumer_key_label: 'Klucz klienta Pocket do importu zawartości' + android_configuration: Skonfiguruj swoją androidową aplikację # help_theme: "wallabag is customizable. You can choose your prefered theme here." # help_items_per_page: "You can change the number of articles displayed on each page." # help_reading_speed: "wallabag calculates a reading time for each article. You can define here, thanks to this list, if you are a fast or a slow reader. wallabag will recalculate the reading time for each article." @@ -94,6 +99,18 @@ config: email_label: 'Adres email' twoFactorAuthentication_label: 'Autoryzacja dwuetapowa' # help_twoFactorAuthentication: "If you enable 2FA, each time you want to login to wallabag, you'll receive a code by email." + delete: + title: Usuń moje konto (niebezpieczna strefa !) + description: Jeżeli usuniesz swoje konto, wszystkie twoje artykuły, tagi, adnotacje, oraz konto zostaną trwale usunięte (operacja jest NIEODWRACALNA). Następnie zostaniesz wylogowany. + confirm: Jesteś pewien? (tej operacji NIE MOŻNA cofnąć) + button: Usuń moje konto + reset: + title: Reset (niebezpieczna strefa) + description: Poniższe przyciski pozwalają usunąć pewne informacje z twojego konta. Uważaj te operacje są NIEODWRACALNE. + annotations: Usuń WSZYSTKIE adnotacje + tags: Usuń WSZYSTKIE tagi + entries: usuń WSZYTSTKIE wpisy + confirm: Jesteś pewien? (tej operacji NIE MOŻNA cofnąć) form_password: # description: "You can change your password here. Your new password should by at least 8 characters long." old_password_label: 'Stare hasło' @@ -168,6 +185,7 @@ entry: preview_picture_label: 'Posiada podgląd obrazu' preview_picture_help: 'Podgląd obrazu' language_label: 'Język' + # http_status_label: 'HTTP status' reading_time: label: 'Czas czytania w minutach' from: 'od' @@ -329,6 +347,9 @@ tag: list: number_on_the_page: '{0} Nie ma tagów.|{1} Jest jeden tag.|]1,Inf[ Są %count% tagi.' see_untagged_entries: 'Zobacz nieotagowane wpisy' + new: + add: 'Dodaj' + placeholder: 'Możesz dodać kilka tagów, oddzielając je przecinkami.' import: page_title: 'Import' @@ -362,6 +383,7 @@ import: how_to: 'Wybierz swój plik eksportu z Readability i kliknij poniższy przycisk, aby go załadować.' worker: enabled: "Import jest wykonywany asynchronicznie. Od momentu rozpoczęcia importu, zewnętrzna usługa może zajmować się na raz tylko jednym zadaniem. Bieżącą usługą jest:" + download_images_warning: "Włączyłeś pobieranie obrazów dla swoich artykułów. W połączeniu z klasycznym importem, może to zająć dużo czasu (lub zakończyć się niepowodzeniem).Zdecydowanie zalecamy włączenie asynchronicznego importu, w celu uniknięcia błędów." firefox: page_title: 'Import > Firefox' description: "Ten importer zaimportuje wszystkie twoje zakładki z Firefoksa. Idź do twoich zakładek (Ctrl+Shift+O), następnie w \"Import i kopie zapasowe\", wybierz \"Utwórz kopię zapasową...\". Uzyskasz plik .json." @@ -374,6 +396,10 @@ import: page_title: 'Import > Instapaper' description: 'Ten importer, zaimportuje wszystkie twoje artykuły z Instapaper. W ustawieniach (https://www.instapaper.com/user), kliknij na "Download .CSV file" w sekcji "Export". Otrzymasz plik CSV.' how_to: 'Wybierz swój plik eksportu z Instapaper i kliknij poniższy przycisk, aby go załadować.' + pinboard: + page_title: "Import > Pinboard" + description: 'Ten importer, zaimportuje wszystkie twoje artykuły z Pinboard. W ustawieniach kopii zapasowej (https://pinboard.in/settings/backup), kliknij na "JSON" w sekcji "Bookmarks". Otrzymasz plik "pinboard_export".' + how_to: 'Wybierz swój plik eksportu z Pinboard i kliknij poniższy przycisk, aby go załadować.' developer: page_title: 'Deweloper' @@ -453,7 +479,7 @@ user: back_to_list: Powrót do listy error: - # page_title: An error occurred + page_title: Wystąpił błąd flashes: config: @@ -465,8 +491,10 @@ flashes: rss_updated: 'Informacje RSS zaktualizowane' tagging_rules_updated: 'Reguły tagowania zaktualizowane' tagging_rules_deleted: 'Reguła tagowania usunięta' - user_added: 'Użytkownik "%username%" dodany' rss_token_updated: 'Token kanału RSS zaktualizowany' + annotations_reset: Zresetuj adnotacje + tags_reset: Zresetuj tagi + entries_reset: Zresetuj wpisy entry: notice: entry_already_saved: 'Wpis już został dodany %date%' @@ -496,3 +524,8 @@ flashes: notice: client_created: 'Nowy klient utworzony.' client_deleted: 'Klient usunięty' + user: + notice: + added: 'Użytkownik "%username%" dodany' + updated: 'Użytkownik "%username%" zaktualizowany' + deleted: 'Użytkownik "%username%" usunięty' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml index a375ac7b..1c1c9a78 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml @@ -70,7 +70,12 @@ config: 200_word: 'Posso ler ~200 palavras por minuto' 300_word: 'Posso ler ~300 palavras por minuto' 400_word: 'Posso ler ~400 palavras por minuto' + action_mark_as_read: + # label: 'Where do you to be redirected after mark an article as read?' + # redirect_homepage: 'To the homepage' + # redirect_current_page: 'To the current page' pocket_consumer_key_label: 'Chave do consumidor do Pocket para importar conteúdo' + # android_configuration: Configure your Android application # help_theme: "wallabag is customizable. You can choose your prefered theme here." # help_items_per_page: "You can change the number of articles displayed on each page." # help_reading_speed: "wallabag calculates a reading time for each article. You can define here, thanks to this list, if you are a fast or a slow reader. wallabag will recalculate the reading time for each article." @@ -94,6 +99,18 @@ config: email_label: 'E-mail' twoFactorAuthentication_label: 'Autenticação de dois passos' # help_twoFactorAuthentication: "If you enable 2FA, each time you want to login to wallabag, you'll receive a code by email." + delete: + # title: Delete my account (a.k.a danger zone) + # description: If you remove your account, ALL your articles, ALL your tags, ALL your annotations and your account will be PERMANENTLY removed (it can't be UNDONE). You'll then be logged out. + # confirm: Are you really sure? (THIS CAN'T BE UNDONE) + # button: Delete my account + reset: + # title: Reset area (a.k.a danger zone) + # description: By hiting buttons below you'll have ability to remove some informations from your account. Be aware that these actions are IRREVERSIBLE. + # annotations: Remove ALL annotations + # tags: Remove ALL tags + # entries: Remove ALL entries + # confirm: Are you really really sure? (THIS CAN'T BE UNDONE) form_password: # description: "You can change your password here. Your new password should by at least 8 characters long." old_password_label: 'Senha atual' @@ -168,6 +185,7 @@ entry: preview_picture_label: 'Possui uma imagem de preview' preview_picture_help: 'Imagem de preview' language_label: 'Idioma' + # http_status_label: 'HTTP status' reading_time: label: 'Tempo de leitura em minutos' from: 'de' @@ -329,6 +347,9 @@ tag: list: number_on_the_page: '{0} Não existem tags.|{1} Uma tag.|]1,Inf[ Existem %count% tags.' see_untagged_entries: 'Ver entradas sem tags' + new: + # add: 'Add' + # placeholder: 'You can add several tags, separated by a comma.' import: page_title: 'Importar' @@ -362,6 +383,7 @@ import: how_to: 'Por favor, selecione sua exportação do Readability e clique no botão abaixo para importá-la.' worker: enabled: "A importação é feita assíncronamente. Uma vez que a tarefa de importação é iniciada, um trabalho externo pode executar tarefas uma por vez. O serviço atual é:" + # download_images_warning: "You enabled downloading images for your articles. Combined with classic import it can take ages to proceed (or maybe failed). We strongly recommend to enable asynchronous import to avoid errors." firefox: page_title: 'Importar > Firefox' description: "Com este importador você importa todos os favoritos de seu Firefox. Somente vá até seus favoritos (Ctrl+Maj+O), e em \"Importar e Backup\" e escolha \"Backup...\". Você terá então um arquivo .json." @@ -374,6 +396,10 @@ import: page_title: 'Importar > Instapaper' description: 'Este importador pode importar todos os artigos do seu Instapaper. Nas página de configurações (https://www.instapaper.com/user), clique em "Download .CSV file" na seção "Export". Um arquivo CSV será baixado (algo como "instapaper-export.csv").' how_to: 'Por favor, selecione sua exportação do seu Instapaper e clique no botão abaixo para importá-la.' + pinboard: + # page_title: "Import > Pinboard" + # description: 'This importer will import all your Instapaper articles. On the backup (https://pinboard.in/settings/backup) page, click on "JSON" in the "Bookmarks" section. A JSON file will be downloaded (like "pinboard_export").' + # how_to: 'Please select your Pinboard export and click on the below button to upload and import it.' developer: page_title: 'Desenvolvedor' @@ -452,17 +478,23 @@ user: delete_confirm: 'Tem certeza?' back_to_list: 'Voltar para a lista' +error: + # page_title: An error occurred + flashes: config: notice: config_saved: 'Configiração salva.' password_updated: 'Senha atualizada' password_not_updated_demo: 'Em modo de demonstração, você não pode alterar a senha deste usuário.' - user_updated: 'Informação atualizada' + # user_updated: 'Information updated' rss_updated: 'Informação de RSS atualizada' tagging_rules_updated: 'Regras de tags atualizadas' tagging_rules_deleted: 'Regra de tag apagada' rss_token_updated: 'Token RSS atualizado' + # annotations_reset: Annotations reset + # tags_reset: Tags reset + # entries_reset: Entries reset entry: notice: entry_already_saved: 'Entrada já foi salva em %date%' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml index 7d8fcea3..8da04d95 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml @@ -70,7 +70,12 @@ config: # 200_word: 'I read ~200 words per minute' # 300_word: 'I read ~300 words per minute' # 400_word: 'I read ~400 words per minute' + action_mark_as_read: + # label: 'Where do you to be redirected after mark an article as read?' + # redirect_homepage: 'To the homepage' + # redirect_current_page: 'To the current page' pocket_consumer_key_label: Cheie consumator pentru importarea contentului din Pocket + # android_configuration: Configure your Android application # help_theme: "wallabag is customizable. You can choose your prefered theme here." # help_items_per_page: "You can change the number of articles displayed on each page." # help_reading_speed: "wallabag calculates a reading time for each article. You can define here, thanks to this list, if you are a fast or a slow reader. wallabag will recalculate the reading time for each article." @@ -94,6 +99,18 @@ config: email_label: 'E-mail' # twoFactorAuthentication_label: 'Two factor authentication' # help_twoFactorAuthentication: "If you enable 2FA, each time you want to login to wallabag, you'll receive a code by email." + delete: + # title: Delete my account (a.k.a danger zone) + # description: If you remove your account, ALL your articles, ALL your tags, ALL your annotations and your account will be PERMANENTLY removed (it can't be UNDONE). You'll then be logged out. + # confirm: Are you really sure? (THIS CAN'T BE UNDONE) + # button: Delete my account + reset: + # title: Reset area (a.k.a danger zone) + # description: By hiting buttons below you'll have ability to remove some informations from your account. Be aware that these actions are IRREVERSIBLE. + # annotations: Remove ALL annotations + # tags: Remove ALL tags + # entries: Remove ALL entries + # confirm: Are you really really sure? (THIS CAN'T BE UNDONE) form_password: # description: "You can change your password here. Your new password should by at least 8 characters long." old_password_label: 'Parola veche' @@ -168,6 +185,7 @@ entry: preview_picture_label: 'Are o imagine de previzualizare' preview_picture_help: 'Previzualizare imagine' language_label: 'Limbă' + # http_status_label: 'HTTP status' reading_time: label: 'Timp de citire în minute' from: 'de la' @@ -329,6 +347,9 @@ tag: list: # number_on_the_page: '{0} There is no tag.|{1} There is one tag.|]1,Inf[ There are %count% tags.' # see_untagged_entries: 'See untagged entries' + new: + # add: 'Add' + # placeholder: 'You can add several tags, separated by a comma.' import: # page_title: 'Import' @@ -362,6 +383,7 @@ import: # how_to: 'Please select your Readability export and click on the below button to upload and import it.' worker: # enabled: "Import is made asynchronously. Once the import task is started, an external worker will handle jobs one at a time. The current service is:" + # download_images_warning: "You enabled downloading images for your articles. Combined with classic import it can take ages to proceed (or maybe failed). We strongly recommend to enable asynchronous import to avoid errors." # firefox: # page_title: 'Import > Firefox' # description: "This importer will import all your Firefox bookmarks. Just go to your bookmarks (Ctrl+Maj+O), then into \"Import and backup\", choose \"Backup...\". You will obtain a .json file." @@ -374,6 +396,10 @@ import: # page_title: 'Import > Instapaper' # description: 'This importer will import all your Instapaper articles. On the settings (https://www.instapaper.com/user) page, click on "Download .CSV file" in the "Export" section. A CSV file will be downloaded (like "instapaper-export.csv").' # how_to: 'Please select your Instapaper export and click on the below button to upload and import it.' + pinboard: + # page_title: "Import > Pinboard" + # description: 'This importer will import all your Instapaper articles. On the backup (https://pinboard.in/settings/backup) page, click on "JSON" in the "Bookmarks" section. A JSON file will be downloaded (like "pinboard_export").' + # how_to: 'Please select your Pinboard export and click on the below button to upload and import it.' developer: # page_title: 'Developer' @@ -465,8 +491,10 @@ flashes: rss_updated: 'Informație RSS actualizată' # tagging_rules_updated: 'Tagging rules updated' # tagging_rules_deleted: 'Tagging rule deleted' - # user_added: 'User "%username%" added' # rss_token_updated: 'RSS token updated' + # annotations_reset: Annotations reset + # tags_reset: Tags reset + # entries_reset: Entries reset entry: notice: # entry_already_saved: 'Entry already saved on %date%' @@ -496,3 +524,8 @@ flashes: notice: # client_created: 'New client created.' # client_deleted: 'Client deleted' + user: + notice: + # added: 'User "%username%" added' + # updated: 'User "%username%" updated' + # deleted: 'User "%username%" deleted' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml index 357aa2ae..8d94044c 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml @@ -70,7 +70,12 @@ config: # 200_word: 'I read ~200 words per minute' # 300_word: 'I read ~300 words per minute' # 400_word: 'I read ~400 words per minute' + action_mark_as_read: + # label: 'Where do you to be redirected after mark an article as read?' + # redirect_homepage: 'To the homepage' + # redirect_current_page: 'To the current page' # pocket_consumer_key_label: Consumer key for Pocket to import contents + # android_configuration: Configure your Android application # help_theme: "wallabag is customizable. You can choose your prefered theme here." # help_items_per_page: "You can change the number of articles displayed on each page." # help_reading_speed: "wallabag calculates a reading time for each article. You can define here, thanks to this list, if you are a fast or a slow reader. wallabag will recalculate the reading time for each article." @@ -94,6 +99,18 @@ config: email_label: 'E-posta' twoFactorAuthentication_label: 'İki adımlı doğrulama' # help_twoFactorAuthentication: "If you enable 2FA, each time you want to login to wallabag, you'll receive a code by email." + delete: + # title: Delete my account (a.k.a danger zone) + # description: If you remove your account, ALL your articles, ALL your tags, ALL your annotations and your account will be PERMANENTLY removed (it can't be UNDONE). You'll then be logged out. + # confirm: Are you really sure? (THIS CAN'T BE UNDONE) + # button: Delete my account + reset: + # title: Reset area (a.k.a danger zone) + # description: By hiting buttons below you'll have ability to remove some informations from your account. Be aware that these actions are IRREVERSIBLE. + # annotations: Remove ALL annotations + # tags: Remove ALL tags + # entries: Remove ALL entries + # confirm: Are you really really sure? (THIS CAN'T BE UNDONE) form_password: # description: "You can change your password here. Your new password should by at least 8 characters long." old_password_label: 'Eski şifre' @@ -103,6 +120,7 @@ config: # if_label: 'if' # then_tag_as_label: 'then tag as' # delete_rule_label: 'delete' + # edit_rule_label: 'edit' rule_label: 'Kural' tags_label: 'Etiketler' faq: @@ -167,6 +185,7 @@ entry: preview_picture_label: 'Resim önizlemesi varsa' preview_picture_help: 'Resim önizlemesi' language_label: 'Dil' + # http_status_label: 'HTTP status' reading_time: label: 'Dakika cinsinden okuma süresi' from: 'başlangıç' @@ -328,6 +347,9 @@ tag: list: number_on_the_page: '{0} Herhangi bir etiket yok.|{1} Burada bir adet etiket var.|]1,Inf[ Burada %count% adet etiket var.' # see_untagged_entries: 'See untagged entries' + new: + # add: 'Add' + # placeholder: 'You can add several tags, separated by a comma.' import: page_title: 'İçe Aktar' @@ -361,6 +383,7 @@ import: # how_to: 'Please select your Readability export and click on the below button to upload and import it.' worker: # enabled: "Import is made asynchronously. Once the import task is started, an external worker will handle jobs one at a time. The current service is:" + # download_images_warning: "You enabled downloading images for your articles. Combined with classic import it can take ages to proceed (or maybe failed). We strongly recommend to enable asynchronous import to avoid errors." firefox: page_title: 'İçe Aktar > Firefox' # description: "This importer will import all your Firefox bookmarks. Just go to your bookmarks (Ctrl+Maj+O), then into \"Import and backup\", choose \"Backup...\". You will obtain a .json file." @@ -373,6 +396,10 @@ import: page_title: 'İçe Aktar > Instapaper' # description: 'This importer will import all your Instapaper articles. On the settings (https://www.instapaper.com/user) page, click on "Download .CSV file" in the "Export" section. A CSV file will be downloaded (like "instapaper-export.csv").' # how_to: 'Please select your Instapaper export and click on the below button to upload and import it.' + pinboard: + # page_title: "Import > Pinboard" + # description: 'This importer will import all your Instapaper articles. On the backup (https://pinboard.in/settings/backup) page, click on "JSON" in the "Bookmarks" section. A JSON file will be downloaded (like "pinboard_export").' + # how_to: 'Please select your Pinboard export and click on the below button to upload and import it.' developer: # page_title: 'Developer' @@ -464,8 +491,10 @@ flashes: rss_updated: 'RSS bilgiler güncellendi' tagging_rules_updated: 'Tagging rules updated' tagging_rules_deleted: 'Tagging rule deleted' - user_added: 'User "%username%" added' rss_token_updated: 'RSS token updated' + # annotations_reset: Annotations reset + # tags_reset: Tags reset + # entries_reset: Entries reset entry: notice: entry_already_saved: 'Entry already saved on %date%' @@ -495,3 +524,8 @@ flashes: notice: # client_created: 'New client created.' # client_deleted: 'Client deleted' + user: + notice: + # added: 'User "%username%" added' + # updated: 'User "%username%" updated' + # deleted: 'User "%username%" deleted' diff --git a/src/Wallabag/CoreBundle/Resources/views/base.html.twig b/src/Wallabag/CoreBundle/Resources/views/base.html.twig index a1a9a136..289458d4 100644 --- a/src/Wallabag/CoreBundle/Resources/views/base.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/base.html.twig @@ -41,6 +41,8 @@ {% block css %} {% endblock %} {% block scripts %} + + {% endblock %} {% block title %}{% endblock %} – wallabag diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig index 98b0e119..3548f590 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig @@ -45,6 +45,14 @@ +
+
+ {{ form_label(form.config.action_mark_as_read) }} + {{ form_errors(form.config.action_mark_as_read) }} + {{ form_widget(form.config.action_mark_as_read) }} +
+
+
{{ form_label(form.config.language) }} @@ -71,6 +79,19 @@
+
+
+

{{ 'config.form_settings.android_configuration'|trans }}

+ Touch here to prefill your Android application +
+ + +
+
+ {{ form_rest(form.config) }} @@ -164,10 +185,41 @@ {% endif %} +

{{ 'config.reset.title'|trans }}

+
+

{{ 'config.reset.description'|trans }}

+ +
+ {{ form_widget(form.user._token) }} {{ form_widget(form.user.save) }} + {% if enabled_users > 1 %} +

{{ 'config.form_user.delete.title'|trans }}

+ +

{{ 'config.form_user.delete.description'|trans }}

+ + {% endif %} +

{{ 'config.tab_menu.password'|trans }}

{{ form_start(form.pwd) }} diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig index 56a0faac..d1baa283 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig @@ -131,6 +131,13 @@ +
+ {{ form_label(form.httpStatus) }} +
+ {{ form_widget(form.httpStatus) }} +
+
+
{{ form_label(form.readingTime) }} diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig index 3689159b..2e9673d5 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig @@ -11,7 +11,7 @@
+
+
+ {{ form_label(form.config.action_mark_as_read) }} + {{ form_errors(form.config.action_mark_as_read) }} + {{ form_widget(form.config.action_mark_as_read) }} +
+
+
{{ form_label(form.config.language) }} @@ -96,6 +104,18 @@
+
+
+
{{ 'config.form_settings.android_configuration'|trans }}
+ Touch here to prefill your Android application + +
+ +
+ {{ form_widget(form.config.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }} {{ form_rest(form.config) }} @@ -197,6 +217,34 @@ {{ form_widget(form.user.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }} {{ form_widget(form.user._token) }} + +


+ +
+
{{ 'config.reset.title'|trans }}
+

{{ 'config.reset.description'|trans }}

+ + {{ 'config.reset.annotations'|trans }} + + + {{ 'config.reset.tags'|trans }} + + + {{ 'config.reset.entries'|trans }} + +
+ + {% if enabled_users > 1 %} +


+ +
+
{{ 'config.form_user.delete.title'|trans }}
+

{{ 'config.form_user.delete.description'|trans }}

+ +
+ {% endif %}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig index c610c8d2..160dbf3d 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig @@ -103,6 +103,14 @@ {{ form_widget(form.language) }}
+
+ {{ form_label(form.httpStatus) }} +
+ +
+ {{ form_widget(form.httpStatus) }} +
+
{{ form_label(form.readingTime) }}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig index c615a907..bed0fdec 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig @@ -46,14 +46,14 @@
  • - + link {{ 'entry.view.left_menu.view_original_article'|trans }}
  • -
  • +
  • autorenew {{ 'entry.view.left_menu.re_fetch_content'|trans }} @@ -67,7 +67,7 @@ {% endif %}
  • - + {% if entry.isArchived == 0 %}done{% else %}redo{% endif %} {{ markAsReadLabel|trans }} @@ -75,21 +75,21 @@
  • - + {% if entry.isStarred == 0 %}star_outline{% else %}star{% endif %} {{ 'entry.view.left_menu.set_as_starred'|trans }}
  • -
  • - +
  • + delete {{ 'entry.view.left_menu.delete'|trans }}
  • -
  • +
  • label_outline {{ 'entry.view.left_menu.add_a_tag'|trans }} @@ -139,6 +139,14 @@
  • {% endif %} + {% if craue_setting('share_unmark') %} +
  • + + + unmark.it + +
  • + {% endif %} {% if craue_setting('carrot') %}
  • @@ -186,14 +194,6 @@
  • -
  • - - delete - {{ 'entry.view.left_menu.delete'|trans }} - -
    -
  • -
  • error diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/new_form.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/new_form.html.twig index 6e552560..b702c4b6 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/new_form.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/new_form.html.twig @@ -9,5 +9,6 @@ {{ form_widget(form.label, { 'attr': {'autocomplete': 'off'} }) }} - {{ form_rest(form) }} + {{ form_widget(form.add, {'attr': {'class': 'btn waves-effect waves-light hide-on-large-only'}}) }} + {{ form_widget(form._token) }} diff --git a/src/Wallabag/ImportBundle/Command/ImportCommand.php b/src/Wallabag/ImportBundle/Command/ImportCommand.php index d1325338..28d01715 100644 --- a/src/Wallabag/ImportBundle/Command/ImportCommand.php +++ b/src/Wallabag/ImportBundle/Command/ImportCommand.php @@ -14,10 +14,10 @@ class ImportCommand extends ContainerAwareCommand { $this ->setName('wallabag:import') - ->setDescription('Import entries from a JSON export from a wallabag v1 instance') + ->setDescription('Import entries from a JSON export') ->addArgument('userId', InputArgument::REQUIRED, 'User ID to populate') ->addArgument('filepath', InputArgument::REQUIRED, 'Path to the JSON file') - ->addOption('importer', null, InputArgument::OPTIONAL, 'The importer to use: wallabag v1, v2, firefox or chrome', 'v1') + ->addOption('importer', null, InputArgument::OPTIONAL, 'The importer to use: v1, v2, instapaper, pinboard, readability, firefox or chrome', 'v1') ->addOption('markAsRead', null, InputArgument::OPTIONAL, 'Mark all entries as read', false) ; } @@ -42,32 +42,36 @@ class ImportCommand extends ContainerAwareCommand switch ($input->getOption('importer')) { case 'v2': - $wallabag = $this->getContainer()->get('wallabag_import.wallabag_v2.import'); + $import = $this->getContainer()->get('wallabag_import.wallabag_v2.import'); break; case 'firefox': - $wallabag = $this->getContainer()->get('wallabag_import.firefox.import'); + $import = $this->getContainer()->get('wallabag_import.firefox.import'); break; case 'chrome': - $wallabag = $this->getContainer()->get('wallabag_import.chrome.import'); + $import = $this->getContainer()->get('wallabag_import.chrome.import'); + break; + case 'readability': + $import = $this->getContainer()->get('wallabag_import.readability.import'); break; case 'instapaper': - $wallabag = $this->getContainer()->get('wallabag_import.instapaper.import'); + $import = $this->getContainer()->get('wallabag_import.instapaper.import'); break; - case 'v1': - default: - $wallabag = $this->getContainer()->get('wallabag_import.wallabag_v1.import'); + case 'pinboard': + $import = $this->getContainer()->get('wallabag_import.pinboard.import'); break; + default: + $import = $this->getContainer()->get('wallabag_import.wallabag_v1.import'); } - $wallabag->setMarkAsRead($input->getOption('markAsRead')); - $wallabag->setUser($user); + $import->setMarkAsRead($input->getOption('markAsRead')); + $import->setUser($user); - $res = $wallabag + $res = $import ->setFilepath($input->getArgument('filepath')) ->import(); if (true === $res) { - $summary = $wallabag->getSummary(); + $summary = $import->getSummary(); $output->writeln(''.$summary['imported'].' imported'); $output->writeln(''.$summary['skipped'].' already saved'); } diff --git a/src/Wallabag/ImportBundle/Command/RedisWorkerCommand.php b/src/Wallabag/ImportBundle/Command/RedisWorkerCommand.php index c2c11f11..f793a314 100644 --- a/src/Wallabag/ImportBundle/Command/RedisWorkerCommand.php +++ b/src/Wallabag/ImportBundle/Command/RedisWorkerCommand.php @@ -17,7 +17,7 @@ class RedisWorkerCommand extends ContainerAwareCommand $this ->setName('wallabag:import:redis-worker') ->setDescription('Launch Redis worker') - ->addArgument('serviceName', InputArgument::REQUIRED, 'Service to use: wallabag_v1, wallabag_v2, pocket, readability, firefox, chrome or instapaper') + ->addArgument('serviceName', InputArgument::REQUIRED, 'Service to use: wallabag_v1, wallabag_v2, pocket, readability, pinboard, firefox, chrome or instapaper') ->addOption('maxIterations', '', InputOption::VALUE_OPTIONAL, 'Number of iterations before stoping', false) ; } diff --git a/src/Wallabag/ImportBundle/Consumer/AbstractConsumer.php b/src/Wallabag/ImportBundle/Consumer/AbstractConsumer.php index b893ea29..fc175f67 100644 --- a/src/Wallabag/ImportBundle/Consumer/AbstractConsumer.php +++ b/src/Wallabag/ImportBundle/Consumer/AbstractConsumer.php @@ -9,19 +9,23 @@ use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\Tag; use Psr\Log\LoggerInterface; use Psr\Log\NullLogger; +use Symfony\Component\EventDispatcher\EventDispatcherInterface; +use Wallabag\CoreBundle\Event\EntrySavedEvent; abstract class AbstractConsumer { protected $em; protected $userRepository; protected $import; + protected $eventDispatcher; protected $logger; - public function __construct(EntityManager $em, UserRepository $userRepository, AbstractImport $import, LoggerInterface $logger = null) + public function __construct(EntityManager $em, UserRepository $userRepository, AbstractImport $import, EventDispatcherInterface $eventDispatcher, LoggerInterface $logger = null) { $this->em = $em; $this->userRepository = $userRepository; $this->import = $import; + $this->eventDispatcher = $eventDispatcher; $this->logger = $logger ?: new NullLogger(); } @@ -59,6 +63,9 @@ abstract class AbstractConsumer try { $this->em->flush(); + // entry saved, dispatch event about it! + $this->eventDispatcher->dispatch(EntrySavedEvent::NAME, new EntrySavedEvent($entry)); + // clear only affected entities $this->em->clear(Entry::class); $this->em->clear(Tag::class); diff --git a/src/Wallabag/ImportBundle/Controller/ImportController.php b/src/Wallabag/ImportBundle/Controller/ImportController.php index 15de75ff..237c748e 100644 --- a/src/Wallabag/ImportBundle/Controller/ImportController.php +++ b/src/Wallabag/ImportBundle/Controller/ImportController.php @@ -42,6 +42,7 @@ class ImportController extends Controller + $this->getTotalMessageInRabbitQueue('firefox') + $this->getTotalMessageInRabbitQueue('chrome') + $this->getTotalMessageInRabbitQueue('instapaper') + + $this->getTotalMessageInRabbitQueue('pinboard') ; } catch (\Exception $e) { $rabbitNotInstalled = true; @@ -57,6 +58,7 @@ class ImportController extends Controller + $redis->llen('wallabag.import.firefox') + $redis->llen('wallabag.import.chrome') + $redis->llen('wallabag.import.instapaper') + + $redis->llen('wallabag.import.pinboard') ; } catch (\Exception $e) { $redisNotInstalled = true; diff --git a/src/Wallabag/ImportBundle/Controller/PinboardController.php b/src/Wallabag/ImportBundle/Controller/PinboardController.php new file mode 100644 index 00000000..9c3f98d6 --- /dev/null +++ b/src/Wallabag/ImportBundle/Controller/PinboardController.php @@ -0,0 +1,77 @@ +createForm(UploadImportType::class); + $form->handleRequest($request); + + $pinboard = $this->get('wallabag_import.pinboard.import'); + $pinboard->setUser($this->getUser()); + + if ($this->get('craue_config')->get('import_with_rabbitmq')) { + $pinboard->setProducer($this->get('old_sound_rabbit_mq.import_pinboard_producer')); + } elseif ($this->get('craue_config')->get('import_with_redis')) { + $pinboard->setProducer($this->get('wallabag_import.producer.redis.pinboard')); + } + + if ($form->isValid()) { + $file = $form->get('file')->getData(); + $markAsRead = $form->get('mark_as_read')->getData(); + $name = 'pinboard_'.$this->getUser()->getId().'.json'; + + if (null !== $file && in_array($file->getClientMimeType(), $this->getParameter('wallabag_import.allow_mimetypes')) && $file->move($this->getParameter('wallabag_import.resource_dir'), $name)) { + $res = $pinboard + ->setFilepath($this->getParameter('wallabag_import.resource_dir').'/'.$name) + ->setMarkAsRead($markAsRead) + ->import(); + + $message = 'flashes.import.notice.failed'; + + if (true === $res) { + $summary = $pinboard->getSummary(); + $message = $this->get('translator')->trans('flashes.import.notice.summary', [ + '%imported%' => $summary['imported'], + '%skipped%' => $summary['skipped'], + ]); + + if (0 < $summary['queued']) { + $message = $this->get('translator')->trans('flashes.import.notice.summary_with_queue', [ + '%queued%' => $summary['queued'], + ]); + } + + unlink($this->getParameter('wallabag_import.resource_dir').'/'.$name); + } + + $this->get('session')->getFlashBag()->add( + 'notice', + $message + ); + + return $this->redirect($this->generateUrl('homepage')); + } else { + $this->get('session')->getFlashBag()->add( + 'notice', + 'flashes.import.notice.failed_on_file' + ); + } + } + + return $this->render('WallabagImportBundle:Pinboard:index.html.twig', [ + 'form' => $form->createView(), + 'import' => $pinboard, + ]); + } +} diff --git a/src/Wallabag/ImportBundle/Import/AbstractImport.php b/src/Wallabag/ImportBundle/Import/AbstractImport.php index 764b390a..1d4a6e27 100644 --- a/src/Wallabag/ImportBundle/Import/AbstractImport.php +++ b/src/Wallabag/ImportBundle/Import/AbstractImport.php @@ -10,12 +10,15 @@ use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\Tag; use Wallabag\UserBundle\Entity\User; use OldSound\RabbitMqBundle\RabbitMq\ProducerInterface; +use Symfony\Component\EventDispatcher\EventDispatcherInterface; +use Wallabag\CoreBundle\Event\EntrySavedEvent; abstract class AbstractImport implements ImportInterface { protected $em; protected $logger; protected $contentProxy; + protected $eventDispatcher; protected $producer; protected $user; protected $markAsRead; @@ -23,11 +26,12 @@ abstract class AbstractImport implements ImportInterface protected $importedEntries = 0; protected $queuedEntries = 0; - public function __construct(EntityManager $em, ContentProxy $contentProxy) + public function __construct(EntityManager $em, ContentProxy $contentProxy, EventDispatcherInterface $eventDispatcher) { $this->em = $em; $this->logger = new NullLogger(); $this->contentProxy = $contentProxy; + $this->eventDispatcher = $eventDispatcher; } public function setLogger(LoggerInterface $logger) @@ -104,6 +108,7 @@ abstract class AbstractImport implements ImportInterface protected function parseEntries($entries) { $i = 1; + $entryToBeFlushed = []; foreach ($entries as $importedEntry) { if ($this->markAsRead) { @@ -116,10 +121,21 @@ abstract class AbstractImport implements ImportInterface continue; } + // store each entry to be flushed so we can trigger the entry.saved event for each of them + // entry.saved needs the entry to be persisted in db because it needs it id to generate + // images (at least) + $entryToBeFlushed[] = $entry; + // flush every 20 entries if (($i % 20) === 0) { $this->em->flush(); + foreach ($entryToBeFlushed as $entry) { + $this->eventDispatcher->dispatch(EntrySavedEvent::NAME, new EntrySavedEvent($entry)); + } + + $entryToBeFlushed = []; + // clear only affected entities $this->em->clear(Entry::class); $this->em->clear(Tag::class); @@ -128,6 +144,12 @@ abstract class AbstractImport implements ImportInterface } $this->em->flush(); + + if (!empty($entryToBeFlushed)) { + foreach ($entryToBeFlushed as $entry) { + $this->eventDispatcher->dispatch(EntrySavedEvent::NAME, new EntrySavedEvent($entry)); + } + } } /** diff --git a/src/Wallabag/ImportBundle/Import/BrowserImport.php b/src/Wallabag/ImportBundle/Import/BrowserImport.php index 2ca1683b..8bf7d92e 100644 --- a/src/Wallabag/ImportBundle/Import/BrowserImport.php +++ b/src/Wallabag/ImportBundle/Import/BrowserImport.php @@ -5,6 +5,7 @@ namespace Wallabag\ImportBundle\Import; use Wallabag\CoreBundle\Entity\Entry; use Wallabag\UserBundle\Entity\User; use Wallabag\CoreBundle\Helper\ContentProxy; +use Wallabag\CoreBundle\Event\EntrySavedEvent; abstract class BrowserImport extends AbstractImport { @@ -81,6 +82,7 @@ abstract class BrowserImport extends AbstractImport protected function parseEntries($entries) { $i = 1; + $entryToBeFlushed = []; foreach ($entries as $importedEntry) { if ((array) $importedEntry !== $importedEntry) { @@ -93,14 +95,29 @@ abstract class BrowserImport extends AbstractImport continue; } + // @see AbstractImport + $entryToBeFlushed[] = $entry; + // flush every 20 entries if (($i % 20) === 0) { $this->em->flush(); + + foreach ($entryToBeFlushed as $entry) { + $this->eventDispatcher->dispatch(EntrySavedEvent::NAME, new EntrySavedEvent($entry)); + } + + $entryToBeFlushed = []; } ++$i; } $this->em->flush(); + + if (!empty($entryToBeFlushed)) { + foreach ($entryToBeFlushed as $entry) { + $this->eventDispatcher->dispatch(EntrySavedEvent::NAME, new EntrySavedEvent($entry)); + } + } } /** diff --git a/src/Wallabag/ImportBundle/Import/PinboardImport.php b/src/Wallabag/ImportBundle/Import/PinboardImport.php new file mode 100644 index 00000000..9bcfbc36 --- /dev/null +++ b/src/Wallabag/ImportBundle/Import/PinboardImport.php @@ -0,0 +1,143 @@ +filepath = $filepath; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function import() + { + if (!$this->user) { + $this->logger->error('PinboardImport: user is not defined'); + + return false; + } + + if (!file_exists($this->filepath) || !is_readable($this->filepath)) { + $this->logger->error('PinboardImport: unable to read file', ['filepath' => $this->filepath]); + + return false; + } + + $data = json_decode(file_get_contents($this->filepath), true); + + if (empty($data)) { + $this->logger->error('PinboardImport: no entries in imported file'); + + return false; + } + + if ($this->producer) { + $this->parseEntriesForProducer($data); + + return true; + } + + $this->parseEntries($data); + + return true; + } + + /** + * {@inheritdoc} + */ + public function parseEntry(array $importedEntry) + { + $existingEntry = $this->em + ->getRepository('WallabagCoreBundle:Entry') + ->findByUrlAndUserId($importedEntry['href'], $this->user->getId()); + + if (false !== $existingEntry) { + ++$this->skippedEntries; + + return; + } + + $data = [ + 'title' => $importedEntry['description'], + 'url' => $importedEntry['href'], + 'content_type' => '', + 'language' => '', + 'is_archived' => ('no' === $importedEntry['toread']) || $this->markAsRead, + 'is_starred' => false, + 'created_at' => $importedEntry['time'], + 'tags' => explode(' ', $importedEntry['tags']), + ]; + + $entry = new Entry($this->user); + $entry->setUrl($data['url']); + $entry->setTitle($data['title']); + + // update entry with content (in case fetching failed, the given entry will be return) + $entry = $this->fetchContent($entry, $data['url'], $data); + + if (!empty($data['tags'])) { + $this->contentProxy->assignTagsToEntry( + $entry, + $data['tags'], + $this->em->getUnitOfWork()->getScheduledEntityInsertions() + ); + } + + $entry->setArchived($data['is_archived']); + $entry->setStarred($data['is_starred']); + $entry->setCreatedAt(new \DateTime($data['created_at'])); + + $this->em->persist($entry); + ++$this->importedEntries; + + return $entry; + } + + /** + * {@inheritdoc} + */ + protected function setEntryAsRead(array $importedEntry) + { + $importedEntry['toread'] = 'no'; + + return $importedEntry; + } +} diff --git a/src/Wallabag/ImportBundle/Import/PocketImport.php b/src/Wallabag/ImportBundle/Import/PocketImport.php index 327e2500..33093480 100644 --- a/src/Wallabag/ImportBundle/Import/PocketImport.php +++ b/src/Wallabag/ImportBundle/Import/PocketImport.php @@ -2,8 +2,6 @@ namespace Wallabag\ImportBundle\Import; -use Psr\Log\NullLogger; -use Doctrine\ORM\EntityManager; use GuzzleHttp\Client; use GuzzleHttp\Exception\RequestException; use Wallabag\CoreBundle\Entity\Entry; @@ -16,13 +14,6 @@ class PocketImport extends AbstractImport const NB_ELEMENTS = 5000; - public function __construct(EntityManager $em, ContentProxy $contentProxy) - { - $this->em = $em; - $this->contentProxy = $contentProxy; - $this->logger = new NullLogger(); - } - /** * Only used for test purpose. * diff --git a/src/Wallabag/ImportBundle/Resources/config/rabbit.yml b/src/Wallabag/ImportBundle/Resources/config/rabbit.yml index 70b8a0d4..e9ecb846 100644 --- a/src/Wallabag/ImportBundle/Resources/config/rabbit.yml +++ b/src/Wallabag/ImportBundle/Resources/config/rabbit.yml @@ -6,6 +6,7 @@ services: - "@doctrine.orm.entity_manager" - "@wallabag_user.user_repository" - "@wallabag_import.pocket.import" + - "@event_dispatcher" - "@logger" wallabag_import.consumer.amqp.readability: class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer @@ -13,6 +14,7 @@ services: - "@doctrine.orm.entity_manager" - "@wallabag_user.user_repository" - "@wallabag_import.readability.import" + - "@event_dispatcher" - "@logger" wallabag_import.consumer.amqp.instapaper: class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer @@ -20,6 +22,15 @@ services: - "@doctrine.orm.entity_manager" - "@wallabag_user.user_repository" - "@wallabag_import.instapaper.import" + - "@event_dispatcher" + - "@logger" + wallabag_import.consumer.amqp.pinboard: + class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer + arguments: + - "@doctrine.orm.entity_manager" + - "@wallabag_user.user_repository" + - "@wallabag_import.pinboard.import" + - "@event_dispatcher" - "@logger" wallabag_import.consumer.amqp.wallabag_v1: class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer @@ -27,6 +38,7 @@ services: - "@doctrine.orm.entity_manager" - "@wallabag_user.user_repository" - "@wallabag_import.wallabag_v1.import" + - "@event_dispatcher" - "@logger" wallabag_import.consumer.amqp.wallabag_v2: class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer @@ -34,6 +46,7 @@ services: - "@doctrine.orm.entity_manager" - "@wallabag_user.user_repository" - "@wallabag_import.wallabag_v2.import" + - "@event_dispatcher" - "@logger" wallabag_import.consumer.amqp.firefox: class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer @@ -41,6 +54,7 @@ services: - "@doctrine.orm.entity_manager" - "@wallabag_user.user_repository" - "@wallabag_import.firefox.import" + - "@event_dispatcher" - "@logger" wallabag_import.consumer.amqp.chrome: class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer @@ -48,4 +62,5 @@ services: - "@doctrine.orm.entity_manager" - "@wallabag_user.user_repository" - "@wallabag_import.chrome.import" + - "@event_dispatcher" - "@logger" diff --git a/src/Wallabag/ImportBundle/Resources/config/redis.yml b/src/Wallabag/ImportBundle/Resources/config/redis.yml index 0a81e1b5..091cdba0 100644 --- a/src/Wallabag/ImportBundle/Resources/config/redis.yml +++ b/src/Wallabag/ImportBundle/Resources/config/redis.yml @@ -18,6 +18,7 @@ services: - "@doctrine.orm.entity_manager" - "@wallabag_user.user_repository" - "@wallabag_import.readability.import" + - "@event_dispatcher" - "@logger" # instapaper @@ -38,6 +39,28 @@ services: - "@doctrine.orm.entity_manager" - "@wallabag_user.user_repository" - "@wallabag_import.instapaper.import" + - "@event_dispatcher" + - "@logger" + + # pinboard + wallabag_import.queue.redis.pinboard: + class: Simpleue\Queue\RedisQueue + arguments: + - "@wallabag_core.redis.client" + - "wallabag.import.pinboard" + + wallabag_import.producer.redis.pinboard: + class: Wallabag\ImportBundle\Redis\Producer + arguments: + - "@wallabag_import.queue.redis.pinboard" + + wallabag_import.consumer.redis.pinboard: + class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer + arguments: + - "@doctrine.orm.entity_manager" + - "@wallabag_user.user_repository" + - "@wallabag_import.pinboard.import" + - "@event_dispatcher" - "@logger" # pocket @@ -58,6 +81,7 @@ services: - "@doctrine.orm.entity_manager" - "@wallabag_user.user_repository" - "@wallabag_import.pocket.import" + - "@event_dispatcher" - "@logger" # wallabag v1 @@ -78,6 +102,7 @@ services: - "@doctrine.orm.entity_manager" - "@wallabag_user.user_repository" - "@wallabag_import.wallabag_v1.import" + - "@event_dispatcher" - "@logger" # wallabag v2 @@ -98,6 +123,7 @@ services: - "@doctrine.orm.entity_manager" - "@wallabag_user.user_repository" - "@wallabag_import.wallabag_v2.import" + - "@event_dispatcher" - "@logger" # firefox @@ -118,6 +144,7 @@ services: - "@doctrine.orm.entity_manager" - "@wallabag_user.user_repository" - "@wallabag_import.firefox.import" + - "@event_dispatcher" - "@logger" # chrome @@ -138,4 +165,5 @@ services: - "@doctrine.orm.entity_manager" - "@wallabag_user.user_repository" - "@wallabag_import.chrome.import" + - "@event_dispatcher" - "@logger" diff --git a/src/Wallabag/ImportBundle/Resources/config/services.yml b/src/Wallabag/ImportBundle/Resources/config/services.yml index d600be0f..c4fe3f92 100644 --- a/src/Wallabag/ImportBundle/Resources/config/services.yml +++ b/src/Wallabag/ImportBundle/Resources/config/services.yml @@ -20,6 +20,7 @@ services: arguments: - "@doctrine.orm.entity_manager" - "@wallabag_core.content_proxy" + - "@event_dispatcher" calls: - [ setClient, [ "@wallabag_import.pocket.client" ] ] - [ setLogger, [ "@logger" ]] @@ -31,6 +32,7 @@ services: arguments: - "@doctrine.orm.entity_manager" - "@wallabag_core.content_proxy" + - "@event_dispatcher" calls: - [ setLogger, [ "@logger" ]] tags: @@ -41,6 +43,7 @@ services: arguments: - "@doctrine.orm.entity_manager" - "@wallabag_core.content_proxy" + - "@event_dispatcher" calls: - [ setLogger, [ "@logger" ]] tags: @@ -51,6 +54,7 @@ services: arguments: - "@doctrine.orm.entity_manager" - "@wallabag_core.content_proxy" + - "@event_dispatcher" calls: - [ setLogger, [ "@logger" ]] tags: @@ -61,16 +65,29 @@ services: arguments: - "@doctrine.orm.entity_manager" - "@wallabag_core.content_proxy" + - "@event_dispatcher" calls: - [ setLogger, [ "@logger" ]] tags: - { name: wallabag_import.import, alias: instapaper } + wallabag_import.pinboard.import: + class: Wallabag\ImportBundle\Import\PinboardImport + arguments: + - "@doctrine.orm.entity_manager" + - "@wallabag_core.content_proxy" + - "@event_dispatcher" + calls: + - [ setLogger, [ "@logger" ]] + tags: + - { name: wallabag_import.import, alias: pinboard } + wallabag_import.firefox.import: class: Wallabag\ImportBundle\Import\FirefoxImport arguments: - "@doctrine.orm.entity_manager" - "@wallabag_core.content_proxy" + - "@event_dispatcher" calls: - [ setLogger, [ "@logger" ]] tags: @@ -80,6 +97,7 @@ services: arguments: - "@doctrine.orm.entity_manager" - "@wallabag_core.content_proxy" + - "@event_dispatcher" calls: - [ setLogger, [ "@logger" ]] tags: diff --git a/src/Wallabag/ImportBundle/Resources/views/Chrome/index.html.twig b/src/Wallabag/ImportBundle/Resources/views/Chrome/index.html.twig index ead828c6..93b08540 100644 --- a/src/Wallabag/ImportBundle/Resources/views/Chrome/index.html.twig +++ b/src/Wallabag/ImportBundle/Resources/views/Chrome/index.html.twig @@ -6,6 +6,8 @@
    + {% include 'WallabagImportBundle:Import:_information.html.twig' %} +
    {{ import.description|trans|raw }}

    {{ 'import.chrome.how_to'|trans }}

    diff --git a/src/Wallabag/ImportBundle/Resources/views/Firefox/index.html.twig b/src/Wallabag/ImportBundle/Resources/views/Firefox/index.html.twig index f975da3f..ced3f008 100644 --- a/src/Wallabag/ImportBundle/Resources/views/Firefox/index.html.twig +++ b/src/Wallabag/ImportBundle/Resources/views/Firefox/index.html.twig @@ -6,6 +6,8 @@
    + {% include 'WallabagImportBundle:Import:_information.html.twig' %} +
    {{ import.description|trans|raw }}

    {{ 'import.firefox.how_to'|trans }}

    diff --git a/src/Wallabag/ImportBundle/Resources/views/Import/_workerEnabled.html.twig b/src/Wallabag/ImportBundle/Resources/views/Import/_information.html.twig similarity index 55% rename from src/Wallabag/ImportBundle/Resources/views/Import/_workerEnabled.html.twig rename to src/Wallabag/ImportBundle/Resources/views/Import/_information.html.twig index 2390a41f..48bbcfe7 100644 --- a/src/Wallabag/ImportBundle/Resources/views/Import/_workerEnabled.html.twig +++ b/src/Wallabag/ImportBundle/Resources/views/Import/_information.html.twig @@ -1,8 +1,15 @@ {% set redis = craue_setting('import_with_redis') %} {% set rabbit = craue_setting('import_with_rabbitmq') %} +{% set downloadImages = craue_setting('download_images_enabled') %} {% if redis or rabbit %}
    {{ 'import.worker.enabled'|trans }} {% if rabbit %}RabbitMQ{% elseif redis %}Redis{% endif %}
    {% endif %} + +{% if not redis and not rabbit and downloadImages %} +
    + {{ 'import.worker.download_images_warning'|trans|raw }} +
    +{% endif %} diff --git a/src/Wallabag/ImportBundle/Resources/views/Import/index.html.twig b/src/Wallabag/ImportBundle/Resources/views/Import/index.html.twig index 6ea5e0f4..b1ec40a6 100644 --- a/src/Wallabag/ImportBundle/Resources/views/Import/index.html.twig +++ b/src/Wallabag/ImportBundle/Resources/views/Import/index.html.twig @@ -6,6 +6,8 @@
    + {% include 'WallabagImportBundle:Import:_information.html.twig' %} + {{ 'import.page_description'|trans }}
      {% for import in imports %} diff --git a/src/Wallabag/ImportBundle/Resources/views/Instapaper/index.html.twig b/src/Wallabag/ImportBundle/Resources/views/Instapaper/index.html.twig index 5789361f..28165d19 100644 --- a/src/Wallabag/ImportBundle/Resources/views/Instapaper/index.html.twig +++ b/src/Wallabag/ImportBundle/Resources/views/Instapaper/index.html.twig @@ -6,7 +6,7 @@
      - {% include 'WallabagImportBundle:Import:_workerEnabled.html.twig' %} + {% include 'WallabagImportBundle:Import:_information.html.twig' %}
      {{ import.description|trans }}
      diff --git a/src/Wallabag/ImportBundle/Resources/views/Pinboard/index.html.twig b/src/Wallabag/ImportBundle/Resources/views/Pinboard/index.html.twig new file mode 100644 index 00000000..43f196ad --- /dev/null +++ b/src/Wallabag/ImportBundle/Resources/views/Pinboard/index.html.twig @@ -0,0 +1,45 @@ +{% extends "WallabagCoreBundle::layout.html.twig" %} + +{% block title %}{{ 'import.pinboard.page_title'|trans }}{% endblock %} + +{% block content %} +
      +
      +
      + {% include 'WallabagImportBundle:Import:_information.html.twig' %} + +
      +
      {{ import.description|trans }}
      +

      {{ 'import.pinboard.how_to'|trans }}

      + +
      + {{ form_start(form, {'method': 'POST'}) }} + {{ form_errors(form) }} +
      +
      + {{ form_errors(form.file) }} +
      + {{ form.file.vars.label|trans }} + {{ form_widget(form.file) }} +
      +
      + +
      +
      +
      +
      {{ 'import.form.mark_as_read_title'|trans }}
      + {{ form_widget(form.mark_as_read) }} + {{ form_label(form.mark_as_read) }} +
      +
      + + {{ form_widget(form.save, { 'attr': {'class': 'btn waves-effect waves-light'} }) }} + + {{ form_rest(form) }} + +
      +
      +
      +
      +
      +{% endblock %} diff --git a/src/Wallabag/ImportBundle/Resources/views/Pocket/index.html.twig b/src/Wallabag/ImportBundle/Resources/views/Pocket/index.html.twig index 6195fa07..536e3d1a 100644 --- a/src/Wallabag/ImportBundle/Resources/views/Pocket/index.html.twig +++ b/src/Wallabag/ImportBundle/Resources/views/Pocket/index.html.twig @@ -6,7 +6,7 @@
      - {% include 'WallabagImportBundle:Import:_workerEnabled.html.twig' %} + {% include 'WallabagImportBundle:Import:_information.html.twig' %} {% if not has_consumer_key %}
      diff --git a/src/Wallabag/ImportBundle/Resources/views/Readability/index.html.twig b/src/Wallabag/ImportBundle/Resources/views/Readability/index.html.twig index 74653b0f..737b0adf 100644 --- a/src/Wallabag/ImportBundle/Resources/views/Readability/index.html.twig +++ b/src/Wallabag/ImportBundle/Resources/views/Readability/index.html.twig @@ -6,7 +6,7 @@
      - {% include 'WallabagImportBundle:Import:_workerEnabled.html.twig' %} + {% include 'WallabagImportBundle:Import:_information.html.twig' %}
      {{ import.description|trans }}
      diff --git a/src/Wallabag/ImportBundle/Resources/views/WallabagV1/index.html.twig b/src/Wallabag/ImportBundle/Resources/views/WallabagV1/index.html.twig index 0b19bc34..974b2c73 100644 --- a/src/Wallabag/ImportBundle/Resources/views/WallabagV1/index.html.twig +++ b/src/Wallabag/ImportBundle/Resources/views/WallabagV1/index.html.twig @@ -6,7 +6,7 @@
      - {% include 'WallabagImportBundle:Import:_workerEnabled.html.twig' %} + {% include 'WallabagImportBundle:Import:_information.html.twig' %}
      {{ import.description|trans }}
      diff --git a/src/Wallabag/UserBundle/Entity/User.php b/src/Wallabag/UserBundle/Entity/User.php index d98ae76a..3a167de7 100644 --- a/src/Wallabag/UserBundle/Entity/User.php +++ b/src/Wallabag/UserBundle/Entity/User.php @@ -11,6 +11,7 @@ use JMS\Serializer\Annotation\ExclusionPolicy; use JMS\Serializer\Annotation\Expose; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\Security\Core\User\UserInterface; +use Wallabag\ApiBundle\Entity\Client; use Wallabag\CoreBundle\Entity\Config; use Wallabag\CoreBundle\Entity\Entry; @@ -84,6 +85,11 @@ class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterf */ private $trusted; + /** + * @ORM\OneToMany(targetEntity="Wallabag\ApiBundle\Entity\Client", mappedBy="user", cascade={"remove"}) + */ + protected $clients; + public function __construct() { parent::__construct(); @@ -240,4 +246,24 @@ class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterf return false; } + + /** + * @param Client $client + * + * @return User + */ + public function addClient(Client $client) + { + $this->clients[] = $client; + + return $this; + } + + /** + * @return ArrayCollection + */ + public function getClients() + { + return $this->clients; + } } diff --git a/src/Wallabag/UserBundle/Repository/UserRepository.php b/src/Wallabag/UserBundle/Repository/UserRepository.php index 009c4881..445edb3c 100644 --- a/src/Wallabag/UserBundle/Repository/UserRepository.php +++ b/src/Wallabag/UserBundle/Repository/UserRepository.php @@ -38,4 +38,18 @@ class UserRepository extends EntityRepository ->getQuery() ->getSingleResult(); } + + /** + * Count how many users are enabled. + * + * @return int + */ + public function getSumEnabledUsers() + { + return $this->createQueryBuilder('u') + ->select('count(u)') + ->andWhere('u.expired = false') + ->getQuery() + ->getSingleScalarResult(); + } } diff --git a/src/Wallabag/UserBundle/Resources/config/services.yml b/src/Wallabag/UserBundle/Resources/config/services.yml index a8ee721b..164a25ec 100644 --- a/src/Wallabag/UserBundle/Resources/config/services.yml +++ b/src/Wallabag/UserBundle/Resources/config/services.yml @@ -22,7 +22,7 @@ services: arguments: - WallabagUserBundle:User - wallabag_user.create_config: + wallabag_user.listener.create_config: class: Wallabag\UserBundle\EventListener\CreateConfigListener arguments: - "@doctrine.orm.entity_manager" diff --git a/tests/Wallabag/AnnotationBundle/Controller/AnnotationControllerTest.php b/tests/Wallabag/AnnotationBundle/Controller/AnnotationControllerTest.php index 70849f74..81f9e9ec 100644 --- a/tests/Wallabag/AnnotationBundle/Controller/AnnotationControllerTest.php +++ b/tests/Wallabag/AnnotationBundle/Controller/AnnotationControllerTest.php @@ -3,35 +3,80 @@ namespace Tests\AnnotationBundle\Controller; use Tests\Wallabag\AnnotationBundle\WallabagAnnotationTestCase; +use Wallabag\AnnotationBundle\Entity\Annotation; +use Wallabag\CoreBundle\Entity\Entry; class AnnotationControllerTest extends WallabagAnnotationTestCase { - public function testGetAnnotations() + /** + * This data provider allow to tests annotation from the : + * - API POV (when user use the api to manage annotations) + * - and User POV (when user use the web interface - using javascript - to manage annotations). + */ + public function dataForEachAnnotations() { - $annotation = $this->client->getContainer() - ->get('doctrine.orm.entity_manager') - ->getRepository('WallabagAnnotationBundle:Annotation') - ->findOneByUsername('admin'); + return [ + ['/api/annotations'], + ['annotations'], + ]; + } + + /** + * Test fetching annotations for an entry. + * + * @dataProvider dataForEachAnnotations + */ + public function testGetAnnotations($prefixUrl) + { + $em = $this->client->getContainer()->get('doctrine.orm.entity_manager'); + + $user = $em + ->getRepository('WallabagUserBundle:User') + ->findOneByUserName('admin'); + $entry = $em + ->getRepository('WallabagCoreBundle:Entry') + ->findOneByUsernameAndNotArchived('admin'); - if (!$annotation) { - $this->markTestSkipped('No content found in db.'); + $annotation = new Annotation($user); + $annotation->setEntry($entry); + $annotation->setText('This is my annotation /o/'); + $annotation->setQuote('content'); + + $em->persist($annotation); + $em->flush(); + + if ('annotations' === $prefixUrl) { + $this->logInAs('admin'); } - $this->logInAs('admin'); - $crawler = $this->client->request('GET', 'annotations/'.$annotation->getEntry()->getId().'.json'); + $this->client->request('GET', $prefixUrl.'/'.$entry->getId().'.json'); $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); $content = json_decode($this->client->getResponse()->getContent(), true); - $this->assertEquals(1, $content['total']); + $this->assertGreaterThanOrEqual(1, $content['total']); $this->assertEquals($annotation->getText(), $content['rows'][0]['text']); + + // we need to re-fetch the annotation becase after the flush, it has been "detached" from the entity manager + $annotation = $em->getRepository('WallabagAnnotationBundle:Annotation')->findAnnotationById($annotation->getId()); + $em->remove($annotation); + $em->flush(); } - public function testSetAnnotation() + /** + * Test creating an annotation for an entry. + * + * @dataProvider dataForEachAnnotations + */ + public function testSetAnnotation($prefixUrl) { - $this->logInAs('admin'); + $em = $this->client->getContainer()->get('doctrine.orm.entity_manager'); - $entry = $this->client->getContainer() - ->get('doctrine.orm.entity_manager') + if ('annotations' === $prefixUrl) { + $this->logInAs('admin'); + } + + /** @var Entry $entry */ + $entry = $em ->getRepository('WallabagCoreBundle:Entry') ->findOneByUsernameAndNotArchived('admin'); @@ -41,7 +86,7 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase 'quote' => 'my quote', 'ranges' => ['start' => '', 'startOffset' => 24, 'end' => '', 'endOffset' => 31], ]); - $crawler = $this->client->request('POST', 'annotations/'.$entry->getId().'.json', [], [], $headers, $content); + $this->client->request('POST', $prefixUrl.'/'.$entry->getId().'.json', [], [], $headers, $content); $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); @@ -52,6 +97,7 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase $this->assertEquals('my annotation', $content['text']); $this->assertEquals('my quote', $content['quote']); + /** @var Annotation $annotation */ $annotation = $this->client->getContainer() ->get('doctrine.orm.entity_manager') ->getRepository('WallabagAnnotationBundle:Annotation') @@ -60,20 +106,35 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase $this->assertEquals('my annotation', $annotation->getText()); } - public function testEditAnnotation() + /** + * Test editing an existing annotation. + * + * @dataProvider dataForEachAnnotations + */ + public function testEditAnnotation($prefixUrl) { - $annotation = $this->client->getContainer() - ->get('doctrine.orm.entity_manager') - ->getRepository('WallabagAnnotationBundle:Annotation') - ->findOneByUsername('admin'); + $em = $this->client->getContainer()->get('doctrine.orm.entity_manager'); - $this->logInAs('admin'); + $user = $em + ->getRepository('WallabagUserBundle:User') + ->findOneByUserName('admin'); + $entry = $em + ->getRepository('WallabagCoreBundle:Entry') + ->findOneByUsernameAndNotArchived('admin'); + + $annotation = new Annotation($user); + $annotation->setEntry($entry); + $annotation->setText('This is my annotation /o/'); + $annotation->setQuote('my quote'); + + $em->persist($annotation); + $em->flush(); $headers = ['CONTENT_TYPE' => 'application/json']; $content = json_encode([ 'text' => 'a modified annotation', ]); - $crawler = $this->client->request('PUT', 'annotations/'.$annotation->getId().'.json', [], [], $headers, $content); + $this->client->request('PUT', $prefixUrl.'/'.$annotation->getId().'.json', [], [], $headers, $content); $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); $content = json_decode($this->client->getResponse()->getContent(), true); @@ -83,35 +144,56 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase $this->assertEquals('a modified annotation', $content['text']); $this->assertEquals('my quote', $content['quote']); - $annotationUpdated = $this->client->getContainer() - ->get('doctrine.orm.entity_manager') + /** @var Annotation $annotationUpdated */ + $annotationUpdated = $em ->getRepository('WallabagAnnotationBundle:Annotation') ->findOneById($annotation->getId()); $this->assertEquals('a modified annotation', $annotationUpdated->getText()); + + $em->remove($annotationUpdated); + $em->flush(); } - public function testDeleteAnnotation() + /** + * Test deleting an annotation. + * + * @dataProvider dataForEachAnnotations + */ + public function testDeleteAnnotation($prefixUrl) { - $annotation = $this->client->getContainer() - ->get('doctrine.orm.entity_manager') - ->getRepository('WallabagAnnotationBundle:Annotation') - ->findOneByUsername('admin'); + $em = $this->client->getContainer()->get('doctrine.orm.entity_manager'); - $this->logInAs('admin'); + $user = $em + ->getRepository('WallabagUserBundle:User') + ->findOneByUserName('admin'); + $entry = $em + ->getRepository('WallabagCoreBundle:Entry') + ->findOneByUsernameAndNotArchived('admin'); + + $annotation = new Annotation($user); + $annotation->setEntry($entry); + $annotation->setText('This is my annotation /o/'); + $annotation->setQuote('my quote'); + + $em->persist($annotation); + $em->flush(); + + if ('annotations' === $prefixUrl) { + $this->logInAs('admin'); + } $headers = ['CONTENT_TYPE' => 'application/json']; $content = json_encode([ 'text' => 'a modified annotation', ]); - $crawler = $this->client->request('DELETE', 'annotations/'.$annotation->getId().'.json', [], [], $headers, $content); + $this->client->request('DELETE', $prefixUrl.'/'.$annotation->getId().'.json', [], [], $headers, $content); $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); $content = json_decode($this->client->getResponse()->getContent(), true); - $this->assertEquals('a modified annotation', $content['text']); + $this->assertEquals('This is my annotation /o/', $content['text']); - $annotationDeleted = $this->client->getContainer() - ->get('doctrine.orm.entity_manager') + $annotationDeleted = $em ->getRepository('WallabagAnnotationBundle:Annotation') ->findOneById($annotation->getId()); diff --git a/tests/Wallabag/AnnotationBundle/WallabagAnnotationTestCase.php b/tests/Wallabag/AnnotationBundle/WallabagAnnotationTestCase.php index 82790a5c..ef3f1324 100644 --- a/tests/Wallabag/AnnotationBundle/WallabagAnnotationTestCase.php +++ b/tests/Wallabag/AnnotationBundle/WallabagAnnotationTestCase.php @@ -8,7 +8,7 @@ use Symfony\Component\BrowserKit\Cookie; abstract class WallabagAnnotationTestCase extends WebTestCase { /** - * @var Client + * @var \Symfony\Bundle\FrameworkBundle\Client */ protected $client = null; @@ -35,7 +35,7 @@ abstract class WallabagAnnotationTestCase extends WebTestCase } /** - * @return Client + * @return \Symfony\Bundle\FrameworkBundle\Client */ protected function createAuthorizedClient() { @@ -49,7 +49,7 @@ abstract class WallabagAnnotationTestCase extends WebTestCase $firewallName = $container->getParameter('fos_user.firewall_name'); $this->user = $userManager->findUserBy(['username' => 'admin']); - $loginManager->loginUser($firewallName, $this->user); + $loginManager->logInUser($firewallName, $this->user); // save the login token into the session and put it in a cookie $container->get('session')->set('_security_'.$firewallName, serialize($container->get('security.token_storage')->getToken())); diff --git a/tests/Wallabag/ApiBundle/Controller/DeveloperControllerTest.php b/tests/Wallabag/ApiBundle/Controller/DeveloperControllerTest.php index 95befa9c..6659443b 100644 --- a/tests/Wallabag/ApiBundle/Controller/DeveloperControllerTest.php +++ b/tests/Wallabag/ApiBundle/Controller/DeveloperControllerTest.php @@ -82,11 +82,24 @@ class DeveloperControllerTest extends WallabagCoreTestCase public function testRemoveClient() { - $this->logInAs('admin'); $client = $this->getClient(); $em = $client->getContainer()->get('doctrine.orm.entity_manager'); - $nbClients = $em->getRepository('WallabagApiBundle:Client')->findAll(); + // Try to remove an admin's client with a wrong user + $this->logInAs('bob'); + $client->request('GET', '/developer'); + $this->assertContains('no_client', $client->getResponse()->getContent()); + + // get an ID of a admin's client + $this->logInAs('admin'); + $nbClients = $em->getRepository('WallabagApiBundle:Client')->findByUser($this->getLoggedInUserId()); + + $this->logInAs('bob'); + $client->request('GET', '/developer/client/delete/'.$nbClients[0]->getId()); + $this->assertEquals(403, $client->getResponse()->getStatusCode()); + + // Try to remove the admin's client with the good user + $this->logInAs('admin'); $crawler = $client->request('GET', '/developer'); $link = $crawler @@ -98,7 +111,7 @@ class DeveloperControllerTest extends WallabagCoreTestCase $client->click($link); $this->assertEquals(302, $client->getResponse()->getStatusCode()); - $newNbClients = $em->getRepository('WallabagApiBundle:Client')->findAll(); + $newNbClients = $em->getRepository('WallabagApiBundle:Client')->findByUser($this->getLoggedInUserId()); $this->assertGreaterThan(count($newNbClients), count($nbClients)); } } diff --git a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php index 825f8f7a..566e9493 100644 --- a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php +++ b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php @@ -30,12 +30,55 @@ class EntryRestControllerTest extends WallabagApiTestCase $this->assertEquals($entry->getUserEmail(), $content['user_email']); $this->assertEquals($entry->getUserId(), $content['user_id']); - $this->assertTrue( - $this->client->getResponse()->headers->contains( - 'Content-Type', - 'application/json' - ) - ); + $this->assertEquals('application/json', $this->client->getResponse()->headers->get('Content-Type')); + } + + public function testExportEntry() + { + $entry = $this->client->getContainer() + ->get('doctrine.orm.entity_manager') + ->getRepository('WallabagCoreBundle:Entry') + ->findOneBy(['user' => 1, 'isArchived' => false]); + + if (!$entry) { + $this->markTestSkipped('No content found in db.'); + } + + $this->client->request('GET', '/api/entries/'.$entry->getId().'/export.epub'); + $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); + + // epub format got the content type in the content + $this->assertContains('application/epub', $this->client->getResponse()->getContent()); + $this->assertEquals('application/epub+zip', $this->client->getResponse()->headers->get('Content-Type')); + + // re-auth client for mobi + $client = $this->createAuthorizedClient(); + $client->request('GET', '/api/entries/'.$entry->getId().'/export.mobi'); + $this->assertEquals(200, $client->getResponse()->getStatusCode()); + + $this->assertEquals('application/x-mobipocket-ebook', $client->getResponse()->headers->get('Content-Type')); + + // re-auth client for pdf + $client = $this->createAuthorizedClient(); + $client->request('GET', '/api/entries/'.$entry->getId().'/export.pdf'); + $this->assertEquals(200, $client->getResponse()->getStatusCode()); + + $this->assertContains('PDF-', $client->getResponse()->getContent()); + $this->assertEquals('application/pdf', $client->getResponse()->headers->get('Content-Type')); + + // re-auth client for pdf + $client = $this->createAuthorizedClient(); + $client->request('GET', '/api/entries/'.$entry->getId().'/export.txt'); + $this->assertEquals(200, $client->getResponse()->getStatusCode()); + + $this->assertContains('text/plain', $client->getResponse()->headers->get('Content-Type')); + + // re-auth client for pdf + $client = $this->createAuthorizedClient(); + $client->request('GET', '/api/entries/'.$entry->getId().'/export.csv'); + $this->assertEquals(200, $client->getResponse()->getStatusCode()); + + $this->assertContains('application/csv', $client->getResponse()->headers->get('Content-Type')); } public function testGetOneEntryWrongUser() @@ -68,12 +111,7 @@ class EntryRestControllerTest extends WallabagApiTestCase $this->assertEquals(1, $content['page']); $this->assertGreaterThanOrEqual(1, $content['pages']); - $this->assertTrue( - $this->client->getResponse()->headers->contains( - 'Content-Type', - 'application/json' - ) - ); + $this->assertEquals('application/json', $this->client->getResponse()->headers->get('Content-Type')); } public function testGetEntriesWithFullOptions() @@ -115,12 +153,7 @@ class EntryRestControllerTest extends WallabagApiTestCase $this->assertContains('since=1443274283', $content['_links'][$link]['href']); } - $this->assertTrue( - $this->client->getResponse()->headers->contains( - 'Content-Type', - 'application/json' - ) - ); + $this->assertEquals('application/json', $this->client->getResponse()->headers->get('Content-Type')); } public function testGetStarredEntries() @@ -148,12 +181,7 @@ class EntryRestControllerTest extends WallabagApiTestCase $this->assertContains('sort=updated', $content['_links'][$link]['href']); } - $this->assertTrue( - $this->client->getResponse()->headers->contains( - 'Content-Type', - 'application/json' - ) - ); + $this->assertEquals('application/json', $this->client->getResponse()->headers->get('Content-Type')); } public function testGetArchiveEntries() @@ -180,12 +208,7 @@ class EntryRestControllerTest extends WallabagApiTestCase $this->assertContains('archive=1', $content['_links'][$link]['href']); } - $this->assertTrue( - $this->client->getResponse()->headers->contains( - 'Content-Type', - 'application/json' - ) - ); + $this->assertEquals('application/json', $this->client->getResponse()->headers->get('Content-Type')); } public function testGetTaggedEntries() @@ -212,12 +235,7 @@ class EntryRestControllerTest extends WallabagApiTestCase $this->assertContains('tags='.urlencode('foo,bar'), $content['_links'][$link]['href']); } - $this->assertTrue( - $this->client->getResponse()->headers->contains( - 'Content-Type', - 'application/json' - ) - ); + $this->assertEquals('application/json', $this->client->getResponse()->headers->get('Content-Type')); } public function testGetDatedEntries() @@ -244,12 +262,7 @@ class EntryRestControllerTest extends WallabagApiTestCase $this->assertContains('since=1443274283', $content['_links'][$link]['href']); } - $this->assertTrue( - $this->client->getResponse()->headers->contains( - 'Content-Type', - 'application/json' - ) - ); + $this->assertEquals('application/json', $this->client->getResponse()->headers->get('Content-Type')); } public function testGetDatedSupEntries() @@ -277,12 +290,7 @@ class EntryRestControllerTest extends WallabagApiTestCase $this->assertContains('since='.($future->getTimestamp() + 1000), $content['_links'][$link]['href']); } - $this->assertTrue( - $this->client->getResponse()->headers->contains( - 'Content-Type', - 'application/json' - ) - ); + $this->assertEquals('application/json', $this->client->getResponse()->headers->get('Content-Type')); } public function testDeleteEntry() diff --git a/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php b/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php index d4fbe2d4..9bbc5960 100644 --- a/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php @@ -3,6 +3,11 @@ namespace Tests\Wallabag\CoreBundle\Controller; use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; +use Wallabag\CoreBundle\Entity\Config; +use Wallabag\UserBundle\Entity\User; +use Wallabag\CoreBundle\Entity\Entry; +use Wallabag\CoreBundle\Entity\Tag; +use Wallabag\AnnotationBundle\Entity\Annotation; class ConfigControllerTest extends WallabagCoreTestCase { @@ -46,6 +51,7 @@ class ConfigControllerTest extends WallabagCoreTestCase 'config[theme]' => 'baggy', 'config[items_per_page]' => '30', 'config[reading_speed]' => '0.5', + 'config[action_mark_as_read]' => '0', 'config[language]' => 'en', ]; @@ -407,7 +413,7 @@ class ConfigControllerTest extends WallabagCoreTestCase $crawler = $client->request('GET', '/config'); - $this->assertTrue($client->getResponse()->isSuccessful()); + $this->assertEquals(200, $client->getResponse()->getStatusCode()); $form = $crawler->filter('button[id=tagging_rule_save]')->form(); @@ -494,7 +500,7 @@ class ConfigControllerTest extends WallabagCoreTestCase $crawler = $client->request('GET', '/config'); - $this->assertTrue($client->getResponse()->isSuccessful()); + $this->assertEquals(200, $client->getResponse()->getStatusCode()); $form = $crawler->filter('button[id=tagging_rule_save]')->form(); @@ -570,4 +576,264 @@ class ConfigControllerTest extends WallabagCoreTestCase $config->set('demo_mode_enabled', 0); $config->set('demo_mode_username', 'wallabag'); } + + public function testDeleteUserButtonVisibility() + { + $this->logInAs('admin'); + $client = $this->getClient(); + + $crawler = $client->request('GET', '/config'); + + $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); + $this->assertContains('config.form_user.delete.button', $body[0]); + + $em = $client->getContainer()->get('doctrine.orm.entity_manager'); + + $user = $em + ->getRepository('WallabagUserBundle:User') + ->findOneByUsername('empty'); + $user->setExpired(1); + $em->persist($user); + + $user = $em + ->getRepository('WallabagUserBundle:User') + ->findOneByUsername('bob'); + $user->setExpired(1); + $em->persist($user); + + $em->flush(); + + $crawler = $client->request('GET', '/config'); + + $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); + $this->assertNotContains('config.form_user.delete.button', $body[0]); + + $client->request('GET', '/account/delete'); + $this->assertEquals(403, $client->getResponse()->getStatusCode()); + + $user = $em + ->getRepository('WallabagUserBundle:User') + ->findOneByUsername('empty'); + $user->setExpired(0); + $em->persist($user); + + $user = $em + ->getRepository('WallabagUserBundle:User') + ->findOneByUsername('bob'); + $user->setExpired(0); + $em->persist($user); + + $em->flush(); + } + + public function testDeleteAccount() + { + $client = $this->getClient(); + $em = $client->getContainer()->get('doctrine.orm.entity_manager'); + + $user = new User(); + $user->setName('Wallace'); + $user->setEmail('wallace@wallabag.org'); + $user->setUsername('wallace'); + $user->setPlainPassword('wallace'); + $user->setEnabled(true); + $user->addRole('ROLE_SUPER_ADMIN'); + + $em->persist($user); + + $config = new Config($user); + + $config->setTheme('material'); + $config->setItemsPerPage(30); + $config->setReadingSpeed(1); + $config->setLanguage('en'); + $config->setPocketConsumerKey('xxxxx'); + + $em->persist($config); + $em->flush(); + + $this->logInAs('wallace'); + $loggedInUserId = $this->getLoggedInUserId(); + + // create entry to check after user deletion + // that this entry is also deleted + $crawler = $client->request('GET', '/new'); + + $this->assertEquals(200, $client->getResponse()->getStatusCode()); + + $form = $crawler->filter('form[name=entry]')->form(); + $data = [ + 'entry[url]' => $url = 'https://github.com/wallabag/wallabag', + ]; + + $client->submit($form, $data); + $this->assertEquals(302, $client->getResponse()->getStatusCode()); + + $crawler = $client->request('GET', '/config'); + + $deleteLink = $crawler->filter('.delete-account')->last()->link(); + + $client->click($deleteLink); + $this->assertEquals(302, $client->getResponse()->getStatusCode()); + + $em = $client->getContainer()->get('doctrine.orm.entity_manager'); + $user = $em + ->getRepository('WallabagUserBundle:User') + ->createQueryBuilder('u') + ->where('u.username = :username')->setParameter('username', 'wallace') + ->getQuery() + ->getOneOrNullResult() + ; + + $this->assertNull($user); + + $entries = $client->getContainer() + ->get('doctrine.orm.entity_manager') + ->getRepository('WallabagCoreBundle:Entry') + ->findByUser($loggedInUserId); + + $this->assertEmpty($entries); + } + + public function testReset() + { + $this->logInAs('empty'); + $client = $this->getClient(); + + $em = $client->getContainer()->get('doctrine.orm.entity_manager'); + + $user = static::$kernel->getContainer()->get('security.token_storage')->getToken()->getUser(); + + $tag = new Tag(); + $tag->setLabel('super'); + $em->persist($tag); + + $entry = new Entry($user); + $entry->setUrl('http://www.lemonde.fr/europe/article/2016/10/01/pour-le-psoe-chaque-election-s-est-transformee-en-une-agonie_5006476_3214.html'); + $entry->setContent('Youhou'); + $entry->setTitle('Youhou'); + $entry->addTag($tag); + $em->persist($entry); + + $entry2 = new Entry($user); + $entry2->setUrl('http://www.lemonde.de/europe/article/2016/10/01/pour-le-psoe-chaque-election-s-est-transformee-en-une-agonie_5006476_3214.html'); + $entry2->setContent('Youhou'); + $entry2->setTitle('Youhou'); + $entry2->addTag($tag); + $em->persist($entry2); + + $annotation = new Annotation($user); + $annotation->setText('annotated'); + $annotation->setQuote('annotated'); + $annotation->setRanges([]); + $annotation->setEntry($entry); + $em->persist($annotation); + + $em->flush(); + + // reset annotations + $crawler = $client->request('GET', '/config#set3'); + + $this->assertEquals(200, $client->getResponse()->getStatusCode()); + + $crawler = $client->click($crawler->selectLink('config.reset.annotations')->link()); + + $this->assertEquals(302, $client->getResponse()->getStatusCode()); + $this->assertContains('flashes.config.notice.annotations_reset', $client->getContainer()->get('session')->getFlashBag()->get('notice')[0]); + + $annotationsReset = $em + ->getRepository('WallabagAnnotationBundle:Annotation') + ->findAnnotationsByPageId($entry->getId(), $user->getId()); + + $this->assertEmpty($annotationsReset, 'Annotations were reset'); + + // reset tags + $crawler = $client->request('GET', '/config#set3'); + + $this->assertEquals(200, $client->getResponse()->getStatusCode()); + + $crawler = $client->click($crawler->selectLink('config.reset.tags')->link()); + + $this->assertEquals(302, $client->getResponse()->getStatusCode()); + $this->assertContains('flashes.config.notice.tags_reset', $client->getContainer()->get('session')->getFlashBag()->get('notice')[0]); + + $tagReset = $em + ->getRepository('WallabagCoreBundle:Tag') + ->countAllTags($user->getId()); + + $this->assertEquals(0, $tagReset, 'Tags were reset'); + + // reset entries + $crawler = $client->request('GET', '/config#set3'); + + $this->assertEquals(200, $client->getResponse()->getStatusCode()); + + $crawler = $client->click($crawler->selectLink('config.reset.entries')->link()); + + $this->assertEquals(302, $client->getResponse()->getStatusCode()); + $this->assertContains('flashes.config.notice.entries_reset', $client->getContainer()->get('session')->getFlashBag()->get('notice')[0]); + + $entryReset = $em + ->getRepository('WallabagCoreBundle:Entry') + ->countAllEntriesByUsername($user->getId()); + + $this->assertEquals(0, $entryReset, 'Entries were reset'); + } + + public function testResetEntriesCascade() + { + $this->logInAs('empty'); + $client = $this->getClient(); + + $em = $client->getContainer()->get('doctrine.orm.entity_manager'); + + $user = static::$kernel->getContainer()->get('security.token_storage')->getToken()->getUser(); + + $tag = new Tag(); + $tag->setLabel('super'); + $em->persist($tag); + + $entry = new Entry($user); + $entry->setUrl('http://www.lemonde.fr/europe/article/2016/10/01/pour-le-psoe-chaque-election-s-est-transformee-en-une-agonie_5006476_3214.html'); + $entry->setContent('Youhou'); + $entry->setTitle('Youhou'); + $entry->addTag($tag); + $em->persist($entry); + + $annotation = new Annotation($user); + $annotation->setText('annotated'); + $annotation->setQuote('annotated'); + $annotation->setRanges([]); + $annotation->setEntry($entry); + $em->persist($annotation); + + $em->flush(); + + $crawler = $client->request('GET', '/config#set3'); + + $this->assertEquals(200, $client->getResponse()->getStatusCode()); + + $crawler = $client->click($crawler->selectLink('config.reset.entries')->link()); + + $this->assertEquals(302, $client->getResponse()->getStatusCode()); + $this->assertContains('flashes.config.notice.entries_reset', $client->getContainer()->get('session')->getFlashBag()->get('notice')[0]); + + $entryReset = $em + ->getRepository('WallabagCoreBundle:Entry') + ->countAllEntriesByUsername($user->getId()); + + $this->assertEquals(0, $entryReset, 'Entries were reset'); + + $tagReset = $em + ->getRepository('WallabagCoreBundle:Tag') + ->countAllTags($user->getId()); + + $this->assertEquals(0, $tagReset, 'Tags were reset'); + + $annotationsReset = $em + ->getRepository('WallabagAnnotationBundle:Annotation') + ->findAnnotationsByPageId($entry->getId(), $user->getId()); + + $this->assertEmpty($annotationsReset, 'Annotations were reset'); + } } diff --git a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php index 05113650..09cf01b8 100644 --- a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php @@ -3,6 +3,7 @@ namespace Tests\Wallabag\CoreBundle\Controller; use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; +use Wallabag\CoreBundle\Entity\Config; use Wallabag\CoreBundle\Entity\Entry; class EntryControllerTest extends WallabagCoreTestCase @@ -836,4 +837,185 @@ class EntryControllerTest extends WallabagCoreTestCase $client->request('GET', '/share/'.$content->getUuid()); $this->assertEquals(404, $client->getResponse()->getStatusCode()); } + + public function testNewEntryWithDownloadImagesEnabled() + { + $this->logInAs('admin'); + $client = $this->getClient(); + + $url = 'http://www.20minutes.fr/montpellier/1952003-20161030-video-car-tombe-panne-rugbymen-perpignan-improvisent-melee-route'; + $client->getContainer()->get('craue_config')->set('download_images_enabled', 1); + + $crawler = $client->request('GET', '/new'); + + $this->assertEquals(200, $client->getResponse()->getStatusCode()); + + $form = $crawler->filter('form[name=entry]')->form(); + + $data = [ + 'entry[url]' => $url, + ]; + + $client->submit($form, $data); + + $this->assertEquals(302, $client->getResponse()->getStatusCode()); + + $em = $client->getContainer() + ->get('doctrine.orm.entity_manager'); + + $entry = $em + ->getRepository('WallabagCoreBundle:Entry') + ->findByUrlAndUserId($url, $this->getLoggedInUserId()); + + $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $entry); + $this->assertEquals($url, $entry->getUrl()); + $this->assertContains('Perpignan', $entry->getTitle()); + $this->assertContains('/d9bc0fcd.jpeg', $entry->getContent()); + + $client->getContainer()->get('craue_config')->set('download_images_enabled', 0); + } + + /** + * @depends testNewEntryWithDownloadImagesEnabled + */ + public function testRemoveEntryWithDownloadImagesEnabled() + { + $this->logInAs('admin'); + $client = $this->getClient(); + + $url = 'http://www.20minutes.fr/montpellier/1952003-20161030-video-car-tombe-panne-rugbymen-perpignan-improvisent-melee-route'; + $client->getContainer()->get('craue_config')->set('download_images_enabled', 1); + + $content = $client->getContainer() + ->get('doctrine.orm.entity_manager') + ->getRepository('WallabagCoreBundle:Entry') + ->findByUrlAndUserId($url, $this->getLoggedInUserId()); + + $client->request('GET', '/delete/'.$content->getId()); + + $this->assertEquals(302, $client->getResponse()->getStatusCode()); + + $client->getContainer()->get('craue_config')->set('download_images_enabled', 0); + } + + public function testRedirectToHomepage() + { + $this->logInAs('empty'); + $client = $this->getClient(); + + $em = $client->getContainer()->get('doctrine.orm.entity_manager'); + $user = $em + ->getRepository('WallabagUserBundle:User') + ->find($this->getLoggedInUserId()); + + if (!$user) { + $this->markTestSkipped('No user found in db.'); + } + + // Redirect to homepage + $config = $user->getConfig(); + $config->setActionMarkAsRead(Config::REDIRECT_TO_HOMEPAGE); + $em->persist($config); + $em->flush(); + + $content = $client->getContainer() + ->get('doctrine.orm.entity_manager') + ->getRepository('WallabagCoreBundle:Entry') + ->findByUrlAndUserId($this->url, $this->getLoggedInUserId()); + + $client->request('GET', '/view/'.$content->getId()); + $client->request('GET', '/archive/'.$content->getId()); + + $this->assertEquals(302, $client->getResponse()->getStatusCode()); + $this->assertEquals('/', $client->getResponse()->headers->get('location')); + } + + public function testRedirectToCurrentPage() + { + $this->logInAs('empty'); + $client = $this->getClient(); + + $em = $client->getContainer()->get('doctrine.orm.entity_manager'); + $user = $em + ->getRepository('WallabagUserBundle:User') + ->find($this->getLoggedInUserId()); + + if (!$user) { + $this->markTestSkipped('No user found in db.'); + } + + // Redirect to current page + $config = $user->getConfig(); + $config->setActionMarkAsRead(Config::REDIRECT_TO_CURRENT_PAGE); + $em->persist($config); + $em->flush(); + + $content = $client->getContainer() + ->get('doctrine.orm.entity_manager') + ->getRepository('WallabagCoreBundle:Entry') + ->findByUrlAndUserId($this->url, $this->getLoggedInUserId()); + + $client->request('GET', '/view/'.$content->getId()); + $client->request('GET', '/archive/'.$content->getId()); + + $this->assertEquals(302, $client->getResponse()->getStatusCode()); + $this->assertContains('/view/'.$content->getId(), $client->getResponse()->headers->get('location')); + } + + public function testFilterOnHttpStatus() + { + $this->logInAs('admin'); + $client = $this->getClient(); + + $crawler = $client->request('GET', '/new'); + $form = $crawler->filter('form[name=entry]')->form(); + + $data = [ + 'entry[url]' => 'http://www.lemonde.fr/incorrect-url/', + ]; + + $client->submit($form, $data); + + $crawler = $client->request('GET', '/all/list'); + $form = $crawler->filter('button[id=submit-filter]')->form(); + + $data = [ + 'entry_filter[httpStatus]' => 404, + ]; + + $crawler = $client->submit($form, $data); + + $this->assertCount(1, $crawler->filter('div[class=entry]')); + + $crawler = $client->request('GET', '/new'); + $form = $crawler->filter('form[name=entry]')->form(); + + $data = [ + 'entry[url]' => 'http://www.nextinpact.com/news/101235-wallabag-alternative-libre-a-pocket-creuse-petit-a-petit-son-nid.htm', + ]; + + $client->submit($form, $data); + + $crawler = $client->request('GET', '/all/list'); + $form = $crawler->filter('button[id=submit-filter]')->form(); + + $data = [ + 'entry_filter[httpStatus]' => 200, + ]; + + $crawler = $client->submit($form, $data); + + $this->assertCount(1, $crawler->filter('div[class=entry]')); + + $crawler = $client->request('GET', '/all/list'); + $form = $crawler->filter('button[id=submit-filter]')->form(); + + $data = [ + 'entry_filter[httpStatus]' => 1024, + ]; + + $crawler = $client->submit($form, $data); + + $this->assertCount(7, $crawler->filter('div[class=entry]')); + } } diff --git a/tests/Wallabag/CoreBundle/EventListener/LocaleListenerTest.php b/tests/Wallabag/CoreBundle/Event/Listener/LocaleListenerTest.php similarity index 96% rename from tests/Wallabag/CoreBundle/EventListener/LocaleListenerTest.php rename to tests/Wallabag/CoreBundle/Event/Listener/LocaleListenerTest.php index 078bb69a..84a54d3a 100644 --- a/tests/Wallabag/CoreBundle/EventListener/LocaleListenerTest.php +++ b/tests/Wallabag/CoreBundle/Event/Listener/LocaleListenerTest.php @@ -1,6 +1,6 @@ '', 'content_type' => '', 'language' => '', + 'status' => '', 'open_graph' => [ 'og_title' => 'my title', 'og_description' => 'desc', @@ -111,6 +112,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase $this->assertEquals('

      Unable to retrieve readable content.

      But we found a short description:

      desc', $entry->getContent()); $this->assertEmpty($entry->getPreviewPicture()); $this->assertEmpty($entry->getLanguage()); + $this->assertEmpty($entry->getHttpStatus()); $this->assertEmpty($entry->getMimetype()); $this->assertEquals(0.0, $entry->getReadingTime()); $this->assertEquals('domain.io', $entry->getDomainName()); @@ -135,6 +137,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase 'url' => 'http://1.1.1.1', 'content_type' => 'text/html', 'language' => 'fr', + 'status' => '200', 'open_graph' => [ 'og_title' => 'my OG title', 'og_description' => 'OG desc', @@ -151,6 +154,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase $this->assertEquals('http://3.3.3.3/cover.jpg', $entry->getPreviewPicture()); $this->assertEquals('text/html', $entry->getMimetype()); $this->assertEquals('fr', $entry->getLanguage()); + $this->assertEquals('200', $entry->getHttpStatus()); $this->assertEquals(4.0, $entry->getReadingTime()); $this->assertEquals('1.1.1.1', $entry->getDomainName()); } diff --git a/tests/Wallabag/CoreBundle/Helper/DownloadImagesTest.php b/tests/Wallabag/CoreBundle/Helper/DownloadImagesTest.php new file mode 100644 index 00000000..85f12d87 --- /dev/null +++ b/tests/Wallabag/CoreBundle/Helper/DownloadImagesTest.php @@ -0,0 +1,142 @@ + 'image/png'], Stream::factory(file_get_contents(__DIR__.'/../fixtures/unnamed.png'))), + ]); + + $client->getEmitter()->attach($mock); + + $logHandler = new TestHandler(); + $logger = new Logger('test', array($logHandler)); + + $download = new DownloadImages($client, sys_get_temp_dir().'/wallabag_test', 'http://wallabag.io/', $logger); + + $res = $download->processHtml(123, '
      ', 'http://imgur.com/gallery/WxtWY'); + + $this->assertContains('http://wallabag.io/assets/images/9/b/9b0ead26/c638b4c2.png', $res); + } + + public function testProcessHtmlWithBadImage() + { + $client = new Client(); + + $mock = new Mock([ + new Response(200, ['content-type' => 'application/json'], Stream::factory('')), + ]); + + $client->getEmitter()->attach($mock); + + $logHandler = new TestHandler(); + $logger = new Logger('test', array($logHandler)); + + $download = new DownloadImages($client, sys_get_temp_dir().'/wallabag_test', 'http://wallabag.io/', $logger); + $res = $download->processHtml(123, '
      ', 'http://imgur.com/gallery/WxtWY'); + + $this->assertContains('http://i.imgur.com/T9qgcHc.jpg', $res, 'Image were not replace because of content-type'); + } + + public function singleImage() + { + return [ + ['image/pjpeg', 'jpeg'], + ['image/jpeg', 'jpeg'], + ['image/png', 'png'], + ['image/gif', 'gif'], + ]; + } + + /** + * @dataProvider singleImage + */ + public function testProcessSingleImage($header, $extension) + { + $client = new Client(); + + $mock = new Mock([ + new Response(200, ['content-type' => $header], Stream::factory(file_get_contents(__DIR__.'/../fixtures/unnamed.png'))), + ]); + + $client->getEmitter()->attach($mock); + + $logHandler = new TestHandler(); + $logger = new Logger('test', array($logHandler)); + + $download = new DownloadImages($client, sys_get_temp_dir().'/wallabag_test', 'http://wallabag.io/', $logger); + $res = $download->processSingleImage(123, 'T9qgcHc.jpg', 'http://imgur.com/gallery/WxtWY'); + + $this->assertContains('/assets/images/9/b/9b0ead26/ebe60399.'.$extension, $res); + } + + public function testProcessSingleImageWithBadUrl() + { + $client = new Client(); + + $mock = new Mock([ + new Response(404, []), + ]); + + $client->getEmitter()->attach($mock); + + $logHandler = new TestHandler(); + $logger = new Logger('test', array($logHandler)); + + $download = new DownloadImages($client, sys_get_temp_dir().'/wallabag_test', 'http://wallabag.io/', $logger); + $res = $download->processSingleImage(123, 'T9qgcHc.jpg', 'http://imgur.com/gallery/WxtWY'); + + $this->assertFalse($res, 'Image can not be found, so it will not be replaced'); + } + + public function testProcessSingleImageWithBadImage() + { + $client = new Client(); + + $mock = new Mock([ + new Response(200, ['content-type' => 'image/png'], Stream::factory('')), + ]); + + $client->getEmitter()->attach($mock); + + $logHandler = new TestHandler(); + $logger = new Logger('test', array($logHandler)); + + $download = new DownloadImages($client, sys_get_temp_dir().'/wallabag_test', 'http://wallabag.io/', $logger); + $res = $download->processSingleImage(123, 'http://i.imgur.com/T9qgcHc.jpg', 'http://imgur.com/gallery/WxtWY'); + + $this->assertFalse($res, 'Image can not be loaded, so it will not be replaced'); + } + + public function testProcessSingleImageFailAbsolute() + { + $client = new Client(); + + $mock = new Mock([ + new Response(200, ['content-type' => 'image/png'], Stream::factory(file_get_contents(__DIR__.'/../fixtures/unnamed.png'))), + ]); + + $client->getEmitter()->attach($mock); + + $logHandler = new TestHandler(); + $logger = new Logger('test', array($logHandler)); + + $download = new DownloadImages($client, sys_get_temp_dir().'/wallabag_test', 'http://wallabag.io/', $logger); + $res = $download->processSingleImage(123, '/i.imgur.com/T9qgcHc.jpg', 'imgur.com/gallery/WxtWY'); + + $this->assertFalse($res, 'Absolute image can not be determined, so it will not be replaced'); + } +} diff --git a/tests/Wallabag/CoreBundle/Helper/RedirectTest.php b/tests/Wallabag/CoreBundle/Helper/RedirectTest.php index f339f75e..0539f20a 100644 --- a/tests/Wallabag/CoreBundle/Helper/RedirectTest.php +++ b/tests/Wallabag/CoreBundle/Helper/RedirectTest.php @@ -2,7 +2,11 @@ namespace Tests\Wallabag\CoreBundle\Helper; +use Wallabag\CoreBundle\Entity\Config; +use Wallabag\UserBundle\Entity\User; use Wallabag\CoreBundle\Helper\Redirect; +use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; +use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage; class RedirectTest extends \PHPUnit_Framework_TestCase { @@ -14,8 +18,38 @@ class RedirectTest extends \PHPUnit_Framework_TestCase public function setUp() { - $this->routerMock = $this->getRouterMock(); - $this->redirect = new Redirect($this->routerMock); + $this->routerMock = $this->getMockBuilder('Symfony\Component\Routing\Router') + ->disableOriginalConstructor() + ->getMock(); + + $this->routerMock->expects($this->any()) + ->method('generate') + ->with('homepage') + ->willReturn('homepage'); + + $user = new User(); + $user->setName('youpi'); + $user->setEmail('youpi@youpi.org'); + $user->setUsername('youpi'); + $user->setPlainPassword('youpi'); + $user->setEnabled(true); + $user->addRole('ROLE_SUPER_ADMIN'); + + $config = new Config($user); + $config->setTheme('material'); + $config->setItemsPerPage(30); + $config->setReadingSpeed(1); + $config->setLanguage('en'); + $config->setPocketConsumerKey('xxxxx'); + $config->setActionMarkAsRead(Config::REDIRECT_TO_CURRENT_PAGE); + + $user->setConfig($config); + + $this->token = new UsernamePasswordToken($user, 'password', 'key'); + $tokenStorage = new TokenStorage(); + $tokenStorage->setToken($this->token); + + $this->redirect = new Redirect($this->routerMock, $tokenStorage); } public function testRedirectToNullWithFallback() @@ -39,17 +73,20 @@ class RedirectTest extends \PHPUnit_Framework_TestCase $this->assertEquals('/unread/list', $redirectUrl); } - private function getRouterMock() + public function testWithNotLoggedUser() { - $mock = $this->getMockBuilder('Symfony\Component\Routing\Router') - ->disableOriginalConstructor() - ->getMock(); + $redirect = new Redirect($this->routerMock, new TokenStorage()); + $redirectUrl = $redirect->to('/unread/list'); - $mock->expects($this->any()) - ->method('generate') - ->with('homepage') - ->willReturn('homepage'); + $this->assertEquals('/unread/list', $redirectUrl); + } - return $mock; + public function testUserForRedirectToHomepage() + { + $this->token->getUser()->getConfig()->setActionMarkAsRead(Config::REDIRECT_TO_HOMEPAGE); + + $redirectUrl = $this->redirect->to('/unread/list'); + + $this->assertEquals($this->routerMock->generate('homepage'), $redirectUrl); } } diff --git a/tests/Wallabag/CoreBundle/fixtures/unnamed.png b/tests/Wallabag/CoreBundle/fixtures/unnamed.png new file mode 100644 index 00000000..e6dd9caa Binary files /dev/null and b/tests/Wallabag/CoreBundle/fixtures/unnamed.png differ diff --git a/tests/Wallabag/ImportBundle/Consumer/AMQPEntryConsumerTest.php b/tests/Wallabag/ImportBundle/Consumer/AMQPEntryConsumerTest.php index a3263771..856954a6 100644 --- a/tests/Wallabag/ImportBundle/Consumer/AMQPEntryConsumerTest.php +++ b/tests/Wallabag/ImportBundle/Consumer/AMQPEntryConsumerTest.php @@ -112,10 +112,19 @@ JSON; ->with(json_decode($body, true)) ->willReturn($entry); + $dispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcher') + ->disableOriginalConstructor() + ->getMock(); + + $dispatcher + ->expects($this->once()) + ->method('dispatch'); + $consumer = new AMQPEntryConsumer( $em, $userRepository, - $import + $import, + $dispatcher ); $message = new AMQPMessage($body); @@ -157,10 +166,19 @@ JSON; ->disableOriginalConstructor() ->getMock(); + $dispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcher') + ->disableOriginalConstructor() + ->getMock(); + + $dispatcher + ->expects($this->never()) + ->method('dispatch'); + $consumer = new AMQPEntryConsumer( $em, $userRepository, - $import + $import, + $dispatcher ); $message = new AMQPMessage($body); @@ -212,10 +230,19 @@ JSON; ->with(json_decode($body, true)) ->willReturn(null); + $dispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcher') + ->disableOriginalConstructor() + ->getMock(); + + $dispatcher + ->expects($this->never()) + ->method('dispatch'); + $consumer = new AMQPEntryConsumer( $em, $userRepository, - $import + $import, + $dispatcher ); $message = new AMQPMessage($body); diff --git a/tests/Wallabag/ImportBundle/Consumer/RedisEntryConsumerTest.php b/tests/Wallabag/ImportBundle/Consumer/RedisEntryConsumerTest.php index 01a92ad2..3b92f759 100644 --- a/tests/Wallabag/ImportBundle/Consumer/RedisEntryConsumerTest.php +++ b/tests/Wallabag/ImportBundle/Consumer/RedisEntryConsumerTest.php @@ -111,10 +111,19 @@ JSON; ->with(json_decode($body, true)) ->willReturn($entry); + $dispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcher') + ->disableOriginalConstructor() + ->getMock(); + + $dispatcher + ->expects($this->once()) + ->method('dispatch'); + $consumer = new RedisEntryConsumer( $em, $userRepository, - $import + $import, + $dispatcher ); $res = $consumer->manage($body); @@ -156,10 +165,19 @@ JSON; ->disableOriginalConstructor() ->getMock(); + $dispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcher') + ->disableOriginalConstructor() + ->getMock(); + + $dispatcher + ->expects($this->never()) + ->method('dispatch'); + $consumer = new RedisEntryConsumer( $em, $userRepository, - $import + $import, + $dispatcher ); $res = $consumer->manage($body); @@ -211,10 +229,19 @@ JSON; ->with(json_decode($body, true)) ->willReturn(null); + $dispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcher') + ->disableOriginalConstructor() + ->getMock(); + + $dispatcher + ->expects($this->never()) + ->method('dispatch'); + $consumer = new RedisEntryConsumer( $em, $userRepository, - $import + $import, + $dispatcher ); $res = $consumer->manage($body); diff --git a/tests/Wallabag/ImportBundle/Controller/ChromeControllerTest.php b/tests/Wallabag/ImportBundle/Controller/ChromeControllerTest.php index c0417bbe..c1f82ea9 100644 --- a/tests/Wallabag/ImportBundle/Controller/ChromeControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/ChromeControllerTest.php @@ -118,8 +118,8 @@ class ChromeControllerTest extends WallabagCoreTestCase $this->getLoggedInUserId() ); - $this->assertNotEmpty($content->getPreviewPicture()); - $this->assertNotEmpty($content->getLanguage()); + $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://www.usinenouvelle.com is ok'); + $this->assertNotEmpty($content->getLanguage(), 'Language for http://www.usinenouvelle.com is ok'); $this->assertEquals(0, count($content->getTags())); $createdAt = $content->getCreatedAt(); diff --git a/tests/Wallabag/ImportBundle/Controller/FirefoxControllerTest.php b/tests/Wallabag/ImportBundle/Controller/FirefoxControllerTest.php index 6154ae8d..7557ea32 100644 --- a/tests/Wallabag/ImportBundle/Controller/FirefoxControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/FirefoxControllerTest.php @@ -118,9 +118,9 @@ class FirefoxControllerTest extends WallabagCoreTestCase $this->getLoggedInUserId() ); - $this->assertNotEmpty($content->getMimetype()); - $this->assertNotEmpty($content->getPreviewPicture()); - $this->assertNotEmpty($content->getLanguage()); + $this->assertNotEmpty($content->getMimetype(), 'Mimetype for http://lexpansion.lexpress.fr is ok'); + $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://lexpansion.lexpress.fr is ok'); + $this->assertNotEmpty($content->getLanguage(), 'Language for http://lexpansion.lexpress.fr is ok'); $this->assertEquals(2, count($content->getTags())); $content = $client->getContainer() @@ -131,9 +131,9 @@ class FirefoxControllerTest extends WallabagCoreTestCase $this->getLoggedInUserId() ); - $this->assertNotEmpty($content->getMimetype()); - $this->assertNotEmpty($content->getPreviewPicture()); - $this->assertEmpty($content->getLanguage()); + $this->assertNotEmpty($content->getMimetype(), 'Mimetype for http://stackoverflow.com is ok'); + $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://stackoverflow.com is ok'); + $this->assertEmpty($content->getLanguage(), 'Language for http://stackoverflow.com is ok'); $createdAt = $content->getCreatedAt(); $this->assertEquals('2013', $createdAt->format('Y')); diff --git a/tests/Wallabag/ImportBundle/Controller/ImportControllerTest.php b/tests/Wallabag/ImportBundle/Controller/ImportControllerTest.php index 0bc40bdd..5e57dcef 100644 --- a/tests/Wallabag/ImportBundle/Controller/ImportControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/ImportControllerTest.php @@ -24,6 +24,6 @@ class ImportControllerTest extends WallabagCoreTestCase $crawler = $client->request('GET', '/import/'); $this->assertEquals(200, $client->getResponse()->getStatusCode()); - $this->assertEquals(7, $crawler->filter('blockquote')->count()); + $this->assertEquals(8, $crawler->filter('blockquote')->count()); } } diff --git a/tests/Wallabag/ImportBundle/Controller/InstapaperControllerTest.php b/tests/Wallabag/ImportBundle/Controller/InstapaperControllerTest.php index 9df08e75..3f6f2b9f 100644 --- a/tests/Wallabag/ImportBundle/Controller/InstapaperControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/InstapaperControllerTest.php @@ -118,9 +118,9 @@ class InstapaperControllerTest extends WallabagCoreTestCase $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); $this->assertContains('flashes.import.notice.summary', $body[0]); - $this->assertNotEmpty($content->getMimetype()); - $this->assertNotEmpty($content->getPreviewPicture()); - $this->assertNotEmpty($content->getLanguage()); + $this->assertNotEmpty($content->getMimetype(), 'Mimetype for http://www.liberation.fr is ok'); + $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://www.liberation.fr is ok'); + $this->assertNotEmpty($content->getLanguage(), 'Language for http://www.liberation.fr is ok'); $this->assertEquals(0, count($content->getTags())); $this->assertInstanceOf(\DateTime::class, $content->getCreatedAt()); } diff --git a/tests/Wallabag/ImportBundle/Controller/PinboardControllerTest.php b/tests/Wallabag/ImportBundle/Controller/PinboardControllerTest.php new file mode 100644 index 00000000..75a7e332 --- /dev/null +++ b/tests/Wallabag/ImportBundle/Controller/PinboardControllerTest.php @@ -0,0 +1,197 @@ +logInAs('admin'); + $client = $this->getClient(); + + $crawler = $client->request('GET', '/import/pinboard'); + + $this->assertEquals(200, $client->getResponse()->getStatusCode()); + $this->assertEquals(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); + $this->assertEquals(1, $crawler->filter('input[type=file]')->count()); + } + + public function testImportPinboardWithRabbitEnabled() + { + $this->logInAs('admin'); + $client = $this->getClient(); + + $client->getContainer()->get('craue_config')->set('import_with_rabbitmq', 1); + + $crawler = $client->request('GET', '/import/pinboard'); + + $this->assertEquals(200, $client->getResponse()->getStatusCode()); + $this->assertEquals(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); + $this->assertEquals(1, $crawler->filter('input[type=file]')->count()); + + $client->getContainer()->get('craue_config')->set('import_with_rabbitmq', 0); + } + + public function testImportPinboardBadFile() + { + $this->logInAs('admin'); + $client = $this->getClient(); + + $crawler = $client->request('GET', '/import/pinboard'); + $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); + + $data = [ + 'upload_import_file[file]' => '', + ]; + + $client->submit($form, $data); + + $this->assertEquals(200, $client->getResponse()->getStatusCode()); + } + + public function testImportPinboardWithRedisEnabled() + { + $this->checkRedis(); + $this->logInAs('admin'); + $client = $this->getClient(); + $client->getContainer()->get('craue_config')->set('import_with_redis', 1); + + $crawler = $client->request('GET', '/import/pinboard'); + + $this->assertEquals(200, $client->getResponse()->getStatusCode()); + $this->assertEquals(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); + $this->assertEquals(1, $crawler->filter('input[type=file]')->count()); + + $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); + + $file = new UploadedFile(__DIR__.'/../fixtures/pinboard_export', 'pinboard.json'); + + $data = [ + 'upload_import_file[file]' => $file, + ]; + + $client->submit($form, $data); + + $this->assertEquals(302, $client->getResponse()->getStatusCode()); + + $crawler = $client->followRedirect(); + + $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); + $this->assertContains('flashes.import.notice.summary', $body[0]); + + $this->assertNotEmpty($client->getContainer()->get('wallabag_core.redis.client')->lpop('wallabag.import.pinboard')); + + $client->getContainer()->get('craue_config')->set('import_with_redis', 0); + } + + public function testImportPinboardWithFile() + { + $this->logInAs('admin'); + $client = $this->getClient(); + + $crawler = $client->request('GET', '/import/pinboard'); + $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); + + $file = new UploadedFile(__DIR__.'/../fixtures/pinboard_export', 'pinboard.json'); + + $data = [ + 'upload_import_file[file]' => $file, + ]; + + $client->submit($form, $data); + + $this->assertEquals(302, $client->getResponse()->getStatusCode()); + + $crawler = $client->followRedirect(); + + $content = $client->getContainer() + ->get('doctrine.orm.entity_manager') + ->getRepository('WallabagCoreBundle:Entry') + ->findByUrlAndUserId( + 'https://ma.ttias.be/varnish-explained/', + $this->getLoggedInUserId() + ); + + $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); + $this->assertContains('flashes.import.notice.summary', $body[0]); + + $this->assertNotEmpty($content->getMimetype(), 'Mimetype for https://ma.ttias.be is ok'); + $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for https://ma.ttias.be is ok'); + $this->assertNotEmpty($content->getLanguage(), 'Language for https://ma.ttias.be is ok'); + $this->assertEquals(2, count($content->getTags())); + $this->assertInstanceOf(\DateTime::class, $content->getCreatedAt()); + $this->assertEquals('2016-10-26', $content->getCreatedAt()->format('Y-m-d')); + } + + public function testImportPinboardWithFileAndMarkAllAsRead() + { + $this->logInAs('admin'); + $client = $this->getClient(); + + $crawler = $client->request('GET', '/import/pinboard'); + $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); + + $file = new UploadedFile(__DIR__.'/../fixtures/pinboard_export', 'pinboard-read.json'); + + $data = [ + 'upload_import_file[file]' => $file, + 'upload_import_file[mark_as_read]' => 1, + ]; + + $client->submit($form, $data); + + $this->assertEquals(302, $client->getResponse()->getStatusCode()); + + $crawler = $client->followRedirect(); + + $content1 = $client->getContainer() + ->get('doctrine.orm.entity_manager') + ->getRepository('WallabagCoreBundle:Entry') + ->findByUrlAndUserId( + 'https://ilia.ws/files/nginx_torontophpug.pdf', + $this->getLoggedInUserId() + ); + + $this->assertTrue($content1->isArchived()); + + $content2 = $client->getContainer() + ->get('doctrine.orm.entity_manager') + ->getRepository('WallabagCoreBundle:Entry') + ->findByUrlAndUserId( + 'https://developers.google.com/web/updates/2016/07/infinite-scroller', + $this->getLoggedInUserId() + ); + + $this->assertTrue($content2->isArchived()); + + $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); + $this->assertContains('flashes.import.notice.summary', $body[0]); + } + + public function testImportPinboardWithEmptyFile() + { + $this->logInAs('admin'); + $client = $this->getClient(); + + $crawler = $client->request('GET', '/import/pinboard'); + $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); + + $file = new UploadedFile(__DIR__.'/../fixtures/test.txt', 'test.txt'); + + $data = [ + 'upload_import_file[file]' => $file, + ]; + + $client->submit($form, $data); + + $this->assertEquals(302, $client->getResponse()->getStatusCode()); + + $crawler = $client->followRedirect(); + + $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); + $this->assertContains('flashes.import.notice.failed', $body[0]); + } +} diff --git a/tests/Wallabag/ImportBundle/Controller/ReadabilityControllerTest.php b/tests/Wallabag/ImportBundle/Controller/ReadabilityControllerTest.php index 916dd297..acb61ca1 100644 --- a/tests/Wallabag/ImportBundle/Controller/ReadabilityControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/ReadabilityControllerTest.php @@ -111,19 +111,19 @@ class ReadabilityControllerTest extends WallabagCoreTestCase ->get('doctrine.orm.entity_manager') ->getRepository('WallabagCoreBundle:Entry') ->findByUrlAndUserId( - 'https://venngage.com/blog/hashtags-are-worthless/', + 'http://www.zataz.com/90-des-dossiers-medicaux-des-coreens-du-sud-vendus-a-des-entreprises-privees/', $this->getLoggedInUserId() ); $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); $this->assertContains('flashes.import.notice.summary', $body[0]); - $this->assertNotEmpty($content->getMimetype()); - $this->assertNotEmpty($content->getPreviewPicture()); - $this->assertNotEmpty($content->getLanguage()); + $this->assertNotEmpty($content->getMimetype(), 'Mimetype for http://www.zataz.com is ok'); + $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://www.zataz.com is ok'); + $this->assertNotEmpty($content->getLanguage(), 'Language for http://www.zataz.com is ok'); $this->assertEquals(0, count($content->getTags())); $this->assertInstanceOf(\DateTime::class, $content->getCreatedAt()); - $this->assertEquals('2016-08-25', $content->getCreatedAt()->format('Y-m-d')); + $this->assertEquals('2016-09-08', $content->getCreatedAt()->format('Y-m-d')); } public function testImportReadabilityWithFileAndMarkAllAsRead() diff --git a/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php b/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php index 3497c4b8..2c370ed9 100644 --- a/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php @@ -126,9 +126,9 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); $this->assertContains('flashes.import.notice.summary', $body[0]); - $this->assertEmpty($content->getMimetype()); - $this->assertEmpty($content->getPreviewPicture()); - $this->assertEmpty($content->getLanguage()); + $this->assertEmpty($content->getMimetype(), 'Mimetype for http://www.framablog.org is ok'); + $this->assertEmpty($content->getPreviewPicture(), 'Preview picture for http://www.framablog.org is ok'); + $this->assertEmpty($content->getLanguage(), 'Language for http://www.framablog.org is ok'); $this->assertEquals(1, count($content->getTags())); $this->assertInstanceOf(\DateTime::class, $content->getCreatedAt()); } diff --git a/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php b/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php index 27d2d52b..26e2f40b 100644 --- a/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php @@ -119,9 +119,9 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase $this->getLoggedInUserId() ); - $this->assertNotEmpty($content->getMimetype()); - $this->assertNotEmpty($content->getPreviewPicture()); - $this->assertNotEmpty($content->getLanguage()); + $this->assertNotEmpty($content->getMimetype(), 'Mimetype for http://www.liberation.fr is ok'); + $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://www.liberation.fr is ok'); + $this->assertNotEmpty($content->getLanguage(), 'Language for http://www.liberation.fr is ok'); $this->assertEquals(0, count($content->getTags())); $content = $client->getContainer() @@ -132,9 +132,9 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase $this->getLoggedInUserId() ); - $this->assertNotEmpty($content->getMimetype()); - $this->assertNotEmpty($content->getPreviewPicture()); - $this->assertNotEmpty($content->getLanguage()); + $this->assertNotEmpty($content->getMimetype(), 'Mimetype for https://www.mediapart.fr is ok'); + $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for https://www.mediapart.fr is ok'); + $this->assertNotEmpty($content->getLanguage(), 'Language for https://www.mediapart.fr is ok'); $this->assertEquals(2, count($content->getTags())); $this->assertInstanceOf(\DateTime::class, $content->getCreatedAt()); $this->assertEquals('2016-09-08', $content->getCreatedAt()->format('Y-m-d')); diff --git a/tests/Wallabag/ImportBundle/Import/ChromeImportTest.php b/tests/Wallabag/ImportBundle/Import/ChromeImportTest.php index 1e52615c..6b3adda4 100644 --- a/tests/Wallabag/ImportBundle/Import/ChromeImportTest.php +++ b/tests/Wallabag/ImportBundle/Import/ChromeImportTest.php @@ -18,7 +18,7 @@ class ChromeImportTest extends \PHPUnit_Framework_TestCase protected $logHandler; protected $contentProxy; - private function getChromeImport($unsetUser = false) + private function getChromeImport($unsetUser = false, $dispatched = 0) { $this->user = new User(); @@ -30,7 +30,15 @@ class ChromeImportTest extends \PHPUnit_Framework_TestCase ->disableOriginalConstructor() ->getMock(); - $wallabag = new ChromeImport($this->em, $this->contentProxy); + $dispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcher') + ->disableOriginalConstructor() + ->getMock(); + + $dispatcher + ->expects($this->exactly($dispatched)) + ->method('dispatch'); + + $wallabag = new ChromeImport($this->em, $this->contentProxy, $dispatcher); $this->logHandler = new TestHandler(); $logger = new Logger('test', [$this->logHandler]); @@ -54,7 +62,7 @@ class ChromeImportTest extends \PHPUnit_Framework_TestCase public function testImport() { - $chromeImport = $this->getChromeImport(); + $chromeImport = $this->getChromeImport(false, 1); $chromeImport->setFilepath(__DIR__.'/../fixtures/chrome-bookmarks'); $entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository') @@ -87,7 +95,7 @@ class ChromeImportTest extends \PHPUnit_Framework_TestCase public function testImportAndMarkAllAsRead() { - $chromeImport = $this->getChromeImport(); + $chromeImport = $this->getChromeImport(false, 1); $chromeImport->setFilepath(__DIR__.'/../fixtures/chrome-bookmarks'); $entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository') diff --git a/tests/Wallabag/ImportBundle/Import/FirefoxImportTest.php b/tests/Wallabag/ImportBundle/Import/FirefoxImportTest.php index 007dda6a..b516fbc5 100644 --- a/tests/Wallabag/ImportBundle/Import/FirefoxImportTest.php +++ b/tests/Wallabag/ImportBundle/Import/FirefoxImportTest.php @@ -18,7 +18,7 @@ class FirefoxImportTest extends \PHPUnit_Framework_TestCase protected $logHandler; protected $contentProxy; - private function getFirefoxImport($unsetUser = false) + private function getFirefoxImport($unsetUser = false, $dispatched = 0) { $this->user = new User(); @@ -30,7 +30,15 @@ class FirefoxImportTest extends \PHPUnit_Framework_TestCase ->disableOriginalConstructor() ->getMock(); - $wallabag = new FirefoxImport($this->em, $this->contentProxy); + $dispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcher') + ->disableOriginalConstructor() + ->getMock(); + + $dispatcher + ->expects($this->exactly($dispatched)) + ->method('dispatch'); + + $wallabag = new FirefoxImport($this->em, $this->contentProxy, $dispatcher); $this->logHandler = new TestHandler(); $logger = new Logger('test', [$this->logHandler]); @@ -54,7 +62,7 @@ class FirefoxImportTest extends \PHPUnit_Framework_TestCase public function testImport() { - $firefoxImport = $this->getFirefoxImport(); + $firefoxImport = $this->getFirefoxImport(false, 2); $firefoxImport->setFilepath(__DIR__.'/../fixtures/firefox-bookmarks.json'); $entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository') @@ -87,7 +95,7 @@ class FirefoxImportTest extends \PHPUnit_Framework_TestCase public function testImportAndMarkAllAsRead() { - $firefoxImport = $this->getFirefoxImport(); + $firefoxImport = $this->getFirefoxImport(false, 1); $firefoxImport->setFilepath(__DIR__.'/../fixtures/firefox-bookmarks.json'); $entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository') diff --git a/tests/Wallabag/ImportBundle/Import/InstapaperImportTest.php b/tests/Wallabag/ImportBundle/Import/InstapaperImportTest.php index 75900bd7..e262a808 100644 --- a/tests/Wallabag/ImportBundle/Import/InstapaperImportTest.php +++ b/tests/Wallabag/ImportBundle/Import/InstapaperImportTest.php @@ -18,7 +18,7 @@ class InstapaperImportTest extends \PHPUnit_Framework_TestCase protected $logHandler; protected $contentProxy; - private function getInstapaperImport($unsetUser = false) + private function getInstapaperImport($unsetUser = false, $dispatched = 0) { $this->user = new User(); @@ -30,7 +30,15 @@ class InstapaperImportTest extends \PHPUnit_Framework_TestCase ->disableOriginalConstructor() ->getMock(); - $import = new InstapaperImport($this->em, $this->contentProxy); + $dispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcher') + ->disableOriginalConstructor() + ->getMock(); + + $dispatcher + ->expects($this->exactly($dispatched)) + ->method('dispatch'); + + $import = new InstapaperImport($this->em, $this->contentProxy, $dispatcher); $this->logHandler = new TestHandler(); $logger = new Logger('test', [$this->logHandler]); @@ -54,7 +62,7 @@ class InstapaperImportTest extends \PHPUnit_Framework_TestCase public function testImport() { - $instapaperImport = $this->getInstapaperImport(); + $instapaperImport = $this->getInstapaperImport(false, 3); $instapaperImport->setFilepath(__DIR__.'/../fixtures/instapaper-export.csv'); $entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository') @@ -87,7 +95,7 @@ class InstapaperImportTest extends \PHPUnit_Framework_TestCase public function testImportAndMarkAllAsRead() { - $instapaperImport = $this->getInstapaperImport(); + $instapaperImport = $this->getInstapaperImport(false, 1); $instapaperImport->setFilepath(__DIR__.'/../fixtures/instapaper-export.csv'); $entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository') diff --git a/tests/Wallabag/ImportBundle/Import/PocketImportTest.php b/tests/Wallabag/ImportBundle/Import/PocketImportTest.php index 9ec7935c..141ece36 100644 --- a/tests/Wallabag/ImportBundle/Import/PocketImportTest.php +++ b/tests/Wallabag/ImportBundle/Import/PocketImportTest.php @@ -24,7 +24,7 @@ class PocketImportTest extends \PHPUnit_Framework_TestCase protected $contentProxy; protected $logHandler; - private function getPocketImport($consumerKey = 'ConsumerKey') + private function getPocketImport($consumerKey = 'ConsumerKey', $dispatched = 0) { $this->user = new User(); @@ -55,10 +55,15 @@ class PocketImportTest extends \PHPUnit_Framework_TestCase ->method('getScheduledEntityInsertions') ->willReturn([]); - $pocket = new PocketImport( - $this->em, - $this->contentProxy - ); + $dispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcher') + ->disableOriginalConstructor() + ->getMock(); + + $dispatcher + ->expects($this->exactly($dispatched)) + ->method('dispatch'); + + $pocket = new PocketImport($this->em, $this->contentProxy, $dispatcher); $pocket->setUser($this->user); $this->logHandler = new TestHandler(); @@ -252,7 +257,7 @@ class PocketImportTest extends \PHPUnit_Framework_TestCase $client->getEmitter()->attach($mock); - $pocketImport = $this->getPocketImport(); + $pocketImport = $this->getPocketImport('ConsumerKey', 1); $entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository') ->disableOriginalConstructor() @@ -339,7 +344,7 @@ class PocketImportTest extends \PHPUnit_Framework_TestCase $client->getEmitter()->attach($mock); - $pocketImport = $this->getPocketImport(); + $pocketImport = $this->getPocketImport('ConsumerKey', 2); $entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository') ->disableOriginalConstructor() @@ -591,7 +596,7 @@ JSON; $client->getEmitter()->attach($mock); - $pocketImport = $this->getPocketImport(); + $pocketImport = $this->getPocketImport('ConsumerKey', 1); $entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository') ->disableOriginalConstructor() diff --git a/tests/Wallabag/ImportBundle/Import/ReadabilityImportTest.php b/tests/Wallabag/ImportBundle/Import/ReadabilityImportTest.php index d98cd486..d1bbe648 100644 --- a/tests/Wallabag/ImportBundle/Import/ReadabilityImportTest.php +++ b/tests/Wallabag/ImportBundle/Import/ReadabilityImportTest.php @@ -18,7 +18,7 @@ class ReadabilityImportTest extends \PHPUnit_Framework_TestCase protected $logHandler; protected $contentProxy; - private function getReadabilityImport($unsetUser = false) + private function getReadabilityImport($unsetUser = false, $dispatched = 0) { $this->user = new User(); @@ -30,7 +30,15 @@ class ReadabilityImportTest extends \PHPUnit_Framework_TestCase ->disableOriginalConstructor() ->getMock(); - $wallabag = new ReadabilityImport($this->em, $this->contentProxy); + $dispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcher') + ->disableOriginalConstructor() + ->getMock(); + + $dispatcher + ->expects($this->exactly($dispatched)) + ->method('dispatch'); + + $wallabag = new ReadabilityImport($this->em, $this->contentProxy, $dispatcher); $this->logHandler = new TestHandler(); $logger = new Logger('test', [$this->logHandler]); @@ -54,7 +62,7 @@ class ReadabilityImportTest extends \PHPUnit_Framework_TestCase public function testImport() { - $readabilityImport = $this->getReadabilityImport(); + $readabilityImport = $this->getReadabilityImport(false, 24); $readabilityImport->setFilepath(__DIR__.'/../fixtures/readability.json'); $entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository') @@ -87,7 +95,7 @@ class ReadabilityImportTest extends \PHPUnit_Framework_TestCase public function testImportAndMarkAllAsRead() { - $readabilityImport = $this->getReadabilityImport(); + $readabilityImport = $this->getReadabilityImport(false, 1); $readabilityImport->setFilepath(__DIR__.'/../fixtures/readability-read.json'); $entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository') diff --git a/tests/Wallabag/ImportBundle/Import/WallabagV1ImportTest.php b/tests/Wallabag/ImportBundle/Import/WallabagV1ImportTest.php index 82dc4c7e..4dbced60 100644 --- a/tests/Wallabag/ImportBundle/Import/WallabagV1ImportTest.php +++ b/tests/Wallabag/ImportBundle/Import/WallabagV1ImportTest.php @@ -18,7 +18,7 @@ class WallabagV1ImportTest extends \PHPUnit_Framework_TestCase protected $logHandler; protected $contentProxy; - private function getWallabagV1Import($unsetUser = false) + private function getWallabagV1Import($unsetUser = false, $dispatched = 0) { $this->user = new User(); @@ -44,7 +44,15 @@ class WallabagV1ImportTest extends \PHPUnit_Framework_TestCase ->disableOriginalConstructor() ->getMock(); - $wallabag = new WallabagV1Import($this->em, $this->contentProxy); + $dispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcher') + ->disableOriginalConstructor() + ->getMock(); + + $dispatcher + ->expects($this->exactly($dispatched)) + ->method('dispatch'); + + $wallabag = new WallabagV1Import($this->em, $this->contentProxy, $dispatcher); $this->logHandler = new TestHandler(); $logger = new Logger('test', [$this->logHandler]); @@ -68,7 +76,7 @@ class WallabagV1ImportTest extends \PHPUnit_Framework_TestCase public function testImport() { - $wallabagV1Import = $this->getWallabagV1Import(); + $wallabagV1Import = $this->getWallabagV1Import(false, 3); $wallabagV1Import->setFilepath(__DIR__.'/../fixtures/wallabag-v1.json'); $entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository') @@ -101,7 +109,7 @@ class WallabagV1ImportTest extends \PHPUnit_Framework_TestCase public function testImportAndMarkAllAsRead() { - $wallabagV1Import = $this->getWallabagV1Import(); + $wallabagV1Import = $this->getWallabagV1Import(false, 3); $wallabagV1Import->setFilepath(__DIR__.'/../fixtures/wallabag-v1-read.json'); $entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository') diff --git a/tests/Wallabag/ImportBundle/Import/WallabagV2ImportTest.php b/tests/Wallabag/ImportBundle/Import/WallabagV2ImportTest.php index bea89efb..0e50b8b2 100644 --- a/tests/Wallabag/ImportBundle/Import/WallabagV2ImportTest.php +++ b/tests/Wallabag/ImportBundle/Import/WallabagV2ImportTest.php @@ -18,7 +18,7 @@ class WallabagV2ImportTest extends \PHPUnit_Framework_TestCase protected $logHandler; protected $contentProxy; - private function getWallabagV2Import($unsetUser = false) + private function getWallabagV2Import($unsetUser = false, $dispatched = 0) { $this->user = new User(); @@ -44,7 +44,15 @@ class WallabagV2ImportTest extends \PHPUnit_Framework_TestCase ->disableOriginalConstructor() ->getMock(); - $wallabag = new WallabagV2Import($this->em, $this->contentProxy); + $dispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcher') + ->disableOriginalConstructor() + ->getMock(); + + $dispatcher + ->expects($this->exactly($dispatched)) + ->method('dispatch'); + + $wallabag = new WallabagV2Import($this->em, $this->contentProxy, $dispatcher); $this->logHandler = new TestHandler(); $logger = new Logger('test', [$this->logHandler]); @@ -68,7 +76,7 @@ class WallabagV2ImportTest extends \PHPUnit_Framework_TestCase public function testImport() { - $wallabagV2Import = $this->getWallabagV2Import(); + $wallabagV2Import = $this->getWallabagV2Import(false, 2); $wallabagV2Import->setFilepath(__DIR__.'/../fixtures/wallabag-v2.json'); $entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository') @@ -97,7 +105,7 @@ class WallabagV2ImportTest extends \PHPUnit_Framework_TestCase public function testImportAndMarkAllAsRead() { - $wallabagV2Import = $this->getWallabagV2Import(); + $wallabagV2Import = $this->getWallabagV2Import(false, 2); $wallabagV2Import->setFilepath(__DIR__.'/../fixtures/wallabag-v2-read.json'); $entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository') @@ -246,7 +254,7 @@ class WallabagV2ImportTest extends \PHPUnit_Framework_TestCase public function testImportWithExceptionFromGraby() { - $wallabagV2Import = $this->getWallabagV2Import(); + $wallabagV2Import = $this->getWallabagV2Import(false, 2); $wallabagV2Import->setFilepath(__DIR__.'/../fixtures/wallabag-v2.json'); $entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository') diff --git a/tests/Wallabag/ImportBundle/fixtures/pinboard_export b/tests/Wallabag/ImportBundle/fixtures/pinboard_export new file mode 100644 index 00000000..2dd744d3 --- /dev/null +++ b/tests/Wallabag/ImportBundle/fixtures/pinboard_export @@ -0,0 +1,5 @@ +[{"href":"https:\/\/developers.google.com\/web\/updates\/2016\/07\/infinite-scroller","description":"Complexities of an Infinite Scroller","extended":"TL;DR: Re-use your DOM elements and remove the ones that are far away from the viewport. Use placeholders to account for delayed data","meta":"21ff61c6f648901168f9e6119f53df7d","hash":"e69b65724cca1c585b446d4c47865d76","time":"2016-10-31T15:57:56Z","shared":"yes","toread":"no","tags":"infinite dom performance scroll"}, +{"href":"https:\/\/ma.ttias.be\/varnish-explained\/","description":"Varnish (explained) for PHP developers","extended":"A few months ago, I gave a presentation at LaraconEU in Amsterdam titled \"Varnish for PHP developers\". The generic title of that presentation is actually Varnish Explained and this is a write-up of that presentation, the video and the slides.","meta":"d32ad9fac2ed29da4aec12c562e9afb1","hash":"21dd6bdda8ad62666a2c9e79f6e80f98","time":"2016-10-26T06:43:03Z","shared":"yes","toread":"no","tags":"varnish PHP"}, +{"href":"https:\/\/ilia.ws\/files\/nginx_torontophpug.pdf","description":"Nginx Tricks for PHP Developers","extended":"","meta":"9adbb5c4ca6760e335b920800d88c70a","hash":"0189bb08f8bd0122c6544bed4624c546","time":"2016-10-05T07:11:27Z","shared":"yes","toread":"no","tags":"nginx PHP best_practice"}, +{"href":"https:\/\/jolicode.com\/blog\/starting-a-mobile-application-with-react-native","description":"Starting a mobile application with React Native","extended":"While preparing our next React Native training, I learnt a lot on the library and discovered an amazing community with a lot of packages.","meta":"bd140bd3e53e3a0b4cb08cdaf64bcbfc","hash":"015fa10cd97f56186420555e52cfab62","time":"2016-09-23T10:58:20Z","shared":"yes","toread":"no","tags":"react-native"}, +{"href":"http:\/\/open.blogs.nytimes.com\/2016\/08\/29\/testing-varnish-using-varnishtest\/","description":"Testing Varnish Using Varnishtest","extended":"Varnish ships with the ability to test using the testing tool varnishtest. Varnishtest gives you the ability to write VCL tests you can run on the command line or as part of your build process.","meta":"ca2752a07adea4bab52cd19e8fdbf356","hash":"d3e642cc1274d10e4c12ee31f5dde736","time":"2016-08-30T09:33:24Z","shared":"yes","toread":"no","tags":"varnish test vcl"}] diff --git a/web/assets/images/.gitkeep b/web/assets/images/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/web/bundles/wallabagcore/themes/baggy/css/style.min.css b/web/bundles/wallabagcore/themes/baggy/css/style.min.css index 00d665a9..456f2267 100644 --- a/web/bundles/wallabagcore/themes/baggy/css/style.min.css +++ b/web/bundles/wallabagcore/themes/baggy/css/style.min.css @@ -1 +1 @@ -@font-face{font-family:PT Sans;font-style:normal;font-weight:700;src:local("PT Sans Bold"),local("PTSans-Bold"),url(../fonts/ptsansbold.woff) format("woff")}html{min-height:100%}body{background-color:#eee}.login{background-color:#333}.login #main{padding:0;margin:0}.login form{background-color:#fff;padding:1.5em;box-shadow:0 1px 8px rgba(0,0,0,.9);width:20em;top:8em;margin-left:-10em}.login .logo,.login form{position:absolute;left:50%}.login .logo{top:2em;margin-left:-55px}::-moz-selection{color:#fff;background-color:#000}::selection{color:#fff;background-color:#000}.desktopHide{display:none}.logo{position:fixed;z-index:5;top:.4em;left:.6em}h2,h3,h4{font-family:PT Sans,sans-serif;text-transform:uppercase}label,li,p{color:#666}a{color:#000;font-weight:700}a.nostyle,a:focus,a:hover{text-decoration:none}form fieldset{border:0;padding:0;margin:0}form input[type=email],form input[type=number],form input[type=password],form input[type=text],form input[type=url],select{border:1px solid #999;padding:.5em 1em;min-width:12em;color:#666}@media screen and (-webkit-min-device-pixel-ratio:0){select{-webkit-appearance:none;border-radius:0;background:#fff url(../../_global/img/bg-select.png) no-repeat 100%}}.inline .row{display:inline-block;margin-right:.5em}.inline label{min-width:6em}fieldset label{display:inline-block;min-width:12.5em;color:#666}label{margin-right:.5em}form .row{margin-bottom:.5em}form button,input[type=submit]{cursor:pointer;background-color:#000;color:#fff;padding:.5em 1em;display:inline-block;border:1px solid #000}form button:focus,form button:hover,input[type=submit]:focus,input[type=submit]:hover{background-color:#fff;color:#000;transition:all .5s ease}#bookmarklet{cursor:move}h2:after{content:"";height:4px;width:70px;background-color:#000;display:block}.links,.links li{padding:0;margin:0}.links li{list-style:none}#links{position:fixed;top:0;width:10em;left:0;text-align:right;background-color:#333;padding-top:9.5em;height:100%;box-shadow:inset -4px 0 20px rgba(0,0,0,.6);z-index:4}#main{margin-left:12em;position:relative;z-index:1;padding-right:5%;padding-bottom:1em}#links>li>a{display:block;padding:.5em 2em .5em 1em;color:#fff;position:relative;text-transform:uppercase;text-decoration:none;font-weight:400;font-family:PT Sans,sans-serif;transition:all .5s ease}#links>li>a:focus,#links>li>a:hover{background-color:#999;color:#000}#links .current:after{content:"";width:0;height:0;position:absolute;border-style:solid;border-width:10px;border-color:transparent #eee transparent transparent;right:0;top:50%;margin-top:-10px}#links li:last-child{position:fixed;bottom:1em;width:10em}#links li:last-child a:before{font-size:1.2em;position:relative;top:2px}#sort{padding:0;list-style-type:none;opacity:.5;display:inline-block}#sort li{display:inline;font-size:.9em}#sort li+li{margin-left:10px}#sort a{padding:2px 2px 0;vertical-align:middle}#sort img{vertical-align:baseline}#sort img:hover{cursor:pointer}#display-mode{float:right;margin-top:10px;margin-bottom:10px;opacity:.5}#listmode{width:16px;display:inline-block;text-decoration:none}#listmode a:hover{opacity:1}#listmode.tablemode{background-image:url(../img/baggy/table.png)}#listmode.listmode,#listmode.tablemode{background-repeat:no-repeat;background-position:bottom}#listmode.listmode{background-image:url(../img/baggy/list.png)}#warning_message{position:fixed;background-color:tomato;z-index:7;bottom:0;left:0;width:100%;color:#000}#content{margin-top:2em;min-height:30em}footer{text-align:right;position:relative;bottom:0;right:5em;color:#999;font-size:.8em;font-style:italic;z-index:5}footer a{color:#999;font-weight:400}.list-entries{letter-spacing:-5px}.listmode .entry{width:100%!important;margin-left:0!important}.card-entry-labels{position:absolute;top:100px;left:-1em;z-index:6;max-width:50%;padding-left:0}.card-entry-labels li{margin:10px 10px 10px auto;padding:5px 12px 5px 25px;background-color:rgba(0,0,0,.6);border-radius:0 3px 3px 0;color:#fff;cursor:default;max-height:2em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.card-entry-tags{max-height:2em;overflow-y:hidden;padding:0;margin:0}.card-entry-tags li,.card-entry-tags span{display:inline-block;margin:0 5px;padding:5px 12px;background-color:rgba(0,0,0,.6);border-radius:3px;max-height:2em;overflow:hidden;text-overflow:ellipsis}.card-entry-labels a,.card-entry-tags a{text-decoration:none;font-weight:400;color:#fff}.nav-panel-add-tag{margin-top:10px}.list-entries+.results{margin-bottom:2em}.created-at,.reading-time{color:#999;font-style:italic;font-weight:400;font-size:.9em}.estimatedTime small{position:relative;top:-1px}.entry{background-color:#fff;letter-spacing:normal;box-shadow:0 3px 7px rgba(0,0,0,.3);display:inline-block;width:32%;margin-bottom:1.5em;vertical-align:top;margin-right:1%;position:relative;overflow:hidden;padding:1.5em 1.5em 3em;height:440px}.entry:before{width:0;height:0;border-style:solid;border-color:transparent transparent #000;border-width:10px;bottom:.3em;z-index:1;right:1.5em}.entry:after,.entry:before{content:"";position:absolute;transition:all .5s ease}.entry:after{height:7px;width:100%;bottom:0;left:0;background-color:#000}.entry:hover{box-shadow:0 3px 10px #000}.entry:hover:after{height:40px}.entry:hover:before{bottom:2.4em}.entry:hover h2 a{color:#666}.entry h2{text-transform:none;margin-bottom:0;line-height:1.2}.entry h2:after{content:none}.entry h2 a{display:block;text-decoration:none;color:#000;word-wrap:break-word;transition:all .5s ease}img.preview{max-width:calc(100% + 3em);left:-1.5em;position:relative}.entry p{color:#666;font-size:.9em;line-height:1.7;margin-top:5px}.entry h2 a:first-letter{text-transform:uppercase}.entry:hover .tools{bottom:0}.entry .tools{position:absolute;bottom:-50px;left:0;width:100%;z-index:1;padding-right:.5em;text-align:right;transition:all .5s ease}.entry .tools a{color:#666;text-decoration:none;display:block;padding:.4em}.entry .tools a:hover{color:#fff}.entry .tools li{display:inline-block}.entry:nth-child(3n+1){margin-left:0}.results{letter-spacing:-5px;padding:0 0 .5em}.results>*{display:inline-block;vertical-align:top;letter-spacing:normal;width:50%}.results>*,div.pagination ul{text-align:right}.nb-results{text-align:left;font-style:italic;color:#999}div.pagination ul>*{display:inline-block;margin-left:.5em}div.pagination ul a{color:#999;text-decoration:none}div.pagination ul a:focus,div.pagination ul a:hover{text-decoration:underline}div.pagination ul .next.disabled,div.pagination ul .prev.disabled{display:none}div.pagination ul .current{height:25px;padding:4px 8px;border:1px solid #d5d5d5;text-decoration:none;font-weight:700;color:#000;background-color:#ccc}.popup-form{background:rgba(0,0,0,.5);left:10em;height:100%;width:100%;margin:0;margin-top:-30%!important;display:none;border-left:1px solid #eee}.popup-form,.popup-form form{position:absolute;top:0;z-index:5;padding:2em}.popup-form form{background-color:#fff;left:0;border:10px solid #000;width:400px;height:200px}#bagit-form-form .addurl{margin-left:0}.close-button,.closeMessage{background-color:#000;color:#fff;font-size:1.2em;line-height:1.6;width:1.6em;height:1.6em;text-align:center;text-decoration:none}.close-button:focus,.close-button:hover,.closeMessage:focus,.closeMessage:hover{background-color:#999;color:#000}.close-button--popup{display:inline-block;position:absolute;top:0;right:0;font-size:1.4em}.active-current{background-color:#999}.active-current:after{content:"";width:0;height:0;position:absolute;border-style:solid;border-width:10px;border-color:transparent #eee transparent transparent;right:0;top:50%;margin-top:-10px}.opacity03{opacity:.3}.add-to-wallabag-link-after{background-color:#000;color:#fff;padding:0 3px 2px}a.add-to-wallabag-link-after{visibility:hidden;position:absolute;opacity:0;transition-duration:2s;transition-timing-function:ease-out}#article article a:hover+a.add-to-wallabag-link-after,a.add-to-wallabag-link-after:hover{opacity:1;visibility:visible;transition-duration:.3s;transition-timing-function:ease-in}a.add-to-wallabag-link-after:after{content:"w"}#add-link-result{font-weight:700;font-size:.9em}.btn-clickable{cursor:pointer}@font-face{font-family:icomoon;src:url(../fonts/IcoMoon-Free.ttf);font-weight:400;font-style:normal}@font-face{font-family:Material Icons;font-style:normal;font-weight:400;src:url(../fonts/MaterialIcons-Regular.eot);src:local("Material Icons"),local("MaterialIcons-Regular"),url(../fonts/MaterialIcons-Regular.woff2) format("woff2"),url(../fonts/MaterialIcons-Regular.woff) format("woff"),url(../fonts/MaterialIcons-Regular.ttf) format("truetype")}.material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:1em;width:1em;height:1em;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:'liga'}.material-icons.md-18{font-size:18px}.material-icons.md-24{font-size:24px}.material-icons.md-36{font-size:36px}.material-icons.md-48{font-size:48px}.icon-image span,.icon span{position:absolute;top:-9999px}[class*=" icon-"]:before,[class^=icon-]:before{font-family:icomoon;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;letter-spacing:0;-ms-font-feature-settings:"liga" 1;-o-font-feature-settings:"liga";font-feature-settings:"liga";-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-flattr:before{content:"\ead4"}.icon-mail:before{content:"\ea86"}.icon-up-open:before{content:"\e80b"}.icon-star:before{content:"\e9d9"}.icon-check:before{content:"\ea10"}.icon-link:before{content:"\e9cb"}.icon-reply:before{content:"\e806"}.icon-menu:before{content:"\e9bd"}.icon-clock:before{content:"\e803"}.icon-twitter:before{content:"\ea96"}.icon-down-open:before{content:"\e809"}.icon-trash:before{content:"\e9ac"}.icon-delete:before{content:"\ea0d"}.icon-power:before{content:"\ea14"}.icon-arrow-up-thick:before{content:"\ea3a"}.icon-rss:before{content:"\e808"}.icon-print:before{content:"\e954"}.icon-reload:before{content:"\ea2e"}.icon-price-tags:before{content:"\e936"}.icon-eye:before{content:"\e9ce"}.icon-no-eye:before{content:"\e9d1"}.icon-calendar:before{content:"\e953"}.icon-time:before{content:"\e952"}.icon-image{background-size:16px 16px;background-repeat:no-repeat;background-position:50%;padding-right:1em!important;padding-left:1em!important}.icon-image--carrot{background-image:url(../../_global/img/icons/carrot-icon--white.png)}.icon-image--diaspora{background-image:url(../../_global/img/icons/diaspora-icon--black.png)}.icon-image--shaarli{background-image:url(../../_global/img/icons/shaarli.png)}.icon-check.archive:before,.icon-star.fav:before{color:#fff}.messages{text-align:left;margin-top:1em}.messages>*{display:inline-block}.warning{font-weight:700;display:block;width:100%}.more-info{font-size:.85em;line-height:1.5;color:#aaa}.more-info a{color:#aaa}#article{width:70%;margin-bottom:3em;text-align:justify}#article .tags{margin-bottom:1em}#article i{font-style:normal}blockquote{border:1px solid #999;background-color:#fff;padding:1em;margin:0}#article h1{text-align:left}#article h2,#article h3,#article h4{text-transform:none}#article h2:after{content:none}.topPosF{position:fixed;right:20%;bottom:2em;font-size:1.5em}#article_toolbar{margin-bottom:1em}#article_toolbar li{display:inline-block;margin:3px auto}#article_toolbar a{background-color:#000;padding:.3em .5em .2em;color:#fff;text-decoration:none}#article_toolbar a:focus,#article_toolbar a:hover{background-color:#999}#nav-btn-add-tag{cursor:pointer}.shaarli:before{content:"*"}.return{text-decoration:none;margin-top:1em;display:block}.return:before{margin-right:.5em}.notags{font-style:italic;color:#999}.icon-rss{background-color:#000;color:#fff;padding:.2em .5em}.icon-rss:before{position:relative;top:2px}.list-tags li{margin-bottom:.5em}.list-tags .icon-rss:focus,.list-tags .icon-rss:hover{background-color:#fff;color:#000;text-decoration:none}.list-tags a{text-decoration:none}.list-tags a:focus,.list-tags a:hover{text-decoration:underline}pre code{font-family:Courier New,Courier,monospace}#filters{position:fixed;width:20%;height:100%;top:0;right:0;background-color:#fff;padding:15px;padding-right:30px;padding-top:30px;border-left:1px solid #333;z-index:3;min-width:300px}#filters form .filter-group{margin:5px}#download-form{position:fixed;width:10%;height:100%;top:0;right:0;background-color:#fff;padding:15px;padding-right:30px;padding-top:30px;border-left:1px solid #333;z-index:3;min-width:200px}#download-form li{display:block;padding:.5em 2em .5em 1em;color:#fff;position:relative;text-transform:uppercase;text-decoration:none;font-weight:400;font-family:PT Sans,sans-serif;transition:all .5s ease}@media screen and (max-width:1050px){.entry{width:49%}.entry:nth-child(3n+1){margin-left:1.5%}.entry:nth-child(2n+1){margin-left:0}}@media screen and (max-width:900px){#article{width:80%}.topPosF{right:2.5em}}@media screen and (max-width:700px){.entry{width:100%;margin-left:0}#display-mode{display:none}}@media screen and (max-height:770px){.menu.developer,.menu.internal,.menu.users{display:none}}@media screen and (max-width:500px){.entry{width:100%;margin-left:0}body>header{background-color:#333;position:fixed;top:0;width:100%;height:3em;z-index:2}#links li:last-child{position:static;width:auto}#links li:last-child a:before{content:none}.logo{width:1.25em;height:1.25em;left:0;top:0}.login>header,.login form{position:static}.login form{width:100%;margin-left:0}.login .logo{height:auto;top:.5em;width:75px;margin-left:-37.5px}.desktopHide{display:block;position:fixed;z-index:5;top:0;right:0;border:0;width:2.5em;height:2.5em;cursor:pointer;background-color:#999;font-size:1.2em}.desktopHide:focus,.desktopHide:hover{background-color:#fff}#links{display:none;width:100%;height:auto;padding-top:3em}#links.menu--open{display:block}footer{margin-right:3em}#main,footer{position:static}#main{margin-left:1.5em;padding-right:1.5em;margin-top:3em}#article_toolbar .topPosF,.card-entry-labels{display:none}#article{width:100%}#article h1{font-size:1.5em}#article_toolbar a{padding:.3em .4em .2em}#display-mode{display:none}#bagit-form,#search-form,.popup-form{left:0;width:100%;border-left:none}#bagit-form form,#search-form form,.popup-form form{width:100%}};.messages.error.install{border:1px solid #c42608;color:#c00!important;background:#fff0ef;text-align:left}.messages.notice.install{border:1px solid #ebcd41;color:#000;background:#fffcd3;text-align:left}.messages.success.install{border:1px solid #6dc70c;background:#e0fbcc!important;text-align:left};@media print{body{font-family:Serif;background-color:#fff}@page{margin:1cm}img{max-width:100%!important}#article-informations,#article .mbm a,#article_toolbar,#links,#sort,.entrie+.results,.messages,.top_link,body>footer,body>header,div.tools,header div{display:none!important}article{border:none!important}.vieworiginal a:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}.pagination span.current{border-style:dashed}#main{padding:0;margin:0;margin-left:0;padding-right:0;padding-bottom:0}#article,#main{width:100%}}*{box-sizing:border-box}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{font-size:1em;line-height:1.5;margin:0}dl:first-child,h1:first-child,h2:first-child,h3:first-child,h4:first-child,h5:first-child,h6:first-child,ol:first-child,p:first-child,ul:first-child{margin-top:0}code,kbd,pre,samp{font-family:monospace,serif}pre{white-space:pre-wrap}.upper{text-transform:uppercase}.bold{font-weight:700}.inner{margin:0 auto;max-width:61.25em}figure,img,table{max-width:100%;height:auto}iframe{max-width:100%}.fl{float:left}.fr{float:right}table{border-collapse:collapse}figure{margin:0}button,input,select,textarea{font-family:inherit;font-size:100%;margin:0}input[type=search]{-webkit-appearance:textfield}.dib{display:inline-block;vertical-align:middle}.dnone{display:none}.dtable{display:table}.dtable>*{display:table-row}.dtable>*>*{display:table-cell}.element-invisible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.small{font-size:.8em}.big{font-size:1.2em}.w100{width:100%}.w90{width:90%}.w80{width:80%}.w70{width:70%}.w60{width:60%}.w50{width:50%}.w40{width:40%}.w30{width:30%}.w20{width:20%}.w10{width:10%}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block}@media screen and (-webkit-min-device-pixel-ratio:0){select{-webkit-appearance:none;border-radius:0}} \ No newline at end of file +@font-face{font-family:PT Sans;font-style:normal;font-weight:700;src:local("PT Sans Bold"),local("PTSans-Bold"),url(../fonts/ptsansbold.woff) format("woff")}html{min-height:100%}body{background-color:#eee}.login{background-color:#333}.login #main{padding:0;margin:0}.login form{background-color:#fff;padding:1.5em;box-shadow:0 1px 8px rgba(0,0,0,.9);width:20em;top:8em;margin-left:-10em}.login .logo,.login form{position:absolute;left:50%}.login .logo{top:2em;margin-left:-55px}::-moz-selection{color:#fff;background-color:#000}::selection{color:#fff;background-color:#000}.desktopHide{display:none}.logo{position:fixed;z-index:5;top:.4em;left:.6em}h2,h3,h4{font-family:PT Sans,sans-serif;text-transform:uppercase}label,li,p{color:#666}a{color:#000;font-weight:700}a.nostyle,a:focus,a:hover{text-decoration:none}form fieldset{border:0;padding:0;margin:0}form input[type=email],form input[type=number],form input[type=password],form input[type=text],form input[type=url],select{border:1px solid #999;padding:.5em 1em;min-width:12em;color:#666}@media screen and (-webkit-min-device-pixel-ratio:0){select{-webkit-appearance:none;border-radius:0;background:#fff url(../../_global/img/bg-select.png) no-repeat 100%}}.inline .row{display:inline-block;margin-right:.5em}.inline label{min-width:6em}fieldset label{display:inline-block;min-width:12.5em;color:#666}label{margin-right:.5em}form .row{margin-bottom:.5em}form button,input[type=submit]{cursor:pointer;background-color:#000;color:#fff;padding:.5em 1em;display:inline-block;border:1px solid #000}form button:focus,form button:hover,input[type=submit]:focus,input[type=submit]:hover{background-color:#fff;color:#000;transition:all .5s ease}#bookmarklet{cursor:move}h2:after{content:"";height:4px;width:70px;background-color:#000;display:block}.links,.links li{padding:0;margin:0}.links li{list-style:none}#links{position:fixed;top:0;width:10em;left:0;text-align:right;background-color:#333;padding-top:9.5em;height:100%;box-shadow:inset -4px 0 20px rgba(0,0,0,.6);z-index:4}#main{margin-left:12em;position:relative;z-index:1;padding-right:5%;padding-bottom:1em}#links>li>a{display:block;padding:.5em 2em .5em 1em;color:#fff;position:relative;text-transform:uppercase;text-decoration:none;font-weight:400;font-family:PT Sans,sans-serif;transition:all .5s ease}#links>li>a:focus,#links>li>a:hover{background-color:#999;color:#000}#links .current:after{content:"";width:0;height:0;position:absolute;border-style:solid;border-width:10px;border-color:transparent #eee transparent transparent;right:0;top:50%;margin-top:-10px}#links li:last-child{position:fixed;bottom:1em;width:10em}#links li:last-child a:before{font-size:1.2em;position:relative;top:2px}#sort{padding:0;list-style-type:none;opacity:.5;display:inline-block}#sort li{display:inline;font-size:.9em}#sort li+li{margin-left:10px}#sort a{padding:2px 2px 0;vertical-align:middle}#sort img{vertical-align:baseline}#sort img:hover{cursor:pointer}#display-mode{float:right;margin-top:10px;margin-bottom:10px;opacity:.5}#listmode{width:16px;display:inline-block;text-decoration:none}#listmode a:hover{opacity:1}#listmode.tablemode{background-image:url(../img/baggy/table.png)}#listmode.listmode,#listmode.tablemode{background-repeat:no-repeat;background-position:bottom}#listmode.listmode{background-image:url(../img/baggy/list.png)}#warning_message{position:fixed;background-color:tomato;z-index:7;bottom:0;left:0;width:100%;color:#000}#content{margin-top:2em;min-height:30em}footer{text-align:right;position:relative;bottom:0;right:5em;color:#999;font-size:.8em;font-style:italic;z-index:5}footer a{color:#999;font-weight:400}.list-entries{letter-spacing:-5px}.listmode .entry{width:100%!important;margin-left:0!important}.card-entry-labels{position:absolute;top:100px;left:-1em;z-index:6;max-width:50%;padding-left:0}.card-entry-labels li{margin:10px 10px 10px auto;padding:5px 12px 5px 25px;background-color:rgba(0,0,0,.6);border-radius:0 3px 3px 0;color:#fff;cursor:default;max-height:2em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.card-entry-tags{max-height:2em;overflow-y:hidden;padding:0;margin:0}.card-entry-tags li,.card-entry-tags span{display:inline-block;margin:0 5px;padding:5px 12px;background-color:rgba(0,0,0,.6);border-radius:3px;max-height:2em;overflow:hidden;text-overflow:ellipsis}.card-entry-labels a,.card-entry-tags a{text-decoration:none;font-weight:400;color:#fff}.nav-panel-add-tag{margin-top:10px}.list-entries+.results{margin-bottom:2em}.created-at,.reading-time{color:#999;font-style:italic;font-weight:400;font-size:.9em}.estimatedTime small{position:relative;top:-1px}.entry{background-color:#fff;letter-spacing:normal;box-shadow:0 3px 7px rgba(0,0,0,.3);display:inline-block;width:32%;margin-bottom:1.5em;vertical-align:top;margin-right:1%;position:relative;overflow:hidden;padding:1.5em 1.5em 3em;height:440px}.entry:before{width:0;height:0;border-style:solid;border-color:transparent transparent #000;border-width:10px;bottom:.3em;z-index:1;right:1.5em}.entry:after,.entry:before{content:"";position:absolute;transition:all .5s ease}.entry:after{height:7px;width:100%;bottom:0;left:0;background-color:#000}.entry:hover{box-shadow:0 3px 10px #000}.entry:hover:after{height:40px}.entry:hover:before{bottom:2.4em}.entry:hover h2 a{color:#666}.entry h2{text-transform:none;margin-bottom:0;line-height:1.2}.entry h2:after{content:none}.entry h2 a{display:block;text-decoration:none;color:#000;word-wrap:break-word;transition:all .5s ease}img.preview{max-width:calc(100% + 3em);left:-1.5em;position:relative}.entry p{color:#666;font-size:.9em;line-height:1.7;margin-top:5px}.entry h2 a:first-letter{text-transform:uppercase}.entry:hover .tools{bottom:0}.entry .tools{position:absolute;bottom:-50px;left:0;width:100%;z-index:1;padding-right:.5em;text-align:right;transition:all .5s ease}.entry .tools a{color:#666;text-decoration:none;display:block;padding:.4em}.entry .tools a:hover{color:#fff}.entry .tools li{display:inline-block}.entry:nth-child(3n+1){margin-left:0}.results{letter-spacing:-5px;padding:0 0 .5em}.results>*{display:inline-block;vertical-align:top;letter-spacing:normal;width:50%}.results>*,div.pagination ul{text-align:right}.nb-results{text-align:left;font-style:italic;color:#999}div.pagination ul>*{display:inline-block;margin-left:.5em}div.pagination ul a{color:#999;text-decoration:none}div.pagination ul a:focus,div.pagination ul a:hover{text-decoration:underline}div.pagination ul .next.disabled,div.pagination ul .prev.disabled{display:none}div.pagination ul .current{height:25px;padding:4px 8px;border:1px solid #d5d5d5;text-decoration:none;font-weight:700;color:#000;background-color:#ccc}.popup-form{background:rgba(0,0,0,.5);left:10em;height:100%;width:100%;margin:0;margin-top:-30%!important;display:none;border-left:1px solid #eee}.popup-form,.popup-form form{position:absolute;top:0;z-index:5;padding:2em}.popup-form form{background-color:#fff;left:0;border:10px solid #000;width:400px;height:200px}#bagit-form-form .addurl{margin-left:0}.close-button,.closeMessage{background-color:#000;color:#fff;font-size:1.2em;line-height:1.6;width:1.6em;height:1.6em;text-align:center;text-decoration:none}.close-button:focus,.close-button:hover,.closeMessage:focus,.closeMessage:hover{background-color:#999;color:#000}.close-button--popup{display:inline-block;position:absolute;top:0;right:0;font-size:1.4em}.active-current{background-color:#999}.active-current:after{content:"";width:0;height:0;position:absolute;border-style:solid;border-width:10px;border-color:transparent #eee transparent transparent;right:0;top:50%;margin-top:-10px}.opacity03{opacity:.3}.add-to-wallabag-link-after{background-color:#000;color:#fff;padding:0 3px 2px}a.add-to-wallabag-link-after{visibility:hidden;position:absolute;opacity:0;transition-duration:2s;transition-timing-function:ease-out}#article article a:hover+a.add-to-wallabag-link-after,a.add-to-wallabag-link-after:hover{opacity:1;visibility:visible;transition-duration:.3s;transition-timing-function:ease-in}a.add-to-wallabag-link-after:after{content:"w"}#add-link-result{font-weight:700;font-size:.9em}.btn-clickable{cursor:pointer}@font-face{font-family:icomoon;src:url(../fonts/IcoMoon-Free.ttf);font-weight:400;font-style:normal}@font-face{font-family:Material Icons;font-style:normal;font-weight:400;src:url(../fonts/MaterialIcons-Regular.eot);src:local("Material Icons"),local("MaterialIcons-Regular"),url(../fonts/MaterialIcons-Regular.woff2) format("woff2"),url(../fonts/MaterialIcons-Regular.woff) format("woff"),url(../fonts/MaterialIcons-Regular.ttf) format("truetype")}.material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:1em;width:1em;height:1em;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:'liga'}.material-icons.md-18{font-size:18px}.material-icons.md-24{font-size:24px}.material-icons.md-36{font-size:36px}.material-icons.md-48{font-size:48px}.icon-image span,.icon span{position:absolute;top:-9999px}[class*=" icon-"]:before,[class^=icon-]:before{font-family:icomoon;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;letter-spacing:0;-ms-font-feature-settings:"liga" 1;-o-font-feature-settings:"liga";font-feature-settings:"liga";-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-flattr:before{content:"\ead4"}.icon-mail:before{content:"\ea86"}.icon-up-open:before{content:"\e80b"}.icon-star:before{content:"\e9d9"}.icon-check:before{content:"\ea10"}.icon-link:before{content:"\e9cb"}.icon-reply:before{content:"\e806"}.icon-menu:before{content:"\e9bd"}.icon-clock:before{content:"\e803"}.icon-twitter:before{content:"\ea96"}.icon-down-open:before{content:"\e809"}.icon-trash:before{content:"\e9ac"}.icon-delete:before{content:"\ea0d"}.icon-power:before{content:"\ea14"}.icon-arrow-up-thick:before{content:"\ea3a"}.icon-rss:before{content:"\e808"}.icon-print:before{content:"\e954"}.icon-reload:before{content:"\ea2e"}.icon-price-tags:before{content:"\e936"}.icon-eye:before{content:"\e9ce"}.icon-no-eye:before{content:"\e9d1"}.icon-calendar:before{content:"\e953"}.icon-time:before{content:"\e952"}.icon-image{background-size:16px 16px;background-repeat:no-repeat;background-position:50%;padding-right:1em!important;padding-left:1em!important}.icon-image--carrot{background-image:url(../../_global/img/icons/carrot-icon--white.png)}.icon-image--diaspora{background-image:url(../../_global/img/icons/diaspora-icon--black.png)}.icon-image--unmark{background-image:url(../../_global/img/icons/unmark-icon--black.png)}.icon-image--shaarli{background-image:url(../../_global/img/icons/shaarli.png)}.icon-check.archive:before,.icon-star.fav:before{color:#fff}.messages{text-align:left;margin-top:1em}.messages>*{display:inline-block}.warning{font-weight:700;display:block;width:100%}.more-info{font-size:.85em;line-height:1.5;color:#aaa}.more-info a{color:#aaa}#article{width:70%;margin-bottom:3em;text-align:justify}#article .tags{margin-bottom:1em}#article i{font-style:normal}blockquote{border:1px solid #999;background-color:#fff;padding:1em;margin:0}#article h1{text-align:left}#article h2,#article h3,#article h4{text-transform:none}#article h2:after{content:none}.topPosF{position:fixed;right:20%;bottom:2em;font-size:1.5em}#article_toolbar{margin-bottom:1em}#article_toolbar li{display:inline-block;margin:3px auto}#article_toolbar a{background-color:#000;padding:.3em .5em .2em;color:#fff;text-decoration:none}#article_toolbar a:focus,#article_toolbar a:hover{background-color:#999}#nav-btn-add-tag{cursor:pointer}.shaarli:before{content:"*"}.return{text-decoration:none;margin-top:1em;display:block}.return:before{margin-right:.5em}.notags{font-style:italic;color:#999}.icon-rss{background-color:#000;color:#fff;padding:.2em .5em}.icon-rss:before{position:relative;top:2px}.list-tags li{margin-bottom:.5em}.list-tags .icon-rss:focus,.list-tags .icon-rss:hover{background-color:#fff;color:#000;text-decoration:none}.list-tags a{text-decoration:none}.list-tags a:focus,.list-tags a:hover{text-decoration:underline}pre code{font-family:Courier New,Courier,monospace}#filters{position:fixed;width:20%;height:100%;top:0;right:0;background-color:#fff;padding:15px;padding-right:30px;padding-top:30px;border-left:1px solid #333;z-index:3;min-width:300px}#filters form .filter-group{margin:5px}#download-form{position:fixed;width:10%;height:100%;top:0;right:0;background-color:#fff;padding:15px;padding-right:30px;padding-top:30px;border-left:1px solid #333;z-index:3;min-width:200px}#download-form li{display:block;padding:.5em 2em .5em 1em;color:#fff;position:relative;text-transform:uppercase;text-decoration:none;font-weight:400;font-family:PT Sans,sans-serif;transition:all .5s ease}@media screen and (max-width:1050px){.entry{width:49%}.entry:nth-child(3n+1){margin-left:1.5%}.entry:nth-child(2n+1){margin-left:0}}@media screen and (max-width:900px){#article{width:80%}.topPosF{right:2.5em}}@media screen and (max-width:700px){.entry{width:100%;margin-left:0}#display-mode{display:none}}@media screen and (max-height:770px){.menu.developer,.menu.internal,.menu.users{display:none}}@media screen and (max-width:500px){.entry{width:100%;margin-left:0}body>header{background-color:#333;position:fixed;top:0;width:100%;height:3em;z-index:2}#links li:last-child{position:static;width:auto}#links li:last-child a:before{content:none}.logo{width:1.25em;height:1.25em;left:0;top:0}.login>header,.login form{position:static}.login form{width:100%;margin-left:0}.login .logo{height:auto;top:.5em;width:75px;margin-left:-37.5px}.desktopHide{display:block;position:fixed;z-index:5;top:0;right:0;border:0;width:2.5em;height:2.5em;cursor:pointer;background-color:#999;font-size:1.2em}.desktopHide:focus,.desktopHide:hover{background-color:#fff}#links{display:none;width:100%;height:auto;padding-top:3em}#links.menu--open{display:block}footer{margin-right:3em}#main,footer{position:static}#main{margin-left:1.5em;padding-right:1.5em;margin-top:3em}#article_toolbar .topPosF,.card-entry-labels{display:none}#article{width:100%}#article h1{font-size:1.5em}#article_toolbar a{padding:.3em .4em .2em}#display-mode{display:none}#bagit-form,#search-form,.popup-form{left:0;width:100%;border-left:none}#bagit-form form,#search-form form,.popup-form form{width:100%}}.messages.error.install{border:1px solid #c42608;color:#c00!important;background:#fff0ef;text-align:left}.messages.notice.install{border:1px solid #ebcd41;color:#000;background:#fffcd3;text-align:left}.messages.success.install{border:1px solid #6dc70c;background:#e0fbcc!important;text-align:left}@media print{body{font-family:Serif;background-color:#fff}@page{margin:1cm}img{max-width:100%!important}#article-informations,#article .mbm a,#article_toolbar,#links,#sort,.entrie+.results,.messages,.top_link,body>footer,body>header,div.tools,header div{display:none!important}article{border:none!important}.vieworiginal a:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}.pagination span.current{border-style:dashed}#main{padding:0;margin:0;margin-left:0;padding-right:0;padding-bottom:0}#article,#main{width:100%}}*{box-sizing:border-box}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{font-size:1em;line-height:1.5;margin:0}dl:first-child,h1:first-child,h2:first-child,h3:first-child,h4:first-child,h5:first-child,h6:first-child,ol:first-child,p:first-child,ul:first-child{margin-top:0}code,kbd,pre,samp{font-family:monospace,serif}pre{white-space:pre-wrap}.upper{text-transform:uppercase}.bold{font-weight:700}.inner{margin:0 auto;max-width:61.25em}figure,img,table{max-width:100%;height:auto}iframe{max-width:100%}.fl{float:left}.fr{float:right}table{border-collapse:collapse}figure{margin:0}button,input,select,textarea{font-family:inherit;font-size:100%;margin:0}input[type=search]{-webkit-appearance:textfield}.dib{display:inline-block;vertical-align:middle}.dnone{display:none}.dtable{display:table}.dtable>*{display:table-row}.dtable>*>*{display:table-cell}.element-invisible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.small{font-size:.8em}.big{font-size:1.2em}.w100{width:100%}.w90{width:90%}.w80{width:80%}.w70{width:70%}.w60{width:60%}.w50{width:50%}.w40{width:40%}.w30{width:30%}.w20{width:20%}.w10{width:10%}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block}@media screen and (-webkit-min-device-pixel-ratio:0){select{-webkit-appearance:none;border-radius:0}} \ No newline at end of file diff --git a/web/bundles/wallabagcore/themes/baggy/js/baggy.min.js b/web/bundles/wallabagcore/themes/baggy/js/baggy.min.js index a0a2ef11..5145f02b 100644 --- a/web/bundles/wallabagcore/themes/baggy/js/baggy.min.js +++ b/web/bundles/wallabagcore/themes/baggy/js/baggy.min.js @@ -1,19 +1,20 @@ -!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g li > a").removeClass("active-current"),e("#links > li > a").removeClass("current"),e("[id$=-arrow]").removeClass("arrow-down"),e("#content").removeClass("opacity03")}var j=e("#listmode"),k=e("#list-entries");e("#menu").click(function(){e("#links").toggleClass("menu--open");var a=e("#content");a.hasClass("opacity03")&&a.removeClass("opacity03")}),j.click(function(){1===e.cookie("listmode")?(e.removeCookie("listmode"),k.removeClass("listmode"),j.removeClass("tablemode"),j.addClass("listmode")):(e.cookie("listmode",1,{expires:365}),k.addClass("listmode"),j.removeClass("listmode"),j.addClass("tablemode"))}),1===e.cookie("listmode")&&(k.addClass("listmode"),j.removeClass("listmode"),j.addClass("tablemode")),e("#nav-btn-add-tag").on("click",function(){return e(".nav-panel-add-tag").toggle(100),e(".nav-panel-menu").addClass("hidden"),e("#tag_label").focus(),!1}),e("div").is("#filters")&&(e("#button_filters").show(),e("#clear_form_filters").on("click",function(){return e("#filters input").val(""),e("#filters :checked").removeAttr("checked"),!1})),e("article").length&&!function(){var a=new f.App;a.include(f.ui.main,{element:document.querySelector("article")});var b=JSON.parse(e("#annotationroutes").html());a.include(f.storage.http,b),a.start().then(function(){a.annotations.load({entry:b.entryId})}),e(window).scroll(function(){var a=e(window).scrollTop(),d=e(document).height(),f=a/d,g=Math.round(100*f)/100;(0,c.savePercent)(b.entryId,g)}),(0,c.retrievePercent)(b.entryId),e(window).resize(function(){(0,c.retrievePercent)(b.entryId)})}();var l=window.location.href;l.match("&closewin=true")&&window.close(),e("a.closeMessage").on("click",function(){return e(void 0).parents("div.messages").slideUp(300,function(){e(void 0).remove()}),!1}),e("#search-form").hide(),e("#bagit-form").hide(),e("#filters").hide(),e("#download-form").hide(),e("#search").click(function(){i(),a(),e("#searchfield").focus()}),e(".filter-btn").click(function(){i(),b()}),e(".download-btn").click(function(){i(),g()}),e("#bagit").click(function(){i(),h(),e("#plainurl").focus()}),e("#search-form-close").click(function(){a()}),e("#filter-form-close").click(function(){b()}),e("#download-form-close").click(function(){g()}),e("#bagit-form-close").click(function(){h()});var m=e("#bagit-form-form");m.submit(function(a){e("body").css("cursor","wait"),e("#add-link-result").empty(),e.ajax({type:m.attr("method"),url:m.attr("action"),data:m.serialize(),success:function(){e("#add-link-result").html("Done!"),e("#plainurl").val(""),e("#plainurl").blur(""),e("body").css("cursor","auto")},error:function(){e("#add-link-result").html("Failed!"),e("body").css("cursor","auto")}}),a.preventDefault()}),e('article a[href^="http"]').after(function(){return''}),e(".add-to-wallabag-link-after").click(function(a){(0,d.toggleSaveLinkForm)(e(void 0).attr("href"),a),a.preventDefault()})})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../_global/js/tools":1,"./uiTools":3,annotator:4,jquery:31,"jquery-ui-browserify":29,"jquery.cookie":30}],3:[function(a,b,c){"use strict";function d(a,b){e("#add-link-result").empty();var c=e("#bagit"),d=e("#bagit-form");c.toggleClass("active-current"),0===c.length&&("undefined"!==b&&b?d.css({position:"absolute",top:b.pageY,left:b.pageX-200}):d.css({position:"relative",top:"auto",left:"auto"}));var f=e("#search-form"),g=e("#plainurl");0!==f.length&&(e("#search").removeClass("current"),e("#search-arrow").removeClass("arrow-down"),f.hide()),d.toggle(),e("#content").toggleClass("opacity03"),"undefined"!==a&&a&&g.val(a),g.focus()}Object.defineProperty(c,"__esModule",{value:!0});var e=a("jquery");c.toggleSaveLinkForm=d},{jquery:31}],4:[function(a,b,c){(function(b){"use strict";var d=a("insert-css"),e=a("./css/annotator.css");d(e);var f=a("./src/app"),g=a("./src/util");c.App=f.App,c.authz=a("./src/authz"),c.identity=a("./src/identity"),c.notification=a("./src/notification"),c.storage=a("./src/storage"),c.ui=a("./src/ui"),c.util=g,c.ext={};var h=b.wgxpath;"undefined"!=typeof h&&null!==h&&"function"==typeof h.install&&h.install();var i=b.annotator;c.noConflict=function(){return b.annotator=i,this}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./css/annotator.css":5,"./src/app":7,"./src/authz":8,"./src/identity":9,"./src/notification":10,"./src/storage":12,"./src/ui":13,"./src/util":24,"insert-css":27}],5:[function(a,b,c){b.exports='.annotator-filter *,.annotator-notice,.annotator-widget *{font-family:"Helvetica Neue",Arial,Helvetica,sans-serif;font-weight:400;text-align:left;margin:0;padding:0;background:0 0;-webkit-transition:none;-moz-transition:none;-o-transition:none;transition:none;-moz-box-shadow:none;-webkit-box-shadow:none;-o-box-shadow:none;box-shadow:none;color:#909090}.annotator-adder{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAAAwCAYAAAD+WvNWAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb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4srdk33tjELM9m+l1A/INTM+45/7rr+1aiPz0olsuYz4+RNkM/7XoO++35m+l3AfG/PHCuJrQ+yM4QtL3JsV1H16xZs4IKh32eyf7ihks8b8lUr2Q6iVwwHVwC4r96fgfll1brMnX6MCqe3VQ8//LJPzg13etc4n3hX3dt3woumY5/F2SGwoB9joLNWdf2+eR/edCPAxp/fQd0SJ4ttFkMY4KxWCx5Op0u4pNPPlkvi/YV4ZcvX04IuWd/DNAnPxOMYG/J4zg+4lrhFz75B495geAB4s+6+vVbln72PB3l33ztgE/+ZYOfCJie8/GX6v06h8wnyzMDveu9/CqRp4vtxBNM43/5y1/ueMO5I/gl8QRRLp/NfiD4mXiC2oq6U3rXxBOFVUzmY1tcr/Lq6CjxdERxTfwd8Qcrno4orom/I/5gxdMhAlIQkXwF064CLzwI4lERUUD891M8KiIKiP9OxNNhAvISEVFZDpevaJIHRTwKIvKb/0EQj4KI/Oa/U/F0qIA03JnS+wdKPD7cmSL/gyQeH+5Mkb8jxHOnWZiWiOTBLVH6/kEtbmHIglui9P2DWtzCWH3534r8HSUcd/l/AQYA7PGYKl3+RK0AAAAASUVORK5CYII=);background-repeat:no-repeat}.annotator-editor a:after,.annotator-filter .annotator-filter-navigation button:after,.annotator-filter .annotator-filter-property .annotator-filter-clear,.annotator-resize,.annotator-viewer .annotator-controls a,.annotator-viewer .annotator-controls button,.annotator-widget:after{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAEiCAYAAAD0w4JOAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzN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A;background:rgba(255,255,10,.3);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#4DFFFF0A, endColorstr=#4DFFFF0A)"}.annotator-hl-temporary{background:#007CFF;background:rgba(0,124,255,.3);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#4D007CFF, endColorstr=#4D007CFF)"}.annotator-wrapper{position:relative}.annotator-adder,.annotator-notice,.annotator-outer{z-index:1020}.annotator-adder,.annotator-notice,.annotator-outer,.annotator-widget{position:absolute;font-size:10px;line-height:1}.annotator-hide{display:none;visibility:hidden}.annotator-adder{margin-top:-48px;margin-left:-24px;width:48px;height:48px;background-position:left top}.annotator-adder:hover{background-position:center top}.annotator-adder:active{background-position:center right}.annotator-adder button{display:block;width:36px;height:41px;margin:0 auto;border:none;background:0 0;text-indent:-999em;cursor:pointer}.annotator-outer{width:0;height:0}.annotator-widget{margin:0;padding:0;bottom:15px;left:-18px;min-width:265px;background-color:#FBFBFB;background-color:rgba(251,251,251,.98);border:1px solid #7A7A7A;border:1px solid rgba(122,122,122,.6);-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;-webkit-box-shadow:0 5px 15px rgba(0,0,0,.2);-moz-box-shadow:0 5px 15px rgba(0,0,0,.2);-o-box-shadow:0 5px 15px rgba(0,0,0,.2);box-shadow:0 5px 15px rgba(0,0,0,.2)}.annotator-invert-x .annotator-widget{left:auto;right:-18px}.annotator-invert-y .annotator-widget{bottom:auto;top:8px}.annotator-widget strong{font-weight:700}.annotator-widget .annotator-item,.annotator-widget .annotator-listing{padding:0;margin:0;list-style:none}.annotator-widget:after{content:"";display:block;width:18px;height:10px;background-position:0 0;position:absolute;bottom:-10px;left:8px}.annotator-invert-x .annotator-widget:after{left:auto;right:8px}.annotator-invert-y .annotator-widget:after{background-position:0 -15px;bottom:auto;top:-9px}.annotator-editor .annotator-item input,.annotator-editor .annotator-item textarea,.annotator-widget .annotator-item{position:relative;font-size:12px}.annotator-viewer .annotator-item{border-top:2px solid #7A7A7A;border-top:2px solid rgba(122,122,122,.2)}.annotator-widget .annotator-item:first-child{border-top:none}.annotator-editor .annotator-item,.annotator-viewer div{border-top:1px solid #858585;border-top:1px solid rgba(133,133,133,.11)}.annotator-viewer div{padding:6px}.annotator-viewer .annotator-item ol,.annotator-viewer .annotator-item ul{padding:4px 16px}.annotator-editor .annotator-item:first-child textarea,.annotator-viewer div:first-of-type{padding-top:12px;padding-bottom:12px;color:#3c3c3c;font-size:13px;font-style:italic;line-height:1.3;border-top:none}.annotator-viewer .annotator-controls{position:relative;top:5px;right:5px;padding-left:5px;opacity:0;-webkit-transition:opacity .2s ease-in;-moz-transition:opacity .2s ease-in;-o-transition:opacity .2s ease-in;transition:opacity .2s ease-in;float:right}.annotator-viewer li .annotator-controls.annotator-visible,.annotator-viewer li:hover .annotator-controls{opacity:1}.annotator-viewer .annotator-controls a,.annotator-viewer .annotator-controls button{cursor:pointer;display:inline-block;width:13px;height:13px;margin-left:2px;border:none;opacity:.2;text-indent:-900em;background-color:transparent;outline:0}.annotator-viewer .annotator-controls a:focus,.annotator-viewer .annotator-controls a:hover,.annotator-viewer .annotator-controls button:focus,.annotator-viewer .annotator-controls button:hover{opacity:.9}.annotator-viewer .annotator-controls a:active,.annotator-viewer .annotator-controls button:active{opacity:1}.annotator-viewer .annotator-controls button[disabled]{display:none}.annotator-viewer .annotator-controls .annotator-edit{background-position:0 -60px}.annotator-viewer .annotator-controls .annotator-delete{background-position:0 -75px}.annotator-viewer .annotator-controls .annotator-link{background-position:0 -270px}.annotator-editor .annotator-item{position:relative}.annotator-editor .annotator-item label{top:0;display:inline;cursor:pointer;font-size:12px}.annotator-editor .annotator-item input,.annotator-editor .annotator-item textarea{display:block;min-width:100%;padding:10px 8px;border:none;margin:0;color:#3c3c3c;background:0 0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box;resize:none}.annotator-editor .annotator-item textarea::-webkit-scrollbar{height:8px;width:8px}.annotator-editor .annotator-item textarea::-webkit-scrollbar-track-piece{margin:13px 0 3px;background-color:#e5e5e5;-webkit-border-radius:4px}.annotator-editor .annotator-item textarea::-webkit-scrollbar-thumb:vertical{height:25px;background-color:#ccc;-webkit-border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.1)}.annotator-editor .annotator-item textarea::-webkit-scrollbar-thumb:horizontal{width:25px;background-color:#ccc;-webkit-border-radius:4px}.annotator-editor .annotator-item:first-child textarea{min-height:5.5em;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;-o-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.annotator-editor .annotator-item input:focus,.annotator-editor .annotator-item textarea:focus{background-color:#f3f3f3;outline:0}.annotator-editor .annotator-item input[type=checkbox],.annotator-editor .annotator-item input[type=radio]{width:auto;min-width:0;padding:0;display:inline;margin:0 4px 0 0;cursor:pointer}.annotator-editor .annotator-checkbox{padding:8px 6px}.annotator-editor .annotator-controls,.annotator-filter,.annotator-filter .annotator-filter-navigation button{text-align:right;padding:3px;border-top:1px solid #d4d4d4;background-color:#d4d4d4;background-image:-webkit-gradient(linear,left top,left bottom,from(#f5f5f5),color-stop(.6,#dcdcdc),to(#d2d2d2));background-image:-moz-linear-gradient(to bottom,#f5f5f5,#dcdcdc 60%,#d2d2d2);background-image:-webkit-linear-gradient(to bottom,#f5f5f5,#dcdcdc 60%,#d2d2d2);background-image:linear-gradient(to bottom,#f5f5f5,#dcdcdc 60%,#d2d2d2);-webkit-box-shadow:inset 1px 0 0 rgba(255,255,255,.7),inset -1px 0 0 rgba(255,255,255,.7),inset 0 1px 0 rgba(255,255,255,.7);-moz-box-shadow:inset 1px 0 0 rgba(255,255,255,.7),inset -1px 0 0 rgba(255,255,255,.7),inset 0 1px 0 rgba(255,255,255,.7);-o-box-shadow:inset 1px 0 0 rgba(255,255,255,.7),inset -1px 0 0 rgba(255,255,255,.7),inset 0 1px 0 rgba(255,255,255,.7);box-shadow:inset 1px 0 0 rgba(255,255,255,.7),inset -1px 0 0 rgba(255,255,255,.7),inset 0 1px 0 rgba(255,255,255,.7);-webkit-border-radius:0 0 5px 5px;-moz-border-radius:0 0 5px 5px;-o-border-radius:0 0 5px 5px;border-radius:0 0 5px 5px}.annotator-editor.annotator-invert-y .annotator-controls{border-top:none;border-bottom:1px solid #b4b4b4;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;-o-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.annotator-editor a,.annotator-filter .annotator-filter-property label{position:relative;display:inline-block;padding:0 6px 0 22px;color:#363636;text-shadow:0 1px 0 rgba(255,255,255,.75);text-decoration:none;line-height:24px;font-size:12px;font-weight:700;border:1px solid #a2a2a2;background-color:#d4d4d4;background-image:-webkit-gradient(linear,left top,left bottom,from(#f5f5f5),color-stop(.5,#d2d2d2),color-stop(.5,#bebebe),to(#d2d2d2));background-image:-moz-linear-gradient(to bottom,#f5f5f5,#d2d2d2 50%,#bebebe 50%,#d2d2d2);background-image:-webkit-linear-gradient(to bottom,#f5f5f5,#d2d2d2 50%,#bebebe 50%,#d2d2d2);background-image:linear-gradient(to bottom,#f5f5f5,#d2d2d2 50%,#bebebe 50%,#d2d2d2);-webkit-box-shadow:inset 0 0 5px rgba(255,255,255,.2),inset 0 0 1px rgba(255,255,255,.8);-moz-box-shadow:inset 0 0 5px rgba(255,255,255,.2),inset 0 0 1px rgba(255,255,255,.8);-o-box-shadow:inset 0 0 5px rgba(255,255,255,.2),inset 0 0 1px rgba(255,255,255,.8);box-shadow:inset 0 0 5px rgba(255,255,255,.2),inset 0 0 1px rgba(255,255,255,.8);-webkit-border-radius:5px;-moz-border-radius:5px;-o-border-radius:5px;border-radius:5px}.annotator-editor a:after{position:absolute;top:50%;left:5px;display:block;content:"";width:15px;height:15px;margin-top:-7px;background-position:0 -90px}.annotator-editor a.annotator-focus,.annotator-editor a:focus,.annotator-editor a:hover,.annotator-filter .annotator-filter-active label,.annotator-filter .annotator-filter-navigation button:hover{outline:0;border-color:#435aa0;background-color:#3865f9;background-image:-webkit-gradient(linear,left top,left bottom,from(#7691fb),color-stop(.5,#5075fb),color-stop(.5,#3865f9),to(#3665fa));background-image:-moz-linear-gradient(to bottom,#7691fb,#5075fb 50%,#3865f9 50%,#3665fa);background-image:-webkit-linear-gradient(to bottom,#7691fb,#5075fb 50%,#3865f9 50%,#3665fa);background-image:linear-gradient(to bottom,#7691fb,#5075fb 50%,#3865f9 50%,#3665fa);color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.42)}.annotator-editor a:focus:after,.annotator-editor a:hover:after{margin-top:-8px;background-position:0 -105px}.annotator-editor a:active,.annotator-filter .annotator-filter-navigation button:active{border-color:#700c49;background-color:#d12e8e;background-image:-webkit-gradient(linear,left top,left bottom,from(#fc7cca),color-stop(.5,#e85db2),color-stop(.5,#d12e8e),to(#ff009c));background-image:-moz-linear-gradient(to bottom,#fc7cca,#e85db2 50%,#d12e8e 50%,#ff009c);background-image:-webkit-linear-gradient(to bottom,#fc7cca,#e85db2 50%,#d12e8e 50%,#ff009c);background-image:linear-gradient(to bottom,#fc7cca,#e85db2 50%,#d12e8e 50%,#ff009c)}.annotator-editor a.annotator-save:after{background-position:0 -120px}.annotator-editor a.annotator-save.annotator-focus:after,.annotator-editor a.annotator-save:focus:after,.annotator-editor a.annotator-save:hover:after{margin-top:-8px;background-position:0 -135px}.annotator-editor .annotator-widget:after{background-position:0 -30px}.annotator-editor.annotator-invert-y .annotator-widget .annotator-controls{background-color:#f2f2f2}.annotator-editor.annotator-invert-y .annotator-widget:after{background-position:0 -45px;height:11px}.annotator-resize{position:absolute;top:0;right:0;width:12px;height:12px;background-position:2px -150px}.annotator-invert-x .annotator-resize{right:auto;left:0;background-position:0 -195px}.annotator-invert-y .annotator-resize{top:auto;bottom:0;background-position:2px -165px}.annotator-invert-y.annotator-invert-x .annotator-resize{background-position:0 -180px}.annotator-notice{color:#fff;position:fixed;top:-54px;left:0;width:100%;font-size:14px;line-height:50px;text-align:center;background:#000;background:rgba(0,0,0,.9);border-bottom:4px solid #d4d4d4;-webkit-transition:top .4s ease-out;-moz-transition:top .4s ease-out;-o-transition:top .4s ease-out;transition:top .4s ease-out}.annotator-notice-success{border-color:#3665f9}.annotator-notice-error{border-color:#ff7e00}.annotator-notice p{margin:0}.annotator-notice a{color:#fff}.annotator-notice-show{top:0}.annotator-tags{margin-bottom:-2px}.annotator-tags .annotator-tag{display:inline-block;padding:0 8px;margin-bottom:2px;line-height:1.6;font-weight:700;background-color:#e6e6e6;-webkit-border-radius:8px;-moz-border-radius:8px;-o-border-radius:8px;border-radius:8px}.annotator-filter{z-index:1010;position:fixed;top:0;right:0;left:0;text-align:left;line-height:0;border:none;border-bottom:1px solid #878787;padding-left:10px;padding-right:10px;-webkit-border-radius:0;-moz-border-radius:0;-o-border-radius:0;border-radius:0;-webkit-box-shadow:inset 0 -1px 0 rgba(255,255,255,.3);-moz-box-shadow:inset 0 -1px 0 rgba(255,255,255,.3);-o-box-shadow:inset 0 -1px 0 rgba(255,255,255,.3);box-shadow:inset 0 -1px 0 rgba(255,255,255,.3)}.annotator-filter strong{font-size:12px;font-weight:700;color:#3c3c3c;text-shadow:0 1px 0 rgba(255,255,255,.7);position:relative;top:-9px}.annotator-filter .annotator-filter-navigation,.annotator-filter .annotator-filter-property{position:relative;display:inline-block;overflow:hidden;line-height:10px;padding:2px 0;margin-right:8px}.annotator-filter .annotator-filter-navigation button,.annotator-filter .annotator-filter-property label{text-align:left;display:block;float:left;line-height:20px;-webkit-border-radius:10px 0 0 10px;-moz-border-radius:10px 0 0 10px;-o-border-radius:10px 0 0 10px;border-radius:10px 0 0 10px}.annotator-filter .annotator-filter-property label{padding-left:8px}.annotator-filter .annotator-filter-property input{display:block;float:right;-webkit-appearance:none;border:1px solid #878787;border-left:none;padding:2px 4px;line-height:16px;min-height:16px;font-size:12px;width:150px;color:#333;background-color:#f8f8f8;-webkit-border-radius:0 10px 10px 0;-moz-border-radius:0 10px 10px 0;-o-border-radius:0 10px 10px 0;border-radius:0 10px 10px 0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-o-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2)}.annotator-filter .annotator-filter-property input:focus{outline:0;background-color:#fff}.annotator-filter .annotator-filter-clear{position:absolute;right:3px;top:6px;border:none;text-indent:-900em;width:15px;height:15px;background-position:0 -90px;opacity:.4}.annotator-filter .annotator-filter-clear:focus,.annotator-filter .annotator-filter-clear:hover{opacity:.8}.annotator-filter .annotator-filter-clear:active{opacity:1}.annotator-filter .annotator-filter-navigation button{border:1px solid #a2a2a2;padding:0;text-indent:-900px;width:20px;min-height:22px;-webkit-box-shadow:inset 0 0 5px rgba(255,255,255,.2),inset 0 0 1px rgba(255,255,255,.8);-moz-box-shadow:inset 0 0 5px rgba(255,255,255,.2),inset 0 0 1px rgba(255,255,255,.8);-o-box-shadow:inset 0 0 5px rgba(255,255,255,.2),inset 0 0 1px rgba(255,255,255,.8);box-shadow:inset 0 0 5px rgba(255,255,255,.2),inset 0 0 1px rgba(255,255,255,.8)}.annotator-filter .annotator-filter-navigation button,.annotator-filter .annotator-filter-navigation button:focus,.annotator-filter .annotator-filter-navigation button:hover{color:transparent}.annotator-filter .annotator-filter-navigation button:after{position:absolute;top:8px;left:8px;content:"";display:block;width:9px;height:9px;background-position:0 -210px}.annotator-filter .annotator-filter-navigation button:hover:after{background-position:0 -225px}.annotator-filter .annotator-filter-navigation .annotator-filter-next{-webkit-border-radius:0 10px 10px 0;-moz-border-radius:0 10px 10px 0;-o-border-radius:0 10px 10px 0;border-radius:0 10px 10px 0;border-left:none}.annotator-filter .annotator-filter-navigation .annotator-filter-next:after{left:auto;right:7px;background-position:0 -240px}.annotator-filter .annotator-filter-navigation .annotator-filter-next:hover:after{background-position:0 -255px}.annotator-hl-active{background:#FFFF0A;background:rgba(255,255,10,.8);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#CCFFFF0A, endColorstr=#CCFFFF0A)"}.annotator-hl-filtered{background-color:transparent}'; -},{}],6:[function(a,b,c){!function(a,c){"object"==typeof b&&"object"==typeof b.exports?b.exports=a.document?c(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return c(a)}:c(a)}("undefined"!=typeof window?window:this,function(a,b){function c(a){var b=!!a&&"length"in a&&a.length,c=na.type(a);return"function"!==c&&!na.isWindow(a)&&("array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a)}function d(a,b,c){if(na.isFunction(b))return na.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return na.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(xa.test(b))return na.filter(b,a,c);b=na.filter(b,a)}return na.grep(a,function(a){return na.inArray(a,b)>-1!==c})}function e(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}function f(a){var b={};return na.each(a.match(Da)||[],function(a,c){b[c]=!0}),b}function g(){da.addEventListener?(da.removeEventListener("DOMContentLoaded",h),a.removeEventListener("load",h)):(da.detachEvent("onreadystatechange",h),a.detachEvent("onload",h))}function h(){(da.addEventListener||"load"===a.event.type||"complete"===da.readyState)&&(g(),na.ready())}function i(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(Ia,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c||"false"!==c&&("null"===c?null:+c+""===c?+c:Ha.test(c)?na.parseJSON(c):c)}catch(e){}na.data(a,b,c)}else c=void 0}return c}function j(a){var b;for(b in a)if(("data"!==b||!na.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function k(a,b,c,d){if(Ga(a)){var e,f,g=na.expando,h=a.nodeType,i=h?na.cache:a,j=h?a[g]:a[g]&&g;if(j&&i[j]&&(d||i[j].data)||void 0!==c||"string"!=typeof b)return j||(j=h?a[g]=ca.pop()||na.guid++:g),i[j]||(i[j]=h?{}:{toJSON:na.noop}),"object"!=typeof b&&"function"!=typeof b||(d?i[j]=na.extend(i[j],b):i[j].data=na.extend(i[j].data,b)),f=i[j],d||(f.data||(f.data={}),f=f.data),void 0!==c&&(f[na.camelCase(b)]=c),"string"==typeof b?(e=f[b],null==e&&(e=f[na.camelCase(b)])):e=f,e}}function l(a,b,c){if(Ga(a)){var d,e,f=a.nodeType,g=f?na.cache:a,h=f?a[na.expando]:na.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){na.isArray(b)?b=b.concat(na.map(b,na.camelCase)):b in d?b=[b]:(b=na.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;for(;e--;)delete d[b[e]];if(c?!j(d):!na.isEmptyObject(d))return}(c||(delete g[h].data,j(g[h])))&&(f?na.cleanData([a],!0):la.deleteExpando||g!=g.window?delete g[h]:g[h]=void 0)}}}function m(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return na.css(a,b,"")},i=h(),j=c&&c[3]||(na.cssNumber[b]?"":"px"),k=(na.cssNumber[b]||"px"!==j&&+i)&&Ka.exec(na.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,na.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}function n(a){var b=Sa.split("|"),c=a.createDocumentFragment();if(c.createElement)for(;b.length;)c.createElement(b.pop());return c}function o(a,b){var c,d,e=0,f="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||na.nodeName(d,b)?f.push(d):na.merge(f,o(d,b));return void 0===b||b&&na.nodeName(a,b)?na.merge([a],f):f}function p(a,b){for(var c,d=0;null!=(c=a[d]);d++)na._data(c,"globalEval",!b||na._data(b[d],"globalEval"))}function q(a){Oa.test(a.type)&&(a.defaultChecked=a.checked)}function r(a,b,c,d,e){for(var f,g,h,i,j,k,l,m=a.length,r=n(b),s=[],t=0;t"!==l[1]||Va.test(g)?0:i:i.firstChild,f=g&&g.childNodes.length;f--;)na.nodeName(k=g.childNodes[f],"tbody")&&!k.childNodes.length&&g.removeChild(k);for(na.merge(s,i.childNodes),i.textContent="";i.firstChild;)i.removeChild(i.firstChild);i=r.lastChild}else s.push(b.createTextNode(g));for(i&&r.removeChild(i),la.appendChecked||na.grep(o(s,"input"),q),t=0;g=s[t++];)if(d&&na.inArray(g,d)>-1)e&&e.push(g);else if(h=na.contains(g.ownerDocument,g),i=o(r.appendChild(g),"script"),h&&p(i),c)for(f=0;g=i[f++];)Qa.test(g.type||"")&&c.push(g);return i=null,r}function s(){return!0}function t(){return!1}function u(){try{return da.activeElement}catch(a){}}function v(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)v(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=t;else if(!e)return a;return 1===f&&(g=e,e=function(a){return na().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=na.guid++)),a.each(function(){na.event.add(this,b,e,d,c)})}function w(a,b){return na.nodeName(a,"table")&&na.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function x(a){return a.type=(null!==na.find.attr(a,"type"))+"/"+a.type,a}function y(a){var b=eb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function z(a,b){if(1===b.nodeType&&na.hasData(a)){var c,d,e,f=na._data(a),g=na._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;d1&&"string"==typeof n&&!la.checkClone&&db.test(n))return a.each(function(e){var f=a.eq(e);p&&(b[0]=n.call(this,e,f.html())),B(f,b,c,d)});if(l&&(j=r(b,a[0].ownerDocument,!1,a,d),e=j.firstChild,1===j.childNodes.length&&(j=e),e||d)){for(h=na.map(o(j,"script"),x),g=h.length;k")).appendTo(b.documentElement),b=(ib[0].contentWindow||ib[0].contentDocument).document,b.write(),b.close(),c=D(a,b),ib.detach()),jb[a]=c),c}function F(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}function G(a){if(a in yb)return a;for(var b=a.charAt(0).toUpperCase()+a.slice(1),c=xb.length;c--;)if(a=xb[c]+b,a in yb)return a}function H(a,b){for(var c,d,e,f=[],g=0,h=a.length;g=0&&c=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==na.type(a)||a.nodeType||na.isWindow(a))return!1;try{if(a.constructor&&!ka.call(a,"constructor")&&!ka.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(!la.ownFirst)for(b in a)return ka.call(a,b);for(b in a);return void 0===b||ka.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?ia[ja.call(a)]||"object":typeof a},globalEval:function(b){b&&na.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(pa,"ms-").replace(qa,ra)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var d,e=0;if(c(a))for(d=a.length;ew.cacheLength&&delete a[b.shift()],a[c+" "]=d}var b=[];return a}function d(a){return a[N]=!0,a}function e(a){var b=G.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function f(a,b){for(var c=a.split("|"),d=c.length;d--;)w.attrHandle[c[d]]=b}function g(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||V)-(~a.sourceIndex||V);if(d)return d;if(c)for(;c=c.nextSibling;)if(c===b)return-1;return a?1:-1}function h(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function i(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function j(a){return d(function(b){return b=+b,d(function(c,d){for(var e,f=a([],c.length,b),g=f.length;g--;)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function k(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}function l(){}function m(a){for(var b=0,c=a.length,d="";b1?function(b,c,d){for(var e=a.length;e--;)if(!a[e](b,c,d))return!1;return!0}:a[0]}function p(a,c,d){for(var e=0,f=c.length;e-1&&(d[j]=!(g[j]=l))}}else t=q(t===g?t.splice(o,t.length):t),f?f(null,g,t,i):$.apply(g,t)})}function s(a){for(var b,c,d,e=a.length,f=w.relative[a[0].type],g=f||w.relative[" "],h=f?1:0,i=n(function(a){return a===b},g,!0),j=n(function(a){return aa(b,a)>-1},g,!0),k=[function(a,c,d){var e=!f&&(d||c!==C)||((b=c).nodeType?i(a,c,d):j(a,c,d));return b=null,e}];h1&&o(k),h>1&&m(a.slice(0,h-1).concat({value:" "===a[h-2].type?"*":""})).replace(ha,"$1"),c,h0,f=a.length>0,g=function(d,g,h,i,j){var k,l,m,n=0,o="0",p=d&&[],r=[],s=C,t=d||f&&w.find.TAG("*",j),u=P+=null==s?1:Math.random()||.1,v=t.length;for(j&&(C=g===G||g||j);o!==v&&null!=(k=t[o]);o++){if(f&&k){for(l=0,g||k.ownerDocument===G||(F(k),h=!I);m=a[l++];)if(m(k,g||G,h)){i.push(k);break}j&&(P=u)}e&&((k=!m&&k)&&n--,d&&p.push(k))}if(n+=o,e&&o!==n){for(l=0;m=c[l++];)m(p,r,g,h);if(d){if(n>0)for(;o--;)p[o]||r[o]||(r[o]=Y.call(i));r=q(r)}$.apply(i,r),j&&!d&&r.length>0&&n+c.length>1&&b.uniqueSort(i)}return j&&(P=u,C=s),p};return e?d(g):g}var u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N="sizzle"+1*new Date,O=a.document,P=0,Q=0,R=c(),S=c(),T=c(),U=function(a,b){return a===b&&(E=!0),0},V=1<<31,W={}.hasOwnProperty,X=[],Y=X.pop,Z=X.push,$=X.push,_=X.slice,aa=function(a,b){for(var c=0,d=a.length;c+~]|"+ca+")"+ca+"*"),ka=new RegExp("="+ca+"*([^\\]'\"]*?)"+ca+"*\\]","g"),la=new RegExp(fa),ma=new RegExp("^"+da+"$"),na={ID:new RegExp("^#("+da+")"),CLASS:new RegExp("^\\.("+da+")"),TAG:new RegExp("^("+da+"|[*])"),ATTR:new RegExp("^"+ea),PSEUDO:new RegExp("^"+fa),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ca+"*(even|odd|(([+-]|)(\\d*)n|)"+ca+"*(?:([+-]|)"+ca+"*(\\d+)|))"+ca+"*\\)|)","i"),bool:new RegExp("^(?:"+ba+")$","i"),needsContext:new RegExp("^"+ca+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ca+"*((?:-\\d)?\\d*)"+ca+"*\\)|)(?=[^-]|$)","i")},oa=/^(?:input|select|textarea|button)$/i,pa=/^h\d$/i,qa=/^[^{]+\{\s*\[native \w/,ra=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,sa=/[+~]/,ta=/'|\\/g,ua=new RegExp("\\\\([\\da-f]{1,6}"+ca+"?|("+ca+")|.)","ig"),va=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},wa=function(){F()};try{$.apply(X=_.call(O.childNodes),O.childNodes),X[O.childNodes.length].nodeType}catch(xa){$={apply:X.length?function(a,b){Z.apply(a,_.call(b))}:function(a,b){for(var c=a.length,d=0;a[c++]=b[d++];);a.length=c-1}}}v=b.support={},y=b.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},F=b.setDocument=function(a){var b,c,d=a?a.ownerDocument||a:O;return d!==G&&9===d.nodeType&&d.documentElement?(G=d,H=G.documentElement,I=!y(G),(c=G.defaultView)&&c.top!==c&&(c.addEventListener?c.addEventListener("unload",wa,!1):c.attachEvent&&c.attachEvent("onunload",wa)),v.attributes=e(function(a){return a.className="i",!a.getAttribute("className")}),v.getElementsByTagName=e(function(a){return a.appendChild(G.createComment("")),!a.getElementsByTagName("*").length}),v.getElementsByClassName=qa.test(G.getElementsByClassName),v.getById=e(function(a){return H.appendChild(a).id=N,!G.getElementsByName||!G.getElementsByName(N).length}),v.getById?(w.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&I){var c=b.getElementById(a);return c?[c]:[]}},w.filter.ID=function(a){var b=a.replace(ua,va);return function(a){return a.getAttribute("id")===b}}):(delete w.find.ID,w.filter.ID=function(a){var b=a.replace(ua,va);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),w.find.TAG=v.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):v.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){for(;c=f[e++];)1===c.nodeType&&d.push(c);return d}return f},w.find.CLASS=v.getElementsByClassName&&function(a,b){if("undefined"!=typeof b.getElementsByClassName&&I)return b.getElementsByClassName(a)},K=[],J=[],(v.qsa=qa.test(G.querySelectorAll))&&(e(function(a){H.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&J.push("[*^$]="+ca+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||J.push("\\["+ca+"*(?:value|"+ba+")"),a.querySelectorAll("[id~="+N+"-]").length||J.push("~="),a.querySelectorAll(":checked").length||J.push(":checked"),a.querySelectorAll("a#"+N+"+*").length||J.push(".#.+[+~]")}),e(function(a){var b=G.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&J.push("name"+ca+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||J.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),J.push(",.*:")})),(v.matchesSelector=qa.test(L=H.matches||H.webkitMatchesSelector||H.mozMatchesSelector||H.oMatchesSelector||H.msMatchesSelector))&&e(function(a){v.disconnectedMatch=L.call(a,"div"),L.call(a,"[s!='']:x"),K.push("!=",fa)}),J=J.length&&new RegExp(J.join("|")),K=K.length&&new RegExp(K.join("|")),b=qa.test(H.compareDocumentPosition),M=b||qa.test(H.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)for(;b=b.parentNode;)if(b===a)return!0;return!1},U=b?function(a,b){if(a===b)return E=!0,0;var c=!a.compareDocumentPosition-!b.compareDocumentPosition;return c?c:(c=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&c||!v.sortDetached&&b.compareDocumentPosition(a)===c?a===G||a.ownerDocument===O&&M(O,a)?-1:b===G||b.ownerDocument===O&&M(O,b)?1:D?aa(D,a)-aa(D,b):0:4&c?-1:1)}:function(a,b){if(a===b)return E=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===G?-1:b===G?1:e?-1:f?1:D?aa(D,a)-aa(D,b):0;if(e===f)return g(a,b);for(c=a;c=c.parentNode;)h.unshift(c);for(c=b;c=c.parentNode;)i.unshift(c);for(;h[d]===i[d];)d++;return d?g(h[d],i[d]):h[d]===O?-1:i[d]===O?1:0},G):G},b.matches=function(a,c){return b(a,null,null,c)},b.matchesSelector=function(a,c){if((a.ownerDocument||a)!==G&&F(a),c=c.replace(ka,"='$1']"),v.matchesSelector&&I&&!T[c+" "]&&(!K||!K.test(c))&&(!J||!J.test(c)))try{var d=L.call(a,c);if(d||v.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return b(c,G,null,[a]).length>0},b.contains=function(a,b){return(a.ownerDocument||a)!==G&&F(a),M(a,b)},b.attr=function(a,b){(a.ownerDocument||a)!==G&&F(a);var c=w.attrHandle[b.toLowerCase()],d=c&&W.call(w.attrHandle,b.toLowerCase())?c(a,b,!I):void 0;return void 0!==d?d:v.attributes||!I?a.getAttribute(b):(d=a.getAttributeNode(b))&&d.specified?d.value:null},b.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},b.uniqueSort=function(a){var b,c=[],d=0,e=0;if(E=!v.detectDuplicates,D=!v.sortStable&&a.slice(0),a.sort(U),E){for(;b=a[e++];)b===a[e]&&(d=c.push(e));for(;d--;)a.splice(c[d],1)}return D=null,a},x=b.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(1===e||9===e||11===e){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=x(a)}else if(3===e||4===e)return a.nodeValue}else for(;b=a[d++];)c+=x(b);return c},w=b.selectors={cacheLength:50,createPseudo:d,match:na,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(ua,va),a[3]=(a[3]||a[4]||a[5]||"").replace(ua,va),"~="===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]||b.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]&&b.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return na.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&la.test(c)&&(b=z(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(ua,va).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=R[a+" "];return b||(b=new RegExp("(^|"+ca+")"+a+"("+ca+"|$)"))&&R(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,c,d){return function(e){var f=b.attr(e,a);return null==f?"!="===c:!c||(f+="","="===c?f===d:"!="===c?f!==d:"^="===c?d&&0===f.indexOf(d):"*="===c?d&&f.indexOf(d)>-1:"$="===c?d&&f.slice(-d.length)===d:"~="===c?(" "+f.replace(ga," ")+" ").indexOf(d)>-1:"|="===c&&(f===d||f.slice(0,d.length+1)===d+"-"))}},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,t=!1;if(q){if(f){for(;p;){for(m=b;m=m[p];)if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){for(m=q,l=m[N]||(m[N]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===P&&j[1], +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g li > a").removeClass("active-current"),(0,e["default"])("#links > li > a").removeClass("current"),(0,e["default"])("[id$=-arrow]").removeClass("arrow-down"),(0,e["default"])("#content").removeClass("opacity03")}var g=(0,e["default"])("#listmode"),h=(0,e["default"])("#list-entries");(0,e["default"])("#menu").click(function(){(0,e["default"])("#links").toggleClass("menu--open");var a=(0,e["default"])("#content");a.hasClass("opacity03")&&a.removeClass("opacity03")}),g.click(function(){1===e["default"].cookie("listmode")?(e["default"].removeCookie("listmode"),h.removeClass("listmode"),g.removeClass("tablemode"),g.addClass("listmode")):(e["default"].cookie("listmode",1,{expires:365}),h.addClass("listmode"),g.removeClass("listmode"),g.addClass("tablemode"))}),1===e["default"].cookie("listmode")&&(h.addClass("listmode"),g.removeClass("listmode"),g.addClass("tablemode")),(0,e["default"])("#nav-btn-add-tag").on("click",function(){return(0,e["default"])(".nav-panel-add-tag").toggle(100),(0,e["default"])(".nav-panel-menu").addClass("hidden"),(0,e["default"])("#tag_label").focus(),!1}),(0,e["default"])("div").is("#filters")&&((0,e["default"])("#button_filters").show(),(0,e["default"])("#clear_form_filters").on("click",function(){return(0,e["default"])("#filters input").val(""),(0,e["default"])("#filters :checked").removeAttr("checked"),!1})),(0,e["default"])("article").length&&!function(){var a=new i["default"].App;a.include(i["default"].ui.main,{element:document.querySelector("article")});var b=JSON.parse((0,e["default"])("#annotationroutes").html());a.include(i["default"].storage.http,b),a.start().then(function(){a.annotations.load({entry:b.entryId})}),(0,e["default"])(window).scroll(function(){var a=(0,e["default"])(window).scrollTop(),c=(0,e["default"])(document).height(),d=a/c,f=Math.round(100*d)/100;(0,j.savePercent)(b.entryId,f)}),(0,j.retrievePercent)(b.entryId),(0,e["default"])(window).resize(function(){(0,j.retrievePercent)(b.entryId)})}();var k=window.location.href;k.match("&closewin=true")&&window.close(),(0,e["default"])("a.closeMessage").on("click",function(){return(0,e["default"])(void 0).parents("div.messages").slideUp(300,function(){(0,e["default"])(void 0).remove()}),!1}),(0,e["default"])("#search-form").hide(),(0,e["default"])("#bagit-form").hide(),(0,e["default"])("#filters").hide(),(0,e["default"])("#download-form").hide(),(0,e["default"])("#search").click(function(){f(),a(),(0,e["default"])("#searchfield").focus()}),(0,e["default"])(".filter-btn").click(function(){f(),b()}),(0,e["default"])(".download-btn").click(function(){f(),c()}),(0,e["default"])("#bagit").click(function(){f(),d(),(0,e["default"])("#plainurl").focus()}),(0,e["default"])("#search-form-close").click(function(){a()}),(0,e["default"])("#filter-form-close").click(function(){b()}),(0,e["default"])("#download-form-close").click(function(){c()}),(0,e["default"])("#bagit-form-close").click(function(){d()});var m=(0,e["default"])("#bagit-form-form");m.submit(function(a){(0,e["default"])("body").css("cursor","wait"),(0,e["default"])("#add-link-result").empty(),e["default"].ajax({type:m.attr("method"),url:m.attr("action"),data:m.serialize(),success:function(){(0,e["default"])("#add-link-result").html("Done!"),(0,e["default"])("#plainurl").val(""),(0,e["default"])("#plainurl").blur(""),(0,e["default"])("body").css("cursor","auto")},error:function(){(0,e["default"])("#add-link-result").html("Failed!"),(0,e["default"])("body").css("cursor","auto")}}),a.preventDefault()}),(0,e["default"])('article a[href^="http"]').after(function(){return''}),(0,e["default"])(".add-to-wallabag-link-after").click(function(a){(0,l["default"])((0,e["default"])(void 0).attr("href"),a),a.preventDefault()})})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../_global/js/shortcuts/entry":1,"../../_global/js/shortcuts/main":2,"../../_global/js/tools":3,"./shortcuts/entry":5,"./shortcuts/main":6,"./uiTools":7,annotator:8,jquery:35,"jquery-ui-browserify":33,"jquery.cookie":34}],5:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}var e=a("mousetrap"),f=d(e),g=a("jquery"),h=d(g);f["default"].bind("o",function(){(0,h["default"])("div#article_toolbar ul.links a.original")[0].click()}),f["default"].bind("s",function(){(0,h["default"])("div#article_toolbar ul.links a.favorite")[0].click()}),f["default"].bind("a",function(){(0,h["default"])("div#article_toolbar ul.links a.markasread")[0].click()}),f["default"].bind("del",function(){(0,h["default"])("div#article_toolbar ul.links a.delete")[0].click()})},{jquery:35,mousetrap:37}],6:[function(a,b,c){"use strict"},{}],7:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){(0,g["default"])("#add-link-result").empty();var c=(0,g["default"])("#bagit"),d=(0,g["default"])("#bagit-form");c.toggleClass("active-current"),0===c.length&&("undefined"!==b&&b?d.css({position:"absolute",top:b.pageY,left:b.pageX-200}):d.css({position:"relative",top:"auto",left:"auto"}));var e=(0,g["default"])("#search-form"),f=(0,g["default"])("#plainurl");0!==e.length&&((0,g["default"])("#search").removeClass("current"),(0,g["default"])("#search-arrow").removeClass("arrow-down"),e.hide()),d.toggle(),(0,g["default"])("#content").toggleClass("opacity03"),"undefined"!==a&&a&&f.val(a),f.focus()}Object.defineProperty(c,"__esModule",{value:!0});var f=a("jquery"),g=d(f);c["default"]=e},{jquery:35}],8:[function(a,b,c){(function(b){"use strict";var d=a("insert-css"),e=a("./css/annotator.css");d(e);var f=a("./src/app"),g=a("./src/util");c.App=f.App,c.authz=a("./src/authz"),c.identity=a("./src/identity"),c.notification=a("./src/notification"),c.storage=a("./src/storage"),c.ui=a("./src/ui"),c.util=g,c.ext={};var h=b.wgxpath;"undefined"!=typeof h&&null!==h&&"function"==typeof h.install&&h.install();var i=b.annotator;c.noConflict=function(){return b.annotator=i,this}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./css/annotator.css":9,"./src/app":11,"./src/authz":12,"./src/identity":13,"./src/notification":14,"./src/storage":16,"./src/ui":17,"./src/util":28,"insert-css":31}],9:[function(a,b,c){b.exports='.annotator-filter *,.annotator-notice,.annotator-widget *{font-family:"Helvetica Neue",Arial,Helvetica,sans-serif;font-weight:400;text-align:left;margin:0;padding:0;background:0 0;-webkit-transition:none;-moz-transition:none;-o-transition:none;transition:none;-moz-box-shadow:none;-webkit-box-shadow:none;-o-box-shadow:none;box-shadow:none;color:#909090}.annotator-adder{background-image:url(data:image/png;base64,iV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zRIdjRJd8pnpIDQfG/kvwjv/5GohK8fFPf3Yl26qTCWEkI+2tohIpoGux2h3SxMfHk5OTIxWPz6oCgkCq2uaHwjTfeIAHcohEUPxXGShaf9IJIRbRIEhErTvFsRmURFc+5bUHxDxmbSeD/PUpB8WeV7F9J+nEgXbiMdLclYmNGLc+2rvnYZyvIXleyPyj+lwfMbTf6ej+vBO9/K5lYT2OrV69e6XwkCBmPPjpDsj7s0Z6cnGOb6Xdu5du84NunibS8/vrrxJ/N047kv3Juu8Tfi/J3TV4srdk33tjELM9m+l1A/INTM+45/7rr+1aiPz0olsuYz4+RNkM/7XoO++35m+l3AfG/PHCuJrQ+yM4QtL3JsV1H16xZs4IKh32eyf7ihks8b8lUr2Q6iVwwHVwC4r96fgfll1brMnX6MCqe3VQ8//LJPzg13etc4n3hX3dt3woumY5/F2SGwoB9joLNWdf2+eR/edCPAxp/fQd0SJ4ttFkMY4KxWCx5Op0u4pNPPlkvi/YV4ZcvX04IuWd/DNAnPxOMYG/J4zg+4lrhFz75B495geAB4s+6+vVbln72PB3l33ztgE/+ZYOfCJie8/GX6v06h8wnyzMDveu9/CqRp4vtxBNM43/5y1/ueMO5I/gl8QRRLp/NfiD4mXiC2oq6U3rXxBOFVUzmY1tcr/Lq6CjxdERxTfwd8Qcrno4orom/I/5gxdMhAlIQkXwF064CLzwI4lERUUD891M8KiIKiP9OxNNhAvISEVFZDpevaJIHRTwKIvKb/0EQj4KI/Oa/U/F0qIA03JnS+wdKPD7cmSL/gyQeH+5Mkb8jxHOnWZiWiOTBLVH6/kEtbmHIglui9P2DWtzCWH3534r8HSUcd/l/AQYA7PGYKl3+RK0AAAAASUVORK5CYII=);background-repeat:no-repeat}.annotator-editor a:after,.annotator-filter .annotator-filter-navigation button:after,.annotator-filter .annotator-filter-property .annotator-filter-clear,.annotator-resize,.annotator-viewer .annotator-controls a,.annotator-viewer .annotator-controls button,.annotator-widget:after{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABI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Ek3jC0sUcUyD69RvckwWDHIuStIDSHjKE3actwlgYoRXj/2HH9GYkfGlInyreEZ3/jXuyoFlWIy8RRBgAxJ+WCRD6cPdfxgzyI3ZMHwPu4Z6sgKaPLO+z6ze5J0usPzMVIYWPKZ0YuJr1lPB91ihImjmhlj5bfI118SlIHkRIRqeYAxFchNZiX+EMP6ScImq7WpuSi5SwTHYyc4u7rFEvWuS09TH79wz6nwADANCoQA3w0fcjAAAAAElFTkSuQmCC);background-repeat:no-repeat}.annotator-hl{background:#FFFF0A;background:rgba(255,255,10,.3);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#4DFFFF0A, endColorstr=#4DFFFF0A)"}.annotator-hl-temporary{background:#007CFF;background:rgba(0,124,255,.3);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#4D007CFF, endColorstr=#4D007CFF)"}.annotator-wrapper{position:relative}.annotator-adder,.annotator-notice,.annotator-outer{z-index:1020}.annotator-adder,.annotator-notice,.annotator-outer,.annotator-widget{position:absolute;font-size:10px;line-height:1}.annotator-hide{display:none;visibility:hidden}.annotator-adder{margin-top:-48px;margin-left:-24px;width:48px;height:48px;background-position:left top}.annotator-adder:hover{background-position:center top}.annotator-adder:active{background-position:center right}.annotator-adder button{display:block;width:36px;height:41px;margin:0 auto;border:none;background:0 0;text-indent:-999em;cursor:pointer}.annotator-outer{width:0;height:0}.annotator-widget{margin:0;padding:0;bottom:15px;left:-18px;min-width:265px;background-color:#FBFBFB;background-color:rgba(251,251,251,.98);border:1px solid #7A7A7A;border:1px solid rgba(122,122,122,.6);-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;-webkit-box-shadow:0 5px 15px rgba(0,0,0,.2);-moz-box-shadow:0 5px 15px rgba(0,0,0,.2);-o-box-shadow:0 5px 15px rgba(0,0,0,.2);box-shadow:0 5px 15px rgba(0,0,0,.2)}.annotator-invert-x .annotator-widget{left:auto;right:-18px}.annotator-invert-y .annotator-widget{bottom:auto;top:8px}.annotator-widget strong{font-weight:700}.annotator-widget .annotator-item,.annotator-widget .annotator-listing{padding:0;margin:0;list-style:none}.annotator-widget:after{content:"";display:block;width:18px;height:10px;background-position:0 0;position:absolute;bottom:-10px;left:8px}.annotator-invert-x .annotator-widget:after{left:auto;right:8px}.annotator-invert-y .annotator-widget:after{background-position:0 -15px;bottom:auto;top:-9px}.annotator-editor .annotator-item input,.annotator-editor .annotator-item textarea,.annotator-widget .annotator-item{position:relative;font-size:12px}.annotator-viewer .annotator-item{border-top:2px solid #7A7A7A;border-top:2px solid rgba(122,122,122,.2)}.annotator-widget .annotator-item:first-child{border-top:none}.annotator-editor .annotator-item,.annotator-viewer div{border-top:1px solid #858585;border-top:1px solid rgba(133,133,133,.11)}.annotator-viewer div{padding:6px}.annotator-viewer .annotator-item ol,.annotator-viewer .annotator-item ul{padding:4px 16px}.annotator-editor .annotator-item:first-child textarea,.annotator-viewer div:first-of-type{padding-top:12px;padding-bottom:12px;color:#3c3c3c;font-size:13px;font-style:italic;line-height:1.3;border-top:none}.annotator-viewer .annotator-controls{position:relative;top:5px;right:5px;padding-left:5px;opacity:0;-webkit-transition:opacity .2s ease-in;-moz-transition:opacity .2s ease-in;-o-transition:opacity .2s ease-in;transition:opacity .2s ease-in;float:right}.annotator-viewer li .annotator-controls.annotator-visible,.annotator-viewer li:hover .annotator-controls{opacity:1}.annotator-viewer .annotator-controls a,.annotator-viewer .annotator-controls button{cursor:pointer;display:inline-block;width:13px;height:13px;margin-left:2px;border:none;opacity:.2;text-indent:-900em;background-color:transparent;outline:0}.annotator-viewer .annotator-controls a:focus,.annotator-viewer .annotator-controls a:hover,.annotator-viewer .annotator-controls button:focus,.annotator-viewer .annotator-controls button:hover{opacity:.9}.annotator-viewer .annotator-controls a:active,.annotator-viewer .annotator-controls button:active{opacity:1}.annotator-viewer .annotator-controls button[disabled]{display:none}.annotator-viewer .annotator-controls .annotator-edit{background-position:0 -60px}.annotator-viewer .annotator-controls .annotator-delete{background-position:0 -75px}.annotator-viewer .annotator-controls .annotator-link{background-position:0 -270px}.annotator-editor .annotator-item{position:relative}.annotator-editor .annotator-item label{top:0;display:inline;cursor:pointer;font-size:12px}.annotator-editor .annotator-item input,.annotator-editor .annotator-item textarea{display:block;min-width:100%;padding:10px 8px;border:none;margin:0;color:#3c3c3c;background:0 0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box;resize:none}.annotator-editor .annotator-item textarea::-webkit-scrollbar{height:8px;width:8px}.annotator-editor .annotator-item textarea::-webkit-scrollbar-track-piece{margin:13px 0 3px;background-color:#e5e5e5;-webkit-border-radius:4px}.annotator-editor .annotator-item textarea::-webkit-scrollbar-thumb:vertical{height:25px;background-color:#ccc;-webkit-border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.1)}.annotator-editor .annotator-item textarea::-webkit-scrollbar-thumb:horizontal{width:25px;background-color:#ccc;-webkit-border-radius:4px}.annotator-editor .annotator-item:first-child textarea{min-height:5.5em;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;-o-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.annotator-editor .annotator-item input:focus,.annotator-editor .annotator-item textarea:focus{background-color:#f3f3f3;outline:0}.annotator-editor .annotator-item input[type=checkbox],.annotator-editor .annotator-item input[type=radio]{width:auto;min-width:0;padding:0;display:inline;margin:0 4px 0 0;cursor:pointer}.annotator-editor .annotator-checkbox{padding:8px 6px}.annotator-editor .annotator-controls,.annotator-filter,.annotator-filter .annotator-filter-navigation button{text-align:right;padding:3px;border-top:1px solid #d4d4d4;background-color:#d4d4d4;background-image:-webkit-gradient(linear,left top,left bottom,from(#f5f5f5),color-stop(.6,#dcdcdc),to(#d2d2d2));background-image:-moz-linear-gradient(to bottom,#f5f5f5,#dcdcdc 60%,#d2d2d2);background-image:-webkit-linear-gradient(to bottom,#f5f5f5,#dcdcdc 60%,#d2d2d2);background-image:linear-gradient(to bottom,#f5f5f5,#dcdcdc 60%,#d2d2d2);-webkit-box-shadow:inset 1px 0 0 rgba(255,255,255,.7),inset -1px 0 0 rgba(255,255,255,.7),inset 0 1px 0 rgba(255,255,255,.7);-moz-box-shadow:inset 1px 0 0 rgba(255,255,255,.7),inset -1px 0 0 rgba(255,255,255,.7),inset 0 1px 0 rgba(255,255,255,.7);-o-box-shadow:inset 1px 0 0 rgba(255,255,255,.7),inset -1px 0 0 rgba(255,255,255,.7),inset 0 1px 0 rgba(255,255,255,.7);box-shadow:inset 1px 0 0 rgba(255,255,255,.7),inset -1px 0 0 rgba(255,255,255,.7),inset 0 1px 0 rgba(255,255,255,.7);-webkit-border-radius:0 0 5px 5px;-moz-border-radius:0 0 5px 5px;-o-border-radius:0 0 5px 5px;border-radius:0 0 5px 5px}.annotator-editor.annotator-invert-y .annotator-controls{border-top:none;border-bottom:1px solid #b4b4b4;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;-o-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.annotator-editor a,.annotator-filter .annotator-filter-property label{position:relative;display:inline-block;padding:0 6px 0 22px;color:#363636;text-shadow:0 1px 0 rgba(255,255,255,.75);text-decoration:none;line-height:24px;font-size:12px;font-weight:700;border:1px solid #a2a2a2;background-color:#d4d4d4;background-image:-webkit-gradient(linear,left top,left bottom,from(#f5f5f5),color-stop(.5,#d2d2d2),color-stop(.5,#bebebe),to(#d2d2d2));background-image:-moz-linear-gradient(to bottom,#f5f5f5,#d2d2d2 50%,#bebebe 50%,#d2d2d2);background-image:-webkit-linear-gradient(to bottom,#f5f5f5,#d2d2d2 50%,#bebebe 50%,#d2d2d2);background-image:linear-gradient(to bottom,#f5f5f5,#d2d2d2 50%,#bebebe 50%,#d2d2d2);-webkit-box-shadow:inset 0 0 5px rgba(255,255,255,.2),inset 0 0 1px rgba(255,255,255,.8);-moz-box-shadow:inset 0 0 5px rgba(255,255,255,.2),inset 0 0 1px rgba(255,255,255,.8);-o-box-shadow:inset 0 0 5px rgba(255,255,255,.2),inset 0 0 1px rgba(255,255,255,.8);box-shadow:inset 0 0 5px rgba(255,255,255,.2),inset 0 0 1px rgba(255,255,255,.8);-webkit-border-radius:5px;-moz-border-radius:5px;-o-border-radius:5px;border-radius:5px}.annotator-editor a:after{position:absolute;top:50%;left:5px;display:block;content:"";width:15px;height:15px;margin-top:-7px;background-position:0 -90px}.annotator-editor a.annotator-focus,.annotator-editor a:focus,.annotator-editor a:hover,.annotator-filter .annotator-filter-active label,.annotator-filter .annotator-filter-navigation button:hover{outline:0;border-color:#435aa0;background-color:#3865f9;background-image:-webkit-gradient(linear,left top,left bottom,from(#7691fb),color-stop(.5,#5075fb),color-stop(.5,#3865f9),to(#3665fa));background-image:-moz-linear-gradient(to bottom,#7691fb,#5075fb 50%,#3865f9 50%,#3665fa);background-image:-webkit-linear-gradient(to bottom,#7691fb,#5075fb 50%,#3865f9 50%,#3665fa);background-image:linear-gradient(to bottom,#7691fb,#5075fb 50%,#3865f9 50%,#3665fa);color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.42)}.annotator-editor a:focus:after,.annotator-editor a:hover:after{margin-top:-8px;background-position:0 -105px}.annotator-editor a:active,.annotator-filter .annotator-filter-navigation button:active{border-color:#700c49;background-color:#d12e8e;background-image:-webkit-gradient(linear,left top,left bottom,from(#fc7cca),color-stop(.5,#e85db2),color-stop(.5,#d12e8e),to(#ff009c));background-image:-moz-linear-gradient(to bottom,#fc7cca,#e85db2 50%,#d12e8e 50%,#ff009c);background-image:-webkit-linear-gradient(to bottom,#fc7cca,#e85db2 50%,#d12e8e 50%,#ff009c);background-image:linear-gradient(to bottom,#fc7cca,#e85db2 50%,#d12e8e 50%,#ff009c)}.annotator-editor a.annotator-save:after{background-position:0 -120px}.annotator-editor a.annotator-save.annotator-focus:after,.annotator-editor a.annotator-save:focus:after,.annotator-editor a.annotator-save:hover:after{margin-top:-8px;background-position:0 -135px}.annotator-editor .annotator-widget:after{background-position:0 -30px}.annotator-editor.annotator-invert-y .annotator-widget .annotator-controls{background-color:#f2f2f2}.annotator-editor.annotator-invert-y .annotator-widget:after{background-position:0 -45px;height:11px}.annotator-resize{position:absolute;top:0;right:0;width:12px;height:12px;background-position:2px -150px}.annotator-invert-x .annotator-resize{right:auto;left:0;background-position:0 -195px}.annotator-invert-y .annotator-resize{top:auto;bottom:0;background-position:2px -165px}.annotator-invert-y.annotator-invert-x .annotator-resize{background-position:0 -180px}.annotator-notice{color:#fff;position:fixed;top:-54px;left:0;width:100%;font-size:14px;line-height:50px;text-align:center;background:#000;background:rgba(0,0,0,.9);border-bottom:4px solid #d4d4d4;-webkit-transition:top .4s ease-out;-moz-transition:top .4s ease-out;-o-transition:top .4s ease-out;transition:top .4s ease-out}.annotator-notice-success{border-color:#3665f9}.annotator-notice-error{border-color:#ff7e00}.annotator-notice p{margin:0}.annotator-notice a{color:#fff}.annotator-notice-show{top:0}.annotator-tags{margin-bottom:-2px}.annotator-tags .annotator-tag{display:inline-block;padding:0 8px;margin-bottom:2px;line-height:1.6;font-weight:700;background-color:#e6e6e6;-webkit-border-radius:8px;-moz-border-radius:8px;-o-border-radius:8px;border-radius:8px}.annotator-filter{z-index:1010;position:fixed;top:0;right:0;left:0;text-align:left;line-height:0;border:none;border-bottom:1px solid #878787;padding-left:10px;padding-right:10px;-webkit-border-radius:0;-moz-border-radius:0;-o-border-radius:0;border-radius:0;-webkit-box-shadow:inset 0 -1px 0 rgba(255,255,255,.3);-moz-box-shadow:inset 0 -1px 0 rgba(255,255,255,.3);-o-box-shadow:inset 0 -1px 0 rgba(255,255,255,.3);box-shadow:inset 0 -1px 0 rgba(255,255,255,.3)}.annotator-filter strong{font-size:12px;font-weight:700;color:#3c3c3c;text-shadow:0 1px 0 rgba(255,255,255,.7);position:relative;top:-9px}.annotator-filter .annotator-filter-navigation,.annotator-filter .annotator-filter-property{position:relative;display:inline-block;overflow:hidden;line-height:10px;padding:2px 0;margin-right:8px}.annotator-filter .annotator-filter-navigation button,.annotator-filter .annotator-filter-property label{text-align:left;display:block;float:left;line-height:20px;-webkit-border-radius:10px 0 0 10px;-moz-border-radius:10px 0 0 10px;-o-border-radius:10px 0 0 10px;border-radius:10px 0 0 10px}.annotator-filter .annotator-filter-property label{padding-left:8px}.annotator-filter .annotator-filter-property input{display:block;float:right;-webkit-appearance:none;border:1px solid #878787;border-left:none;padding:2px 4px;line-height:16px;min-height:16px;font-size:12px;width:150px;color:#333;background-color:#f8f8f8;-webkit-border-radius:0 10px 10px 0;-moz-border-radius:0 10px 10px 0;-o-border-radius:0 10px 10px 0;border-radius:0 10px 10px 0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-o-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2)}.annotator-filter .annotator-filter-property input:focus{outline:0;background-color:#fff}.annotator-filter .annotator-filter-clear{position:absolute;right:3px;top:6px;border:none;text-indent:-900em;width:15px;height:15px;background-position:0 -90px;opacity:.4}.annotator-filter .annotator-filter-clear:focus,.annotator-filter .annotator-filter-clear:hover{opacity:.8}.annotator-filter .annotator-filter-clear:active{opacity:1}.annotator-filter .annotator-filter-navigation button{border:1px solid #a2a2a2;padding:0;text-indent:-900px;width:20px;min-height:22px;-webkit-box-shadow:inset 0 0 5px rgba(255,255,255,.2),inset 0 0 1px rgba(255,255,255,.8);-moz-box-shadow:inset 0 0 5px rgba(255,255,255,.2),inset 0 0 1px rgba(255,255,255,.8);-o-box-shadow:inset 0 0 5px rgba(255,255,255,.2),inset 0 0 1px rgba(255,255,255,.8);box-shadow:inset 0 0 5px rgba(255,255,255,.2),inset 0 0 1px rgba(255,255,255,.8)}.annotator-filter .annotator-filter-navigation button,.annotator-filter .annotator-filter-navigation button:focus,.annotator-filter .annotator-filter-navigation button:hover{color:transparent}.annotator-filter .annotator-filter-navigation button:after{position:absolute;top:8px;left:8px;content:"";display:block;width:9px;height:9px;background-position:0 -210px}.annotator-filter .annotator-filter-navigation button:hover:after{background-position:0 -225px}.annotator-filter .annotator-filter-navigation .annotator-filter-next{-webkit-border-radius:0 10px 10px 0;-moz-border-radius:0 10px 10px 0;-o-border-radius:0 10px 10px 0;border-radius:0 10px 10px 0;border-left:none}.annotator-filter .annotator-filter-navigation .annotator-filter-next:after{left:auto;right:7px;background-position:0 -240px}.annotator-filter .annotator-filter-navigation .annotator-filter-next:hover:after{background-position:0 -255px}.annotator-hl-active{background:#FFFF0A;background:rgba(255,255,10,.8);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#CCFFFF0A, endColorstr=#CCFFFF0A)"}.annotator-hl-filtered{background-color:transparent}'; +},{}],10:[function(a,b,c){!function(a,c){"object"==typeof b&&"object"==typeof b.exports?b.exports=a.document?c(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return c(a)}:c(a)}("undefined"!=typeof window?window:this,function(a,b){function c(a){var b=!!a&&"length"in a&&a.length,c=na.type(a);return"function"!==c&&!na.isWindow(a)&&("array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a)}function d(a,b,c){if(na.isFunction(b))return na.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return na.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(xa.test(b))return na.filter(b,a,c);b=na.filter(b,a)}return na.grep(a,function(a){return na.inArray(a,b)>-1!==c})}function e(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}function f(a){var b={};return na.each(a.match(Da)||[],function(a,c){b[c]=!0}),b}function g(){da.addEventListener?(da.removeEventListener("DOMContentLoaded",h),a.removeEventListener("load",h)):(da.detachEvent("onreadystatechange",h),a.detachEvent("onload",h))}function h(){(da.addEventListener||"load"===a.event.type||"complete"===da.readyState)&&(g(),na.ready())}function i(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(Ia,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c||"false"!==c&&("null"===c?null:+c+""===c?+c:Ha.test(c)?na.parseJSON(c):c)}catch(e){}na.data(a,b,c)}else c=void 0}return c}function j(a){var b;for(b in a)if(("data"!==b||!na.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function k(a,b,c,d){if(Ga(a)){var e,f,g=na.expando,h=a.nodeType,i=h?na.cache:a,j=h?a[g]:a[g]&&g;if(j&&i[j]&&(d||i[j].data)||void 0!==c||"string"!=typeof b)return j||(j=h?a[g]=ca.pop()||na.guid++:g),i[j]||(i[j]=h?{}:{toJSON:na.noop}),"object"!=typeof b&&"function"!=typeof b||(d?i[j]=na.extend(i[j],b):i[j].data=na.extend(i[j].data,b)),f=i[j],d||(f.data||(f.data={}),f=f.data),void 0!==c&&(f[na.camelCase(b)]=c),"string"==typeof b?(e=f[b],null==e&&(e=f[na.camelCase(b)])):e=f,e}}function l(a,b,c){if(Ga(a)){var d,e,f=a.nodeType,g=f?na.cache:a,h=f?a[na.expando]:na.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){na.isArray(b)?b=b.concat(na.map(b,na.camelCase)):b in d?b=[b]:(b=na.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;for(;e--;)delete d[b[e]];if(c?!j(d):!na.isEmptyObject(d))return}(c||(delete g[h].data,j(g[h])))&&(f?na.cleanData([a],!0):la.deleteExpando||g!=g.window?delete g[h]:g[h]=void 0)}}}function m(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return na.css(a,b,"")},i=h(),j=c&&c[3]||(na.cssNumber[b]?"":"px"),k=(na.cssNumber[b]||"px"!==j&&+i)&&Ka.exec(na.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,na.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}function n(a){var b=Sa.split("|"),c=a.createDocumentFragment();if(c.createElement)for(;b.length;)c.createElement(b.pop());return c}function o(a,b){var c,d,e=0,f="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||na.nodeName(d,b)?f.push(d):na.merge(f,o(d,b));return void 0===b||b&&na.nodeName(a,b)?na.merge([a],f):f}function p(a,b){for(var c,d=0;null!=(c=a[d]);d++)na._data(c,"globalEval",!b||na._data(b[d],"globalEval"))}function q(a){Oa.test(a.type)&&(a.defaultChecked=a.checked)}function r(a,b,c,d,e){for(var f,g,h,i,j,k,l,m=a.length,r=n(b),s=[],t=0;t"!==l[1]||Va.test(g)?0:i:i.firstChild,f=g&&g.childNodes.length;f--;)na.nodeName(k=g.childNodes[f],"tbody")&&!k.childNodes.length&&g.removeChild(k);for(na.merge(s,i.childNodes),i.textContent="";i.firstChild;)i.removeChild(i.firstChild);i=r.lastChild}else s.push(b.createTextNode(g));for(i&&r.removeChild(i),la.appendChecked||na.grep(o(s,"input"),q),t=0;g=s[t++];)if(d&&na.inArray(g,d)>-1)e&&e.push(g);else if(h=na.contains(g.ownerDocument,g),i=o(r.appendChild(g),"script"),h&&p(i),c)for(f=0;g=i[f++];)Qa.test(g.type||"")&&c.push(g);return i=null,r}function s(){return!0}function t(){return!1}function u(){try{return da.activeElement}catch(a){}}function v(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)v(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=t;else if(!e)return a;return 1===f&&(g=e,e=function(a){return na().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=na.guid++)),a.each(function(){na.event.add(this,b,e,d,c)})}function w(a,b){return na.nodeName(a,"table")&&na.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function x(a){return a.type=(null!==na.find.attr(a,"type"))+"/"+a.type,a}function y(a){var b=eb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function z(a,b){if(1===b.nodeType&&na.hasData(a)){var c,d,e,f=na._data(a),g=na._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;d1&&"string"==typeof n&&!la.checkClone&&db.test(n))return a.each(function(e){var f=a.eq(e);p&&(b[0]=n.call(this,e,f.html())),B(f,b,c,d)});if(l&&(j=r(b,a[0].ownerDocument,!1,a,d),e=j.firstChild,1===j.childNodes.length&&(j=e),e||d)){for(h=na.map(o(j,"script"),x),g=h.length;k")).appendTo(b.documentElement),b=(ib[0].contentWindow||ib[0].contentDocument).document,b.write(),b.close(),c=D(a,b),ib.detach()),jb[a]=c),c}function F(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}function G(a){if(a in yb)return a;for(var b=a.charAt(0).toUpperCase()+a.slice(1),c=xb.length;c--;)if(a=xb[c]+b,a in yb)return a}function H(a,b){for(var c,d,e,f=[],g=0,h=a.length;g=0&&c=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==na.type(a)||a.nodeType||na.isWindow(a))return!1;try{if(a.constructor&&!ka.call(a,"constructor")&&!ka.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(!la.ownFirst)for(b in a)return ka.call(a,b);for(b in a);return void 0===b||ka.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?ia[ja.call(a)]||"object":typeof a},globalEval:function(b){b&&na.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(pa,"ms-").replace(qa,ra)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var d,e=0;if(c(a))for(d=a.length;ew.cacheLength&&delete a[b.shift()],a[c+" "]=d}var b=[];return a}function d(a){return a[N]=!0,a}function e(a){var b=G.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function f(a,b){for(var c=a.split("|"),d=c.length;d--;)w.attrHandle[c[d]]=b}function g(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||V)-(~a.sourceIndex||V);if(d)return d;if(c)for(;c=c.nextSibling;)if(c===b)return-1;return a?1:-1}function h(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function i(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function j(a){return d(function(b){return b=+b,d(function(c,d){for(var e,f=a([],c.length,b),g=f.length;g--;)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function k(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}function l(){}function m(a){for(var b=0,c=a.length,d="";b1?function(b,c,d){for(var e=a.length;e--;)if(!a[e](b,c,d))return!1;return!0}:a[0]}function p(a,c,d){for(var e=0,f=c.length;e-1&&(d[j]=!(g[j]=l))}}else t=q(t===g?t.splice(o,t.length):t),f?f(null,g,t,i):$.apply(g,t)})}function s(a){for(var b,c,d,e=a.length,f=w.relative[a[0].type],g=f||w.relative[" "],h=f?1:0,i=n(function(a){return a===b},g,!0),j=n(function(a){return aa(b,a)>-1},g,!0),k=[function(a,c,d){var e=!f&&(d||c!==C)||((b=c).nodeType?i(a,c,d):j(a,c,d));return b=null,e}];h1&&o(k),h>1&&m(a.slice(0,h-1).concat({value:" "===a[h-2].type?"*":""})).replace(ha,"$1"),c,h0,f=a.length>0,g=function(d,g,h,i,j){var k,l,m,n=0,o="0",p=d&&[],r=[],s=C,t=d||f&&w.find.TAG("*",j),u=P+=null==s?1:Math.random()||.1,v=t.length;for(j&&(C=g===G||g||j);o!==v&&null!=(k=t[o]);o++){if(f&&k){for(l=0,g||k.ownerDocument===G||(F(k),h=!I);m=a[l++];)if(m(k,g||G,h)){i.push(k);break}j&&(P=u)}e&&((k=!m&&k)&&n--,d&&p.push(k))}if(n+=o,e&&o!==n){for(l=0;m=c[l++];)m(p,r,g,h);if(d){if(n>0)for(;o--;)p[o]||r[o]||(r[o]=Y.call(i));r=q(r)}$.apply(i,r),j&&!d&&r.length>0&&n+c.length>1&&b.uniqueSort(i)}return j&&(P=u,C=s),p};return e?d(g):g}var u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N="sizzle"+1*new Date,O=a.document,P=0,Q=0,R=c(),S=c(),T=c(),U=function(a,b){return a===b&&(E=!0),0},V=1<<31,W={}.hasOwnProperty,X=[],Y=X.pop,Z=X.push,$=X.push,_=X.slice,aa=function(a,b){for(var c=0,d=a.length;c+~]|"+ca+")"+ca+"*"),ka=new RegExp("="+ca+"*([^\\]'\"]*?)"+ca+"*\\]","g"),la=new RegExp(fa),ma=new RegExp("^"+da+"$"),na={ID:new RegExp("^#("+da+")"),CLASS:new RegExp("^\\.("+da+")"),TAG:new RegExp("^("+da+"|[*])"),ATTR:new RegExp("^"+ea),PSEUDO:new RegExp("^"+fa),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ca+"*(even|odd|(([+-]|)(\\d*)n|)"+ca+"*(?:([+-]|)"+ca+"*(\\d+)|))"+ca+"*\\)|)","i"),bool:new RegExp("^(?:"+ba+")$","i"),needsContext:new RegExp("^"+ca+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ca+"*((?:-\\d)?\\d*)"+ca+"*\\)|)(?=[^-]|$)","i")},oa=/^(?:input|select|textarea|button)$/i,pa=/^h\d$/i,qa=/^[^{]+\{\s*\[native \w/,ra=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,sa=/[+~]/,ta=/'|\\/g,ua=new RegExp("\\\\([\\da-f]{1,6}"+ca+"?|("+ca+")|.)","ig"),va=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},wa=function(){F()};try{$.apply(X=_.call(O.childNodes),O.childNodes),X[O.childNodes.length].nodeType}catch(xa){$={apply:X.length?function(a,b){Z.apply(a,_.call(b))}:function(a,b){for(var c=a.length,d=0;a[c++]=b[d++];);a.length=c-1}}}v=b.support={},y=b.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},F=b.setDocument=function(a){var b,c,d=a?a.ownerDocument||a:O;return d!==G&&9===d.nodeType&&d.documentElement?(G=d,H=G.documentElement,I=!y(G),(c=G.defaultView)&&c.top!==c&&(c.addEventListener?c.addEventListener("unload",wa,!1):c.attachEvent&&c.attachEvent("onunload",wa)),v.attributes=e(function(a){return a.className="i",!a.getAttribute("className")}),v.getElementsByTagName=e(function(a){return a.appendChild(G.createComment("")),!a.getElementsByTagName("*").length}),v.getElementsByClassName=qa.test(G.getElementsByClassName),v.getById=e(function(a){return H.appendChild(a).id=N,!G.getElementsByName||!G.getElementsByName(N).length}),v.getById?(w.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&I){var c=b.getElementById(a);return c?[c]:[]}},w.filter.ID=function(a){var b=a.replace(ua,va);return function(a){return a.getAttribute("id")===b}}):(delete w.find.ID,w.filter.ID=function(a){var b=a.replace(ua,va);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),w.find.TAG=v.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):v.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){for(;c=f[e++];)1===c.nodeType&&d.push(c);return d}return f},w.find.CLASS=v.getElementsByClassName&&function(a,b){if("undefined"!=typeof b.getElementsByClassName&&I)return b.getElementsByClassName(a)},K=[],J=[],(v.qsa=qa.test(G.querySelectorAll))&&(e(function(a){H.appendChild(a).innerHTML="
      ",a.querySelectorAll("[msallowcapture^='']").length&&J.push("[*^$]="+ca+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||J.push("\\["+ca+"*(?:value|"+ba+")"),a.querySelectorAll("[id~="+N+"-]").length||J.push("~="),a.querySelectorAll(":checked").length||J.push(":checked"),a.querySelectorAll("a#"+N+"+*").length||J.push(".#.+[+~]")}),e(function(a){var b=G.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&J.push("name"+ca+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||J.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),J.push(",.*:")})),(v.matchesSelector=qa.test(L=H.matches||H.webkitMatchesSelector||H.mozMatchesSelector||H.oMatchesSelector||H.msMatchesSelector))&&e(function(a){v.disconnectedMatch=L.call(a,"div"),L.call(a,"[s!='']:x"),K.push("!=",fa)}),J=J.length&&new RegExp(J.join("|")),K=K.length&&new RegExp(K.join("|")),b=qa.test(H.compareDocumentPosition),M=b||qa.test(H.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)for(;b=b.parentNode;)if(b===a)return!0;return!1},U=b?function(a,b){if(a===b)return E=!0,0;var c=!a.compareDocumentPosition-!b.compareDocumentPosition;return c?c:(c=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&c||!v.sortDetached&&b.compareDocumentPosition(a)===c?a===G||a.ownerDocument===O&&M(O,a)?-1:b===G||b.ownerDocument===O&&M(O,b)?1:D?aa(D,a)-aa(D,b):0:4&c?-1:1)}:function(a,b){if(a===b)return E=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===G?-1:b===G?1:e?-1:f?1:D?aa(D,a)-aa(D,b):0;if(e===f)return g(a,b);for(c=a;c=c.parentNode;)h.unshift(c);for(c=b;c=c.parentNode;)i.unshift(c);for(;h[d]===i[d];)d++;return d?g(h[d],i[d]):h[d]===O?-1:i[d]===O?1:0},G):G},b.matches=function(a,c){return b(a,null,null,c)},b.matchesSelector=function(a,c){if((a.ownerDocument||a)!==G&&F(a),c=c.replace(ka,"='$1']"),v.matchesSelector&&I&&!T[c+" "]&&(!K||!K.test(c))&&(!J||!J.test(c)))try{var d=L.call(a,c);if(d||v.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return b(c,G,null,[a]).length>0},b.contains=function(a,b){return(a.ownerDocument||a)!==G&&F(a),M(a,b)},b.attr=function(a,b){(a.ownerDocument||a)!==G&&F(a);var c=w.attrHandle[b.toLowerCase()],d=c&&W.call(w.attrHandle,b.toLowerCase())?c(a,b,!I):void 0;return void 0!==d?d:v.attributes||!I?a.getAttribute(b):(d=a.getAttributeNode(b))&&d.specified?d.value:null},b.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},b.uniqueSort=function(a){var b,c=[],d=0,e=0;if(E=!v.detectDuplicates,D=!v.sortStable&&a.slice(0),a.sort(U),E){for(;b=a[e++];)b===a[e]&&(d=c.push(e));for(;d--;)a.splice(c[d],1)}return D=null,a},x=b.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(1===e||9===e||11===e){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=x(a)}else if(3===e||4===e)return a.nodeValue}else for(;b=a[d++];)c+=x(b);return c},w=b.selectors={cacheLength:50,createPseudo:d,match:na,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(ua,va),a[3]=(a[3]||a[4]||a[5]||"").replace(ua,va),"~="===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]||b.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]&&b.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return na.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&la.test(c)&&(b=z(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(ua,va).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=R[a+" "];return b||(b=new RegExp("(^|"+ca+")"+a+"("+ca+"|$)"))&&R(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,c,d){return function(e){var f=b.attr(e,a);return null==f?"!="===c:!c||(f+="","="===c?f===d:"!="===c?f!==d:"^="===c?d&&0===f.indexOf(d):"*="===c?d&&f.indexOf(d)>-1:"$="===c?d&&f.slice(-d.length)===d:"~="===c?(" "+f.replace(ga," ")+" ").indexOf(d)>-1:"|="===c&&(f===d||f.slice(0,d.length+1)===d+"-"))}},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,t=!1;if(q){if(f){for(;p;){for(m=b;m=m[p];)if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){for(m=q,l=m[N]||(m[N]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===P&&j[1], t=n&&j[2],m=n&&q.childNodes[n];m=++n&&m&&m[p]||(t=n=0)||o.pop();)if(1===m.nodeType&&++t&&m===b){k[a]=[P,n,t];break}}else if(s&&(m=b,l=m[N]||(m[N]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===P&&j[1],t=n),t===!1)for(;(m=++n&&m&&m[p]||(t=n=0)||o.pop())&&((h?m.nodeName.toLowerCase()!==r:1!==m.nodeType)||!++t||(s&&(l=m[N]||(m[N]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[P,t]),m!==b)););return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,c){var e,f=w.pseudos[a]||w.setFilters[a.toLowerCase()]||b.error("unsupported pseudo: "+a);return f[N]?f(c):f.length>1?(e=[a,a,"",c],w.setFilters.hasOwnProperty(a.toLowerCase())?d(function(a,b){for(var d,e=f(a,c),g=e.length;g--;)d=aa(a,e[g]),a[d]=!(b[d]=e[g])}):function(a){return f(a,0,e)}):f}},pseudos:{not:d(function(a){var b=[],c=[],e=A(a.replace(ha,"$1"));return e[N]?d(function(a,b,c,d){for(var f,g=e(a,null,d,[]),h=a.length;h--;)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,d,f){return b[0]=a,e(b,null,f,c),b[0]=null,!c.pop()}}),has:d(function(a){return function(c){return b(a,c).length>0}}),contains:d(function(a){return a=a.replace(ua,va),function(b){return(b.textContent||b.innerText||x(b)).indexOf(a)>-1}}),lang:d(function(a){return ma.test(a||"")||b.error("unsupported lang: "+a),a=a.replace(ua,va).toLowerCase(),function(b){var c;do if(c=I?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===H},focus:function(a){return a===G.activeElement&&(!G.hasFocus||G.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!w.pseudos.empty(a)},header:function(a){return pa.test(a.nodeName)},input:function(a){return oa.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:j(function(){return[0]}),last:j(function(a,b){return[b-1]}),eq:j(function(a,b,c){return[c<0?c+b:c]}),even:j(function(a,b){for(var c=0;c=0;)a.push(d);return a}),gt:j(function(a,b,c){for(var d=c<0?c+b:c;++d2&&"ID"===(g=f[0]).type&&v.getById&&9===b.nodeType&&I&&w.relative[f[1].type]){if(b=(w.find.ID(g.matches[0].replace(ua,va),b)||[])[0],!b)return c;j&&(b=b.parentNode),a=a.slice(f.shift().value.length)}for(e=na.needsContext.test(a)?0:f.length;e--&&(g=f[e],!w.relative[h=g.type]);)if((i=w.find[h])&&(d=i(g.matches[0].replace(ua,va),sa.test(f[0].type)&&k(b.parentNode)||b))){if(f.splice(e,1),a=d.length&&m(f),!a)return $.apply(c,d),c;break}}return(j||A(a,l))(d,b,!I,c,!b||sa.test(a)&&k(b.parentNode)||b),c},v.sortStable=N.split("").sort(U).join("")===N,v.detectDuplicates=!!E,F(),v.sortDetached=e(function(a){return 1&a.compareDocumentPosition(G.createElement("div"))}),e(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||f("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),v.attributes&&e(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||f("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),e(function(a){return null==a.getAttribute("disabled")})||f(ba,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),b}(a);na.find=sa,na.expr=sa.selectors,na.expr[":"]=na.expr.pseudos,na.uniqueSort=na.unique=sa.uniqueSort,na.text=sa.getText,na.isXMLDoc=sa.isXML,na.contains=sa.contains;var ta=function(a,b,c){for(var d=[],e=void 0!==c;(a=a[b])&&9!==a.nodeType;)if(1===a.nodeType){if(e&&na(a).is(c))break;d.push(a)}return d},ua=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},va=na.expr.match.needsContext,wa=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,xa=/^.[^:#\[\.,]*$/;na.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?na.find.matchesSelector(d,a)?[d]:[]:na.find.matches(a,na.grep(b,function(a){return 1===a.nodeType}))},na.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(na(a).filter(function(){for(b=0;b1?na.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(d(this,a||[],!1))},not:function(a){return this.pushStack(d(this,a||[],!0))},is:function(a){return!!d(this,"string"==typeof a&&va.test(a)?na(a):a||[],!1).length}});var ya,za=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,Aa=na.fn.init=function(a,b,c){var d,e;if(!a)return this;if(c=c||ya,"string"==typeof a){if(d="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:za.exec(a),!d||!d[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(d[1]){if(b=b instanceof na?b[0]:b,na.merge(this,na.parseHTML(d[1],b&&b.nodeType?b.ownerDocument||b:da,!0)),wa.test(d[1])&&na.isPlainObject(b))for(d in b)na.isFunction(this[d])?this[d](b[d]):this.attr(d,b[d]);return this}if(e=da.getElementById(d[2]),e&&e.parentNode){if(e.id!==d[2])return ya.find(a);this.length=1,this[0]=e}return this.context=da,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):na.isFunction(a)?"undefined"!=typeof c.ready?c.ready(a):a(na):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),na.makeArray(a,this))};Aa.prototype=na.fn,ya=na(da);var Ba=/^(?:parents|prev(?:Until|All))/,Ca={children:!0,contents:!0,next:!0,prev:!0};na.fn.extend({has:function(a){var b,c=na(a,this),d=c.length;return this.filter(function(){for(b=0;b-1:1===c.nodeType&&na.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?na.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?na.inArray(this[0],na(a)):na.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(na.uniqueSort(na.merge(this.get(),na(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}}),na.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return ta(a,"parentNode")},parentsUntil:function(a,b,c){return ta(a,"parentNode",c)},next:function(a){return e(a,"nextSibling")},prev:function(a){return e(a,"previousSibling")},nextAll:function(a){return ta(a,"nextSibling")},prevAll:function(a){return ta(a,"previousSibling")},nextUntil:function(a,b,c){return ta(a,"nextSibling",c)},prevUntil:function(a,b,c){return ta(a,"previousSibling",c)},siblings:function(a){return ua((a.parentNode||{}).firstChild,a)},children:function(a){return ua(a.firstChild)},contents:function(a){return na.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:na.merge([],a.childNodes)}},function(a,b){na.fn[a]=function(c,d){var e=na.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=na.filter(d,e)),this.length>1&&(Ca[a]||(e=na.uniqueSort(e)),Ba.test(a)&&(e=e.reverse())),this.pushStack(e)}});var Da=/\S+/g;na.Callbacks=function(a){a="string"==typeof a?f(a):na.extend({},a);var b,c,d,e,g=[],h=[],i=-1,j=function(){for(e=a.once,d=b=!0;h.length;i=-1)for(c=h.shift();++i-1;)g.splice(c,1),c<=i&&i--}),this},has:function(a){return a?na.inArray(a,g)>-1:g.length>0},empty:function(){return g&&(g=[]),this},disable:function(){return e=h=[],g=c="",this},disabled:function(){return!g},lock:function(){return e=!0,c||k.disable(),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],h.push(c),b||j()),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},na.extend({Deferred:function(a){var b=[["resolve","done",na.Callbacks("once memory"),"resolved"],["reject","fail",na.Callbacks("once memory"),"rejected"],["notify","progress",na.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return na.Deferred(function(c){na.each(b,function(b,f){var g=na.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&na.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?na.extend(a,d):d}},e={};return d.pipe=d.then,na.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,c,d,e=0,f=ea.call(arguments),g=f.length,h=1!==g||a&&na.isFunction(a.promise)?g:0,i=1===h?a:na.Deferred(),j=function(a,c,d){return function(e){c[a]=this,d[a]=arguments.length>1?ea.call(arguments):e,d===b?i.notifyWith(c,d):--h||i.resolveWith(c,d)}};if(g>1)for(b=new Array(g),c=new Array(g),d=new Array(g);e0||(Ea.resolveWith(da,[na]),na.fn.triggerHandler&&(na(da).triggerHandler("ready"),na(da).off("ready"))))}}),na.ready.promise=function(b){if(!Ea)if(Ea=na.Deferred(),"complete"===da.readyState||"loading"!==da.readyState&&!da.documentElement.doScroll)a.setTimeout(na.ready);else if(da.addEventListener)da.addEventListener("DOMContentLoaded",h),a.addEventListener("load",h);else{da.attachEvent("onreadystatechange",h),a.attachEvent("onload",h);var c=!1;try{c=null==a.frameElement&&da.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!na.isReady){try{c.doScroll("left")}catch(b){return a.setTimeout(e,50)}g(),na.ready()}}()}return Ea.promise(b)},na.ready.promise();var Fa;for(Fa in na(la))break;la.ownFirst="0"===Fa,la.inlineBlockNeedsLayout=!1,na(function(){var a,b,c,d;c=da.getElementsByTagName("body")[0],c&&c.style&&(b=da.createElement("div"),d=da.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),"undefined"!=typeof b.style.zoom&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",la.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=da.createElement("div");la.deleteExpando=!0;try{delete a.test}catch(b){la.deleteExpando=!1}a=null}();var Ga=function(a){var b=na.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return(1===c||9===c)&&(!b||b!==!0&&a.getAttribute("classid")===b)},Ha=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Ia=/([A-Z])/g;na.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?na.cache[a[na.expando]]:a[na.expando],!!a&&!j(a)},data:function(a,b,c){return k(a,b,c)},removeData:function(a,b){return l(a,b)},_data:function(a,b,c){return k(a,b,c,!0)},_removeData:function(a,b){return l(a,b,!0)}}),na.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=na.data(f),1===f.nodeType&&!na._data(f,"parsedAttrs"))){for(c=g.length;c--;)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=na.camelCase(d.slice(5)),i(f,d,e[d])));na._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){na.data(this,a)}):arguments.length>1?this.each(function(){na.data(this,a,b)}):f?i(f,a,na.data(f,a)):void 0},removeData:function(a){return this.each(function(){na.removeData(this,a)})}}),na.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=na._data(a,b),c&&(!d||na.isArray(c)?d=na._data(a,b,na.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=na.queue(a,b),d=c.length,e=c.shift(),f=na._queueHooks(a,b),g=function(){na.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 na._data(a,c)||na._data(a,c,{empty:na.Callbacks("once memory").add(function(){na._removeData(a,b+"queue"),na._removeData(a,c)})})}}),na.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length
      a",la.leadingWhitespace=3===a.firstChild.nodeType,la.tbody=!a.getElementsByTagName("tbody").length,la.htmlSerialize=!!a.getElementsByTagName("link").length,la.html5Clone="<:nav>"!==da.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,b.appendChild(c),la.appendChecked=c.checked,a.innerHTML="",la.noCloneChecked=!!a.cloneNode(!0).lastChild.defaultValue,b.appendChild(a),c=da.createElement("input"),c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),a.appendChild(c),la.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,la.noCloneEvent=!!a.addEventListener,a[na.expando]=1,la.attributes=!a.getAttribute(na.expando)}();var Ta={option:[1,""],legend:[1,"
      ","
      "],area:[1,"",""],param:[1,"",""],thead:[1,"","
      "],tr:[2,"","
      "],col:[2,"","
      "],td:[3,"","
      "],_default:la.htmlSerialize?[0,"",""]:[1,"X
      ","
      "]};Ta.optgroup=Ta.option,Ta.tbody=Ta.tfoot=Ta.colgroup=Ta.caption=Ta.thead,Ta.th=Ta.td;var Ua=/<|&#?\w+;/,Va=/-1&&(o=n.split("."),n=o.shift(),o.sort()),g=n.indexOf(":")<0&&"on"+n,b=b[na.expando]?b:new na.Event(n,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=o.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:na.makeArray(c,[b]),j=na.event.special[n]||{},e||!j.trigger||j.trigger.apply(d,c)!==!1)){if(!e&&!j.noBubble&&!na.isWindow(d)){for(i=j.delegateType||n,Za.test(i+n)||(h=h.parentNode);h;h=h.parentNode)m.push(h),k=h;k===(d.ownerDocument||da)&&m.push(k.defaultView||k.parentWindow||a)}for(l=0;(h=m[l++])&&!b.isPropagationStopped();)b.type=l>1?i:j.bindType||n,f=(na._data(h,"events")||{})[b.type]&&na._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&Ga(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=n,!e&&!b.isDefaultPrevented()&&(!j._default||j._default.apply(m.pop(),c)===!1)&&Ga(d)&&g&&d[n]&&!na.isWindow(d)){k=d[g],k&&(d[g]=null),na.event.triggered=n;try{d[n]()}catch(p){}na.event.triggered=void 0,k&&(d[g]=k)}return b.result}},dispatch:function(a){a=na.event.fix(a);var b,c,d,e,f,g=[],h=ea.call(arguments),i=(na._data(this,"events")||{})[a.type]||[],j=na.event.special[a.type]||{};if(h[0]=a,a.delegateTarget=this,!j.preDispatch||j.preDispatch.call(this,a)!==!1){for(g=na.event.handlers.call(this,a,i),b=0;(e=g[b++])&&!a.isPropagationStopped();)for(a.currentTarget=e.elem,c=0;(f=e.handlers[c++])&&!a.isImmediatePropagationStopped();)a.rnamespace&&!a.rnamespace.test(f.namespace)||(a.handleObj=f,a.data=f.data,d=((na.event.special[f.origType]||{}).handle||f.handler).apply(e.elem,h),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()));return j.postDispatch&&j.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&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;c-1:na.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]","i"),bb=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,cb=/\s*$/g,gb=n(da),hb=gb.appendChild(da.createElement("div"));na.extend({htmlPrefilter:function(a){return a.replace(bb,"<$1>")},clone:function(a,b,c){var d,e,f,g,h,i=na.contains(a.ownerDocument,a);if(la.html5Clone||na.isXMLDoc(a)||!ab.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(hb.innerHTML=a.outerHTML,hb.removeChild(f=hb.firstChild)),!(la.noCloneEvent&&la.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||na.isXMLDoc(a)))for(d=o(f),h=o(a),g=0;null!=(e=h[g]);++g)d[g]&&A(e,d[g]);if(b)if(c)for(h=h||o(a),d=d||o(f),g=0;null!=(e=h[g]);g++)z(e,d[g]);else z(a,f);return d=o(f,"script"),d.length>0&&p(d,!i&&o(a,"script")),d=h=e=null,f},cleanData:function(a,b){for(var c,d,e,f,g=0,h=na.expando,i=na.cache,j=la.attributes,k=na.event.special;null!=(c=a[g]);g++)if((b||Ga(c))&&(e=c[h],f=e&&i[e])){if(f.events)for(d in f.events)k[d]?na.event.remove(c,d):na.removeEvent(c,d,f.handle);i[e]&&(delete i[e],j||"undefined"==typeof c.removeAttribute?c[h]=void 0:c.removeAttribute(h),ca.push(e))}}}),na.fn.extend({domManip:B,detach:function(a){return C(this,a,!0)},remove:function(a){return C(this,a)},text:function(a){return Na(this,function(a){return void 0===a?na.text(this):this.empty().append((this[0]&&this[0].ownerDocument||da).createTextNode(a))},null,a,arguments.length)},append:function(){return B(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=w(this,a);b.appendChild(a)}})},prepend:function(){return B(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=w(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return B(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return B(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){for(1===a.nodeType&&na.cleanData(o(a,!1));a.firstChild;)a.removeChild(a.firstChild);a.options&&na.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return na.clone(this,a,b)})},html:function(a){return Na(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(_a,""):void 0;if("string"==typeof a&&!cb.test(a)&&(la.htmlSerialize||!ab.test(a))&&(la.leadingWhitespace||!Ra.test(a))&&!Ta[(Pa.exec(a)||["",""])[1].toLowerCase()]){a=na.htmlPrefilter(a);try{for(;ct",j.childNodes[0].style.borderCollapse="separate",b=j.getElementsByTagName("td"),b[0].style.cssText="margin:0;border:0;padding:0;display:none",f=0===b[0].offsetHeight,f&&(b[0].style.display="",b[1].style.display="none",f=0===b[0].offsetHeight)),l.removeChild(i)}var c,d,e,f,g,h,i=da.createElement("div"),j=da.createElement("div");j.style&&(j.style.cssText="float:left;opacity:.5",la.opacity="0.5"===j.style.opacity,la.cssFloat=!!j.style.cssFloat,j.style.backgroundClip="content-box",j.cloneNode(!0).style.backgroundClip="",la.clearCloneStyle="content-box"===j.style.backgroundClip,i=da.createElement("div"),i.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",j.innerHTML="",i.appendChild(j),la.boxSizing=""===j.style.boxSizing||""===j.style.MozBoxSizing||""===j.style.WebkitBoxSizing,na.extend(la,{reliableHiddenOffsets:function(){return null==c&&b(),f},boxSizingReliable:function(){return null==c&&b(),e},pixelMarginRight:function(){return null==c&&b(),d},pixelPosition:function(){return null==c&&b(),c},reliableMarginRight:function(){return null==c&&b(),g},reliableMarginLeft:function(){return null==c&&b(),h}}))}();var ob,pb,qb=/^(top|right|bottom|left)$/;a.getComputedStyle?(ob=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)},pb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||ob(a),g=c?c.getPropertyValue(b)||c[b]:void 0,""!==g&&void 0!==g||na.contains(a.ownerDocument,a)||(g=na.style(a,b)),c&&!la.pixelMarginRight()&&lb.test(g)&&kb.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+""}):nb.currentStyle&&(ob=function(a){return a.currentStyle},pb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||ob(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),lb.test(g)&&!qb.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});var rb=/alpha\([^)]*\)/i,sb=/opacity\s*=\s*([^)]*)/i,tb=/^(none|table(?!-c[ea]).+)/,ub=new RegExp("^("+Ja+")(.*)$","i"),vb={position:"absolute",visibility:"hidden",display:"block"},wb={letterSpacing:"0",fontWeight:"400"},xb=["Webkit","O","Moz","ms"],yb=da.createElement("div").style;na.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=pb(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,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":la.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=na.camelCase(b),i=a.style;if(b=na.cssProps[h]||(na.cssProps[h]=G(h)||h),g=na.cssHooks[b]||na.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Ka.exec(c))&&e[1]&&(c=m(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(na.cssNumber[h]?"":"px")),la.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=na.camelCase(b);return b=na.cssProps[h]||(na.cssProps[h]=G(h)||h),g=na.cssHooks[b]||na.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=pb(a,b,d)),"normal"===f&&b in wb&&(f=wb[b]),""===c||c?(e=parseFloat(f),c===!0||isFinite(e)?e||0:f):f}}),na.each(["height","width"],function(a,b){na.cssHooks[b]={get:function(a,c,d){if(c)return tb.test(na.css(a,"display"))&&0===a.offsetWidth?mb(a,vb,function(){return K(a,b,d)}):K(a,b,d)},set:function(a,c,d){var e=d&&ob(a);return I(a,c,d?J(a,b,d,la.boxSizing&&"border-box"===na.css(a,"boxSizing",!1,e),e):0)}}}),la.opacity||(na.cssHooks.opacity={get:function(a,b){return sb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=na.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===na.trim(f.replace(rb,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=rb.test(f)?f.replace(rb,e):f+" "+e)}}),na.cssHooks.marginRight=F(la.reliableMarginRight,function(a,b){if(b)return mb(a,{display:"inline-block"},pb,[a,"marginRight"])}),na.cssHooks.marginLeft=F(la.reliableMarginLeft,function(a,b){if(b)return(parseFloat(pb(a,"marginLeft"))||(na.contains(a.ownerDocument,a)?a.getBoundingClientRect().left-mb(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}):0))+"px"}),na.each({margin:"",padding:"",border:"Width"},function(a,b){na.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];d<4;d++)e[a+La[d]+b]=f[d]||f[d-2]||f[0];return e}},kb.test(a)||(na.cssHooks[a+b].set=I)}),na.fn.extend({css:function(a,b){return Na(this,function(a,b,c){var d,e,f={},g=0;if(na.isArray(b)){for(d=ob(a),e=b.length;g1)},show:function(){return H(this,!0)},hide:function(){return H(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){Ma(this)?na(this).show():na(this).hide()})}}),na.Tween=L,L.prototype={constructor:L,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||na.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(na.cssNumber[c]?"":"px")},cur:function(){var a=L.propHooks[this.prop];return a&&a.get?a.get(this):L.propHooks._default.get(this)},run:function(a){var b,c=L.propHooks[this.prop];return this.options.duration?this.pos=b=na.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=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):L.propHooks._default.set(this),this}},L.prototype.init.prototype=L.prototype,L.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=na.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){na.fx.step[a.prop]?na.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[na.cssProps[a.prop]]&&!na.cssHooks[a.prop]?a.elem[a.prop]=a.now:na.style(a.elem,a.prop,a.now+a.unit)}}},L.propHooks.scrollTop=L.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},na.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},na.fx=L.prototype.init,na.fx.step={};var zb,Ab,Bb=/^(?:toggle|show|hide)$/,Cb=/queueHooks$/;na.Animation=na.extend(R,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return m(c.elem,a,Ka.exec(b),c),c}]},tweener:function(a,b){na.isFunction(a)?(b=a,a=["*"]):a=a.match(Da);for(var c,d=0,e=a.length;d
      a",a=c.getElementsByTagName("a")[0],b.setAttribute("type","checkbox"),c.appendChild(b),a=c.getElementsByTagName("a")[0],a.style.cssText="top:1px",la.getSetAttribute="t"!==c.className,la.style=/top/.test(a.getAttribute("style")),la.hrefNormalized="/a"===a.getAttribute("href"),la.checkOn=!!b.value,la.optSelected=e.selected,la.enctype=!!da.createElement("form").enctype,d.disabled=!0,la.optDisabled=!e.disabled,b=da.createElement("input"),b.setAttribute("value",""),la.input=""===b.getAttribute("value"),b.value="t",b.setAttribute("type","radio"),la.radioValue="t"===b.value}();var Db=/\r/g,Eb=/[\x20\t\r\n\f]+/g;na.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=na.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,na(this).val()):a,null==e?e="":"number"==typeof e?e+="":na.isArray(e)&&(e=na.map(e,function(a){return null==a?"":a+""})),b=na.valHooks[this.type]||na.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=na.valHooks[e.type]||na.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(Db,""):null==c?"":c)}}}),na.extend({valHooks:{option:{get:function(a){var b=na.find.attr(a,"value");return null!=b?b:na.trim(na.text(a)).replace(Eb," ")}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||e<0,g=f?null:[],h=f?e+1:d.length,i=e<0?h:f?e:0;i-1)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),na.each(["radio","checkbox"],function(){na.valHooks[this]={set:function(a,b){if(na.isArray(b))return a.checked=na.inArray(na(a).val(),b)>-1}},la.checkOn||(na.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var Fb,Gb,Hb=na.expr.attrHandle,Ib=/^(?:checked|selected)$/i,Jb=la.getSetAttribute,Kb=la.input;na.fn.extend({attr:function(a,b){return Na(this,na.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){na.removeAttr(this,a)})}}),na.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?na.prop(a,b,c):(1===f&&na.isXMLDoc(a)||(b=b.toLowerCase(),e=na.attrHooks[b]||(na.expr.match.bool.test(b)?Gb:Fb)),void 0!==c?null===c?void na.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=na.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!la.radioValue&&"radio"===b&&na.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(Da);if(f&&1===a.nodeType)for(;c=f[e++];)d=na.propFix[c]||c,na.expr.match.bool.test(c)?Kb&&Jb||!Ib.test(c)?a[d]=!1:a[na.camelCase("default-"+c)]=a[d]=!1:na.attr(a,c,""),a.removeAttribute(Jb?c:d)}}),Gb={set:function(a,b,c){return b===!1?na.removeAttr(a,c):Kb&&Jb||!Ib.test(c)?a.setAttribute(!Jb&&na.propFix[c]||c,c):a[na.camelCase("default-"+c)]=a[c]=!0,c}},na.each(na.expr.match.bool.source.match(/\w+/g),function(a,b){var c=Hb[b]||na.find.attr;Kb&&Jb||!Ib.test(b)?Hb[b]=function(a,b,d){var e,f;return d||(f=Hb[b],Hb[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,Hb[b]=f),e}:Hb[b]=function(a,b,c){if(!c)return a[na.camelCase("default-"+b)]?b.toLowerCase():null}}),Kb&&Jb||(na.attrHooks.value={set:function(a,b,c){return na.nodeName(a,"input")?void(a.defaultValue=b):Fb&&Fb.set(a,b,c)}}),Jb||(Fb={set:function(a,b,c){var d=a.getAttributeNode(c);if(d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c))return b}},Hb.id=Hb.name=Hb.coords=function(a,b,c){var d;if(!c)return(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},na.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);if(c&&c.specified)return c.value},set:Fb.set},na.attrHooks.contenteditable={set:function(a,b,c){Fb.set(a,""!==b&&b,c)}},na.each(["width","height"],function(a,b){na.attrHooks[b]={set:function(a,c){if(""===c)return a.setAttribute(b,"auto"),c}}})),la.style||(na.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var Lb=/^(?:input|select|textarea|button|object)$/i,Mb=/^(?:a|area)$/i;na.fn.extend({prop:function(a,b){return Na(this,na.prop,a,b,arguments.length>1)},removeProp:function(a){return a=na.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),na.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&na.isXMLDoc(a)||(b=na.propFix[b]||b,e=na.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){var b=na.find.attr(a,"tabindex");return b?parseInt(b,10):Lb.test(a.nodeName)||Mb.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),la.hrefNormalized||na.each(["href","src"],function(a,b){na.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),la.optSelected||(na.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),na.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){na.propFix[this.toLowerCase()]=this}),la.enctype||(na.propFix.enctype="encoding");var Nb=/[\t\r\n\f]/g;na.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(na.isFunction(a))return this.each(function(b){na(this).addClass(a.call(this,b,S(this)))});if("string"==typeof a&&a)for(b=a.match(Da)||[];c=this[i++];)if(e=S(c),d=1===c.nodeType&&(" "+e+" ").replace(Nb," ")){for(g=0;f=b[g++];)d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=na.trim(d),e!==h&&na.attr(c,"class",h)}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(na.isFunction(a))return this.each(function(b){na(this).removeClass(a.call(this,b,S(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a)for(b=a.match(Da)||[];c=this[i++];)if(e=S(c),d=1===c.nodeType&&(" "+e+" ").replace(Nb," ")){for(g=0;f=b[g++];)for(;d.indexOf(" "+f+" ")>-1;)d=d.replace(" "+f+" "," ");h=na.trim(d),e!==h&&na.attr(c,"class",h)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):na.isFunction(a)?this.each(function(c){na(this).toggleClass(a.call(this,c,S(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c)for(d=0,e=na(this),f=a.match(Da)||[];b=f[d++];)e.hasClass(b)?e.removeClass(b):e.addClass(b);else void 0!==a&&"boolean"!==c||(b=S(this),b&&na._data(this,"__className__",b),na.attr(this,"class",b||a===!1?"":na._data(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;for(b=" "+a+" ";c=this[d++];)if(1===c.nodeType&&(" "+S(c)+" ").replace(Nb," ").indexOf(b)>-1)return!0;return!1}}),na.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){na.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),na.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Ob=a.location,Pb=na.now(),Qb=/\?/,Rb=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;na.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=na.trim(b+"");return e&&!na.trim(e.replace(Rb,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():na.error("Invalid JSON: "+b)},na.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new a.DOMParser,c=d.parseFromString(b,"text/xml")):(c=new a.ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||na.error("Invalid XML: "+b),c};var Sb=/#.*$/,Tb=/([?&])_=[^&]*/,Ub=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Vb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Wb=/^(?:GET|HEAD)$/,Xb=/^\/\//,Yb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Zb={},$b={},_b="*/".concat("*"),ac=Ob.href,bc=Yb.exec(ac.toLowerCase())||[];na.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ac,type:"GET",isLocal:Vb.test(bc[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":_b,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":na.parseJSON,"text xml":na.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?V(V(a,na.ajaxSettings),b):V(na.ajaxSettings,a)},ajaxPrefilter:T(Zb),ajaxTransport:T($b),ajax:function(b,c){function d(b,c,d,e){var f,l,s,t,v,x=c;2!==u&&(u=2,i&&a.clearTimeout(i),k=void 0,h=e||"",w.readyState=b>0?4:0,f=b>=200&&b<300||304===b,d&&(t=W(m,w,d)),t=X(m,t,w,f),f?(m.ifModified&&(v=w.getResponseHeader("Last-Modified"),v&&(na.lastModified[g]=v),v=w.getResponseHeader("etag"),v&&(na.etag[g]=v)),204===b||"HEAD"===m.type?x="nocontent":304===b?x="notmodified":(x=t.state,l=t.data,s=t.error,f=!s)):(s=x,!b&&x||(x="error",b<0&&(b=0))),w.status=b,w.statusText=(c||x)+"",f?p.resolveWith(n,[l,x,w]):p.rejectWith(n,[w,x,s]),w.statusCode(r),r=void 0,j&&o.trigger(f?"ajaxSuccess":"ajaxError",[w,m,f?l:s]),q.fireWith(n,[w,x]),j&&(o.trigger("ajaxComplete",[w,m]),--na.active||na.event.trigger("ajaxStop")))}"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m=na.ajaxSetup({},c),n=m.context||m,o=m.context&&(n.nodeType||n.jquery)?na(n):na.event,p=na.Deferred(),q=na.Callbacks("once memory"),r=m.statusCode||{},s={},t={},u=0,v="canceled",w={readyState:0,getResponseHeader:function(a){var b;if(2===u){if(!l)for(l={};b=Ub.exec(h);)l[b[1].toLowerCase()]=b[2];b=l[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===u?h:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return u||(a=t[c]=t[c]||a,s[a]=b),this},overrideMimeType:function(a){return u||(m.mimeType=a),this},statusCode:function(a){var b;if(a)if(u<2)for(b in a)r[b]=[r[b],a[b]];else w.always(a[w.status]);return this},abort:function(a){var b=a||v;return k&&k.abort(b),d(0,b),this}};if(p.promise(w).complete=q.add,w.success=w.done,w.error=w.fail,m.url=((b||m.url||ac)+"").replace(Sb,"").replace(Xb,bc[1]+"//"),m.type=c.method||c.type||m.method||m.type,m.dataTypes=na.trim(m.dataType||"*").toLowerCase().match(Da)||[""],null==m.crossDomain&&(e=Yb.exec(m.url.toLowerCase()),m.crossDomain=!(!e||e[1]===bc[1]&&e[2]===bc[2]&&(e[3]||("http:"===e[1]?"80":"443"))===(bc[3]||("http:"===bc[1]?"80":"443")))),m.data&&m.processData&&"string"!=typeof m.data&&(m.data=na.param(m.data,m.traditional)),U(Zb,m,c,w),2===u)return w;j=na.event&&m.global,j&&0===na.active++&&na.event.trigger("ajaxStart"),m.type=m.type.toUpperCase(),m.hasContent=!Wb.test(m.type),g=m.url,m.hasContent||(m.data&&(g=m.url+=(Qb.test(g)?"&":"?")+m.data,delete m.data),m.cache===!1&&(m.url=Tb.test(g)?g.replace(Tb,"$1_="+Pb++):g+(Qb.test(g)?"&":"?")+"_="+Pb++)),m.ifModified&&(na.lastModified[g]&&w.setRequestHeader("If-Modified-Since",na.lastModified[g]),na.etag[g]&&w.setRequestHeader("If-None-Match",na.etag[g])),(m.data&&m.hasContent&&m.contentType!==!1||c.contentType)&&w.setRequestHeader("Content-Type",m.contentType),w.setRequestHeader("Accept",m.dataTypes[0]&&m.accepts[m.dataTypes[0]]?m.accepts[m.dataTypes[0]]+("*"!==m.dataTypes[0]?", "+_b+"; q=0.01":""):m.accepts["*"]);for(f in m.headers)w.setRequestHeader(f,m.headers[f]);if(m.beforeSend&&(m.beforeSend.call(n,w,m)===!1||2===u))return w.abort();v="abort";for(f in{success:1,error:1,complete:1})w[f](m[f]);if(k=U($b,m,c,w)){if(w.readyState=1,j&&o.trigger("ajaxSend",[w,m]),2===u)return w;m.async&&m.timeout>0&&(i=a.setTimeout(function(){w.abort("timeout")},m.timeout));try{u=1,k.send(s,d)}catch(x){if(!(u<2))throw x;d(-1,x)}}else d(-1,"No Transport");return w},getJSON:function(a,b,c){return na.get(a,b,c,"json")},getScript:function(a,b){return na.get(a,void 0,b,"script")}}),na.each(["get","post"],function(a,b){na[b]=function(a,c,d,e){return na.isFunction(c)&&(e=e||d,d=c,c=void 0),na.ajax(na.extend({url:a,type:b,dataType:e,data:c,success:d},na.isPlainObject(a)&&a))}}),na._evalUrl=function(a){return na.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},na.fn.extend({wrapAll:function(a){if(na.isFunction(a))return this.each(function(b){na(this).wrapAll(a.call(this,b))});if(this[0]){var b=na(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){for(var a=this;a.firstChild&&1===a.firstChild.nodeType;)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return na.isFunction(a)?this.each(function(b){na(this).wrapInner(a.call(this,b))}):this.each(function(){var b=na(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=na.isFunction(a);return this.each(function(c){na(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){na.nodeName(this,"body")||na(this).replaceWith(this.childNodes)}).end()}}),na.expr.filters.hidden=function(a){return la.reliableHiddenOffsets()?a.offsetWidth<=0&&a.offsetHeight<=0&&!a.getClientRects().length:Z(a)},na.expr.filters.visible=function(a){return!na.expr.filters.hidden(a)};var cc=/%20/g,dc=/\[\]$/,ec=/\r?\n/g,fc=/^(?:submit|button|image|reset|file)$/i,gc=/^(?:input|select|textarea|keygen)/i;na.param=function(a,b){var c,d=[],e=function(a,b){b=na.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=na.ajaxSettings&&na.ajaxSettings.traditional),na.isArray(a)||a.jquery&&!na.isPlainObject(a))na.each(a,function(){e(this.name,this.value)});else for(c in a)$(c,a[c],b,e);return d.join("&").replace(cc,"+")},na.fn.extend({serialize:function(){return na.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=na.prop(this,"elements");return a?na.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!na(this).is(":disabled")&&gc.test(this.nodeName)&&!fc.test(a)&&(this.checked||!Oa.test(a))}).map(function(a,b){var c=na(this).val();return null==c?null:na.isArray(c)?na.map(c,function(a){return{name:b.name,value:a.replace(ec,"\r\n")}}):{name:b.name,value:c.replace(ec,"\r\n")}}).get()}}),na.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return this.isLocal?aa():da.documentMode>8?_():/^(get|post|head|put|delete|options)$/i.test(this.type)&&_()||aa()}:_;var hc=0,ic={},jc=na.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in ic)ic[a](void 0,!0)}),la.cors=!!jc&&"withCredentials"in jc,jc=la.ajax=!!jc,jc&&na.ajaxTransport(function(b){if(!b.crossDomain||la.cors){var c;return{send:function(d,e){var f,g=b.xhr(),h=++hc;if(g.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(f in b.xhrFields)g[f]=b.xhrFields[f];b.mimeType&&g.overrideMimeType&&g.overrideMimeType(b.mimeType),b.crossDomain||d["X-Requested-With"]||(d["X-Requested-With"]="XMLHttpRequest");for(f in d)void 0!==d[f]&&g.setRequestHeader(f,d[f]+"");g.send(b.hasContent&&b.data||null),c=function(a,d){var f,i,j;if(c&&(d||4===g.readyState))if(delete ic[h],c=void 0,g.onreadystatechange=na.noop,d)4!==g.readyState&&g.abort();else{j={},f=g.status,"string"==typeof g.responseText&&(j.text=g.responseText);try{i=g.statusText}catch(k){i=""}f||!b.isLocal||b.crossDomain?1223===f&&(f=204):f=j.text?200:404}j&&e(f,i,j,g.getAllResponseHeaders())},b.async?4===g.readyState?a.setTimeout(c):g.onreadystatechange=ic[h]=c:c()},abort:function(){c&&c(void 0,!0)}}}}),na.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return na.globalEval(a),a}}}),na.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),na.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=da.head||na("head")[0]||da.documentElement;return{send:function(d,e){b=da.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var kc=[],lc=/(=)\?(?=&|$)|\?\?/;na.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=kc.pop()||na.expando+"_"+Pb++;return this[a]=!0,a}}),na.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(lc.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&lc.test(b.data)&&"data");if(h||"jsonp"===b.dataTypes[0])return e=b.jsonpCallback=na.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(lc,"$1"+e):b.jsonp!==!1&&(b.url+=(Qb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||na.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?na(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,kc.push(e)),g&&na.isFunction(f)&&f(g[0]),g=f=void 0}),"script"}),na.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||da;var d=wa.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=r([a],b,e),e&&e.length&&na(e).remove(),na.merge([],d.childNodes))};var mc=na.fn.load;na.fn.load=function(a,b,c){if("string"!=typeof a&&mc)return mc.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=na.trim(a.slice(h,a.length)),a=a.slice(0,h)),na.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&na.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?na("
      ").append(na.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(this,f||[a.responseText,b,a])})}),this},na.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){na.fn[b]=function(a){return this.on(b,a)}}),na.expr.filters.animated=function(a){return na.grep(na.timers,function(b){return a===b.elem}).length},na.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=na.css(a,"position"),l=na(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=na.css(a,"top"),i=na.css(a,"left"),j=("absolute"===k||"fixed"===k)&&na.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),na.isFunction(b)&&(b=b.call(a,c,na.extend({},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)}},na.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){na.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,na.contains(b,e)?("undefined"!=typeof e.getBoundingClientRect&&(d=e.getBoundingClientRect()),c=ba(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===na.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),na.nodeName(a[0],"html")||(c=a.offset()),c.top+=na.css(a[0],"borderTopWidth",!0),c.left+=na.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-na.css(d,"marginTop",!0),left:b.left-c.left-na.css(d,"marginLeft",!0) -}}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent;a&&!na.nodeName(a,"html")&&"static"===na.css(a,"position");)a=a.offsetParent;return a||nb})}}),na.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);na.fn[a]=function(d){return Na(this,function(a,d,e){var f=ba(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?na(f).scrollLeft():e,c?e:na(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),na.each(["top","left"],function(a,b){na.cssHooks[b]=F(la.pixelPosition,function(a,c){if(c)return c=pb(a,b),lb.test(c)?na(a).position()[b]+"px":c})}),na.each({Height:"height",Width:"width"},function(a,b){na.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){na.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return Na(this,function(b,c,d){var e;return na.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?na.css(b,c,g):na.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),na.fn.extend({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)}}),na.fn.size=function(){return this.length},na.fn.andSelf=na.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return na});var nc=a.jQuery,oc=a.$;return na.noConflict=function(b){return a.$===na&&(a.$=oc),b&&a.jQuery===na&&(a.jQuery=nc),na},b||(a.jQuery=a.$=na),na})},{}],7:[function(a,b,c){"use strict";function d(){this.modules=[],this.registry=new j.Registry,this._started=!1,this.registry.registerUtility(i.defaultNotifier,"notifier"),this.include(g.acl),this.include(h.simple),this.include(k.noop)}var e=a("backbone-extend-standalone"),f=a("es6-promise").Promise,g=a("./authz"),h=a("./identity"),i=a("./notification"),j=a("./registry"),k=a("./storage");d.prototype.include=function(a,b){var c=a(b);return"function"==typeof c.configure&&c.configure(this.registry),this.modules.push(c),this},d.prototype.start=function(){if(!this._started){this._started=!0;var a=this,b=this.registry;return this.authz=b.getUtility("authorizationPolicy"),this.ident=b.getUtility("identityPolicy"),this.notify=b.getUtility("notifier"),this.annotations=new k.StorageAdapter(b.getUtility("storage"),function(){return a.runHook.apply(a,arguments)}),this.runHook("start",[this])}},d.prototype.destroy=function(){return this.runHook("destroy")},d.prototype.runHook=function(a,b){for(var c=[],d=0,e=this.modules.length;d
      ",k={show:"annotator-notice-show",info:"annotator-notice-info",success:"annotator-notice-success",error:"annotator-notice-error"};c.banner=d,c.defaultNotifier=d,c.INFO=g,c.SUCCESS=h,c.ERROR=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./util":24}],11:[function(a,b,c){"use strict";function d(){this.utilities={}}function e(a){this.name="LookupError",this.message='No utility registered for interface "'+a+'".'}d.prototype.registerUtility=function(a,b){this.utilities[b]=a},d.prototype.getUtility=function(a){var b=this.queryUtility(a);if(null===b)throw new e(a);return b},d.prototype.queryUtility=function(a){var b=this.utilities[a];return"undefined"==typeof b||null===b?null:b},e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,c.LookupError=e,c.Registry=d},{}],12:[function(a,b,c){"use strict";function d(a,b){this.store=a,this.runHook=b}var e=a("./util"),f=e.$,g=e.gettext,h=e.Promise,i=function(){var a;return a=-1,function(){return a+=1}}();c.debug=function(){function a(a,b){var c=JSON.parse(JSON.stringify(b));console.debug("annotator.storage.debug: "+a,c)}return{create:function(b){return b.id=i(),a("create",b),b},update:function(b){return a("update",b),b},"delete":function(b){return a("destroy",b),b},query:function(b){return a("query",b),{results:[],meta:{total:0}}},configure:function(a){a.registerUtility(this,"storage")}}},c.noop=function(){return{create:function(a){return"undefined"!=typeof a.id&&null!==a.id||(a.id=i()),a},update:function(a){return a},"delete":function(a){return a},query:function(){return{results:[]}},configure:function(a){a.registerUtility(this,"storage")}}};var j;c.http=function(a){var b=function(){};"undefined"!=typeof a&&null!==a||(a={}),a.onError=a.onError||function(a,c){console.error(a,c),b(a,"error")};var c=new j(a);return{configure:function(a){a.registerUtility(c,"storage")},start:function(a){b=a.notify}}},j=c.HttpStorage=function k(a){this.options=f.extend(!0,{},k.options,a),this.onError=this.options.onError},j.prototype.create=function(a){return this._apiRequest("create",a)},j.prototype.update=function(a){return this._apiRequest("update",a)},j.prototype["delete"]=function(a){return this._apiRequest("destroy",a)},j.prototype.query=function(a){return this._apiRequest("search",a).then(function(a){var b=a.rows;return delete a.rows,{results:b,meta:a}})},j.prototype.setHeader=function(a,b){this.options.headers[a]=b},j.prototype._apiRequest=function(a,b){var c=b&&b.id,d=this._urlFor(a,c),e=this._apiRequestOptions(a,b),g=f.ajax(d,e);return g._id=c,g._action=a,g},j.prototype._apiRequestOptions=function(a,b){var c=this._methodFor(a),d=this,e={type:c,dataType:"json",error:function(){d._onError.apply(d,arguments)},headers:this.options.headers};if(!this.options.emulateHTTP||"PUT"!==c&&"DELETE"!==c||(e.headers=f.extend(e.headers,{"X-HTTP-Method-Override":c}),e.type="POST"),"search"===a)return e=f.extend(e,{data:b});var g=b&&JSON.stringify(b);return this.options.emulateJSON?(e.data={json:g},this.options.emulateHTTP&&(e.data._method=c),e):e=f.extend(e,{data:g,contentType:"application/json; charset=utf-8"})},j.prototype._urlFor=function(a,b){"undefined"!=typeof b&&null!==b||(b="");var c="";return"undefined"!=typeof this.options.prefix&&null!==this.options.prefix&&(c=this.options.prefix),c+=this.options.urls[a],c=c.replace(/idAnnotation/,b)},j.prototype._methodFor=function(a){var b={create:"POST",update:"PUT",destroy:"DELETE",search:"GET"};return b[a]},j.prototype._onError=function(a){if("function"==typeof this.onError){var b;b=g(400===a.status?"The annotation store did not understand the request! (Error 400)":401===a.status?"You must be logged in to perform this operation! (Error 401)":403===a.status?"You don't have permission to perform this operation! (Error 403)":404===a.status?"Could not connect to the annotation store! (Error 404)":500===a.status?"Internal error in annotation store! (Error 500)":"Unknown error while speaking to annotation store!"),this.onError(b,a)}},j.options={emulateHTTP:!1,emulateJSON:!1,headers:{},onError:function(a){console.error("API request failed: "+a)},prefix:"/store",urls:{create:"/annotations",update:"/annotations/idAnnotation",destroy:"/annotations/idAnnotation",search:"/search"}},d.prototype.create=function(a){return"undefined"!=typeof a&&null!==a||(a={}),this._cycle(a,"create","beforeAnnotationCreated","annotationCreated")},d.prototype.update=function(a){if("undefined"==typeof a.id||null===a.id)throw new TypeError("annotation must have an id for update()");return this._cycle(a,"update","beforeAnnotationUpdated","annotationUpdated")},d.prototype["delete"]=function(a){if("undefined"==typeof a.id||null===a.id)throw new TypeError("annotation must have an id for delete()");return this._cycle(a,"delete","beforeAnnotationDeleted","annotationDeleted")},d.prototype.query=function(a){return h.resolve(this.store.query(a))},d.prototype.load=function(a){var b=this;return this.query(a).then(function(a){b.runHook("annotationsLoaded",[a.results])})},d.prototype._cycle=function(a,b,c,d){var e=this;return this.runHook(c,[a]).then(function(){var c=f.extend(!0,{},a);delete c._local;var d=e.store[b](c);return h.resolve(d)}).then(function(b){for(var c in a)a.hasOwnProperty(c)&&"_local"!==c&&delete a[c];return f.extend(a,b),e.runHook(d,[a]),a})},c.StorageAdapter=d},{"./util":24}],13:[function(a,b,c){c.main=a("./ui/main").main,c.adder=a("./ui/adder"),c.editor=a("./ui/editor"),c.filter=a("./ui/filter"),c.highlighter=a("./ui/highlighter"),c.markdown=a("./ui/markdown"),c.tags=a("./ui/tags"),c.textselector=a("./ui/textselector"),c.viewer=a("./ui/viewer"),c.widget=a("./ui/widget")},{"./ui/adder":14,"./ui/editor":15,"./ui/filter":16,"./ui/highlighter":17,"./ui/main":18,"./ui/markdown":19,"./ui/tags":20,"./ui/textselector":21,"./ui/viewer":22,"./ui/widget":23}],14:[function(a,b,c){"use strict";var d=a("./widget").Widget,e=a("../util"),f=e.$,g=e.gettext,h="annotator-adder",i=d.extend({constructor:function(a){d.call(this,a),this.ignoreMouseup=!1,this.annotation=null,this.onCreate=this.options.onCreate;var b=this;this.element.on("click."+h,"button",function(a){b._onClick(a)}).on("mousedown."+h,"button",function(a){b._onMousedown(a)}),this.document=this.element[0].ownerDocument,f(this.document.body).on("mouseup."+h,function(a){b._onMouseup(a)})},destroy:function(){this.element.off("."+h),f(this.document.body).off("."+h),d.prototype.destroy.call(this)},load:function(a,b){this.annotation=a,this.show(b)},show:function(a){"undefined"!=typeof a&&null!==a&&this.element.css({top:a.top,left:a.left}),d.prototype.show.call(this)},_onMousedown:function(a){a.which>1||(a.preventDefault(),this.ignoreMouseup=!0)},_onMouseup:function(a){a.which>1||this.ignoreMouseup&&a.stopImmediatePropagation()},_onClick:function(a){a.which>1||(a.preventDefault(),this.hide(),this.ignoreMouseup=!1,null!==this.annotation&&"function"==typeof this.onCreate&&this.onCreate(this.annotation,a))}});i.template=['
      ',' ","
      "].join("\n"),i.options={onCreate:null},c.Adder=i},{"../util":24,"./widget":23}],15:[function(a,b,c){"use strict";function d(a){"undefined"!=typeof a&&null!==a&&"function"==typeof a.preventDefault&&a.preventDefault()}var e=a("./widget").Widget,f=a("../util"),g=f.$,h=f.gettext,i=f.Promise,j="annotator-editor",k=function(){var a;return a=-1,function(){return a+=1}}(),l=c.dragTracker=function(a,b){function c(a){if(!i&&null!==h){var c={y:a.pageY-h.top,x:a.pageX-h.left},d=!0;"function"==typeof b&&(d=b(c)),d!==!1&&(h={top:a.pageY,left:a.pageX}),i=!0,setTimeout(function(){i=!1},1e3/60)}}function d(){h=null,g(a.ownerDocument).off("mouseup",d).off("mousemove",c)}function e(b){b.target===a&&(h={top:b.pageY,left:b.pageX},g(a.ownerDocument).on("mouseup",d).on("mousemove",c),b.preventDefault())}function f(){g(a).off("mousedown",e)}var h=null,i=!1;return g(a).on("mousedown",e),{destroy:f}},m=c.resizer=function(a,b,c){function d(a){var b=1,d=-1;return"function"==typeof c.invertedX&&c.invertedX()&&(b=-1),"function"==typeof c.invertedY&&c.invertedY()&&(d=1),{x:a.x*b,y:a.y*d}}function e(a){var b=f.height(),c=f.width(),e=d(a);Math.abs(e.x)>0&&f.width(c+e.x),Math.abs(e.y)>0&&f.height(b+e.y);var g=f.height()!==b||f.width()!==c;return g}var f=g(a);return"undefined"!=typeof c&&null!==c||(c={}),l(b,e)},n=c.mover=function(a,b){function c(b){g(a).css({top:parseInt(g(a).css("top"),10)+b.y,left:parseInt(g(a).css("left"),10)+b.x})}return l(b,c)},o=c.Editor=e.extend({constructor:function(a){e.call(this,a),this.fields=[],this.annotation={},this.options.defaultFields&&this.addField({type:"textarea",label:h("Comments")+"…",load:function(a,b){g(a).find("textarea").val(b.text||"")},submit:function(a,b){b.text=g(a).find("textarea").val()}});var b=this;this.element.on("submit."+j,"form",function(a){b._onFormSubmit(a)}).on("click."+j,".annotator-save",function(a){b._onSaveClick(a)}).on("click."+j,".annotator-cancel",function(a){b._onCancelClick(a)}).on("mouseover."+j,".annotator-cancel",function(a){b._onCancelMouseover(a)}).on("keydown."+j,"textarea",function(a){b._onTextareaKeydown(a)})},destroy:function(){this.element.off("."+j),e.prototype.destroy.call(this)},show:function(a){"undefined"!=typeof a&&null!==a&&this.element.css({top:a.top,left:a.left}),this.element.find(".annotator-save").addClass(this.classes.focus),e.prototype.show.call(this),this.element.find(":input:first").focus(),this._setupDraggables()},load:function(a,b){this.annotation=a;for(var c=0,d=this.fields.length;c');return b.element=d[0],"textarea"===b.type?c=g("",ea.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var Na=/^key/,Oa=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Pa=/^([^.]*)(?:\.(.+)|)/;ga.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=Aa.get(a);if(q)for(c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=ga.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof ga&&ga.event.triggered!==b.type?ga.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(wa)||[""],j=b.length;j--;)h=Pa.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=ga.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=ga.event.special[n]||{},k=ga.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&ga.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),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),ga.event.global[n]=!0)},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=Aa.hasData(a)&&Aa.get(a);if(q&&(i=q.events)){for(b=(b||"").match(wa)||[""],j=b.length;j--;)if(h=Pa.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(), -n){for(l=ga.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;f--;)k=m[f],!e&&p!==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,o,q.handle)!==!1||ga.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)ga.event.remove(a,n+b[j],c,d,!0);ga.isEmptyObject(i)&&Aa.remove(a,"handle events")}},dispatch:function(a){a=ga.event.fix(a);var b,c,d,e,f,g=[],h=Z.call(arguments),i=(Aa.get(this,"events")||{})[a.type]||[],j=ga.event.special[a.type]||{};if(h[0]=a,a.delegateTarget=this,!j.preDispatch||j.preDispatch.call(this,a)!==!1){for(g=ga.event.handlers.call(this,a,i),b=0;(e=g[b++])&&!a.isPropagationStopped();)for(a.currentTarget=e.elem,c=0;(f=e.handlers[c++])&&!a.isImmediatePropagationStopped();)a.rnamespace&&!a.rnamespace.test(f.namespace)||(a.handleObj=f,a.data=f.data,d=((ga.event.special[f.origType]||{}).handle||f.handler).apply(e.elem,h),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()));return j.postDispatch&&j.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&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!==this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;c-1:ga.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]*)\/>/gi,Ra=/\s*$/g;ga.extend({htmlPrefilter:function(a){return a.replace(Qa,"<$1>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=ga.contains(a.ownerDocument,a);if(!(ea.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||ga.isXMLDoc(a)))for(g=l(h),f=l(a),d=0,e=f.length;d0&&m(g,!i&&l(a,"script")),h},cleanData:function(a){for(var b,c,d,e=ga.event.special,f=0;void 0!==(c=a[f]);f++)if(za(c)){if(b=c[Aa.expando]){if(b.events)for(d in b.events)e[d]?ga.event.remove(c,d):ga.removeEvent(c,d,b.handle);c[Aa.expando]=void 0}c[Ba.expando]&&(c[Ba.expando]=void 0)}}}),ga.fn.extend({domManip:x,detach:function(a){return y(this,a,!0)},remove:function(a){return y(this,a)},text:function(a){return ya(this,function(a){return void 0===a?ga.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 x(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=s(this,a);b.appendChild(a)}})},prepend:function(){return x(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=s(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return x(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return x(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(ga.cleanData(l(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return ga.clone(this,a,b)})},html:function(a){return ya(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&&!Ra.test(a)&&!La[(Ja.exec(a)||["",""])[1].toLowerCase()]){a=ga.htmlPrefilter(a);try{for(;c1)},show:function(){return H(this,!0)},hide:function(){return H(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){Ha(this)?ga(this).show():ga(this).hide()})}}),ga.Tween=I,I.prototype={constructor:I,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||ga.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(ga.cssNumber[c]?"":"px")},cur:function(){var a=I.propHooks[this.prop];return a&&a.get?a.get(this):I.propHooks._default.get(this)},run:function(a){var b,c=I.propHooks[this.prop];return this.options.duration?this.pos=b=ga.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=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):I.propHooks._default.set(this),this}},I.prototype.init.prototype=I.prototype,I.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=ga.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){ga.fx.step[a.prop]?ga.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[ga.cssProps[a.prop]]&&!ga.cssHooks[a.prop]?a.elem[a.prop]=a.now:ga.style(a.elem,a.prop,a.now+a.unit)}}},I.propHooks.scrollTop=I.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},ga.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},ga.fx=I.prototype.init,ga.fx.step={};var fb,gb,hb=/^(?:toggle|show|hide)$/,ib=/queueHooks$/;ga.Animation=ga.extend(O,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return k(c.elem,a,Fa.exec(b),c),c}]},tweener:function(a,b){ga.isFunction(a)?(b=a,a=["*"]):a=a.match(wa);for(var c,d=0,e=a.length;d1)},removeAttr:function(a){return this.each(function(){ga.removeAttr(this,a)})}}),ga.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?ga.prop(a,b,c):(1===f&&ga.isXMLDoc(a)||(b=b.toLowerCase(),e=ga.attrHooks[b]||(ga.expr.match.bool.test(b)?jb:void 0)),void 0!==c?null===c?void ga.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=ga.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!ea.radioValue&&"radio"===b&&ga.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(wa);if(f&&1===a.nodeType)for(;c=f[e++];)d=ga.propFix[c]||c,ga.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)}}),jb={set:function(a,b,c){return b===!1?ga.removeAttr(a,c):a.setAttribute(c,c),c}},ga.each(ga.expr.match.bool.source.match(/\w+/g),function(a,b){var c=kb[b]||ga.find.attr;kb[b]=function(a,b,d){var e,f;return d||(f=kb[b],kb[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,kb[b]=f),e}});var lb=/^(?:input|select|textarea|button)$/i,mb=/^(?:a|area)$/i;ga.fn.extend({prop:function(a,b){return ya(this,ga.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[ga.propFix[a]||a]})}}),ga.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&ga.isXMLDoc(a)||(b=ga.propFix[b]||b,e=ga.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){var b=ga.find.attr(a,"tabindex");return b?parseInt(b,10):lb.test(a.nodeName)||mb.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),ea.optSelected||(ga.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),ga.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){ga.propFix[this.toLowerCase()]=this});var nb=/[\t\r\n\f]/g;ga.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(ga.isFunction(a))return this.each(function(b){ga(this).addClass(a.call(this,b,P(this)))});if("string"==typeof a&&a)for(b=a.match(wa)||[];c=this[i++];)if(e=P(c),d=1===c.nodeType&&(" "+e+" ").replace(nb," ")){for(g=0;f=b[g++];)d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=ga.trim(d),e!==h&&c.setAttribute("class",h)}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(ga.isFunction(a))return this.each(function(b){ga(this).removeClass(a.call(this,b,P(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a)for(b=a.match(wa)||[];c=this[i++];)if(e=P(c),d=1===c.nodeType&&(" "+e+" ").replace(nb," ")){for(g=0;f=b[g++];)for(;d.indexOf(" "+f+" ")>-1;)d=d.replace(" "+f+" "," ");h=ga.trim(d),e!==h&&c.setAttribute("class",h)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):ga.isFunction(a)?this.each(function(c){ga(this).toggleClass(a.call(this,c,P(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c)for(d=0,e=ga(this),f=a.match(wa)||[];b=f[d++];)e.hasClass(b)?e.removeClass(b):e.addClass(b);else void 0!==a&&"boolean"!==c||(b=P(this),b&&Aa.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":Aa.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;for(b=" "+a+" ";c=this[d++];)if(1===c.nodeType&&(" "+P(c)+" ").replace(nb," ").indexOf(b)>-1)return!0;return!1}});var ob=/\r/g,pb=/[\x20\t\r\n\f]+/g;ga.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=ga.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,ga(this).val()):a,null==e?e="":"number"==typeof e?e+="":ga.isArray(e)&&(e=ga.map(e,function(a){return null==a?"":a+""})),b=ga.valHooks[this.type]||ga.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=ga.valHooks[e.type]||ga.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(ob,""):null==c?"":c)}}}),ga.extend({valHooks:{option:{get:function(a){var b=ga.find.attr(a,"value");return null!=b?b:ga.trim(ga.text(a)).replace(pb," ")}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||e<0,g=f?null:[],h=f?e+1:d.length,i=e<0?h:f?e:0;i-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),ga.each(["radio","checkbox"],function(){ga.valHooks[this]={set:function(a,b){if(ga.isArray(b))return a.checked=ga.inArray(ga(a).val(),b)>-1}},ea.checkOn||(ga.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var qb=/^(?:focusinfocus|focusoutblur)$/;ga.extend(ga.event,{trigger:function(b,c,d,e){var f,g,h,i,j,k,l,m=[d||Y],n=da.call(b,"type")?b.type:b,o=da.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||Y,3!==d.nodeType&&8!==d.nodeType&&!qb.test(n+ga.event.triggered)&&(n.indexOf(".")>-1&&(o=n.split("."),n=o.shift(),o.sort()),j=n.indexOf(":")<0&&"on"+n,b=b[ga.expando]?b:new ga.Event(n,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=o.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:ga.makeArray(c,[b]),l=ga.event.special[n]||{},e||!l.trigger||l.trigger.apply(d,c)!==!1)){if(!e&&!l.noBubble&&!ga.isWindow(d)){for(i=l.delegateType||n,qb.test(i+n)||(g=g.parentNode);g;g=g.parentNode)m.push(g),h=g;h===(d.ownerDocument||Y)&&m.push(h.defaultView||h.parentWindow||a)}for(f=0;(g=m[f++])&&!b.isPropagationStopped();)b.type=f>1?i:l.bindType||n,k=(Aa.get(g,"events")||{})[b.type]&&Aa.get(g,"handle"),k&&k.apply(g,c),k=j&&g[j],k&&k.apply&&za(g)&&(b.result=k.apply(g,c),b.result===!1&&b.preventDefault());return b.type=n,e||b.isDefaultPrevented()||l._default&&l._default.apply(m.pop(),c)!==!1||!za(d)||j&&ga.isFunction(d[n])&&!ga.isWindow(d)&&(h=d[j],h&&(d[j]=null),ga.event.triggered=n,d[n](),ga.event.triggered=void 0,h&&(d[j]=h)),b.result}},simulate:function(a,b,c){var d=ga.extend(new ga.Event,c,{type:a,isSimulated:!0});ga.event.trigger(d,null,b)}}),ga.fn.extend({trigger:function(a,b){return this.each(function(){ga.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];if(c)return ga.event.trigger(a,b,c,!0)}}),ga.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){ga.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),ga.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),ea.focusin="onfocusin"in a,ea.focusin||ga.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){ga.event.simulate(b,a.target,ga.event.fix(a))};ga.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=Aa.access(d,b);e||d.addEventListener(a,c,!0),Aa.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=Aa.access(d,b)-1;e?Aa.access(d,b,e):(d.removeEventListener(a,c,!0),Aa.remove(d,b))}}});var rb=a.location,sb=ga.now(),tb=/\?/;ga.parseJSON=function(a){return JSON.parse(a+"")},ga.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||ga.error("Invalid XML: "+b),c};var ub=/#.*$/,vb=/([?&])_=[^&]*/,wb=/^(.*?):[ \t]*([^\r\n]*)$/gm,xb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,yb=/^(?:GET|HEAD)$/,zb=/^\/\//,Ab={},Bb={},Cb="*/".concat("*"),Db=Y.createElement("a");Db.href=rb.href,ga.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:rb.href,type:"GET",isLocal:xb.test(rb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Cb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":ga.parseJSON,"text xml":ga.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?S(S(a,ga.ajaxSettings),b):S(ga.ajaxSettings,a)},ajaxPrefilter:Q(Ab),ajaxTransport:Q(Bb),ajax:function(b,c){function d(b,c,d,h){var j,l,s,t,v,x=c;2!==u&&(u=2,i&&a.clearTimeout(i),e=void 0,g=h||"",w.readyState=b>0?4:0,j=b>=200&&b<300||304===b,d&&(t=T(m,w,d)),t=U(m,t,w,j),j?(m.ifModified&&(v=w.getResponseHeader("Last-Modified"),v&&(ga.lastModified[f]=v),v=w.getResponseHeader("etag"),v&&(ga.etag[f]=v)),204===b||"HEAD"===m.type?x="nocontent":304===b?x="notmodified":(x=t.state,l=t.data,s=t.error,j=!s)):(s=x,!b&&x||(x="error",b<0&&(b=0))),w.status=b,w.statusText=(c||x)+"",j?p.resolveWith(n,[l,x,w]):p.rejectWith(n,[w,x,s]),w.statusCode(r),r=void 0,k&&o.trigger(j?"ajaxSuccess":"ajaxError",[w,m,j?l:s]),q.fireWith(n,[w,x]),k&&(o.trigger("ajaxComplete",[w,m]),--ga.active||ga.event.trigger("ajaxStop")))}"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m=ga.ajaxSetup({},c),n=m.context||m,o=m.context&&(n.nodeType||n.jquery)?ga(n):ga.event,p=ga.Deferred(),q=ga.Callbacks("once memory"),r=m.statusCode||{},s={},t={},u=0,v="canceled",w={readyState:0,getResponseHeader:function(a){var b;if(2===u){if(!h)for(h={};b=wb.exec(g);)h[b[1].toLowerCase()]=b[2];b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===u?g:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return u||(a=t[c]=t[c]||a,s[a]=b),this},overrideMimeType:function(a){return u||(m.mimeType=a),this},statusCode:function(a){var b;if(a)if(u<2)for(b in a)r[b]=[r[b],a[b]];else w.always(a[w.status]);return this},abort:function(a){var b=a||v;return e&&e.abort(b),d(0,b),this}};if(p.promise(w).complete=q.add,w.success=w.done,w.error=w.fail,m.url=((b||m.url||rb.href)+"").replace(ub,"").replace(zb,rb.protocol+"//"),m.type=c.method||c.type||m.method||m.type,m.dataTypes=ga.trim(m.dataType||"*").toLowerCase().match(wa)||[""],null==m.crossDomain){j=Y.createElement("a");try{j.href=m.url,j.href=j.href,m.crossDomain=Db.protocol+"//"+Db.host!=j.protocol+"//"+j.host}catch(x){m.crossDomain=!0}}if(m.data&&m.processData&&"string"!=typeof m.data&&(m.data=ga.param(m.data,m.traditional)),R(Ab,m,c,w),2===u)return w;k=ga.event&&m.global,k&&0===ga.active++&&ga.event.trigger("ajaxStart"),m.type=m.type.toUpperCase(),m.hasContent=!yb.test(m.type),f=m.url,m.hasContent||(m.data&&(f=m.url+=(tb.test(f)?"&":"?")+m.data,delete m.data),m.cache===!1&&(m.url=vb.test(f)?f.replace(vb,"$1_="+sb++):f+(tb.test(f)?"&":"?")+"_="+sb++)),m.ifModified&&(ga.lastModified[f]&&w.setRequestHeader("If-Modified-Since",ga.lastModified[f]),ga.etag[f]&&w.setRequestHeader("If-None-Match",ga.etag[f])),(m.data&&m.hasContent&&m.contentType!==!1||c.contentType)&&w.setRequestHeader("Content-Type",m.contentType),w.setRequestHeader("Accept",m.dataTypes[0]&&m.accepts[m.dataTypes[0]]?m.accepts[m.dataTypes[0]]+("*"!==m.dataTypes[0]?", "+Cb+"; q=0.01":""):m.accepts["*"]);for(l in m.headers)w.setRequestHeader(l,m.headers[l]);if(m.beforeSend&&(m.beforeSend.call(n,w,m)===!1||2===u))return w.abort();v="abort";for(l in{success:1,error:1,complete:1})w[l](m[l]);if(e=R(Bb,m,c,w)){if(w.readyState=1,k&&o.trigger("ajaxSend",[w,m]),2===u)return w;m.async&&m.timeout>0&&(i=a.setTimeout(function(){w.abort("timeout")},m.timeout));try{u=1,e.send(s,d)}catch(x){if(!(u<2))throw x;d(-1,x)}}else d(-1,"No Transport");return w},getJSON:function(a,b,c){return ga.get(a,b,c,"json")},getScript:function(a,b){return ga.get(a,void 0,b,"script")}}),ga.each(["get","post"],function(a,b){ga[b]=function(a,c,d,e){return ga.isFunction(c)&&(e=e||d,d=c,c=void 0),ga.ajax(ga.extend({url:a,type:b,dataType:e,data:c,success:d},ga.isPlainObject(a)&&a))}}),ga._evalUrl=function(a){return ga.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},ga.fn.extend({wrapAll:function(a){var b;return ga.isFunction(a)?this.each(function(b){ga(this).wrapAll(a.call(this,b))}):(this[0]&&(b=ga(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){for(var a=this;a.firstElementChild;)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return ga.isFunction(a)?this.each(function(b){ga(this).wrapInner(a.call(this,b))}):this.each(function(){var b=ga(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=ga.isFunction(a);return this.each(function(c){ga(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){ga.nodeName(this,"body")||ga(this).replaceWith(this.childNodes)}).end()}}),ga.expr.filters.hidden=function(a){return!ga.expr.filters.visible(a)},ga.expr.filters.visible=function(a){return a.offsetWidth>0||a.offsetHeight>0||a.getClientRects().length>0};var Eb=/%20/g,Fb=/\[\]$/,Gb=/\r?\n/g,Hb=/^(?:submit|button|image|reset|file)$/i,Ib=/^(?:input|select|textarea|keygen)/i;ga.param=function(a,b){var c,d=[],e=function(a,b){b=ga.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=ga.ajaxSettings&&ga.ajaxSettings.traditional),ga.isArray(a)||a.jquery&&!ga.isPlainObject(a))ga.each(a,function(){e(this.name,this.value)});else for(c in a)V(c,a[c],b,e);return d.join("&").replace(Eb,"+")},ga.fn.extend({serialize:function(){return ga.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=ga.prop(this,"elements");return a?ga.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!ga(this).is(":disabled")&&Ib.test(this.nodeName)&&!Hb.test(a)&&(this.checked||!Ia.test(a))}).map(function(a,b){var c=ga(this).val();return null==c?null:ga.isArray(c)?ga.map(c,function(a){return{name:b.name,value:a.replace(Gb,"\r\n")}}):{name:b.name,value:c.replace(Gb,"\r\n")}}).get()}}),ga.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Jb={0:200,1223:204},Kb=ga.ajaxSettings.xhr();ea.cors=!!Kb&&"withCredentials"in Kb,ea.ajax=Kb=!!Kb,ga.ajaxTransport(function(b){ -var c,d;if(ea.cors||Kb&&!b.crossDomain)return{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Jb[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}}),ga.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return ga.globalEval(a),a}}}),ga.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),ga.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(d,e){b=ga("