diff --git a/CHANGELOG.md b/CHANGELOG.md index b2626153c..73fe67982 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,29 @@ # Changelog +## [2.3.3](https://github.com/wallabag/wallabag/tree/2.3.3) + [Full Changelog](https://github.com/wallabag/wallabag/compare/2.3.2...2.3.3) + +### Fixes + +- Fix error when withRemove variable is not defined. [#3573](https://github.com/wallabag/wallabag/pull/3573) +- Fix title card HTML parsing [#3592](https://github.com/wallabag/wallabag/pull/3592) +- Fix tests [#3597](https://github.com/wallabag/wallabag/pull/3597) +- Fix tests [#3619](https://github.com/wallabag/wallabag/pull/3619) +- Better encoding of the URI for the bookmarklet [#3616](https://github.com/wallabag/wallabag/pull/3616) +- Fix overflow wrap issue [#3652](https://github.com/wallabag/wallabag/pull/3652) +- Fix/firefox mobile unneeded resize [#3653](https://github.com/wallabag/wallabag/pull/3653) +- Fix srcset attribute on images downloaded [#3661](https://github.com/wallabag/wallabag/pull/3661) +- Fix authors and preview alt encoding display [#3664](https://github.com/wallabag/wallabag/pull/3664) +- Spelling: GitHub, Log out, of the dev [#3614](https://github.com/wallabag/wallabag/pull/3614) +- Fix tests [#3668](https://github.com/wallabag/wallabag/pull/3668) +- Fixed migrations with dash into db names [#3538](https://github.com/wallabag/wallabag/pull/3538) + +### Changes + +- Allow login by email [#3615](https://github.com/wallabag/wallabag/pull/3615) +- Occitan update [#3646](https://github.com/wallabag/wallabag/pull/3646) +- Highlight code in articles using highlight.js [#3636](https://github.com/wallabag/wallabag/pull/3636) + ## [2.3.2](https://github.com/wallabag/wallabag/tree/2.3.2) [Full Changelog](https://github.com/wallabag/wallabag/compare/2.3.1...2.3.2) diff --git a/app/DoctrineMigrations/Version20160401000000.php b/app/DoctrineMigrations/Version20160401000000.php index e9956b485..c80e3e1f5 100644 --- a/app/DoctrineMigrations/Version20160401000000.php +++ b/app/DoctrineMigrations/Version20160401000000.php @@ -2,26 +2,14 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; +use Wallabag\CoreBundle\Doctrine\WallabagMigration; /** * Initial database structure. */ -class Version20160401000000 extends AbstractMigration implements ContainerAwareInterface +class Version20160401000000 extends WallabagMigration { - /** - * @var ContainerInterface - */ - private $container; - - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } - /** * @param Schema $schema */ @@ -76,30 +64,30 @@ SQL case 'mysql': $sql = <<getTable('craue_config_setting')} (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_5D9649505E237E06 (name), PRIMARY KEY(name)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; -CREATE TABLE `{$this->getTable('entry')}` (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, title LONGTEXT DEFAULT NULL, url LONGTEXT DEFAULT NULL, is_archived TINYINT(1) NOT NULL, is_starred TINYINT(1) NOT NULL, content LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, mimetype LONGTEXT DEFAULT NULL, language LONGTEXT DEFAULT NULL, reading_time INT DEFAULT NULL, domain_name LONGTEXT DEFAULT NULL, preview_picture LONGTEXT DEFAULT NULL, is_public TINYINT(1) DEFAULT '0', INDEX IDX_F4D18282A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; +CREATE TABLE {$this->getTable('entry')} (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, title LONGTEXT DEFAULT NULL, url LONGTEXT DEFAULT NULL, is_archived TINYINT(1) NOT NULL, is_starred TINYINT(1) NOT NULL, content LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, mimetype LONGTEXT DEFAULT NULL, language LONGTEXT DEFAULT NULL, reading_time INT DEFAULT NULL, domain_name LONGTEXT DEFAULT NULL, preview_picture LONGTEXT DEFAULT NULL, is_public TINYINT(1) DEFAULT '0', INDEX IDX_F4D18282A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; CREATE TABLE {$this->getTable('entry_tag')} (entry_id INT NOT NULL, tag_id INT NOT NULL, INDEX IDX_C9F0DD7CBA364942 (entry_id), INDEX IDX_C9F0DD7CBAD26311 (tag_id), PRIMARY KEY(entry_id, tag_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; -CREATE TABLE `{$this->getTable('config')}` (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, theme VARCHAR(255) NOT NULL, items_per_page INT NOT NULL, language VARCHAR(255) NOT NULL, rss_token VARCHAR(255) DEFAULT NULL, rss_limit INT DEFAULT NULL, reading_speed DOUBLE PRECISION DEFAULT NULL, UNIQUE INDEX UNIQ_87E64C53A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; -CREATE TABLE `{$this->getTable('tagging_rule')}` (id INT AUTO_INCREMENT NOT NULL, config_id INT DEFAULT NULL, rule VARCHAR(255) NOT NULL, tags LONGTEXT NOT NULL COMMENT '(DC2Type:simple_array)', INDEX IDX_2D9B3C5424DB0683 (config_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; -CREATE TABLE `{$this->getTable('tag')}` (id INT AUTO_INCREMENT NOT NULL, `label` LONGTEXT NOT NULL, slug VARCHAR(128) NOT NULL, UNIQUE INDEX UNIQ_4CA58A8C989D9B62 (slug), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; +CREATE TABLE {$this->getTable('config')} (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, theme VARCHAR(255) NOT NULL, items_per_page INT NOT NULL, language VARCHAR(255) NOT NULL, rss_token VARCHAR(255) DEFAULT NULL, rss_limit INT DEFAULT NULL, reading_speed DOUBLE PRECISION DEFAULT NULL, UNIQUE INDEX UNIQ_87E64C53A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; +CREATE TABLE {$this->getTable('tagging_rule')} (id INT AUTO_INCREMENT NOT NULL, config_id INT DEFAULT NULL, rule VARCHAR(255) NOT NULL, tags LONGTEXT NOT NULL COMMENT '(DC2Type:simple_array)', INDEX IDX_2D9B3C5424DB0683 (config_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; +CREATE TABLE {$this->getTable('tag')} (id INT AUTO_INCREMENT NOT NULL, `label` LONGTEXT NOT NULL, slug VARCHAR(128) NOT NULL, UNIQUE INDEX UNIQ_4CA58A8C989D9B62 (slug), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; CREATE TABLE {$this->getTable('oauth2_clients')} (id INT AUTO_INCREMENT NOT NULL, random_id VARCHAR(255) NOT NULL, redirect_uris LONGTEXT NOT NULL COMMENT '(DC2Type:array)', secret VARCHAR(255) NOT NULL, allowed_grant_types LONGTEXT NOT NULL COMMENT '(DC2Type:array)', PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; CREATE TABLE {$this->getTable('oauth2_access_tokens')} (id INT AUTO_INCREMENT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_368A42095F37A13B (token), INDEX IDX_368A420919EB6921 (client_id), INDEX IDX_368A4209A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; CREATE TABLE {$this->getTable('oauth2_refresh_tokens')} (id INT AUTO_INCREMENT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_20C9FB245F37A13B (token), INDEX IDX_20C9FB2419EB6921 (client_id), INDEX IDX_20C9FB24A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; CREATE TABLE {$this->getTable('oauth2_auth_codes')} (id INT AUTO_INCREMENT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, redirect_uri LONGTEXT NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_EE52E3FA5F37A13B (token), INDEX IDX_EE52E3FA19EB6921 (client_id), INDEX IDX_EE52E3FAA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; -CREATE TABLE `{$this->getTable('user')}` (id INT AUTO_INCREMENT NOT NULL, username VARCHAR(180) NOT NULL, username_canonical VARCHAR(180) NOT NULL, email VARCHAR(180) NOT NULL, email_canonical VARCHAR(180) NOT NULL, enabled TINYINT(1) NOT NULL, salt VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, locked TINYINT(1) NOT NULL, expired TINYINT(1) NOT NULL, expires_at DATETIME DEFAULT NULL, confirmation_token VARCHAR(255) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, roles LONGTEXT NOT NULL COMMENT '(DC2Type:array)', credentials_expired TINYINT(1) NOT NULL, credentials_expire_at DATETIME DEFAULT NULL, name LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, authCode INT DEFAULT NULL, twoFactorAuthentication TINYINT(1) NOT NULL, trusted LONGTEXT DEFAULT NULL COMMENT '(DC2Type:json_array)', UNIQUE INDEX UNIQ_1D63E7E592FC23A8 (username_canonical), UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF (email_canonical), UNIQUE INDEX UNIQ_1D63E7E5C05FB297 (confirmation_token), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; +CREATE TABLE {$this->getTable('user')} (id INT AUTO_INCREMENT NOT NULL, username VARCHAR(180) NOT NULL, username_canonical VARCHAR(180) NOT NULL, email VARCHAR(180) NOT NULL, email_canonical VARCHAR(180) NOT NULL, enabled TINYINT(1) NOT NULL, salt VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, locked TINYINT(1) NOT NULL, expired TINYINT(1) NOT NULL, expires_at DATETIME DEFAULT NULL, confirmation_token VARCHAR(255) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, roles LONGTEXT NOT NULL COMMENT '(DC2Type:array)', credentials_expired TINYINT(1) NOT NULL, credentials_expire_at DATETIME DEFAULT NULL, name LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, authCode INT DEFAULT NULL, twoFactorAuthentication TINYINT(1) NOT NULL, trusted LONGTEXT DEFAULT NULL COMMENT '(DC2Type:json_array)', UNIQUE INDEX UNIQ_1D63E7E592FC23A8 (username_canonical), UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF (email_canonical), UNIQUE INDEX UNIQ_1D63E7E5C05FB297 (confirmation_token), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; CREATE TABLE {$this->getTable('annotation')} (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, entry_id INT DEFAULT NULL, text LONGTEXT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, quote VARCHAR(255) NOT NULL, ranges LONGTEXT NOT NULL COMMENT '(DC2Type:array)', INDEX IDX_A7AED006A76ED395 (user_id), INDEX IDX_A7AED006BA364942 (entry_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; -ALTER TABLE `{$this->getTable('entry')}` ADD CONSTRAINT FK_F4D18282A76ED395 FOREIGN KEY (user_id) REFERENCES `{$this->getTable('user')}` (id); -ALTER TABLE {$this->getTable('entry_tag')} ADD CONSTRAINT FK_C9F0DD7CBA364942 FOREIGN KEY (entry_id) REFERENCES `{$this->getTable('entry')}` (id); -ALTER TABLE {$this->getTable('entry_tag')} ADD CONSTRAINT FK_C9F0DD7CBAD26311 FOREIGN KEY (tag_id) REFERENCES `{$this->getTable('tag')}` (id); -ALTER TABLE `{$this->getTable('config')}` ADD CONSTRAINT FK_87E64C53A76ED395 FOREIGN KEY (user_id) REFERENCES `{$this->getTable('user')}` (id); -ALTER TABLE `{$this->getTable('tagging_rule')}` ADD CONSTRAINT FK_2D9B3C5424DB0683 FOREIGN KEY (config_id) REFERENCES `{$this->getTable('config')}` (id); +ALTER TABLE {$this->getTable('entry')} ADD CONSTRAINT FK_F4D18282A76ED395 FOREIGN KEY (user_id) REFERENCES {$this->getTable('user')} (id); +ALTER TABLE {$this->getTable('entry_tag')} ADD CONSTRAINT FK_C9F0DD7CBA364942 FOREIGN KEY (entry_id) REFERENCES {$this->getTable('entry')} (id); +ALTER TABLE {$this->getTable('entry_tag')} ADD CONSTRAINT FK_C9F0DD7CBAD26311 FOREIGN KEY (tag_id) REFERENCES {$this->getTable('tag')} (id); +ALTER TABLE {$this->getTable('config')} ADD CONSTRAINT FK_87E64C53A76ED395 FOREIGN KEY (user_id) REFERENCES {$this->getTable('user')} (id); +ALTER TABLE {$this->getTable('tagging_rule')} ADD CONSTRAINT FK_2D9B3C5424DB0683 FOREIGN KEY (config_id) REFERENCES {$this->getTable('config')} (id); ALTER TABLE {$this->getTable('oauth2_access_tokens')} ADD CONSTRAINT FK_368A420919EB6921 FOREIGN KEY (client_id) REFERENCES {$this->getTable('oauth2_clients')} (id); -ALTER TABLE {$this->getTable('oauth2_access_tokens')} ADD CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES `{$this->getTable('user')}` (id); +ALTER TABLE {$this->getTable('oauth2_access_tokens')} ADD CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES {$this->getTable('user')} (id); ALTER TABLE {$this->getTable('oauth2_refresh_tokens')} ADD CONSTRAINT FK_20C9FB2419EB6921 FOREIGN KEY (client_id) REFERENCES {$this->getTable('oauth2_clients')} (id); -ALTER TABLE {$this->getTable('oauth2_refresh_tokens')} ADD CONSTRAINT FK_20C9FB24A76ED395 FOREIGN KEY (user_id) REFERENCES `{$this->getTable('user')}` (id); +ALTER TABLE {$this->getTable('oauth2_refresh_tokens')} ADD CONSTRAINT FK_20C9FB24A76ED395 FOREIGN KEY (user_id) REFERENCES {$this->getTable('user')} (id); ALTER TABLE {$this->getTable('oauth2_auth_codes')} ADD CONSTRAINT FK_EE52E3FA19EB6921 FOREIGN KEY (client_id) REFERENCES {$this->getTable('oauth2_clients')} (id); -ALTER TABLE {$this->getTable('oauth2_auth_codes')} ADD CONSTRAINT FK_EE52E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES `{$this->getTable('user')}` (id); -ALTER TABLE {$this->getTable('annotation')} ADD CONSTRAINT FK_A7AED006A76ED395 FOREIGN KEY (user_id) REFERENCES `{$this->getTable('user')}` (id); -ALTER TABLE {$this->getTable('annotation')} ADD CONSTRAINT FK_A7AED006BA364942 FOREIGN KEY (entry_id) REFERENCES `{$this->getTable('entry')}` (id); +ALTER TABLE {$this->getTable('oauth2_auth_codes')} ADD CONSTRAINT FK_EE52E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES {$this->getTable('user')} (id); +ALTER TABLE {$this->getTable('annotation')} ADD CONSTRAINT FK_A7AED006A76ED395 FOREIGN KEY (user_id) REFERENCES {$this->getTable('user')} (id); +ALTER TABLE {$this->getTable('annotation')} ADD CONSTRAINT FK_A7AED006BA364942 FOREIGN KEY (entry_id) REFERENCES {$this->getTable('entry')} (id); SQL ; foreach (explode("\n", $sql) as $query) { @@ -197,9 +185,4 @@ SQL $this->addSql("DROP TABLE {$this->getTable('user')}"); $this->addSql("DROP TABLE {$this->getTable('annotation')}"); } - - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix') . $tableName; - } } diff --git a/app/DoctrineMigrations/Version20160410190541.php b/app/DoctrineMigrations/Version20160410190541.php index 55c12ce15..e1bd3e5c6 100644 --- a/app/DoctrineMigrations/Version20160410190541.php +++ b/app/DoctrineMigrations/Version20160410190541.php @@ -2,26 +2,14 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; +use Wallabag\CoreBundle\Doctrine\WallabagMigration; /** * Added foreign keys for account resetting. */ -class Version20160410190541 extends AbstractMigration implements ContainerAwareInterface +class Version20160410190541 extends WallabagMigration { - /** - * @var ContainerInterface - */ - private $container; - - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } - /** * @param Schema $schema */ @@ -56,9 +44,4 @@ class Version20160410190541 extends AbstractMigration implements ContainerAwareI $this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'share_public'"); } - - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix') . $tableName; - } } diff --git a/app/DoctrineMigrations/Version20160812120952.php b/app/DoctrineMigrations/Version20160812120952.php index d28f3a71d..d09aefa09 100644 --- a/app/DoctrineMigrations/Version20160812120952.php +++ b/app/DoctrineMigrations/Version20160812120952.php @@ -2,26 +2,14 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; +use Wallabag\CoreBundle\Doctrine\WallabagMigration; /** * Added name field on wallabag_oauth2_clients. */ -class Version20160812120952 extends AbstractMigration implements ContainerAwareInterface +class Version20160812120952 extends WallabagMigration { - /** - * @var ContainerInterface - */ - private $container; - - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } - /** * @param Schema $schema */ @@ -65,9 +53,4 @@ class Version20160812120952 extends AbstractMigration implements ContainerAwareI $clientsTable->dropColumn('name'); } } - - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix') . $tableName; - } } diff --git a/app/DoctrineMigrations/Version20160911214952.php b/app/DoctrineMigrations/Version20160911214952.php index 08cc8a03c..9dc225fdc 100644 --- a/app/DoctrineMigrations/Version20160911214952.php +++ b/app/DoctrineMigrations/Version20160911214952.php @@ -2,26 +2,14 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; +use Wallabag\CoreBundle\Doctrine\WallabagMigration; /** * Added settings for RabbitMQ and Redis imports. */ -class Version20160911214952 extends AbstractMigration implements ContainerAwareInterface +class Version20160911214952 extends WallabagMigration { - /** - * @var ContainerInterface - */ - private $container; - - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } - /** * @param Schema $schema */ @@ -56,9 +44,4 @@ class Version20160911214952 extends AbstractMigration implements ContainerAwareI $this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'import_with_redis';"); $this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'import_with_rabbitmq';"); } - - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix') . $tableName; - } } diff --git a/app/DoctrineMigrations/Version20160916201049.php b/app/DoctrineMigrations/Version20160916201049.php index 83503bc49..13f99ce10 100644 --- a/app/DoctrineMigrations/Version20160916201049.php +++ b/app/DoctrineMigrations/Version20160916201049.php @@ -2,26 +2,14 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; +use Wallabag\CoreBundle\Doctrine\WallabagMigration; /** * Added pocket_consumer_key field on wallabag_config. */ -class Version20160916201049 extends AbstractMigration implements ContainerAwareInterface +class Version20160916201049 extends WallabagMigration { - /** - * @var ContainerInterface - */ - private $container; - - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } - /** * @param Schema $schema */ @@ -44,9 +32,4 @@ class Version20160916201049 extends AbstractMigration implements ContainerAwareI $configTable->dropColumn('pocket_consumer_key'); $this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('pocket_consumer_key', NULL, 'import')"); } - - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix') . $tableName; - } } diff --git a/app/DoctrineMigrations/Version20161001072726.php b/app/DoctrineMigrations/Version20161001072726.php index f9d088a37..4e19a54a7 100644 --- a/app/DoctrineMigrations/Version20161001072726.php +++ b/app/DoctrineMigrations/Version20161001072726.php @@ -2,27 +2,15 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Migrations\SkipMigrationException; use Doctrine\DBAL\Schema\Schema; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; +use Wallabag\CoreBundle\Doctrine\WallabagMigration; /** * Added pocket_consumer_key field on wallabag_config. */ -class Version20161001072726 extends AbstractMigration implements ContainerAwareInterface +class Version20161001072726 extends WallabagMigration { - /** - * @var ContainerInterface - */ - private $container; - - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } - /** * @param Schema $schema */ @@ -36,7 +24,7 @@ class Version20161001072726 extends AbstractMigration implements ContainerAwareI $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_%' + WHERE TABLE_NAME = '" . $this->getTable('entry_tag', WallabagMigration::UN_ESCAPED_TABLE) . "' AND CONSTRAINT_NAME LIKE 'FK_%' AND TABLE_SCHEMA = '" . $this->connection->getDatabase() . "'" ); $query->execute(); @@ -54,7 +42,7 @@ class Version20161001072726 extends AbstractMigration implements ContainerAwareI FROM pg_constraint c JOIN pg_namespace n ON n.oid = c.connamespace WHERE contype = 'f' - AND conrelid::regclass::text = '" . $this->getTable('entry_tag') . "' + AND conrelid::regclass::text = '" . $this->getTable('entry_tag', WallabagMigration::UN_ESCAPED_TABLE) . "' AND n.nspname = 'public';" ); $query->execute(); @@ -75,7 +63,7 @@ class Version20161001072726 extends AbstractMigration implements ContainerAwareI $query = $this->connection->query(" SELECT CONSTRAINT_NAME FROM information_schema.key_column_usage - WHERE TABLE_NAME = '" . $this->getTable('annotation') . "' + WHERE TABLE_NAME = '" . $this->getTable('annotation', WallabagMigration::UN_ESCAPED_TABLE) . "' AND CONSTRAINT_NAME LIKE 'FK_%' AND COLUMN_NAME = 'entry_id' AND TABLE_SCHEMA = '" . $this->connection->getDatabase() . "'" @@ -95,7 +83,7 @@ class Version20161001072726 extends AbstractMigration implements ContainerAwareI FROM pg_constraint c JOIN pg_namespace n ON n.oid = c.connamespace WHERE contype = 'f' - AND conrelid::regclass::text = '" . $this->getTable('annotation') . "' + AND conrelid::regclass::text = '" . $this->getTable('annotation', WallabagMigration::UN_ESCAPED_TABLE) . "' AND n.nspname = 'public' AND pg_get_constraintdef(c.oid) LIKE '%entry_id%';" ); @@ -117,9 +105,4 @@ class Version20161001072726 extends AbstractMigration implements ContainerAwareI { throw new SkipMigrationException('Too complex ...'); } - - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix') . $tableName; - } } diff --git a/app/DoctrineMigrations/Version20161022134138.php b/app/DoctrineMigrations/Version20161022134138.php index c84f8fbba..231aada78 100644 --- a/app/DoctrineMigrations/Version20161022134138.php +++ b/app/DoctrineMigrations/Version20161022134138.php @@ -2,26 +2,14 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; +use Wallabag\CoreBundle\Doctrine\WallabagMigration; /** * Converted database to utf8mb4 encoding (for MySQL only). */ -class Version20161022134138 extends AbstractMigration implements ContainerAwareInterface +class Version20161022134138 extends WallabagMigration { - /** - * @var ContainerInterface - */ - private $container; - - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } - /** * @param Schema $schema */ @@ -29,7 +17,7 @@ class Version20161022134138 extends AbstractMigration implements ContainerAwareI { $this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL'); - $this->addSql('ALTER DATABASE ' . $this->connection->getParams()['dbname'] . ' CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;'); + $this->addSql('ALTER DATABASE `' . $this->connection->getParams()['dbname'] . '` CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;'); // convert field length for utf8mb4 // http://stackoverflow.com/a/31474509/569101 @@ -60,7 +48,7 @@ class Version20161022134138 extends AbstractMigration implements ContainerAwareI { $this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL'); - $this->addSql('ALTER DATABASE ' . $this->connection->getParams()['dbname'] . ' CHARACTER SET = utf8 COLLATE = utf8_unicode_ci;'); + $this->addSql('ALTER DATABASE `' . $this->connection->getParams()['dbname'] . '` 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;'); @@ -77,9 +65,4 @@ class Version20161022134138 extends AbstractMigration implements ContainerAwareI $this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE `name` `name` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); } - - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix') . $tableName; - } } diff --git a/app/DoctrineMigrations/Version20161024212538.php b/app/DoctrineMigrations/Version20161024212538.php index 698819be3..a7e3c3c86 100644 --- a/app/DoctrineMigrations/Version20161024212538.php +++ b/app/DoctrineMigrations/Version20161024212538.php @@ -2,28 +2,16 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; +use Wallabag\CoreBundle\Doctrine\WallabagMigration; /** * Added user_id column on oauth2_clients to prevent users to delete API clients from other users. */ -class Version20161024212538 extends AbstractMigration implements ContainerAwareInterface +class Version20161024212538 extends WallabagMigration { - /** - * @var ContainerInterface - */ - private $container; - private $constraintName = 'IDX_user_oauth_client'; - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } - /** * @param Schema $schema */ @@ -59,9 +47,4 @@ class Version20161024212538 extends AbstractMigration implements ContainerAwareI $clientsTable->removeForeignKey($this->constraintName); } } - - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix') . $tableName; - } } diff --git a/app/DoctrineMigrations/Version20161031132655.php b/app/DoctrineMigrations/Version20161031132655.php index 0deebdf96..8d5768627 100644 --- a/app/DoctrineMigrations/Version20161031132655.php +++ b/app/DoctrineMigrations/Version20161031132655.php @@ -2,26 +2,14 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; +use Wallabag\CoreBundle\Doctrine\WallabagMigration; /** * Added the internal setting to enable/disable downloading pictures. */ -class Version20161031132655 extends AbstractMigration implements ContainerAwareInterface +class Version20161031132655 extends WallabagMigration { - /** - * @var ContainerInterface - */ - private $container; - - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } - /** * @param Schema $schema */ @@ -44,9 +32,4 @@ class Version20161031132655 extends AbstractMigration implements ContainerAwareI { $this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'download_images_enabled';"); } - - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix') . $tableName; - } } diff --git a/app/DoctrineMigrations/Version20161104073720.php b/app/DoctrineMigrations/Version20161104073720.php index f59ad7ba2..e2b18a460 100644 --- a/app/DoctrineMigrations/Version20161104073720.php +++ b/app/DoctrineMigrations/Version20161104073720.php @@ -2,28 +2,16 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; +use Wallabag\CoreBundle\Doctrine\WallabagMigration; /** * Added created_at index on entry table. */ -class Version20161104073720 extends AbstractMigration implements ContainerAwareInterface +class Version20161104073720 extends WallabagMigration { - /** - * @var ContainerInterface - */ - private $container; - private $indexName = 'IDX_entry_created_at'; - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } - /** * @param Schema $schema */ @@ -45,9 +33,4 @@ class Version20161104073720 extends AbstractMigration implements ContainerAwareI $entryTable->dropIndex($this->indexName); } - - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix') . $tableName; - } } diff --git a/app/DoctrineMigrations/Version20161106113822.php b/app/DoctrineMigrations/Version20161106113822.php index 1d5a865bc..3a3c90dbf 100644 --- a/app/DoctrineMigrations/Version20161106113822.php +++ b/app/DoctrineMigrations/Version20161106113822.php @@ -2,26 +2,14 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; +use Wallabag\CoreBundle\Doctrine\WallabagMigration; /** * Added action_mark_as_read field on config table. */ -class Version20161106113822 extends AbstractMigration implements ContainerAwareInterface +class Version20161106113822 extends WallabagMigration { - /** - * @var ContainerInterface - */ - private $container; - - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } - /** * @param Schema $schema */ @@ -48,9 +36,4 @@ class Version20161106113822 extends AbstractMigration implements ContainerAwareI $configTable->dropColumn('action_mark_as_read'); } - - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix') . $tableName; - } } diff --git a/app/DoctrineMigrations/Version20161117071626.php b/app/DoctrineMigrations/Version20161117071626.php index 0b34caab5..fc66e7e31 100644 --- a/app/DoctrineMigrations/Version20161117071626.php +++ b/app/DoctrineMigrations/Version20161117071626.php @@ -2,26 +2,14 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; +use Wallabag\CoreBundle\Doctrine\WallabagMigration; /** * Added the internal setting to share articles to unmark.it. */ -class Version20161117071626 extends AbstractMigration implements ContainerAwareInterface +class Version20161117071626 extends WallabagMigration { - /** - * @var ContainerInterface - */ - private $container; - - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } - /** * @param Schema $schema */ @@ -56,9 +44,4 @@ class Version20161117071626 extends AbstractMigration implements ContainerAwareI $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';"); } - - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix') . $tableName; - } } diff --git a/app/DoctrineMigrations/Version20161118134328.php b/app/DoctrineMigrations/Version20161118134328.php index dab0ff5b4..8302408ec 100644 --- a/app/DoctrineMigrations/Version20161118134328.php +++ b/app/DoctrineMigrations/Version20161118134328.php @@ -2,26 +2,14 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; +use Wallabag\CoreBundle\Doctrine\WallabagMigration; /** * Add http_status in `entry_table`. */ -class Version20161118134328 extends AbstractMigration implements ContainerAwareInterface +class Version20161118134328 extends WallabagMigration { - /** - * @var ContainerInterface - */ - private $container; - - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } - /** * @param Schema $schema */ @@ -48,9 +36,4 @@ class Version20161118134328 extends AbstractMigration implements ContainerAwareI $entryTable->dropColumn('http_status'); } - - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix') . $tableName; - } } diff --git a/app/DoctrineMigrations/Version20161122144743.php b/app/DoctrineMigrations/Version20161122144743.php index 15052ad70..08a41f480 100644 --- a/app/DoctrineMigrations/Version20161122144743.php +++ b/app/DoctrineMigrations/Version20161122144743.php @@ -2,26 +2,14 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; +use Wallabag\CoreBundle\Doctrine\WallabagMigration; /** * Add the restricted_access internal setting for articles with paywall. */ -class Version20161122144743 extends AbstractMigration implements ContainerAwareInterface +class Version20161122144743 extends WallabagMigration { - /** - * @var ContainerInterface - */ - private $container; - - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } - /** * @param Schema $schema */ @@ -44,9 +32,4 @@ class Version20161122144743 extends AbstractMigration implements ContainerAwareI { $this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'restricted_access';"); } - - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix') . $tableName; - } } diff --git a/app/DoctrineMigrations/Version20161122203647.php b/app/DoctrineMigrations/Version20161122203647.php index ef08bd59d..60ddeb087 100644 --- a/app/DoctrineMigrations/Version20161122203647.php +++ b/app/DoctrineMigrations/Version20161122203647.php @@ -2,10 +2,8 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; +use Wallabag\CoreBundle\Doctrine\WallabagMigration; /** * Methods and properties removed from `FOS\UserBundle\Model\User`. @@ -18,18 +16,8 @@ use Symfony\Component\DependencyInjection\ContainerInterface; * You need to drop the fields `expired` and `credentials_expired` from your database * schema, because they aren't mapped anymore. */ -class Version20161122203647 extends AbstractMigration implements ContainerAwareInterface +class Version20161122203647 extends WallabagMigration { - /** - * @var ContainerInterface - */ - private $container; - - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } - /** * @param Schema $schema */ @@ -55,9 +43,4 @@ class Version20161122203647 extends AbstractMigration implements ContainerAwareI $userTable->addColumn('expired', 'smallint', ['notnull' => false]); $userTable->addColumn('credentials_expired', 'smallint', ['notnull' => false]); } - - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix') . $tableName; - } } diff --git a/app/DoctrineMigrations/Version20161128084725.php b/app/DoctrineMigrations/Version20161128084725.php index 497a9f216..ef747154a 100644 --- a/app/DoctrineMigrations/Version20161128084725.php +++ b/app/DoctrineMigrations/Version20161128084725.php @@ -2,26 +2,14 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; +use Wallabag\CoreBundle\Doctrine\WallabagMigration; /** * Added list_mode in user config. */ -class Version20161128084725 extends AbstractMigration implements ContainerAwareInterface +class Version20161128084725 extends WallabagMigration { - /** - * @var ContainerInterface - */ - private $container; - - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } - /** * @param Schema $schema */ @@ -41,9 +29,4 @@ class Version20161128084725 extends AbstractMigration implements ContainerAwareI $configTable = $schema->getTable($this->getTable('config')); $configTable->dropColumn('list_mode'); } - - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix') . $tableName; - } } diff --git a/app/DoctrineMigrations/Version20161128131503.php b/app/DoctrineMigrations/Version20161128131503.php index 9d92983a9..cd4346172 100644 --- a/app/DoctrineMigrations/Version20161128131503.php +++ b/app/DoctrineMigrations/Version20161128131503.php @@ -2,15 +2,13 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; +use Wallabag\CoreBundle\Doctrine\WallabagMigration; /** * Removed locked, credentials_expire_at and expires_at. */ -class Version20161128131503 extends AbstractMigration implements ContainerAwareInterface +class Version20161128131503 extends WallabagMigration { private $fields = [ 'locked' => 'smallint', @@ -18,16 +16,6 @@ class Version20161128131503 extends AbstractMigration implements ContainerAwareI 'expires_at' => 'datetime', ]; - /** - * @var ContainerInterface - */ - private $container; - - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } - /** * @param Schema $schema */ @@ -53,9 +41,4 @@ class Version20161128131503 extends AbstractMigration implements ContainerAwareI $userTable->addColumn($field, $type, ['notnull' => false]); } } - - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix') . $tableName; - } } diff --git a/app/DoctrineMigrations/Version20161214094402.php b/app/DoctrineMigrations/Version20161214094402.php index 07090b2f2..e9f1a3020 100644 --- a/app/DoctrineMigrations/Version20161214094402.php +++ b/app/DoctrineMigrations/Version20161214094402.php @@ -2,26 +2,14 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; +use Wallabag\CoreBundle\Doctrine\WallabagMigration; /** * Renamed uuid to uid in entry table. */ -class Version20161214094402 extends AbstractMigration implements ContainerAwareInterface +class Version20161214094402 extends WallabagMigration { - /** - * @var ContainerInterface - */ - private $container; - - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } - /** * @param Schema $schema */ @@ -67,9 +55,4 @@ class Version20161214094402 extends AbstractMigration implements ContainerAwareI $this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' RENAME uid TO uuid'); } } - - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix') . $tableName; - } } diff --git a/app/DoctrineMigrations/Version20161214094403.php b/app/DoctrineMigrations/Version20161214094403.php index 6b5640e56..1f9e1f6be 100644 --- a/app/DoctrineMigrations/Version20161214094403.php +++ b/app/DoctrineMigrations/Version20161214094403.php @@ -2,28 +2,16 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; +use Wallabag\CoreBundle\Doctrine\WallabagMigration; /** * Added index on wallabag_entry.uid. */ -class Version20161214094403 extends AbstractMigration implements ContainerAwareInterface +class Version20161214094403 extends WallabagMigration { - /** - * @var ContainerInterface - */ - private $container; - private $indexName = 'IDX_entry_uid'; - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } - /** * @param Schema $schema */ @@ -45,9 +33,4 @@ class Version20161214094403 extends AbstractMigration implements ContainerAwareI $entryTable->dropIndex($this->indexName); } - - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix') . $tableName; - } } diff --git a/app/DoctrineMigrations/Version20170127093841.php b/app/DoctrineMigrations/Version20170127093841.php index fc78a2469..491b9383f 100644 --- a/app/DoctrineMigrations/Version20170127093841.php +++ b/app/DoctrineMigrations/Version20170127093841.php @@ -2,29 +2,17 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; +use Wallabag\CoreBundle\Doctrine\WallabagMigration; /** * Added indexes on wallabag_entry.is_starred and wallabag_entry.is_archived. */ -class Version20170127093841 extends AbstractMigration implements ContainerAwareInterface +class Version20170127093841 extends WallabagMigration { - /** - * @var ContainerInterface - */ - private $container; - private $indexStarredName = 'IDX_entry_starred'; private $indexArchivedName = 'IDX_entry_archived'; - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } - /** * @param Schema $schema */ @@ -48,9 +36,4 @@ class Version20170127093841 extends AbstractMigration implements ContainerAwareI $entryTable->dropIndex($this->indexStarredName); $entryTable->dropIndex($this->indexArchivedName); } - - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix') . $tableName; - } } diff --git a/app/DoctrineMigrations/Version20170327194233.php b/app/DoctrineMigrations/Version20170327194233.php index 3e7e722dd..1aa20eb5f 100644 --- a/app/DoctrineMigrations/Version20170327194233.php +++ b/app/DoctrineMigrations/Version20170327194233.php @@ -2,26 +2,14 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; +use Wallabag\CoreBundle\Doctrine\WallabagMigration; /** * Add the share_scuttle internal setting. */ -class Version20170327194233 extends AbstractMigration implements ContainerAwareInterface +class Version20170327194233 extends WallabagMigration { - /** - * @var ContainerInterface - */ - private $container; - - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } - /** * @param Schema $schema */ @@ -46,9 +34,4 @@ class Version20170327194233 extends AbstractMigration implements ContainerAwareI $this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'share_scuttle';"); $this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'scuttle_url';"); } - - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix') . $tableName; - } } diff --git a/app/DoctrineMigrations/Version20170405182620.php b/app/DoctrineMigrations/Version20170405182620.php index 75793fcbf..c7752664a 100644 --- a/app/DoctrineMigrations/Version20170405182620.php +++ b/app/DoctrineMigrations/Version20170405182620.php @@ -2,26 +2,14 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; +use Wallabag\CoreBundle\Doctrine\WallabagMigration; /** * Add published_at and published_by in `entry` table. */ -class Version20170405182620 extends AbstractMigration implements ContainerAwareInterface +class Version20170405182620 extends WallabagMigration { - /** - * @var ContainerInterface - */ - private $container; - - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } - /** * @param Schema $schema */ @@ -57,9 +45,4 @@ class Version20170405182620 extends AbstractMigration implements ContainerAwareI $entryTable->dropColumn('published_by'); } - - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix') . $tableName; - } } diff --git a/app/DoctrineMigrations/Version20170407200919.php b/app/DoctrineMigrations/Version20170407200919.php index 8a11ffe3f..ad05eadf5 100644 --- a/app/DoctrineMigrations/Version20170407200919.php +++ b/app/DoctrineMigrations/Version20170407200919.php @@ -2,26 +2,14 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; +use Wallabag\CoreBundle\Doctrine\WallabagMigration; /** * Remove isPublic in Entry Table. */ -class Version20170407200919 extends AbstractMigration implements ContainerAwareInterface +class Version20170407200919 extends WallabagMigration { - /** - * @var ContainerInterface - */ - private $container; - - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } - /** * @param Schema $schema */ @@ -43,9 +31,4 @@ class Version20170407200919 extends AbstractMigration implements ContainerAwareI $entryTable->addColumn('is_public', 'boolean', ['notnull' => false, 'default' => 0]); } - - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix') . $tableName; - } } diff --git a/app/DoctrineMigrations/Version20170420134133.php b/app/DoctrineMigrations/Version20170420134133.php index e1947a494..c17325783 100644 --- a/app/DoctrineMigrations/Version20170420134133.php +++ b/app/DoctrineMigrations/Version20170420134133.php @@ -2,26 +2,14 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; +use Wallabag\CoreBundle\Doctrine\WallabagMigration; /** * Remove download_pictures in craue_config_setting. */ -class Version20170420134133 extends AbstractMigration implements ContainerAwareInterface +class Version20170420134133 extends WallabagMigration { - /** - * @var ContainerInterface - */ - private $container; - - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } - /** * @param Schema $schema */ @@ -44,9 +32,4 @@ class Version20170420134133 extends AbstractMigration implements ContainerAwareI $this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('download_pictures', '1', 'entry')"); } - - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix') . $tableName; - } } diff --git a/app/DoctrineMigrations/Version20170501115751.php b/app/DoctrineMigrations/Version20170501115751.php index adf2f8413..fd238cef6 100644 --- a/app/DoctrineMigrations/Version20170501115751.php +++ b/app/DoctrineMigrations/Version20170501115751.php @@ -2,26 +2,14 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; +use Wallabag\CoreBundle\Doctrine\WallabagMigration; /** * Add site credential table to store username & password for some website (behind authentication or paywall). */ -class Version20170501115751 extends AbstractMigration implements ContainerAwareInterface +class Version20170501115751 extends WallabagMigration { - /** - * @var ContainerInterface - */ - private $container; - - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } - /** * @param Schema $schema */ @@ -53,9 +41,4 @@ class Version20170501115751 extends AbstractMigration implements ContainerAwareI { $schema->dropTable($this->getTable('site_credential')); } - - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix') . $tableName; - } } diff --git a/app/DoctrineMigrations/Version20170510082609.php b/app/DoctrineMigrations/Version20170510082609.php index 52c70168c..541ae1fdd 100644 --- a/app/DoctrineMigrations/Version20170510082609.php +++ b/app/DoctrineMigrations/Version20170510082609.php @@ -2,15 +2,13 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; +use Wallabag\CoreBundle\Doctrine\WallabagMigration; /** * Changed length for username, username_canonical, email and email_canonical fields in wallabag_user table. */ -class Version20170510082609 extends AbstractMigration implements ContainerAwareInterface +class Version20170510082609 extends WallabagMigration { private $fields = [ 'username', @@ -19,16 +17,6 @@ class Version20170510082609 extends AbstractMigration implements ContainerAwareI 'email_canonical', ]; - /** - * @var ContainerInterface - */ - private $container; - - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } - /** * @param Schema $schema */ @@ -52,9 +40,4 @@ class Version20170510082609 extends AbstractMigration implements ContainerAwareI $this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE ' . $field . ' ' . $field . ' VARCHAR(255) NOT NULL;'); } } - - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix') . $tableName; - } } diff --git a/app/DoctrineMigrations/Version20170511115400.php b/app/DoctrineMigrations/Version20170511115400.php index cad2b637a..cb80dd451 100644 --- a/app/DoctrineMigrations/Version20170511115400.php +++ b/app/DoctrineMigrations/Version20170511115400.php @@ -2,26 +2,14 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; +use Wallabag\CoreBundle\Doctrine\WallabagMigration; /** * Added `headers` field in entry table. */ -class Version20170511115400 extends AbstractMigration implements ContainerAwareInterface +class Version20170511115400 extends WallabagMigration { - /** - * @var ContainerInterface - */ - private $container; - - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } - /** * @param Schema $schema */ @@ -47,9 +35,4 @@ class Version20170511115400 extends AbstractMigration implements ContainerAwareI $entryTable->dropColumn('headers'); } - - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix') . $tableName; - } } diff --git a/app/DoctrineMigrations/Version20170511211659.php b/app/DoctrineMigrations/Version20170511211659.php index f004d1b3c..00ce7b1f3 100644 --- a/app/DoctrineMigrations/Version20170511211659.php +++ b/app/DoctrineMigrations/Version20170511211659.php @@ -2,27 +2,15 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Migrations\SkipMigrationException; use Doctrine\DBAL\Schema\Schema; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; +use Wallabag\CoreBundle\Doctrine\WallabagMigration; /** * Increase the length of the "quote" column of "annotation" table. */ -class Version20170511211659 extends AbstractMigration implements ContainerAwareInterface +class Version20170511211659 extends WallabagMigration { - /** - * @var ContainerInterface - */ - private $container; - - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } - public function up(Schema $schema) { $tableName = $this->getTable('annotation'); @@ -30,8 +18,8 @@ class Version20170511211659 extends AbstractMigration implements ContainerAwareI switch ($this->connection->getDatabasePlatform()->getName()) { case 'sqlite': $this->addSql(<<addSql(<<container->getParameter('database_table_prefix') . $tableName; - } } diff --git a/app/DoctrineMigrations/Version20170602075214.php b/app/DoctrineMigrations/Version20170602075214.php index 6b6f00358..12997c715 100644 --- a/app/DoctrineMigrations/Version20170602075214.php +++ b/app/DoctrineMigrations/Version20170602075214.php @@ -2,26 +2,14 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; +use Wallabag\CoreBundle\Doctrine\WallabagMigration; /** * Add api_user_registration in craue_config_setting. */ -class Version20170602075214 extends AbstractMigration implements ContainerAwareInterface +class Version20170602075214 extends WallabagMigration { - /** - * @var ContainerInterface - */ - private $container; - - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } - /** * @param Schema $schema */ @@ -44,9 +32,4 @@ class Version20170602075214 extends AbstractMigration implements ContainerAwareI { $this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'api_user_registration';"); } - - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix') . $tableName; - } } diff --git a/app/DoctrineMigrations/Version20170606155640.php b/app/DoctrineMigrations/Version20170606155640.php index 5f58fc29c..153d31b88 100644 --- a/app/DoctrineMigrations/Version20170606155640.php +++ b/app/DoctrineMigrations/Version20170606155640.php @@ -2,27 +2,15 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; +use Wallabag\CoreBundle\Doctrine\WallabagMigration; /** * Remove wallabag_url from craue_config_setting. * It has been moved into the parameters.yml. */ -class Version20170606155640 extends AbstractMigration implements ContainerAwareInterface +class Version20170606155640 extends WallabagMigration { - /** - * @var ContainerInterface - */ - private $container; - - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } - /** * @param Schema $schema */ @@ -45,9 +33,4 @@ class Version20170606155640 extends AbstractMigration implements ContainerAwareI { $this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('wallabag_url', 'wallabag.me', 'misc')"); } - - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix') . $tableName; - } } diff --git a/app/DoctrineMigrations/Version20170719231144.php b/app/DoctrineMigrations/Version20170719231144.php index 867540331..04358c7ce 100644 --- a/app/DoctrineMigrations/Version20170719231144.php +++ b/app/DoctrineMigrations/Version20170719231144.php @@ -2,26 +2,14 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; +use Wallabag\CoreBundle\Doctrine\WallabagMigration; /** * Changed tags to lowercase. */ -class Version20170719231144 extends AbstractMigration implements ContainerAwareInterface +class Version20170719231144 extends WallabagMigration { - /** - * @var ContainerInterface - */ - private $container; - - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } - /** * @param Schema $schema */ @@ -108,9 +96,4 @@ class Version20170719231144 extends AbstractMigration implements ContainerAwareI { throw new SkipMigrationException('Too complex ...'); } - - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix') . $tableName; - } } diff --git a/app/DoctrineMigrations/Version20170824113337.php b/app/DoctrineMigrations/Version20170824113337.php index e54a9bcf7..5fc31de9d 100644 --- a/app/DoctrineMigrations/Version20170824113337.php +++ b/app/DoctrineMigrations/Version20170824113337.php @@ -2,26 +2,14 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; +use Wallabag\CoreBundle\Doctrine\WallabagMigration; /** * Add starred_at column and set its value to updated_at for is_starred entries. */ -class Version20170824113337 extends AbstractMigration implements ContainerAwareInterface +class Version20170824113337 extends WallabagMigration { - /** - * @var ContainerInterface - */ - private $container; - - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } - /** * @param Schema $schema */ @@ -60,9 +48,4 @@ class Version20170824113337 extends AbstractMigration implements ContainerAwareI $entryTable->dropColumn('starred_at'); } - - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix') . $tableName; - } } diff --git a/app/DoctrineMigrations/Version20171008195606.php b/app/DoctrineMigrations/Version20171008195606.php index f09726c85..6974232a0 100644 --- a/app/DoctrineMigrations/Version20171008195606.php +++ b/app/DoctrineMigrations/Version20171008195606.php @@ -2,26 +2,14 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; +use Wallabag\CoreBundle\Doctrine\WallabagMigration; /** * Changed reading_time field to prevent null value. */ -class Version20171008195606 extends AbstractMigration implements ContainerAwareInterface +class Version20171008195606 extends WallabagMigration { - /** - * @var ContainerInterface - */ - private $container; - - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } - /** * @param Schema $schema */ @@ -57,9 +45,4 @@ class Version20171008195606 extends AbstractMigration implements ContainerAwareI break; } } - - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix') . $tableName; - } } diff --git a/app/DoctrineMigrations/Version20171105202000.php b/app/DoctrineMigrations/Version20171105202000.php index 3769045fe..5ed787b99 100644 --- a/app/DoctrineMigrations/Version20171105202000.php +++ b/app/DoctrineMigrations/Version20171105202000.php @@ -2,26 +2,14 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; +use Wallabag\CoreBundle\Doctrine\WallabagMigration; /** * Add origin_url column. */ -class Version20171105202000 extends AbstractMigration implements ContainerAwareInterface +class Version20171105202000 extends WallabagMigration { - /** - * @var ContainerInterface - */ - private $container; - - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } - /** * @param Schema $schema */ @@ -47,9 +35,4 @@ class Version20171105202000 extends AbstractMigration implements ContainerAwareI $entryTable->dropColumn('origin_url'); } - - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix') . $tableName; - } } diff --git a/app/DoctrineMigrations/Version20171120163128.php b/app/DoctrineMigrations/Version20171120163128.php index fc3d4c37e..48f10f1de 100644 --- a/app/DoctrineMigrations/Version20171120163128.php +++ b/app/DoctrineMigrations/Version20171120163128.php @@ -2,26 +2,14 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; +use Wallabag\CoreBundle\Doctrine\WallabagMigration; /** * Add store_article_headers in craue_config_setting. */ -class Version20171120163128 extends AbstractMigration implements ContainerAwareInterface +class Version20171120163128 extends WallabagMigration { - /** - * @var ContainerInterface - */ - private $container; - - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } - /** * @param Schema $schema */ @@ -44,9 +32,4 @@ class Version20171120163128 extends AbstractMigration implements ContainerAwareI { $this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'store_article_headers';"); } - - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix') . $tableName; - } } diff --git a/app/DoctrineMigrations/Version20171125164500.php b/app/DoctrineMigrations/Version20171125164500.php index 980e0e756..a72463f0c 100644 --- a/app/DoctrineMigrations/Version20171125164500.php +++ b/app/DoctrineMigrations/Version20171125164500.php @@ -2,26 +2,14 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; +use Wallabag\CoreBundle\Doctrine\WallabagMigration; /** * Add shaarli_share_origin_url in craue_config_setting. */ -class Version20171125164500 extends AbstractMigration implements ContainerAwareInterface +class Version20171125164500 extends WallabagMigration { - /** - * @var ContainerInterface - */ - private $container; - - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } - /** * @param Schema $schema */ @@ -44,9 +32,4 @@ class Version20171125164500 extends AbstractMigration implements ContainerAwareI { $this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'shaarli_share_origin_url';"); } - - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix') . $tableName; - } } diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml index 4c99652a7..13771799c 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml @@ -36,5 +36,5 @@ share_public: Autorizar una URL publica pels articles download_images_enabled: Telecargar los imatges en local restricted_access: Activar l'autenticacion pels sites amb peatge api_user_registration: Autorizar los utilizaires a se marcar amb l'API -# store_article_headers: Enable if wallabag stores HTTP headers for each article -# shaarli_share_origin_url: Enable sharing origin url to Shaarli, if the service is enabled +store_article_headers: Activar se wallabag garda las entèstas HTTP per cada article +shaarli_share_origin_url: Activar lo partatge de l’url amb Shaarli, se lo servici es activat diff --git a/app/Resources/static/themes/_global/index.js b/app/Resources/static/themes/_global/index.js index fddb476dc..ae598e56e 100644 --- a/app/Resources/static/themes/_global/index.js +++ b/app/Resources/static/themes/_global/index.js @@ -13,8 +13,10 @@ import './global.scss'; import './js/shortcuts/entry'; import './js/shortcuts/main'; -import { savePercent, retrievePercent } from './js/tools'; +/* Hightlight */ +import './js/highlight'; +import { savePercent, retrievePercent } from './js/tools'; /* ========================================================================== Annotations & Remember position @@ -65,7 +67,7 @@ $(document).ready(() => { retrievePercent(x.entryId); $(window).resize(() => { - retrievePercent(x.entryId); + retrievePercent(x.entryId, true); }); } }); diff --git a/app/Resources/static/themes/_global/js/highlight.js b/app/Resources/static/themes/_global/js/highlight.js new file mode 100644 index 000000000..4025fc14f --- /dev/null +++ b/app/Resources/static/themes/_global/js/highlight.js @@ -0,0 +1,8 @@ +import 'highlight.js/styles/atom-one-light.css'; +import * as hljs from 'highlight.js'; + +window.addEventListener('load', () => { + document.querySelectorAll('pre').forEach((node) => { + hljs.highlightBlock(node); + }); +}); diff --git a/app/Resources/static/themes/_global/js/tools.js b/app/Resources/static/themes/_global/js/tools.js index 774f45399..7e5a2b271 100644 --- a/app/Resources/static/themes/_global/js/tools.js +++ b/app/Resources/static/themes/_global/js/tools.js @@ -19,14 +19,16 @@ function savePercent(id, percent) { return true; } -function retrievePercent(id) { +function retrievePercent(id, resized) { if (!supportsLocalStorage()) { return false; } const bheight = $(document).height(); const percent = localStorage[`wallabag.article.${id}.percent`]; const scroll = bheight * percent; - $('html,body').animate({ scrollTop: scroll }, 'fast'); + if (!resized) { + $('html,body').animate({ scrollTop: scroll }, 'fast'); + } return true; } diff --git a/app/Resources/static/themes/material/css/article.scss b/app/Resources/static/themes/material/css/article.scss index 2d4ef4b4f..75658a580 100644 --- a/app/Resources/static/themes/material/css/article.scss +++ b/app/Resources/static/themes/material/css/article.scss @@ -11,6 +11,7 @@ color: #424242; font-size: 18px; line-height: 1.7em; + overflow-wrap: break-word; h1, h2, diff --git a/app/Resources/static/themes/material/css/media_queries.scss b/app/Resources/static/themes/material/css/media_queries.scss index 69e3d47d5..725844269 100644 --- a/app/Resources/static/themes/material/css/media_queries.scss +++ b/app/Resources/static/themes/material/css/media_queries.scss @@ -22,6 +22,16 @@ padding-left: 0; } + table { + display: block; + overflow: auto; + } + + iframe { + max-width: 100%; + height: auto; + } + .nav-panels .action { padding-right: 0.75rem; } diff --git a/app/config/wallabag.yml b/app/config/wallabag.yml index b155d1591..d24769596 100644 --- a/app/config/wallabag.yml +++ b/app/config/wallabag.yml @@ -1,5 +1,5 @@ wallabag_core: - version: 2.3.2 + version: 2.3.3 paypal_url: "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9UBA65LG3FX9Y&lc=gb" languages: en: 'English' diff --git a/package.json b/package.json index e6659bd33..8d856bbb2 100644 --- a/package.json +++ b/package.json @@ -65,6 +65,7 @@ "dependencies": { "annotator": "git://github.com/wallabag/annotator.git#0f076c7d371ed25eb0793346f46982d90f2c4c85", "hammerjs": "^2.0.8", + "highlight.js": "^9.12.0", "icomoon-free-npm": "^0.0.0", "jquery": "^2.1.4", "jquery.cookie": "^1.4.1", diff --git a/src/Wallabag/CoreBundle/Controller/RssController.php b/src/Wallabag/CoreBundle/Controller/RssController.php index e84044b10..848bb8140 100644 --- a/src/Wallabag/CoreBundle/Controller/RssController.php +++ b/src/Wallabag/CoreBundle/Controller/RssController.php @@ -12,7 +12,6 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; -use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\Tag; use Wallabag\UserBundle\Entity\User; diff --git a/src/Wallabag/CoreBundle/Doctrine/WallabagMigration.php b/src/Wallabag/CoreBundle/Doctrine/WallabagMigration.php new file mode 100644 index 000000000..7aa2409a1 --- /dev/null +++ b/src/Wallabag/CoreBundle/Doctrine/WallabagMigration.php @@ -0,0 +1,49 @@ +container = $container; + } + + protected function getTable($tableName, $unEscaped = false) + { + $table = $this->container->getParameter('database_table_prefix') . $tableName; + + if (self::UN_ESCAPED_TABLE === $unEscaped) { + return $table; + } + + // escape table name is handled using " on postgresql + if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) { + return '"' . $table . '"'; + } + + // return escaped table + return '`' . $table . '`'; + } +} diff --git a/src/Wallabag/CoreBundle/Helper/DownloadImages.php b/src/Wallabag/CoreBundle/Helper/DownloadImages.php index 252ba57c5..9c9452ddf 100644 --- a/src/Wallabag/CoreBundle/Helper/DownloadImages.php +++ b/src/Wallabag/CoreBundle/Helper/DownloadImages.php @@ -42,14 +42,17 @@ class DownloadImages public function processHtml($entryId, $html, $url) { $crawler = new Crawler($html); - $result = $crawler - ->filterXpath('//img') + $imagesCrawler = $crawler + ->filterXpath('//img'); + $imagesUrls = $imagesCrawler ->extract(['src']); + $imagesSrcsetUrls = $this->getSrcsetUrls($imagesCrawler); + $imagesUrls = array_unique(array_merge($imagesUrls, $imagesSrcsetUrls)); $relativePath = $this->getRelativePath($entryId); // download and save the image to the folder - foreach ($result as $image) { + foreach ($imagesUrls as $image) { $imagePath = $this->processSingleImage($entryId, $image, $url, $relativePath); if (false === $imagePath) { @@ -171,6 +174,33 @@ class DownloadImages @rmdir($folderPath); } + /** + * Get images urls from the srcset image attribute. + * + * @param Crawler $imagesCrawler + * + * @return array An array of urls + */ + protected function getSrcsetUrls(Crawler $imagesCrawler) + { + $urls = []; + $iterator = $imagesCrawler + ->getIterator(); + while ($iterator->valid()) { + $srcsetAttribute = $iterator->current()->getAttribute('srcset'); + if ('' !== $srcsetAttribute) { + $srcset = array_map('trim', explode(',', $srcsetAttribute)); + $srcsetUrls = array_map(function ($src) { + return explode(' ', $src)[0]; + }, $srcset); + $urls = array_merge($srcsetUrls, $urls); + } + $iterator->next(); + } + + return $urls; + } + /** * Setup base folder where all images are going to be saved. */ diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index 0a65ce9f8..88517c82f 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml @@ -265,7 +265,7 @@ about: who_behind_wallabag: developped_by: 'Developed by' website: 'website' - many_contributors: 'And many others contributors ♥ on Github' + many_contributors: 'And many others contributors ♥ on GitHub' project_website: 'Project website' license: 'License' version: 'Version' @@ -323,7 +323,7 @@ howto: go_import: Go to import go_developers: Go to developers go_howto: Go to howto (this page!) - go_logout: Logout + go_logout: Log out list_title: Shortcuts available in listing pages search: Display the search form article_title: Shortcuts available in entry view @@ -373,7 +373,7 @@ quickstart: instapaper: 'Migrate from Instapaper' developer: title: 'Developers' - description: 'We also thought to the developers: Docker, API, translations, etc.' + description: 'We also thought of the developers: Docker, API, translations, etc.' create_application: 'Create your third-party application' use_docker: 'Use Docker to install wallabag' docs: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index 6130eee23..95bc9560f 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml @@ -234,7 +234,7 @@ entry: created_at: 'Data de creacion' published_at: 'Data de publicacion' published_by: 'Publicat per' - # provided_by: 'Provided by' + provided_by: 'Provesit per' new: page_title: 'Enregistrar un novèl article' placeholder: 'http://website.com' @@ -246,7 +246,7 @@ entry: page_title: 'Modificar un article' title_label: 'Títol' url_label: 'Url' - # origin_url_label: 'Origin url (from where you found that entry)' + origin_url_label: 'Url d’origina (ont avètz trobat aqueste article)' save_label: 'Enregistrar' public: shared_by_wallabag: "Aqueste article es estat partejat per wallabag" @@ -400,8 +400,8 @@ tag: add: 'Ajustar' placeholder: "Podètz ajustar mai qu'una etiqueta, separadas per de virgula." -# export: -# footer_template: '

