Jdlrobson has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/316415

Change subject: Directory structure should reflect the ResourceLoader 
definitions
......................................................................

Directory structure should reflect the ResourceLoader definitions

Given we currently have modules defined in extension.json and in hooks
it can be really confusing understanding how the code fits together.

This change hopefully makes this a little clearer by using folder names
that are named after the resource loader modules - this is also consistent
with how we do things in our other extensions.

A images folder is added to the route so that it is clearer that the images
are not used in ResourceLoader module definitions and are only used to 
illustrate
the beta feature.

Change-Id: Ia650ec03e3a6d3069165441ddfa069d390be4d10
---
M Popups.hooks.php
M extension.json
R images/popups-ltr.svg
R images/popups-rtl.svg
R resources/ext.popups.core/ext.popups.core.js
R resources/ext.popups.core/ext.popups.core.less
R resources/ext.popups.core/images/cog.png
R resources/ext.popups.core/images/cog.svg
R resources/ext.popups.core/images/horn-ltr.png
R resources/ext.popups.core/images/horn-ltr.svg
R resources/ext.popups.core/images/horn-rtl.png
R resources/ext.popups.core/images/horn-rtl.svg
R resources/ext.popups.desktop/ext.popups.animation.less
R resources/ext.popups.desktop/ext.popups.renderer.article.js
R resources/ext.popups.desktop/ext.popups.settings.js
R resources/ext.popups.desktop/ext.popups.settings.less
R resources/ext.popups.desktop/images/footer-ltr.png
R resources/ext.popups.desktop/images/footer-ltr.svg
R resources/ext.popups.desktop/images/footer-rtl.png
R resources/ext.popups.desktop/images/footer-rtl.svg
R resources/ext.popups.desktop/images/hovercard.svg
R resources/ext.popups.desktop/images/navpop.svg
R resources/ext.popups.desktop/popup.mustache
R resources/ext.popups.desktop/settings.mustache
R resources/ext.popups.renderer.desktopRenderer/desktopRenderer.js
R resources/ext.popups.renderer.mobileRenderer/LinkPreview.less
R resources/ext.popups.renderer.mobileRenderer/LinkPreviewDrawer.hogan
R resources/ext.popups.renderer.mobileRenderer/LinkPreviewDrawer.js
R resources/ext.popups.renderer.mobileRenderer/mobileRenderer.js
R resources/ext.popups.schemaPopups.utils/ext.popups.schemaPopups.utils.js
R resources/ext.popups.schemaPopups/ext.popups.schemaPopups.js
R resources/ext.popups.targets.desktopTarget/desktopTarget.js
R resources/ext.popups.targets.mobileTarget/mobileTarget.js
R tests/qunit/ext.popups.desktopRenderer.test.js
34 files changed, 21 insertions(+), 21 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Popups 
refs/changes/15/316415/1

diff --git a/Popups.hooks.php b/Popups.hooks.php
index a0466f0..654a8f4 100644
--- a/Popups.hooks.php
+++ b/Popups.hooks.php
@@ -30,8 +30,8 @@
                        'label-message' => 'popups-message',
                        'desc-message' => 'popups-desc',
                        'screenshot' => array(
-                               'ltr' => 
"$wgExtensionAssetsPath/Popups/resources/images/popups-ltr.svg",
-                               'rtl' => 
"$wgExtensionAssetsPath/Popups/resources/images/popups-rtl.svg",
+                               'ltr' => 
"$wgExtensionAssetsPath/Popups/images/popups-ltr.svg",
+                               'rtl' => 
"$wgExtensionAssetsPath/Popups/images/popups-rtl.svg",
                        ),
                        'info-link' => 
'https://www.mediawiki.org/wiki/Beta_Features/Hovercards',
                        'discussion-link' => 
'https://www.mediawiki.org/wiki/Talk:Beta_Features/Hovercards',
@@ -81,7 +81,7 @@
                                        'ext.popups.schemaPopups.utils',
                                ],
                                'scripts' => [
-                                       'resources/ext.popups.schemaPopups.js',
+                                       
'resources/ext.popups.schemaPopups/ext.popups.schemaPopups.js',
                                ]
                        ];
                }
