WP Featherlight – A Simple jQuery Lightbox - Version 0.3.0

Version Description

There are quite a few internal changes in the plugin for this release, plus some nice new features and improvements on the front-end. We've streamlined everything as much as possible and also added support for some languages other than English! Here's a breakdown of everything that's changed:

New Features - Automatic captioning for WordPress images and gallery items (Including Jetpack Galleries) - Spanish language translation

Enhancements - Updated Featherlight to 1.3.3 - Improved gallery styles on desktop and mobile devices - Streamlined overall styles - Added SVG icons for more visual consistency across various platforms - Simplified the text used in the admin metabox to ease translations (props @toscho)

Bug Fixes - Improved handling of images when certain caching plugins are enabled - Prevented gallery arrows from being hijacked by WP Emoji - Fixed a bug which allowed multiple light boxes to be opened using keyboard commands

Developer Stuff - Reduced overhead by loading language files only when needed (props @toscho) - Improved the save routine for our admin metabox (props @toscho) - Added a wp_featherlight_captions filter to control auto-captioning. Filter it to false to disable captions. - Re-structured the plugin's internal code base and deprecated plugin constants - Added Grunt and Bower the plugin to allow easier updates and releases in the future

Added Language Support - German - Spanish - French - Portuguese (Brazil) - Spanish (Peru)

Download this release

Release Info

Developer wpsitecare
Plugin Icon wp plugin WP Featherlight – A Simple jQuery Lightbox
Version 0.3.0
Comparing to
See all releases

Code changes from version 0.2.0 to 0.3.0

Files changed (123) hide show
  1. admin/class-meta.php +160 -0
  2. {templates/admin → admin/templates}/metabox-sidebar.php +4 -4
  3. composer.json +0 -23
  4. composer.lock +0 -113
  5. css/src/.scss-lint.yml +0 -49
  6. css/src/_featherlight.scss +0 -28
  7. css/src/parts/_animation.scss +0 -8
  8. css/src/parts/_base.scss +0 -105
  9. css/src/parts/_gallery.scss +0 -75
  10. css/wp-featherlight-rtl.css +231 -0
  11. css/wp-featherlight-rtl.min.css +1 -0
  12. css/wp-featherlight.css +111 -128
  13. css/wp-featherlight.min.css +1 -1
  14. includes/class-i18n.php +106 -0
  15. includes/class-plugin.php +183 -0
  16. includes/{classes/scripts.php → class-scripts.php} +50 -23
  17. includes/classes/admin/meta.php +0 -118
  18. includes/constants.php +24 -0
  19. includes/plugin.php +0 -106
  20. includes/vendor/autoload.php +0 -7
  21. includes/vendor/composer/ClassLoader.php +0 -413
  22. includes/vendor/composer/autoload_classmap.php +0 -9
  23. includes/vendor/composer/autoload_namespaces.php +0 -10
  24. includes/vendor/composer/autoload_psr4.php +0 -9
  25. includes/vendor/composer/autoload_real.php +0 -50
  26. includes/vendor/composer/installed.json +0 -99
  27. includes/vendor/composer/installers/.editorconfig +0 -10
  28. includes/vendor/composer/installers/.gitignore +0 -3
  29. includes/vendor/composer/installers/.travis.yml +0 -14
  30. includes/vendor/composer/installers/LICENSE +0 -19
  31. includes/vendor/composer/installers/README.md +0 -191
  32. includes/vendor/composer/installers/composer.json +0 -77
  33. includes/vendor/composer/installers/phpunit.xml.dist +0 -25
  34. includes/vendor/composer/installers/src/Composer/Installers/AglInstaller.php +0 -21
  35. includes/vendor/composer/installers/src/Composer/Installers/AimeosInstaller.php +0 -9
  36. includes/vendor/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php +0 -11
  37. includes/vendor/composer/installers/src/Composer/Installers/AsgardInstaller.php +0 -45
  38. includes/vendor/composer/installers/src/Composer/Installers/BaseInstaller.php +0 -131
  39. includes/vendor/composer/installers/src/Composer/Installers/BitrixInstaller.php +0 -11
  40. includes/vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php +0 -78
  41. includes/vendor/composer/installers/src/Composer/Installers/ChefInstaller.php +0 -11
  42. includes/vendor/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php +0 -10
  43. includes/vendor/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php +0 -11
  44. includes/vendor/composer/installers/src/Composer/Installers/Concrete5Installer.php +0 -12
  45. includes/vendor/composer/installers/src/Composer/Installers/CraftInstaller.php +0 -9
  46. includes/vendor/composer/installers/src/Composer/Installers/CroogoInstaller.php +0 -21
  47. includes/vendor/composer/installers/src/Composer/Installers/DokuWikiInstaller.php +0 -50
  48. includes/vendor/composer/installers/src/Composer/Installers/DolibarrInstaller.php +0 -16
  49. includes/vendor/composer/installers/src/Composer/Installers/DrupalInstaller.php +0 -14
  50. includes/vendor/composer/installers/src/Composer/Installers/ElggInstaller.php +0 -9
  51. includes/vendor/composer/installers/src/Composer/Installers/FuelInstaller.php +0 -11
  52. includes/vendor/composer/installers/src/Composer/Installers/FuelphpInstaller.php +0 -9
  53. includes/vendor/composer/installers/src/Composer/Installers/GravInstaller.php +0 -30
  54. includes/vendor/composer/installers/src/Composer/Installers/HuradInstaller.php +0 -25
  55. includes/vendor/composer/installers/src/Composer/Installers/Installer.php +0 -163
  56. includes/vendor/composer/installers/src/Composer/Installers/JoomlaInstaller.php +0 -15
  57. includes/vendor/composer/installers/src/Composer/Installers/KirbyInstaller.php +0 -9
  58. includes/vendor/composer/installers/src/Composer/Installers/KohanaInstaller.php +0 -9
  59. includes/vendor/composer/installers/src/Composer/Installers/LaravelInstaller.php +0 -9
  60. includes/vendor/composer/installers/src/Composer/Installers/LithiumInstaller.php +0 -10
  61. includes/vendor/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php +0 -9
  62. includes/vendor/composer/installers/src/Composer/Installers/MODXEvoInstaller.php +0 -16
  63. includes/vendor/composer/installers/src/Composer/Installers/MagentoInstaller.php +0 -11
  64. includes/vendor/composer/installers/src/Composer/Installers/MakoInstaller.php +0 -9
  65. includes/vendor/composer/installers/src/Composer/Installers/MediaWikiInstaller.php +0 -50
  66. includes/vendor/composer/installers/src/Composer/Installers/MicroweberInstaller.php +0 -111
  67. includes/vendor/composer/installers/src/Composer/Installers/MoodleInstaller.php +0 -47
  68. includes/vendor/composer/installers/src/Composer/Installers/OctoberInstaller.php +0 -46
  69. includes/vendor/composer/installers/src/Composer/Installers/OxidInstaller.php +0 -11
  70. includes/vendor/composer/installers/src/Composer/Installers/PPIInstaller.php +0 -9
  71. includes/vendor/composer/installers/src/Composer/Installers/PhpBBInstaller.php +0 -11
  72. includes/vendor/composer/installers/src/Composer/Installers/PimcoreInstaller.php +0 -21
  73. includes/vendor/composer/installers/src/Composer/Installers/PiwikInstaller.php +0 -32
  74. includes/vendor/composer/installers/src/Composer/Installers/PrestashopInstaller.php +0 -10
  75. includes/vendor/composer/installers/src/Composer/Installers/PuppetInstaller.php +0 -11
  76. includes/vendor/composer/installers/src/Composer/Installers/RedaxoInstaller.php +0 -10
  77. includes/vendor/composer/installers/src/Composer/Installers/RoundcubeInstaller.php +0 -22
  78. includes/vendor/composer/installers/src/Composer/Installers/SMFInstaller.php +0 -10
  79. includes/vendor/composer/installers/src/Composer/Installers/ShopwareInstaller.php +0 -58
  80. includes/vendor/composer/installers/src/Composer/Installers/SilverStripeInstaller.php +0 -36
  81. includes/vendor/composer/installers/src/Composer/Installers/Symfony1Installer.php +0 -26
  82. includes/vendor/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php +0 -14
  83. includes/vendor/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php +0 -38
  84. includes/vendor/composer/installers/src/Composer/Installers/TheliaInstaller.php +0 -12
  85. includes/vendor/composer/installers/src/Composer/Installers/TuskInstaller.php +0 -14
  86. includes/vendor/composer/installers/src/Composer/Installers/WHMCSInstaller.php +0 -10
  87. includes/vendor/composer/installers/src/Composer/Installers/WolfCMSInstaller.php +0 -9
  88. includes/vendor/composer/installers/src/Composer/Installers/WordPressInstaller.php +0 -11
  89. includes/vendor/composer/installers/src/Composer/Installers/ZendInstaller.php +0 -11
  90. includes/vendor/composer/installers/src/Composer/Installers/ZikulaInstaller.php +0 -10
  91. includes/vendor/composer/installers/src/bootstrap.php +0 -13
  92. includes/vendor/composer/installers/tests/Composer/Installers/Test/AsgardInstallerTest.php +0 -61
  93. includes/vendor/composer/installers/tests/Composer/Installers/Test/CakePHPInstallerTest.php +0 -115
  94. includes/vendor/composer/installers/tests/Composer/Installers/Test/DokuWikiInstallerTest.php +0 -89
  95. includes/vendor/composer/installers/tests/Composer/Installers/Test/GravInstallerTest.php +0 -63
  96. includes/vendor/composer/installers/tests/Composer/Installers/Test/InstallerTest.php +0 -422
  97. includes/vendor/composer/installers/tests/Composer/Installers/Test/MediaWikiInstallerTest.php +0 -66
  98. includes/vendor/composer/installers/tests/Composer/Installers/Test/OctoberInstallerTest.php +0 -66
  99. includes/vendor/composer/installers/tests/Composer/Installers/Test/PimcoreInstallerTest.php +0 -44
  100. includes/vendor/composer/installers/tests/Composer/Installers/Test/PiwikInstallerTest.php +0 -63
  101. includes/vendor/composer/installers/tests/Composer/Installers/Test/TestCase.php +0 -64
  102. includes/vendor/composer/installers/tests/bootstrap.php +0 -4
  103. js/.jscsrc +0 -113
  104. js/.jshintrc +0 -24
  105. js/dist/wpFeatherlight.pkgd.min.js +0 -1
  106. js/src/vendor/featherlight.gallery.js +10 -5
  107. js/src/vendor/featherlight.gallery.min.js +1 -0
  108. js/src/vendor/featherlight.js +18 -5
  109. js/src/vendor/featherlight.min.js +1 -0
  110. js/src/vendor/jquery.detect_swipe.js +55 -55
  111. js/src/vendor/jquery.detect_swipe.min.js +1 -0
  112. js/src/wpFeatherlight.js +39 -7
  113. js/src/wpFeatherlight.min.js +1 -0
  114. js/{dist/wpFeatherlight.pkgd.js → wpFeatherlight.pkgd.js} +130 -83
  115. js/wpFeatherlight.pkgd.min.js +1 -0
  116. languages/wp-featherlight-de_DE.mo +0 -0
  117. languages/wp-featherlight-es_ES.mo +0 -0
  118. languages/wp-featherlight-fr_FR .mo +0 -0
  119. languages/wp-featherlight-fr_FR.mo +0 -0
  120. languages/wp-featherlight-pt_BR.mo +0 -0
  121. languages/wp-featherlight.pot +53 -0
  122. readme.txt +53 -7
  123. wp-featherlight.php +9 -24
admin/class-meta.php ADDED
@@ -0,0 +1,160 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Methods used for adding and saving meta data for WP Featherlight.
4
+ *
5
+ * @package WPFeatherlight\Admin
6
+ * @author Robert Neu
7
+ * @copyright Copyright (c) 2015, WP Site Care
8
+ * @license GPL-2.0+
9
+ * @since 0.1.0
10
+ */
11
+
12
+ // Prevent direct access.
13
+ defined( 'ABSPATH' ) || exit;
14
+
15
+ class WP_Featherlight_Admin_Meta {
16
+
17
+ /**
18
+ * Name for the nonce field
19
+ *
20
+ * @var string
21
+ */
22
+ private $nonce_name = 'wp_featherlight_metabox_nonce';
23
+
24
+ /**
25
+ * Name for the nonce action
26
+ *
27
+ * @var string
28
+ */
29
+ private $nonce_action = 'save_wp_featherlight_metabox';
30
+
31
+ /**
32
+ * User submitted data.
33
+ *
34
+ * @var array
35
+ */
36
+ private $user_data = array();
37
+
38
+ /**
39
+ * Get the class running!
40
+ *
41
+ * @since 0.1.0
42
+ * @access public
43
+ * @return void
44
+ */
45
+ public function run() {
46
+ $this->wp_hooks();
47
+ }
48
+
49
+ /**
50
+ * Hook into WordPress.
51
+ *
52
+ * @since 0.1.0
53
+ * @access protected
54
+ * @return void
55
+ */
56
+ protected function wp_hooks() {
57
+ add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );
58
+
59
+ if ( 'POST' === $_SERVER['REQUEST_METHOD'] ) {
60
+ $this->user_data = $_POST;
61
+ add_action( 'save_post', array( $this, 'save_meta_boxes' ) );
62
+ }
63
+ }
64
+
65
+ /**
66
+ * Determine if the request to save data should be allowed to proceed.
67
+ *
68
+ * @since 0.3.0
69
+ * @access protected
70
+ * @param int $post_id Post ID.
71
+ * @return bool Whether or not this is a valid request to save our data.
72
+ */
73
+ protected function validate_request( $post_id ) {
74
+ if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
75
+ return false;
76
+ }
77
+
78
+ if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
79
+ return false;
80
+ }
81
+
82
+ if ( defined( 'DOING_CRON' ) && DOING_CRON ) {
83
+ return false;
84
+ }
85
+
86
+ if ( ! current_user_can( 'edit_post', $post_id ) ) {
87
+ return false;
88
+ }
89
+
90
+ if ( ! isset( $this->user_data[ $this->nonce_name ] ) ) {
91
+ return false;
92
+ }
93
+
94
+ if ( ! wp_verify_nonce( $this->user_data[ $this->nonce_name ], $this->nonce_action ) ) {
95
+ return false;
96
+ }
97
+ // @link http://make.marketpress.com/multilingualpress/2014/10/how-to-disable-broken-save_post-callbacks/
98
+ if ( is_multisite() && ms_is_switched() ) {
99
+ return false;
100
+ }
101
+
102
+ return true;
103
+ }
104
+
105
+ /**
106
+ * Add a metabox to control featherlight display options.
107
+ *
108
+ * @since 0.1.0
109
+ * @access public
110
+ * @param string $post_type the current post type.
111
+ * @return void
112
+ */
113
+ public function add_meta_boxes( $post_type ) {
114
+ $type = get_post_type_object( $post_type );
115
+ if ( is_object( $type ) && $type->public ) {
116
+ add_meta_box(
117
+ 'wp_featherlight_options',
118
+ __( 'WP Featherlight Options', 'wp-featherlight' ),
119
+ array( $this, 'options_callback' ),
120
+ null,
121
+ 'side'
122
+ );
123
+ }
124
+ }
125
+
126
+ /**
127
+ * Output the content of our metabox.
128
+ *
129
+ * @since 0.1.0
130
+ * @access public
131
+ *
132
+ * @param \WP_Post $post Post object.
133
+ * @return void
134
+ */
135
+ public function options_callback( WP_Post $post ) {
136
+ wp_featherlight()->i18n->load();
137
+ $disable = get_post_meta( $post->ID, 'wp_featherlight_disable', true );
138
+ $checked = empty( $disable ) ? '' : $disable;
139
+ require_once wp_featherlight()->get_dir() . 'admin/templates/metabox-sidebar.php';
140
+ }
141
+
142
+ /**
143
+ * Callback function for saving our meta box data.
144
+ *
145
+ * @since 0.1.0
146
+ * @access public
147
+ * @param int $post_id Post ID.
148
+ * @return bool Whether or not data has been saved.
149
+ */
150
+ public function save_meta_boxes( $post_id ) {
151
+ if ( ! $this->validate_request( $post_id ) ) {
152
+ return false;
153
+ }
154
+
155
+ $value = isset( $this->user_data['wp_featherlight_disable'] ) ? 'yes' : '';
156
+
157
+ return (bool) update_post_meta( $post_id, 'wp_featherlight_disable', $value );
158
+ }
159
+
160
+ }
{templates/admin → admin/templates}/metabox-sidebar.php RENAMED
@@ -2,17 +2,17 @@
2
  /**
3
  * Template to display the WP Featherlight admin sidebar meta box.
4
  *
5
- * @package WPFeatherlight
6
  * @author Robert Neu
7
- * @copyright Copyright (c) 2015, Robert Neu
8
  * @license GPL-2.0+
9
  * @since 0.1.0
10
  */
11
  ?>
12
- <?php wp_nonce_field( plugin_basename( WP_FEATHERLIGHT_FILE ), 'wp_featherlight_nonce' ); ?>
13
  <p>
14
  <label for="wp_featherlight_disable">
15
  <input type="checkbox" name="wp_featherlight_disable" id="wp_featherlight_disable" value="yes"<?php checked( $checked, 'yes' ); ?> />
16
- <?php echo esc_html( sprintf( _x( 'Disable Lightbox on This %s', '%s = post type singular name', 'wp-featherlight' ), $name ) ); ?>
17
  </label>
18
  </p>
 
2
  /**
3
  * Template to display the WP Featherlight admin sidebar meta box.
4
  *
5
+ * @package WPFeatherlight\Admin\Templates
6
  * @author Robert Neu
7
+ * @copyright Copyright (c) 2015, WP Site Care
8
  * @license GPL-2.0+
9
  * @since 0.1.0
10
  */
11
  ?>
 
12
  <p>
13
  <label for="wp_featherlight_disable">
14
  <input type="checkbox" name="wp_featherlight_disable" id="wp_featherlight_disable" value="yes"<?php checked( $checked, 'yes' ); ?> />
15
+ <?php esc_html_e( 'Disable lightbox', 'wp-featherlight' ); ?>
16
  </label>
17
  </p>