Produced by wallabag with %method%

Please open an issue if you have trouble with the display of this E-Book on your device.

' +export: + footer_template: '

Produch per wallabag amb %method%

Mercés de dobrir una sollicitacion s’avètz de problèmas amb l’afichatge d’aqueste E-Book sus vòstre periferic.

' import: page_title: 'Importar' 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 0d05f4d5b..7484d53be 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 @@ -245,7 +245,7 @@
  • person {% for author in entry.publishedBy %} - {{ author }}{% if not loop.last %}, {% endif %} + {{ author|raw }}{% if not loop.last %}, {% endif %} {% endfor %}
  • {% endif %} @@ -276,7 +276,7 @@ {% if entry.previewPicture is not null %} -
    {{ entry.title|striptags|e('html_attr') }}
    +
    {{ entry.title|striptags|default('entry.default_title'|trans)|raw }}
    {% endif %} diff --git a/src/Wallabag/UserBundle/Resources/translations/wallabag_user.oc.yml b/src/Wallabag/UserBundle/Resources/translations/wallabag_user.oc.yml index e62ea2bcf..6277dc735 100644 --- a/src/Wallabag/UserBundle/Resources/translations/wallabag_user.oc.yml +++ b/src/Wallabag/UserBundle/Resources/translations/wallabag_user.oc.yml @@ -5,7 +5,7 @@ auth_code: subject: "Còdi d'autentificacion wallabag" body: hello: "Bonjorn %user%," - first_para: "Estant qu'avètz activat l'autentificacion en dos temps sus vòstre compte wallabag e que venètz de vos connectar dempuèi un novèl periferic (ordinador, mobil, etc.) vos mandem un còdi per validar la connexion." + first_para: "Estant qu'avètz activat l'autentificacion en dos temps sus vòstre compte wallabag e que venètz de vos connectar d'un novèl periferic (ordinador, mobil, etc.) vos mandem un còdi per validar la connexion." second_para: "Vaquí lo còdi per dintrar : " support: "S'avètz un problèma de connexion, dobtetz pas a contactar l'assisténcia : " signature: "La còla de wallabag" diff --git a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php index 2e9b93050..9722986eb 100644 --- a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php +++ b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php @@ -419,7 +419,7 @@ class EntryRestControllerTest extends WallabagApiTestCase public function testPostEntry() { $this->client->request('POST', '/api/entries.json', [ - 'url' => 'http://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html', + 'url' => 'https://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html', 'tags' => 'google', 'title' => 'New title for my article', 'content' => 'my content', @@ -434,7 +434,7 @@ class EntryRestControllerTest extends WallabagApiTestCase $content = json_decode($this->client->getResponse()->getContent(), true); $this->assertGreaterThan(0, $content['id']); - $this->assertSame('http://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html', $content['url']); + $this->assertSame('https://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html', $content['url']); $this->assertSame(0, $content['is_archived']); $this->assertSame(0, $content['is_starred']); $this->assertNull($content['starred_at']); @@ -455,7 +455,7 @@ class EntryRestControllerTest extends WallabagApiTestCase { $em = $this->client->getContainer()->get('doctrine.orm.entity_manager'); $entry = new Entry($em->getReference(User::class, 1)); - $entry->setUrl('http://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html'); + $entry->setUrl('https://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html'); $entry->setArchived(true); $entry->addTag((new Tag())->setLabel('google')); $entry->addTag((new Tag())->setLabel('apple')); @@ -464,7 +464,7 @@ class EntryRestControllerTest extends WallabagApiTestCase $em->clear(); $this->client->request('POST', '/api/entries.json', [ - 'url' => 'http://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html', + 'url' => 'https://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html', 'archive' => '1', 'tags' => 'google, apple', ]); @@ -474,7 +474,7 @@ class EntryRestControllerTest extends WallabagApiTestCase $content = json_decode($this->client->getResponse()->getContent(), true); $this->assertGreaterThan(0, $content['id']); - $this->assertSame('http://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html', $content['url']); + $this->assertSame('https://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html', $content['url']); $this->assertSame(1, $content['is_archived']); $this->assertSame(0, $content['is_starred']); $this->assertCount(3, $content['tags']); @@ -519,7 +519,7 @@ class EntryRestControllerTest extends WallabagApiTestCase { $now = new \DateTime(); $this->client->request('POST', '/api/entries.json', [ - 'url' => 'http://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html', + 'url' => 'https://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html', 'archive' => '1', 'starred' => '1', ]); @@ -529,7 +529,7 @@ class EntryRestControllerTest extends WallabagApiTestCase $content = json_decode($this->client->getResponse()->getContent(), true); $this->assertGreaterThan(0, $content['id']); - $this->assertSame('http://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html', $content['url']); + $this->assertSame('https://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html', $content['url']); $this->assertSame(1, $content['is_archived']); $this->assertSame(1, $content['is_starred']); $this->assertGreaterThanOrEqual($now->getTimestamp(), (new \DateTime($content['starred_at']))->getTimestamp()); @@ -539,7 +539,7 @@ class EntryRestControllerTest extends WallabagApiTestCase public function testPostArchivedAndStarredEntryWithoutQuotes() { $this->client->request('POST', '/api/entries.json', [ - 'url' => 'http://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html', + 'url' => 'https://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html', 'archive' => 0, 'starred' => 1, ]); @@ -549,7 +549,7 @@ class EntryRestControllerTest extends WallabagApiTestCase $content = json_decode($this->client->getResponse()->getContent(), true); $this->assertGreaterThan(0, $content['id']); - $this->assertSame('http://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html', $content['url']); + $this->assertSame('https://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html', $content['url']); $this->assertSame(0, $content['is_archived']); $this->assertSame(1, $content['is_starred']); } @@ -557,7 +557,7 @@ class EntryRestControllerTest extends WallabagApiTestCase public function testPostEntryWithOriginUrl() { $this->client->request('POST', '/api/entries.json', [ - 'url' => 'http://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html', + 'url' => 'https://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html', 'tags' => 'google', 'title' => 'New title for my article', 'content' => 'my content', @@ -573,7 +573,7 @@ class EntryRestControllerTest extends WallabagApiTestCase $content = json_decode($this->client->getResponse()->getContent(), true); $this->assertGreaterThan(0, $content['id']); - $this->assertSame('http://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html', $content['url']); + $this->assertSame('https://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html', $content['url']); $this->assertSame('http://mysource.tld', $content['origin_url']); } @@ -1013,7 +1013,7 @@ class EntryRestControllerTest extends WallabagApiTestCase public function testReloadEntry() { $this->client->request('POST', '/api/entries.json', [ - 'url' => 'http://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html', + 'url' => 'https://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html', 'archive' => '1', 'tags' => 'google, apple', ]); @@ -1117,7 +1117,7 @@ class EntryRestControllerTest extends WallabagApiTestCase public function testPostEntriesListAction() { $list = [ - 'http://www.lemonde.fr/musiques/article/2017/04/23/loin-de-la-politique-le-printemps-de-bourges-retombe-en-enfance_5115862_1654986.html', + 'https://www.lemonde.fr/musiques/article/2017/04/23/loin-de-la-politique-le-printemps-de-bourges-retombe-en-enfance_5115862_1654986.html', 'http://0.0.0.0/entry2', ]; @@ -1128,7 +1128,7 @@ class EntryRestControllerTest extends WallabagApiTestCase $content = json_decode($this->client->getResponse()->getContent(), true); $this->assertInternalType('int', $content[0]['entry']); - $this->assertSame('http://www.lemonde.fr/musiques/article/2017/04/23/loin-de-la-politique-le-printemps-de-bourges-retombe-en-enfance_5115862_1654986.html', $content[0]['url']); + $this->assertSame('https://www.lemonde.fr/musiques/article/2017/04/23/loin-de-la-politique-le-printemps-de-bourges-retombe-en-enfance_5115862_1654986.html', $content[0]['url']); $this->assertInternalType('int', $content[1]['entry']); $this->assertSame('http://0.0.0.0/entry2', $content[1]['url']); @@ -1209,14 +1209,14 @@ class EntryRestControllerTest extends WallabagApiTestCase $entry = new Entry($em->getReference(User::class, 1)); $entry->setTitle('Antoine de Caunes : « Je veux avoir le droit de tâtonner »'); $entry->setContent('hihi'); - $entry->setUrl('http://www.lemonde.fr/m-perso/article/2017/06/25/antoine-de-caunes-je-veux-avoir-le-droit-de-tatonner_5150728_4497916.html'); + $entry->setUrl('https://www.lemonde.fr/m-perso/article/2017/06/25/antoine-de-caunes-je-veux-avoir-le-droit-de-tatonner_5150728_4497916.html'); $entry->setPublishedAt(new \DateTime('2017-06-26T07:46:02+0200')); $em->persist($entry); $em->flush(); $em->clear(); $this->client->request('POST', '/api/entries.json', [ - 'url' => 'http://www.lemonde.fr/m-perso/article/2017/06/25/antoine-de-caunes-je-veux-avoir-le-droit-de-tatonner_5150728_4497916.html', + 'url' => 'https://www.lemonde.fr/m-perso/article/2017/06/25/antoine-de-caunes-je-veux-avoir-le-droit-de-tatonner_5150728_4497916.html', ]); $this->assertSame(200, $this->client->getResponse()->getStatusCode()); @@ -1224,6 +1224,6 @@ class EntryRestControllerTest extends WallabagApiTestCase $content = json_decode($this->client->getResponse()->getContent(), true); $this->assertGreaterThan(0, $content['id']); - $this->assertSame('http://www.lemonde.fr/m-perso/article/2017/06/25/antoine-de-caunes-je-veux-avoir-le-droit-de-tatonner_5150728_4497916.html', $content['url']); + $this->assertSame('https://www.lemonde.fr/m-perso/article/2017/06/25/antoine-de-caunes-je-veux-avoir-le-droit-de-tatonner_5150728_4497916.html', $content['url']); } } diff --git a/tests/Wallabag/CoreBundle/Command/CleanDuplicatesCommandTest.php b/tests/Wallabag/CoreBundle/Command/CleanDuplicatesCommandTest.php index 38e8dd07f..5ca9785dc 100644 --- a/tests/Wallabag/CoreBundle/Command/CleanDuplicatesCommandTest.php +++ b/tests/Wallabag/CoreBundle/Command/CleanDuplicatesCommandTest.php @@ -60,7 +60,7 @@ class CleanDuplicatesCommandTest extends WallabagCoreTestCase public function testDuplicate() { - $url = 'http://www.lemonde.fr/sport/visuel/2017/05/05/rondelle-prison-blanchissage-comprendre-le-hockey-sur-glace_5122587_3242.html'; + $url = 'https://www.lemonde.fr/sport/visuel/2017/05/05/rondelle-prison-blanchissage-comprendre-le-hockey-sur-glace_5122587_3242.html'; $client = $this->getClient(); $em = $client->getContainer()->get('doctrine.orm.entity_manager'); diff --git a/tests/Wallabag/CoreBundle/Command/ReloadEntryCommandTest.php b/tests/Wallabag/CoreBundle/Command/ReloadEntryCommandTest.php index 63c068b43..b13f6519a 100644 --- a/tests/Wallabag/CoreBundle/Command/ReloadEntryCommandTest.php +++ b/tests/Wallabag/CoreBundle/Command/ReloadEntryCommandTest.php @@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Entity\Entry; class ReloadEntryCommandTest extends WallabagCoreTestCase { - public $url = 'http://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html'; + public $url = 'https://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html'; /** * @var entry diff --git a/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php b/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php index e4bf09988..e07c57dd3 100644 --- a/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php @@ -742,7 +742,7 @@ class ConfigControllerTest extends WallabagCoreTestCase $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->setUrl('https://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); @@ -827,7 +827,7 @@ class ConfigControllerTest extends WallabagCoreTestCase $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->setUrl('https://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); @@ -845,7 +845,7 @@ class ConfigControllerTest extends WallabagCoreTestCase $em->persist($tagArchived); $entryArchived = new Entry($user); - $entryArchived->setUrl('http://www.lemonde.fr/europe/article/2016/10/01/pour-le-psoe-chaque-election-s-est-transformee-en-une-agonie_5006476_3214.html'); + $entryArchived->setUrl('https://www.lemonde.fr/europe/article/2016/10/01/pour-le-psoe-chaque-election-s-est-transformee-en-une-agonie_5006476_3214.html'); $entryArchived->setContent('Youhou'); $entryArchived->setTitle('Youhou'); $entryArchived->addTag($tagArchived); @@ -903,7 +903,7 @@ class ConfigControllerTest extends WallabagCoreTestCase $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->setUrl('https://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); diff --git a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php index 95482fe4b..a436be796 100644 --- a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php @@ -11,9 +11,9 @@ use Wallabag\CoreBundle\Helper\ContentProxy; class EntryControllerTest extends WallabagCoreTestCase { - const AN_URL_CONTAINING_AN_ARTICLE_WITH_IMAGE = 'http://www.lemonde.fr/judo/article/2017/11/11/judo-la-decima-de-teddy-riner_5213605_1556020.html'; + const AN_URL_CONTAINING_AN_ARTICLE_WITH_IMAGE = 'https://www.lemonde.fr/judo/article/2017/11/11/judo-la-decima-de-teddy-riner_5213605_1556020.html'; public $downloadImagesEnabled = false; - public $url = 'http://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html'; + public $url = 'https://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html'; /** * @after @@ -1143,7 +1143,7 @@ class EntryControllerTest extends WallabagCoreTestCase $client = $this->getClient(); $entry = new Entry($this->getLoggedInUser()); - $entry->setUrl('http://www.lemonde.fr/incorrect-url/'); + $entry->setUrl('https://www.lemonde.fr/incorrect-url/'); $entry->setHttpStatus(404); $this->getEntityManager()->persist($entry); @@ -1342,8 +1342,8 @@ class EntryControllerTest extends WallabagCoreTestCase null, ], 'es-ES' => [ - 'https://www.muylinux.com/2015/04/17/odf-reino-unido-microsoft-google/', - 'es_ES', + 'https://www.20minutos.es/noticia/3360685/0/gobierno-sanchez-primero-historia-mas-mujeres-que-hombres/', + 'es', ], ]; } diff --git a/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php b/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php index 398592e1f..51df8de1b 100644 --- a/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php +++ b/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php @@ -11,7 +11,6 @@ use Symfony\Component\Validator\ConstraintViolation; use Symfony\Component\Validator\ConstraintViolationList; use Symfony\Component\Validator\Validator\RecursiveValidator; use Wallabag\CoreBundle\Entity\Entry; -use Wallabag\CoreBundle\Entity\Tag; use Wallabag\CoreBundle\Helper\ContentProxy; use Wallabag\CoreBundle\Helper\RuleBasedTagger; use Wallabag\UserBundle\Entity\User; diff --git a/tests/Wallabag/CoreBundle/Helper/DownloadImagesTest.php b/tests/Wallabag/CoreBundle/Helper/DownloadImagesTest.php index 0e1d296b0..51ab1bcdd 100644 --- a/tests/Wallabag/CoreBundle/Helper/DownloadImagesTest.php +++ b/tests/Wallabag/CoreBundle/Helper/DownloadImagesTest.php @@ -183,4 +183,25 @@ class DownloadImagesTest extends TestCase $this->assertContains('http://wallabag.io/assets/images/9/b/9b0ead26/', $res, 'Content-Type was empty but data is ok for an image'); $this->assertContains('DownloadImages: Checking extension (alternative)', $logHandler->getRecords()[3]['message']); } + + public function testProcessImageWithSrcset() + { + $client = new Client(); + + $mock = new Mock([ + new Response(200, ['content-type' => 'image/jpeg'], Stream::factory(file_get_contents(__DIR__ . '/../fixtures/image-no-content-type.jpg'))), + new Response(200, ['content-type' => 'image/jpeg'], Stream::factory(file_get_contents(__DIR__ . '/../fixtures/image-no-content-type.jpg'))), + new Response(200, ['content-type' => 'image/jpeg'], Stream::factory(file_get_contents(__DIR__ . '/../fixtures/image-no-content-type.jpg'))), + ]); + + $client->getEmitter()->attach($mock); + + $logHandler = new TestHandler(); + $logger = new Logger('test', [$logHandler]); + + $download = new DownloadImages($client, sys_get_temp_dir() . '/wallabag_test', 'http://wallabag.io/', $logger); + $res = $download->processHtml(123, '

    ', 'http://piketty.blog.lemonde.fr/2017/10/12/budget-2018-la-jeunesse-sacrifiee/'); + + $this->assertNotContains('http://piketty.blog.lemonde.fr/', $res, 'Image srcset attribute were not replaced'); + } } diff --git a/tests/Wallabag/ImportBundle/Controller/InstapaperControllerTest.php b/tests/Wallabag/ImportBundle/Controller/InstapaperControllerTest.php index 9b887cbb6..dacdf4883 100644 --- a/tests/Wallabag/ImportBundle/Controller/InstapaperControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/InstapaperControllerTest.php @@ -129,7 +129,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase ->get('doctrine.orm.entity_manager') ->getRepository('WallabagCoreBundle:Entry') ->findByUrlAndUserId( - 'https://www.20minutes.fr/high-tech/2077615-20170531-dis-donc-donald-trump-quoi-exactement-covfefe', + 'https://www.20minutes.fr/high-tech/2077615-20170531-quoi-exactement-tweet-covfefe-donald-trump-persiste-signe', $this->getLoggedInUserId() ); diff --git a/tests/Wallabag/ImportBundle/fixtures/instapaper-export.csv b/tests/Wallabag/ImportBundle/fixtures/instapaper-export.csv index 06d018e0c..7b692d00d 100644 --- a/tests/Wallabag/ImportBundle/fixtures/instapaper-export.csv +++ b/tests/Wallabag/ImportBundle/fixtures/instapaper-export.csv @@ -2,4 +2,4 @@ URL,Title,Selection,Folder http://www.liberation.fr/societe/2012/12/06/baumettes-un-tour-en-cellule_865551,Baumettes : un tour en cellule,,Unread https://redditblog.com/2016/09/20/amp-and-reactredux/,AMP and React+Redux: Why Not?,,Archive https://medium.com/@the_minh/why-foursquare-swarm-is-still-my-favourite-social-network-e38228493e6c,Why Foursquare / Swarm is still my favourite social network,,Starred -https://www.20minutes.fr/high-tech/2077615-20170531-dis-donc-donald-trump-quoi-exactement-covfefe,"Dis donc Donald Trump, c'est quoi exactement «covfefe»?",,test_tag +https://www.20minutes.fr/high-tech/2077615-20170531-quoi-exactement-tweet-covfefe-donald-trump-persiste-signe,"Dis donc Donald Trump, c'est quoi exactement «covfefe»?",,test_tag diff --git a/web/wallassets/baggy.js b/web/wallassets/baggy.js index 405e25a04..655a80e36 100644 --- a/web/wallassets/baggy.js +++ b/web/wallassets/baggy.js @@ -1 +1 @@ -!function(e){function __webpack_require__(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,__webpack_require__),r.l=!0,r.exports}var t={};__webpack_require__.m=e,__webpack_require__.c=t,__webpack_require__.i=function(e){return e},__webpack_require__.d=function(e,t,n){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=53)}([function(e,t,n){var r,o;!function(t,n){"object"==typeof e&&"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}:n(t)}("undefined"!=typeof window?window:this,function(n,i){function isArrayLike(e){var t=!!e&&"length"in e&&e.length,n=m.type(e);return"function"!==n&&!m.isWindow(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}function winnow(e,t,n){if(m.isFunction(t))return m.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return m.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(k.test(t))return m.filter(t,e,n);t=m.filter(t,e)}return m.grep(e,function(e){return f.call(t,e)>-1!==n})}function sibling(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function createOptions(e){var t={};return m.each(e.match(P)||[],function(e,n){t[n]=!0}),t}function completed(){s.removeEventListener("DOMContentLoaded",completed),n.removeEventListener("load",completed),m.ready()}function Data(){this.expando=m.expando+Data.uid++}function dataAttr(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(H,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:F.test(n)?m.parseJSON(n):n)}catch(e){}j.set(e,t,n)}else n=void 0;return n}function adjustCSS(e,t,n,r){var o,i=1,a=20,s=r?function(){return r.cur()}:function(){return m.css(e,t,"")},u=s(),l=n&&n[3]||(m.cssNumber[t]?"":"px"),c=(m.cssNumber[t]||"px"!==l&&+u)&&B.exec(m.css(e,t));if(c&&c[3]!==l){l=l||c[3],n=n||[],c=+u||1;do{i=i||".5",c/=i,m.style(e,t,c+l)}while(i!==(i=s()/u)&&1!==i&&--a)}return n&&(c=+c||+u||0,o=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=o)),o}function getAll(e,t){var n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&m.nodeName(e,t)?m.merge([e],n):n}function setGlobalEval(e,t){for(var n=0,r=e.length;n-1)o&&o.push(i);else if(l=m.contains(i.ownerDocument,i),a=getAll(f.appendChild(i),"script"),l&&setGlobalEval(a),n)for(c=0;i=a[c++];)$.test(i.type||"")&&n.push(i);return f}function returnTrue(){return!0}function returnFalse(){return!1}function safeActiveElement(){try{return s.activeElement}catch(e){}}function on(e,t,n,r,o,i){var a,s;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(s in t)on(e,s,n,r,t[s],i);return e}if(null==r&&null==o?(o=n,r=n=void 0):null==o&&("string"==typeof n?(o=r,r=void 0):(o=r,r=n,n=void 0)),!1===o)o=returnFalse;else if(!o)return e;return 1===i&&(a=o,o=function(e){return m().off(e),a.apply(this,arguments)},o.guid=a.guid||(a.guid=m.guid++)),e.each(function(){m.event.add(this,t,o,r,n)})}function manipulationTarget(e,t){return m.nodeName(e,"table")&&m.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function disableScript(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function restoreScript(e){var t=ee.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function cloneCopyEvent(e,t){var n,r,o,i,a,s,u,l;if(1===t.nodeType){if(R.hasData(e)&&(i=R.access(e),a=R.set(t,i),l=i.events)){delete a.handle,a.events={};for(o in l)for(n=0,r=l[o].length;n1&&"string"==typeof p&&!g.checkClone&&Z.test(p))return e.each(function(o){var i=e.eq(o);v&&(t[0]=p.call(this,o,i.html())),domManip(i,t,n,r)});if(d&&(o=buildFragment(t,e[0].ownerDocument,!1,e,r),i=o.firstChild,1===o.childNodes.length&&(o=i),i||r)){for(a=m.map(getAll(o,"script"),disableScript),s=a.length;f")).appendTo(t.documentElement),t=ne[0].contentDocument,t.write(),t.close(),n=actualDisplay(e,t),ne.detach()),re[e]=n),n}function curCSS(e,t,n){var r,o,i,a,s=e.style;return n=n||ae(e),a=n?n.getPropertyValue(t)||n[t]:void 0,""!==a&&void 0!==a||m.contains(e.ownerDocument,e)||(a=m.style(e,t)),n&&!g.pixelMarginRight()&&ie.test(a)&&oe.test(t)&&(r=s.width,o=s.minWidth,i=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=o,s.maxWidth=i),void 0!==a?a+"":a}function addGetHookIf(e,t){return{get:function(){return e()?void delete this.get:(this.get=t).apply(this,arguments)}}}function vendorPropName(e){if(e in he)return e;for(var t=e[0].toUpperCase()+e.slice(1),n=de.length;n--;)if((e=de[n]+t)in he)return e}function setPositiveNumber(e,t,n){var r=B.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function augmentWidthOrHeight(e,t,n,r,o){for(var i=n===(r?"border":"content")?4:"width"===t?1:0,a=0;i<4;i+=2)"margin"===n&&(a+=m.css(e,n+z[i],!0,o)),r?("content"===n&&(a-=m.css(e,"padding"+z[i],!0,o)),"margin"!==n&&(a-=m.css(e,"border"+z[i]+"Width",!0,o))):(a+=m.css(e,"padding"+z[i],!0,o),"padding"!==n&&(a+=m.css(e,"border"+z[i]+"Width",!0,o)));return a}function getWidthOrHeight(e,t,n){var r=!0,o="width"===t?e.offsetWidth:e.offsetHeight,i=ae(e),a="border-box"===m.css(e,"boxSizing",!1,i);if(o<=0||null==o){if(o=curCSS(e,t,i),(o<0||null==o)&&(o=e.style[t]),ie.test(o))return o;r=a&&(g.boxSizingReliable()||o===e.style[t]),o=parseFloat(o)||0}return o+augmentWidthOrHeight(e,t,n||(a?"border":"content"),r,i)+"px"}function showHide(e,t){for(var n,r,o,i=[],a=0,s=e.length;a=0&&n=0},isPlainObject:function(e){var t;if("object"!==m.type(e)||e.nodeType||m.isWindow(e))return!1;if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype||{},"isPrototypeOf"))return!1;for(t in e);return void 0===t||p.call(e,t)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?d[h.call(e)]||"object":typeof e},globalEval:function(e){var t,n=eval;(e=m.trim(e))&&(1===e.indexOf("use strict")?(t=s.createElement("script"),t.text=e,s.head.appendChild(t).parentNode.removeChild(t)):n(e))},camelCase:function(e){return e.replace(y,"ms-").replace(w,b)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t){var n,r=0;if(isArrayLike(e))for(n=e.length;rr.cacheLength&&delete cache[e.shift()],cache[t+" "]=n}var e=[];return cache}function markFunction(e){return e[b]=!0,e}function assert(e){var t=h.createElement("div");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function addHandle(e,t){for(var n=e.split("|"),o=n.length;o--;)r.attrHandle[n[o]]=t}function siblingCheck(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||A)-(~e.sourceIndex||A);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function createPositionalPseudo(e){return markFunction(function(t){return t=+t,markFunction(function(n,r){for(var o,i=e([],n.length,t),a=i.length;a--;)n[o=i[a]]&&(n[o]=!(r[o]=n[o]))})})}function testContext(e){return e&&void 0!==e.getElementsByTagName&&e}function setFilters(){}function toSelector(e){for(var t=0,n=e.length,r="";t1?function(t,n,r){for(var o=e.length;o--;)if(!e[o](t,n,r))return!1;return!0}:e[0]}function multipleContexts(e,t,n){for(var r=0,o=t.length;r-1&&(i[l]=!(a[l]=f))}}else v=condense(v===a?v.splice(p,v.length):v),o?o(null,a,v,u):L.apply(a,v)})}function matcherFromTokens(e){for(var t,n,o,i=e.length,a=r.relative[e[0].type],s=a||r.relative[" "],u=a?1:0,c=addCombinator(function(e){return e===t},s,!0),f=addCombinator(function(e){return R(t,e)>-1},s,!0),d=[function(e,n,r){var o=!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):f(e,n,r));return t=null,o}];u1&&elementMatcher(d),u>1&&toSelector(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(I,"$1"),n,u0,o=e.length>0,i=function(i,a,s,u,c){var f,p,m,v=0,y="0",w=i&&[],b=[],x=l,C=i||o&&r.find.TAG("*",c),_=T+=null==x?1:Math.random()||.1,E=C.length;for(c&&(l=a===h||a||c);y!==E&&null!=(f=C[y]);y++){if(o&&f){for(p=0,a||f.ownerDocument===h||(d(f),s=!g);m=e[p++];)if(m(f,a||h,s)){u.push(f);break}c&&(T=_)}n&&((f=!m&&f)&&v--,i&&w.push(f))}if(v+=y,n&&y!==v){for(p=0;m=t[p++];)m(w,b,a,s);if(i){if(v>0)for(;y--;)w[y]||b[y]||(b[y]=P.call(u));b=condense(b)}L.apply(u,b),c&&!i&&b.length>0&&v+t.length>1&&Sizzle.uniqueSort(u)}return c&&(T=_,l=x),w};return n?markFunction(i):i}var t,n,r,o,i,a,s,u,l,c,f,d,h,p,g,m,v,y,w,b="sizzle"+1*new Date,x=e.document,T=0,C=0,_=createCache(),E=createCache(),k=createCache(),S=function(e,t){return e===t&&(f=!0),0},A=1<<31,N={}.hasOwnProperty,D=[],P=D.pop,O=D.push,L=D.push,M=D.slice,R=function(e,t){for(var n=0,r=e.length;n+~]|"+F+")"+F+"*"),$=new RegExp("="+F+"*([^\\]'\"]*?)"+F+"*\\]","g"),X=new RegExp(B),V=new RegExp("^"+H+"$"),Y={ID:new RegExp("^#("+H+")"),CLASS:new RegExp("^\\.("+H+")"),TAG:new RegExp("^("+H+"|[*])"),ATTR:new RegExp("^"+q),PSEUDO:new RegExp("^"+B),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+F+"*(even|odd|(([+-]|)(\\d*)n|)"+F+"*(?:([+-]|)"+F+"*(\\d+)|))"+F+"*\\)|)","i"),bool:new RegExp("^(?:"+j+")$","i"),needsContext:new RegExp("^"+F+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+F+"*((?:-\\d)?\\d*)"+F+"*\\)|)(?=[^-]|$)","i")},K=/^(?:input|select|textarea|button)$/i,G=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Z=/[+~]/,ee=/'|\\/g,te=new RegExp("\\\\([\\da-f]{1,6}"+F+"?|("+F+")|.)","ig"),ne=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},re=function(){d()};try{L.apply(D=M.call(x.childNodes),x.childNodes),D[x.childNodes.length].nodeType}catch(e){L={apply:D.length?function(e,t){O.apply(e,M.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}n=Sizzle.support={},i=Sizzle.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},d=Sizzle.setDocument=function(e){var t,o,a=e?e.ownerDocument||e:x;return a!==h&&9===a.nodeType&&a.documentElement?(h=a,p=h.documentElement,g=!i(h),(o=h.defaultView)&&o.top!==o&&(o.addEventListener?o.addEventListener("unload",re,!1):o.attachEvent&&o.attachEvent("onunload",re)),n.attributes=assert(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=assert(function(e){return e.appendChild(h.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=Q.test(h.getElementsByClassName),n.getById=assert(function(e){return p.appendChild(e).id=b,!h.getElementsByName||!h.getElementsByName(b).length}),n.getById?(r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n=t.getElementById(e);return n?[n]:[]}},r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}}):(delete r.find.ID,r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],o=0,i=t.getElementsByTagName(e);if("*"===e){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&g)return t.getElementsByClassName(e)},v=[],m=[],(n.qsa=Q.test(h.querySelectorAll))&&(assert(function(e){p.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&m.push("[*^$]="+F+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||m.push("\\["+F+"*(?:value|"+j+")"),e.querySelectorAll("[id~="+b+"-]").length||m.push("~="),e.querySelectorAll(":checked").length||m.push(":checked"),e.querySelectorAll("a#"+b+"+*").length||m.push(".#.+[+~]")}),assert(function(e){var t=h.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&m.push("name"+F+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||m.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),m.push(",.*:")})),(n.matchesSelector=Q.test(y=p.matches||p.webkitMatchesSelector||p.mozMatchesSelector||p.oMatchesSelector||p.msMatchesSelector))&&assert(function(e){n.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),v.push("!=",B)}),m=m.length&&new RegExp(m.join("|")),v=v.length&&new RegExp(v.join("|")),t=Q.test(p.compareDocumentPosition),w=t||Q.test(p.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},S=t?function(e,t){if(e===t)return f=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&r||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===h||e.ownerDocument===x&&w(x,e)?-1:t===h||t.ownerDocument===x&&w(x,t)?1:c?R(c,e)-R(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,r=0,o=e.parentNode,i=t.parentNode,a=[e],s=[t];if(!o||!i)return e===h?-1:t===h?1:o?-1:i?1:c?R(c,e)-R(c,t):0;if(o===i)return siblingCheck(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?siblingCheck(a[r],s[r]):a[r]===x?-1:s[r]===x?1:0},h):h},Sizzle.matches=function(e,t){return Sizzle(e,null,null,t)},Sizzle.matchesSelector=function(e,t){if((e.ownerDocument||e)!==h&&d(e),t=t.replace($,"='$1']"),n.matchesSelector&&g&&!k[t+" "]&&(!v||!v.test(t))&&(!m||!m.test(t)))try{var r=y.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return Sizzle(t,h,null,[e]).length>0},Sizzle.contains=function(e,t){return(e.ownerDocument||e)!==h&&d(e),w(e,t)},Sizzle.attr=function(e,t){(e.ownerDocument||e)!==h&&d(e);var o=r.attrHandle[t.toLowerCase()],i=o&&N.call(r.attrHandle,t.toLowerCase())?o(e,t,!g):void 0;return void 0!==i?i:n.attributes||!g?e.getAttribute(t):(i=e.getAttributeNode(t))&&i.specified?i.value:null},Sizzle.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},Sizzle.uniqueSort=function(e){var t,r=[],o=0,i=0;if(f=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(S),f){for(;t=e[i++];)t===e[i]&&(o=r.push(i));for(;o--;)e.splice(r[o],1)}return c=null,e},o=Sizzle.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=o(t);return n},r=Sizzle.selectors={cacheLength:50,createPseudo:markFunction,match:Y,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||Sizzle.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&Sizzle.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return Y.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=_[e+" "];return t||(t=new RegExp("(^|"+F+")"+e+"("+F+"|$)"))&&_(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var o=Sizzle.attr(r,e);return null==o?"!="===t:!t||(o+="","="===t?o===n:"!="===t?o!==n:"^="===t?n&&0===o.indexOf(n):"*="===t?n&&o.indexOf(n)>-1:"$="===t?n&&o.slice(-n.length)===n:"~="===t?(" "+o.replace(z," ")+" ").indexOf(n)>-1:"|="===t&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,o){var i="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===o?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,d,h,p,g=i!==a?"nextSibling":"previousSibling",m=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!u&&!s,w=!1;if(m){if(i){for(;g;){for(d=t;d=d[g];)if(s?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;p=g="only"===e&&!p&&"nextSibling"}return!0}if(p=[a?m.firstChild:m.lastChild],a&&y){for(d=m,f=d[b]||(d[b]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}),l=c[e]||[],h=l[0]===T&&l[1],w=h&&l[2],d=h&&m.childNodes[h];d=++h&&d&&d[g]||(w=h=0)||p.pop();)if(1===d.nodeType&&++w&&d===t){c[e]=[T,h,w];break}}else if(y&&(d=t,f=d[b]||(d[b]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}),l=c[e]||[],h=l[0]===T&&l[1],w=h),!1===w)for(;(d=++h&&d&&d[g]||(w=h=0)||p.pop())&&((s?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++w||(y&&(f=d[b]||(d[b]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}),c[e]=[T,w]),d!==t)););return(w-=o)===r||w%r==0&&w/r>=0}}},PSEUDO:function(e,t){var n,o=r.pseudos[e]||r.setFilters[e.toLowerCase()]||Sizzle.error("unsupported pseudo: "+e);return o[b]?o(t):o.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?markFunction(function(e,n){for(var r,i=o(e,t),a=i.length;a--;)r=R(e,i[a]),e[r]=!(n[r]=i[a])}):function(e){return o(e,0,n)}):o}},pseudos:{not:markFunction(function(e){var t=[],n=[],r=s(e.replace(I,"$1"));return r[b]?markFunction(function(e,t,n,o){for(var i,a=r(e,null,o,[]),s=e.length;s--;)(i=a[s])&&(e[s]=!(t[s]=i))}):function(e,o,i){return t[0]=e,r(t,null,i,n),t[0]=null,!n.pop()}}),has:markFunction(function(e){return function(t){return Sizzle(e,t).length>0}}),contains:markFunction(function(e){return e=e.replace(te,ne),function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}}),lang:markFunction(function(e){return V.test(e||"")||Sizzle.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=g?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===p},focus:function(e){return e===h.activeElement&&(!h.hasFocus||h.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return G.test(e.nodeName)},input:function(e){return K.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:createPositionalPseudo(function(){return[0]}),last:createPositionalPseudo(function(e,t){return[t-1]}),eq:createPositionalPseudo(function(e,t,n){return[n<0?n+t:n]}),even:createPositionalPseudo(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:createPositionalPseudo(function(e,t,n){for(var r=n<0?n+t:n;++r2&&"ID"===(c=l[0]).type&&n.getById&&9===t.nodeType&&g&&r.relative[l[1].type]){if(!(t=(r.find.ID(c.matches[0].replace(te,ne),t)||[])[0]))return o;h&&(t=t.parentNode),e=e.slice(l.shift().value.length)}for(u=Y.needsContext.test(e)?0:l.length;u--&&(c=l[u],!r.relative[f=c.type]);)if((d=r.find[f])&&(i=d(c.matches[0].replace(te,ne),Z.test(l[0].type)&&testContext(t.parentNode)||t))){if(l.splice(u,1),!(e=i.length&&toSelector(l)))return L.apply(o,i),o;break}}return(h||s(e,p))(i,t,!g,o,!t||Z.test(e)&&testContext(t.parentNode)||t),o},n.sortStable=b.split("").sort(S).join("")===b,n.detectDuplicates=!!f,d(),n.sortDetached=assert(function(e){return 1&e.compareDocumentPosition(h.createElement("div"))}),assert(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||addHandle("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&assert(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||addHandle("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),assert(function(e){return null==e.getAttribute("disabled")})||addHandle(j,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),Sizzle}(n);m.find=x,m.expr=x.selectors,m.expr[":"]=m.expr.pseudos,m.uniqueSort=m.unique=x.uniqueSort,m.text=x.getText,m.isXMLDoc=x.isXML,m.contains=x.contains;var T=function(e,t,n){for(var r=[],o=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(o&&m(e).is(n))break;r.push(e)}return r},C=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},_=m.expr.match.needsContext,E=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,k=/^.[^:#\[\.,]*$/;m.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?m.find.matchesSelector(r,e)?[r]:[]:m.find.matches(e,m.grep(t,function(e){return 1===e.nodeType}))},m.fn.extend({find:function(e){var t,n=this.length,r=[],o=this;if("string"!=typeof e)return this.pushStack(m(e).filter(function(){for(t=0;t1?m.unique(r):r),r.selector=this.selector?this.selector+" "+e:e,r},filter:function(e){return this.pushStack(winnow(this,e||[],!1))},not:function(e){return this.pushStack(winnow(this,e||[],!0))},is:function(e){return!!winnow(this,"string"==typeof e&&_.test(e)?m(e):e||[],!1).length}});var S,A=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/;(m.fn.init=function(e,t,n){var r,o;if(!e)return this;if(n=n||S,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:A.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof m?t[0]:t,m.merge(this,m.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:s,!0)),E.test(r[1])&&m.isPlainObject(t))for(r in t)m.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return o=s.getElementById(r[2]),o&&o.parentNode&&(this.length=1,this[0]=o),this.context=s,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):m.isFunction(e)?void 0!==n.ready?n.ready(e):e(m):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),m.makeArray(e,this))}).prototype=m.fn,S=m(s);var N=/^(?:parents|prev(?:Until|All))/,D={children:!0,contents:!0,next:!0,prev:!0};m.fn.extend({has:function(e){var t=m(e,this),n=t.length;return this.filter(function(){for(var e=0;e-1:1===n.nodeType&&m.find.matchesSelector(n,e))){i.push(n);break}return this.pushStack(i.length>1?m.uniqueSort(i):i)},index:function(e){return e?"string"==typeof e?f.call(m(e),this[0]):f.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(m.uniqueSort(m.merge(this.get(),m(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),m.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return T(e,"parentNode")},parentsUntil:function(e,t,n){return T(e,"parentNode",n)},next:function(e){return sibling(e,"nextSibling")},prev:function(e){return sibling(e,"previousSibling")},nextAll:function(e){return T(e,"nextSibling")},prevAll:function(e){return T(e,"previousSibling")},nextUntil:function(e,t,n){return T(e,"nextSibling",n)},prevUntil:function(e,t,n){return T(e,"previousSibling",n)},siblings:function(e){return C((e.parentNode||{}).firstChild,e)},children:function(e){return C(e.firstChild)},contents:function(e){return e.contentDocument||m.merge([],e.childNodes)}},function(e,t){m.fn[e]=function(n,r){var o=m.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(o=m.filter(r,o)),this.length>1&&(D[e]||m.uniqueSort(o),N.test(e)&&o.reverse()),this.pushStack(o)}});var P=/\S+/g;m.Callbacks=function(e){e="string"==typeof e?createOptions(e):m.extend({},e);var t,n,r,o,i=[],a=[],s=-1,u=function(){for(o=e.once,r=t=!0;a.length;s=-1)for(n=a.shift();++s-1;)i.splice(n,1),n<=s&&s--}),this},has:function(e){return e?m.inArray(e,i)>-1:i.length>0},empty:function(){return i&&(i=[]),this},disable:function(){return o=a=[],i=n="",this},disabled:function(){return!i},lock:function(){return o=a=[],n||(i=n=""),this},locked:function(){return!!o},fireWith:function(e,n){return o||(n=n||[],n=[e,n.slice?n.slice():n],a.push(n),t||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l},m.extend({Deferred:function(e){var t=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return o.done(arguments).fail(arguments),this},then:function(){var e=arguments;return m.Deferred(function(n){m.each(t,function(t,i){var a=m.isFunction(e[t])&&e[t];o[i[1]](function(){var e=a&&a.apply(this,arguments);e&&m.isFunction(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[i[0]+"With"](this===r?n.promise():this,a?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?m.extend(e,r):r}},o={};return r.pipe=r.then,m.each(t,function(e,i){var a=i[2],s=i[3];r[i[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),o[i[0]]=function(){return o[i[0]+"With"](this===o?r:this,arguments),this},o[i[0]+"With"]=a.fireWith}),r.promise(o),e&&e.call(o,o),o},when:function(e){var t,n,r,o=0,i=u.call(arguments),a=i.length,s=1!==a||e&&m.isFunction(e.promise)?a:0,l=1===s?e:m.Deferred(),c=function(e,n,r){return function(o){n[e]=this,r[e]=arguments.length>1?u.call(arguments):o,r===t?l.notifyWith(n,r):--s||l.resolveWith(n,r)}};if(a>1)for(t=new Array(a),n=new Array(a),r=new Array(a);o0||(O.resolveWith(s,[m]),m.fn.triggerHandler&&(m(s).triggerHandler("ready"),m(s).off("ready"))))}}),m.ready.promise=function(e){return O||(O=m.Deferred(),"complete"===s.readyState||"loading"!==s.readyState&&!s.documentElement.doScroll?n.setTimeout(m.ready):(s.addEventListener("DOMContentLoaded",completed),n.addEventListener("load",completed))),O.promise(e)},m.ready.promise();var L=function(e,t,n,r,o,i,a){var s=0,u=e.length,l=null==n;if("object"===m.type(n)){o=!0;for(s in n)L(e,t,s,n[s],!0,i,a)}else if(void 0!==r&&(o=!0,m.isFunction(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(m(e),n)})),t))for(;s-1&&void 0!==n&&j.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){j.remove(this,e)})}}),m.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=R.get(e,t),n&&(!r||m.isArray(n)?r=R.access(e,t,m.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=m.queue(e,t),r=n.length,o=n.shift(),i=m._queueHooks(e,t),a=function(){m.dequeue(e,t)};"inprogress"===o&&(o=n.shift(),r--),o&&("fx"===t&&n.unshift("inprogress"),delete i.stop,o.call(e,a,i)),!r&&i&&i.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return R.get(e,n)||R.access(e,n,{empty:m.Callbacks("once memory").add(function(){R.remove(e,[t+"queue",n])})})}}),m.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length",""],thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};X.optgroup=X.option,X.tbody=X.tfoot=X.colgroup=X.caption=X.thead,X.th=X.td;var V=/<|&#?\w+;/;!function(){var e=s.createDocumentFragment(),t=e.appendChild(s.createElement("div")),n=s.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),t.appendChild(n),g.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="",g.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue}();var Y=/^key/,K=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,G=/^([^.]*)(?:\.(.+)|)/;m.event={global:{},add:function(e,t,n,r,o){var i,a,s,u,l,c,f,d,h,p,g,v=R.get(e);if(v)for(n.handler&&(i=n,n=i.handler,o=i.selector),n.guid||(n.guid=m.guid++),(u=v.events)||(u=v.events={}),(a=v.handle)||(a=v.handle=function(t){return void 0!==m&&m.event.triggered!==t.type?m.event.dispatch.apply(e,arguments):void 0}),t=(t||"").match(P)||[""],l=t.length;l--;)s=G.exec(t[l])||[],h=g=s[1],p=(s[2]||"").split(".").sort(),h&&(f=m.event.special[h]||{},h=(o?f.delegateType:f.bindType)||h,f=m.event.special[h]||{},c=m.extend({type:h,origType:g,data:r,handler:n,guid:n.guid,selector:o,needsContext:o&&m.expr.match.needsContext.test(o),namespace:p.join(".")},i),(d=u[h])||(d=u[h]=[],d.delegateCount=0,f.setup&&!1!==f.setup.call(e,r,p,a)||e.addEventListener&&e.addEventListener(h,a)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),o?d.splice(d.delegateCount++,0,c):d.push(c),m.event.global[h]=!0)},remove:function(e,t,n,r,o){var i,a,s,u,l,c,f,d,h,p,g,v=R.hasData(e)&&R.get(e);if(v&&(u=v.events)){for(t=(t||"").match(P)||[""],l=t.length;l--;)if(s=G.exec(t[l])||[],h=g=s[1],p=(s[2]||"").split(".").sort(),h){for(f=m.event.special[h]||{},h=(r?f.delegateType:f.bindType)||h,d=u[h]||[],s=s[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=i=d.length;i--;)c=d[i],!o&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(d.splice(i,1),c.selector&&d.delegateCount--,f.remove&&f.remove.call(e,c));a&&!d.length&&(f.teardown&&!1!==f.teardown.call(e,p,v.handle)||m.removeEvent(e,h,v.handle),delete u[h])}else for(h in u)m.event.remove(e,h+t[l],n,r,!0);m.isEmptyObject(u)&&R.remove(e,"handle events")}},dispatch:function(e){e=m.event.fix(e);var t,n,r,o,i,a=[],s=u.call(arguments),l=(R.get(this,"events")||{})[e.type]||[],c=m.event.special[e.type]||{};if(s[0]=e,e.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,e)){for(a=m.event.handlers.call(this,e,l),t=0;(o=a[t++])&&!e.isPropagationStopped();)for(e.currentTarget=o.elem,n=0;(i=o.handlers[n++])&&!e.isImmediatePropagationStopped();)e.rnamespace&&!e.rnamespace.test(i.namespace)||(e.handleObj=i,e.data=i.data,void 0!==(r=((m.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,s))&&!1===(e.result=r)&&(e.preventDefault(),e.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,o,i,a=[],s=t.delegateCount,u=e.target;if(s&&u.nodeType&&("click"!==e.type||isNaN(e.button)||e.button<1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&(!0!==u.disabled||"click"!==e.type)){for(r=[],n=0;n-1:m.find(o,this,null,[u]).length),r[o]&&r.push(i);r.length&&a.push({elem:u,handlers:r})}return s]*)\/>/gi,J=/\s*$/g;m.extend({htmlPrefilter:function(e){return e.replace(Q,"<$1>")},clone:function(e,t,n){var r,o,i,a,s=e.cloneNode(!0),u=m.contains(e.ownerDocument,e);if(!(g.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||m.isXMLDoc(e)))for(a=getAll(s),i=getAll(e),r=0,o=i.length;r0&&setGlobalEval(a,!u&&getAll(e,"script")),s},cleanData:function(e){for(var t,n,r,o=m.event.special,i=0;void 0!==(n=e[i]);i++)if(M(n)){if(t=n[R.expando]){if(t.events)for(r in t.events)o[r]?m.event.remove(n,r):m.removeEvent(n,r,t.handle);n[R.expando]=void 0}n[j.expando]&&(n[j.expando]=void 0)}}}),m.fn.extend({domManip:domManip,detach:function(e){return remove(this,e,!0)},remove:function(e){return remove(this,e)},text:function(e){return L(this,function(e){return void 0===e?m.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return domManip(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){manipulationTarget(this,e).appendChild(e)}})},prepend:function(){return domManip(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=manipulationTarget(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return domManip(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return domManip(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(m.cleanData(getAll(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return m.clone(this,e,t)})},html:function(e){return L(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!J.test(e)&&!X[(U.exec(e)||["",""])[1].toLowerCase()]){e=m.htmlPrefilter(e);try{for(;n1)},show:function(){return showHide(this,!0)},hide:function(){return showHide(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){I(this)?m(this).show():m(this).hide()})}}),m.Tween=Tween,Tween.prototype={constructor:Tween,init:function(e,t,n,r,o,i){this.elem=e,this.prop=n,this.easing=o||m.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=i||(m.cssNumber[n]?"":"px")},cur:function(){var e=Tween.propHooks[this.prop];return e&&e.get?e.get(this):Tween.propHooks._default.get(this)},run:function(e){var t,n=Tween.propHooks[this.prop];return this.options.duration?this.pos=t=m.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Tween.propHooks._default.set(this),this}},Tween.prototype.init.prototype=Tween.prototype,Tween.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=m.css(e.elem,e.prop,""),t&&"auto"!==t?t:0)},set:function(e){m.fx.step[e.prop]?m.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[m.cssProps[e.prop]]&&!m.cssHooks[e.prop]?e.elem[e.prop]=e.now:m.style(e.elem,e.prop,e.now+e.unit)}}},Tween.propHooks.scrollTop=Tween.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},m.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},m.fx=Tween.prototype.init,m.fx.step={};var pe,ge,me=/^(?:toggle|show|hide)$/,ve=/queueHooks$/;m.Animation=m.extend(Animation,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return adjustCSS(n.elem,e,B.exec(t),n),n}]},tweener:function(e,t){m.isFunction(e)?(t=e,e=["*"]):e=e.match(P);for(var n,r=0,o=e.length;r1)},removeAttr:function(e){return this.each(function(){m.removeAttr(this,e)})}}),m.extend({attr:function(e,t,n){var r,o,i=e.nodeType;if(3!==i&&8!==i&&2!==i)return void 0===e.getAttribute?m.prop(e,t,n):(1===i&&m.isXMLDoc(e)||(t=t.toLowerCase(),o=m.attrHooks[t]||(m.expr.match.bool.test(t)?ye:void 0)),void 0!==n?null===n?void m.removeAttr(e,t):o&&"set"in o&&void 0!==(r=o.set(e,n,t))?r:(e.setAttribute(t,n+""),n):o&&"get"in o&&null!==(r=o.get(e,t))?r:(r=m.find.attr(e,t),null==r?void 0:r))},attrHooks:{type:{set:function(e,t){if(!g.radioValue&&"radio"===t&&m.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r,o=0,i=t&&t.match(P);if(i&&1===e.nodeType)for(;n=i[o++];)r=m.propFix[n]||n,m.expr.match.bool.test(n)&&(e[r]=!1),e.removeAttribute(n)}}),ye={set:function(e,t,n){return!1===t?m.removeAttr(e,n):e.setAttribute(n,n),n}},m.each(m.expr.match.bool.source.match(/\w+/g),function(e,t){var n=we[t]||m.find.attr;we[t]=function(e,t,r){var o,i;return r||(i=we[t],we[t]=o,o=null!=n(e,t,r)?t.toLowerCase():null,we[t]=i),o}});var be=/^(?:input|select|textarea|button)$/i,xe=/^(?:a|area)$/i;m.fn.extend({prop:function(e,t){return L(this,m.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[m.propFix[e]||e]})}}),m.extend({prop:function(e,t,n){var r,o,i=e.nodeType;if(3!==i&&8!==i&&2!==i)return 1===i&&m.isXMLDoc(e)||(t=m.propFix[t]||t,o=m.propHooks[t]),void 0!==n?o&&"set"in o&&void 0!==(r=o.set(e,n,t))?r:e[t]=n:o&&"get"in o&&null!==(r=o.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=m.find.attr(e,"tabindex");return t?parseInt(t,10):be.test(e.nodeName)||xe.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),g.optSelected||(m.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),m.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){m.propFix[this.toLowerCase()]=this});var Te=/[\t\r\n\f]/g;m.fn.extend({addClass:function(e){var t,n,r,o,i,a,s,u=0;if(m.isFunction(e))return this.each(function(t){m(this).addClass(e.call(this,t,getClass(this)))});if("string"==typeof e&&e)for(t=e.match(P)||[];n=this[u++];)if(o=getClass(n),r=1===n.nodeType&&(" "+o+" ").replace(Te," ")){for(a=0;i=t[a++];)r.indexOf(" "+i+" ")<0&&(r+=i+" ");s=m.trim(r),o!==s&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,o,i,a,s,u=0;if(m.isFunction(e))return this.each(function(t){m(this).removeClass(e.call(this,t,getClass(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(P)||[];n=this[u++];)if(o=getClass(n),r=1===n.nodeType&&(" "+o+" ").replace(Te," ")){for(a=0;i=t[a++];)for(;r.indexOf(" "+i+" ")>-1;)r=r.replace(" "+i+" "," ");s=m.trim(r),o!==s&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):m.isFunction(e)?this.each(function(n){m(this).toggleClass(e.call(this,n,getClass(this),t),t)}):this.each(function(){var t,r,o,i;if("string"===n)for(r=0,o=m(this),i=e.match(P)||[];t=i[r++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else void 0!==e&&"boolean"!==n||(t=getClass(this),t&&R.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":R.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+getClass(n)+" ").replace(Te," ").indexOf(t)>-1)return!0;return!1}});var Ce=/\r/g,_e=/[\x20\t\r\n\f]+/g;m.fn.extend({val:function(e){var t,n,r,o=this[0];{if(arguments.length)return r=m.isFunction(e),this.each(function(n){var o;1===this.nodeType&&(o=r?e.call(this,n,m(this).val()):e,null==o?o="":"number"==typeof o?o+="":m.isArray(o)&&(o=m.map(o,function(e){return null==e?"":e+""})),(t=m.valHooks[this.type]||m.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,o,"value")||(this.value=o))});if(o)return(t=m.valHooks[o.type]||m.valHooks[o.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(o,"value"))?n:(n=o.value,"string"==typeof n?n.replace(Ce,""):null==n?"":n)}}}),m.extend({valHooks:{option:{get:function(e){var t=m.find.attr(e,"value");return null!=t?t:m.trim(m.text(e)).replace(_e," ")}},select:{get:function(e){for(var t,n,r=e.options,o=e.selectedIndex,i="select-one"===e.type||o<0,a=i?null:[],s=i?o+1:r.length,u=o<0?s:i?o:0;u-1)&&(n=!0);return n||(e.selectedIndex=-1),i}}}}),m.each(["radio","checkbox"],function(){m.valHooks[this]={set:function(e,t){if(m.isArray(t))return e.checked=m.inArray(m(e).val(),t)>-1}},g.checkOn||(m.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Ee=/^(?:focusinfocus|focusoutblur)$/;m.extend(m.event,{trigger:function(e,t,r,o){var i,a,u,l,c,f,d,h=[r||s],g=p.call(e,"type")?e.type:e,v=p.call(e,"namespace")?e.namespace.split("."):[];if(a=u=r=r||s,3!==r.nodeType&&8!==r.nodeType&&!Ee.test(g+m.event.triggered)&&(g.indexOf(".")>-1&&(v=g.split("."),g=v.shift(),v.sort()),c=g.indexOf(":")<0&&"on"+g,e=e[m.expando]?e:new m.Event(g,"object"==typeof e&&e),e.isTrigger=o?2:3,e.namespace=v.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=r),t=null==t?[e]:m.makeArray(t,[e]),d=m.event.special[g]||{},o||!d.trigger||!1!==d.trigger.apply(r,t))){if(!o&&!d.noBubble&&!m.isWindow(r)){for(l=d.delegateType||g,Ee.test(l+g)||(a=a.parentNode);a;a=a.parentNode)h.push(a),u=a;u===(r.ownerDocument||s)&&h.push(u.defaultView||u.parentWindow||n)}for(i=0;(a=h[i++])&&!e.isPropagationStopped();)e.type=i>1?l:d.bindType||g,f=(R.get(a,"events")||{})[e.type]&&R.get(a,"handle"),f&&f.apply(a,t),(f=c&&a[c])&&f.apply&&M(a)&&(e.result=f.apply(a,t),!1===e.result&&e.preventDefault());return e.type=g,o||e.isDefaultPrevented()||d._default&&!1!==d._default.apply(h.pop(),t)||!M(r)||c&&m.isFunction(r[g])&&!m.isWindow(r)&&(u=r[c],u&&(r[c]=null),m.event.triggered=g,r[g](),m.event.triggered=void 0,u&&(r[c]=u)),e.result}},simulate:function(e,t,n){var r=m.extend(new m.Event,n,{type:e,isSimulated:!0});m.event.trigger(r,null,t)}}),m.fn.extend({trigger:function(e,t){return this.each(function(){m.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return m.event.trigger(e,t,n,!0)}}),m.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(e,t){m.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),m.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),g.focusin="onfocusin"in n,g.focusin||m.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){m.event.simulate(t,e.target,m.event.fix(e))};m.event.special[t]={setup:function(){var r=this.ownerDocument||this,o=R.access(r,t);o||r.addEventListener(e,n,!0),R.access(r,t,(o||0)+1)},teardown:function(){var r=this.ownerDocument||this,o=R.access(r,t)-1;o?R.access(r,t,o):(r.removeEventListener(e,n,!0),R.remove(r,t))}}});var ke=n.location,Se=m.now(),Ae=/\?/;m.parseJSON=function(e){return JSON.parse(e+"")},m.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new n.DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||m.error("Invalid XML: "+e),t};var Ne=/#.*$/,De=/([?&])_=[^&]*/,Pe=/^(.*?):[ \t]*([^\r\n]*)$/gm,Oe=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Le=/^(?:GET|HEAD)$/,Me=/^\/\//,Re={},je={},Fe="*/".concat("*"),He=s.createElement("a");He.href=ke.href,m.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ke.href,type:"GET",isLocal:Oe.test(ke.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Fe,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":m.parseJSON,"text xml":m.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?ajaxExtend(ajaxExtend(e,m.ajaxSettings),t):ajaxExtend(m.ajaxSettings,e)},ajaxPrefilter:addToPrefiltersOrTransports(Re),ajaxTransport:addToPrefiltersOrTransports(je),ajax:function(e,t){function done(e,t,a,s){var l,f,w,b,T,_=t;2!==x&&(x=2,u&&n.clearTimeout(u),r=void 0,i=s||"",C.readyState=e>0?4:0,l=e>=200&&e<300||304===e,a&&(b=ajaxHandleResponses(d,C,a)),b=ajaxConvert(d,b,C,l),l?(d.ifModified&&(T=C.getResponseHeader("Last-Modified"),T&&(m.lastModified[o]=T),(T=C.getResponseHeader("etag"))&&(m.etag[o]=T)),204===e||"HEAD"===d.type?_="nocontent":304===e?_="notmodified":(_=b.state,f=b.data,w=b.error,l=!w)):(w=_,!e&&_||(_="error",e<0&&(e=0))),C.status=e,C.statusText=(t||_)+"",l?g.resolveWith(h,[f,_,C]):g.rejectWith(h,[C,_,w]),C.statusCode(y),y=void 0,c&&p.trigger(l?"ajaxSuccess":"ajaxError",[C,d,l?f:w]),v.fireWith(h,[C,_]),c&&(p.trigger("ajaxComplete",[C,d]),--m.active||m.event.trigger("ajaxStop")))}"object"==typeof e&&(t=e,e=void 0),t=t||{};var r,o,i,a,u,l,c,f,d=m.ajaxSetup({},t),h=d.context||d,p=d.context&&(h.nodeType||h.jquery)?m(h):m.event,g=m.Deferred(),v=m.Callbacks("once memory"),y=d.statusCode||{},w={},b={},x=0,T="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(2===x){if(!a)for(a={};t=Pe.exec(i);)a[t[1].toLowerCase()]=t[2];t=a[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===x?i:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return x||(e=b[n]=b[n]||e,w[e]=t),this},overrideMimeType:function(e){return x||(d.mimeType=e),this},statusCode:function(e){var t;if(e)if(x<2)for(t in e)y[t]=[y[t],e[t]];else C.always(e[C.status]);return this},abort:function(e){var t=e||T;return r&&r.abort(t),done(0,t),this}};if(g.promise(C).complete=v.add,C.success=C.done,C.error=C.fail,d.url=((e||d.url||ke.href)+"").replace(Ne,"").replace(Me,ke.protocol+"//"),d.type=t.method||t.type||d.method||d.type,d.dataTypes=m.trim(d.dataType||"*").toLowerCase().match(P)||[""],null==d.crossDomain){l=s.createElement("a");try{l.href=d.url,l.href=l.href,d.crossDomain=He.protocol+"//"+He.host!=l.protocol+"//"+l.host}catch(e){d.crossDomain=!0}}if(d.data&&d.processData&&"string"!=typeof d.data&&(d.data=m.param(d.data,d.traditional)),inspectPrefiltersOrTransports(Re,d,t,C),2===x)return C;c=m.event&&d.global,c&&0==m.active++&&m.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!Le.test(d.type),o=d.url,d.hasContent||(d.data&&(o=d.url+=(Ae.test(o)?"&":"?")+d.data,delete d.data),!1===d.cache&&(d.url=De.test(o)?o.replace(De,"$1_="+Se++):o+(Ae.test(o)?"&":"?")+"_="+Se++)),d.ifModified&&(m.lastModified[o]&&C.setRequestHeader("If-Modified-Since",m.lastModified[o]),m.etag[o]&&C.setRequestHeader("If-None-Match",m.etag[o])),(d.data&&d.hasContent&&!1!==d.contentType||t.contentType)&&C.setRequestHeader("Content-Type",d.contentType),C.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+Fe+"; q=0.01":""):d.accepts["*"]);for(f in d.headers)C.setRequestHeader(f,d.headers[f]);if(d.beforeSend&&(!1===d.beforeSend.call(h,C,d)||2===x))return C.abort();T="abort";for(f in{success:1,error:1,complete:1})C[f](d[f]);if(r=inspectPrefiltersOrTransports(je,d,t,C)){if(C.readyState=1,c&&p.trigger("ajaxSend",[C,d]),2===x)return C;d.async&&d.timeout>0&&(u=n.setTimeout(function(){C.abort("timeout")},d.timeout));try{x=1,r.send(w,done)}catch(e){if(!(x<2))throw e;done(-1,e)}}else done(-1,"No Transport");return C},getJSON:function(e,t,n){return m.get(e,t,n,"json")},getScript:function(e,t){return m.get(e,void 0,t,"script")}}),m.each(["get","post"],function(e,t){m[t]=function(e,n,r,o){return m.isFunction(n)&&(o=o||r,r=n,n=void 0),m.ajax(m.extend({url:e,type:t,dataType:o,data:n,success:r},m.isPlainObject(e)&&e))}}),m._evalUrl=function(e){return m.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,throws:!0})},m.fn.extend({wrapAll:function(e){var t;return m.isFunction(e)?this.each(function(t){m(this).wrapAll(e.call(this,t))}):(this[0]&&(t=m(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this)},wrapInner:function(e){return m.isFunction(e)?this.each(function(t){m(this).wrapInner(e.call(this,t))}):this.each(function(){var t=m(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=m.isFunction(e);return this.each(function(n){m(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){m.nodeName(this,"body")||m(this).replaceWith(this.childNodes)}).end()}}),m.expr.filters.hidden=function(e){return!m.expr.filters.visible(e)},m.expr.filters.visible=function(e){return e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0};var qe=/%20/g,Be=/\[\]$/,ze=/\r?\n/g,Ie=/^(?:submit|button|image|reset|file)$/i,We=/^(?:input|select|textarea|keygen)/i;m.param=function(e,t){var n,r=[],o=function(e,t){t=m.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=m.ajaxSettings&&m.ajaxSettings.traditional),m.isArray(e)||e.jquery&&!m.isPlainObject(e))m.each(e,function(){o(this.name,this.value)});else for(n in e)buildParams(n,e[n],t,o);return r.join("&").replace(qe,"+")},m.fn.extend({serialize:function(){return m.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=m.prop(this,"elements");return e?m.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!m(this).is(":disabled")&&We.test(this.nodeName)&&!Ie.test(e)&&(this.checked||!W.test(e))}).map(function(e,t){var n=m(this).val();return null==n?null:m.isArray(n)?m.map(n,function(e){return{name:t.name,value:e.replace(ze,"\r\n")}}):{name:t.name,value:n.replace(ze,"\r\n")}}).get()}}),m.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(e){}};var Ue={0:200,1223:204},$e=m.ajaxSettings.xhr();g.cors=!!$e&&"withCredentials"in $e,g.ajax=$e=!!$e,m.ajaxTransport(function(e){var t,r;if(g.cors||$e&&!e.crossDomain)return{send:function(o,i){var a,s=e.xhr();if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(a in e.xhrFields)s[a]=e.xhrFields[a];e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||o["X-Requested-With"]||(o["X-Requested-With"]="XMLHttpRequest");for(a in o)s.setRequestHeader(a,o[a]);t=function(e){return function(){t&&(t=r=s.onload=s.onerror=s.onabort=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?i(0,"error"):i(s.status,s.statusText):i(Ue[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=t(),r=s.onerror=t("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&n.setTimeout(function(){t&&r()})},t=t("abort");try{s.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}}),m.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return m.globalEval(e),e}}}),m.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),m.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(r,o){t=m("