@@ -90,16 +90,16 @@
 
                $rl->register( "ext.popups.desktop", array(
                        'scripts' => array(
-                               'resources/ext.popups.renderer.article.js',
-                               'resources/ext.popups.settings.js',
+                               
'resources/ext.popups.desktop/ext.popups.renderer.article.js',
+                               
'resources/ext.popups.desktop/ext.popups.settings.js',
                        ),
                        'templates' => array(
-                               'popup.mustache' => 'resources/popup.mustache',
-                               'settings.mustache' => 
'resources/settings.mustache',
+                               'popup.mustache' => 
'resources/ext.popups.desktop/popup.mustache',
+                               'settings.mustache' => 
'resources/ext.popups.desktop/settings.mustache',
                        ),
                        'styles' => array(
-                               'resources/ext.popups.animation.less',
-                               'resources/ext.popups.settings.less',
+                               
'resources/ext.popups.desktop/ext.popups.animation.less',
+                               
'resources/ext.popups.desktop/ext.popups.settings.less',
                        ),
                        'dependencies' => $moduleDependencies,
                        'messages' => array(
@@ -138,7 +138,7 @@
                                                
'ext.popups.renderer.mobileRenderer',
                                        ),
                                        'scripts' => array(
-                                               
'resources/ext.popups.targets/mobileTarget.js',
+                                               
'resources/ext.popups.targets.mobileTarget/mobileTarget.js',
                                        ),
                                ) + $mobileBoilerplate
                        );