18
+ <?php wp_nonce_field( $this->nonce_action, $this->nonce_name ); ?>
composer.json DELETED
@@ -1,23 +0,0 @@
1
- {
2
- "name": "wpsitecare/wp-featherlight",
3
- "description": "An ultra lightweight jQuery lightbox for WordPress images and galleries.",
4
- "type": "wordpress-plugin",
5
- "homepage" : "http://www.wpsitecare.com",
6
- "license" : "GPL-2.0+",
7
- "authors" : [
8
- {
9
- "name" : "Robert Neu",
10
- "email" : "rob@wpsitecare.com",
11
- "homepage" : "http://www.wpsitecare.com"
12
- }
13
- ],
14
- "support" : {
15
- "issues" : "https://github.com/wpsitecare/wp-featherlight/issues"
16
- },
17
- "config": {
18
- "vendor-dir": "includes/vendor"
19
- },
20
- "require": {
21
- "composer/installers": "~1.0"
22
- }
23
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
composer.lock DELETED
@@ -1,113 +0,0 @@
1
- {
2
- "_readme": [
3
- "This file locks the dependencies of your project to a known state",
4
- "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
5
- "This file is @generated automatically"
6
- ],
7
- "hash": "0d1186212214fbaa4e5f713507762659",
8
- "packages": [
9
- {
10
- "name": "composer/installers",
11
- "version": "v1.0.21",
12
- "source": {
13
- "type": "git",
14
- "url": "https://github.com/composer/installers.git",
15
- "reference": "d64e23fce42a4063d63262b19b8e7c0f3b5e4c45"
16
- },
17
- "dist": {
18
- "type": "zip",
19
- "url": "https://api.github.com/repos/composer/installers/zipball/d64e23fce42a4063d63262b19b8e7c0f3b5e4c45",
20
- "reference": "d64e23fce42a4063d63262b19b8e7c0f3b5e4c45",
21
- "shasum": ""
22
- },
23
- "replace": {
24
- "roundcube/plugin-installer": "*",
25
- "shama/baton": "*"
26
- },
27
- "require-dev": {
28
- "composer/composer": "1.0.*@dev",
29
- "phpunit/phpunit": "4.1.*"
30
- },
31
- "type": "composer-installer",
32
- "extra": {
33
- "class": "Composer\\Installers\\Installer",
34
- "branch-alias": {
35
- "dev-master": "1.0-dev"
36
- }
37
- },
38
- "autoload": {
39
- "psr-0": {
40
- "Composer\\Installers\\": "src/"
41
- }
42
- },
43
- "notification-url": "https://packagist.org/downloads/",
44
- "license": [
45
- "MIT"
46
- ],
47
- "authors": [
48
- {
49
- "name": "Kyle Robinson Young",
50
- "email": "kyle@dontkry.com",
51
- "homepage": "https://github.com/shama"
52
- }
53
- ],
54
- "description": "A multi-framework Composer library installer",
55
- "homepage": "http://composer.github.com/installers/",
56
- "keywords": [
57
- "Craft",
58
- "Dolibarr",
59
- "Hurad",
60
- "MODX Evo",
61
- "OXID",
62
- "SMF",
63
- "Thelia",
64
- "WolfCMS",
65
- "agl",
66
- "aimeos",
67
- "annotatecms",
68
- "bitrix",
69
- "cakephp",
70
- "chef",
71
- "codeigniter",
72
- "concrete5",
73
- "croogo",
74
- "dokuwiki",
75
- "drupal",
76
- "elgg",
77
- "fuelphp",
78
- "grav",
79
- "installer",
80
- "joomla",
81
- "kohana",
82
- "laravel",
83
- "lithium",
84
- "magento",
85
- "mako",
86
- "mediawiki",
87
- "modulework",
88
- "moodle",
89
- "phpbb",
90
- "piwik",
91
- "ppi",
92
- "puppet",
93
- "roundcube",
94
- "shopware",
95
- "silverstripe",
96
- "symfony",
97
- "typo3",
98
- "wordpress",
99
- "zend",
100
- "zikula"
101
- ],
102
- "time": "2015-02-18 17:17:01"
103
- }
104
- ],
105
- "packages-dev": [],
106
- "aliases": [],
107
- "minimum-stability": "stable",
108
- "stability-flags": [],
109
- "prefer-stable": false,
110
- "prefer-lowest": false,
111
- "platform": [],
112
- "platform-dev": []
113
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/src/.scss-lint.yml DELETED
@@ -1,49 +0,0 @@
1
- # Default application configuration that all configurations inherit from:
2
- # https://github.com/causes/scss-lint/blob/master/config/default.yml
3
-
4
- linters:
5
- Comment:
6
- enabled: false # False since style.dev.css should also contain heading comments
7
-
8
- IdSelector:
9
- exclude: # These files have ID selectors because of WordPress or plugins.
10
- - 'scss/partials/_common-classes.scss'
11
- - 'scss/partials/_jetpack.scss'
12
-
13
- Indentation:
14
- character: tab
15
- width: 1 # Set to one, as tabs are used, not spaces.
16
-
17
- LeadingZero:
18
- style: include_zero
19
-
20
- PropertySortOrder:
21
- enabled: false # To be handled with CSSComb
22
-
23
- QualifyingElement:
24
- allow_element_with_attribute: true
25
- exclude: # These files currently have qualifying elements
26
- - 'scss/partials/_common-classes.scss'
27
- - 'scss/partials/_plugins.scss'
28
- - 'scss/partials/_jetpack.scss'
29
- - 'scss/partials/_reset.scss'
30
-
31
- SelectorDepth:
32
- enabled: false
33
-
34
- SelectorFormat:
35
- exclude: # These files have underscore selectors because of WordPress or plugins.
36
- - 'scss/partials/_plugins.scss'
37
- - 'scss/partials/_jetpack.scss'
38
- - 'scss/partials/_sidebars.scss'
39
- - 'scss/partials/_theme-icons.scss'
40
- - 'scss/partials/_widgets.scss'
41
-
42
- SingleLinePerProperty:
43
- allow_single_line_rule_sets: false
44
-
45
- StringQuotes:
46
- style: double_quotes
47
-
48
- UrlQuotes:
49
- enabled: false
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/src/_featherlight.scss DELETED
@@ -1,28 +0,0 @@
1
- /**
2
- * Featherlight Animations
3
- * Version 0.2.0
4
- *
5
- * Copyright 2015, WP Site Care
6
- * MIT Licensed.
7
- */
8
- @import "parts/animation";
9
-
10
-
11
- /**
12
- * Featherlight - ultra slim jQuery lightbox
13
- * Version 1.2.3 - http://noelboss.github.io/featherlight/
14
- *
15
- * Copyright 2015, Noel Raoul Bossart (http://www.noelboss.com)
16
- * MIT Licensed.
17
- */
18
- @import "parts/base";
19
-
20
-
21
- /**
22
- * Featherlight Gallery - an extension for the ultra slim jQuery lightbox
23
- * Version 1.2.3 - http://noelboss.github.io/featherlight/
24
- *
25
- * Copyright 2015, Noel Raoul Bossart (http://www.noelboss.com)
26
- * MIT Licensed.
27
- */
28
- @import "parts/gallery";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/src/parts/_animation.scss DELETED
@@ -1,8 +0,0 @@
1
- @keyframes featherlightLoader {
2
- 0% {
3
- transform: rotate(0deg);
4
- }
5
- 100% {
6
- transform: rotate(360deg);
7
- }
8
- }
 
 
 
 
 
 
 
 
css/src/parts/_base.scss DELETED
@@ -1,105 +0,0 @@
1
- .featherlight {
2
- display: none;
3
- position: fixed;
4
- top: 0;
5
- right: 0;
6
- bottom: 0;
7
- left: 0;
8
- z-index: 2147483647;
9
- text-align: center;
10
- white-space: nowrap;
11
- cursor: pointer;
12
- background: rgba(0, 0, 0, 0);
13
-
14
- * {
15
- box-sizing: border-box;
16
- }
17
-
18
- &:last-of-type {
19
- background: rgba(0, 0, 0, 0.8);
20
- }
21
-
22
- &:before {
23
- content: "";
24
- display: inline-block;
25
- height: 100%;
26
- vertical-align: middle;
27
- margin-right: -0.25em;
28
- }
29
-
30
- .featherlight-content {
31
- background: #fff;
32
- position: relative;
33
- text-align: left;
34
- vertical-align: middle;
35
- display: inline-block;
36
- overflow: auto;
37
- padding: 0;
38
- border: 0;
39
- min-width: inherit;
40
- max-height: 95%;
41
- max-width: 90%;
42
- cursor: auto;
43
- white-space: normal;
44
- }
45
-
46
- .featherlight-inner {
47
- display: block;
48
- }
49
-
50
- .featherlight-close-icon {
51
- position: absolute;
52
- z-index: 9999;
53
- top: 0;
54
- right: 0;
55
- line-height: 25px;
56
- width: 20px;
57
- cursor: pointer;
58
- text-align: center;
59
- font: Arial, sans-serif;
60
- background: rgba(255, 255, 255, 0.3);
61
- color: #000;
62
- }
63
-
64
- .featherlight-image {
65
- max-width: 100%;
66
- border: 20px solid #fff;
67
-
68
- @media only screen and (max-width: 1024px) {
69
- border: 10px solid #fff;
70
- }
71
- }
72
-
73
- iframe {
74
- border: 0;
75
- }
76
- }
77
-
78
- .featherlight-iframe .featherlight-content {
79
- border-bottom: 0;
80
- padding: 0;
81
- }
82
-
83
- /* Animated Loader
84
- --------------------------------------------- */
85
- .featherlight-loading {
86
- .featherlight-content {
87
- animation: featherlightLoader 1s infinite linear;
88
- background: transparent;
89
- border: 8px solid #909090;
90
- border-left-color: #fff;
91
- font-size: 10px;
92
- }
93
-
94
- .featherlight-content,
95
- .featherlight-content:after {
96
- border-radius: 50%;
97
- width: 10em;
98
- height: 10em;
99
- }
100
-
101
- .featherlight-close,
102
- .featherlight-inner {
103
- display: none;
104
- }
105
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/src/parts/_gallery.scss DELETED
@@ -1,75 +0,0 @@
1
- .featherlight-next,
2
- .featherlight-previous {
3
- background: rgba(0, 0, 0, 0); // IE9 hack to fix navigation display
4
- display: block;
5
- position: absolute;
6
- top: 20px;
7
- right: 20px;
8
- bottom: 0;
9
- left: 80%;
10
- cursor: pointer;
11
- user-select: none;
12
-
13
- @media only screen and (max-width: 1024px) {
14
- top: 10px;
15
- right: 10px;
16
- left: 85%;
17
- }
18
-
19
- &:hover,
20
- &:focus {
21
- background: rgba(255, 255, 255, 0.25);
22
-
23
- @media only screen and (max-width: 1024px) {
24
- background: none;
25
- }
26
-
27
- span {
28
- display: inline-block;
29
- }
30
- }
31
-
32
- span {
33
- display: none;
34
- position: absolute;
35
- top: 50%;
36
- left: 5%;
37
- width: 82%;
38
- text-align: center;
39
- font-size: 80px;
40
- line-height: 80px;
41
- margin-top: -40px;
42
- text-shadow: 0 0 5px #fff;
43
- color: #fff;
44
- font-style: normal;
45
- font-weight: normal;
46
-
47
- @media only screen and (max-width: 1024px) {
48
- display: block;
49
- margin-top: -30px;
50
- font-size: 40px;
51
- }
52
- }
53
- }
54
-
55
- .featherlight-previous {
56
- left: 20px;
57
- right: 80%;
58
-
59
- @media only screen and (max-width: 1024px) {
60
- left: 10px;
61
- right: 85%;
62
- }
63
- }
64
-
65
- .featherlight-next span {
66
- right: 5%;
67
- left: auto;
68
- }
69
-
70
- .featherlight-loading {
71
- .featherlight-previous,
72
- .featherlight-next {
73
- display: none;
74
- }
75
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/wp-featherlight-rtl.css ADDED
@@ -0,0 +1,231 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**!
2
+ * Plugin Name: WP Featherlight
3
+ * Version: 0.3.0
4
+ * Author: WP Site Care
5
+ * License: GPL-2.0+
6
+ */
7
+
8
+
9
+ /* Base Styles
10
+ --------------------------------------------- */
11
+
12
+ .featherlight {
13
+ background: transparent;
14
+ cursor: -webkit-zoom-out;
15
+ cursor: -moz-zoom-out;
16
+ cursor: zoom-out;
17
+ display: none;
18
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
19
+ position: fixed;
20
+ top: 0;
21
+ left: 0;
22
+ bottom: 0;
23
+ right: 0;
24
+ text-align: center;
25
+ white-space: nowrap;
26
+ z-index: 2147483647;
27
+ }
28
+
29
+ .featherlight * {
30
+ -moz-box-sizing: border-box;
31
+ -webkit-box-sizing: border-box;
32
+ box-sizing: border-box;
33
+ }
34
+
35
+ .featherlight:last-of-type {
36
+ background: rgba(0, 0, 0, 0.9);
37
+ }
38
+
39
+ .featherlight:before {
40
+ content: "";
41
+ display: inline-block;
42
+ height: 100%;
43
+ margin-left: -0.25em;
44
+ vertical-align: middle;
45
+ }
46
+
47
+ .featherlight .featherlight-content {
48
+ background: #fff;
49
+ border: 0;
50
+ cursor: auto;
51
+ display: inline-block;
52
+ max-height: 80%;
53
+ max-width: 90%;
54
+ min-width: inherit;
55
+ overflow: visible;
56
+ padding: 0;
57
+ position: relative;
58
+ text-align: right;
59
+ vertical-align: middle;
60
+ white-space: normal;
61
+ }
62
+
63
+ @media screen and (min-width: 980px) {
64
+ .featherlight .featherlight-content {
65
+ max-height: 90%;
66
+ }
67
+ }
68
+
69
+ .featherlight .featherlight-inner {
70
+ display: block;
71
+ }
72
+
73
+ .featherlight .featherlight-close-icon {
74
+ background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%09%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M21%204.41L19.59%203%2012%2010.59%204.41%203%203%204.41%2010.59%2012%203%2019.59%204.41%2021%2012%2013.41%2019.59%2021%2021%2019.59%2013.41%2012%2021%204.41z%22/%3E%0A%3C/svg%3E");
75
+ background-position: center;
76
+ background-repeat: no-repeat;
77
+ -webkit-background-size: 100% auto;
78
+ background-size: 100% auto;
79
+ cursor: pointer;
80
+ display: block;
81
+ height: 30px;
82
+ overflow: hidden;
83
+ position: fixed;
84
+ top: 25px;
85
+ left: 25px;
86
+ text-align: center;
87
+ text-indent: 100%;
88
+ white-space: nowrap;
89
+ width: 30px;
90
+ z-index: 9999;
91
+ }
92
+
93
+ .featherlight .featherlight-image {
94
+ max-width: 100%;
95
+ }
96
+
97
+ .featherlight iframe {
98
+ border: 0;
99
+ }
100
+
101
+ [data-featherlight] {
102
+ cursor: -webkit-zoom-in;
103
+ cursor: -moz-zoom-in;
104
+ cursor: zoom-in;
105
+ }
106
+
107
+ .featherlight-iframe .featherlight-content {
108
+ border-bottom: 0;
109
+ padding: 0;
110
+ }
111
+
112
+ .featherlight-content .caption {
113
+ color: #fff;
114
+ font-size: 16px;
115
+ font-weight: lighter;
116
+ max-width: 100%;
117
+ overflow: hidden;
118
+ position: absolute;
119
+ text-align: right;
120
+ text-overflow: ellipsis;
121
+ white-space: nowrap;
122
+ }
123
+
124
+ .featherlight-content .caption:hover,
125
+ .featherlight-content .caption:focus {
126
+ overflow: visible;
127
+ white-space: normal;
128
+ }
129
+
130
+
131
+ /* Animated Loader
132
+ --------------------------------------------- */
133
+
134
+ @-webkit-keyframes featherlightLoader {
135
+ 0% {
136
+ -webkit-transform: rotate(0deg);
137
+ transform: rotate(0deg);
138
+ }
139
+
140
+ 100% {
141
+ -webkit-transform: rotate(-360deg);
142
+ transform: rotate(-360deg);
143
+ }
144
+ }
145
+
146
+ @keyframes featherlightLoader {
147
+ 0% {
148
+ -webkit-transform: rotate(0deg);
149
+ transform: rotate(0deg);
150
+ }
151
+
152
+ 100% {
153
+ -webkit-transform: rotate(-360deg);
154
+ transform: rotate(-360deg);
155
+ }
156
+ }
157
+
158
+ .featherlight-loading .featherlight-content {
159
+ -webkit-animation: featherlightLoader 1s infinite linear;
160
+ animation: featherlightLoader 1s infinite linear;
161
+ background: transparent;
162
+ border: 8px solid #909090;
163
+ border-right-color: #fff;
164
+ font-size: 10px;
165
+ }
166
+
167
+ .featherlight-loading .featherlight-content,
168
+ .featherlight-loading .featherlight-content:after {
169
+ -webkit-border-radius: 50%;
170
+ border-radius: 50%;
171
+ height: 10em;
172
+ width: 10em;
173
+ }
174
+
175
+ .featherlight-loading .featherlight-close,
176
+ .featherlight-loading .featherlight-inner {
177
+ display: none;
178
+ }
179
+
180
+
181
+ /* Gallery
182
+ --------------------------------------------- */
183
+
184
+ .featherlight-next,
185
+ .featherlight-previous {
186
+ background-repeat: no-repeat;
187
+ -webkit-background-size: 100% auto;
188
+ background-size: 100% auto;
189
+ cursor: pointer;
190
+ display: block;
191
+ height: 60px;
192
+ margin-top: -30px;
193
+ opacity: 0.4;
194
+ overflow: hidden;
195
+ position: fixed;
196
+ top: 50%;
197
+ text-indent: 100%;
198
+ -moz-user-select: none;
199
+ -ms-user-select: none;
200
+ -webkit-user-select: none;
201
+ user-select: none;
202
+ white-space: nowrap;
203
+ width: 60px;
204
+ }
205
+
206
+ .featherlight-next span,
207
+ .featherlight-previous span {
208
+ display: none;
209
+ }
210
+
211
+ .featherlight-next:hover,
212
+ .featherlight-next:focus,
213
+ .featherlight-previous:hover,
214
+ .featherlight-previous:focus {
215
+ opacity: 1;
216
+ }
217
+ .featherlight-next {
218
+ background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%09%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M8.59%2016.59L13.17%2012%208.59%207.41%2010%206l6%206-6%206-1.41-1.41z%22/%3E%0A%3C/svg%3E");
219
+ background-position: 0 0;
220
+ right: 10px;
221
+ }
222
+ .featherlight-previous {
223
+ background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%09%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M15.41%207.41L10.83%2012l4.58%204.59L14%2018l-6-6%206-6%201.41%201.41z%22/%3E%0A%3C/svg%3E");
224
+ background-position: -5px 0;
225
+ left: 10px;
226
+ }
227
+
228
+ .featherlight-loading .featherlight-previous,
229
+ .featherlight-loading .featherlight-next {
230
+ display: none;
231
+ }
css/wp-featherlight-rtl.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .featherlight{background:0 0;cursor:-webkit-zoom-out;cursor:-moz-zoom-out;cursor:zoom-out;display:none;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;position:fixed;top:0;left:0;bottom:0;right:0;text-align:center;white-space:nowrap;z-index:2147483647}.featherlight *{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.featherlight:last-of-type{background:rgba(0,0,0,.9)}.featherlight:before{content:"";display:inline-block;height:100%;margin-left:-.25em;vertical-align:middle}.featherlight .featherlight-content{background:#fff;border:0;cursor:auto;display:inline-block;max-height:80%;max-width:90%;min-width:inherit;overflow:visible;padding:0;position:relative;text-align:right;vertical-align:middle;white-space:normal}@media screen and (min-width:980px){.featherlight .featherlight-content{max-height:90%}}.featherlight .featherlight-inner{display:block}.featherlight .featherlight-close-icon{background:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%09%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M21%204.41L19.59%203%2012%2010.59%204.41%203%203%204.41%2010.59%2012%203%2019.59%204.41%2021%2012%2013.41%2019.59%2021%2021%2019.59%2013.41%2012%2021%204.41z%22/%3E%0A%3C/svg%3E) center no-repeat;-webkit-background-size:100% auto;background-size:100% auto;cursor:pointer;display:block;height:30px;overflow:hidden;position:fixed;top:25px;left:25px;text-align:center;text-indent:100%;white-space:nowrap;width:30px;z-index:9999}.featherlight .featherlight-image{max-width:100%}.featherlight iframe{border:0}[data-featherlight]{cursor:-webkit-zoom-in;cursor:-moz-zoom-in;cursor:zoom-in}.featherlight-iframe .featherlight-content{border-bottom:0;padding:0}.featherlight-content .caption{color:#fff;font-size:16px;font-weight:lighter;max-width:100%;overflow:hidden;position:absolute;text-align:right;text-overflow:ellipsis;white-space:nowrap}.featherlight-content .caption:focus,.featherlight-content .caption:hover{overflow:visible;white-space:normal}@-webkit-keyframes featherlightLoader{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(-360deg);transform:rotate(-360deg)}}@keyframes featherlightLoader{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(-360deg);transform:rotate(-360deg)}}.featherlight-loading .featherlight-content{-webkit-animation:featherlightLoader 1s infinite linear;animation:featherlightLoader 1s infinite linear;background:0 0;border:8px solid #909090;border-right-color:#fff;font-size:10px}.featherlight-loading .featherlight-content,.featherlight-loading .featherlight-content:after{-webkit-border-radius:50%;border-radius:50%;height:10em;width:10em}.featherlight-loading .featherlight-close,.featherlight-loading .featherlight-inner{display:none}.featherlight-next,.featherlight-previous{background-repeat:no-repeat;-webkit-background-size:100% auto;background-size:100% auto;cursor:pointer;display:block;height:60px;margin-top:-30px;opacity:.4;overflow:hidden;position:fixed;top:50%;text-indent:100%;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;user-select:none;white-space:nowrap;width:60px}.featherlight-loading .featherlight-next,.featherlight-loading .featherlight-previous,.featherlight-next span,.featherlight-previous span{display:none}.featherlight-next:focus,.featherlight-next:hover,.featherlight-previous:focus,.featherlight-previous:hover{opacity:1}.featherlight-next{background-image:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%09%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M8.59%2016.59L13.17%2012%208.59%207.41%2010%206l6%206-6%206-1.41-1.41z%22/%3E%0A%3C/svg%3E);background-position:0 0;right:10px}.featherlight-previous{background-image:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%09%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M15.41%207.41L10.83%2012l4.58%204.59L14%2018l-6-6%206-6%201.41%201.41z%22/%3E%0A%3C/svg%3E);background-position:-5px 0;left:10px}
css/wp-featherlight.css CHANGED
@@ -1,45 +1,21 @@
1
- /**
2
- * Featherlight Animations
3
- * Version 0.2.0
4
- *
5
- * Copyright 2015, WP Site Care
6
- * MIT Licensed.
7
  */
8
- @-webkit-keyframes featherlightLoader {
9
- 0% {
10
- -webkit-transform: rotate(0deg);
11
- transform: rotate(0deg);
12
- }
13
 
14
- 100% {
15
- -webkit-transform: rotate(360deg);
16
- transform: rotate(360deg);
17
- }
18
- }
19
 
20
- @keyframes featherlightLoader {
21
- 0% {
22
- -webkit-transform: rotate(0deg);
23
- transform: rotate(0deg);
24
- }
25
-
26
- 100% {
27
- -webkit-transform: rotate(360deg);
28
- transform: rotate(360deg);
29
- }
30
- }
31
 
32
- /**
33
- * Featherlight - ultra slim jQuery lightbox
34
- * Version 1.2.3 - http://noelboss.github.io/featherlight/
35
- *
36
- * Copyright 2015, Noel Raoul Bossart (http://www.noelboss.com)
37
- * MIT Licensed.
38
- */
39
  .featherlight {
40
  background: transparent;
41
- cursor: pointer;
 
 
42
  display: none;
 
43
  position: fixed;
44
  top: 0;
45
  right: 0;
@@ -57,7 +33,7 @@
57
  }
58
 
59
  .featherlight:last-of-type {
60
- background: rgba(0, 0, 0, 0.8);
61
  }
62
 
63
  .featherlight:before {
@@ -73,10 +49,10 @@
73
  border: 0;
74
  cursor: auto;
75
  display: inline-block;
76
- max-height: 95%;
77
  max-width: 90%;
78
  min-width: inherit;
79
- overflow: auto;
80
  padding: 0;
81
  position: relative;
82
  text-align: left;
@@ -84,48 +60,101 @@
84
  white-space: normal;
85
  }
86
 
 
 
 
 
 
 
87
  .featherlight .featherlight-inner {
88
  display: block;
89
  }
90
 
91
  .featherlight .featherlight-close-icon {
92
- background: rgba(255, 255, 255, 0.3);
93
- color: #000;
 
 
 
94
  cursor: pointer;
95
- font: Arial, sans-serif;
96
- line-height: 25px;
97
- position: absolute;
98
- top: 0;
99
- right: 0;
 
100
  text-align: center;
101
- width: 20px;
 
 
102
  z-index: 9999;
103
  }
104
 
105
  .featherlight .featherlight-image {
106
- border: 20px solid #fff;
107
  max-width: 100%;
108
  }
109
 
110
- @media only screen and (max-width: 1024px) {
111
- .featherlight .featherlight-image {
112
- border: 10px solid #fff;
113
- }
114
- }
115
-
116
  .featherlight iframe {
117
  border: 0;
118
  }
119
 
 
 
 
 
 
 
120
  .featherlight-iframe .featherlight-content {
121
  border-bottom: 0;
122
  padding: 0;
123
  }
124
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
 
126
  /* Animated Loader
127
  --------------------------------------------- */
128
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  .featherlight-loading .featherlight-content {
130
  -webkit-animation: featherlightLoader 1s infinite linear;
131
  animation: featherlightLoader 1s infinite linear;
@@ -148,102 +177,56 @@
148
  display: none;
149
  }
150
 
151
- /**
152
- * Featherlight Gallery - an extension for the ultra slim jQuery lightbox
153
- * Version 1.2.3 - http://noelboss.github.io/featherlight/
154
- *
155
- * Copyright 2015, Noel Raoul Bossart (http://www.noelboss.com)
156
- * MIT Licensed.
157
- */
158
  .featherlight-next,
159
  .featherlight-previous {
160
- background: transparent;
 
 
161
  cursor: pointer;
162
  display: block;
163
- position: absolute;
164
- top: 20px;
165
- right: 20px;
166
- bottom: 0;
167
- left: 80%;
 
 
168
  -moz-user-select: none;
169
  -ms-user-select: none;
170
  -webkit-user-select: none;
171
  user-select: none;
 
 
172
  }
173
 
174
- @media only screen and (max-width: 1024px) {
175
- .featherlight-next,
176
- .featherlight-previous {
177
- top: 10px;
178
- right: 10px;
179
- left: 85%;
180
- }
181
  }
182
 
183
  .featherlight-next:hover,
184
  .featherlight-next:focus,
185
  .featherlight-previous:hover,
186
  .featherlight-previous:focus {
187
- background: rgba(255, 255, 255, 0.25);
188
- }
189
-
190
- @media only screen and (max-width: 1024px) {
191
- .featherlight-next:hover,
192
- .featherlight-next:focus,
193
- .featherlight-previous:hover,
194
- .featherlight-previous:focus {
195
- background: none;
196
- }
197
- }
198
-
199
- .featherlight-next:hover span,
200
- .featherlight-next:focus span,
201
- .featherlight-previous:hover span,
202
- .featherlight-previous:focus span {
203
- display: inline-block;
204
- }
205
-
206
- .featherlight-next span,
207
- .featherlight-previous span {
208
- color: #fff;
209
- display: none;
210
- font-size: 80px;
211
- font-style: normal;
212
- font-weight: normal;
213
- line-height: 80px;
214
- margin-top: -40px;
215
- position: absolute;
216
- top: 50%;
217
- left: 5%;
218
- text-align: center;
219
- text-shadow: 0 0 5px #fff;
220
- width: 82%;
221
  }
222
 
223
- @media only screen and (max-width: 1024px) {
224
- .featherlight-next span,
225
- .featherlight-previous span {
226
- display: block;
227
- font-size: 40px;
228
- margin-top: -30px;
229
- }
230
  }
231
 
 
232
  .featherlight-previous {
233
- right: 80%;
234
- left: 20px;
235
- }
236
-
237
- @media only screen and (max-width: 1024px) {
238
- .featherlight-previous {
239
- right: 85%;
240
- left: 10px;
241
- }
242
- }
243
-
244
- .featherlight-next span {
245
- right: 5%;
246
- left: auto;
247
  }
248
 
249
  .featherlight-loading .featherlight-previous,
1
+ /**!
2
+ * Plugin Name: WP Featherlight
3
+ * Version: 0.3.0
4
+ * Author: WP Site Care
5
+ * License: GPL-2.0+
 
6
  */
 
 
 
 
 
7
 
 
 
 
 
 
8
 
9
+ /* Base Styles
10
+ --------------------------------------------- */
 
 
 
 
 
 
 
 
 
11
 
 
 
 
 
 
 
 
12
  .featherlight {
13
  background: transparent;
14
+ cursor: -webkit-zoom-out;
15
+ cursor: -moz-zoom-out;
16
+ cursor: zoom-out;
17
  display: none;
18
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
19
  position: fixed;
20
  top: 0;
21
  right: 0;
33
  }
34
 
35
  .featherlight:last-of-type {
36
+ background: rgba(0, 0, 0, 0.9);
37
  }
38
 
39
  .featherlight:before {
49
  border: 0;
50
  cursor: auto;
51
  display: inline-block;
52
+ max-height: 80%;
53
  max-width: 90%;
54
  min-width: inherit;
55
+ overflow: visible;
56
  padding: 0;
57
  position: relative;
58
  text-align: left;
60
  white-space: normal;
61
  }
62
 
63
+ @media screen and (min-width: 980px) {
64
+ .featherlight .featherlight-content {
65
+ max-height: 90%;
66
+ }
67
+ }
68
+
69
  .featherlight .featherlight-inner {
70
  display: block;
71
  }
72
 
73
  .featherlight .featherlight-close-icon {
74
+ background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%09%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M21%204.41L19.59%203%2012%2010.59%204.41%203%203%204.41%2010.59%2012%203%2019.59%204.41%2021%2012%2013.41%2019.59%2021%2021%2019.59%2013.41%2012%2021%204.41z%22/%3E%0A%3C/svg%3E");
75
+ background-position: center;
76
+ background-repeat: no-repeat;
77
+ -webkit-background-size: 100% auto;
78
+ background-size: 100% auto;
79
  cursor: pointer;
80
+ display: block;
81
+ height: 30px;
82
+ overflow: hidden;
83
+ position: fixed;
84
+ top: 25px;
85
+ right: 25px;
86
  text-align: center;
87
+ text-indent: 100%;
88
+ white-space: nowrap;
89
+ width: 30px;
90
  z-index: 9999;
91
  }
92
 
93
  .featherlight .featherlight-image {
 
94
  max-width: 100%;
95
  }
96
 
 
 
 
 
 
 
97
  .featherlight iframe {
98
  border: 0;
99
  }
100
 
101
+ [data-featherlight] {
102
+ cursor: -webkit-zoom-in;
103
+ cursor: -moz-zoom-in;
104
+ cursor: zoom-in;
105
+ }
106
+
107
  .featherlight-iframe .featherlight-content {
108
  border-bottom: 0;
109
  padding: 0;
110
  }
111
 
112
+ .featherlight-content .caption {
113
+ color: #fff;
114
+ font-size: 16px;
115
+ font-weight: lighter;
116
+ max-width: 100%;
117
+ overflow: hidden;
118
+ position: absolute;
119
+ text-align: left;
120
+ text-overflow: ellipsis;
121
+ white-space: nowrap;
122
+ }
123
+
124
+ .featherlight-content .caption:hover,
125
+ .featherlight-content .caption:focus {
126
+ overflow: visible;
127
+ white-space: normal;
128
+ }
129
+
130
 
131
  /* Animated Loader
132
  --------------------------------------------- */
133
 
134
+ @-webkit-keyframes featherlightLoader {
135
+ 0% {
136
+ -webkit-transform: rotate(0deg);
137
+ transform: rotate(0deg);
138
+ }
139
+
140
+ 100% {
141
+ -webkit-transform: rotate(360deg);
142
+ transform: rotate(360deg);
143
+ }
144
+ }
145
+
146
+ @keyframes featherlightLoader {
147
+ 0% {
148
+ -webkit-transform: rotate(0deg);
149
+ transform: rotate(0deg);
150
+ }
151
+
152
+ 100% {
153
+ -webkit-transform: rotate(360deg);
154
+ transform: rotate(360deg);
155
+ }
156
+ }
157
+
158
  .featherlight-loading .featherlight-content {
159
  -webkit-animation: featherlightLoader 1s infinite linear;
160
  animation: featherlightLoader 1s infinite linear;
177
  display: none;
178
  }
179
 
180
+
181
+ /* Gallery
182
+ --------------------------------------------- */
183
+
 
 
 
184
  .featherlight-next,
185
  .featherlight-previous {
186
+ background-repeat: no-repeat;
187
+ -webkit-background-size: 100% auto;
188
+ background-size: 100% auto;
189
  cursor: pointer;
190
  display: block;
191
+ height: 60px;
192
+ margin-top: -30px;
193
+ opacity: 0.4;
194
+ overflow: hidden;
195
+ position: fixed;
196
+ top: 50%;
197
+ text-indent: 100%;
198
  -moz-user-select: none;
199
  -ms-user-select: none;
200
  -webkit-user-select: none;
201
  user-select: none;
202
+ white-space: nowrap;
203
+ width: 60px;
204
  }
205
 
206
+ .featherlight-next span,
207
+ .featherlight-previous span {
208
+ display: none;
 
 
 
 
209
  }
210
 
211
  .featherlight-next:hover,
212
  .featherlight-next:focus,
213
  .featherlight-previous:hover,
214
  .featherlight-previous:focus {
215
+ opacity: 1;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
216
  }
217
 
218
+ /* rtl:ignore */
219
+ .featherlight-next {
220
+ background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%09%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M8.59%2016.59L13.17%2012%208.59%207.41%2010%206l6%206-6%206-1.41-1.41z%22/%3E%0A%3C/svg%3E");
221
+ background-position: 0 0;
222
+ right: 10px;
 
 
223
  }
224
 
225
+ /* rtl:ignore */
226
  .featherlight-previous {
227
+ background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%09%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M15.41%207.41L10.83%2012l4.58%204.59L14%2018l-6-6%206-6%201.41%201.41z%22/%3E%0A%3C/svg%3E");
228
+ background-position: -5px 0;
229
+ left: 10px;
 
 
 
 
 
 
 
 
 
 
 
230
  }
231
 
232
  .featherlight-loading .featherlight-previous,
css/wp-featherlight.min.css CHANGED
@@ -1 +1 @@
1
- @-webkit-keyframes featherlightLoader{0{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes featherlightLoader{0{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.featherlight{background:transparent;cursor:pointer;display:none;position:fixed;top:0;right:0;bottom:0;left:0;text-align:center;white-space:nowrap;z-index:2147483647}.featherlight *{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.featherlight:last-of-type{background:rgba(0,0,0,0.8)}.featherlight:before{content:"";display:inline-block;height:100%;margin-right:-0.25em;vertical-align:middle}.featherlight .featherlight-content{background:#fff;border:0;cursor:auto;display:inline-block;max-height:95%;max-width:90%;min-width:inherit;overflow:auto;padding:0;position:relative;text-align:left;vertical-align:middle;white-space:normal}.featherlight .featherlight-inner{display:block}.featherlight .featherlight-close-icon{background:rgba(255,255,255,0.3);color:#000;cursor:pointer;font:Arial,sans-serif;line-height:25px;position:absolute;top:0;right:0;text-align:center;width:20px;z-index:9999}.featherlight .featherlight-image{border:20px solid #fff;max-width:100%}@media only screen and (max-width:1024px){.featherlight .featherlight-image{border:10px solid #fff}}.featherlight iframe{border:0}.featherlight-iframe .featherlight-content{border-bottom:0;padding:0}.featherlight-loading .featherlight-content{-webkit-animation:featherlightLoader 1s infinite linear;animation:featherlightLoader 1s infinite linear;background:transparent;border:8px solid #909090;border-left-color:#fff;font-size:10px}.featherlight-loading .featherlight-content,.featherlight-loading .featherlight-content:after{-webkit-border-radius:50%;border-radius:50%;height:10em;width:10em}.featherlight-loading .featherlight-close,.featherlight-loading .featherlight-inner{display:none}.featherlight-next,.featherlight-previous{background:transparent;cursor:pointer;display:block;position:absolute;top:20px;right:20px;bottom:0;left:80%;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;user-select:none}@media only screen and (max-width:1024px){.featherlight-next,.featherlight-previous{top:10px;right:10px;left:85%}}.featherlight-next:hover,.featherlight-next:focus,.featherlight-previous:hover,.featherlight-previous:focus{background:rgba(255,255,255,0.25)}@media only screen and (max-width:1024px){.featherlight-next:hover,.featherlight-next:focus,.featherlight-previous:hover,.featherlight-previous:focus{background:0}}.featherlight-next:hover span,.featherlight-next:focus span,.featherlight-previous:hover span,.featherlight-previous:focus span{display:inline-block}.featherlight-next span,.featherlight-previous span{color:#fff;display:none;font-size:80px;font-style:normal;font-weight:normal;line-height:80px;margin-top:-40px;position:absolute;top:50%;left:5%;text-align:center;text-shadow:0 0 5px #fff;width:82%}@media only screen and (max-width:1024px){.featherlight-next span,.featherlight-previous span{display:block;font-size:40px;margin-top:-30px}}.featherlight-previous{right:80%;left:20px}@media only screen and (max-width:1024px){.featherlight-previous{right:85%;left:10px}}.featherlight-next span{right:5%;left:auto}.featherlight-loading .featherlight-previous,.featherlight-loading .featherlight-next{display:none}
1
+ .featherlight{background:0 0;cursor:-webkit-zoom-out;cursor:-moz-zoom-out;cursor:zoom-out;display:none;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;position:fixed;top:0;right:0;bottom:0;left:0;text-align:center;white-space:nowrap;z-index:2147483647}.featherlight *{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.featherlight:last-of-type{background:rgba(0,0,0,.9)}.featherlight:before{content:"";display:inline-block;height:100%;margin-right:-.25em;vertical-align:middle}.featherlight .featherlight-content{background:#fff;border:0;cursor:auto;display:inline-block;max-height:80%;max-width:90%;min-width:inherit;overflow:visible;padding:0;position:relative;text-align:left;vertical-align:middle;white-space:normal}@media screen and (min-width:980px){.featherlight .featherlight-content{max-height:90%}}.featherlight .featherlight-inner{display:block}.featherlight .featherlight-close-icon{background:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%09%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M21%204.41L19.59%203%2012%2010.59%204.41%203%203%204.41%2010.59%2012%203%2019.59%204.41%2021%2012%2013.41%2019.59%2021%2021%2019.59%2013.41%2012%2021%204.41z%22/%3E%0A%3C/svg%3E) center no-repeat;-webkit-background-size:100% auto;background-size:100% auto;cursor:pointer;display:block;height:30px;overflow:hidden;position:fixed;top:25px;right:25px;text-align:center;text-indent:100%;white-space:nowrap;width:30px;z-index:9999}.featherlight .featherlight-image{max-width:100%}.featherlight iframe{border:0}[data-featherlight]{cursor:-webkit-zoom-in;cursor:-moz-zoom-in;cursor:zoom-in}.featherlight-iframe .featherlight-content{border-bottom:0;padding:0}.featherlight-content .caption{color:#fff;font-size:16px;font-weight:lighter;max-width:100%;overflow:hidden;position:absolute;text-align:left;text-overflow:ellipsis;white-space:nowrap}.featherlight-content .caption:focus,.featherlight-content .caption:hover{overflow:visible;white-space:normal}@-webkit-keyframes featherlightLoader{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes featherlightLoader{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.featherlight-loading .featherlight-content{-webkit-animation:featherlightLoader 1s infinite linear;animation:featherlightLoader 1s infinite linear;background:0 0;border:8px solid #909090;border-left-color:#fff;font-size:10px}.featherlight-loading .featherlight-content,.featherlight-loading .featherlight-content:after{-webkit-border-radius:50%;border-radius:50%;height:10em;width:10em}.featherlight-loading .featherlight-close,.featherlight-loading .featherlight-inner{display:none}.featherlight-next,.featherlight-previous{background-repeat:no-repeat;-webkit-background-size:100% auto;background-size:100% auto;cursor:pointer;display:block;height:60px;margin-top:-30px;opacity:.4;overflow:hidden;position:fixed;top:50%;text-indent:100%;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;user-select:none;white-space:nowrap;width:60px}.featherlight-loading .featherlight-next,.featherlight-loading .featherlight-previous,.featherlight-next span,.featherlight-previous span{display:none}.featherlight-next:focus,.featherlight-next:hover,.featherlight-previous:focus,.featherlight-previous:hover{opacity:1}.featherlight-next{background-image:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%09%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M8.59%2016.59L13.17%2012%208.59%207.41%2010%206l6%206-6%206-1.41-1.41z%22/%3E%0A%3C/svg%3E);background-position:0 0;right:10px}.featherlight-previous{background-image:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%09%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M15.41%207.41L10.83%2012l4.58%204.59L14%2018l-6-6%206-6%201.41%201.41z%22/%3E%0A%3C/svg%3E);background-position:-5px 0;left:10px}
includes/class-i18n.php ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Load translations for the plugin.
4
+ *
5
+ * @package WPFeatherlight\Internationalization
6
+ * @author Robert Neu
7
+ * @copyright Copyright (c) 2015, WP Site Care
8
+ * @license GPL-2.0+
9
+ * @since 0.3.0
10
+ */
11
+
12
+ // Prevent direct access.
13
+ defined( 'ABSPATH' ) || exit;
14
+
15
+ /**
16
+ * Based on t5-libraries' language loader by Thomas Scholz
17
+ *
18
+ * @link https://github.com/toscho/t5-libraries/blob/master/Core/I18n/Language_Loader.php
19
+ */
20
+ class WP_Featherlight_Language_Loader {
21
+
22
+ /**
23
+ * Path to the root plugin file.
24
+ *
25
+ * @var string
26
+ */
27
+ private $plugin_file;
28
+
29
+ /**
30
+ * Name of the text domain.
31
+ *
32
+ * @var string
33
+ */
34
+ private $text_domain;
35
+
36
+ /**
37
+ * Constructor.
38
+ *
39
+ * @param string $text_domain Name of the text domain.
40
+ * @param string $language_dir Path to language files.
41
+ */
42
+ public function __construct( $text_domain, $plugin_file ) {
43
+ $this->text_domain = $text_domain;
44
+ $this->plugin_file = $plugin_file;
45
+ }
46
+
47
+ /**
48
+ * Get the class running!
49
+ *
50
+ * @since 0.3.0
51
+ * @access public
52
+ * @return void
53
+ */
54
+ public function run() {
55
+ $this->wp_hooks();
56
+ }
57
+
58
+ /**
59
+ * Hook into WordPress.
60
+ *
61
+ * @since 0.3.0
62
+ * @access protected
63
+ * @return void
64
+ */
65
+ protected function wp_hooks() {
66
+ add_action( 'admin_head-plugins.php', array( $this, 'load' ) );
67
+ }
68
+
69
+ /**
70
+ * Loads translation file.
71
+ *
72
+ * @since 0.3.0
73
+ * @access public
74
+ * @return bool true when the file was found, false otherwise.
75
+ */
76
+ public function load() {
77
+ return load_plugin_textdomain(
78
+ $this->text_domain,
79
+ false,
80
+ dirname( plugin_basename( $this->plugin_file ) ) . '/languages'
81
+ );
82
+ }
83
+
84
+ /**
85
+ * Remove translations from memory.
86
+ *
87
+ * @since 0.3.0
88
+ * @access public
89
+ * @return bool true if the text domain was loaded, false if it was not.
90
+ */
91
+ public function unload() {
92
+ return unload_textdomain( $this->text_domain );
93
+ }
94
+
95
+ /**
96
+ * Whether or not the language has been loaded already.
97
+ *
98
+ * @since 0.3.0
99
+ * @access public
100
+ * @return bool
101
+ */
102
+ public function is_loaded() {
103
+ return is_textdomain_loaded( $this->text_domain );
104
+ }
105
+
106
+ }
includes/class-plugin.php ADDED
@@ -0,0 +1,183 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WP Featherlight main plugin class.
4
+ *
5
+ * @package WPFeatherlight
6
+ * @author Robert Neu
7
+ * @copyright Copyright (c) 2015, WP Site Care
8
+ * @license GPL-2.0+
9
+ * @since 0.1.0
10
+ */
11
+
12
+ // Prevent direct access.
13
+ defined( 'ABSPATH' ) || exit;
14
+
15
+ /**
16
+ * Main plugin class.
17
+ */
18
+ class WP_Featherlight {
19
+
20
+ /**
21
+ * Property for storing the plugin version.
22
+ *
23
+ * @since 0.3.0
24
+ * @var string
25
+ */
26
+ const VERSION = '0.3.0';
27
+
28
+ /**
29
+ * Property for storing a reference to the main plugin file.
30
+ *
31
+ * @since 0.3.0
32
+ * @var string
33
+ */
34
+ private $file;
35
+
36
+ /**
37
+ * Property for storing the plugin's directory path.
38
+ *
39
+ * @since 0.3.0
40
+ * @var string
41
+ */
42
+ private $dir;
43
+
44
+ /**
45
+ * Property for storing the plugin directory URL.
46
+ *
47
+ * @since 0.3.0
48
+ * @var string
49
+ */
50
+ private $url;
51
+
52
+ /**
53
+ * An empty placeholder for referencing the scripts class.
54
+ *
55
+ * @since 0.1.0
56
+ * @var object
57
+ */
58
+ public $scripts;
59
+
60
+ /**
61
+ * An empty placeholder for referencing the i18n class.
62
+ *
63
+ * @since 0.1.0
64
+ * @var object
65
+ */
66
+ public $i18n;
67
+
68
+ /**
69
+ * An empty placeholder for referencing the meta class.
70
+ *
71
+ * @since 0.1.0
72
+ * @var object
73
+ */
74
+ public $meta;
75
+
76
+ public function __construct( $args ) {
77
+ $this->file = $args['file'];
78
+ $this->dir = plugin_dir_path( $this->file );
79
+ $this->url = plugin_dir_url( $this->file );
80
+ }
81
+
82
+ /**
83
+ * Method to initialize the plugin.
84
+ *
85
+ * @since 0.1.0
86
+ * @return void
87
+ */
88
+ public function run() {
89
+ $this->includes();
90
+ $this->instantiate();
91
+ }
92
+
93
+ /**
94
+ * Retrieve the plugin version number.
95
+ *
96
+ * @since 0.3.0
97
+ * @access public
98
+ * @return string
99
+ */
100
+ public function get_version() {
101
+ return self::VERSION;
102
+ }
103
+
104
+ /**
105
+ * Retrieve a trailing slashed path to the plugin directory.
106
+ *
107
+ * @since 0.3.0
108
+ * @access public
109
+ * @return string
110
+ */
111
+ public function get_file() {
112
+ return $this->file;
113
+ }
114
+
115
+ /**
116
+ * Retrieve a trailing slashed path to the plugin directory.
117
+ *
118
+ * @since 0.3.0
119
+ * @access public
120
+ * @return string
121
+ */
122
+ public function get_dir() {
123
+ return $this->dir;
124
+ }
125
+
126
+ /**
127
+ * Retrieve a trailing slashed URL to the plugin directory.
128
+ *
129
+ * @since 0.3.0
130
+ * @access public
131
+ * @return string
132
+ */
133
+ public function get_url() {
134
+ return $this->url;
135
+ }
136
+
137
+ /**
138
+ * Require all plugin files.
139
+ *
140
+ * @since 0.1.0
141
+ * @access private
142
+ * @return void
143
+ */
144
+ private function includes() {
145
+ require_once $this->dir . 'includes/class-scripts.php';
146
+ require_once $this->dir . 'includes/class-i18n.php';
147
+ if ( is_admin() ) {
148
+ require_once $this->dir . 'admin/class-meta.php';
149
+ }
150
+ }
151
+
152
+ /**
153
+ * Load all required files and get all of our classes running.
154
+ *
155
+ * @since 0.1.0
156
+ * @access public
157
+ * @return void
158
+ */
159
+ private function instantiate() {
160
+ $this->scripts = new WP_Featherlight_Scripts;
161
+ $this->scripts->run();
162
+ if ( is_admin() ) {
163
+ $this->i18n = new WP_Featherlight_Language_Loader( 'wp-featherlight', $this->file );
164
+ $this->meta = new WP_Featherlight_Admin_Meta;
165
+ $this->i18n->run();
166
+ $this->meta->run();
167
+ }
168
+ }
169
+
170
+ /**
171
+ * Runs on plugin activation to set a default admin content label for all
172
+ * existing posts using the post title.
173
+ *
174
+ * @since 0.1.0
175
+ * @access public
176
+ * @global $wpdb
177
+ * @return void
178
+ */
179
+ public function activate() {
180
+ // Nothing yet.
181
+ }
182
+
183
+ }
includes/{classes/scripts.php → class-scripts.php} RENAMED
@@ -2,9 +2,9 @@
2
  /**
3
  * Methods used for filtering and displaying WP Featherlight images.
4
  *
5
- * @package WPFeatherlight
6
  * @author Robert Neu
7
- * @copyright Copyright (c) 2015, Robert Neu
8
  * @license GPL-2.0+
9
  * @since 0.1.0
10
  */
@@ -16,6 +16,16 @@ class WP_Featherlight_Scripts {
16
 
17
  protected $suffix;
18
 
 
 
 
 
 
 
 
 
 
 
19
  /**
20
  * Get the class running!
21
  *
@@ -24,21 +34,21 @@ class WP_Featherlight_Scripts {
24
  * @return void
25
  */
26
  public function run() {
27
- $this->suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
28
- self::wp_hooks();
29
  }
30
 
31
  /**
32
  * Hook into WordPress.
33
  *
34
  * @since 0.1.0
35
- * @access public
36
  * @return void
37
  */
38
  protected function wp_hooks() {
39
- add_action( 'wp_enqueue_scripts', array( $this, 'load_css' ), 20 );
40
- add_action( 'wp_enqueue_scripts', array( $this, 'load_js' ), 20 );
41
- add_action( 'wp_enqueue_scripts', array( $this, 'maybe_disable' ) );
 
42
  }
43
 
44
  /**
@@ -57,10 +67,12 @@ class WP_Featherlight_Scripts {
57
  }
58
  wp_enqueue_style(
59
  'wp-featherlight',
60
- WP_FEATHERLIGHT_URL . "css/wp-featherlight{$this->suffix}.css",
61
  array(),
62
- WP_FEATHERLIGHT_VERSION
63
  );
 
 
64
  }
65
 
66
  /**
@@ -119,9 +131,9 @@ class WP_Featherlight_Scripts {
119
  }
120
  wp_enqueue_script(
121
  'wp-featherlight',
122
- WP_FEATHERLIGHT_URL . "js/dist/wpFeatherlight.pkgd{$this->suffix}.js",
123
  array( 'jquery' ),
124
- WP_FEATHERLIGHT_VERSION,
125
  true
126
  );
127
  }
@@ -129,8 +141,6 @@ class WP_Featherlight_Scripts {
129
  /**
130
  * Load all of our JS files individually to for maximum compatibility.
131
  *
132
- * @todo Add logic to use minified versions of scripts when not debugging.
133
- *
134
  * @since 0.1.0
135
  * @access public
136
  * @return void
@@ -139,33 +149,34 @@ class WP_Featherlight_Scripts {
139
  if ( $this->enable_packed_js() ) {
140
  return;
141
  }
142
- $url = WP_FEATHERLIGHT_URL . 'js/src/';
 
143
  wp_enqueue_script(
144
  'jquery-detect-swipe',
145
- $url . 'vendor/jquery.detect_swipe.js',
146
  array( 'jquery' ),
147
- '2.0.4',
148
  true
149
  );
150
  wp_enqueue_script(
151
  'featherlight',
152
- $url . 'vendor/featherlight.js',
153
  array( 'jquery-detect-swipe' ),
154
- '1.2.3',
155
  true
156
  );
157
  wp_enqueue_script(
158
  'featherlight-gallery',
159
- $url . 'vendor/featherlight.gallery.js',
160
  array( 'featherlight' ),
161
- '1.2.3',
162
  true
163
  );
164
  wp_enqueue_script(
165
  'wp-featherlight',
166
- $url . 'wpFeatherlight.js',
167
  array( 'featherlight-gallery' ),
168
- WP_FEATHERLIGHT_VERSION,
169
  true
170
  );
171
  }
@@ -185,4 +196,20 @@ class WP_Featherlight_Scripts {
185
  }
186
  }
187
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
188
  }
2
  /**
3
  * Methods used for filtering and displaying WP Featherlight images.
4
  *
5
+ * @package WPFeatherlight\Scripts
6
  * @author Robert Neu
7
+ * @copyright Copyright (c) 2015, WP Site Care
8
  * @license GPL-2.0+
9
  * @since 0.1.0
10
  */
16
 
17
  protected $suffix;
18
 
19
+ protected $url;
20
+
21
+ protected $version;
22
+
23
+ public function __construct() {
24
+ $this->suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
25
+ $this->url = wp_featherlight()->get_url();
26
+ $this->version = wp_featherlight()->get_version();
27
+ }
28
+
29
  /**
30
  * Get the class running!
31
  *
34
  * @return void
35
  */
36
  public function run() {
37
+ $this->wp_hooks();
 
38
  }
39
 
40
  /**
41
  * Hook into WordPress.
42
  *
43
  * @since 0.1.0
44
+ * @access protected
45
  * @return void
46
  */
47
  protected function wp_hooks() {
48
+ add_action( 'wp_enqueue_scripts', array( $this, 'load_css' ), 20 );
49
+ add_action( 'wp_enqueue_scripts', array( $this, 'load_js' ), 20 );
50
+ add_action( 'wp_enqueue_scripts', array( $this, 'maybe_disable' ), 10 );
51
+ add_action( 'body_class', array( $this, 'script_helpers' ), 10 );
52
  }
53
 
54
  /**
67
  }
68
  wp_enqueue_style(
69
  'wp-featherlight',
70
+ "{$this->url}css/wp-featherlight{$this->suffix}.css",
71
  array(),
72
+ $this->version
73
  );
74
+ wp_style_add_data( 'wp-featherlight', 'rtl', 'replace' );
75
+ wp_style_add_data( 'wp-featherlight', 'suffix', $this->suffix );
76
  }
77
 
78
  /**
131
  }
132
  wp_enqueue_script(
133
  'wp-featherlight',
134
+ "{$this->url}js/wpFeatherlight.pkgd{$this->suffix}.js",
135
  array( 'jquery' ),
136
+ $this->version,
137
  true
138
  );
139
  }
141
  /**
142
  * Load all of our JS files individually to for maximum compatibility.
143
  *
 
 
144
  * @since 0.1.0
145
  * @access public
146
  * @return void
149
  if ( $this->enable_packed_js() ) {
150
  return;
151
  }
152
+ $suffix = $this->suffix;
153
+ $url = "{$this->url}js/src/";
154
  wp_enqueue_script(
155
  'jquery-detect-swipe',
156
+ "{$url}vendor/jquery.detect_swipe{$suffix}.js",
157
  array( 'jquery' ),
158
+ '2.1.1',
159
  true
160
  );
161
  wp_enqueue_script(
162
  'featherlight',
163
+ "{$url}vendor/featherlight{$suffix}.js",
164
  array( 'jquery-detect-swipe' ),
165
+ '1.3.2',
166
  true
167
  );
168
  wp_enqueue_script(
169
  'featherlight-gallery',
170
+ "{$url}vendor/featherlight.gallery{$suffix}.js",
171
  array( 'featherlight' ),
172
+ '1.3.2',
173
  true
174
  );
175
  wp_enqueue_script(
176
  'wp-featherlight',
177
+ "{$url}wpFeatherlight{$suffix}.js",
178
  array( 'featherlight-gallery' ),
179
+ $this->version,
180
  true
181
  );
182
  }
196
  }
197
  }
198
 
199
+ /**
200
+ * Add custom body classes to help our script enable and disable features
201
+ * without creating true plugin database options.
202
+ *
203
+ * @since 0.3.0
204
+ * @access public
205
+ * @param array $classes the existing body classes.
206
+ * @return array $classes the amended body classes.
207
+ */
208
+ public function script_helpers( $classes ) {
209
+ if ( apply_filters( 'wp_featherlight_captions', true ) ) {
210
+ $classes[] = 'wp-featherlight-captions';
211
+ }
212
+ return $classes;
213
+ }
214
+
215
  }
includes/classes/admin/meta.php DELETED
@@ -1,118 +0,0 @@
1
- <?php
2
- /**
3
- * Methods used for adding and saving meta data for WP Featherlight.
4
- *
5
- * @package WPFeatherlight
6
- * @author Robert Neu
7
- * @copyright Copyright (c) 2015, Robert Neu
8
- * @license GPL-2.0+
9
- * @since 0.1.0
10
- */
11
-
12
- // Prevent direct access.
13
- defined( 'ABSPATH' ) || exit;
14
-
15
- class WP_Featherlight_Admin_Meta {
16
-
17
- /**
18
- * Get the class running!
19
- *
20
- * @since 0.1.0
21
- * @access public
22
- * @return void
23
- */
24
- public function run() {
25
- self::wp_hooks();
26
- }
27
-
28
- /**
29
- * Hook into WordPress.
30
- *
31
- * @since 0.1.0
32
- * @access protected
33
- * @return void
34
- */
35
- protected function wp_hooks() {
36
- add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );
37
- add_action( 'save_post', array( $this, 'save_meta_boxes' ) );
38
- }
39
-
40
- /**
41
- * Helper function to determine if an automated task which should prevent
42
- * saving meta box data is running.
43
- *
44
- * @since 0.1.0
45
- * @access protected
46
- * @return void
47
- */
48
- protected function stop_save() {
49
- return defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ||
50
- defined( 'DOING_AJAX' ) && DOING_AJAX ||
51
- defined( 'DOING_CRON' ) && DOING_CRON;
52
- }
53
-
54
- /**
55
- * Adds a simple metabox to disable the after entry widget areas.
56
- *
57
- * @since 1.0.0
58
- * @access public
59
- * @return void
60
- */
61
- public function add_meta_boxes( $post_type ) {
62
- add_meta_box(
63
- 'wp_featherlight_options',
64
- __( 'WP Featherlight Options', 'wp-featherlight' ),
65
- array( $this, 'options_callback' ),
66
- null,
67
- 'side'
68
- );
69
- }
70
-
71
- /**
72
- * Outputs the content of our disable after-entry metabox.
73
- *
74
- * @since 1.0.0
75
- * @access public
76
- * @return void
77
- */
78
- public function options_callback( $post ) {
79
- $type = get_post_type_object( $post->post_type );
80
- $name = $type->labels->singular_name;
81
- $disable = get_post_meta( $post->ID, 'wp_featherlight_disable', true );
82
- $checked = '';
83
- if ( ! empty( $disable ) ) {
84
- $checked = $disable;
85
- }
86
- require_once WP_FEATHERLIGHT_DIR . 'templates/admin/metabox-sidebar.php';
87
- }
88
-
89
- /**
90
- * Callback function for saving our testimonial details meta box data.
91
- * Handles data validation and sanitization for our content label.
92
- *
93
- * @since 0.1.0
94
- * @access public
95
- * @return void
96
- */
97
- public function save_meta_boxes( $post_id ) {
98
- // Bail if something is in progress.
99
- if ( $this->stop_save() ) {
100
- return;
101
- }
102
-
103
- $nonce = '';
104
- if ( isset( $_POST['wp_featherlight_nonce'] ) ) {
105
- $nonce = $_POST['wp_featherlight_nonce'];
106
- }
107
-
108
- // Bail if we can't verify the nonce.
109
- if ( ! wp_verify_nonce( $nonce, plugin_basename( WP_FEATHERLIGHT_FILE ) ) ) {
110
- return;
111
- }
112
-
113
- $disable = isset( $_POST['wp_featherlight_disable'] ) ? 'yes' : '';
114
-
115
- update_post_meta( $post_id, 'wp_featherlight_disable', $disable );
116
- }
117
-
118
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/constants.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Define constants to preserve backwards compatibility with older versions.
4
+ *
5
+ * @package WPFeatherlight
6
+ * @author Robert Neu
7
+ * @copyright Copyright (c) 2015, WP Site Care
8
+ * @license GPL-2.0+
9
+ * @since 0.3.0
10
+ */
11
+
12
+ // Prevent direct access.
13
+ defined( 'ABSPATH' ) || exit;
14
+
15
+ define( 'WP_FEATHERLIGHT_FILE', wp_featherlight()->get_file() );
16
+ define( 'WP_FEATHERLIGHT_VERSION', wp_featherlight()->get_version() );
17
+
18
+ if ( ! defined( 'WP_FEATHERLIGHT_DIR' ) ) {
19
+ define( 'WP_FEATHERLIGHT_DIR', wp_featherlight()->get_dir() );
20
+ }
21
+
22
+ if ( ! defined( 'WP_FEATHERLIGHT_URL' ) ) {
23
+ define( 'WP_FEATHERLIGHT_URL', wp_featherlight()->get_url() );
24
+ }
includes/plugin.php DELETED
@@ -1,106 +0,0 @@
1
- <?php
2
- /**
3
- * Enhanced User Profiles main plugin class.
4
- *
5
- * @package WPFeatherlight
6
- * @author Robert Neu
7
- * @copyright Copyright (c) 2015, Robert Neu
8
- * @license GPL-2.0+
9
- * @since 0.1.0
10
- */
11
-
12
- // Prevent direct access.
13
- defined( 'ABSPATH' ) || exit;
14
-
15
- /**
16
- * Main plugin class.
17
- */
18
- class WP_Featherlight {
19
-
20
- /**
21
- * An empty placeholder for referencing the scripts class.
22
- *
23
- * @since 0.1.0
24
- * @var object
25
- */
26
- public $scripts;
27
-
28
- /**
29
- * An empty placeholder for referencing the meta class.
30
- *
31
- * @since 0.1.0
32
- * @var object
33
- */
34
- public $meta;
35
-
36
- /**
37
- * Method to initialize the plugin.
38
- *
39
- * @since 0.1.0
40
- * @return void
41
- */
42
- public function run() {
43
- self::load_textdomain();
44
- self::includes();
45
- self::instantiate();
46
- }
47
-
48
- /**
49
- * Loads the plugin language files
50
- *
51
- * @since 0.1.0
52
- * @access public
53
- * @return void
54
- */
55
- public function load_textdomain() {
56
- load_plugin_textdomain(
57
- 'wp-featherlight',
58
- false,
59
- dirname( plugin_basename( WP_FEATHERLIGHT_FILE ) ) . '/languages'
60
- );
61
- }
62
-
63
- /**
64
- * Require all plugin files.
65
- *
66
- * @since 0.1.0
67
- * @access private
68
- * @return void
69
- */
70
- private function includes() {
71
- $includes_dir = WP_FEATHERLIGHT_DIR . 'includes/';
72
- require_once $includes_dir . 'classes/scripts.php';
73
- require_once $includes_dir . 'classes/admin/meta.php';
74
- }
75
-
76
- /**
77
- * Load all required files and get all of our classes running.
78
- *
79
- * @since 0.1.0
80
- * @access public
81
- * @return void
82
- */
83
- private function instantiate() {
84
- $this->scripts = new WP_Featherlight_Scripts;
85
- $this->scripts->run();
86
- if ( ! is_admin() ) {
87
- return;
88
- }
89
- $this->meta = new WP_Featherlight_Admin_Meta;
90
- $this->meta->run();
91
- }
92
-
93
- /**
94
- * Runs on plugin activation to set a default admin content label for all
95
- * existing posts using the post title.
96
- *
97
- * @since 0.1.0
98
- * @access public
99
- * @global $wpdb
100
- * @return void
101
- */
102
- public function activate() {
103
- // Nothing yet.
104
- }
105
-
106
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/autoload.php DELETED
@@ -1,7 +0,0 @@
1
- <?php
2
-
3
- // autoload.php @generated by Composer
4
-
5
- require_once __DIR__ . '/composer' . '/autoload_real.php';
6
-
7
- return ComposerAutoloaderInit3bb75807e81292dee13fe8a3526e0777::getLoader();
 
 
 
 
 
 
 
includes/vendor/composer/ClassLoader.php DELETED
@@ -1,413 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Composer.
5
- *
6
- * (c) Nils Adermann <naderman@naderman.de>
7
- * Jordi Boggiano <j.boggiano@seld.be>
8
- *
9
- * For the full copyright and license information, please view the LICENSE
10
- * file that was distributed with this source code.
11
- */
12
-
13
- namespace Composer\Autoload;
14
-
15
- /**
16
- * ClassLoader implements a PSR-0 class loader
17
- *
18
- * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md
19
- *
20
- * $loader = new \Composer\Autoload\ClassLoader();
21
- *
22
- * // register classes with namespaces
23
- * $loader->add('Symfony\Component', __DIR__.'/component');
24
- * $loader->add('Symfony', __DIR__.'/framework');
25
- *
26
- * // activate the autoloader
27
- * $loader->register();
28
- *
29
- * // to enable searching the include path (eg. for PEAR packages)
30
- * $loader->setUseIncludePath(true);
31
- *
32
- * In this example, if you try to use a class in the Symfony\Component
33
- * namespace or one of its children (Symfony\Component\Console for instance),
34
- * the autoloader will first look for the class under the component/
35
- * directory, and it will then fallback to the framework/ directory if not
36
- * found before giving up.
37
- *
38
- * This class is loosely based on the Symfony UniversalClassLoader.
39
- *
40
- * @author Fabien Potencier <fabien@symfony.com>
41
- * @author Jordi Boggiano <j.boggiano@seld.be>
42
- */
43
- class ClassLoader
44
- {
45
- // PSR-4
46
- private $prefixLengthsPsr4 = array();
47
- private $prefixDirsPsr4 = array();
48
- private $fallbackDirsPsr4 = array();
49
-
50
- // PSR-0
51
- private $prefixesPsr0 = array();
52
- private $fallbackDirsPsr0 = array();
53
-
54
- private $useIncludePath = false;
55
- private $classMap = array();
56
-
57
- private $classMapAuthoritative = false;
58
-
59
- public function getPrefixes()
60
- {
61
- if (!empty($this->prefixesPsr0)) {
62
- return call_user_func_array('array_merge', $this->prefixesPsr0);
63
- }
64
-
65
- return array();
66
- }
67
-
68
- public function getPrefixesPsr4()
69
- {
70
- return $this->prefixDirsPsr4;
71
- }
72
-
73
- public function getFallbackDirs()
74
- {
75
- return $this->fallbackDirsPsr0;
76
- }
77
-
78
- public function getFallbackDirsPsr4()
79
- {
80
- return $this->fallbackDirsPsr4;
81
- }
82
-
83
- public function getClassMap()
84
- {
85
- return $this->classMap;
86
- }
87
-
88
- /**
89
- * @param array $classMap Class to filename map
90
- */
91
- public function addClassMap(array $classMap)
92
- {
93
- if ($this->classMap) {
94
- $this->classMap = array_merge($this->classMap, $classMap);
95
- } else {
96
- $this->classMap = $classMap;
97
- }
98
- }
99
-
100
- /**
101
- * Registers a set of PSR-0 directories for a given prefix, either
102
- * appending or prepending to the ones previously set for this prefix.
103
- *
104
- * @param string $prefix The prefix
105
- * @param array|string $paths The PSR-0 root directories
106
- * @param bool $prepend Whether to prepend the directories
107
- */
108
- public function add($prefix, $paths, $prepend = false)
109
- {
110
- if (!$prefix) {
111
- if ($prepend) {
112
- $this->fallbackDirsPsr0 = array_merge(
113
- (array) $paths,
114
- $this->fallbackDirsPsr0
115
- );
116
- } else {
117
- $this->fallbackDirsPsr0 = array_merge(
118
- $this->fallbackDirsPsr0,
119
- (array) $paths
120
- );
121
- }
122
-
123
- return;
124
- }
125
-
126
- $first = $prefix[0];
127
- if (!isset($this->prefixesPsr0[$first][$prefix])) {
128
- $this->prefixesPsr0[$first][$prefix] = (array) $paths;
129
-
130
- return;
131
- }
132
- if ($prepend) {
133
- $this->prefixesPsr0[$first][$prefix] = array_merge(
134
- (array) $paths,
135
- $this->prefixesPsr0[$first][$prefix]
136
- );
137
- } else {
138
- $this->prefixesPsr0[$first][$prefix] = array_merge(
139
- $this->prefixesPsr0[$first][$prefix],
140
- (array) $paths
141
- );
142
- }
143
- }
144
-
145
- /**
146
- * Registers a set of PSR-4 directories for a given namespace, either
147
- * appending or prepending to the ones previously set for this namespace.
148
- *
149
- * @param string $prefix The prefix/namespace, with trailing '\\'
150
- * @param array|string $paths The PSR-0 base directories
151
- * @param bool $prepend Whether to prepend the directories
152
- *
153
- * @throws \InvalidArgumentException
154
- */
155
- public function addPsr4($prefix, $paths, $prepend = false)
156
- {
157
- if (!$prefix) {
158
- // Register directories for the root namespace.
159
- if ($prepend) {
160
- $this->fallbackDirsPsr4 = array_merge(
161
- (array) $paths,
162
- $this->fallbackDirsPsr4
163
- );
164
- } else {
165
- $this->fallbackDirsPsr4 = array_merge(
166
- $this->fallbackDirsPsr4,
167
- (array) $paths
168
- );
169
- }
170
- } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
171
- // Register directories for a new namespace.
172
- $length = strlen($prefix);
173
- if ('\\' !== $prefix[$length - 1]) {
174
- throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
175
- }
176
- $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
177
- $this->prefixDirsPsr4[$prefix] = (array) $paths;
178
- } elseif ($prepend) {
179
- // Prepend directories for an already registered namespace.
180
- $this->prefixDirsPsr4[$prefix] = array_merge(
181
- (array) $paths,
182
- $this->prefixDirsPsr4[$prefix]
183
- );
184
- } else {
185
- // Append directories for an already registered namespace.
186
- $this->prefixDirsPsr4[$prefix] = array_merge(
187
- $this->prefixDirsPsr4[$prefix],
188
- (array) $paths
189
- );
190
- }
191
- }
192
-
193
- /**
194
- * Registers a set of PSR-0 directories for a given prefix,
195
- * replacing any others previously set for this prefix.
196
- *
197
- * @param string $prefix The prefix
198
- * @param array|string $paths The PSR-0 base directories
199
- */
200
- public function set($prefix, $paths)
201
- {
202
- if (!$prefix) {
203
- $this->fallbackDirsPsr0 = (array) $paths;
204
- } else {
205
- $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
206
- }
207
- }
208
-
209
- /**
210
- * Registers a set of PSR-4 directories for a given namespace,
211
- * replacing any others previously set for this namespace.
212
- *
213
- * @param string $prefix The prefix/namespace, with trailing '\\'
214
- * @param array|string $paths The PSR-4 base directories
215
- *
216
- * @throws \InvalidArgumentException
217
- */
218
- public function setPsr4($prefix, $paths)
219
- {
220
- if (!$prefix) {
221
- $this->fallbackDirsPsr4 = (array) $paths;
222
- } else {
223
- $length = strlen($prefix);
224
- if ('\\' !== $prefix[$length - 1]) {
225
- throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
226
- }
227
- $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
228
- $this->prefixDirsPsr4[$prefix] = (array) $paths;
229
- }
230
- }
231
-
232
- /**
233
- * Turns on searching the include path for class files.
234
- *
235
- * @param bool $useIncludePath
236
- */
237
- public function setUseIncludePath($useIncludePath)
238
- {
239
- $this->useIncludePath = $useIncludePath;
240
- }
241
-
242
- /**
243
- * Can be used to check if the autoloader uses the include path to check
244
- * for classes.
245
- *
246
- * @return bool
247
- */
248
- public function getUseIncludePath()
249
- {
250
- return $this->useIncludePath;
251
- }
252
-
253
- /**
254
- * Turns off searching the prefix and fallback directories for classes
255
- * that have not been registered with the class map.
256
- *
257
- * @param bool $classMapAuthoritative
258
- */
259
- public function setClassMapAuthoritative($classMapAuthoritative)
260
- {
261
- $this->classMapAuthoritative = $classMapAuthoritative;
262
- }
263
-
264
- /**
265
- * Should class lookup fail if not found in the current class map?
266
- *
267
- * @return bool
268
- */
269
- public function isClassMapAuthoritative()
270
- {
271
- return $this->classMapAuthoritative;
272
- }
273
-
274
- /**
275
- * Registers this instance as an autoloader.
276
- *
277
- * @param bool $prepend Whether to prepend the autoloader or not
278
- */
279
- public function register($prepend = false)
280
- {
281
- spl_autoload_register(array($this, 'loadClass'), true, $prepend);
282
- }
283
-
284
- /**
285
- * Unregisters this instance as an autoloader.
286
- */
287
- public function unregister()
288
- {
289
- spl_autoload_unregister(array($this, 'loadClass'));
290
- }
291
-
292
- /**
293
- * Loads the given class or interface.
294
- *
295
- * @param string $class The name of the class
296
- * @return bool|null True if loaded, null otherwise
297
- */
298
- public function loadClass($class)
299
- {
300
- if ($file = $this->findFile($class)) {
301
- includeFile($file);
302
-
303
- return true;
304
- }
305
- }
306
-
307
- /**
308
- * Finds the path to the file where the class is defined.
309
- *
310
- * @param string $class The name of the class
311
- *
312
- * @return string|false The path if found, false otherwise
313
- */
314
- public function findFile($class)
315
- {
316
- // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731
317
- if ('\\' == $class[0]) {
318
- $class = substr($class, 1);
319
- }
320
-
321
- // class map lookup
322
- if (isset($this->classMap[$class])) {
323
- return $this->classMap[$class];
324
- }
325
- if ($this->classMapAuthoritative) {
326
- return false;
327
- }
328
-
329
- $file = $this->findFileWithExtension($class, '.php');
330
-
331
- // Search for Hack files if we are running on HHVM
332
- if ($file === null && defined('HHVM_VERSION')) {
333
- $file = $this->findFileWithExtension($class, '.hh');
334
- }
335
-
336
- if ($file === null) {
337
- // Remember that this class does not exist.
338
- return $this->classMap[$class] = false;
339
- }
340
-
341
- return $file;
342
- }
343
-
344
- private function findFileWithExtension($class, $ext)
345
- {
346
- // PSR-4 lookup
347
- $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
348
-
349
- $first = $class[0];
350
- if (isset($this->prefixLengthsPsr4[$first])) {
351
- foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) {
352
- if (0 === strpos($class, $prefix)) {
353
- foreach ($this->prefixDirsPsr4[$prefix] as $dir) {
354
- if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
355
- return $file;
356
- }
357
- }
358
- }
359
- }
360
- }
361
-
362
- // PSR-4 fallback dirs
363
- foreach ($this->fallbackDirsPsr4 as $dir) {
364
- if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
365
- return $file;
366
- }
367
- }
368
-
369
- // PSR-0 lookup
370
- if (false !== $pos = strrpos($class, '\\')) {
371
- // namespaced class name
372
- $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
373
- . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
374
- } else {
375
- // PEAR-like class name
376
- $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
377
- }
378
-
379
- if (isset($this->prefixesPsr0[$first])) {
380
- foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
381
- if (0 === strpos($class, $prefix)) {
382
- foreach ($dirs as $dir) {
383
- if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
384
- return $file;
385
- }
386
- }
387
- }
388
- }
389
- }
390
-
391
- // PSR-0 fallback dirs
392
- foreach ($this->fallbackDirsPsr0 as $dir) {
393
- if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
394
- return $file;
395
- }
396
- }
397
-
398
- // PSR-0 include paths.
399
- if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
400
- return $file;
401
- }
402
- }
403
- }
404
-
405
- /**
406
- * Scope isolated include.
407
- *
408
- * Prevents access to $this/self from included files.
409
- */
410
- function includeFile($file)
411
- {
412
- include $file;
413
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/autoload_classmap.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
-
3
- // autoload_classmap.php @generated by Composer
4
-
5
- $vendorDir = dirname(dirname(__FILE__));
6
- $baseDir = dirname(dirname($vendorDir));
7
-
8
- return array(
9
- );
 
 
 
 
 
 
 
 
 
includes/vendor/composer/autoload_namespaces.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- // autoload_namespaces.php @generated by Composer
4
-
5
- $vendorDir = dirname(dirname(__FILE__));
6
- $baseDir = dirname(dirname($vendorDir));
7
-
8
- return array(
9
- 'Composer\\Installers\\' => array($vendorDir . '/composer/installers/src'),
10
- );
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/autoload_psr4.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
-
3
- // autoload_psr4.php @generated by Composer
4
-
5
- $vendorDir = dirname(dirname(__FILE__));
6
- $baseDir = dirname(dirname($vendorDir));
7
-
8
- return array(
9
- );
 
 
 
 
 
 
 
 
 
includes/vendor/composer/autoload_real.php DELETED
@@ -1,50 +0,0 @@
1
- <?php
2
-
3
- // autoload_real.php @generated by Composer
4
-
5
- class ComposerAutoloaderInit3bb75807e81292dee13fe8a3526e0777
6
- {
7
- private static $loader;
8
-
9
- public static function loadClassLoader($class)
10
- {
11
- if ('Composer\Autoload\ClassLoader' === $class) {
12
- require __DIR__ . '/ClassLoader.php';
13
- }
14
- }
15
-
16
- public static function getLoader()
17
- {
18
- if (null !== self::$loader) {
19
- return self::$loader;
20
- }
21
-
22
- spl_autoload_register(array('ComposerAutoloaderInit3bb75807e81292dee13fe8a3526e0777', 'loadClassLoader'), true, true);
23
- self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit3bb75807e81292dee13fe8a3526e0777', 'loadClassLoader'));
25
-
26
- $map = require __DIR__ . '/autoload_namespaces.php';
27
- foreach ($map as $namespace => $path) {
28
- $loader->set($namespace, $path);
29
- }
30
-
31
- $map = require __DIR__ . '/autoload_psr4.php';
32
- foreach ($map as $namespace => $path) {
33
- $loader->setPsr4($namespace, $path);
34
- }
35
-
36
- $classMap = require __DIR__ . '/autoload_classmap.php';
37
- if ($classMap) {
38
- $loader->addClassMap($classMap);
39
- }
40
-
41
- $loader->register(true);
42
-
43
- return $loader;
44
- }
45
- }
46
-
47
- function composerRequire3bb75807e81292dee13fe8a3526e0777($file)
48
- {
49
- require $file;
50
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installed.json DELETED
@@ -1,99 +0,0 @@
1
- [
2
- {
3
- "name": "composer/installers",
4
- "version": "v1.0.21",
5
- "version_normalized": "1.0.21.0",
6
- "source": {
7
- "type": "git",
8
- "url": "https://github.com/composer/installers.git",
9
- "reference": "d64e23fce42a4063d63262b19b8e7c0f3b5e4c45"
10
- },
11
- "dist": {
12
- "type": "zip",
13
- "url": "https://api.github.com/repos/composer/installers/zipball/d64e23fce42a4063d63262b19b8e7c0f3b5e4c45",
14
- "reference": "d64e23fce42a4063d63262b19b8e7c0f3b5e4c45",
15
- "shasum": ""
16
- },
17
- "replace": {
18
- "roundcube/plugin-installer": "*",
19
- "shama/baton": "*"
20
- },
21
- "require-dev": {
22
- "composer/composer": "1.0.*@dev",
23
- "phpunit/phpunit": "4.1.*"
24
- },
25
- "time": "2015-02-18 17:17:01",
26
- "type": "composer-installer",
27
- "extra": {
28
- "class": "Composer\\Installers\\Installer",
29
- "branch-alias": {
30
- "dev-master": "1.0-dev"
31
- }
32
- },
33
- "installation-source": "dist",
34
- "autoload": {
35
- "psr-0": {
36
- "Composer\\Installers\\": "src/"
37
- }
38
- },
39
- "notification-url": "https://packagist.org/downloads/",
40
- "license": [
41
- "MIT"
42
- ],
43
- "authors": [
44
- {
45
- "name": "Kyle Robinson Young",
46
- "email": "kyle@dontkry.com",
47
- "homepage": "https://github.com/shama"
48
- }
49
- ],
50
- "description": "A multi-framework Composer library installer",
51
- "homepage": "http://composer.github.com/installers/",
52
- "keywords": [
53
- "Craft",
54
- "Dolibarr",
55
- "Hurad",
56
- "MODX Evo",
57
- "OXID",
58
- "SMF",
59
- "Thelia",
60
- "WolfCMS",
61
- "agl",
62
- "aimeos",
63
- "annotatecms",
64
- "bitrix",
65
- "cakephp",
66
- "chef",
67
- "codeigniter",
68
- "concrete5",
69
- "croogo",
70
- "dokuwiki",
71
- "drupal",
72
- "elgg",
73
- "fuelphp",
74
- "grav",
75
- "installer",
76
- "joomla",
77
- "kohana",
78
- "laravel",
79
- "lithium",
80
- "magento",
81
- "mako",
82
- "mediawiki",
83
- "modulework",
84
- "moodle",
85
- "phpbb",
86
- "piwik",
87
- "ppi",
88
- "puppet",
89
- "roundcube",
90
- "shopware",
91
- "silverstripe",
92
- "symfony",
93
- "typo3",
94
- "wordpress",
95
- "zend",
96
- "zikula"
97
- ]
98
- }
99
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/.editorconfig DELETED
@@ -1,10 +0,0 @@
1
- ; top-most EditorConfig file
2
- root = true
3
-
4
- ; Unix-style newlines
5
- [*]
6
- end_of_line = LF
7
-
8
- [*.php]
9
- indent_style = space
10
- indent_size = 4
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/.gitignore DELETED
@@ -1,3 +0,0 @@
1
- vendor/
2
- composer.lock
3
- .idea/
 
 
 
includes/vendor/composer/installers/.travis.yml DELETED
@@ -1,14 +0,0 @@
1
- language: php
2
-
3
- php:
4
- - 5.3
5
- - 5.4
6
- - 5.5
7
- - 5.6
8
- - hhvm
9
-
10
- before_script:
11
- - curl -s http://getcomposer.org/installer | php -- --quiet
12
- - php composer.phar install --dev
13
-
14
- script: phpunit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/LICENSE DELETED
@@ -1,19 +0,0 @@
1
- Copyright (c) 2012 Kyle Robinson Young
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy
4
- of this software and associated documentation files (the "Software"), to deal
5
- in the Software without restriction, including without limitation the rights
6
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- copies of the Software, and to permit persons to whom the Software is furnished
8
- to do so, subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in all
11
- copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- THE SOFTWARE.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/README.md DELETED
@@ -1,191 +0,0 @@
1
- # A Multi-Framework [Composer](http://getcomposer.org) Library Installer
2
-
3
- [![Build Status](http://img.shields.io/travis/composer/installers.svg)](http://travis-ci.org/composer/installers)
4
-
5
- This is for PHP package authors to require in their `composer.json`. It will
6
- install their package to the correct location based on the specified package
7
- type.
8
-
9
- The goal of `installers` is to be a simple package type to install path map.
10
- Users can also customize the install path per package and package authors can
11
- modify the package name upon installing.
12
-
13
- `installers` isn't intended on replacing all custom installers. If your
14
- package requires special installation handling then by all means, create a
15
- custom installer to handle it.
16
-
17
- **Natively Supported Frameworks**:
18
-
19
- The following frameworks natively work with Composer and will be
20
- installed to the default `vendor` directory. `composer/installers`
21
- is not needed to install packages with these frameworks:
22
-
23
- * Aura
24
- * Symfony2
25
- * Yii
26
- * Yii2
27
-
28
- **Current Supported Package Types**:
29
-
30
- > Stable types are marked as **bold**, this means that installation paths
31
- > for those type will not be changed. Any adjustment for those types would
32
- > require creation of brand new type that will cover required changes.
33
-
34
- | Framework | Types
35
- | --------- | -----
36
- | Aimeos | `aimeos-extension`
37
- | Asgard | `asgard-module`<br>`asgard-theme`
38
- | AGL | `agl-module`
39
- | AnnotateCms | `annotatecms-module`<br>`annotatecms-component`<br>`annotatecms-service`
40
- | Bitrix | `bitrix-module`<br>`bitrix-component`<br>`bitrix-theme`
41
- | CakePHP 2+ | **`cakephp-plugin`**
42
- | Chef | `chef-cookbook`<br>`chef-role`
43
- | CCFramework | `ccframework-ship`<br>`ccframework-theme`
44
- | CodeIgniter | `codeigniter-library`<br>`codeigniter-third-party`<br>`codeigniter-module`
45
- | concrete5 | `concrete5-block`<br>`concrete5-package`<br>`concrete5-theme`<br>`concrete5-update`
46
- | Craft | `craft-plugin`
47
- | Croogo | `croogo-plugin`<br>`croogo-theme`
48
- | DokuWiki | `dokuwiki-plugin`<br>`dokuwiki-template`
49
- | Dolibarr | `dolibarr-module`
50
- | Drupal | <b>`drupal-module`<br>`drupal-theme`</b><br>`drupal-library`<br>`drupal-profile`<br>`drupal-drush`
51
- | Elgg | `elgg-plugin`
52
- | FuelPHP v1.x | `fuel-module`<br>`fuel-package`<br/>`fuel-theme`
53
- | FuelPHP v2.x | `fuelphp-component`
54
- | Grav | `grav-plugin`<br>`grav-theme`
55
- | Hurad | `hurad-plugin`<br>`hurad-theme`
56
- | Joomla | `joomla-component`<br>`joomla-module`<br>`joomla-template`<br>`joomla-plugin`<br>`joomla-library`
57
- | Kirby | **`kirby-plugin`**
58
- | Kohana | **`kohana-module`**
59
- | Laravel | `laravel-library`
60
- | Lithium | **`lithium-library`<br>`lithium-source`**
61
- | Magento | `magento-library`<br>`magento-skin`<br>`magento-theme`
62
- | Mako | `mako-package`
63
- | MODX Evo | `modxevo-snippet`<br>`modxevo-plugin`<br>`modxevo-module`<br>`modxevo-template`<br>`modxevo-lib`
64
- | MediaWiki | `mediawiki-extension`
65
- | October | **`october-module`<br>`october-plugin`<br>`october-theme`**
66
- | OXID | `oxid-module`<br>`oxid-theme`<br>`oxid-out`
67
- | MODULEWork | `modulework-module`
68
- | Moodle | `moodle-*` (Please [check source](https://raw.githubusercontent.com/composer/installers/master/src/Composer/Installers/MoodleInstaller.php) for all supported types)
69
- | Piwik | `piwik-plugin`
70
- | phpBB | `phpbb-extension`<br>`phpbb-style`<br>`phpbb-language`
71
- | Pimcore | `pimcore-plugin`
72
- | PPI | **`ppi-module`**
73
- | Puppet | `puppet-module`
74
- | REDAXO | `redaxo-addon`
75
- | Roundcube | `roundcube-plugin`
76
- | shopware | `shopware-backend-plugin`<br/>`shopware-core-plugin`<br/>`shopware-frontend-plugin`<br/>`shopware-theme`
77
- | SilverStripe | `silverstripe-module`<br>`silverstripe-theme`
78
- | SMF | `smf-module`<br>`smf-theme`
79
- | symfony1 | **`symfony1-plugin`**
80
- | Tusk | `tusk-task`<br>`tusk-command`<br>`tusk-asset`
81
- | TYPO3 Flow | `typo3-flow-package`<br>`typo3-flow-framework`<br>`typo3-flow-plugin`<br>`typo3-flow-site`<br>`typo3-flow-boilerplate`<br>`typo3-flow-build`
82
- | TYPO3 CMS | `typo3-cms-extension`
83
- | Wolf CMS | `wolfcms-plugin`
84
- | WordPress | <b>`wordpress-plugin`<br>`wordpress-theme`</b><br>`wordpress-muplugin`
85
- | Zend | `zend-library`<br>`zend-extra`<br>`zend-module`
86
- | Zikula | `zikula-module`<br>`zikula-theme`
87
- | Prestashop | `prestashop-module`<br>`prestashop-theme`
88
-
89
- ## Example `composer.json` File
90
-
91
- This is an example for a CakePHP plugin. The only important parts to set in your
92
- composer.json file are `"type": "cakephp-plugin"` which describes what your
93
- package is and `"require": { "composer/installers": "~1.0" }` which tells composer
94
- to load the custom installers.
95
-
96
- ```json
97
- {
98
- "name": "you/ftp",
99
- "type": "cakephp-plugin",
100
- "require": {
101
- "composer/installers": "~1.0"
102
- }
103
- }
104
- ```
105
-
106
- This would install your package to the `Plugin/Ftp/` folder of a CakePHP app
107
- when a user runs `php composer.phar install`.
108
-
109
- So submit your packages to [packagist.org](http://packagist.org)!
110
-
111
- ## Custom Install Paths
112
-
113
- If you are consuming a package that uses the `composer/installers` you can
114
- override the install path with the following extra in your `composer.json`:
115
-
116
- ```json
117
- {
118
- "extra": {
119
- "installer-paths": {
120
- "your/custom/path/{$name}/": ["shama/ftp", "vendor/package"]
121
- }
122
- }
123
- }
124
- ```
125
-
126
- A package type can have a custom installation path with a `type:` prefix.
127
-
128
- ``` json
129
- {
130
- "extra": {
131
- "installer-paths": {
132
- "your/custom/path/{$name}/": ["type:wordpress-plugin"]
133
- }
134
- }
135
- }
136
- ```
137
-
138
- This would use your custom path for each of the listed packages. The available
139
- variables to use in your paths are: `{$name}`, `{$vendor}`, `{$type}`.
140
-
141
- ## Custom Install Names
142
-
143
- If you're a package author and need your package to be named differently when
144
- installed consider using the `installer-name` extra.
145
-
146
- For example you have a package named `shama/cakephp-ftp` with the type
147
- `cakephp-plugin`. Installing with `composer/installers` would install to the
148
- path `Plugin/CakephpFtp`. Due to the strict naming conventions, you as a
149
- package author actually need the package to be named and installed to
150
- `Plugin/Ftp`. Using the following config within your **package** `composer.json`
151
- will allow this:
152
-
153
- ```json
154
- {
155
- "name": "shama/cakephp-ftp",
156
- "type": "cakephp-plugin",
157
- "extra": {
158
- "installer-name": "Ftp"
159
- }
160
- }
161
- ```
162
-
163
- Please note the name entered into `installer-name` will be the final and will
164
- not be inflected.
165
-
166
- ## Contribute!
167
-
168
- * [Fork and clone](https://help.github.com/articles/fork-a-repo).
169
- * Run the command `php composer.phar install --dev` to install the dev
170
- dependencies. See [Composer](https://github.com/composer/composer#installation--usage).
171
- * Use the command `phpunit` to run the tests. See [PHPUnit](http://phpunit.de).
172
- * Create a branch, commit, push and send us a
173
- [pull request](https://help.github.com/articles/using-pull-requests).
174
-
175
- To ensure a consistent code base, you should make sure the code follows the
176
- [Coding Standards](http://symfony.com/doc/2.0/contributing/code/standards.html)
177
- which we borrowed from Symfony.
178
-
179
- If you would like to help, please take a look at the list of
180
- [issues](https://github.com/composer/installers/issues).
181
-
182
- ### Should we allow dynamic package types or paths? No.
183
- What are they? The ability for a package author to determine where a package
184
- will be installed either through setting the path directly in their
185
- `composer.json` or through a dynamic package type: `"type":
186
- "framework-install-here"`.
187
-
188
- It has been proposed many times. Even implemented once early on and then
189
- removed. `installers` won't do this because it would allow a single package
190
- author to wipe out entire folders without the user's consent. That user would
191
- then come here to yell at us.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/composer.json DELETED
@@ -1,77 +0,0 @@
1
- {
2
- "name": "composer/installers",
3
- "type": "composer-installer",
4
- "license": "MIT",
5
- "description": "A multi-framework Composer library installer",
6
- "keywords": [
7
- "installer",
8
- "Aimeos",
9
- "AGL",
10
- "AnnotateCms",
11
- "Bitrix",
12
- "CakePHP",
13
- "Chef",
14
- "CodeIgniter",
15
- "concrete5",
16
- "Craft",
17
- "Croogo",
18
- "DokuWiki",
19
- "Dolibarr",
20
- "Drupal",
21
- "Elgg",
22
- "FuelPHP",
23
- "Grav",
24
- "Hurad",
25
- "Joomla",
26
- "Kohana",
27
- "Laravel",
28
- "Lithium",
29
- "Magento",
30
- "Mako",
31
- "MODX Evo",
32
- "MediaWiki",
33
- "OXID",
34
- "MODULEWork",
35
- "Moodle",
36
- "Piwik",
37
- "phpBB",
38
- "PPI",
39
- "Puppet",
40
- "Roundcube",
41
- "shopware",
42
- "SilverStripe",
43
- "SMF",
44
- "symfony",
45
- "Thelia",
46
- "TYPO3",
47
- "WolfCMS",
48
- "WordPress",
49
- "Zend",
50
- "Zikula"
51
- ],
52
- "homepage": "http://composer.github.com/installers/",
53
- "authors": [
54
- {
55
- "name": "Kyle Robinson Young",
56
- "email": "kyle@dontkry.com",
57
- "homepage": "https://github.com/shama"
58
- }
59
- ],
60
- "autoload": {
61
- "psr-0": { "Composer\\Installers\\": "src/" }
62
- },
63
- "extra": {
64
- "class": "Composer\\Installers\\Installer",
65
- "branch-alias": {
66
- "dev-master": "1.0-dev"
67
- }
68
- },
69
- "replace": {
70
- "shama/baton": "*",
71
- "roundcube/plugin-installer": "*"
72
- },
73
- "require-dev": {
74
- "composer/composer": "1.0.*@dev",
75
- "phpunit/phpunit": "4.1.*"
76
- }
77
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/phpunit.xml.dist DELETED
@@ -1,25 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
-
3
- <phpunit backupGlobals="false"
4
- backupStaticAttributes="false"
5
- colors="true"
6
- convertErrorsToExceptions="true"
7
- convertNoticesToExceptions="true"
8
- convertWarningsToExceptions="true"
9
- processIsolation="false"
10
- stopOnFailure="false"
11
- syntaxCheck="false"
12
- bootstrap="tests/bootstrap.php"
13
- >
14
- <testsuites>
15
- <testsuite name="Installers Test Suite">
16
- <directory>tests/Composer/Installers</directory>
17
- </testsuite>
18
- </testsuites>
19
-
20
- <filter>
21
- <whitelist>
22
- <directory>src/Composer/Installers</directory>
23
- </whitelist>
24
- </filter>
25
- </phpunit>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/AglInstaller.php DELETED
@@ -1,21 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class AglInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'More/{$name}/',
8
- );
9
-
10
- /**
11
- * Format package name to CamelCase
12
- */
13
- public function inflectPackageVars($vars)
14
- {
15
- $vars['name'] = preg_replace_callback('/(?:^|_|-)(.?)/', function ($matches) {
16
- return strtoupper($matches[1]);
17
- }, $vars['name']);
18
-
19
- return $vars;
20
- }
21
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/AimeosInstaller.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class AimeosInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'extension' => 'ext/{$name}/',
8
- );
9
- }
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class AnnotateCmsInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'addons/modules/{$name}/',
8
- 'component' => 'addons/components/{$name}/',
9
- 'service' => 'addons/services/{$name}/',
10
- );
11
- }
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/AsgardInstaller.php DELETED
@@ -1,45 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class AsgardInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'Modules/{$name}/',
8
- 'theme' => 'Themes/{$name}/'
9
- );
10
-
11
- /**
12
- * Format package name.
13
- *
14
- * For package type asgard-module, cut off a trailing '-plugin' if present.
15
- *
16
- * For package type asgard-theme, cut off a trailing '-theme' if present.
17
- *
18
- */
19
- public function inflectPackageVars($vars)
20
- {
21
- if ($vars['type'] === 'asgard-module') {
22
- return $this->inflectPluginVars($vars);
23
- }
24
-
25
- if ($vars['type'] === 'asgard-theme') {
26
- return $this->inflectThemeVars($vars);
27
- }
28
-
29
- return $vars;
30
- }
31
-
32
- protected function inflectPluginVars($vars)
33
- {
34
- $vars['name'] = ucfirst(preg_replace('/-module/', '', $vars['name']));
35
-
36
- return $vars;
37
- }
38
-
39
- protected function inflectThemeVars($vars)
40
- {
41
- $vars['name'] = ucfirst(preg_replace('/-theme$/', '', $vars['name']));
42
-
43
- return $vars;
44
- }
45
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/BaseInstaller.php DELETED
@@ -1,131 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- use Composer\Composer;
5
- use Composer\Package\PackageInterface;
6
-
7
- abstract class BaseInstaller
8
- {
9
- protected $locations = array();
10
- protected $composer;
11
- protected $package;
12
-
13
- /**
14
- * Initializes base installer.
15
- *
16
- * @param PackageInterface $package
17
- * @param Composer $composer
18
- */
19
- public function __construct(PackageInterface $package = null, Composer $composer = null)
20
- {
21
- $this->composer = $composer;
22
- $this->package = $package;
23
- }
24
-
25
- /**
26
- * Return the install path based on package type.
27
- *
28
- * @param PackageInterface $package
29
- * @param string $frameworkType
30
- * @return string
31
- */
32
- public function getInstallPath(PackageInterface $package, $frameworkType = '')
33
- {
34
- $type = $this->package->getType();
35
-
36
- $prettyName = $this->package->getPrettyName();
37
- if (strpos($prettyName, '/') !== false) {
38
- list($vendor, $name) = explode('/', $prettyName);
39
- } else {
40
- $vendor = '';
41
- $name = $prettyName;
42
- }
43
-
44
- $availableVars = $this->inflectPackageVars(compact('name', 'vendor', 'type'));
45
-
46
- $extra = $package->getExtra();
47
- if (!empty($extra['installer-name'])) {
48
- $availableVars['name'] = $extra['installer-name'];
49
- }
50
-
51
- if ($this->composer->getPackage()) {
52
- $extra = $this->composer->getPackage()->getExtra();
53
- if (!empty($extra['installer-paths'])) {
54
- $customPath = $this->mapCustomInstallPaths($extra['installer-paths'], $prettyName, $type);
55
- if ($customPath !== false) {
56
- return $this->templatePath($customPath, $availableVars);
57
- }
58
- }
59
- }
60
-
61
- $packageType = substr($type, strlen($frameworkType) + 1);
62
- $locations = $this->getLocations();
63
- if (!isset($locations[$packageType])) {
64
- throw new \InvalidArgumentException(sprintf('Package type "%s" is not supported', $type));
65
- }
66
-
67
- return $this->templatePath($locations[$packageType], $availableVars);
68
- }
69
-
70
- /**
71
- * For an installer to override to modify the vars per installer.
72
- *
73
- * @param array $vars
74
- * @return array
75
- */
76
- public function inflectPackageVars($vars)
77
- {
78
- return $vars;
79
- }
80
-
81
- /**
82
- * Gets the installer's locations
83
- *
84
- * @return array
85
- */
86
- public function getLocations()
87
- {
88
- return $this->locations;
89
- }
90
-
91
- /**
92
- * Replace vars in a path
93
- *
94
- * @param string $path
95
- * @param array $vars
96
- * @return string
97
- */
98
- protected function templatePath($path, array $vars = array())
99
- {
100
- if (strpos($path, '{') !== false) {
101
- extract($vars);
102
- preg_match_all('@\{\$([A-Za-z0-9_]*)\}@i', $path, $matches);
103
- if (!empty($matches[1])) {
104
- foreach ($matches[1] as $var) {
105
- $path = str_replace('{$' . $var . '}', $$var, $path);
106
- }
107
- }
108
- }
109
-
110
- return $path;
111
- }
112
-
113
- /**
114
- * Search through a passed paths array for a custom install path.
115
- *
116
- * @param array $paths
117
- * @param string $name
118
- * @param string $type
119
- * @return string
120
- */
121
- protected function mapCustomInstallPaths(array $paths, $name, $type)
122
- {
123
- foreach ($paths as $path => $names) {
124
- if (in_array($name, $names) || in_array('type:' . $type, $names)) {
125
- return $path;
126
- }
127
- }
128
-
129
- return false;
130
- }
131
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/BitrixInstaller.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class BitrixInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'local/modules/{$name}/',
8
- 'component' => 'local/components/{$name}/',
9
- 'theme' => 'local/templates/{$name}/'
10
- );
11
- }
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php DELETED
@@ -1,78 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- use Composer\DependencyResolver\Pool;
5
- use Composer\Package\PackageInterface;
6
- use Composer\Package\LinkConstraint\MultiConstraint;
7
- use Composer\Package\LinkConstraint\VersionConstraint;
8
-
9
- class CakePHPInstaller extends BaseInstaller
10
- {
11
- protected $locations = array(
12
- 'plugin' => 'Plugin/{$name}/',
13
- );
14
-
15
- /**
16
- * Format package name to CamelCase
17
- */
18
- public function inflectPackageVars($vars)
19
- {
20
- if ($this->matchesCakeVersion('>=', '3.0.0')) {
21
- return $vars;
22
- }
23
-
24
- $nameParts = explode('/', $vars['name']);
25
- foreach ($nameParts as &$value) {
26
- $value = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $value));
27
- $value = str_replace(array('-', '_'), ' ', $value);
28
- $value = str_replace(' ', '', ucwords($value));
29
- }
30
- $vars['name'] = implode('/', $nameParts);
31
-
32
- return $vars;
33
- }
34
-
35
- /**
36
- * Change the default plugin location when cakephp >= 3.0
37
- */
38
- public function getLocations()
39
- {
40
- if ($this->matchesCakeVersion('>=', '3.0.0')) {
41
- $this->locations['plugin'] = $this->composer->getConfig()->get('vendor-dir') . '/{$vendor}/{$name}/';
42
- }
43
- return $this->locations;
44
- }
45
-
46
- /**
47
- * Check if CakePHP version matches against a version
48
- *
49
- * @param string $matcher
50
- * @param string $version
51
- * @return bool
52
- */
53
- protected function matchesCakeVersion($matcher, $version)
54
- {
55
- $repositoryManager = $this->composer->getRepositoryManager();
56
- if ($repositoryManager) {
57
- $repos = $repositoryManager->getLocalRepository();
58
- if (!$repos) {
59
- return false;
60
- }
61
- $cake3 = new MultiConstraint(array(
62
- new VersionConstraint($matcher, $version),
63
- new VersionConstraint('!=', '9999999-dev'),
64
- ));
65
- $pool = new Pool('dev');
66
- $pool->addRepository($repos);
67
- $packages = $pool->whatProvides('cakephp/cakephp');
68
- foreach ($packages as $package) {
69
- $installed = new VersionConstraint('=', $package->getVersion());
70
- if ($cake3->matches($installed)) {
71
- return true;
72
- break;
73
- }
74
- }
75
- }
76
- return false;
77
- }
78
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/ChefInstaller.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class ChefInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'cookbook' => 'Chef/{$vendor}/{$name}/',
8
- 'role' => 'Chef/roles/{$name}/',
9
- );
10
- }
11
-
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class ClanCatsFrameworkInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'ship' => 'CCF/orbit/{$name}/',
8
- 'theme' => 'CCF/app/themes/{$name}/',
9
- );
10
- }
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class CodeIgniterInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'library' => 'application/libraries/{$name}/',
8
- 'third-party' => 'application/third_party/{$name}/',
9
- 'module' => 'application/modules/{$name}/',
10
- );
11
- }
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/Concrete5Installer.php DELETED
@@ -1,12 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class Concrete5Installer extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'block' => 'blocks/{$name}/',
8
- 'package' => 'packages/{$name}/',
9
- 'theme' => 'themes/{$name}/',
10
- 'update' => 'updates/{$name}/',
11
- );
12
- }
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/CraftInstaller.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class CraftInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'plugin' => 'craft/plugins/{$name}/',
8
- );
9
- }
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/CroogoInstaller.php DELETED
@@ -1,21 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class CroogoInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'plugin' => 'Plugin/{$name}/',
8
- 'theme' => 'View/Themed/{$name}/',
9
- );
10
-
11
- /**
12
- * Format package name to CamelCase
13
- */
14
- public function inflectPackageVars($vars)
15
- {
16
- $vars['name'] = strtolower(str_replace(array('-', '_'), ' ', $vars['name']));
17
- $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
18
-
19
- return $vars;
20
- }
21
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/DokuWikiInstaller.php DELETED
@@ -1,50 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class DokuWikiInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'plugin' => 'lib/plugins/{$name}/',
8
- 'template' => 'lib/tpl/{$name}/',
9
- );
10
-
11
- /**
12
- * Format package name.
13
- *
14
- * For package type dokuwiki-plugin, cut off a trailing '-plugin',
15
- * or leading dokuwiki_ if present.
16
- *
17
- * For package type dokuwiki-template, cut off a trailing '-template' if present.
18
- *
19
- */
20
- public function inflectPackageVars($vars)
21
- {
22
-
23
- if ($vars['type'] === 'dokuwiki-plugin') {
24
- return $this->inflectPluginVars($vars);
25
- }
26
-
27
- if ($vars['type'] === 'dokuwiki-template') {
28
- return $this->inflectTemplateVars($vars);
29
- }
30
-
31
- return $vars;
32
- }
33
-
34
- protected function inflectPluginVars($vars)
35
- {
36
- $vars['name'] = preg_replace('/-plugin$/', '', $vars['name']);
37
- $vars['name'] = preg_replace('/^dokuwiki_?-?/', '', $vars['name']);
38
-
39
- return $vars;
40
- }
41
-
42
- protected function inflectTemplateVars($vars)
43
- {
44
- $vars['name'] = preg_replace('/-template$/', '', $vars['name']);
45
- $vars['name'] = preg_replace('/^dokuwiki_?-?/', '', $vars['name']);
46
-
47
- return $vars;
48
- }
49
-
50
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/DolibarrInstaller.php DELETED
@@ -1,16 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- /**
5
- * Class DolibarrInstaller
6
- *
7
- * @package Composer\Installers
8
- * @author Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
9
- */
10
- class DolibarrInstaller extends BaseInstaller
11
- {
12
- //TODO: Add support for scripts and themes
13
- protected $locations = array(
14
- 'module' => 'htdocs/custom/{$name}/',
15
- );
16
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/DrupalInstaller.php DELETED
@@ -1,14 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class DrupalInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'core' => 'core/',
8
- 'module' => 'modules/{$name}/',
9
- 'theme' => 'themes/{$name}/',
10
- 'library' => 'libraries/{$name}/',
11
- 'profile' => 'profiles/{$name}/',
12
- 'drush' => 'drush/{$name}/',
13
- );
14
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/ElggInstaller.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class ElggInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'plugin' => 'mod/{$name}/',
8
- );
9
- }
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/FuelInstaller.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class FuelInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'fuel/app/modules/{$name}/',
8
- 'package' => 'fuel/packages/{$name}/',
9
- 'theme' => 'fuel/app/themes/{$name}/',
10
- );
11
- }
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/FuelphpInstaller.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class FuelphpInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'component' => 'components/{$name}/',
8
- );
9
- }
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/GravInstaller.php DELETED
@@ -1,30 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class GravInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'plugin' => 'user/plugins/{$name}/',
8
- 'theme' => 'user/themes/{$name}/',
9
- );
10
-
11
- /**
12
- * Format package name
13
- *
14
- * @param array $vars
15
- *
16
- * @return array
17
- */
18
- public function inflectPackageVars($vars)
19
- {
20
- $restrictedWords = implode('|', array_keys($this->locations));
21
-
22
- $vars['name'] = strtolower($vars['name']);
23
- $vars['name'] = preg_replace('/^(?:grav-)?(?:(?:'.$restrictedWords.')-)?(.*?)(?:-(?:'.$restrictedWords.'))?$/ui',
24
- '$1',
25
- $vars['name']
26
- );
27
-
28
- return $vars;
29
- }
30
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/HuradInstaller.php DELETED
@@ -1,25 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class HuradInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'plugin' => 'plugins/{$name}/',
8
- 'theme' => 'plugins/{$name}/',
9
- );
10
-
11
- /**
12
- * Format package name to CamelCase
13
- */
14
- public function inflectPackageVars($vars)
15
- {
16
- $nameParts = explode('/', $vars['name']);
17
- foreach ($nameParts as &$value) {
18
- $value = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $value));
19
- $value = str_replace(array('-', '_'), ' ', $value);
20
- $value = str_replace(' ', '', ucwords($value));
21
- }
22
- $vars['name'] = implode('/', $nameParts);
23
- return $vars;
24
- }
25
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/Installer.php DELETED
@@ -1,163 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- use Composer\Installer\LibraryInstaller;
5
- use Composer\Package\PackageInterface;
6
- use Composer\Repository\InstalledRepositoryInterface;
7
-
8
- class Installer extends LibraryInstaller
9
- {
10
- /**
11
- * Package types to installer class map
12
- *
13
- * @var array
14
- */
15
- private $supportedTypes = array(
16
- 'aimeos' => 'AimeosInstaller',
17
- 'asgard' => 'AsgardInstaller',
18
- 'agl' => 'AglInstaller',
19
- 'annotatecms' => 'AnnotateCmsInstaller',
20
- 'bitrix' => 'BitrixInstaller',
21
- 'cakephp' => 'CakePHPInstaller',
22
- 'chef' => 'ChefInstaller',
23
- 'ccframework' => 'ClanCatsFrameworkInstaller',
24
- 'codeigniter' => 'CodeIgniterInstaller',
25
- 'concrete5' => 'Concrete5Installer',
26
- 'craft' => 'CraftInstaller',
27
- 'croogo' => 'CroogoInstaller',
28
- 'dokuwiki' => 'DokuWikiInstaller',
29
- 'dolibarr' => 'DolibarrInstaller',
30
- 'drupal' => 'DrupalInstaller',
31
- 'elgg' => 'ElggInstaller',
32
- 'fuel' => 'FuelInstaller',
33
- 'fuelphp' => 'FuelphpInstaller',
34
- 'grav' => 'GravInstaller',
35
- 'hurad' => 'HuradInstaller',
36
- 'joomla' => 'JoomlaInstaller',
37
- 'kirby' => 'KirbyInstaller',
38
- 'kohana' => 'KohanaInstaller',
39
- 'laravel' => 'LaravelInstaller',
40
- 'lithium' => 'LithiumInstaller',
41
- 'magento' => 'MagentoInstaller',
42
- 'mako' => 'MakoInstaller',
43
- 'mediawiki' => 'MediaWikiInstaller',
44
- 'microweber' => 'MicroweberInstaller',
45
- 'modulework' => 'MODULEWorkInstaller',
46
- 'modxevo' => 'MODXEvoInstaller',
47
- 'moodle' => 'MoodleInstaller',
48
- 'october' => 'OctoberInstaller',
49
- 'oxid' => 'OxidInstaller',
50
- 'phpbb' => 'PhpBBInstaller',
51
- 'pimcore' => 'PimcoreInstaller',
52
- 'piwik' => 'PiwikInstaller',
53
- 'ppi' => 'PPIInstaller',
54
- 'puppet' => 'PuppetInstaller',
55
- 'redaxo' => 'RedaxoInstaller',
56
- 'roundcube' => 'RoundcubeInstaller',
57
- 'shopware' => 'ShopwareInstaller',
58
- 'silverstripe' => 'SilverStripeInstaller',
59
- 'smf' => 'SMFInstaller',
60
- 'symfony1' => 'Symfony1Installer',
61
- 'thelia' => 'TheliaInstaller',
62
- 'tusk' => 'TuskInstaller',
63
- 'typo3-cms' => 'TYPO3CmsInstaller',
64
- 'typo3-flow' => 'TYPO3FlowInstaller',
65
- 'whmcs' => 'WHMCSInstaller',
66
- 'wolfcms' => 'WolfCMSInstaller',
67
- 'wordpress' => 'WordPressInstaller',
68
- 'zend' => 'ZendInstaller',
69
- 'zikula' => 'ZikulaInstaller',
70
- 'prestashop' => 'PrestashopInstaller',
71
- );
72
-
73
- /**
74
- * {@inheritDoc}
75
- */
76
- public function getInstallPath(PackageInterface $package)
77
- {
78
- $type = $package->getType();
79
- $frameworkType = $this->findFrameworkType($type);
80
-
81
- if ($frameworkType === false) {
82
- throw new \InvalidArgumentException(
83
- 'Sorry the package type of this package is not yet supported.'
84
- );
85
- }
86
-
87
- $class = 'Composer\\Installers\\' . $this->supportedTypes[$frameworkType];
88
- $installer = new $class($package, $this->composer);
89
-
90
- return $installer->getInstallPath($package, $frameworkType);
91
- }
92
-
93
- public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
94
- {
95
- if (!$repo->hasPackage($package)) {
96
- throw new \InvalidArgumentException('Package is not installed: '.$package);
97
- }
98
-
99
- $repo->removePackage($package);
100
-
101
- $installPath = $this->getInstallPath($package);
102
- $this->io->write(sprintf('Deleting %s - %s', $installPath, $this->filesystem->removeDirectory($installPath) ? '<comment>deleted</comment>' : '<error>not deleted</error>'));
103
- }
104
-
105
- /**
106
- * {@inheritDoc}
107
- */
108
- public function supports($packageType)
109
- {
110
- $frameworkType = $this->findFrameworkType($packageType);
111
-
112
- if ($frameworkType === false) {
113
- return false;
114
- }
115
-
116
- $locationPattern = $this->getLocationPattern($frameworkType);
117
-
118
- return preg_match('#' . $frameworkType . '-' . $locationPattern . '#', $packageType, $matches) === 1;
119
- }
120
-
121
- /**
122
- * Finds a supported framework type if it exists and returns it
123
- *
124
- * @param string $type
125
- * @return string
126
- */
127
- protected function findFrameworkType($type)
128
- {
129
- $frameworkType = false;
130
-
131
- krsort($this->supportedTypes);
132
-
133
- foreach ($this->supportedTypes as $key => $val) {
134
- if ($key === substr($type, 0, strlen($key))) {
135
- $frameworkType = substr($type, 0, strlen($key));
136
- break;
137
- }
138
- }
139
-
140
- return $frameworkType;
141
- }
142
-
143
- /**
144
- * Get the second part of the regular expression to check for support of a
145
- * package type
146
- *
147
- * @param string $frameworkType
148
- * @return string
149
- */
150
- protected function getLocationPattern($frameworkType)
151
- {
152
- $pattern = false;
153
- if (!empty($this->supportedTypes[$frameworkType])) {
154
- $frameworkClass = 'Composer\\Installers\\' . $this->supportedTypes[$frameworkType];
155
- /** @var BaseInstaller $framework */
156
- $framework = new $frameworkClass(null, $this->composer);
157
- $locations = array_keys($framework->getLocations());
158
- $pattern = $locations ? '(' . implode('|', $locations) . ')' : false;
159
- }
160
-
161
- return $pattern ? : '(\w+)';
162
- }
163
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/JoomlaInstaller.php DELETED
@@ -1,15 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class JoomlaInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'component' => 'components/{$name}/',
8
- 'module' => 'modules/{$name}/',
9
- 'template' => 'templates/{$name}/',
10
- 'plugin' => 'plugins/{$name}/',
11
- 'library' => 'libraries/{$name}/',
12
- );
13
-
14
- // TODO: Add inflector for mod_ and com_ names
15
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/KirbyInstaller.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class KirbyInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'plugin' => 'site/plugins/{$name}/',
8
- );
9
- }
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/KohanaInstaller.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class KohanaInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'modules/{$name}/',
8
- );
9
- }
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/LaravelInstaller.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class LaravelInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'library' => 'libraries/{$name}/',
8
- );
9
- }
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/LithiumInstaller.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class LithiumInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'library' => 'libraries/{$name}/',
8
- 'source' => 'libraries/_source/{$name}/',
9
- );
10
- }
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class MODULEWorkInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'modules/{$name}/',
8
- );
9
- }
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/MODXEvoInstaller.php DELETED
@@ -1,16 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- /**
5
- * An installer to handle MODX Evolution specifics when installing packages.
6
- */
7
- class MODXEvoInstaller extends BaseInstaller
8
- {
9
- protected $locations = array(
10
- 'snippet' => 'assets/snippets/{$name}/',
11
- 'plugin' => 'assets/plugins/{$name}/',
12
- 'module' => 'assets/modules/{$name}/',
13
- 'template' => 'assets/templates/{$name}/',
14
- 'lib' => 'assets/lib/{$name}/'
15
- );
16
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/MagentoInstaller.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class MagentoInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'theme' => 'app/design/frontend/{$name}/',
8
- 'skin' => 'skin/frontend/default/{$name}/',
9
- 'library' => 'lib/{$name}/',
10
- );
11
- }
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/MakoInstaller.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class MakoInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'package' => 'app/packages/{$name}/',
8
- );
9
- }
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/MediaWikiInstaller.php DELETED
@@ -1,50 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class MediaWikiInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'extension' => 'extensions/{$name}/',
8
- 'skin' => 'skins/{$name}/',
9
- );
10
-
11
- /**
12
- * Format package name.
13
- *
14
- * For package type mediawiki-extension, cut off a trailing '-extension' if present and transform
15
- * to CamelCase keeping existing uppercase chars.
16
- *
17
- * For package type mediawiki-skin, cut off a trailing '-skin' if present.
18
- *
19
- */
20
- public function inflectPackageVars($vars)
21
- {
22
-
23
- if ($vars['type'] === 'mediawiki-extension') {
24
- return $this->inflectExtensionVars($vars);
25
- }
26
-
27
- if ($vars['type'] === 'mediawiki-skin') {
28
- return $this->inflectSkinVars($vars);
29
- }
30
-
31
- return $vars;
32
- }
33
-
34
- protected function inflectExtensionVars($vars)
35
- {
36
- $vars['name'] = preg_replace('/-extension$/', '', $vars['name']);
37
- $vars['name'] = str_replace('-', ' ', $vars['name']);
38
- $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
39
-
40
- return $vars;
41
- }
42
-
43
- protected function inflectSkinVars($vars)
44
- {
45
- $vars['name'] = preg_replace('/-skin$/', '', $vars['name']);
46
-
47
- return $vars;
48
- }
49
-
50
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/MicroweberInstaller.php DELETED
@@ -1,111 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class MicroweberInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'userfiles/modules/{$name}/',
8
- 'module-skin' => 'userfiles/modules/{$name}/templates/',
9
- 'template' => 'userfiles/templates/{$name}/',
10
- 'element' => 'userfiles/elements/{$name}/',
11
- 'vendor' => 'vendor/{$name}/',
12
- 'components' => 'components/{$name}/'
13
- );
14
-
15
- /**
16
- * Format package name.
17
- *
18
- * For package type microweber-module, cut off a trailing '-module' if present
19
- *
20
- * For package type microweber-template, cut off a trailing '-template' if present.
21
- *
22
- */
23
- public function inflectPackageVars($vars)
24
- {
25
- if ($vars['type'] === 'microweber-template') {
26
- return $this->inflectTemplateVars($vars);
27
- }
28
- if ($vars['type'] === 'microweber-templates') {
29
- return $this->inflectTemplatesVars($vars);
30
- }
31
- if ($vars['type'] === 'microweber-core') {
32
- return $this->inflectCoreVars($vars);
33
- }
34
- if ($vars['type'] === 'microweber-adapter') {
35
- return $this->inflectCoreVars($vars);
36
- }
37
- if ($vars['type'] === 'microweber-module') {
38
- return $this->inflectModuleVars($vars);
39
- }
40
- if ($vars['type'] === 'microweber-modules') {
41
- return $this->inflectModulesVars($vars);
42
- }
43
- if ($vars['type'] === 'microweber-skin') {
44
- return $this->inflectSkinVars($vars);
45
- }
46
- if ($vars['type'] === 'microweber-element' or $vars['type'] === 'microweber-elements') {
47
- return $this->inflectElementVars($vars);
48
- }
49
-
50
- return $vars;
51
- }
52
-
53
- protected function inflectTemplateVars($vars)
54
- {
55
- $vars['name'] = preg_replace('/-template$/', '', $vars['name']);
56
- $vars['name'] = preg_replace('/template-$/', '', $vars['name']);
57
-
58
- return $vars;
59
- }
60
-
61
- protected function inflectTemplatesVars($vars)
62
- {
63
- $vars['name'] = preg_replace('/-templates$/', '', $vars['name']);
64
- $vars['name'] = preg_replace('/templates-$/', '', $vars['name']);
65
-
66
- return $vars;
67
- }
68
-
69
- protected function inflectCoreVars($vars)
70
- {
71
- $vars['name'] = preg_replace('/-providers$/', '', $vars['name']);
72
- $vars['name'] = preg_replace('/-provider$/', '', $vars['name']);
73
- $vars['name'] = preg_replace('/-adapter$/', '', $vars['name']);
74
-
75
- return $vars;
76
- }
77
-
78
- protected function inflectModuleVars($vars)
79
- {
80
- $vars['name'] = preg_replace('/-module$/', '', $vars['name']);
81
- $vars['name'] = preg_replace('/module-$/', '', $vars['name']);
82
-
83
- return $vars;
84
- }
85
-
86
- protected function inflectModulesVars($vars)
87
- {
88
- $vars['name'] = preg_replace('/-modules$/', '', $vars['name']);
89
- $vars['name'] = preg_replace('/modules-$/', '', $vars['name']);
90
-
91
- return $vars;
92
- }
93
-
94
- protected function inflectSkinVars($vars)
95
- {
96
- $vars['name'] = preg_replace('/-skin$/', '', $vars['name']);
97
- $vars['name'] = preg_replace('/skin-$/', '', $vars['name']);
98
-
99
- return $vars;
100
- }
101
-
102
- protected function inflectElementVars($vars)
103
- {
104
- $vars['name'] = preg_replace('/-elements$/', '', $vars['name']);
105
- $vars['name'] = preg_replace('/elements-$/', '', $vars['name']);
106
- $vars['name'] = preg_replace('/-element$/', '', $vars['name']);
107
- $vars['name'] = preg_replace('/element-$/', '', $vars['name']);
108
-
109
- return $vars;
110
- }
111
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/MoodleInstaller.php DELETED
@@ -1,47 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class MoodleInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'mod' => 'mod/{$name}/',
8
- 'admin_report' => 'admin/report/{$name}/',
9
- 'tool' => 'admin/tool/{$name}/',
10
- 'assignment' => 'mod/assignment/type/{$name}/',
11
- 'assignsubmission' => 'mod/assign/submission/{$name}/',
12
- 'assignfeedback' => 'mod/assign/feedback/{$name}/',
13
- 'auth' => 'auth/{$name}/',
14
- 'availability' => 'availability/condition/{$name}/',
15
- 'block' => 'blocks/{$name}/',
16
- 'calendartype' => 'calendar/type/{$name}/',
17
- 'format' => 'course/format/{$name}/',
18
- 'coursereport' => 'course/report/{$name}/',
19
- 'datafield' => 'mod/data/field/{$name}/',
20
- 'datapreset' => 'mod/data/preset/{$name}/',
21
- 'editor' => 'lib/editor/{$name}/',
22
- 'enrol' => 'enrol/{$name}/',
23
- 'filter' => 'filter/{$name}/',
24
- 'gradeexport' => 'grade/export/{$name}/',
25
- 'gradeimport' => 'grade/import/{$name}/',
26
- 'gradereport' => 'grade/report/{$name}/',
27
- 'gradingform' => 'grade/grading/form/{$name}/',
28
- 'local' => 'local/{$name}/',
29
- 'message' => 'message/output/{$name}/',
30
- 'plagiarism' => 'plagiarism/{$name}/',
31
- 'portfolio' => 'portfolio/{$name}/',
32
- 'qbehaviour' => 'question/behaviour/{$name}/',
33
- 'qformat' => 'question/format/{$name}/',
34
- 'qtype' => 'question/type/{$name}/',
35
- 'quizaccess' => 'mod/quiz/accessrule/{$name}/',
36
- 'quiz' => 'mod/quiz/report/{$name}/',
37
- 'report' => 'report/{$name}/',
38
- 'repository' => 'repository/{$name}/',
39
- 'scormreport' => 'mod/scorm/report/{$name}/',
40
- 'theme' => 'theme/{$name}/',
41
- 'profilefield' => 'user/profile/field/{$name}/',
42
- 'webservice' => 'webservice/{$name}/',
43
- 'workshopallocation' => 'mod/workshop/allocation/{$name}/',
44
- 'workshopeval' => 'mod/workshop/eval/{$name}/',
45
- 'workshopform' => 'mod/workshop/form/{$name}/'
46
- );
47
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/OctoberInstaller.php DELETED
@@ -1,46 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class OctoberInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'modules/{$name}/',
8
- 'plugin' => 'plugins/{$vendor}/{$name}/',
9
- 'theme' => 'themes/{$name}/'
10
- );
11
-
12
- /**
13
- * Format package name.
14
- *
15
- * For package type october-plugin, cut off a trailing '-plugin' if present.
16
- *
17
- * For package type october-theme, cut off a trailing '-theme' if present.
18
- *
19
- */
20
- public function inflectPackageVars($vars)
21
- {
22
- if ($vars['type'] === 'october-plugin') {
23
- return $this->inflectPluginVars($vars);
24
- }
25
-
26
- if ($vars['type'] === 'october-theme') {
27
- return $this->inflectThemeVars($vars);
28
- }
29
-
30
- return $vars;
31
- }
32
-
33
- protected function inflectPluginVars($vars)
34
- {
35
- $vars['name'] = preg_replace('/-plugin$/', '', $vars['name']);
36
-
37
- return $vars;
38
- }
39
-
40
- protected function inflectThemeVars($vars)
41
- {
42
- $vars['name'] = preg_replace('/-theme$/', '', $vars['name']);
43
-
44
- return $vars;
45
- }
46
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/OxidInstaller.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class OxidInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'modules/{$name}/',
8
- 'theme' => 'application/views/{$name}/',
9
- 'out' => 'out/{$name}/',
10
- );
11
- }
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/PPIInstaller.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class PPIInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'modules/{$name}/',
8
- );
9
- }
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/PhpBBInstaller.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class PhpBBInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'extension' => 'ext/{$vendor}/{$name}/',
8
- 'language' => 'language/{$name}/',
9
- 'style' => 'styles/{$name}/',
10
- );
11
- }
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/PimcoreInstaller.php DELETED
@@ -1,21 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class PimcoreInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'plugin' => 'plugins/{$name}/',
8
- );
9
-
10
- /**
11
- * Format package name to CamelCase
12
- */
13
- public function inflectPackageVars($vars)
14
- {
15
- $vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
16
- $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
17
- $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
18
-
19
- return $vars;
20
- }
21
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/PiwikInstaller.php DELETED
@@ -1,32 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- /**
5
- * Class PiwikInstaller
6
- *
7
- * @package Composer\Installers
8
- */
9
- class PiwikInstaller extends BaseInstaller
10
- {
11
- /**
12
- * @var array
13
- */
14
- protected $locations = array(
15
- 'plugin' => 'plugins/{$name}/',
16
- );
17
-
18
- /**
19
- * Format package name to CamelCase
20
- * @param array $vars
21
- *
22
- * @return array
23
- */
24
- public function inflectPackageVars($vars)
25
- {
26
- $vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
27
- $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
28
- $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
29
-
30
- return $vars;
31
- }
32
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/PrestashopInstaller.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class PrestashopInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'modules/{$name}/',
8
- 'theme' => 'themes/{$name}/',
9
- );
10
- }
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/PuppetInstaller.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- namespace Composer\Installers;
4
-
5
- class PuppetInstaller extends BaseInstaller
6
- {
7
-
8
- protected $locations = array(
9
- 'module' => 'modules/{$name}/',
10
- );
11
- }
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/RedaxoInstaller.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class RedaxoInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'addon' => 'redaxo/include/addons/{$name}/',
8
- 'bestyle-plugin' => 'redaxo/include/addons/be_style/plugins/{$name}/'
9
- );
10
- }
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/RoundcubeInstaller.php DELETED
@@ -1,22 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class RoundcubeInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'plugin' => 'plugins/{$name}/',
8
- );
9
-
10
- /**
11
- * Lowercase name and changes the name to a underscores
12
- *
13
- * @param array $vars
14
- * @return array
15
- */
16
- public function inflectPackageVars($vars)
17
- {
18
- $vars['name'] = strtolower(str_replace('-', '_', $vars['name']));
19
-
20
- return $vars;
21
- }
22
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/SMFInstaller.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class SMFInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'Sources/{$name}/',
8
- 'theme' => 'Themes/{$name}/',
9
- );
10
- }
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/ShopwareInstaller.php DELETED
@@ -1,58 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- /**
5
- * Plugin/theme installer for shopware
6
- * @author Benjamin Boit
7
- */
8
- class ShopwareInstaller extends BaseInstaller
9
- {
10
- protected $locations = array(
11
- 'backend-plugin' => 'engine/Shopware/Plugins/Local/Backend/{$name}/',
12
- 'core-plugin' => 'engine/Shopware/Plugins/Local/Core/{$name}/',
13
- 'frontend-plugin' => 'engine/Shopware/Plugins/Local/Frontend/{$name}/',
14
- 'theme' => 'templates/{$name}/'
15
- );
16
-
17
- /**
18
- * Transforms the names
19
- * @param array $vars
20
- * @return array
21
- */
22
- public function inflectPackageVars($vars)
23
- {
24
- if ($vars['type'] === 'shopware-theme') {
25
- return $this->correctThemeName($vars);
26
- } else {
27
- return $this->correctPluginName($vars);
28
- }
29
- }
30
-
31
- /**
32
- * Changes the name to a camelcased combination of vendor and name
33
- * @param array $vars
34
- * @return array
35
- */
36
- private function correctPluginName($vars)
37
- {
38
- $camelCasedName = preg_replace_callback('/(-[a-z])/', function ($matches) {
39
- return strtoupper($matches[0][1]);
40
- }, $vars['name']);
41
-
42
- $vars['name'] = ucfirst($vars['vendor']) . ucfirst($camelCasedName);
43
-
44
- return $vars;
45
- }
46
-
47
- /**
48
- * Changes the name to a underscore separated name
49
- * @param array $vars
50
- * @return array
51
- */
52
- private function correctThemeName($vars)
53
- {
54
- $vars['name'] = str_replace('-', '_', $vars['name']);
55
-
56
- return $vars;
57
- }
58
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/SilverStripeInstaller.php DELETED
@@ -1,36 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- use Composer\Package\PackageInterface;
5
-
6
- class SilverStripeInstaller extends BaseInstaller
7
- {
8
- protected $locations = array(
9
- 'module' => '{$name}/',
10
- 'theme' => 'themes/{$name}/',
11
- );
12
-
13
- /**
14
- * Return the install path based on package type.
15
- *
16
- * Relies on built-in BaseInstaller behaviour with one exception: silverstripe/framework
17
- * must be installed to 'sapphire' and not 'framework' if the version is <3.0.0
18
- *
19
- * @param PackageInterface $package
20
- * @param string $frameworkType
21
- * @return string
22
- */
23
- public function getInstallPath(PackageInterface $package, $frameworkType = '')
24
- {
25
- if (
26
- $package->getName() == 'silverstripe/framework'
27
- && preg_match('/^\d+\.\d+\.\d+/', $package->getVersion())
28
- && version_compare($package->getVersion(), '2.999.999') < 0
29
- ) {
30
- return $this->templatePath($this->locations['module'], array('name' => 'sapphire'));
31
- } else {
32
- return parent::getInstallPath($package, $frameworkType);
33
- }
34
-
35
- }
36
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/Symfony1Installer.php DELETED
@@ -1,26 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- /**
5
- * Plugin installer for symfony 1.x
6
- *
7
- * @author Jérôme Tamarelle <jerome@tamarelle.net>
8
- */
9
- class Symfony1Installer extends BaseInstaller
10
- {
11
- protected $locations = array(
12
- 'plugin' => 'plugins/{$name}/',
13
- );
14
-
15
- /**
16
- * Format package name to CamelCase
17
- */
18
- public function inflectPackageVars($vars)
19
- {
20
- $vars['name'] = preg_replace_callback('/(-[a-z])/', function ($matches) {
21
- return strtoupper($matches[0][1]);
22
- }, $vars['name']);
23
-
24
- return $vars;
25
- }
26
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php DELETED
@@ -1,14 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- /**
5
- * Extension installer for TYPO3 CMS
6
- *
7
- * @author Sascha Egerer <sascha.egerer@dkd.de>
8
- */
9
- class TYPO3CmsInstaller extends BaseInstaller
10
- {
11
- protected $locations = array(
12
- 'extension' => 'typo3conf/ext/{$name}/',
13
- );
14
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php DELETED
@@ -1,38 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- /**
5
- * An installer to handle TYPO3 Flow specifics when installing packages.
6
- */
7
- class TYPO3FlowInstaller extends BaseInstaller
8
- {
9
- protected $locations = array(
10
- 'package' => 'Packages/Application/{$name}/',
11
- 'framework' => 'Packages/Framework/{$name}/',
12
- 'plugin' => 'Packages/Plugins/{$name}/',
13
- 'site' => 'Packages/Sites/{$name}/',
14
- 'boilerplate' => 'Packages/Boilerplates/{$name}/',
15
- 'build' => 'Build/{$name}/',
16
- );
17
-
18
- /**
19
- * Modify the package name to be a TYPO3 Flow style key.
20
- *
21
- * @param array $vars
22
- * @return array
23
- */
24
- public function inflectPackageVars($vars)
25
- {
26
- $autoload = $this->package->getAutoload();
27
- if (isset($autoload['psr-0']) && is_array($autoload['psr-0'])) {
28
- $namespace = key($autoload['psr-0']);
29
- $vars['name'] = str_replace('\\', '.', $namespace);
30
- }
31
- if (isset($autoload['psr-4']) && is_array($autoload['psr-4'])) {
32
- $namespace = key($autoload['psr-4']);
33
- $vars['name'] = rtrim(str_replace('\\', '.', $namespace), '.');
34
- }
35
-
36
- return $vars;
37
- }
38
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/TheliaInstaller.php DELETED
@@ -1,12 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class TheliaInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'local/modules/{$name}/',
8
- 'frontoffice-template' => 'templates/frontOffice/{$name}/',
9
- 'backoffice-template' => 'templates/backOffice/{$name}/',
10
- 'email-template' => 'templates/email/{$name}/',
11
- );
12
- }
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/TuskInstaller.php DELETED
@@ -1,14 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
- /**
4
- * Composer installer for 3rd party Tusk utilities
5
- * @author Drew Ewing <drew@phenocode.com>
6
- */
7
- class TuskInstaller extends BaseInstaller
8
- {
9
- protected $locations = array(
10
- 'task' => '.tusk/tasks/{$name}/',
11
- 'command' => '.tusk/commands/{$name}/',
12
- 'asset' => 'assets/tusk/{$name}/',
13
- );
14
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/WHMCSInstaller.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- namespace Composer\Installers;
4
-
5
- class WHMCSInstaller extends BaseInstaller
6
- {
7
- protected $locations = array(
8
- 'gateway' => 'modules/gateways/{$name}/',
9
- );
10
- }
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/WolfCMSInstaller.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class WolfCMSInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'plugin' => 'wolf/plugins/{$name}/',
8
- );
9
- }
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/WordPressInstaller.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class WordPressInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'plugin' => 'wp-content/plugins/{$name}/',
8
- 'theme' => 'wp-content/themes/{$name}/',
9
- 'muplugin' => 'wp-content/mu-plugins/{$name}/',
10
- );
11
- }
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/ZendInstaller.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class ZendInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'library' => 'library/{$name}/',
8
- 'extra' => 'extras/library/{$name}/',
9
- 'module' => 'module/{$name}/',
10
- );
11
- }
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/Composer/Installers/ZikulaInstaller.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class ZikulaInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'modules/{$vendor}-{$name}/',
8
- 'theme' => 'themes/{$vendor}-{$name}/'
9
- );
10
- }
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/src/bootstrap.php DELETED
@@ -1,13 +0,0 @@
1
- <?php
2
- function includeIfExists($file)
3
- {
4
- if (file_exists($file)) {
5
- return include $file;
6
- }
7
- }
8
- if ((!$loader = includeIfExists(__DIR__ . '/../vendor/autoload.php')) && (!$loader = includeIfExists(__DIR__ . '/../../../autoload.php'))) {
9
- die('You must set up the project dependencies, run the following commands:'.PHP_EOL.
10
- 'curl -s http://getcomposer.org/installer | php'.PHP_EOL.
11
- 'php composer.phar install'.PHP_EOL);
12
- }
13
- return $loader;
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/tests/Composer/Installers/Test/AsgardInstallerTest.php DELETED
@@ -1,61 +0,0 @@
1
- <?php
2
- namespace Composer\Installers\Test;
3
-
4
- use Composer\Installers\AsgardInstaller;
5
- use Composer\Package\Package;
6
- use Composer\Composer;
7
-
8
- class AsgardInstallerTest extends \PHPUnit_Framework_TestCase
9
- {
10
- /**
11
- * @var OctoberInstaller
12
- */
13
- private $installer;
14
-
15
- public function setUp()
16
- {
17
- $this->installer = new AsgardInstaller(
18
- new Package('NyanCat', '4.2', '4.2'),
19
- new Composer()
20
- );
21
- }
22
-
23
- /**
24
- * @dataProvider packageNameInflectionProvider
25
- */
26
- public function testInflectPackageVars($type, $name, $expected)
27
- {
28
- $this->assertEquals(
29
- $this->installer->inflectPackageVars(array('name' => $name, 'type' => $type)),
30
- array('name' => $expected, 'type' => $type)
31
- );
32
- }
33
-
34
- public function packageNameInflectionProvider()
35
- {
36
- return array(
37
- array(
38
- 'asgard-module',
39
- 'asgard-module',
40
- 'Asgard'
41
- ),
42
- array(
43
- 'asgard-module',
44
- 'blog',
45
- 'Blog'
46
- ),
47
- // tests that exactly one '-theme' is cut off
48
- array(
49
- 'asgard-theme',
50
- 'some-theme-theme',
51
- 'Some-theme',
52
- ),
53
- // tests that names without '-theme' suffix stay valid
54
- array(
55
- 'asgard-theme',
56
- 'someothertheme',
57
- 'Someothertheme',
58
- ),
59
- );
60
- }
61
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/tests/Composer/Installers/Test/CakePHPInstallerTest.php DELETED
@@ -1,115 +0,0 @@
1
- <?php
2
- namespace Composer\Installers\Test;
3
-
4
- use Composer\Installers\CakePHPInstaller;
5
- use Composer\Repository\RepositoryManager;
6
- use Composer\Repository\InstalledArrayRepository;
7
- use Composer\Package\Package;
8
- use Composer\Package\RootPackage;
9
- use Composer\Package\Link;
10
- use Composer\Package\Version\VersionParser;
11
- use Composer\Composer;
12
- use Composer\Config;
13
-
14
- class CakePHPInstallerTest extends TestCase
15
- {
16
- private $composer;
17
- private $io;
18
-
19
- /**
20
- * setUp
21
- *
22
- * @return void
23
- */
24
- public function setUp()
25
- {
26
- $this->package = new Package('CamelCased', '1.0', '1.0');
27
- $this->io = $this->getMock('Composer\IO\PackageInterface');
28
- $this->composer = new Composer();
29
- $this->composer->setConfig(new Config(false));
30
- }
31
-
32
- /**
33
- * testInflectPackageVars
34
- *
35
- * @return void
36
- */
37
- public function testInflectPackageVars()
38
- {
39
- $installer = new CakePHPInstaller($this->package, $this->composer);
40
- $result = $installer->inflectPackageVars(array('name' => 'CamelCased'));
41
- $this->assertEquals($result, array('name' => 'CamelCased'));
42
-
43
- $installer = new CakePHPInstaller($this->package, $this->composer);
44
- $result = $installer->inflectPackageVars(array('name' => 'with-dash'));
45
- $this->assertEquals($result, array('name' => 'WithDash'));
46
-
47
- $installer = new CakePHPInstaller($this->package, $this->composer);
48
- $result = $installer->inflectPackageVars(array('name' => 'with_underscore'));
49
- $this->assertEquals($result, array('name' => 'WithUnderscore'));
50
-
51
- $installer = new CakePHPInstaller($this->package, $this->composer);
52
- $result = $installer->inflectPackageVars(array('name' => 'cake/acl'));
53
- $this->assertEquals($result, array('name' => 'Cake/Acl'));
54
-
55
- $installer = new CakePHPInstaller($this->package, $this->composer);
56
- $result = $installer->inflectPackageVars(array('name' => 'cake/debug-kit'));
57
- $this->assertEquals($result, array('name' => 'Cake/DebugKit'));
58
- }
59
-
60
- /**
61
- * Test getLocations returning appropriate values based on CakePHP version
62
- *
63
- */
64
- public function testGetLocations() {
65
- $package = new RootPackage('CamelCased', '1.0', '1.0');
66
- $composer = $this->composer;
67
- $rm = new RepositoryManager(
68
- $this->getMock('Composer\IO\IOInterface'),
69
- $this->getMock('Composer\Config')
70
- );
71
- $composer->setRepositoryManager($rm);
72
- $installer = new CakePHPInstaller($package, $composer);
73
-
74
- // 2.0 < cakephp < 3.0
75
- $this->setCakephpVersion($rm, '2.0.0');
76
- $result = $installer->getLocations();
77
- $this->assertContains('Plugin/', $result['plugin']);
78
-
79
- $this->setCakephpVersion($rm, '2.5.9');
80
- $result = $installer->getLocations();
81
- $this->assertContains('Plugin/', $result['plugin']);
82
-
83
- $this->setCakephpVersion($rm, '~2.5');
84
- $result = $installer->getLocations();
85
- $this->assertContains('Plugin/', $result['plugin']);
86
-
87
- // special handling for 2.x versions when 3.x is still in development
88
- $this->setCakephpVersion($rm, 'dev-master');
89
- $result = $installer->getLocations();
90
- $this->assertContains('Plugin/', $result['plugin']);
91
-
92
- $this->setCakephpVersion($rm, '>=2.5');
93
- $result = $installer->getLocations();
94
- $this->assertContains('Plugin/', $result['plugin']);
95
-
96
- // cakephp >= 3.0
97
- $this->setCakephpVersion($rm, '3.0.*-dev');
98
- $result = $installer->getLocations();
99
- $this->assertContains('vendor/{$vendor}/{$name}/', $result['plugin']);
100
-
101
- $this->setCakephpVersion($rm, '~8.8');
102
- $result = $installer->getLocations();
103
- $this->assertEquals('vendor/{$vendor}/{$name}/', $result['plugin']);
104
- }
105
-
106
- protected function setCakephpVersion($rm, $version) {
107
- $parser = new VersionParser();
108
- list(, $version) = explode(' ', $parser->parseConstraints($version));
109
- $installed = new InstalledArrayRepository();
110
- $package = new Package('cakephp/cakephp', $version, $version);
111
- $installed->addPackage($package);
112
- $rm->setLocalRepository($installed);
113
- }
114
-
115
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/tests/Composer/Installers/Test/DokuWikiInstallerTest.php DELETED
@@ -1,89 +0,0 @@
1
- <?php
2
- namespace Composer\Installers\Test;
3
-
4
- use Composer\Installers\DokuWikiInstaller;
5
- use Composer\Package\Package;
6
- use Composer\Composer;
7
-
8
- class DokuWikiInstallerTest extends \PHPUnit_Framework_TestCase
9
- {
10
- /**
11
- * @var DokuWikiInstaller
12
- */
13
- private $installer;
14
-
15
- public function setUp()
16
- {
17
- $this->installer = new DokuWikiInstaller(
18
- new Package('NyanCat', '4.2', '4.2'),
19
- new Composer()
20
- );
21
- }
22
-
23
- /**
24
- * @dataProvider packageNameInflectionProvider
25
- */
26
- public function testInflectPackageVars($type, $name, $expected)
27
- {
28
- $this->assertEquals(
29
- $this->installer->inflectPackageVars(array('name' => $name, 'type'=>$type)),
30
- array('name' => $expected, 'type'=>$type)
31
- );
32
- }
33
-
34
- public function packageNameInflectionProvider()
35
- {
36
- return array(
37
- array(
38
- 'dokuwiki-plugin',
39
- 'dokuwiki-test-plugin',
40
- 'test',
41
- ),
42
- array(
43
- 'dokuwiki-plugin',
44
- 'test-plugin',
45
- 'test',
46
- ),
47
- array(
48
- 'dokuwiki-plugin',
49
- 'dokuwiki_test',
50
- 'test',
51
- ),
52
- array(
53
- 'dokuwiki-plugin',
54
- 'test',
55
- 'test',
56
- ),
57
- array(
58
- 'dokuwiki-plugin',
59
- 'test-template',
60
- 'test-template',
61
- ),
62
- array(
63
- 'dokuwiki-template',
64
- 'dokuwiki-test-template',
65
- 'test',
66
- ),
67
- array(
68
- 'dokuwiki-template',
69
- 'test-template',
70
- 'test',
71
- ),
72
- array(
73
- 'dokuwiki-template',
74
- 'dokuwiki_test',
75
- 'test',
76
- ),
77
- array(
78
- 'dokuwiki-template',
79
- 'test',
80
- 'test',
81
- ),
82
- array(
83
- 'dokuwiki-template',
84
- 'test-plugin',
85
- 'test-plugin',
86
- ),
87
- );
88
- }
89
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/tests/Composer/Installers/Test/GravInstallerTest.php DELETED
@@ -1,63 +0,0 @@
1
- <?php
2
- namespace Composer\Installers\Test;
3
-
4
- use Composer\Composer;
5
- use Composer\Installers\GravInstaller;
6
-
7
- class GravInstallerTest extends TestCase
8
- {
9
- /* @var \Composer\Composer */
10
- protected $composer;
11
-
12
- public function setUp()
13
- {
14
- $this->composer = new Composer();
15
- }
16
-
17
- public function testInflectPackageVars()
18
- {
19
- $package = $this->getPackage('vendor/name', '0.0.0');
20
- $installer = new GravInstaller($package, $this->composer);
21
- $packageVars = $this->getPackageVars($package);
22
-
23
- $result = $installer->inflectPackageVars(array_merge($packageVars, array('name' => 'test')));
24
- $this->assertEquals('test', $result['name']);
25
-
26
- foreach ($installer->getLocations() as $name => $location) {
27
- $result = $installer->inflectPackageVars(array_merge($packageVars, array('name' => "$name-test")));
28
- $this->assertEquals('test', $result['name']);
29
- $result = $installer->inflectPackageVars(array_merge($packageVars, array('name' => "test-$name")));
30
- $this->assertEquals('test', $result['name']);
31
- $result = $installer->inflectPackageVars(array_merge($packageVars, array('name' => "$name-test-test")));
32
- $this->assertEquals('test-test', $result['name']);
33
- $result = $installer->inflectPackageVars(array_merge($packageVars, array('name' => "test-test-$name")));
34
- $this->assertEquals('test-test', $result['name']);
35
- $result = $installer->inflectPackageVars(array_merge($packageVars, array('name' => "grav-$name-test")));
36
- $this->assertEquals('test', $result['name']);
37
- $result = $installer->inflectPackageVars(array_merge($packageVars, array('name' => "grav-test-$name")));
38
- $this->assertEquals('test', $result['name']);
39
- $result = $installer->inflectPackageVars(array_merge($packageVars, array('name' => "grav-$name-test-test")));
40
- $this->assertEquals('test-test', $result['name']);
41
- $result = $installer->inflectPackageVars(array_merge($packageVars, array('name' => "grav-test-test-$name")));
42
- $this->assertEquals('test-test', $result['name']);
43
- }
44
- }
45
-
46
- /**
47
- * @param $package \Composer\Package\PackageInterface
48
- */
49
- public function getPackageVars($package)
50
- {
51
- $type = $package->getType();
52
-
53
- $prettyName = $package->getPrettyName();
54
- if (strpos($prettyName, '/') !== false) {
55
- list($vendor, $name) = explode('/', $prettyName);
56
- } else {
57
- $vendor = '';
58
- $name = $prettyName;
59
- }
60
-
61
- return compact('name', 'vendor', 'type');
62
- }
63
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/tests/Composer/Installers/Test/InstallerTest.php DELETED
@@ -1,422 +0,0 @@
1
- <?php
2
- namespace Composer\Installers\Test;
3
-
4
- use Composer\Installers\Installer;
5
- use Composer\Util\Filesystem;
6
- use Composer\Package\Package;
7
- use Composer\Package\RootPackage;
8
- use Composer\Composer;
9
- use Composer\Config;
10
-
11
- class InstallerTest extends TestCase
12
- {
13
- private $composer;
14
- private $config;
15
- private $vendorDir;
16
- private $binDir;
17
- private $dm;
18
- private $repository;
19
- private $io;
20
- private $fs;
21
-
22
- /**
23
- * setUp
24
- *
25
- * @return void
26
- */
27
- public function setUp()
28
- {
29
- $this->fs = new Filesystem;
30
-
31
- $this->composer = new Composer();
32
- $this->config = new Config();
33
- $this->composer->setConfig($this->config);
34
-
35
- $this->vendorDir = realpath(sys_get_temp_dir()) . DIRECTORY_SEPARATOR . 'baton-test-vendor';
36
- $this->ensureDirectoryExistsAndClear($this->vendorDir);
37
-
38
- $this->binDir = realpath(sys_get_temp_dir()) . DIRECTORY_SEPARATOR . 'baton-test-bin';
39
- $this->ensureDirectoryExistsAndClear($this->binDir);
40
-
41
- $this->config->merge(array(
42
- 'config' => array(
43
- 'vendor-dir' => $this->vendorDir,
44
- 'bin-dir' => $this->binDir,
45
- ),
46
- ));
47
-
48
- $this->dm = $this->getMockBuilder('Composer\Downloader\DownloadManager')
49
- ->disableOriginalConstructor()
50
- ->getMock();
51
- $this->composer->setDownloadManager($this->dm);
52
-
53
- $this->repository = $this->getMock('Composer\Repository\InstalledRepositoryInterface');
54
- $this->io = $this->getMock('Composer\IO\IOInterface');
55
- }
56
-
57
- /**
58
- * tearDown
59
- *
60
- * @return void
61
- */
62
- public function tearDown()
63
- {
64
- $this->fs->removeDirectory($this->vendorDir);
65
- $this->fs->removeDirectory($this->binDir);
66
- }
67
-
68
- /**
69
- * testSupports
70
- *
71
- * @return void
72
- *
73
- * @dataProvider dataForTestSupport
74
- */
75
- public function testSupports($type, $expected)
76
- {
77
- $installer = new Installer($this->io, $this->composer);
78
- $this->assertSame($expected, $installer->supports($type), sprintf('Failed to show support for %s', $type));
79
- }
80
-
81
- /**
82
- * dataForTestSupport
83
- */
84
- public function dataForTestSupport()
85
- {
86
- return array(
87
- array('agl-module', true),
88
- array('aimeos-extension', true),
89
- array('annotatecms-module', true),
90
- array('annotatecms-component', true),
91
- array('annotatecms-service', true),
92
- array('bitrix-module', true),
93
- array('bitrix-component', true),
94
- array('bitrix-theme', true),
95
- array('cakephp', false),
96
- array('cakephp-', false),
97
- array('cakephp-app', false),
98
- array('cakephp-plugin', true),
99
- array('chef-cookbook', true),
100
- array('chef-role', true),
101
- array('codeigniter-app', false),
102
- array('codeigniter-library', true),
103
- array('codeigniter-third-party', true),
104
- array('codeigniter-module', true),
105
- array('concrete5-block', true),
106
- array('concrete5-package', true),
107
- array('concrete5-theme', true),
108
- array('concrete5-update', true),
109
- array('craft-plugin', true),
110
- array('croogo-plugin', true),
111
- array('croogo-theme', true),
112
- array('dokuwiki-plugin', true),
113
- array('dokuwiki-template', true),
114
- array('drupal-module', true),
115
- array('dolibarr-module', true),
116
- array('elgg-plugin', true),
117
- array('fuel-module', true),
118
- array('fuel-package', true),
119
- array('fuel-theme', true),
120
- array('fuelphp-component', true),
121
- array('hurad-plugin', true),
122
- array('hurad-theme', true),
123
- array('joomla-library', true),
124
- array('kirby-plugin', true),
125
- array('kohana-module', true),
126
- array('laravel-library', true),
127
- array('lithium-library', true),
128
- array('magento-library', true),
129
- array('mako-package', true),
130
- array('modxevo-snippet', true),
131
- array('modxevo-plugin', true),
132
- array('modxevo-module', true),
133
- array('modxevo-template', true),
134
- array('modxevo-lib', true),
135
- array('mediawiki-extension', true),
136
- array('mediawiki-skin', true),
137
- array('microweber-module', true),
138
- array('modulework-module', true),
139
- array('moodle-mod', true),
140
- array('october-module', true),
141
- array('october-plugin', true),
142
- array('piwik-plugin', true),
143
- array('phpbb-extension', true),
144
- array('pimcore-plugin', true),
145
- array('ppi-module', true),
146
- array('prestashop-module', true),
147
- array('prestashop-theme', true),
148
- array('puppet-module', true),
149
- array('redaxo-addon', true),
150
- array('redaxo-bestyle-plugin', true),
151
- array('roundcube-plugin', true),
152
- array('shopware-backend-plugin', true),
153
- array('shopware-core-plugin', true),
154
- array('shopware-frontend-plugin', true),
155
- array('shopware-theme', true),
156
- array('silverstripe-module', true),
157
- array('silverstripe-theme', true),
158
- array('smf-module', true),
159
- array('smf-theme', true),
160
- array('symfony1-plugin', true),
161
- array('thelia-module', true),
162
- array('thelia-frontoffice-template', true),
163
- array('thelia-backoffice-template', true),
164
- array('thelia-email-template', true),
165
- array('tusk-task', true),
166
- array('tusk-asset', true),
167
- array('typo3-flow-plugin', true),
168
- array('typo3-cms-extension', true),
169
- array('whmcs-gateway', true),
170
- array('wolfcms-plugin', true),
171
- array('wordpress-plugin', true),
172
- array('wordpress-core', false),
173
- array('zend-library', true),
174
- array('zikula-module', true),
175
- array('zikula-theme', true),
176
- );
177
- }
178
-
179
- /**
180
- * testInstallPath
181
- *
182
- * @dataProvider dataForTestInstallPath
183
- */
184
- public function testInstallPath($type, $path, $name, $version = '1.0.0')
185
- {
186
- $installer = new Installer($this->io, $this->composer);
187
- $package = new Package($name, $version, $version);
188
-
189
- $package->setType($type);
190
- $result = $installer->getInstallPath($package);
191
- $this->assertEquals($path, $result);
192
- }
193
-
194
- /**
195
- * dataFormTestInstallPath
196
- */
197
- public function dataForTestInstallPath()
198
- {
199
- return array(
200
- array('agl-module', 'More/MyTestPackage/', 'agl/my_test-package'),
201
- array('aimeos-extension', 'ext/ai-test/', 'author/ai-test'),
202
- array('annotatecms-module', 'addons/modules/my_module/', 'vysinsky/my_module'),
203
- array('annotatecms-component', 'addons/components/my_component/', 'vysinsky/my_component'),
204
- array('annotatecms-service', 'addons/services/my_service/', 'vysinsky/my_service'),
205
- array('bitrix-module', 'local/modules/my_module/', 'author/my_module'),
206
- array('bitrix-component', 'local/components/my_component/', 'author/my_component'),
207
- array('bitrix-theme', 'local/templates/my_theme/', 'author/my_theme'),
208
- array('cakephp-plugin', 'Plugin/Ftp/', 'shama/ftp'),
209
- array('chef-cookbook', 'Chef/mre/my_cookbook/', 'mre/my_cookbook'),
210
- array('chef-role', 'Chef/roles/my_role/', 'mre/my_role'),
211
- array('codeigniter-library', 'application/libraries/my_package/', 'shama/my_package'),
212
- array('codeigniter-module', 'application/modules/my_package/', 'shama/my_package'),
213
- array('concrete5-block', 'blocks/concrete5_block/', 'remo/concrete5_block'),
214
- array('concrete5-package', 'packages/concrete5_package/', 'remo/concrete5_package'),
215
- array('concrete5-theme', 'themes/concrete5_theme/', 'remo/concrete5_theme'),
216
- array('concrete5-update', 'updates/concrete5/', 'concrete5/concrete5'),
217
- array('craft-plugin', 'craft/plugins/my_plugin/', 'mdcpepper/my_plugin'),
218
- array('croogo-plugin', 'Plugin/Sitemaps/', 'fahad19/sitemaps'),
219
- array('croogo-theme', 'View/Themed/Readable/', 'rchavik/readable'),
220
- array('dokuwiki-plugin', 'lib/plugins/someplugin/', 'author/someplugin'),
221
- array('dokuwiki-template', 'lib/tpl/sometemplate/', 'author/sometemplate'),
222
- array('dolibarr-module', 'htdocs/custom/my_module/', 'shama/my_module'),
223
- array('drupal-module', 'modules/my_module/', 'shama/my_module'),
224
- array('drupal-theme', 'themes/my_module/', 'shama/my_module'),
225
- array('drupal-profile', 'profiles/my_module/', 'shama/my_module'),
226
- array('drupal-drush', 'drush/my_module/', 'shama/my_module'),
227
- array('elgg-plugin', 'mod/sample_plugin/', 'test/sample_plugin'),
228
- array('fuel-module', 'fuel/app/modules/module/', 'fuel/module'),
229
- array('fuel-package', 'fuel/packages/orm/', 'fuel/orm'),
230
- array('fuel-theme', 'fuel/app/themes/theme/', 'fuel/theme'),
231
- array('fuelphp-component', 'components/demo/', 'fuelphp/demo'),
232
- array('hurad-plugin', 'plugins/Akismet/', 'atkrad/akismet'),
233
- array('hurad-theme', 'plugins/Hurad2013/', 'atkrad/Hurad2013'),
234
- array('joomla-plugin', 'plugins/my_plugin/', 'shama/my_plugin'),
235
- array('kirby-plugin', 'site/plugins/my_plugin/', 'shama/my_plugin'),
236
- array('kohana-module', 'modules/my_package/', 'shama/my_package'),
237
- array('laravel-library', 'libraries/my_package/', 'shama/my_package'),
238
- array('lithium-library', 'libraries/li3_test/', 'user/li3_test'),
239
- array('magento-library', 'lib/foo/', 'test/foo'),
240
- array('modxevo-snippet', 'assets/snippets/my_snippet/', 'shama/my_snippet'),
241
- array('modxevo-plugin', 'assets/plugins/my_plugin/', 'shama/my_plugin'),
242
- array('modxevo-module', 'assets/modules/my_module/', 'shama/my_module'),
243
- array('modxevo-template', 'assets/templates/my_template/', 'shama/my_template'),
244
- array('modxevo-lib', 'assets/lib/my_lib/', 'shama/my_lib'),
245
- array('mako-package', 'app/packages/my_package/', 'shama/my_package'),
246
- array('mediawiki-extension', 'extensions/APC/', 'author/APC'),
247
- array('mediawiki-extension', 'extensions/APC/', 'author/APC-extension'),
248
- array('mediawiki-extension', 'extensions/UploadWizard/', 'author/upload-wizard'),
249
- array('mediawiki-extension', 'extensions/SyntaxHighlight_GeSHi/', 'author/syntax-highlight_GeSHi'),
250
- array('mediawiki-skin', 'skins/someskin/', 'author/someskin-skin'),
251
- array('mediawiki-skin', 'skins/someskin/', 'author/someskin'),
252
- array('microweber-module', 'userfiles/modules/my-thing/', 'author/my-thing-module'),
253
- array('modulework-module', 'modules/my_package/', 'shama/my_package'),
254
- array('moodle-mod', 'mod/my_package/', 'shama/my_package'),
255
- array('october-module', 'modules/my_plugin/', 'shama/my_plugin'),
256
- array('october-plugin', 'plugins/shama/my_plugin/', 'shama/my_plugin'),
257
- array('october-theme', 'themes/my_theme/', 'shama/my_theme'),
258
- array('piwik-plugin', 'plugins/VisitSummary/', 'shama/visit-summary'),
259
- array('prestashop-module', 'modules/a-module/', 'vendor/a-module'),
260
- array('prestashop-theme', 'themes/a-theme/', 'vendor/a-theme'),
261
- array('phpbb-extension', 'ext/test/foo/', 'test/foo'),
262
- array('phpbb-style', 'styles/foo/', 'test/foo'),
263
- array('phpbb-language', 'language/foo/', 'test/foo'),
264
- array('pimcore-plugin', 'plugins/MyPlugin/', 'ubikz/my_plugin'),
265
- array('ppi-module', 'modules/foo/', 'test/foo'),
266
- array('puppet-module', 'modules/puppet-name/', 'puppet/puppet-name'),
267
- array('redaxo-addon', 'redaxo/include/addons/my_plugin/', 'shama/my_plugin'),
268
- array('redaxo-bestyle-plugin', 'redaxo/include/addons/be_style/plugins/my_plugin/', 'shama/my_plugin'),
269
- array('roundcube-plugin', 'plugins/base/', 'test/base'),
270
- array('roundcube-plugin', 'plugins/replace_dash/', 'test/replace-dash'),
271
- array('shopware-backend-plugin', 'engine/Shopware/Plugins/Local/Backend/ShamaMyBackendPlugin/', 'shama/my-backend-plugin'),
272
- array('shopware-core-plugin', 'engine/Shopware/Plugins/Local/Core/ShamaMyCorePlugin/', 'shama/my-core-plugin'),
273
- array('shopware-frontend-plugin', 'engine/Shopware/Plugins/Local/Frontend/ShamaMyFrontendPlugin/', 'shama/my-frontend-plugin'),
274
- array('shopware-theme', 'templates/my_theme/', 'shama/my-theme'),
275
- array('silverstripe-module', 'my_module/', 'shama/my_module'),
276
- array('silverstripe-module', 'sapphire/', 'silverstripe/framework', '2.4.0'),
277
- array('silverstripe-module', 'framework/', 'silverstripe/framework', '3.0.0'),
278
- array('silverstripe-module', 'framework/', 'silverstripe/framework', '3.0.0-rc1'),
279
- array('silverstripe-module', 'framework/', 'silverstripe/framework', 'my/branch'),
280
- array('silverstripe-theme', 'themes/my_theme/', 'shama/my_theme'),
281
- array('smf-module', 'Sources/my_module/', 'shama/my_module'),
282
- array('smf-theme', 'Themes/my_theme/', 'shama/my_theme'),
283
- array('symfony1-plugin', 'plugins/sfShamaPlugin/', 'shama/sfShamaPlugin'),
284
- array('symfony1-plugin', 'plugins/sfShamaPlugin/', 'shama/sf-shama-plugin'),
285
- array('thelia-module', 'local/modules/my_module/', 'shama/my_module'),
286
- array('thelia-frontoffice-template', 'templates/frontOffice/my_template_fo/', 'shama/my_template_fo'),
287
- array('thelia-backoffice-template', 'templates/backOffice/my_template_bo/', 'shama/my_template_bo'),
288
- array('thelia-email-template', 'templates/email/my_template_email/', 'shama/my_template_email'),
289
- array('tusk-task', '.tusk/tasks/my_task/', 'shama/my_task'),
290
- array('typo3-flow-package', 'Packages/Application/my_package/', 'shama/my_package'),
291
- array('typo3-flow-build', 'Build/my_package/', 'shama/my_package'),
292
- array('typo3-cms-extension', 'typo3conf/ext/my_extension/', 'shama/my_extension'),
293
- array('whmcs-gateway', 'modules/gateways/gateway_name/', 'vendor/gateway_name'),
294
- array('wolfcms-plugin', 'wolf/plugins/my_plugin/', 'shama/my_plugin'),
295
- array('wordpress-plugin', 'wp-content/plugins/my_plugin/', 'shama/my_plugin'),
296
- array('wordpress-muplugin', 'wp-content/mu-plugins/my_plugin/', 'shama/my_plugin'),
297
- array('zend-extra', 'extras/library/zend_test/', 'shama/zend_test'),
298
- array('zikula-module', 'modules/my-test_module/', 'my/test_module'),
299
- array('zikula-theme', 'themes/my-test_theme/', 'my/test_theme'),
300
- );
301
- }
302
-
303
- /**
304
- * testGetCakePHPInstallPathException
305
- *
306
- * @return void
307
- *
308
- * @expectedException \InvalidArgumentException
309
- */
310
- public function testGetCakePHPInstallPathException()
311
- {
312
- $installer = new Installer($this->io, $this->composer);
313
- $package = new Package('shama/ftp', '1.0.0', '1.0.0');
314
-
315
- $package->setType('cakephp-whoops');
316
- $result = $installer->getInstallPath($package);
317
- }
318
-
319
- /**
320
- * testCustomInstallPath
321
- */
322
- public function testCustomInstallPath()
323
- {
324
- $installer = new Installer($this->io, $this->composer);
325
- $package = new Package('shama/ftp', '1.0.0', '1.0.0');
326
- $package->setType('cakephp-plugin');
327
- $consumerPackage = new RootPackage('foo/bar', '1.0.0', '1.0.0');
328
- $this->composer->setPackage($consumerPackage);
329
- $consumerPackage->setExtra(array(
330
- 'installer-paths' => array(
331
- 'my/custom/path/{$name}/' => array(
332
- 'shama/ftp',
333
- 'foo/bar',
334
- ),
335
- ),
336
- ));
337
- $result = $installer->getInstallPath($package);
338
- $this->assertEquals('my/custom/path/Ftp/', $result);
339
- }
340
-
341
- /**
342
- * testCustomInstallerName
343
- */
344
- public function testCustomInstallerName()
345
- {
346
- $installer = new Installer($this->io, $this->composer);
347
- $package = new Package('shama/cakephp-ftp-plugin', '1.0.0', '1.0.0');
348
- $package->setType('cakephp-plugin');
349
- $package->setExtra(array(
350
- 'installer-name' => 'FTP',
351
- ));
352
- $result = $installer->getInstallPath($package);
353
- $this->assertEquals('Plugin/FTP/', $result);
354
- }
355
-
356
- /**
357
- * testCustomTypePath
358
- */
359
- public function testCustomTypePath()
360
- {
361
- $installer = new Installer($this->io, $this->composer);
362
- $package = new Package('slbmeh/my_plugin', '1.0.0', '1.0.0');
363
- $package->setType('wordpress-plugin');
364
- $consumerPackage = new RootPackage('foo/bar', '1.0.0', '1.0.0');
365
- $this->composer->setPackage($consumerPackage);
366
- $consumerPackage->setExtra(array(
367
- 'installer-paths' => array(
368
- 'my/custom/path/{$name}/' => array(
369
- 'type:wordpress-plugin'
370
- ),
371
- ),
372
- ));
373
- $result = $installer->getInstallPath($package);
374
- $this->assertEquals('my/custom/path/my_plugin/', $result);
375
- }
376
-
377
- /**
378
- * testNoVendorName
379
- */
380
- public function testNoVendorName()
381
- {
382
- $installer = new Installer($this->io, $this->composer);
383
- $package = new Package('sfPhpunitPlugin', '1.0.0', '1.0.0');
384
-
385
- $package->setType('symfony1-plugin');
386
- $result = $installer->getInstallPath($package);
387
- $this->assertEquals('plugins/sfPhpunitPlugin/', $result);
388
- }
389
-
390
- /**
391
- * testTypo3Inflection
392
- */
393
- public function testTypo3Inflection()
394
- {
395
- $installer = new Installer($this->io, $this->composer);
396
- $package = new Package('typo3/fluid', '1.0.0', '1.0.0');
397
-
398
- $package->setAutoload(array(
399
- 'psr-0' => array(
400
- 'TYPO3\\Fluid' => 'Classes',
401
- ),
402
- ));
403
-
404
- $package->setType('typo3-flow-package');
405
- $result = $installer->getInstallPath($package);
406
- $this->assertEquals('Packages/Application/TYPO3.Fluid/', $result);
407
- }
408
-
409
- public function testUninstallAndDeletePackageFromLocalRepo()
410
- {
411
- $package = new Package('foo', '1.0.0', '1.0.0');
412
-
413
- $installer = $this->getMock('Composer\Installers\Installer', array('getInstallPath'), array($this->io, $this->composer));
414
- $installer->expects($this->once())->method('getInstallPath')->with($package)->will($this->returnValue(sys_get_temp_dir().'/foo'));
415
-
416
- $repo = $this->getMock('Composer\Repository\InstalledRepositoryInterface');
417
- $repo->expects($this->once())->method('hasPackage')->with($package)->will($this->returnValue(true));
418
- $repo->expects($this->once())->method('removePackage')->with($package);
419
-
420
- $installer->uninstall($repo, $package);
421
- }
422
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/tests/Composer/Installers/Test/MediaWikiInstallerTest.php DELETED
@@ -1,66 +0,0 @@
1
- <?php
2
- namespace Composer\Installers\Test;
3
-
4
- use Composer\Installers\MediaWikiInstaller;
5
- use Composer\Package\Package;
6
- use Composer\Composer;
7
-
8
- class MediaWikiInstallerTest extends \PHPUnit_Framework_TestCase
9
- {
10
- /**
11
- * @var MediaWikiInstaller
12
- */
13
- private $installer;
14
-
15
- public function setUp()
16
- {
17
- $this->installer = new MediaWikiInstaller(
18
- new Package('NyanCat', '4.2', '4.2'),
19
- new Composer()
20
- );
21
- }
22
-
23
- /**
24
- * @dataProvider packageNameInflectionProvider
25
- */
26
- public function testInflectPackageVars($type, $name, $expected)
27
- {
28
- $this->assertEquals(
29
- $this->installer->inflectPackageVars(array('name' => $name, 'type'=>$type)),
30
- array('name' => $expected, 'type'=>$type)
31
- );
32
- }
33
-
34
- public function packageNameInflectionProvider()
35
- {
36
- return array(
37
- array(
38
- 'mediawiki-extension',
39
- 'sub-page-list',
40
- 'SubPageList',
41
- ),
42
- array(
43
- 'mediawiki-extension',
44
- 'sub-page-list-extension',
45
- 'SubPageList',
46
- ),
47
- array(
48
- 'mediawiki-extension',
49
- 'semantic-mediawiki',
50
- 'SemanticMediawiki',
51
- ),
52
- // tests that exactly one '-skin' is cut off, and that skins do not get ucwords treatment like extensions
53
- array(
54
- 'mediawiki-skin',
55
- 'some-skin-skin',
56
- 'some-skin',
57
- ),
58
- // tests that names without '-skin' suffix stay valid
59
- array(
60
- 'mediawiki-skin',
61
- 'someotherskin',
62
- 'someotherskin',
63
- ),
64
- );
65
- }
66
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/tests/Composer/Installers/Test/OctoberInstallerTest.php DELETED
@@ -1,66 +0,0 @@
1
- <?php
2
- namespace Composer\Installers\Test;
3
-
4
- use Composer\Installers\OctoberInstaller;
5
- use Composer\Package\Package;
6
- use Composer\Composer;
7
-
8
- class OctoberInstallerTest extends \PHPUnit_Framework_TestCase
9
- {
10
- /**
11
- * @var OctoberInstaller
12
- */
13
- private $installer;
14
-
15
- public function setUp()
16
- {
17
- $this->installer = new OctoberInstaller(
18
- new Package('NyanCat', '4.2', '4.2'),
19
- new Composer()
20
- );
21
- }
22
-
23
- /**
24
- * @dataProvider packageNameInflectionProvider
25
- */
26
- public function testInflectPackageVars($type, $name, $expected)
27
- {
28
- $this->assertEquals(
29
- $this->installer->inflectPackageVars(array('name' => $name, 'type' => $type)),
30
- array('name' => $expected, 'type' => $type)
31
- );
32
- }
33
-
34
- public function packageNameInflectionProvider()
35
- {
36
- return array(
37
- array(
38
- 'october-plugin',
39
- 'subpagelist',
40
- 'subpagelist',
41
- ),
42
- array(
43
- 'october-plugin',
44
- 'subpagelist-plugin',
45
- 'subpagelist',
46
- ),
47
- array(
48
- 'october-plugin',
49
- 'semanticoctober',
50
- 'semanticoctober',
51
- ),
52
- // tests that exactly one '-theme' is cut off
53
- array(
54
- 'october-theme',
55
- 'some-theme-theme',
56
- 'some-theme',
57
- ),
58
- // tests that names without '-theme' suffix stay valid
59
- array(
60
- 'october-theme',
61
- 'someothertheme',
62
- 'someothertheme',
63
- ),
64
- );
65
- }
66
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/tests/Composer/Installers/Test/PimcoreInstallerTest.php DELETED
@@ -1,44 +0,0 @@
1
- <?php
2
- namespace Composer\Installers\Test;
3
-
4
- use Composer\Installers\PimcoreInstaller;
5
- use Composer\Package\Package;
6
- use Composer\Composer;
7
-
8
- class PimcoreInstallerTest extends TestCase
9
- {
10
- private $composer;
11
- private $io;
12
-
13
- /**
14
- * setUp
15
- *
16
- * @return void
17
- */
18
- public function setUp()
19
- {
20
- $this->package = new Package('CamelCased', '1.0', '1.0');
21
- $this->io = $this->getMock('Composer\IO\PackageInterface');
22
- $this->composer = new Composer();
23
- }
24
-
25
- /**
26
- * testInflectPackageVars
27
- *
28
- * @return void
29
- */
30
- public function testInflectPackageVars()
31
- {
32
- $installer = new PimcoreInstaller($this->package, $this->composer);
33
- $result = $installer->inflectPackageVars(array('name' => 'CamelCased'));
34
- $this->assertEquals($result, array('name' => 'CamelCased'));
35
-
36
- $installer = new PimcoreInstaller($this->package, $this->composer);
37
- $result = $installer->inflectPackageVars(array('name' => 'with-dash'));
38
- $this->assertEquals($result, array('name' => 'WithDash'));
39
-
40
- $installer = new PimcoreInstaller($this->package, $this->composer);
41
- $result = $installer->inflectPackageVars(array('name' => 'with_underscore'));
42
- $this->assertEquals($result, array('name' => 'WithUnderscore'));
43
- }
44
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/tests/Composer/Installers/Test/PiwikInstallerTest.php DELETED
@@ -1,63 +0,0 @@
1
- <?php
2
- namespace Composer\Installers\Test;
3
-
4
- use Composer\Composer;
5
- use Composer\Installers\PiwikInstaller;
6
- use Composer\Package\Package;
7
- use Composer\Package\PackageInterface;
8
-
9
- /**
10
- * Class PiwikInstallerTest
11
- *
12
- * @package Composer\Installers\Test
13
- */
14
- class PiwikInstallerTest extends TestCase
15
- {
16
- /**
17
- * @varComposer
18
- */
19
- private $composer;
20
-
21
- /**
22
- * @var PackageInterface
23
- */
24
- private $io;
25
-
26
- /**
27
- * @var Package
28
- */
29
- private $package;
30
-
31
- /**
32
- * setUp
33
- *
34
- * @return void
35
- */
36
- public function setUp()
37
- {
38
- $this->package = new Package('VisitSummary', '1.0', '1.0');
39
- $this->io = $this->getMock('Composer\IO\PackageInterface');
40
- $this->composer = new Composer();
41
- }
42
-
43
- /**
44
- * testInflectPackageVars
45
- *
46
- * @return void
47
- */
48
- public function testInflectPackageVars()
49
- {
50
- $installer = new PiwikInstaller($this->package, $this->composer);
51
- $result = $installer->inflectPackageVars(array('name' => 'VisitSummary'));
52
- $this->assertEquals($result, array('name' => 'VisitSummary'));
53
-
54
- $installer = new PiwikInstaller($this->package, $this->composer);
55
- $result = $installer->inflectPackageVars(array('name' => 'visit-summary'));
56
- $this->assertEquals($result, array('name' => 'VisitSummary'));
57
-
58
- $installer = new PiwikInstaller($this->package, $this->composer);
59
- $result = $installer->inflectPackageVars(array('name' => 'visit_summary'));
60
- $this->assertEquals($result, array('name' => 'VisitSummary'));
61
- }
62
-
63
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/tests/Composer/Installers/Test/TestCase.php DELETED
@@ -1,64 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Composer.
5
- *
6
- * (c) Nils Adermann <naderman@naderman.de>
7
- * Jordi Boggiano <j.boggiano@seld.be>
8
- *
9
- * For the full copyright and license information, please view the LICENSE
10
- * file that was distributed with this source code.
11
- */
12
-
13
- namespace Composer\Installers\Test;
14
-
15
- use Composer\Package\Version\VersionParser;
16
- use Composer\Package\Package;
17
- use Composer\Package\AliasPackage;
18
- use Composer\Package\LinkConstraint\VersionConstraint;
19
- use Composer\Util\Filesystem;
20
-
21
- abstract class TestCase extends \PHPUnit_Framework_TestCase
22
- {
23
- private static $parser;
24
-
25
- protected static function getVersionParser()
26
- {
27
- if (!self::$parser) {
28
- self::$parser = new VersionParser();
29
- }
30
-
31
- return self::$parser;
32
- }
33
-
34
- protected function getVersionConstraint($operator, $version)
35
- {
36
- return new VersionConstraint(
37
- $operator,
38
- self::getVersionParser()->normalize($version)
39
- );
40
- }
41
-
42
- protected function getPackage($name, $version)
43
- {
44
- $normVersion = self::getVersionParser()->normalize($version);
45
-
46
- return new Package($name, $normVersion, $version);
47
- }
48
-
49
- protected function getAliasPackage($package, $version)
50
- {
51
- $normVersion = self::getVersionParser()->normalize($version);
52
-
53
- return new AliasPackage($package, $normVersion, $version);
54
- }
55
-
56
- protected function ensureDirectoryExistsAndClear($directory)
57
- {
58
- $fs = new Filesystem();
59
- if (is_dir($directory)) {
60
- $fs->removeDirectory($directory);
61
- }
62
- mkdir($directory, 0777, true);
63
- }
64
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/vendor/composer/installers/tests/bootstrap.php DELETED
@@ -1,4 +0,0 @@
1
- <?php
2
-
3
- $loader = require __DIR__ . '/../src/bootstrap.php';
4
- $loader->add('Composer\Installers\Test', __DIR__);
 
 
 
 
js/.jscsrc DELETED
@@ -1,113 +0,0 @@
1
- {
2
- "requireSpacesInConditionalExpression": true,
3
- "requireSpacesInFunction": {
4
- "beforeOpeningCurlyBrace": true
5
- },
6
- "disallowSpacesInFunction": {
7
- "beforeOpeningRoundBrace": true
8
- },
9
- "requireMultipleVarDecl": "onevar",
10
- "requireSpacesInsideObjectBrackets": "all",
11
- "disallowSpaceAfterObjectKeys": true,
12
- "requireSpaceAfterBinaryOperators": [
13
- "=", "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=",
14
- "&=", "|=", "^=", "+=",
15
-
16
- "+", "-", "*", "/", "%", "<<", ">>", ">>>", "&",
17
- "|", "^", "&&", "||", "===", "==", ">=",
18
- "<=", "<", ">", "!=", "!=="
19
- ],
20
- "requireSpaceBeforeBinaryOperators": [
21
- "=", "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=",
22
- "&=", "|=", "^=", "+=",
23
-
24
- "+", "-", "*", "/", "%", "<<", ">>", ">>>", "&",
25
- "|", "^", "&&", "||", "===", "==", ">=",
26
- "<=", "<", ">", "!=", "!=="
27
- ],
28
- "disallowKeywords": ["with"],
29
- "disallowMultipleLineBreaks": true,
30
- "validateLineBreaks": "LF",
31
- "disallowMixedSpacesAndTabs": "smart",
32
- "disallowTrailingWhitespace": true,
33
-
34
- "requireCurlyBraces": [ "if", "else", "for", "while", "do", "try", "catch" ],
35
- "requireSpaceBeforeBlockStatements": true,
36
- "requireParenthesesAroundIIFE": true,
37
- "requireBlocksOnNewline": true,
38
- "requireOperatorBeforeLineBreak": [
39
- "?",
40
- "=",
41
- "+",
42
- "-",
43
- "/",
44
- "*",
45
- "==",
46
- "===",
47
- "!=",
48
- "!==",
49
- ">",
50
- ">=",
51
- "<",
52
- "<="
53
- ],
54
- "requireSpaceBeforeBinaryOperators": [
55
- "?",
56
- "=",
57
- "+",
58
- "-",
59
- "/",
60
- "*",
61
- "==",
62
- "===",
63
- "!=",
64
- "!==",
65
- ">",
66
- ">=",
67
- "<",
68
- "<="
69
- ],
70
- "requireSpaceAfterBinaryOperators": [
71
- "?",
72
- "=",
73
- "+",
74
- "/",
75
- "*",
76
- ":",
77
- "==",
78
- "===",
79
- "!=",
80
- "!==",
81
- ">",
82
- ">=",
83
- "<",
84
- "<="
85
- ],
86
- "disallowSpaceBeforeBinaryOperators": [","],
87
- "disallowSpaceAfterBinaryOperators": [],
88
- "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~"],
89
- "requireSpaceAfterPrefixUnaryOperators": ["!"],
90
- "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
91
- "requireCamelCaseOrUpperCaseIdentifiers": true,
92
- "disallowMultipleLineStrings": true,
93
- "validateQuoteMarks": "'",
94
- "validateIndentation": "\t",
95
- "requireLineFeedAtFileEnd": true,
96
- "requireDotNotation": true,
97
- "disallowNewlineBeforeBlockStatements": true,
98
-
99
- "disallowTrailingComma": true,
100
- "disallowPaddingNewlinesInBlocks": true,
101
- "disallowEmptyBlocks": true,
102
- "disallowQuotedKeysInObjects": "allButReserved",
103
- "disallowDanglingUnderscores": true,
104
- "requireCommaBeforeLineBreak": true,
105
- "disallowKeywordsOnNewLine": ["else"],
106
- "requireCapitalizedConstructors": true,
107
- "safeContextKeyword": [ "that" ],
108
- "validateJSDoc": {
109
- "checkParamNames": true,
110
- "checkRedundantParams": true,
111
- "requireParamTypes": true
112
- }
113
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/.jshintrc DELETED
@@ -1,24 +0,0 @@
1
- {
2
- "boss": true,
3
- "curly": true,
4
- "eqeqeq": true,
5
- "eqnull": true,
6
- "es3": true,
7
- "immed": true,
8
- "latedef": true,
9
- "newcap": true,
10
- "noarg": true,
11
- "quotmark": "single",
12
- "sub": true,
13
- "strict": true,
14
- "undef": true,
15
- "unused": true,
16
-
17
- "browser": true,
18
- "jquery": true,
19
-
20
- "globals": {
21
- "exports": true,
22
- "module": false
23
- }
24
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/dist/wpFeatherlight.pkgd.min.js DELETED
@@ -1 +0,0 @@
1
- !function(e){"use strict";function t(){this.removeEventListener("touchmove",n),this.removeEventListener("touchend",t),s=!1}function n(n){if(e.detectSwipe.preventDefault&&n.preventDefault(),s){var r,i=n.touches[0].pageX,c=n.touches[0].pageY,u=a-i,l=o-c;Math.abs(u)>=e.detectSwipe.threshold?r=u>0?"left":"right":Math.abs(l)>=e.detectSwipe.threshold&&(r=l>0?"down":"up"),r&&(t.call(this),e(this).trigger("swipe",r).trigger("swipe"+r))}}function r(e){1==e.touches.length&&(a=e.touches[0].pageX,o=e.touches[0].pageY,s=!0,this.addEventListener("touchmove",n,!1),this.addEventListener("touchend",t,!1))}function i(){this.addEventListener&&this.addEventListener("touchstart",r,!1)}e.detectSwipe={version:"2.1.1",enabled:"ontouchstart"in document.documentElement,preventDefault:!0,threshold:20};var a,o,s=!1;e.event.special.swipe={setup:i},e.each(["left","up","down","right"],function(){e.event.special["swipe"+this]={setup:function(){e(this).on("swipe",e.noop)}}})}(jQuery),function(e){"use strict";function t(e,n){if(!(this instanceof t)){var r=new t(e,n);return r.open(),r}this.id=t.id++,this.setup(e,n),this.chainCallbacks(t._callbackChain)}if("undefined"==typeof e)return void("console"in window&&window.console.info("Too much lightness, Featherlight needs jQuery."));var n=[],r=function(t){return n=e.grep(n,function(e){return e!==t&&e.$instance.closest("body").length>0})},i=function(e,t){var n={},r=new RegExp("^"+t+"([A-Z])(.*)");for(var i in e){var a=i.match(r);if(a){var o=(a[1]+a[2].replace(/([A-Z])/g,"-$1")).toLowerCase();n[o]=e[i]}}return n},a={keyup:"onKeyUp",resize:"onResize"},o=function(n){e.each(t.opened().reverse(),function(){return n.isDefaultPrevented()||!1!==this[a[n.type]](n)?void 0:(n.preventDefault(),n.stopPropagation(),!1)})},s=function(n){if(n!==t._globalHandlerInstalled){t._globalHandlerInstalled=n;var r=e.map(a,function(e,n){return n+"."+t.prototype.namespace}).join(" ");e(window)[n?"on":"off"](r,o)}};t.prototype={constructor:t,namespace:"featherlight",targetAttr:"data-featherlight",variant:null,resetCss:!1,background:null,openTrigger:"click",closeTrigger:"click",filter:null,root:"body",openSpeed:250,closeSpeed:250,closeOnClick:"background",closeOnEsc:!0,closeIcon:"&#10005;",loading:"",otherClose:null,beforeOpen:e.noop,beforeContent:e.noop,beforeClose:e.noop,afterOpen:e.noop,afterContent:e.noop,afterClose:e.noop,onKeyUp:e.noop,onResize:e.noop,type:null,contentFilters:["jquery","image","html","ajax","iframe","text"],setup:function(t,n){"object"!=typeof t||t instanceof e!=!1||n||(n=t,t=void 0);var r=e.extend(this,n,{target:t}),i=r.resetCss?r.namespace+"-reset":r.namespace,a=e(r.background||['<div class="'+i+"-loading "+i+'">','<div class="'+i+'-content">','<span class="'+i+"-close-icon "+r.namespace+'-close">',r.closeIcon,"</span>",'<div class="'+r.namespace+'-inner">'+r.loading+"</div>","</div>","</div>"].join("")),o="."+r.namespace+"-close"+(r.otherClose?","+r.otherClose:"");return r.$instance=a.clone().addClass(r.variant),r.$instance.on(r.closeTrigger+"."+r.namespace,function(t){var n=e(t.target);("background"===r.closeOnClick&&n.is("."+r.namespace)||"anywhere"===r.closeOnClick||n.closest(o).length)&&(t.preventDefault(),r.close())}),this},getContent:function(){var t=this,n=this.constructor.contentFilters,r=function(e){return t.$currentTarget&&t.$currentTarget.attr(e)},i=r(t.targetAttr),a=t.target||i||"",o=n[t.type];if(!o&&a in n&&(o=n[a],a=t.target&&i),a=a||r("href")||"",!o)for(var s in n)t[s]&&(o=n[s],a=t[s]);if(!o){var c=a;if(a=null,e.each(t.contentFilters,function(){return o=n[this],o.test&&(a=o.test(c)),!a&&o.regex&&c.match&&c.match(o.regex)&&(a=c),!a}),!a)return"console"in window&&window.console.error("Featherlight: no content filter found "+(c?' for "'+c+'"':" (no target specified)")),!1}return o.process.call(t,a)},setContent:function(t){var n=this;return(t.is("iframe")||e("iframe",t).length>0)&&n.$instance.addClass(n.namespace+"-iframe"),n.$instance.removeClass(n.namespace+"-loading"),n.$instance.find("."+n.namespace+"-inner").slice(1).remove().end().replaceWith(e.contains(n.$instance[0],t[0])?"":t),n.$content=t.addClass(n.namespace+"-inner"),n},open:function(t){var r=this;if(r.$instance.hide().appendTo(r.root),!(t&&t.isDefaultPrevented()||r.beforeOpen(t)===!1)){t&&t.preventDefault();var i=r.getContent();if(i)return n.push(r),s(!0),r.$instance.fadeIn(r.openSpeed),r.beforeContent(t),e.when(i).always(function(e){r.setContent(e),r.afterContent(t)}).then(r.$instance.promise()).done(function(){r.afterOpen(t)})}return r.$instance.detach(),e.Deferred().reject().promise()},close:function(t){var n=this,i=e.Deferred();return n.beforeClose(t)===!1?i.reject():(0===r(n).length&&s(!1),n.$instance.fadeOut(n.closeSpeed,function(){n.$instance.detach(),n.afterClose(t),i.resolve()})),i.promise()},chainCallbacks:function(t){for(var n in t)this[n]=e.proxy(t[n],this,e.proxy(this[n],this))}},e.extend(t,{id:0,autoBind:"[data-featherlight]",defaults:t.prototype,contentFilters:{jquery:{regex:/^[#.]\w/,test:function(t){return t instanceof e&&t},process:function(t){return e(t).clone(!0)}},image:{regex:/\.(png|jpg|jpeg|gif|tiff|bmp)(\?\S*)?$/i,process:function(t){var n=this,r=e.Deferred(),i=new Image,a=e('<img src="'+t+'" alt="" class="'+n.namespace+'-image" />');return i.onload=function(){a.naturalWidth=i.width,a.naturalHeight=i.height,r.resolve(a)},i.onerror=function(){r.reject(a)},i.src=t,r.promise()}},html:{regex:/^\s*<[\w!][^<]*>/,process:function(t){return e(t)}},ajax:{regex:/./,process:function(t){var n=e.Deferred(),r=e("<div></div>").load(t,function(e,t){"error"!==t&&n.resolve(r.contents()),n.fail()});return n.promise()}},iframe:{process:function(t){var n=new e.Deferred,r=e("<iframe/>").hide().attr("src",t).css(i(this,"iframe")).on("load",function(){n.resolve(r.show())}).appendTo(this.$instance.find("."+this.namespace+"-content"));return n.promise()}},text:{process:function(t){return e("<div>",{text:t})}}},functionAttributes:["beforeOpen","afterOpen","beforeContent","afterContent","beforeClose","afterClose"],readElementConfig:function(t,n){var r=this,i=new RegExp("^data-"+n+"-(.*)"),a={};return t&&t.attributes&&e.each(t.attributes,function(){var t=this.name.match(i);if(t){var n=this.value,o=e.camelCase(t[1]);if(e.inArray(o,r.functionAttributes)>=0)n=new Function(n);else try{n=e.parseJSON(n)}catch(s){}a[o]=n}}),a},extend:function(t,n){var r=function(){this.constructor=t};return r.prototype=this.prototype,t.prototype=new r,t.__super__=this.prototype,e.extend(t,this,n),t.defaults=t.prototype,t},attach:function(t,n,r){var i=this;"object"!=typeof n||n instanceof e!=!1||r||(r=n,n=void 0),r=e.extend({},r);var a=r.namespace||i.defaults.namespace,o=e.extend({},i.defaults,i.readElementConfig(t[0],a),r);return t.on(o.openTrigger+"."+o.namespace,o.filter,function(a){var s=e.extend({$source:t,$currentTarget:e(this)},i.readElementConfig(t[0],o.namespace),i.readElementConfig(this,o.namespace),r);new i(n,s).open(a)}),t},current:function(){var e=this.opened();return e[e.length-1]||null},opened:function(){var t=this;return r(),e.grep(n,function(e){return e instanceof t})},close:function(){var e=this.current();return e?e.close():void 0},_onReady:function(){var t=this;t.autoBind&&(t.attach(e(document),{filter:t.autoBind}),e(t.autoBind).filter("[data-featherlight-filter]").each(function(){t.attach(e(this))}))},_callbackChain:{onKeyUp:function(e,t){return 27===t.keyCode?(this.closeOnEsc&&this.$instance.find("."+this.namespace+"-close:first").click(),!1):e(t)},onResize:function(e,t){if(this.$content.naturalWidth){var n=this.$content.naturalWidth,r=this.$content.naturalHeight;this.$content.css("width","").css("height","");var i=Math.max(n/parseInt(this.$content.parent().css("width"),10),r/parseInt(this.$content.parent().css("height"),10));i>1&&this.$content.css("width",""+n/i+"px").css("height",""+r/i+"px")}return e(t)},afterContent:function(e,t){var n=e(t);return this.onResize(t),n}}}),e.featherlight=t,e.fn.featherlight=function(e,n){return t.attach(this,e,n)},e(document).ready(function(){t._onReady()})}(jQuery),function(e){"use strict";function t(n,r){if(!(this instanceof t)){var i=new t(e.extend({$source:n,$currentTarget:n.first()},r));return i.open(),i}e.featherlight.apply(this,arguments),this.chainCallbacks(s)}var n=function(e){window.console&&window.console.warn&&window.console.warn("FeatherlightGallery: "+e)};if("undefined"==typeof e)return n("Too much lightness, Featherlight needs jQuery.");if(!e.featherlight)return n("Load the featherlight plugin before the gallery plugin");var r="ontouchstart"in document.documentElement,i=e.event&&e.event.special.swipeleft&&e,a=window.Hammer&&function(e){var t=new window.Hammer.Manager(e[0]);return t.add(new window.Hammer.Swipe),t},o=r&&(i||a);r&&!o&&n("No compatible swipe library detected; one must be included before featherlightGallery for swipe motions to navigate the galleries.");var s={afterClose:function(e,t){var n=this;return n.$instance.off("next."+n.namespace+" previous."+n.namespace),n._swiper&&(n._swiper.off("swipeleft",n._swipeleft).off("swiperight",n._swiperight),n._swiper=null),e(t)},beforeOpen:function(e,t){var n=this;return n.$instance.on("next."+n.namespace+" previous."+n.namespace,function(e){var t="next"===e.type?1:-1;n.navigateTo(n.currentNavigation()+t)}),o?n._swiper=o(n.$instance).on("swipeleft",n._swipeleft=function(){n.$instance.trigger("next")}).on("swiperight",n._swiperight=function(){n.$instance.trigger("previous")}):n.$instance.find("."+n.namespace+"-content").append(n.createNavigation("previous")).append(n.createNavigation("next")),e(t)},onKeyUp:function(e,t){var n={37:"previous",39:"next"}[t.keyCode];return n?(this.$instance.trigger(n),!1):e(t)}};e.featherlight.extend(t,{autoBind:"[data-featherlight-gallery]"}),e.extend(t.prototype,{previousIcon:"&#9664;",nextIcon:"&#9654;",galleryFadeIn:100,galleryFadeOut:300,images:function(){return this.filter?this.$source.find(this.filter):this.$source},currentNavigation:function(){return this.images().index(this.$currentTarget)},navigateTo:function(t){var n=this,r=n.images(),i=r.length,a=n.$instance.find("."+n.namespace+"-inner");return t=(t%i+i)%i,n.$currentTarget=r.eq(t),n.beforeContent(),e.when(n.getContent(),a.fadeTo(n.galleryFadeOut,.2)).always(function(e){n.setContent(e),n.afterContent(),e.fadeTo(n.galleryFadeIn,1)})},createNavigation:function(t){var n=this;return e('<span title="'+t+'" class="'+this.namespace+"-"+t+'"><span>'+this[t+"Icon"]+"</span></span>").click(function(){e(this).trigger(t+"."+n.namespace)})}}),e.featherlightGallery=t,e.fn.featherlightGallery=function(e){return t.attach(this,e)},e(document).ready(function(){t._onReady()})}(jQuery),function(e,t){"use strict";function n(e,n){return/(png|jpg|jpeg|gif|tiff|bmp)$/.test(t(n).attr("href").toLowerCase())}function r(){t("a[href]").filter(n).attr("data-featherlight","image")}function i(e,n){var r=t(n),i=r.find(".gallery-item a");0===i.length&&(i=r.find(".tiled-gallery-item a")),i.attr("data-featherlight")&&i.featherlightGallery()}function a(){var e=t(".gallery, .tiled-gallery");0!==e.length&&t.each(e,i)}function o(){r(),a()}t(document).ready(function(){o()})}(this,jQuery);
 
js/src/vendor/featherlight.gallery.js CHANGED
@@ -1,6 +1,6 @@
1
  /**
2
  * Featherlight Gallery – an extension for the ultra slim jQuery lightbox
3
- * Version 1.2.3 - http://noelboss.github.io/featherlight/
4
  *
5
  * Copyright 2015, Noël Raoul Bossart (http://www.noelboss.com)
6
  * MIT Licensed.
@@ -20,7 +20,7 @@
20
  return warn('Load the featherlight plugin before the gallery plugin');
21
  }
22
 
23
- var isTouchAware = 'ontouchstart' in document.documentElement,
24
  jQueryConstructor = $.event && $.event.special.swipeleft && $,
25
  hammerConstructor = window.Hammer && function($el){
26
  var mc = new window.Hammer.Manager($el[0]);
@@ -99,20 +99,25 @@
99
  galleryFadeIn: 100, /* fadeIn speed when image is loaded */
100
  galleryFadeOut: 300, /* fadeOut speed before image is loaded */
101
 
102
- images: function() {
103
  if (this.filter) {
104
  return this.$source.find(this.filter);
105
  }
106
  return this.$source;
107
  },
108
 
 
 
 
 
 
109
  currentNavigation: function() {
110
- return this.images().index(this.$currentTarget);
111
  },
112
 
113
  navigateTo: function(index) {
114
  var self = this,
115
- source = self.images(),
116
  len = source.length,
117
  $inner = self.$instance.find('.' + self.namespace + '-inner');
118
  index = ((index % len) + len) % len; /* pin index to [0, len[ */
1
  /**
2
  * Featherlight Gallery – an extension for the ultra slim jQuery lightbox
3
+ * Version 1.3.3 - http://noelboss.github.io/featherlight/
4
  *
5
  * Copyright 2015, Noël Raoul Bossart (http://www.noelboss.com)
6
  * MIT Licensed.
20
  return warn('Load the featherlight plugin before the gallery plugin');
21
  }
22
 
23
+ var isTouchAware = ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch,
24
  jQueryConstructor = $.event && $.event.special.swipeleft && $,
25
  hammerConstructor = window.Hammer && function($el){
26
  var mc = new window.Hammer.Manager($el[0]);
99
  galleryFadeIn: 100, /* fadeIn speed when image is loaded */
100
  galleryFadeOut: 300, /* fadeOut speed before image is loaded */
101
 
102
+ slides: function() {
103
  if (this.filter) {
104
  return this.$source.find(this.filter);
105
  }
106
  return this.$source;
107
  },
108
 
109
+ images: function() {
110
+ warn('images is deprecated, please use slides instead');
111
+ return this.slides();
112
+ },
113
+
114
  currentNavigation: function() {
115
+ return this.slides().index(this.$currentTarget);
116
  },
117
 
118
  navigateTo: function(index) {
119
  var self = this,
120
+ source = self.slides(),
121
  len = source.length,
122
  $inner = self.$instance.find('.' + self.namespace + '-inner');
123
  index = ((index % len) + len) % len; /* pin index to [0, len[ */
js/src/vendor/featherlight.gallery.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(a){"use strict";function b(c,d){if(!(this instanceof b)){var e=new b(a.extend({$source:c,$currentTarget:c.first()},d));return e.open(),e}a.featherlight.apply(this,arguments),this.chainCallbacks(h)}var c=function(a){window.console&&window.console.warn&&window.console.warn("FeatherlightGallery: "+a)};if("undefined"==typeof a)return c("Too much lightness, Featherlight needs jQuery.");if(!a.featherlight)return c("Load the featherlight plugin before the gallery plugin");var d="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch,e=a.event&&a.event.special.swipeleft&&a,f=window.Hammer&&function(a){var b=new window.Hammer.Manager(a[0]);return b.add(new window.Hammer.Swipe),b},g=d&&(e||f);d&&!g&&c("No compatible swipe library detected; one must be included before featherlightGallery for swipe motions to navigate the galleries.");var h={afterClose:function(a,b){var c=this;return c.$instance.off("next."+c.namespace+" previous."+c.namespace),c._swiper&&(c._swiper.off("swipeleft",c._swipeleft).off("swiperight",c._swiperight),c._swiper=null),a(b)},beforeOpen:function(a,b){var c=this;return c.$instance.on("next."+c.namespace+" previous."+c.namespace,function(a){var b="next"===a.type?1:-1;c.navigateTo(c.currentNavigation()+b)}),g?c._swiper=g(c.$instance).on("swipeleft",c._swipeleft=function(){c.$instance.trigger("next")}).on("swiperight",c._swiperight=function(){c.$instance.trigger("previous")}):c.$instance.find("."+c.namespace+"-content").append(c.createNavigation("previous")).append(c.createNavigation("next")),a(b)},onKeyUp:function(a,b){var c={37:"previous",39:"next"}[b.keyCode];return c?(this.$instance.trigger(c),!1):a(b)}};a.featherlight.extend(b,{autoBind:"[data-featherlight-gallery]"}),a.extend(b.prototype,{previousIcon:"&#9664;",nextIcon:"&#9654;",galleryFadeIn:100,galleryFadeOut:300,slides:function(){return this.filter?this.$source.find(this.filter):this.$source},images:function(){return c("images is deprecated, please use slides instead"),this.slides()},currentNavigation:function(){return this.slides().index(this.$currentTarget)},navigateTo:function(b){var c=this,d=c.slides(),e=d.length,f=c.$instance.find("."+c.namespace+"-inner");return b=(b%e+e)%e,c.$currentTarget=d.eq(b),c.beforeContent(),a.when(c.getContent(),f.fadeTo(c.galleryFadeOut,.2)).always(function(a){c.setContent(a),c.afterContent(),a.fadeTo(c.galleryFadeIn,1)})},createNavigation:function(b){var c=this;return a('<span title="'+b+'" class="'+this.namespace+"-"+b+'"><span>'+this[b+"Icon"]+"</span></span>").click(function(){a(this).trigger(b+"."+c.namespace)})}}),a.featherlightGallery=b,a.fn.featherlightGallery=function(a){return b.attach(this,a)},a(document).ready(function(){b._onReady()})}(jQuery);
js/src/vendor/featherlight.js CHANGED
@@ -1,6 +1,6 @@
1
  /**
2
  * Featherlight - ultra slim jQuery lightbox
3
- * Version 1.2.3 - http://noelboss.github.io/featherlight/
4
  *
5
  * Copyright 2015, Noël Raoul Bossart (http://www.noelboss.com)
6
  * MIT Licensed.
@@ -109,6 +109,7 @@
109
  closeOnEsc: true, /* Close lightbox when pressing esc */
110
  closeIcon: '&#10005;', /* Close icon */
111
  loading: '', /* Content to show while initial content is loading */
 
112
  otherClose: null, /* Selector for alternate close buttons (e.g. "a.close") */
113
  beforeOpen: $.noop, /* Called before open. can return false to prevent opening of lightbox. Gets event as parameter, this contains all data */
114
  beforeContent: $.noop, /* Called when content is loaded. Gets event as parameter, this contains all data */
@@ -161,6 +162,9 @@
161
 
162
  /* this method prepares the content and converts it into a jQuery object or a promise */
163
  getContent: function(){
 
 
 
164
  var self = this,
165
  filters = this.constructor.contentFilters,
166
  readTargetAttr = function(name){ return self.$currentTarget && self.$currentTarget.attr(name); },
@@ -224,6 +228,7 @@
224
  this insures that featherlight-inner remain at the same relative
225
  position to any other items added to featherlight-content */
226
  self.$instance.find('.'+self.namespace+'-inner')
 
227
  .slice(1).remove().end() /* In the unexpected event where there are many inner elements, remove all but the first one */
228
  .replaceWith($.contains(self.$instance[0], $content[0]) ? '' : $content);
229
 
@@ -314,10 +319,10 @@
314
  jquery: {
315
  regex: /^[#.]\w/, /* Anything that starts with a class name or identifiers */
316
  test: function(elem) { return elem instanceof $ && elem; },
317
- process: function(elem) { return $(elem).clone(true); }
318
  },
319
  image: {
320
- regex: /\.(png|jpg|jpeg|gif|tiff|bmp)(\?\S*)?$/i,
321
  process: function(url) {
322
  var self = this,
323
  deferred = $.Deferred(),
@@ -431,7 +436,8 @@
431
 
432
  /* Only for openTrigger and namespace... */
433
  var namespace = config.namespace || Klass.defaults.namespace,
434
- tempConfig = $.extend({}, Klass.defaults, Klass.readElementConfig($source[0], namespace), config);
 
435
 
436
  $source.on(tempConfig.openTrigger+'.'+tempConfig.namespace, tempConfig.filter, function(event) {
437
  /* ... since we might as well compute the config on the actual target */
@@ -440,7 +446,14 @@
440
  Klass.readElementConfig($source[0], tempConfig.namespace),
441
  Klass.readElementConfig(this, tempConfig.namespace),
442
  config);
443
- new Klass($content, elemConfig).open(event);
 
 
 
 
 
 
 
444
  });
445
  return $source;
446
  },
1
  /**
2
  * Featherlight - ultra slim jQuery lightbox
3
+ * Version 1.3.3 - http://noelboss.github.io/featherlight/
4
  *
5
  * Copyright 2015, Noël Raoul Bossart (http://www.noelboss.com)
6
  * MIT Licensed.
109
  closeOnEsc: true, /* Close lightbox when pressing esc */
110
  closeIcon: '&#10005;', /* Close icon */
111
  loading: '', /* Content to show while initial content is loading */
112
+ persist: false, /* If set, the content persist and will be shown again when opened again. 'shared' is a special value when binding multiple elements for them to share the same content */
113
  otherClose: null, /* Selector for alternate close buttons (e.g. "a.close") */
114
  beforeOpen: $.noop, /* Called before open. can return false to prevent opening of lightbox. Gets event as parameter, this contains all data */
115
  beforeContent: $.noop, /* Called when content is loaded. Gets event as parameter, this contains all data */
162
 
163
  /* this method prepares the content and converts it into a jQuery object or a promise */
164
  getContent: function(){
165
+ if(this.persist !== false && this.$content) {
166
+ return this.$content;
167
+ }
168
  var self = this,
169
  filters = this.constructor.contentFilters,
170
  readTargetAttr = function(name){ return self.$currentTarget && self.$currentTarget.attr(name); },
228
  this insures that featherlight-inner remain at the same relative
229
  position to any other items added to featherlight-content */
230
  self.$instance.find('.'+self.namespace+'-inner')
231
+ .not($content) /* excluded new content, important if persisted */
232
  .slice(1).remove().end() /* In the unexpected event where there are many inner elements, remove all but the first one */
233
  .replaceWith($.contains(self.$instance[0], $content[0]) ? '' : $content);
234
 
319
  jquery: {
320
  regex: /^[#.]\w/, /* Anything that starts with a class name or identifiers */
321
  test: function(elem) { return elem instanceof $ && elem; },
322
+ process: function(elem) { return this.persist !== false ? $(elem) : $(elem).clone(true); }
323
  },
324
  image: {
325
+ regex: /\.(png|jpg|jpeg|gif|tiff|bmp|svg)(\?\S*)?$/i,
326
  process: function(url) {
327
  var self = this,
328
  deferred = $.Deferred(),
436
 
437
  /* Only for openTrigger and namespace... */
438
  var namespace = config.namespace || Klass.defaults.namespace,
439
+ tempConfig = $.extend({}, Klass.defaults, Klass.readElementConfig($source[0], namespace), config),
440
+ sharedPersist;
441
 
442
  $source.on(tempConfig.openTrigger+'.'+tempConfig.namespace, tempConfig.filter, function(event) {
443
  /* ... since we might as well compute the config on the actual target */
446
  Klass.readElementConfig($source[0], tempConfig.namespace),
447
  Klass.readElementConfig(this, tempConfig.namespace),
448
  config);
449
+ var fl = sharedPersist || $(this).data('featherlight-persisted') || new Klass($content, elemConfig);
450
+ if(fl.persist === 'shared') {
451
+ sharedPersist = fl;
452
+ } else if(fl.persist !== false) {
453
+ $(this).data('featherlight-persisted', fl);
454
+ }
455
+ elemConfig.$currentTarget.blur(); // Otherwise 'enter' key might trigger the dialog again
456
+ fl.open(event);
457
  });
458
  return $source;
459
  },
js/src/vendor/featherlight.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(a){"use strict";function b(a,c){if(!(this instanceof b)){var d=new b(a,c);return d.open(),d}this.id=b.id++,this.setup(a,c),this.chainCallbacks(b._callbackChain)}if("undefined"==typeof a)return void("console"in window&&window.console.info("Too much lightness, Featherlight needs jQuery."));var c=[],d=function(b){return c=a.grep(c,function(a){return a!==b&&a.$instance.closest("body").length>0})},e=function(a,b){var c={},d=new RegExp("^"+b+"([A-Z])(.*)");for(var e in a){var f=e.match(d);if(f){var g=(f[1]+f[2].replace(/([A-Z])/g,"-$1")).toLowerCase();c[g]=a[e]}}return c},f={keyup:"onKeyUp",resize:"onResize"},g=function(c){a.each(b.opened().reverse(),function(){return c.isDefaultPrevented()||!1!==this[f[c.type]](c)?void 0:(c.preventDefault(),c.stopPropagation(),!1)})},h=function(c){if(c!==b._globalHandlerInstalled){b._globalHandlerInstalled=c;var d=a.map(f,function(a,c){return c+"."+b.prototype.namespace}).join(" ");a(window)[c?"on":"off"](d,g)}};b.prototype={constructor:b,namespace:"featherlight",targetAttr:"data-featherlight",variant:null,resetCss:!1,background:null,openTrigger:"click",closeTrigger:"click",filter:null,root:"body",openSpeed:250,closeSpeed:250,closeOnClick:"background",closeOnEsc:!0,closeIcon:"&#10005;",loading:"",persist:!1,otherClose:null,beforeOpen:a.noop,beforeContent:a.noop,beforeClose:a.noop,afterOpen:a.noop,afterContent:a.noop,afterClose:a.noop,onKeyUp:a.noop,onResize:a.noop,type:null,contentFilters:["jquery","image","html","ajax","iframe","text"],setup:function(b,c){"object"!=typeof b||b instanceof a!=!1||c||(c=b,b=void 0);var d=a.extend(this,c,{target:b}),e=d.resetCss?d.namespace+"-reset":d.namespace,f=a(d.background||['<div class="'+e+"-loading "+e+'">','<div class="'+e+'-content">','<span class="'+e+"-close-icon "+d.namespace+'-close">',d.closeIcon,"</span>",'<div class="'+d.namespace+'-inner">'+d.loading+"</div>","</div>","</div>"].join("")),g="."+d.namespace+"-close"+(d.otherClose?","+d.otherClose:"");return d.$instance=f.clone().addClass(d.variant),d.$instance.on(d.closeTrigger+"."+d.namespace,function(b){var c=a(b.target);("background"===d.closeOnClick&&c.is("."+d.namespace)||"anywhere"===d.closeOnClick||c.closest(g).length)&&(b.preventDefault(),d.close())}),this},getContent:function(){if(this.persist!==!1&&this.$content)return this.$content;var b=this,c=this.constructor.contentFilters,d=function(a){return b.$currentTarget&&b.$currentTarget.attr(a)},e=d(b.targetAttr),f=b.target||e||"",g=c[b.type];if(!g&&f in c&&(g=c[f],f=b.target&&e),f=f||d("href")||"",!g)for(var h in c)b[h]&&(g=c[h],f=b[h]);if(!g){var i=f;if(f=null,a.each(b.contentFilters,function(){return g=c[this],g.test&&(f=g.test(i)),!f&&g.regex&&i.match&&i.match(g.regex)&&(f=i),!f}),!f)return"console"in window&&window.console.error("Featherlight: no content filter found "+(i?' for "'+i+'"':" (no target specified)")),!1}return g.process.call(b,f)},setContent:function(b){var c=this;return(b.is("iframe")||a("iframe",b).length>0)&&c.$instance.addClass(c.namespace+"-iframe"),c.$instance.removeClass(c.namespace+"-loading"),c.$instance.find("."+c.namespace+"-inner").not(b).slice(1).remove().end().replaceWith(a.contains(c.$instance[0],b[0])?"":b),c.$content=b.addClass(c.namespace+"-inner"),c},open:function(b){var d=this;if(d.$instance.hide().appendTo(d.root),!(b&&b.isDefaultPrevented()||d.beforeOpen(b)===!1)){b&&b.preventDefault();var e=d.getContent();if(e)return c.push(d),h(!0),d.$instance.fadeIn(d.openSpeed),d.beforeContent(b),a.when(e).always(function(a){d.setContent(a),d.afterContent(b)}).then(d.$instance.promise()).done(function(){d.afterOpen(b)})}return d.$instance.detach(),a.Deferred().reject().promise()},close:function(b){var c=this,e=a.Deferred();return c.beforeClose(b)===!1?e.reject():(0===d(c).length&&h(!1),c.$instance.fadeOut(c.closeSpeed,function(){c.$instance.detach(),c.afterClose(b),e.resolve()})),e.promise()},chainCallbacks:function(b){for(var c in b)this[c]=a.proxy(b[c],this,a.proxy(this[c],this))}},a.extend(b,{id:0,autoBind:"[data-featherlight]",defaults:b.prototype,contentFilters:{jquery:{regex:/^[#.]\w/,test:function(b){return b instanceof a&&b},process:function(b){return this.persist!==!1?a(b):a(b).clone(!0)}},image:{regex:/\.(png|jpg|jpeg|gif|tiff|bmp|svg)(\?\S*)?$/i,process:function(b){var c=this,d=a.Deferred(),e=new Image,f=a('<img src="'+b+'" alt="" class="'+c.namespace+'-image" />');return e.onload=function(){f.naturalWidth=e.width,f.naturalHeight=e.height,d.resolve(f)},e.onerror=function(){d.reject(f)},e.src=b,d.promise()}},html:{regex:/^\s*<[\w!][^<]*>/,process:function(b){return a(b)}},ajax:{regex:/./,process:function(b){var c=a.Deferred(),d=a("<div></div>").load(b,function(a,b){"error"!==b&&c.resolve(d.contents()),c.fail()});return c.promise()}},iframe:{process:function(b){var c=new a.Deferred,d=a("<iframe/>").hide().attr("src",b).css(e(this,"iframe")).on("load",function(){c.resolve(d.show())}).appendTo(this.$instance.find("."+this.namespace+"-content"));return c.promise()}},text:{process:function(b){return a("<div>",{text:b})}}},functionAttributes:["beforeOpen","afterOpen","beforeContent","afterContent","beforeClose","afterClose"],readElementConfig:function(b,c){var d=this,e=new RegExp("^data-"+c+"-(.*)"),f={};return b&&b.attributes&&a.each(b.attributes,function(){var b=this.name.match(e);if(b){var c=this.value,g=a.camelCase(b[1]);if(a.inArray(g,d.functionAttributes)>=0)c=new Function(c);else try{c=a.parseJSON(c)}catch(h){}f[g]=c}}),f},extend:function(b,c){var d=function(){this.constructor=b};return d.prototype=this.prototype,b.prototype=new d,b.__super__=this.prototype,a.extend(b,this,c),b.defaults=b.prototype,b},attach:function(b,c,d){var e=this;"object"!=typeof c||c instanceof a!=!1||d||(d=c,c=void 0),d=a.extend({},d);var f,g=d.namespace||e.defaults.namespace,h=a.extend({},e.defaults,e.readElementConfig(b[0],g),d);return b.on(h.openTrigger+"."+h.namespace,h.filter,function(g){var i=a.extend({$source:b,$currentTarget:a(this)},e.readElementConfig(b[0],h.namespace),e.readElementConfig(this,h.namespace),d),j=f||a(this).data("featherlight-persisted")||new e(c,i);"shared"===j.persist?f=j:j.persist!==!1&&a(this).data("featherlight-persisted",j),i.$currentTarget.blur(),j.open(g)}),b},current:function(){var a=this.opened();return a[a.length-1]||null},opened:function(){var b=this;return d(),a.grep(c,function(a){return a instanceof b})},close:function(){var a=this.current();return a?a.close():void 0},_onReady:function(){var b=this;b.autoBind&&(b.attach(a(document),{filter:b.autoBind}),a(b.autoBind).filter("[data-featherlight-filter]").each(function(){b.attach(a(this))}))},_callbackChain:{onKeyUp:function(a,b){return 27===b.keyCode?(this.closeOnEsc&&this.$instance.find("."+this.namespace+"-close:first").click(),!1):a(b)},onResize:function(a,b){if(this.$content.naturalWidth){var c=this.$content.naturalWidth,d=this.$content.naturalHeight;this.$content.css("width","").css("height","");var e=Math.max(c/parseInt(this.$content.parent().css("width"),10),d/parseInt(this.$content.parent().css("height"),10));e>1&&this.$content.css("width",""+c/e+"px").css("height",""+d/e+"px")}return a(b)},afterContent:function(a,b){var c=a(b);return this.onResize(b),c}}}),a.featherlight=b,a.fn.featherlight=function(a,c){return b.attach(this,a,c)},a(document).ready(function(){b._onReady()})}(jQuery);
js/src/vendor/jquery.detect_swipe.js CHANGED
@@ -6,67 +6,67 @@
6
  */
7
  (function($) {
8
 
9
- $.detectSwipe = {
10
- version: '2.1.1',
11
- enabled: 'ontouchstart' in document.documentElement,
12
- preventDefault: true,
13
- threshold: 20
14
- };
15
 
16
- var startX,
17
- startY,
18
- isMoving = false;
19
 
20
- function onTouchEnd() {
21
- this.removeEventListener('touchmove', onTouchMove);
22
- this.removeEventListener('touchend', onTouchEnd);
23
- isMoving = false;
24
- }
25
 
26
- function onTouchMove(e) {
27
- if ($.detectSwipe.preventDefault) { e.preventDefault(); }
28
- if(isMoving) {
29
- var x = e.touches[0].pageX;
30
- var y = e.touches[0].pageY;
31
- var dx = startX - x;
32
- var dy = startY - y;
33
- var dir;
34
- if(Math.abs(dx) >= $.detectSwipe.threshold) {
35
- dir = dx > 0 ? 'left' : 'right'
36
- }
37
- else if(Math.abs(dy) >= $.detectSwipe.threshold) {
38
- dir = dy > 0 ? 'down' : 'up'
39
- }
40
- if(dir) {
41
- onTouchEnd.call(this);
42
- $(this).trigger('swipe', dir).trigger('swipe' + dir);
43
- }
44
- }
45
- }
46
 
47
- function onTouchStart(e) {
48
- if (e.touches.length == 1) {
49
- startX = e.touches[0].pageX;
50
- startY = e.touches[0].pageY;
51
- isMoving = true;
52
- this.addEventListener('touchmove', onTouchMove, false);
53
- this.addEventListener('touchend', onTouchEnd, false);
54
- }
55
- }
56
 
57
- function setup() {
58
- this.addEventListener && this.addEventListener('touchstart', onTouchStart, false);
59
- }
60
 
61
- function teardown() {
62
- this.removeEventListener('touchstart', onTouchStart);
63
- }
64
 
65
- $.event.special.swipe = { setup: setup };
66
 
67
- $.each(['left', 'up', 'down', 'right'], function () {
68
- $.event.special['swipe' + this] = { setup: function(){
69
- $(this).on('swipe', $.noop);
70
- } };
71
- });
72
  })(jQuery);
6
  */
7
  (function($) {
8
 
9
+ $.detectSwipe = {
10
+ version: '2.1.1',
11
+ enabled: 'ontouchstart' in document.documentElement,
12
+ preventDefault: true,
13
+ threshold: 20
14
+ };
15
 
16
+ var startX,
17
+ startY,
18
+ isMoving = false;
19
 
20
+ function onTouchEnd() {
21
+ this.removeEventListener('touchmove', onTouchMove);
22
+ this.removeEventListener('touchend', onTouchEnd);
23
+ isMoving = false;
24
+ }
25
 
26
+ function onTouchMove(e) {
27
+ if ($.detectSwipe.preventDefault) { e.preventDefault(); }
28
+ if(isMoving) {
29
+ var x = e.touches[0].pageX;
30
+ var y = e.touches[0].pageY;
31
+ var dx = startX - x;
32
+ var dy = startY - y;
33
+ var dir;
34
+ if(Math.abs(dx) >= $.detectSwipe.threshold) {
35
+ dir = dx > 0 ? 'left' : 'right'
36
+ }
37
+ else if(Math.abs(dy) >= $.detectSwipe.threshold) {
38
+ dir = dy > 0 ? 'down' : 'up'
39
+ }
40
+ if(dir) {
41
+ onTouchEnd.call(this);
42
+ $(this).trigger('swipe', dir).trigger('swipe' + dir);
43
+ }
44
+ }
45
+ }
46
 
47
+ function onTouchStart(e) {
48
+ if (e.touches.length == 1) {
49
+ startX = e.touches[0].pageX;
50
+ startY = e.touches[0].pageY;
51
+ isMoving = true;
52
+ this.addEventListener('touchmove', onTouchMove, false);
53
+ this.addEventListener('touchend', onTouchEnd, false);
54
+ }
55
+ }
56
 
57
+ function setup() {
58
+ this.addEventListener('touchstart', onTouchStart, false);
59
+ }
60
 
61
+ function teardown() {
62
+ this.removeEventListener('touchstart', onTouchStart);
63
+ }
64
 
65
+ $.event.special.swipe = { setup: setup };
66
 
67
+ $.each(['left', 'up', 'down', 'right'], function () {
68
+ $.event.special['swipe' + this] = { setup: function(){
69
+ $(this).on('swipe', $.noop);
70
+ } };
71
+ });
72
  })(jQuery);
js/src/vendor/jquery.detect_swipe.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(a){function b(){this.removeEventListener("touchmove",c),this.removeEventListener("touchend",b),h=!1}function c(c){if(a.detectSwipe.preventDefault&&c.preventDefault(),h){var d,e=c.touches[0].pageX,i=c.touches[0].pageY,j=f-e,k=g-i;Math.abs(j)>=a.detectSwipe.threshold?d=j>0?"left":"right":Math.abs(k)>=a.detectSwipe.threshold&&(d=k>0?"down":"up"),d&&(b.call(this),a(this).trigger("swipe",d).trigger("swipe"+d))}}function d(a){1==a.touches.length&&(f=a.touches[0].pageX,g=a.touches[0].pageY,h=!0,this.addEventListener("touchmove",c,!1),this.addEventListener("touchend",b,!1))}function e(){this.addEventListener("touchstart",d,!1)}a.detectSwipe={version:"2.1.1",enabled:"ontouchstart"in document.documentElement,preventDefault:!0,threshold:20};var f,g,h=!1;a.event.special.swipe={setup:e},a.each(["left","up","down","right"],function(){a.event.special["swipe"+this]={setup:function(){a(this).on("swipe",a.noop)}}})}(jQuery);
js/src/wpFeatherlight.js CHANGED
@@ -1,23 +1,24 @@
1
  /**
2
  * WP Featherlight - Loader and helpers for the Featherlight WordPress plugin
3
  *
4
- * @version Version 0.2.0
5
- * @copyright Copyright 2015, Robert Neu (http://robneu.com)
6
  * @license MIT
7
  */
8
  (function( window, $, undefined ) {
9
  'use strict';
10
 
 
 
11
  /**
12
  * Checks href targets to see if a given anchor is linking to an image.
13
  *
14
- * Returns false if the anchor is pointing to an external URL.
15
- *
16
  * @since 0.1.0
17
  * @return mixed
18
  */
19
  function testImages( index, element ) {
20
- return /(png|jpg|jpeg|gif|tiff|bmp)$/.test( $( element ).attr( 'href' ).toLowerCase() );
 
 
21
  }
22
 
23
  /**
@@ -43,7 +44,7 @@
43
  var $galleryObj = $( element ),
44
  $galleryItems = $galleryObj.find( '.gallery-item a' );
45
 
46
- if ( $galleryItems.length === 0 ) {
47
  $galleryItems = $galleryObj.find( '.tiled-gallery-item a' );
48
  }
49
 
@@ -63,13 +64,41 @@
63
  function findGalleries() {
64
  var $gallery = $( '.gallery, .tiled-gallery' );
65
 
66
- if ( $gallery.length === 0 ) {
67
  return;
68
  }
69
 
70
  $.each( $gallery, buildGalleries );
71
  }
72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  /**
74
  * Fires all of our helper methods to load featherlight.
75
  *
@@ -79,6 +108,9 @@
79
  function wpFeatherlightInit() {
80
  findImages();
81
  findGalleries();
 
 
 
82
  }
83
 
84
  $( document ).ready(function() {
1
  /**
2
  * WP Featherlight - Loader and helpers for the Featherlight WordPress plugin
3
  *
4
+ * @copyright Copyright 2015, WP Site Care (http://www.wpsitecare.com)
 
5
  * @license MIT
6
  */
7
  (function( window, $, undefined ) {
8
  'use strict';
9
 
10
+ var $body = $( 'body' );
11
+
12
  /**
13
  * Checks href targets to see if a given anchor is linking to an image.
14
  *
 
 
15
  * @since 0.1.0
16
  * @return mixed
17
  */
18
  function testImages( index, element ) {
19
+ return /(png|jpg|jpeg|gif|tiff|bmp)$/.test(
20
+ $( element ).attr( 'href' ).toLowerCase().split( '?' )[0].split( '#' )[0]
21
+ );
22
  }
23
 
24
  /**
44
  var $galleryObj = $( element ),
45
  $galleryItems = $galleryObj.find( '.gallery-item a' );
46
 
47
+ if ( 0 === $galleryItems.length ) {
48
  $galleryItems = $galleryObj.find( '.tiled-gallery-item a' );
49
  }
50
 
64
  function findGalleries() {
65
  var $gallery = $( '.gallery, .tiled-gallery' );
66
 
67
+ if ( 0 === $gallery.length ) {
68
  return;
69
  }
70
 
71
  $.each( $gallery, buildGalleries );
72
  }
73
 
74
+ /**
75
+ * Append image captions to the Featherlight content <div>.
76
+ *
77
+ * @since 0.3.0
78
+ * @return void
79
+ */
80
+ function addCaptions() {
81
+ $.featherlight.prototype.afterContent = function() {
82
+ var object = this.$instance,
83
+ target = this.$currentTarget,
84
+ parent = target.parent(),
85
+ caption = parent.find( '.wp-caption-text' ),
86
+ galParent = target.parents( '.gallery-item' ),
87
+ jetParent = target.parents( '.tiled-gallery-item' );
88
+
89
+ if ( 0 !== galParent.length ) {
90
+ caption = galParent.find( '.wp-caption-text' );
91
+ } else if ( 0 !== jetParent.length ) {
92
+ caption = jetParent.find( '.tiled-gallery-caption' );
93
+ }
94
+
95
+ object.find( '.caption' ).remove();
96
+ if ( 0 !== caption.length ) {
97
+ $( '<div class="caption">' ).text( caption.text() ).appendTo( object.find( '.featherlight-content' ) );
98
+ }
99
+ };
100
+ }
101
+
102
  /**
103
  * Fires all of our helper methods to load featherlight.
104
  *
108
  function wpFeatherlightInit() {
109
  findImages();
110
  findGalleries();
111
+ if ( $body.hasClass( 'wp-featherlight-captions' ) ) {
112
+ addCaptions();
113
+ }
114
  }
115
 
116
  $( document ).ready(function() {
js/src/wpFeatherlight.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(a,b,c){"use strict";function d(a,c){return/(png|jpg|jpeg|gif|tiff|bmp)$/.test(b(c).attr("href").toLowerCase().split("?")[0].split("#")[0])}function e(){b("a[href]").filter(d).attr("data-featherlight","image")}function f(a,c){var d=b(c),e=d.find(".gallery-item a");0===e.length&&(e=d.find(".tiled-gallery-item a")),e.attr("data-featherlight")&&e.featherlightGallery()}function g(){var a=b(".gallery, .tiled-gallery");0!==a.length&&b.each(a,f)}function h(){b.featherlight.prototype.afterContent=function(){var a=this.$instance,c=this.$currentTarget,d=c.parent(),e=d.find(".wp-caption-text"),f=c.parents(".gallery-item"),g=c.parents(".tiled-gallery-item");0!==f.length?e=f.find(".wp-caption-text"):0!==g.length&&(e=g.find(".tiled-gallery-caption")),a.find(".caption").remove(),0!==e.length&&b('<div class="caption">').text(e.text()).appendTo(a.find(".featherlight-content"))}}function i(){e(),g(),j.hasClass("wp-featherlight-captions")&&h()}var j=b("body");b(document).ready(function(){i()})}(this,jQuery);
js/{dist/wpFeatherlight.pkgd.js → wpFeatherlight.pkgd.js} RENAMED
@@ -5,78 +5,75 @@
5
  * Based on touchwipe by Andreas Waltl, netCU Internetagentur (http://www.netcu.de)
6
  */
7
  (function($) {
8
- 'use strict';
9
-
10
- $.detectSwipe = {
11
- version: '2.1.1',
12
- enabled: 'ontouchstart' in document.documentElement,
13
- preventDefault: true,
14
- threshold: 20
15
- };
16
-
17
- var startX,
18
- startY,
19
- isMoving = false;
20
-
21
- function onTouchEnd() {
22
- this.removeEventListener('touchmove', onTouchMove);
23
- this.removeEventListener('touchend', onTouchEnd);
24
- isMoving = false;
25
- }
26
 
27
- function onTouchMove(e) {
28
- if ($.detectSwipe.preventDefault) {
29
- e.preventDefault();
30
- }
31
- if(isMoving) {
32
- var x = e.touches[0].pageX,
33
- y = e.touches[0].pageY,
34
- dx = startX - x,
35
- dy = startY - y,
36
- dir;
37
- if (Math.abs(dx) >= $.detectSwipe.threshold) {
38
- dir = dx > 0 ? 'left' : 'right';
39
- } else if (Math.abs(dy) >= $.detectSwipe.threshold) {
40
- dir = dy > 0 ? 'down' : 'up';
41
- }
42
- if (dir) {
43
- onTouchEnd.call(this);
44
- $(this).trigger('swipe', dir).trigger('swipe' + dir);
45
- }
46
- }
47
- }
48
-
49
- function onTouchStart(e) {
50
- if (e.touches.length == 1) {
51
- startX = e.touches[0].pageX;
52
- startY = e.touches[0].pageY;
53
- isMoving = true;
54
- this.addEventListener('touchmove', onTouchMove, false);
55
- this.addEventListener('touchend', onTouchEnd, false);
56
- }
57
- }
58
-
59
- function setup() {
60
- this.addEventListener && this.addEventListener('touchstart', onTouchStart, false);
61
- }
62
-
63
- function teardown() {
64
- this.removeEventListener('touchstart', onTouchStart);
65
- }
66
-
67
- $.event.special.swipe = { setup: setup };
68
-
69
- $.each(['left', 'up', 'down', 'right'], function() {
70
- $.event.special['swipe' + this] = { setup: function() {
71
- $(this).on('swipe', $.noop);
72
- } };
73
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  })(jQuery);
75
 
76
-
77
  /**
78
  * Featherlight - ultra slim jQuery lightbox
79
- * Version 1.2.3 - http://noelboss.github.io/featherlight/
80
  *
81
  * Copyright 2015, Noël Raoul Bossart (http://www.noelboss.com)
82
  * MIT Licensed.
@@ -185,6 +182,7 @@
185
  closeOnEsc: true, /* Close lightbox when pressing esc */
186
  closeIcon: '&#10005;', /* Close icon */
187
  loading: '', /* Content to show while initial content is loading */
 
188
  otherClose: null, /* Selector for alternate close buttons (e.g. "a.close") */
189
  beforeOpen: $.noop, /* Called before open. can return false to prevent opening of lightbox. Gets event as parameter, this contains all data */
190
  beforeContent: $.noop, /* Called when content is loaded. Gets event as parameter, this contains all data */
@@ -237,6 +235,9 @@
237
 
238
  /* this method prepares the content and converts it into a jQuery object or a promise */
239
  getContent: function(){
 
 
 
240
  var self = this,
241
  filters = this.constructor.contentFilters,
242
  readTargetAttr = function(name){ return self.$currentTarget && self.$currentTarget.attr(name); },
@@ -300,6 +301,7 @@
300
  this insures that featherlight-inner remain at the same relative
301
  position to any other items added to featherlight-content */
302
  self.$instance.find('.'+self.namespace+'-inner')
 
303
  .slice(1).remove().end() /* In the unexpected event where there are many inner elements, remove all but the first one */
304
  .replaceWith($.contains(self.$instance[0], $content[0]) ? '' : $content);
305
 
@@ -390,10 +392,10 @@
390
  jquery: {
391
  regex: /^[#.]\w/, /* Anything that starts with a class name or identifiers */
392
  test: function(elem) { return elem instanceof $ && elem; },
393
- process: function(elem) { return $(elem).clone(true); }
394
  },
395
  image: {
396
- regex: /\.(png|jpg|jpeg|gif|tiff|bmp)(\?\S*)?$/i,
397
  process: function(url) {
398
  var self = this,
399
  deferred = $.Deferred(),
@@ -507,7 +509,8 @@
507
 
508
  /* Only for openTrigger and namespace... */
509
  var namespace = config.namespace || Klass.defaults.namespace,
510
- tempConfig = $.extend({}, Klass.defaults, Klass.readElementConfig($source[0], namespace), config);
 
511
 
512
  $source.on(tempConfig.openTrigger+'.'+tempConfig.namespace, tempConfig.filter, function(event) {
513
  /* ... since we might as well compute the config on the actual target */
@@ -516,7 +519,14 @@
516
  Klass.readElementConfig($source[0], tempConfig.namespace),
517
  Klass.readElementConfig(this, tempConfig.namespace),
518
  config);
519
- new Klass($content, elemConfig).open(event);
 
 
 
 
 
 
 
520
  });
521
  return $source;
522
  },
@@ -607,7 +617,7 @@
607
 
608
  /**
609
  * Featherlight Gallery – an extension for the ultra slim jQuery lightbox
610
- * Version 1.2.3 - http://noelboss.github.io/featherlight/
611
  *
612
  * Copyright 2015, Noël Raoul Bossart (http://www.noelboss.com)
613
  * MIT Licensed.
@@ -627,7 +637,7 @@
627
  return warn('Load the featherlight plugin before the gallery plugin');
628
  }
629
 
630
- var isTouchAware = 'ontouchstart' in document.documentElement,
631
  jQueryConstructor = $.event && $.event.special.swipeleft && $,
632
  hammerConstructor = window.Hammer && function($el){
633
  var mc = new window.Hammer.Manager($el[0]);
@@ -706,20 +716,25 @@
706
  galleryFadeIn: 100, /* fadeIn speed when image is loaded */
707
  galleryFadeOut: 300, /* fadeOut speed before image is loaded */
708
 
709
- images: function() {
710
  if (this.filter) {
711
  return this.$source.find(this.filter);
712
  }
713
  return this.$source;
714
  },
715
 
 
 
 
 
 
716
  currentNavigation: function() {
717
- return this.images().index(this.$currentTarget);
718
  },
719
 
720
  navigateTo: function(index) {
721
  var self = this,
722
- source = self.images(),
723
  len = source.length,
724
  $inner = self.$instance.find('.' + self.namespace + '-inner');
725
  index = ((index % len) + len) % len; /* pin index to [0, len[ */
@@ -759,23 +774,24 @@
759
  /**
760
  * WP Featherlight - Loader and helpers for the Featherlight WordPress plugin
761
  *
762
- * @version Version 0.2.0
763
- * @copyright Copyright 2015, Robert Neu (http://robneu.com)
764
  * @license MIT
765
  */
766
  (function( window, $, undefined ) {
767
  'use strict';
768
 
 
 
769
  /**
770
  * Checks href targets to see if a given anchor is linking to an image.
771
  *
772
- * Returns false if the anchor is pointing to an external URL.
773
- *
774
  * @since 0.1.0
775
  * @return mixed
776
  */
777
  function testImages( index, element ) {
778
- return /(png|jpg|jpeg|gif|tiff|bmp)$/.test( $( element ).attr( 'href' ).toLowerCase() );
 
 
779
  }
780
 
781
  /**
@@ -801,7 +817,7 @@
801
  var $galleryObj = $( element ),
802
  $galleryItems = $galleryObj.find( '.gallery-item a' );
803
 
804
- if ( $galleryItems.length === 0 ) {
805
  $galleryItems = $galleryObj.find( '.tiled-gallery-item a' );
806
  }
807
 
@@ -821,13 +837,41 @@
821
  function findGalleries() {
822
  var $gallery = $( '.gallery, .tiled-gallery' );
823
 
824
- if ( $gallery.length === 0 ) {
825
  return;
826
  }
827
 
828
  $.each( $gallery, buildGalleries );
829
  }
830
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
831
  /**
832
  * Fires all of our helper methods to load featherlight.
833
  *
@@ -837,6 +881,9 @@
837
  function wpFeatherlightInit() {
838
  findImages();
839
  findGalleries();
 
 
 
840
  }
841
 
842
  $( document ).ready(function() {
5
  * Based on touchwipe by Andreas Waltl, netCU Internetagentur (http://www.netcu.de)
6
  */
7
  (function($) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
 
9
+ $.detectSwipe = {
10
+ version: '2.1.1',
11
+ enabled: 'ontouchstart' in document.documentElement,
12
+ preventDefault: true,
13
+ threshold: 20
14
+ };
15
+
16
+ var startX,
17
+ startY,
18
+ isMoving = false;
19
+
20
+ function onTouchEnd() {
21
+ this.removeEventListener('touchmove', onTouchMove);
22
+ this.removeEventListener('touchend', onTouchEnd);
23
+ isMoving = false;
24
+ }
25
+
26
+ function onTouchMove(e) {
27
+ if ($.detectSwipe.preventDefault) { e.preventDefault(); }
28
+ if(isMoving) {
29
+ var x = e.touches[0].pageX;
30
+ var y = e.touches[0].pageY;
31
+ var dx = startX - x;
32
+ var dy = startY - y;
33
+ var dir;
34
+ if(Math.abs(dx) >= $.detectSwipe.threshold) {
35
+ dir = dx > 0 ? 'left' : 'right'
36
+ }
37
+ else if(Math.abs(dy) >= $.detectSwipe.threshold) {
38
+ dir = dy > 0 ? 'down' : 'up'
39
+ }
40
+ if(dir) {
41
+ onTouchEnd.call(this);
42
+ $(this).trigger('swipe', dir).trigger('swipe' + dir);
43
+ }
44
+ }
45
+ }
46
+
47
+ function onTouchStart(e) {
48
+ if (e.touches.length == 1) {
49
+ startX = e.touches[0].pageX;
50
+ startY = e.touches[0].pageY;
51
+ isMoving = true;
52
+ this.addEventListener('touchmove', onTouchMove, false);
53
+ this.addEventListener('touchend', onTouchEnd, false);
54
+ }
55
+ }
56
+
57
+ function setup() {
58
+ this.addEventListener('touchstart', onTouchStart, false);
59
+ }
60
+
61
+ function teardown() {
62
+ this.removeEventListener('touchstart', onTouchStart);
63
+ }
64
+
65
+ $.event.special.swipe = { setup: setup };
66
+
67
+ $.each(['left', 'up', 'down', 'right'], function () {
68
+ $.event.special['swipe' + this] = { setup: function(){
69
+ $(this).on('swipe', $.noop);
70
+ } };
71
+ });
72
  })(jQuery);
73
 
 
74
  /**
75
  * Featherlight - ultra slim jQuery lightbox
76
+ * Version 1.3.3 - http://noelboss.github.io/featherlight/
77
  *
78
  * Copyright 2015, Noël Raoul Bossart (http://www.noelboss.com)
79
  * MIT Licensed.
182
  closeOnEsc: true, /* Close lightbox when pressing esc */
183
  closeIcon: '&#10005;', /* Close icon */
184
  loading: '', /* Content to show while initial content is loading */
185
+ persist: false, /* If set, the content persist and will be shown again when opened again. 'shared' is a special value when binding multiple elements for them to share the same content */
186
  otherClose: null, /* Selector for alternate close buttons (e.g. "a.close") */
187
  beforeOpen: $.noop, /* Called before open. can return false to prevent opening of lightbox. Gets event as parameter, this contains all data */
188
  beforeContent: $.noop, /* Called when content is loaded. Gets event as parameter, this contains all data */
235
 
236
  /* this method prepares the content and converts it into a jQuery object or a promise */
237
  getContent: function(){
238
+ if(this.persist !== false && this.$content) {
239
+ return this.$content;
240
+ }
241
  var self = this,
242
  filters = this.constructor.contentFilters,
243
  readTargetAttr = function(name){ return self.$currentTarget && self.$currentTarget.attr(name); },
301
  this insures that featherlight-inner remain at the same relative
302
  position to any other items added to featherlight-content */
303
  self.$instance.find('.'+self.namespace+'-inner')
304
+ .not($content) /* excluded new content, important if persisted */
305
  .slice(1).remove().end() /* In the unexpected event where there are many inner elements, remove all but the first one */
306
  .replaceWith($.contains(self.$instance[0], $content[0]) ? '' : $content);
307
 
392
  jquery: {
393
  regex: /^[#.]\w/, /* Anything that starts with a class name or identifiers */
394
  test: function(elem) { return elem instanceof $ && elem; },
395
+ process: function(elem) { return this.persist !== false ? $(elem) : $(elem).clone(true); }
396
  },
397
  image: {
398
+ regex: /\.(png|jpg|jpeg|gif|tiff|bmp|svg)(\?\S*)?$/i,
399
  process: function(url) {
400
  var self = this,
401
  deferred = $.Deferred(),
509
 
510
  /* Only for openTrigger and namespace... */
511
  var namespace = config.namespace || Klass.defaults.namespace,
512
+ tempConfig = $.extend({}, Klass.defaults, Klass.readElementConfig($source[0], namespace), config),
513
+ sharedPersist;
514
 
515
  $source.on(tempConfig.openTrigger+'.'+tempConfig.namespace, tempConfig.filter, function(event) {
516
  /* ... since we might as well compute the config on the actual target */
519
  Klass.readElementConfig($source[0], tempConfig.namespace),
520
  Klass.readElementConfig(this, tempConfig.namespace),
521
  config);
522
+ var fl = sharedPersist || $(this).data('featherlight-persisted') || new Klass($content, elemConfig);
523
+ if(fl.persist === 'shared') {
524
+ sharedPersist = fl;
525
+ } else if(fl.persist !== false) {
526
+ $(this).data('featherlight-persisted', fl);
527
+ }
528
+ elemConfig.$currentTarget.blur(); // Otherwise 'enter' key might trigger the dialog again
529
+ fl.open(event);
530
  });
531
  return $source;
532
  },
617
 
618
  /**
619
  * Featherlight Gallery – an extension for the ultra slim jQuery lightbox
620
+ * Version 1.3.3 - http://noelboss.github.io/featherlight/
621
  *
622
  * Copyright 2015, Noël Raoul Bossart (http://www.noelboss.com)
623
  * MIT Licensed.
637
  return warn('Load the featherlight plugin before the gallery plugin');
638
  }
639
 
640
+ var isTouchAware = ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch,
641
  jQueryConstructor = $.event && $.event.special.swipeleft && $,
642
  hammerConstructor = window.Hammer && function($el){
643
  var mc = new window.Hammer.Manager($el[0]);
716
  galleryFadeIn: 100, /* fadeIn speed when image is loaded */
717
  galleryFadeOut: 300, /* fadeOut speed before image is loaded */
718
 
719
+ slides: function() {
720
  if (this.filter) {
721
  return this.$source.find(this.filter);
722
  }
723
  return this.$source;
724
  },
725
 
726
+ images: function() {
727
+ warn('images is deprecated, please use slides instead');
728
+ return this.slides();
729
+ },
730
+
731
  currentNavigation: function() {
732
+ return this.slides().index(this.$currentTarget);
733
  },
734
 
735
  navigateTo: function(index) {
736
  var self = this,
737
+ source = self.slides(),
738
  len = source.length,
739
  $inner = self.$instance.find('.' + self.namespace + '-inner');
740
  index = ((index % len) + len) % len; /* pin index to [0, len[ */
774
  /**
775
  * WP Featherlight - Loader and helpers for the Featherlight WordPress plugin
776
  *
777
+ * @copyright Copyright 2015, WP Site Care (http://www.wpsitecare.com)
 
778
  * @license MIT
779
  */
780
  (function( window, $, undefined ) {
781
  'use strict';
782
 
783
+ var $body = $( 'body' );
784
+
785
  /**
786
  * Checks href targets to see if a given anchor is linking to an image.
787
  *
 
 
788
  * @since 0.1.0
789
  * @return mixed
790
  */
791
  function testImages( index, element ) {
792
+ return /(png|jpg|jpeg|gif|tiff|bmp)$/.test(
793
+ $( element ).attr( 'href' ).toLowerCase().split( '?' )[0].split( '#' )[0]
794
+ );
795
  }
796
 
797
  /**
817
  var $galleryObj = $( element ),
818
  $galleryItems = $galleryObj.find( '.gallery-item a' );
819
 
820
+ if ( 0 === $galleryItems.length ) {
821
  $galleryItems = $galleryObj.find( '.tiled-gallery-item a' );
822
  }
823
 
837
  function findGalleries() {
838
  var $gallery = $( '.gallery, .tiled-gallery' );
839
 
840
+ if ( 0 === $gallery.length ) {
841
  return;
842
  }
843
 
844
  $.each( $gallery, buildGalleries );
845
  }
846
 
847
+ /**
848
+ * Append image captions to the Featherlight content <div>.
849
+ *
850
+ * @since 0.3.0
851
+ * @return void
852
+ */
853
+ function addCaptions() {
854
+ $.featherlight.prototype.afterContent = function() {
855
+ var object = this.$instance,
856
+ target = this.$currentTarget,
857
+ parent = target.parent(),
858
+ caption = parent.find( '.wp-caption-text' ),
859
+ galParent = target.parents( '.gallery-item' ),
860
+ jetParent = target.parents( '.tiled-gallery-item' );
861
+
862
+ if ( 0 !== galParent.length ) {
863
+ caption = galParent.find( '.wp-caption-text' );
864
+ } else if ( 0 !== jetParent.length ) {
865
+ caption = jetParent.find( '.tiled-gallery-caption' );
866
+ }
867
+
868
+ object.find( '.caption' ).remove();
869
+ if ( 0 !== caption.length ) {
870
+ $( '<div class="caption">' ).text( caption.text() ).appendTo( object.find( '.featherlight-content' ) );
871
+ }
872
+ };
873
+ }
874
+
875
  /**
876
  * Fires all of our helper methods to load featherlight.
877
  *
881
  function wpFeatherlightInit() {
882
  findImages();
883
  findGalleries();
884
+ if ( $body.hasClass( 'wp-featherlight-captions' ) ) {
885
+ addCaptions();
886
+ }
887
  }
888
 
889
  $( document ).ready(function() {
js/wpFeatherlight.pkgd.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(a){function b(){this.removeEventListener("touchmove",c),this.removeEventListener("touchend",b),h=!1}function c(c){if(a.detectSwipe.preventDefault&&c.preventDefault(),h){var d,e=c.touches[0].pageX,i=c.touches[0].pageY,j=f-e,k=g-i;Math.abs(j)>=a.detectSwipe.threshold?d=j>0?"left":"right":Math.abs(k)>=a.detectSwipe.threshold&&(d=k>0?"down":"up"),d&&(b.call(this),a(this).trigger("swipe",d).trigger("swipe"+d))}}function d(a){1==a.touches.length&&(f=a.touches[0].pageX,g=a.touches[0].pageY,h=!0,this.addEventListener("touchmove",c,!1),this.addEventListener("touchend",b,!1))}function e(){this.addEventListener("touchstart",d,!1)}a.detectSwipe={version:"2.1.1",enabled:"ontouchstart"in document.documentElement,preventDefault:!0,threshold:20};var f,g,h=!1;a.event.special.swipe={setup:e},a.each(["left","up","down","right"],function(){a.event.special["swipe"+this]={setup:function(){a(this).on("swipe",a.noop)}}})}(jQuery),function(a){"use strict";function b(a,c){if(!(this instanceof b)){var d=new b(a,c);return d.open(),d}this.id=b.id++,this.setup(a,c),this.chainCallbacks(b._callbackChain)}if("undefined"==typeof a)return void("console"in window&&window.console.info("Too much lightness, Featherlight needs jQuery."));var c=[],d=function(b){return c=a.grep(c,function(a){return a!==b&&a.$instance.closest("body").length>0})},e=function(a,b){var c={},d=new RegExp("^"+b+"([A-Z])(.*)");for(var e in a){var f=e.match(d);if(f){var g=(f[1]+f[2].replace(/([A-Z])/g,"-$1")).toLowerCase();c[g]=a[e]}}return c},f={keyup:"onKeyUp",resize:"onResize"},g=function(c){a.each(b.opened().reverse(),function(){return c.isDefaultPrevented()||!1!==this[f[c.type]](c)?void 0:(c.preventDefault(),c.stopPropagation(),!1)})},h=function(c){if(c!==b._globalHandlerInstalled){b._globalHandlerInstalled=c;var d=a.map(f,function(a,c){return c+"."+b.prototype.namespace}).join(" ");a(window)[c?"on":"off"](d,g)}};b.prototype={constructor:b,namespace:"featherlight",targetAttr:"data-featherlight",variant:null,resetCss:!1,background:null,openTrigger:"click",closeTrigger:"click",filter:null,root:"body",openSpeed:250,closeSpeed:250,closeOnClick:"background",closeOnEsc:!0,closeIcon:"&#10005;",loading:"",persist:!1,otherClose:null,beforeOpen:a.noop,beforeContent:a.noop,beforeClose:a.noop,afterOpen:a.noop,afterContent:a.noop,afterClose:a.noop,onKeyUp:a.noop,onResize:a.noop,type:null,contentFilters:["jquery","image","html","ajax","iframe","text"],setup:function(b,c){"object"!=typeof b||b instanceof a!=!1||c||(c=b,b=void 0);var d=a.extend(this,c,{target:b}),e=d.resetCss?d.namespace+"-reset":d.namespace,f=a(d.background||['<div class="'+e+"-loading "+e+'">','<div class="'+e+'-content">','<span class="'+e+"-close-icon "+d.namespace+'-close">',d.closeIcon,"</span>",'<div class="'+d.namespace+'-inner">'+d.loading+"</div>","</div>","</div>"].join("")),g="."+d.namespace+"-close"+(d.otherClose?","+d.otherClose:"");return d.$instance=f.clone().addClass(d.variant),d.$instance.on(d.closeTrigger+"."+d.namespace,function(b){var c=a(b.target);("background"===d.closeOnClick&&c.is("."+d.namespace)||"anywhere"===d.closeOnClick||c.closest(g).length)&&(b.preventDefault(),d.close())}),this},getContent:function(){if(this.persist!==!1&&this.$content)return this.$content;var b=this,c=this.constructor.contentFilters,d=function(a){return b.$currentTarget&&b.$currentTarget.attr(a)},e=d(b.targetAttr),f=b.target||e||"",g=c[b.type];if(!g&&f in c&&(g=c[f],f=b.target&&e),f=f||d("href")||"",!g)for(var h in c)b[h]&&(g=c[h],f=b[h]);if(!g){var i=f;if(f=null,a.each(b.contentFilters,function(){return g=c[this],g.test&&(f=g.test(i)),!f&&g.regex&&i.match&&i.match(g.regex)&&(f=i),!f}),!f)return"console"in window&&window.console.error("Featherlight: no content filter found "+(i?' for "'+i+'"':" (no target specified)")),!1}return g.process.call(b,f)},setContent:function(b){var c=this;return(b.is("iframe")||a("iframe",b).length>0)&&c.$instance.addClass(c.namespace+"-iframe"),c.$instance.removeClass(c.namespace+"-loading"),c.$instance.find("."+c.namespace+"-inner").not(b).slice(1).remove().end().replaceWith(a.contains(c.$instance[0],b[0])?"":b),c.$content=b.addClass(c.namespace+"-inner"),c},open:function(b){var d=this;if(d.$instance.hide().appendTo(d.root),!(b&&b.isDefaultPrevented()||d.beforeOpen(b)===!1)){b&&b.preventDefault();var e=d.getContent();if(e)return c.push(d),h(!0),d.$instance.fadeIn(d.openSpeed),d.beforeContent(b),a.when(e).always(function(a){d.setContent(a),d.afterContent(b)}).then(d.$instance.promise()).done(function(){d.afterOpen(b)})}return d.$instance.detach(),a.Deferred().reject().promise()},close:function(b){var c=this,e=a.Deferred();return c.beforeClose(b)===!1?e.reject():(0===d(c).length&&h(!1),c.$instance.fadeOut(c.closeSpeed,function(){c.$instance.detach(),c.afterClose(b),e.resolve()})),e.promise()},chainCallbacks:function(b){for(var c in b)this[c]=a.proxy(b[c],this,a.proxy(this[c],this))}},a.extend(b,{id:0,autoBind:"[data-featherlight]",defaults:b.prototype,contentFilters:{jquery:{regex:/^[#.]\w/,test:function(b){return b instanceof a&&b},process:function(b){return this.persist!==!1?a(b):a(b).clone(!0)}},image:{regex:/\.(png|jpg|jpeg|gif|tiff|bmp|svg)(\?\S*)?$/i,process:function(b){var c=this,d=a.Deferred(),e=new Image,f=a('<img src="'+b+'" alt="" class="'+c.namespace+'-image" />');return e.onload=function(){f.naturalWidth=e.width,f.naturalHeight=e.height,d.resolve(f)},e.onerror=function(){d.reject(f)},e.src=b,d.promise()}},html:{regex:/^\s*<[\w!][^<]*>/,process:function(b){return a(b)}},ajax:{regex:/./,process:function(b){var c=a.Deferred(),d=a("<div></div>").load(b,function(a,b){"error"!==b&&c.resolve(d.contents()),c.fail()});return c.promise()}},iframe:{process:function(b){var c=new a.Deferred,d=a("<iframe/>").hide().attr("src",b).css(e(this,"iframe")).on("load",function(){c.resolve(d.show())}).appendTo(this.$instance.find("."+this.namespace+"-content"));return c.promise()}},text:{process:function(b){return a("<div>",{text:b})}}},functionAttributes:["beforeOpen","afterOpen","beforeContent","afterContent","beforeClose","afterClose"],readElementConfig:function(b,c){var d=this,e=new RegExp("^data-"+c+"-(.*)"),f={};return b&&b.attributes&&a.each(b.attributes,function(){var b=this.name.match(e);if(b){var c=this.value,g=a.camelCase(b[1]);if(a.inArray(g,d.functionAttributes)>=0)c=new Function(c);else try{c=a.parseJSON(c)}catch(h){}f[g]=c}}),f},extend:function(b,c){var d=function(){this.constructor=b};return d.prototype=this.prototype,b.prototype=new d,b.__super__=this.prototype,a.extend(b,this,c),b.defaults=b.prototype,b},attach:function(b,c,d){var e=this;"object"!=typeof c||c instanceof a!=!1||d||(d=c,c=void 0),d=a.extend({},d);var f,g=d.namespace||e.defaults.namespace,h=a.extend({},e.defaults,e.readElementConfig(b[0],g),d);return b.on(h.openTrigger+"."+h.namespace,h.filter,function(g){var i=a.extend({$source:b,$currentTarget:a(this)},e.readElementConfig(b[0],h.namespace),e.readElementConfig(this,h.namespace),d),j=f||a(this).data("featherlight-persisted")||new e(c,i);"shared"===j.persist?f=j:j.persist!==!1&&a(this).data("featherlight-persisted",j),i.$currentTarget.blur(),j.open(g)}),b},current:function(){var a=this.opened();return a[a.length-1]||null},opened:function(){var b=this;return d(),a.grep(c,function(a){return a instanceof b})},close:function(){var a=this.current();return a?a.close():void 0},_onReady:function(){var b=this;b.autoBind&&(b.attach(a(document),{filter:b.autoBind}),a(b.autoBind).filter("[data-featherlight-filter]").each(function(){b.attach(a(this))}))},_callbackChain:{onKeyUp:function(a,b){return 27===b.keyCode?(this.closeOnEsc&&this.$instance.find("."+this.namespace+"-close:first").click(),!1):a(b)},onResize:function(a,b){if(this.$content.naturalWidth){var c=this.$content.naturalWidth,d=this.$content.naturalHeight;this.$content.css("width","").css("height","");var e=Math.max(c/parseInt(this.$content.parent().css("width"),10),d/parseInt(this.$content.parent().css("height"),10));e>1&&this.$content.css("width",""+c/e+"px").css("height",""+d/e+"px")}return a(b)},afterContent:function(a,b){var c=a(b);return this.onResize(b),c}}}),a.featherlight=b,a.fn.featherlight=function(a,c){return b.attach(this,a,c)},a(document).ready(function(){b._onReady()})}(jQuery),function(a){"use strict";function b(c,d){if(!(this instanceof b)){var e=new b(a.extend({$source:c,$currentTarget:c.first()},d));return e.open(),e}a.featherlight.apply(this,arguments),this.chainCallbacks(h)}var c=function(a){window.console&&window.console.warn&&window.console.warn("FeatherlightGallery: "+a)};if("undefined"==typeof a)return c("Too much lightness, Featherlight needs jQuery.");if(!a.featherlight)return c("Load the featherlight plugin before the gallery plugin");var d="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch,e=a.event&&a.event.special.swipeleft&&a,f=window.Hammer&&function(a){var b=new window.Hammer.Manager(a[0]);return b.add(new window.Hammer.Swipe),b},g=d&&(e||f);d&&!g&&c("No compatible swipe library detected; one must be included before featherlightGallery for swipe motions to navigate the galleries.");var h={afterClose:function(a,b){var c=this;return c.$instance.off("next."+c.namespace+" previous."+c.namespace),c._swiper&&(c._swiper.off("swipeleft",c._swipeleft).off("swiperight",c._swiperight),c._swiper=null),a(b)},beforeOpen:function(a,b){var c=this;return c.$instance.on("next."+c.namespace+" previous."+c.namespace,function(a){var b="next"===a.type?1:-1;c.navigateTo(c.currentNavigation()+b)}),g?c._swiper=g(c.$instance).on("swipeleft",c._swipeleft=function(){c.$instance.trigger("next")}).on("swiperight",c._swiperight=function(){c.$instance.trigger("previous")}):c.$instance.find("."+c.namespace+"-content").append(c.createNavigation("previous")).append(c.createNavigation("next")),a(b)},onKeyUp:function(a,b){var c={37:"previous",39:"next"}[b.keyCode];return c?(this.$instance.trigger(c),!1):a(b)}};a.featherlight.extend(b,{autoBind:"[data-featherlight-gallery]"}),a.extend(b.prototype,{previousIcon:"&#9664;",nextIcon:"&#9654;",galleryFadeIn:100,galleryFadeOut:300,slides:function(){return this.filter?this.$source.find(this.filter):this.$source},images:function(){return c("images is deprecated, please use slides instead"),this.slides()},currentNavigation:function(){return this.slides().index(this.$currentTarget)},navigateTo:function(b){var c=this,d=c.slides(),e=d.length,f=c.$instance.find("."+c.namespace+"-inner");return b=(b%e+e)%e,c.$currentTarget=d.eq(b),c.beforeContent(),a.when(c.getContent(),f.fadeTo(c.galleryFadeOut,.2)).always(function(a){c.setContent(a),c.afterContent(),a.fadeTo(c.galleryFadeIn,1)})},createNavigation:function(b){var c=this;return a('<span title="'+b+'" class="'+this.namespace+"-"+b+'"><span>'+this[b+"Icon"]+"</span></span>").click(function(){a(this).trigger(b+"."+c.namespace)})}}),a.featherlightGallery=b,a.fn.featherlightGallery=function(a){return b.attach(this,a)},a(document).ready(function(){b._onReady()})}(jQuery),function(a,b,c){"use strict";function d(a,c){return/(png|jpg|jpeg|gif|tiff|bmp)$/.test(b(c).attr("href").toLowerCase().split("?")[0].split("#")[0])}function e(){b("a[href]").filter(d).attr("data-featherlight","image")}function f(a,c){var d=b(c),e=d.find(".gallery-item a");0===e.length&&(e=d.find(".tiled-gallery-item a")),e.attr("data-featherlight")&&e.featherlightGallery()}function g(){var a=b(".gallery, .tiled-gallery");0!==a.length&&b.each(a,f)}function h(){b.featherlight.prototype.afterContent=function(){var a=this.$instance,c=this.$currentTarget,d=c.parent(),e=d.find(".wp-caption-text"),f=c.parents(".gallery-item"),g=c.parents(".tiled-gallery-item");0!==f.length?e=f.find(".wp-caption-text"):0!==g.length&&(e=g.find(".tiled-gallery-caption")),a.find(".caption").remove(),0!==e.length&&b('<div class="caption">').text(e.text()).appendTo(a.find(".featherlight-content"))}}function i(){e(),g(),j.hasClass("wp-featherlight-captions")&&h()}var j=b("body");b(document).ready(function(){i()})}(this,jQuery);
languages/wp-featherlight-de_DE.mo ADDED
Binary file
languages/wp-featherlight-es_ES.mo ADDED
Binary file
languages/wp-featherlight-fr_FR .mo ADDED
Binary file
languages/wp-featherlight-fr_FR.mo ADDED
Binary file
languages/wp-featherlight-pt_BR.mo ADDED
Binary file
languages/wp-featherlight.pot ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2015 WP Site Care
2
+ # This file is distributed under the GPL-2.0+.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: WP Featherlight 0.3.0\n"
6
+ "Report-Msgid-Bugs-To: Robert Neu <translations@wpsitecare.com>\n"
7
+ "POT-Creation-Date: 2015-09-02 02:22:17+00:00\n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=utf-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2015-MO-DA HO:MI+ZONE\n"
12
+ "Last-Translator: Robert Neu <translations@wpsitecare.com>\n"
13
+ "Language-Team: Robert Neu <translations@wpsitecare.com>\n"
14
+ "X-Generator: grunt-wp-i18n 0.5.3\n"
15
+ "X-Poedit-KeywordsList: "
16
+ "__;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_"
17
+ "attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c;\n"
18
+ "Language: en\n"
19
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
20
+ "X-Poedit-Country: United States\n"
21
+ "X-Poedit-SourceCharset: UTF-8\n"
22
+ "X-Poedit-Basepath: ../\n"
23
+ "X-Poedit-SearchPath-0: .\n"
24
+ "X-Poedit-Bookmarks: \n"
25
+ "X-Textdomain-Support: yes\n"
26
+
27
+ #: admin/class-meta.php:118
28
+ msgid "WP Featherlight Options"
29
+ msgstr ""
30
+
31
+ #: admin/templates/metabox-sidebar.php:15
32
+ msgid "Disable lightbox"
33
+ msgstr ""
34
+
35
+ #. Plugin Name of the plugin/theme
36
+ msgid "WP Featherlight"
37
+ msgstr ""
38
+
39
+ #. Plugin URI of the plugin/theme
40
+ msgid "http://www.wpsitecare.com/wp-featherlight/"
41
+ msgstr ""
42
+
43
+ #. Description of the plugin/theme
44
+ msgid "An ultra lightweight jQuery lightbox for WordPress images and galleries."
45
+ msgstr ""
46
+
47
+ #. Author of the plugin/theme
48
+ msgid "WP Site Care"
49
+ msgstr ""
50
+
51
+ #. Author URI of the plugin/theme
52
+ msgid "http://www.wpsitecare.com"
53
+ msgstr ""
readme.txt CHANGED
@@ -1,32 +1,78 @@
1
- === WP Featherlight ===
2
 
3
  Contributors: fatmedia, wpsitecare
4
- Tags: jquery, lightbox, featherlight, photography, images, popup, minimal, responsive
5
- Requires at least: 4.1
6
- Tested up to: 4.2.2
7
- Stable tag: 0.2.0
8
  License: GPL-2.0+
9
 
10
  An ultra lightweight jQuery lightbox for WordPress images and galleries.
11
 
12
  == Description ==
13
 
14
- WP Featherlight is a WordPress plugin wrapper for the Featherlight jQuery lightbox plugin. When installed, the plugin will automatically display all standard WordPress images and galleries in a simple, minimalistic lightbox popup. It's also possible to load Videos, iframes, and ajax content using WP Featherlight by adding data attributes to your content. For more details on custom content loading, check out the [featherlight documentation](https://github.com/noelboss/featherlight/#usage).
 
 
 
 
15
 
16
  There are no settings for WP Featherlight, so you should be able to install it without needing to configure anything. In the event you don't want a lightbox on certain pages or posts, there is an option to disable it from within the post editor screen.
17
 
18
  If you find a display problem, it may be related to your theme but please [open an support request](https://wordpress.org/support/plugin/wp-featherlight) about it so we can look into it. For more information about the Featherlight script itself, check out their [GitHub plugin page](http://noelboss.github.io/featherlight/).
19
 
 
 
 
 
 
 
 
 
20
  = Contributing =
21
 
22
  If you'd like to submit code patches or contribute in any other way, please fork the plugin on GitHub. https://github.com/wpsitecare/wp-featherlight
23
 
24
  == Screenshots ==
25
 
26
- 1. A view of the lightbox in action.
27
 
28
  == Changelog ==
29
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  = 0.2.0 =
31
  The primary feature in this release is the addition of a visual loader and the automatic lightboxing of external images. In prior versions, only images from the WordPress host domain were lightboxed automatically. This caused some problems with people using a CDN as the URLs were treated as external.
32
 
1
+ === WP Featherlight - A Simple jQuery Lightbox ===
2
 
3
  Contributors: fatmedia, wpsitecare
4
+ Tags: lightbox, jquery lightbox, jquery, gallery, image, lightbox images, image lightbox, lightbox gallery, lightbox image, lightbox popup, featherlight, photo gallery, popup image, popup images, popup lightbox, responsive lightbox, swipe, wordpress image lightbox, wordpress lightbox, wordpress slideshow lightbox, photography, images, minimal, responsive, photo, photos
5
+ Requires at least: 4.3
6
+ Tested up to: 4.5.2
7
+ Stable tag: 0.3.0
8
  License: GPL-2.0+
9
 
10
  An ultra lightweight jQuery lightbox for WordPress images and galleries.
11
 
12
  == Description ==
13
 
14
+ WP Featherlight is a WordPress lightbox plugin for adding a minimal, high-performance, responsive jQuery lightbox to your WordPress website. At its core, WP Featherlight is a WordPress plugin wrapper for the Featherlight jQuery lightbox plugin. When installed, the plugin will automatically display all standard WordPress images and galleries in a simple, minimalistic lightbox popup.
15
+
16
+ In order for WordPress images and galleries to be lightboxed, you need to select the "Media File" option when choosing where the thumbnails should link. You can also select the "Custom Link" option if you make sure to link directly to an image file. This should work for any image file, even if it's hosted on another website.
17
+
18
+ It's also possible to lightbox videos, iframes, and ajax content with WP Featherlight by adding data attributes to your content. For more details on custom content loading, check out the [featherlight documentation](https://github.com/noelboss/featherlight/#usage).
19
 
20
  There are no settings for WP Featherlight, so you should be able to install it without needing to configure anything. In the event you don't want a lightbox on certain pages or posts, there is an option to disable it from within the post editor screen.
21
 
22
  If you find a display problem, it may be related to your theme but please [open an support request](https://wordpress.org/support/plugin/wp-featherlight) about it so we can look into it. For more information about the Featherlight script itself, check out their [GitHub plugin page](http://noelboss.github.io/featherlight/).
23
 
24
+ WP Featherlight was built by <a rel="friend" href="http://www.wpsitecare.com">WordPress support</a> company WP Site Care. If you're interested in choosing the <a rel="friend" href="http://www.wpsitecare.com/best-wordpress-plugins/">best WordPress plugins</a> or need to find the fastest <a rel="friend" href="http://www.wpsitecare.com/performance-of-7-top-wordpress-hosting-companies-compared/">WordPress hosting</a> provider, check out our blog and subscribe for new articles every week!
25
+
26
+ = Developer Notes =
27
+
28
+ While there are no options in the plugin, there are some handy filters to modify the default behavior. As of `0.3.0` all images which use the default WordPress captions will also include a caption when the image is lightboxed. To disable this behavior, filter `wp_featherlight_captions` to false.
29
+
30
+ You can also disable inclusion of the CSS and JavaScript conditionally using filters which can be found in the `/includes/class-scripts.php` file. If you have questions about how any part of the plugin works, please don't hesitate to [open an issue on GitHub](https://github.com/wpsitecare/wp-featherlight/issues).
31
+
32
  = Contributing =
33
 
34
  If you'd like to submit code patches or contribute in any other way, please fork the plugin on GitHub. https://github.com/wpsitecare/wp-featherlight
35
 
36
  == Screenshots ==
37
 
38
+ 1. A view of the jQuery lightbox in action.
39
 
40
  == Changelog ==
41
 
42
+ = 0.3.0 =
43
+
44
+ There are quite a few internal changes in the plugin for this release, plus some nice new features and improvements on the front-end. We've streamlined everything as much as possible and also added support for some languages other than English! Here's a breakdown of everything that's changed:
45
+
46
+ New Features
47
+ - Automatic captioning for WordPress images and gallery items (Including Jetpack Galleries)
48
+ - Spanish language translation
49
+
50
+ Enhancements
51
+ - Updated [Featherlight](https://github.com/noelboss/featherlight/) to `1.3.3`
52
+ - Improved gallery styles on desktop and mobile devices
53
+ - Streamlined overall styles
54
+ - Added SVG icons for more visual consistency across various platforms
55
+ - Simplified the text used in the admin metabox to ease translations (props @toscho)
56
+
57
+ Bug Fixes
58
+ - Improved handling of images when certain caching plugins are enabled
59
+ - Prevented gallery arrows from being hijacked by WP Emoji
60
+ - Fixed a bug which allowed multiple light boxes to be opened using keyboard commands
61
+
62
+ Developer Stuff
63
+ - Reduced overhead by loading language files only when needed (props @toscho)
64
+ - Improved the save routine for our admin metabox (props @toscho)
65
+ - Added a `wp_featherlight_captions` filter to control auto-captioning. Filter it to false to disable captions.
66
+ - Re-structured the plugin's internal code base and deprecated plugin constants
67
+ - Added Grunt and Bower the plugin to allow easier updates and releases in the future
68
+
69
+ Added Language Support
70
+ - German
71
+ - Spanish
72
+ - French
73
+ - Portuguese (Brazil)
74
+ - Spanish (Peru)
75
+
76
  = 0.2.0 =
77
  The primary feature in this release is the addition of a visual loader and the automatic lightboxing of external images. In prior versions, only images from the WordPress host domain were lightboxed automatically. This caused some problems with people using a CDN as the URLs were treated as external.
78
 
wp-featherlight.php CHANGED
@@ -3,9 +3,9 @@
3
  * Plugin Name: WP Featherlight
4
  * Plugin URI: http://www.wpsitecare.com/wp-featherlight/
5
  * Description: An ultra lightweight jQuery lightbox for WordPress images and galleries.
6
- * Version: 0.2.0
7
- * Author: Robert Neu
8
- * Author URI: http://robneu.com
9
  * License: GPL-2.0+
10
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
  * Text Domain: wp-featherlight
@@ -15,20 +15,11 @@
15
  // Prevent direct access.
16
  defined( 'ABSPATH' ) || exit;
17
 
18
- define( 'WP_FEATHERLIGHT_FILE', __FILE__ );
19
- define( 'WP_FEATHERLIGHT_VERSION', '0.2.0' );
20
-
21
- if ( ! defined( 'WP_FEATHERLIGHT_DIR' ) ) {
22
- define( 'WP_FEATHERLIGHT_DIR', plugin_dir_path( WP_FEATHERLIGHT_FILE ) );
23
- }
24
-
25
- if ( ! defined( 'WP_FEATHERLIGHT_URL' ) ) {
26
- define( 'WP_FEATHERLIGHT_URL', plugin_dir_url( WP_FEATHERLIGHT_FILE ) );
27
- }
28
-
29
  // Load the main plugin class.
30
- require_once WP_FEATHERLIGHT_DIR . 'includes/plugin.php';
 
31
 
 
32
  /**
33
  * Allow themes and plugins to access WP_Featherlight methods and properties.
34
  *
@@ -38,7 +29,7 @@ require_once WP_FEATHERLIGHT_DIR . 'includes/plugin.php';
38
  *
39
  * Example:
40
  *
41
- * <?php wp_featherlight()->meta; ?>
42
  *
43
  * @since 0.1.0
44
  * @access public
@@ -48,7 +39,7 @@ require_once WP_FEATHERLIGHT_DIR . 'includes/plugin.php';
48
  function wp_featherlight() {
49
  static $plugin;
50
  if ( null === $plugin ) {
51
- $plugin = new WP_Featherlight;
52
  }
53
  return $plugin;
54
  }
@@ -60,10 +51,4 @@ function wp_featherlight() {
60
  * @access public
61
  * @return void
62
  */
63
- register_activation_hook(
64
- WP_FEATHERLIGHT_FILE,
65
- array( wp_featherlight(), 'activate' )
66
- );
67
-
68
- // Hook the main plugin class into WordPress to get things running.
69
- add_action( 'plugins_loaded', array( wp_featherlight(), 'run' ) );
3
  * Plugin Name: WP Featherlight
4
  * Plugin URI: http://www.wpsitecare.com/wp-featherlight/
5
  * Description: An ultra lightweight jQuery lightbox for WordPress images and galleries.
6
+ * Version: 0.3.0
7
+ * Author: WP Site Care
8
+ * Author URI: http://www.wpsitecare.com
9
  * License: GPL-2.0+
10
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
  * Text Domain: wp-featherlight
15
  // Prevent direct access.
16
  defined( 'ABSPATH' ) || exit;
17
 
 
 
 
 
 
 
 
 
 
 
 
18
  // Load the main plugin class.
19
+ require_once plugin_dir_path( __FILE__ ) . 'includes/class-plugin.php';
20
+ require_once plugin_dir_path( __FILE__ ) . 'includes/constants.php';
21
 
22
+ add_action( 'plugins_loaded', array( wp_featherlight(), 'run' ) );
23
  /**
24
  * Allow themes and plugins to access WP_Featherlight methods and properties.
25
  *
29
  *
30
  * Example:
31
  *
32
+ * <?php wp_featherlight()->scripts; ?>
33
  *
34
  * @since 0.1.0
35
  * @access public
39
  function wp_featherlight() {
40
  static $plugin;
41
  if ( null === $plugin ) {
42
+ $plugin = new WP_Featherlight( array( 'file' => __FILE__ ) );
43
  }
44
  return $plugin;
45
  }
51
  * @access public
52
  * @return void
53
  */
54
+ register_activation_hook( __FILE__, array( wp_featherlight(), 'activate' ) );