Skip to content

Commit

Permalink
Break ImagesLoaded out into another extension (#11)
Browse files Browse the repository at this point in the history
* Remove imagesloaded; fix readme; bump version

* images loaded extension is a dependency
  • Loading branch information
jamesmontalvo3 authored Apr 20, 2017
1 parent 86cc53d commit 9837244
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
2 changes: 0 additions & 2 deletions MasonryMainPage.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ static function renderMasonryMainPage ( &$parser, $frame, $args ) {

// There are issues loading Masonry via ResourceLoader in MW 1.27, but not in MW 1.25.
// Functionality in other MW versions is unknown at this writing.
$scriptURL = "$wgServer/$wgExtensionAssetsPath/MasonryMainPage/imagesloaded.pkgd.js";
$wgOut->addScript( "<script type='text/javascript' src='$scriptURL'></script>" );
$scriptURL = "$wgServer/$wgExtensionAssetsPath/MasonryMainPage/masonry.pkgd.js";
$wgOut->addScript( "<script type='text/javascript' src='$scriptURL'></script>" );

Expand Down
4 changes: 2 additions & 2 deletions MasonryMainPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
'url' => 'http://github.com/enterprisemediawiki/MasonryMainPage',
'author' => '[https://www.mediawiki.org/wiki/User:Darenwelsh Daren Welsh]',
'descriptionmsg' => 'masonrymainpage-desc',
'version' => '0.3.0'
'version' => '0.4.0'
);


Expand All @@ -52,7 +52,7 @@
$wgAutoloadClasses['MasonryMainPage'] = __DIR__ . '/MasonryMainPage.class.php';

$wgResourceModules['ext.masonrymainpage.base'] = array(
'scripts' => array( 'imagesloaded.pkgd.js', 'masonry.pkgd.js', 'masonry-common.js' ),
'scripts' => array( 'masonry-common.js' ),
'styles' => 'Masonry.css',
'localBasePath' => __DIR__,
'remoteExtPath' => 'MasonryMainPage',
Expand Down
34 changes: 18 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
MasonryMainPage
=========================
===============

This extension enables the use of Masonry blocks in MediaWiki.
This extension enables the use of Masonry blocks in MediaWiki.

Masonry is developed by David DeSandro and information about that script can be found at http://masonry.desandro.com

=========================
DEPENDENCIES
------------

* [Extension:ImagesLoaded](https://github.com/enterprisemediawiki/ImagesLoaded)

USAGE
=========================
-----

To enable this extension, append the following to LocalSettings.php

Expand All @@ -28,13 +32,13 @@ To use this extension in a MediaWiki page, add the following elements to the con
Begin Masonry Blocks
-->
{{#masonry-block: title =
| width =
| color =
| body =
{{#masonry-block: title =
| width =
| color =
| body =
}}
{{#masonry-block: title =
| body =
{{#masonry-block: title =
| body =
}}
<!--
Expand All @@ -44,18 +48,17 @@ To use this extension in a MediaWiki page, add the following elements to the con
</div>
```

=========================
OPTIONS
=========================
-------

<ul><li>title = Title of your block (optional, will not show a header if omitted).</li>
<li>width = 1 (or 2) (optional, default is 1).</li>
<li>color = white (optional, default is green, options include orange, yellow, blue, white, purple, green, and none).</li>
<li>body = This is the main content. Wiki code like links can be included; templates and wiki tables cannot.</li></ul>

=========================
TEMPLATES
=========================
---------

Instead of clogging your main page with lots of content, you can also use templates.

For example, you could create Template:Pages That Need Help Block with the content below:
Expand All @@ -76,9 +79,8 @@ Then, on the main page, just place {{Pages That Need Help Block}} in the Masonry



=========================
BACKGROUND INFO
=========================
---------------

The parser function #masonry-block essentially adds the following code and applies some CSS:

Expand Down

0 comments on commit 9837244

Please sign in to comment.