Index: trunk/extensions/Storyboard/specials/StoryReview_body.php |
— | — | @@ -1,37 +0,0 @@ |
2 | | -<?php |
3 | | -/** |
4 | | - * File holding the SpecialStoryReview class that allows reviewers to moderate the submitted stories. |
5 | | - * |
6 | | - * @file StoryReview_body.php |
7 | | - * @ingroup Storyboard |
8 | | - * |
9 | | - * @author Jeroen De Dauw |
10 | | - */ |
11 | | - |
12 | | -if ( !defined( 'MEDIAWIKI' ) ) { |
13 | | - die( 'Not an entry point.' ); |
14 | | -} |
15 | | - |
16 | | -class SpecialStoryReview extends IncludableSpecialPage { |
17 | | - |
18 | | - public function __construct() { |
19 | | - parent::__construct( 'StoryReview' ); |
20 | | - |
21 | | - wfLoadExtensionMessages( 'Storyboard' ); |
22 | | - } |
23 | | - |
24 | | - public function execute( $language ) { |
25 | | - global $wgUser; |
26 | | - if ( $wgUser->isAllowed( 'storyreview' ) && !$wgUser->isBlocked() ) { |
27 | | - $this->addOutput(); |
28 | | - } else { |
29 | | - global $wgOut; |
30 | | - $wgOut->permissionRequired( 'storyreview' ); |
31 | | - } |
32 | | - } |
33 | | - |
34 | | - private function addOutput() { |
35 | | - global $wgOut; |
36 | | - $wgOut->includeJQuery(); |
37 | | - } |
38 | | -} |
Index: trunk/extensions/Storyboard/specials/StoryReview/StoryReview_body.php |
— | — | @@ -0,0 +1,37 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * File holding the SpecialStoryReview class that allows reviewers to moderate the submitted stories. |
| 5 | + * |
| 6 | + * @file StoryReview_body.php |
| 7 | + * @ingroup Storyboard |
| 8 | + * |
| 9 | + * @author Jeroen De Dauw |
| 10 | + */ |
| 11 | + |
| 12 | +if ( !defined( 'MEDIAWIKI' ) ) { |
| 13 | + die( 'Not an entry point.' ); |
| 14 | +} |
| 15 | + |
| 16 | +class SpecialStoryReview extends IncludableSpecialPage { |
| 17 | + |
| 18 | + public function __construct() { |
| 19 | + parent::__construct( 'StoryReview' ); |
| 20 | + |
| 21 | + wfLoadExtensionMessages( 'Storyboard' ); |
| 22 | + } |
| 23 | + |
| 24 | + public function execute( $language ) { |
| 25 | + global $wgUser; |
| 26 | + if ( $wgUser->isAllowed( 'storyreview' ) && !$wgUser->isBlocked() ) { |
| 27 | + $this->addOutput(); |
| 28 | + } else { |
| 29 | + global $wgOut; |
| 30 | + $wgOut->permissionRequired( 'storyreview' ); |
| 31 | + } |
| 32 | + } |
| 33 | + |
| 34 | + private function addOutput() { |
| 35 | + global $wgOut; |
| 36 | + $wgOut->includeJQuery(); |
| 37 | + } |
| 38 | +} |
Property changes on: trunk/extensions/Storyboard/specials/StoryReview/StoryReview_body.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 39 | + native |
Index: trunk/extensions/Storyboard/images/Background.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/Storyboard/images/Background.png |
___________________________________________________________________ |
Added: svn:mime-type |
2 | 40 | + image/png |
Index: trunk/extensions/Storyboard/images/Delicious.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/Storyboard/images/Delicious.png |
___________________________________________________________________ |
Added: svn:mime-type |
3 | 41 | + image/png |
Index: trunk/extensions/Storyboard/images/Twitter.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/Storyboard/images/Twitter.png |
___________________________________________________________________ |
Added: svn:mime-type |
4 | 42 | + image/png |
Index: trunk/extensions/Storyboard/images/Facebook.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/Storyboard/images/Facebook.png |
___________________________________________________________________ |
Added: svn:mime-type |
5 | 43 | + image/png |
Index: trunk/extensions/Storyboard/images/ajax_loader.gif |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/extensions/Storyboard/images/ajax_loader.gif |
___________________________________________________________________ |
Added: svn:mime-type |
6 | 44 | + application/octet-stream |
Index: trunk/extensions/Storyboard/images/spacer_result.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/Storyboard/images/spacer_result.png |
___________________________________________________________________ |
Added: svn:mime-type |
7 | 45 | + image/png |
Index: trunk/extensions/Storyboard/Storyboard.pg.sql |
— | — | @@ -0,0 +1,18 @@ |
| 2 | +-- Postgres version of the database schema for the Storyboard extension. |
| 3 | + |
| 4 | +BEGIN; |
| 5 | + |
| 6 | +CREATE SEQUENCE story_id_seq; |
| 7 | + |
| 8 | +CREATE TABLE `storyboard` ( |
| 9 | + story_id INTEGER PRIMARY KEY DEFAULT nextval('story_id_seq'), |
| 10 | + story_author_id INTEGER NULL, |
| 11 | + story_author_name TEXT NULL, |
| 12 | + story_hit_count INTEGER NOT NULL, |
| 13 | + story_title TEXT NOT NULL, |
| 14 | + story_text TEXT NULL, |
| 15 | + story_modified TIMESTAMPTZ NULL DEFAULT now(), |
| 16 | + story_created TIMESTAMPTZ NULL DEFAULT now(), |
| 17 | +); |
| 18 | + |
| 19 | +COMMIT; |
\ No newline at end of file |
Property changes on: trunk/extensions/Storyboard/Storyboard.pg.sql |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 20 | + native |
Index: trunk/extensions/Storyboard/Storyboard.php |
— | — | @@ -23,8 +23,10 @@ |
24 | 24 | |
25 | 25 | define( 'Storyboard_VERSION', '0' ); |
26 | 26 | |
| 27 | +// TODO: try to get out the hardcoded path. |
27 | 28 | $egStoryboardScriptPath = $wgScriptPath . '/extensions/Storyboard'; |
28 | 29 | $egStoryboardDir = dirname( __FILE__ ) . '/'; |
| 30 | +$egStoryboardStyleVersion = $wgStyleVersion . '-' . Storyboard_VERSION; |
29 | 31 | |
30 | 32 | // Include the settings file. |
31 | 33 | require_once( $egStoryboardDir . 'Storyboard_Settings.php' ); |
— | — | @@ -37,13 +39,13 @@ |
38 | 40 | $wgExtensionAliasesFiles['Storyboard'] = $egStoryboardDir . 'Storyboard.alias.php'; |
39 | 41 | |
40 | 42 | // Load and register the StoryReview special page and register it's group. |
41 | | -$wgAutoloadClasses['SpecialStoryReview'] = $egStoryboardDir . 'specials/StoryReview_body.php'; |
| 43 | +$wgAutoloadClasses['SpecialStoryReview'] = $egStoryboardDir . 'specials/StoryReview/StoryReview_body.php'; |
42 | 44 | $wgSpecialPages['StoryReview'] = 'SpecialStoryReview'; |
43 | 45 | $wgSpecialPageGroups['StoryReview'] = 'contribution'; |
44 | 46 | |
45 | 47 | // Load the tag extension classes. |
46 | | -$wgAutoloadClasses['TagStoryboard'] = $egStoryboardDir . 'tags/Storyboard_body.php'; |
47 | | -$wgAutoloadClasses['TagStorysubmission'] = $egStoryboardDir . 'tags/Storysubmission_body.php'; |
| 48 | +$wgAutoloadClasses['TagStoryboard'] = $egStoryboardDir . 'tags/Storyboard/Storyboard_body.php'; |
| 49 | +$wgAutoloadClasses['TagStorysubmission'] = $egStoryboardDir . 'tags/Storysubmission/Storysubmission_body.php'; |
48 | 50 | |
49 | 51 | // Register the tag extensions. |
50 | 52 | // Avoid unstubbing $wgParser on setHook() too early on modern (1.12+) MW versions, as per r35980. |
Index: trunk/extensions/Storyboard/tags/Storysubmission_body.php |
— | — | @@ -1,22 +0,0 @@ |
2 | | -<?php |
3 | | - |
4 | | -/** |
5 | | - * File holding the rendering function for the Storysubmission tag. |
6 | | - * |
7 | | - * @file Storysubmission_body.php |
8 | | - * @ingroup Storyboard |
9 | | - * |
10 | | - * @author Jeroen De Dauw |
11 | | - */ |
12 | | - |
13 | | -if ( !defined( 'MEDIAWIKI' ) ) { |
14 | | - die( 'Not an entry point.' ); |
15 | | -} |
16 | | - |
17 | | -class TagStorysubmission { |
18 | | - |
19 | | - public static function render( $input, $args, $parser, $frame ) { |
20 | | - return ''; |
21 | | - } |
22 | | - |
23 | | -} |
\ No newline at end of file |
Index: trunk/extensions/Storyboard/tags/Storyboard_body.php |
— | — | @@ -1,25 +0,0 @@ |
2 | | -<?php |
3 | | - |
4 | | -/** |
5 | | - * File holding the rendering function for the Storyboard tag. |
6 | | - * |
7 | | - * @file Storyboard_body.php |
8 | | - * @ingroup Storyboard |
9 | | - * |
10 | | - * @author Jeroen De Dauw |
11 | | - */ |
12 | | - |
13 | | -if ( !defined( 'MEDIAWIKI' ) ) { |
14 | | - die( 'Not an entry point.' ); |
15 | | -} |
16 | | - |
17 | | -class TagStoryboard { |
18 | | - |
19 | | - public static function render( $input, $args, $parser, $frame ) { |
20 | | - return ''; |
21 | | - } |
22 | | - |
23 | | -} |
24 | | - |
25 | | - |
26 | | - |
Index: trunk/extensions/Storyboard/tags/Storyboard/Storyboard.css |
— | — | @@ -0,0 +1,93 @@ |
| 2 | +/** |
| 3 | + * Storyboard tag css. |
| 4 | + * |
| 5 | + * @file Storyboard.css |
| 6 | + * @ingroup Storyboard |
| 7 | + * |
| 8 | + * @author Jeroen De Dauw |
| 9 | + * @author Tha Devil (helpmij.nl) |
| 10 | + */ |
| 11 | + |
| 12 | +#storyboard |
| 13 | +{ |
| 14 | + margin-left: 31px; |
| 15 | + width: 50%; |
| 16 | + height: 300px; |
| 17 | + overflow-y: scroll; |
| 18 | + overflow-x: hidden; |
| 19 | + font-family: Verdana; |
| 20 | + font-size: 10px; |
| 21 | +} |
| 22 | + |
| 23 | +#storyboard-results |
| 24 | +{ |
| 25 | + background: url(extensions/Storyboard/images/Background.png) repeat-y; |
| 26 | +} |
| 27 | + |
| 28 | +.storyboard-result |
| 29 | +{ |
| 30 | + padding-bottom: 6px; |
| 31 | + background: url(extensions/Storyboard/images/spacer_result.png) no-repeat bottom; |
| 32 | +} |
| 33 | + |
| 34 | +.storyboard-result .storyboard-header |
| 35 | +{ |
| 36 | + margin: 10px 0px 10px 15px; |
| 37 | +} |
| 38 | + |
| 39 | +.storyboard-result .storyboard-header .storyboard-title |
| 40 | +{ |
| 41 | + font: 16px "Lucida Sans", Verdana; |
| 42 | + font-weight: bold; |
| 43 | + width: 100px; |
| 44 | + height: 21px; |
| 45 | + overflow: hidden; |
| 46 | + float: left; |
| 47 | +} |
| 48 | + |
| 49 | +.storyboard-result |
| 50 | +{ |
| 51 | + margin-left: 12px; |
| 52 | + margin-right: 15px; |
| 53 | +} |
| 54 | + |
| 55 | +.storyboard-result |
| 56 | +{ |
| 57 | + float: left; |
| 58 | + width: 146px; |
| 59 | + height: 112px; |
| 60 | + margin-left: 3px; |
| 61 | + margin-right: 3px; |
| 62 | + margin-top: 10px; |
| 63 | + overflow: hidden; |
| 64 | + text-align: center; |
| 65 | +} |
| 66 | + |
| 67 | +.storyboard-result |
| 68 | +{ |
| 69 | + display: none; |
| 70 | +} |
| 71 | + |
| 72 | +#storyboard-loading |
| 73 | +{ |
| 74 | + background-image: url(extensions/Storyboard/images/ajax_loader.gif); |
| 75 | + width:31px; |
| 76 | + height:31px; |
| 77 | + margin:0 auto; |
| 78 | + margin-top: 10px; |
| 79 | +} |
| 80 | + |
| 81 | +.storyboard-footer |
| 82 | +{ |
| 83 | + height: 40px; |
| 84 | + padding-top: 20px; |
| 85 | + margin-left: 15px; |
| 86 | +} |
| 87 | + |
| 88 | +.storyboard-sharing |
| 89 | +{ |
| 90 | + margin-left: 750px; |
| 91 | + height: 30px; |
| 92 | + width: 110px; |
| 93 | + float: left; |
| 94 | +} |
Property changes on: trunk/extensions/Storyboard/tags/Storyboard/Storyboard.css |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 95 | + native |
Index: trunk/extensions/Storyboard/tags/Storyboard/Storyboard.js |
— | — | @@ -0,0 +1,87 @@ |
| 2 | + /** |
| 3 | + * Storyboard object. |
| 4 | + * |
| 5 | + * @file Storyboard.js |
| 6 | + * @ingroup Storyboard |
| 7 | + * |
| 8 | + * @author Jeroen De Dauw |
| 9 | + * @author Tha Devil (helpmij.nl) |
| 10 | + */ |
| 11 | + |
| 12 | +/** |
| 13 | + * Constructor for the Storyboard object. |
| 14 | + */ |
| 15 | +function Storyboard() { |
| 16 | + this.stories = []; |
| 17 | + |
| 18 | + this.pageNumber = 0; |
| 19 | + this.pageAmount = -1; |
| 20 | + |
| 21 | + this.isLoading = false; |
| 22 | +} |
| 23 | + |
| 24 | +/** |
| 25 | + * Scroll method. |
| 26 | + * Checks if new stories should be loaded, and calls loadAjax when this is the case. |
| 27 | + */ |
| 28 | +Storyboard.prototype.scroll = function(event) { |
| 29 | + var board = event.data[0]; |
| 30 | + var documentHeight = jQuery(document).height(); |
| 31 | + var top = jQuery("#storyboard").scrollTop(); |
| 32 | + |
| 33 | + var resultsHeight = 0; |
| 34 | + jQuery("#storyboard .storyboard-result").each(function() { |
| 35 | + resultsHeight += $(this).height(); |
| 36 | + }); |
| 37 | + |
| 38 | + var threshold = ( ( top / 2 ) + ( 0.01 * Math.pow(documentHeight, 2) ) ) / resultsHeight; |
| 39 | + if (threshold > 0.6) threshold = 0.6; |
| 40 | + |
| 41 | + if( top / resultsHeight >= threshold && !board.isLoading && board.pageNumber < board.pageAmount ) |
| 42 | + { |
| 43 | + board.loadAjax(); |
| 44 | + } |
| 45 | +}; |
| 46 | + |
| 47 | +/** |
| 48 | + * LoadAjax method. |
| 49 | + * Requests and loads new stories into the storyboard. |
| 50 | + */ |
| 51 | +Storyboard.prototype.loadAjax = function() { |
| 52 | + alert('load'); |
| 53 | + var t = this; |
| 54 | + |
| 55 | + this.isLoading = true; |
| 56 | + |
| 57 | + jQuery("#storyboard").append(jQuery("<div />").attr("id","storyboard-loading")); |
| 58 | + |
| 59 | + jQuery.getJSON(storyboardPath + '/tags/Storyboard/Stories.php?&number=' + t.currentPage + '', function(json) { |
| 60 | + |
| 61 | + t.pageAmount = json.pageAmount; |
| 62 | + t.stories.push(json); |
| 63 | + t.isLoading = false; |
| 64 | + |
| 65 | + jQuery("#storyboard-loading").remove(); |
| 66 | + |
| 67 | + t.display(); |
| 68 | + }); |
| 69 | +}; |
| 70 | + |
| 71 | +/** |
| 72 | + * Display method. |
| 73 | + * Creates the storyboard layout. |
| 74 | + */ |
| 75 | +Storyboard.prototype.display = function() { |
| 76 | + alert('display'); |
| 77 | +}; |
| 78 | + |
| 79 | +/** |
| 80 | + * Reload method. |
| 81 | + * Removes all stories from the storyboard and loads a new batch of stories. |
| 82 | + */ |
| 83 | +Storyboard.prototype.reload = function() { |
| 84 | + jQuery("#storyboard").html(""); |
| 85 | + this.stories = []; |
| 86 | + this.pageNumber = 0; |
| 87 | + this.loadAjax(); |
| 88 | +}; |
\ No newline at end of file |
Property changes on: trunk/extensions/Storyboard/tags/Storyboard/Storyboard.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 89 | + native |
Index: trunk/extensions/Storyboard/tags/Storyboard/Storyboard_body.php |
— | — | @@ -0,0 +1,41 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +/** |
| 5 | + * File holding the rendering function for the Storyboard tag. |
| 6 | + * |
| 7 | + * @file Storyboard_body.php |
| 8 | + * @ingroup Storyboard |
| 9 | + * |
| 10 | + * @author Jeroen De Dauw |
| 11 | + */ |
| 12 | + |
| 13 | +if ( !defined( 'MEDIAWIKI' ) ) { |
| 14 | + die( 'Not an entry point.' ); |
| 15 | +} |
| 16 | + |
| 17 | +class TagStoryboard { |
| 18 | + |
| 19 | + public static function render( $input, $args, $parser, $frame ) { |
| 20 | + global $wgOut, $wgJsMimeType, $egStoryboardScriptPath; |
| 21 | + |
| 22 | + $wgOut->addStyle($egStoryboardScriptPath . '/tags/Storyboard/Storyboard.css'); |
| 23 | + $wgOut->includeJQuery(); |
| 24 | + $wgOut->addScriptFile($egStoryboardScriptPath . '/tags/Storyboard/Storyboard.js'); |
| 25 | + |
| 26 | + $output = <<<END |
| 27 | +<script type="$wgJsMimeType">var storyboardPath = '$egStoryboardScriptPath';</script> |
| 28 | +<div id="storyboard"></div> |
| 29 | +<script type="$wgJsMimeType"> /*<![CDATA[*/ |
| 30 | + jQuery(document).ready(function(){ jQuery("p").click(function(){ jQuery(this).hide(); }); }); |
| 31 | + var storyboard = new Storyboard(); |
| 32 | + storyboard.loadAjax(); |
| 33 | +/*]]>*/ </script> |
| 34 | +END; |
| 35 | + |
| 36 | + return array($output, 'noparse' => 'true', 'isHTML' => 'true'); |
| 37 | + } |
| 38 | + |
| 39 | +} |
| 40 | + |
| 41 | + |
| 42 | + |
Property changes on: trunk/extensions/Storyboard/tags/Storyboard/Storyboard_body.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 43 | + native |
Index: trunk/extensions/Storyboard/tags/Storyboard/Stories.php |
— | — | @@ -0,0 +1,11 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +/** |
| 5 | + * Webservice for fetching stories from the Storyboard extension. |
| 6 | + * |
| 7 | + * @file Stories.php |
| 8 | + * @ingroup Storyboard |
| 9 | + * |
| 10 | + * @author Jeroen De Dauw |
| 11 | + */ |
| 12 | + |
Property changes on: trunk/extensions/Storyboard/tags/Storyboard/Stories.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 13 | + native |
Index: trunk/extensions/Storyboard/tags/Storysubmission/Storysubmission_body.php |
— | — | @@ -0,0 +1,26 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +/** |
| 5 | + * File holding the rendering function for the Storysubmission tag. |
| 6 | + * |
| 7 | + * @file Storysubmission_body.php |
| 8 | + * @ingroup Storyboard |
| 9 | + * |
| 10 | + * @author Jeroen De Dauw |
| 11 | + */ |
| 12 | + |
| 13 | +if ( !defined( 'MEDIAWIKI' ) ) { |
| 14 | + die( 'Not an entry point.' ); |
| 15 | +} |
| 16 | + |
| 17 | +class TagStorysubmission { |
| 18 | + |
| 19 | + // http://www.mediawiki.org/wiki/Manual:Forms |
| 20 | + // http://www.mediawiki.org/wiki/Manual:Hooks/UnknownAction |
| 21 | + public static function render( $input, $args, $parser, $frame ) { |
| 22 | + return <<<END |
| 23 | + |
| 24 | +END; |
| 25 | + } |
| 26 | + |
| 27 | +} |
\ No newline at end of file |
Property changes on: trunk/extensions/Storyboard/tags/Storysubmission/Storysubmission_body.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 28 | + native |