@@ -149,14 +149,14 @@
                                                'mobile.drawers',
                                        ),
                                        'scripts' => array(
-                                               
'resources/ext.popups.renderer/mobileRenderer.js',
-                                               
'resources/ext.popups.renderer/LinkPreviewDrawer.js',
+                                               
'resources/ext.popups.renderer.mobileRenderer/mobileRenderer.js',
+                                               
'resources/ext.popups.renderer.mobileRenderer/LinkPreviewDrawer.js',
                                        ),
                                        'templates' => array(
-                                               'LinkPreviewDrawer.hogan' => 
'resources/ext.popups.renderer/LinkPreviewDrawer.hogan',
+                                               'LinkPreviewDrawer.hogan' => 
'resources/ext.popups.renderer.mobileRenderer/LinkPreviewDrawer.hogan',
                                        ),
                                        'styles' => array(
-                                               
'resources/ext.popups.renderer/LinkPreview.less',
+                                               
'resources/ext.popups.renderer.mobileRenderer/LinkPreview.less',
                                        ),
                                        'messages' => array(
                                                
'popups-mobile-continue-to-page',
@@ -229,7 +229,7 @@
        public static function onResourceLoaderTestModules( array 
&$testModules, ResourceLoader &$resourceLoader ) {
                $testModules['qunit']['ext.popups.tests'] = array(
                        'scripts' => array(
-                               
'tests/qunit/ext.popups.renderer/desktopRenderer.test.js',
+                               
'tests/qunit/ext.popups.desktopRenderer.test.js',
                                
'tests/qunit/ext.popups.renderer.article.test.js',
                                'tests/qunit/ext.popups.core.test.js',
                                
'tests/qunit/ext.popups.schemaPopups.utils.test.js',
diff --git a/extension.json b/extension.json
index 890b183..b5e2ba2 100644
--- a/extension.json
+++ b/extension.json
@@ -61,7 +61,7 @@
        "ResourceModules": {
                "ext.popups.core": {
                        "scripts": [
-                               "resources/ext.popups.core.js"
+                               "resources/ext.popups.core/ext.popups.core.js"
                        ],
                        "dependencies": [
                                "mediawiki.api",
@@ -77,12 +77,12 @@
                                "mobile"
                        ],
                        "styles": [
-                               "resources/ext.popups.core.less"
+                               "resources/ext.popups.core/ext.popups.core.less"
                        ]
                },
                "ext.popups.targets.desktopTarget": {
                        "scripts": [
-                               "resources/ext.popups.targets/desktopTarget.js"
+                               
"resources/ext.popups.targets.desktopTarget/desktopTarget.js"
                        ],
                        "dependencies": [
                                "mediawiki.storage",
@@ -102,7 +102,7 @@
                },
                "ext.popups.renderer.desktopRenderer": {
                        "scripts": [
-                               
"resources/ext.popups.renderer/desktopRenderer.js"
+                               
"resources/ext.popups.renderer.desktopRenderer/desktopRenderer.js"
                        ],
                        "dependencies": [
                                "ext.popups.core"
@@ -110,7 +110,7 @@
                },
                "ext.popups.schemaPopups.utils": {
                        "scripts": [
-                               "resources/ext.popups.schemaPopups.utils.js"
+                               
"resources/ext.popups.schemaPopups.utils/ext.popups.schemaPopups.utils.js"
                        ],
                        "dependencies": [
                                "mediawiki.experiments",
diff --git a/resources/images/popups-ltr.svg b/images/popups-ltr.svg
similarity index 100%
rename from resources/images/popups-ltr.svg
rename to images/popups-ltr.svg
diff --git a/resources/images/popups-rtl.svg b/images/popups-rtl.svg
similarity index 100%
rename from resources/images/popups-rtl.svg
rename to images/popups-rtl.svg
diff --git a/resources/ext.popups.core.js 
b/resources/ext.popups.core/ext.popups.core.js
similarity index 100%
rename from resources/ext.popups.core.js
rename to resources/ext.popups.core/ext.popups.core.js
diff --git a/resources/ext.popups.core.less 
b/resources/ext.popups.core/ext.popups.core.less
similarity index 100%
rename from resources/ext.popups.core.less
rename to resources/ext.popups.core/ext.popups.core.less
diff --git a/resources/images/cog.png b/resources/ext.popups.core/images/cog.png
similarity index 100%
rename from resources/images/cog.png
rename to resources/ext.popups.core/images/cog.png
Binary files differ
diff --git a/resources/images/cog.svg b/resources/ext.popups.core/images/cog.svg
similarity index 100%
rename from resources/images/cog.svg
rename to resources/ext.popups.core/images/cog.svg
diff --git a/resources/images/horn-ltr.png 
b/resources/ext.popups.core/images/horn-ltr.png
similarity index 100%
rename from resources/images/horn-ltr.png
rename to resources/ext.popups.core/images/horn-ltr.png
Binary files differ
diff --git a/resources/images/horn-ltr.svg 
b/resources/ext.popups.core/images/horn-ltr.svg
similarity index 100%
rename from resources/images/horn-ltr.svg
rename to resources/ext.popups.core/images/horn-ltr.svg
diff --git a/resources/images/horn-rtl.png 
b/resources/ext.popups.core/images/horn-rtl.png
similarity index 100%
rename from resources/images/horn-rtl.png
rename to resources/ext.popups.core/images/horn-rtl.png
Binary files differ
diff --git a/resources/images/horn-rtl.svg 
b/resources/ext.popups.core/images/horn-rtl.svg
similarity index 100%
rename from resources/images/horn-rtl.svg
rename to resources/ext.popups.core/images/horn-rtl.svg
diff --git a/resources/ext.popups.animation.less 
b/resources/ext.popups.desktop/ext.popups.animation.less
similarity index 100%
rename from resources/ext.popups.animation.less
rename to resources/ext.popups.desktop/ext.popups.animation.less
diff --git a/resources/ext.popups.renderer.article.js 
b/resources/ext.popups.desktop/ext.popups.renderer.article.js
similarity index 100%
rename from resources/ext.popups.renderer.article.js
rename to resources/ext.popups.desktop/ext.popups.renderer.article.js
diff --git a/resources/ext.popups.settings.js 
b/resources/ext.popups.desktop/ext.popups.settings.js
similarity index 98%
rename from resources/ext.popups.settings.js
rename to resources/ext.popups.desktop/ext.popups.settings.js
index 1d23274..8e2aa8d 100644
--- a/resources/ext.popups.settings.js
+++ b/resources/ext.popups.desktop/ext.popups.settings.js
@@ -20,7 +20,7 @@
         * @method render
         */
        settings.render = function () {
-               var path = mw.config.get( 'wgExtensionAssetsPath' ) + 
'/Popups/resources/',
+               var path = mw.config.get( 'wgExtensionAssetsPath' ) + 
'/Popups/resources/ext.popups.desktop/',
                        choices = [
                                {
                                        id: 'simple',
diff --git a/resources/ext.popups.settings.less 
b/resources/ext.popups.desktop/ext.popups.settings.less
similarity index 100%
rename from resources/ext.popups.settings.less
rename to resources/ext.popups.desktop/ext.popups.settings.less
diff --git a/resources/images/footer-ltr.png 
b/resources/ext.popups.desktop/images/footer-ltr.png
similarity index 100%
rename from resources/images/footer-ltr.png
rename to resources/ext.popups.desktop/images/footer-ltr.png
Binary files differ
diff --git a/resources/images/footer-ltr.svg 
b/resources/ext.popups.desktop/images/footer-ltr.svg
similarity index 100%
rename from resources/images/footer-ltr.svg
rename to resources/ext.popups.desktop/images/footer-ltr.svg
diff --git a/resources/images/footer-rtl.png 
b/resources/ext.popups.desktop/images/footer-rtl.png
similarity index 100%
rename from resources/images/footer-rtl.png
rename to resources/ext.popups.desktop/images/footer-rtl.png
Binary files differ
diff --git a/resources/images/footer-rtl.svg 
b/resources/ext.popups.desktop/images/footer-rtl.svg
similarity index 100%
rename from resources/images/footer-rtl.svg
rename to resources/ext.popups.desktop/images/footer-rtl.svg
diff --git a/resources/images/hovercard.svg 
b/resources/ext.popups.desktop/images/hovercard.svg
similarity index 100%
rename from resources/images/hovercard.svg
rename to resources/ext.popups.desktop/images/hovercard.svg
diff --git a/resources/images/navpop.svg 
b/resources/ext.popups.desktop/images/navpop.svg
similarity index 100%
rename from resources/images/navpop.svg
rename to resources/ext.popups.desktop/images/navpop.svg
diff --git a/resources/popup.mustache 
b/resources/ext.popups.desktop/popup.mustache
similarity index 100%
rename from resources/popup.mustache
rename to resources/ext.popups.desktop/popup.mustache
diff --git a/resources/settings.mustache 
b/resources/ext.popups.desktop/settings.mustache
similarity index 100%
rename from resources/settings.mustache
rename to resources/ext.popups.desktop/settings.mustache
diff --git a/resources/ext.popups.renderer/desktopRenderer.js 
b/resources/ext.popups.renderer.desktopRenderer/desktopRenderer.js
similarity index 100%
rename from resources/ext.popups.renderer/desktopRenderer.js
rename to resources/ext.popups.renderer.desktopRenderer/desktopRenderer.js
diff --git a/resources/ext.popups.renderer/LinkPreview.less 
b/resources/ext.popups.renderer.mobileRenderer/LinkPreview.less
similarity index 100%
rename from resources/ext.popups.renderer/LinkPreview.less
rename to resources/ext.popups.renderer.mobileRenderer/LinkPreview.less
diff --git a/resources/ext.popups.renderer/LinkPreviewDrawer.hogan 
b/resources/ext.popups.renderer.mobileRenderer/LinkPreviewDrawer.hogan
similarity index 100%
rename from resources/ext.popups.renderer/LinkPreviewDrawer.hogan
rename to resources/ext.popups.renderer.mobileRenderer/LinkPreviewDrawer.hogan
diff --git a/resources/ext.popups.renderer/LinkPreviewDrawer.js 
b/resources/ext.popups.renderer.mobileRenderer/LinkPreviewDrawer.js
similarity index 100%
rename from resources/ext.popups.renderer/LinkPreviewDrawer.js
rename to resources/ext.popups.renderer.mobileRenderer/LinkPreviewDrawer.js
diff --git a/resources/ext.popups.renderer/mobileRenderer.js 
b/resources/ext.popups.renderer.mobileRenderer/mobileRenderer.js
similarity index 100%
rename from resources/ext.popups.renderer/mobileRenderer.js
rename to resources/ext.popups.renderer.mobileRenderer/mobileRenderer.js
diff --git a/resources/ext.popups.schemaPopups.utils.js 
b/resources/ext.popups.schemaPopups.utils/ext.popups.schemaPopups.utils.js
similarity index 100%
rename from resources/ext.popups.schemaPopups.utils.js
rename to 
resources/ext.popups.schemaPopups.utils/ext.popups.schemaPopups.utils.js
diff --git a/resources/ext.popups.schemaPopups.js 
b/resources/ext.popups.schemaPopups/ext.popups.schemaPopups.js
similarity index 100%
rename from resources/ext.popups.schemaPopups.js
rename to resources/ext.popups.schemaPopups/ext.popups.schemaPopups.js
diff --git a/resources/ext.popups.targets/desktopTarget.js 
b/resources/ext.popups.targets.desktopTarget/desktopTarget.js
similarity index 100%
rename from resources/ext.popups.targets/desktopTarget.js
rename to resources/ext.popups.targets.desktopTarget/desktopTarget.js
diff --git a/resources/ext.popups.targets/mobileTarget.js 
b/resources/ext.popups.targets.mobileTarget/mobileTarget.js
similarity index 100%
rename from resources/ext.popups.targets/mobileTarget.js
rename to resources/ext.popups.targets.mobileTarget/mobileTarget.js
diff --git a/tests/qunit/ext.popups.renderer/desktopRenderer.test.js 
b/tests/qunit/ext.popups.desktopRenderer.test.js
similarity index 100%
rename from tests/qunit/ext.popups.renderer/desktopRenderer.test.js
rename to tests/qunit/ext.popups.desktopRenderer.test.js

-- 
To view, visit https://gerrit.wikimedia.org/r/316415
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia650ec03e3a6d3069165441ddfa069d390be4d10
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Popups
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <jrob...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to