Skip to content

Commit

Permalink
1.1.0 release
Browse files Browse the repository at this point in the history
* Removed inline JSON to avoid hitting page size limit
* Added config docs to README
  • Loading branch information
JeroenDeDauw committed Aug 28, 2019
1 parent 952e89b commit 59c62b7
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 21 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,34 @@ Display and behaviour of the timeline can be changed via several output paramete
}}
```

### Parameters

A full list of supported output parameters can be obtained in wiki via the `smwdoc` parser function:

```
{{#smwdoc: moderntimeline }}
```

### Configuration

The default value of all parameters can be changed by placing configuration in `LocalSettings.php`.
These configuration settings are available:

* wgModernTimelineWidth
* wgModernTimelineHeight
* wgModernTimelineBookmark
* wgModernTimelineBackground
* wgModernTimelineScaleFactor
* wgModernTimelinePosition
* wgModernTimelineTickWidth
* wgModernTimelineStartSlide
* wgModernTimelineStartAtEnd
* wgModernTimelineTransitionDuration
* wgModernTimelineNavHeight
* wgModernTimelineTemplate

Default values of these configuration settings can be found in `extension.json`. Do not change `extension.json`.

## Limitations

* The template parameter is not supported on "Special:Ask"
Expand Down
8 changes: 7 additions & 1 deletion RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@ These are the RELEASE NOTES for the **Modern Timeline** extension. See the
[README](/README.md) for further information on platform requirements, installation
and usage.

## Version 1.1.0

Released on August 28th, 2019.

* Improved handling of large data sets

## Version 1.0.0

Released on August 16th, 2019.

Initial release with a [TimelineJS3](https://github.com/NUKnightLab/TimelineJS3)
based result format featuring 12 customization parameters, template support and
date range support.
date range support.
14 changes: 7 additions & 7 deletions extension.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"name": "ModernTimeline",
"version": "1.0.0",

"version": "1.1.0",

"author": [
"[https://professional.wiki/ <span style=\"color: #df2e2c \">Professional</span>.Wiki]",
"[https://www.entropywins.wtf/mediawiki Jeroen De Dauw]"
],

"url": "https://github.com/ProfessionalWiki/ModernTimeline#modern-timeline",

"namemsg": "modern-timeline-name",

"descriptionmsg": "modern-timeline-desc",

"license-name": "GPL-2.0-or-later",

"type": "semantic",

"requires": {
Expand Down
15 changes: 4 additions & 11 deletions src/TimelinePresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,12 @@ private function newTimelineId(): string {
public function getResult( SMWQueryResult $result ): string {
SMWOutputs::requireResource( 'ext.modern.timeline' );

$json = $this->createJsonString( $result );

SMWOutputs::requireHeadItem(
$this->id,
$this->createJs( $json )
$this->createJs( $this->createJsonString( $result ) )
);

return $this->createDiv( $json );
return $this->createDiv();
}

private function createJsonString( SMWQueryResult $result ) {
Expand Down Expand Up @@ -76,7 +74,7 @@ private function createJs( string $json ): string {
);
}

private function createDiv( string $json ): string {
private function createDiv(): string {
$width = $this->parameters[TimelineOptions::PARAM_WIDTH]->getValue();
$height = $this->parameters[TimelineOptions::PARAM_HEIGHT]->getValue();

Expand All @@ -94,12 +92,7 @@ private function createDiv( string $json ): string {
'style' => 'width: 100%; height: calc(100% - 10px); background-color: rgba(0, 0, 0, 0.05); margin-top: 5px; margin-bottom: 5px;'
]
)
)
. \Html::element( // TODO: remove when system tests can test head items
'div',
[ 'style' => 'display:none' ],
$json
);
);
}

}
7 changes: 5 additions & 2 deletions tests/System/JsonScript/escaping.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
"to-contain": [
"Evil page",
"2019",
"Description: &amp;lt;script&amp;gt;&amp;lt;\\/script&amp;gt"
"&lt;script&gt;"
],
"not-contain": [
"<script></script>"
]
}
}
Expand All @@ -48,4 +51,4 @@
"is-incomplete": false,
"debug": false
}
}
}
8 changes: 8 additions & 0 deletions tests/System/JsonScriptTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@

class JsonScriptTest extends JsonTestCaseScriptRunnerTest {

public function setUp() {
if ( version_compare( SMW_VERSION, '3.1c', '<' ) ) {
$this->markTestSkipped( 'SMW version too old' );
}

parent::setUp();
}

protected function getTestCaseLocation() {
return __DIR__ . '/JsonScript';
}
Expand Down

0 comments on commit 59c62b7

Please sign in to comment.