Skip to content

Commit

Permalink
Item8514: using ZonePlugin and shipping minified and compressed css now
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk/MediaWikiTablePlugin@6299 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
MichaelDaum authored and MichaelDaum committed Feb 12, 2010
1 parent b8b82c4 commit 16e3f43
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 23 deletions.
3 changes: 2 additions & 1 deletion data/System/MediaWikiTablePlugin.txt
Expand Up @@ -1230,11 +1230,12 @@ Wiki markup like <code>_text_</code> instead of "font-style:italic".
* Set SHORTDESCRIPTION = Format tables the <nop>MediaWiki way
-->
| Plugin Author: | Michael Daum |
| Copyright &copy;: | 2006-2009, Michael Daum http://michaeldaumconsulting.com |
| Copyright &copy;: | 2006-2010, Michael Daum http://michaeldaumconsulting.com |
| License: | GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]]) |
| Release: | %$RELEASE% |
| Version: | %$VERSION% |
| Change History: | <!-- versions below in reverse order -->&nbsp; |
| 12 Feb 2010: | using Foswiki:Extensions/ZonePlugin to add css to the page; shipping minified and gziped css now |
| 19 Feb 2009: | converted to foswiki |
| 08 Jan 2009: | certified on foswiki/compat |
| 17 Jul 2008: | fixed some Wikipedia:Mojibake in documentation |
Expand Down
29 changes: 10 additions & 19 deletions lib/Foswiki/Plugins/MediaWikiTablePlugin.pm
@@ -1,6 +1,6 @@
# Plugin for Foswiki - The Free and Open Source Wiki, http://foswiki.org/
#
# Copyright (C) 2006-2009 Michael Daum http://michaeldaumconsulting.com
# Copyright (C) 2006-2010 Michael Daum http://michaeldaumconsulting.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
Expand All @@ -15,38 +15,29 @@
package Foswiki::Plugins::MediaWikiTablePlugin;

use strict;
use vars qw(
$VERSION $RELEASE $NO_PREFS_IN_TOPIC $SHORTDESCRIPTION
$doneHeader $header
);

$VERSION = '$Rev$';
$RELEASE = 'v1.20';
$NO_PREFS_IN_TOPIC = 1;
$SHORTDESCRIPTION = 'Format tables the <nop>MediaWiki way';

$header = <<'HERE';
<link rel="stylesheet" href="%PUBURLPATH%/%SYSTEMWEB%/MediaWikiTablePlugin/style.css" type="text/css" media="all" />
HERE
use Foswiki::Func ();
our $VERSION = '$Rev$';
our $RELEASE = 'v1.21';
our $NO_PREFS_IN_TOPIC = 1;
our $SHORTDESCRIPTION = 'Format tables the <nop>MediaWiki way';
our $doneInit = 0;

###############################################################################
sub initPlugin {
$doneHeader = 0;
$doneInit = 0;
return 1;
}

###############################################################################
sub commonTagsHandler {
# text, topic, web
# text, topic, web
handleMWTable($_[2], $_[1], $_[0]) if $_[0] =~ /(^|[\n\r])\s*{\|/;

return if $doneHeader;
$doneHeader = 1 if $_[0] =~ s/<head>(.*?[\r\n]+)/<head>$1$header/o;
}

###############################################################################
sub handleMWTable {
require Foswiki::Plugins::MediaWikiTablePlugin::Core;
Foswiki::Plugins::MediaWikiTablePlugin::Core::init() unless $doneInit;
return Foswiki::Plugins::MediaWikiTablePlugin::Core::handleMWTable(@_);
}

Expand Down
12 changes: 10 additions & 2 deletions lib/Foswiki/Plugins/MediaWikiTablePlugin/Core.pm
@@ -1,6 +1,6 @@
# Plugin for Foswiki - The Free and Open Source Wiki, http://foswiki.org/
#
# Copyright (C) 2006-2009 Michael Daum http://michaeldaumconsulting.com
# Copyright (C) 2006-2010 Michael Daum http://michaeldaumconsulting.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
Expand All @@ -15,7 +15,7 @@
package Foswiki::Plugins::MediaWikiTablePlugin::Core;

use strict;

use Foswiki::Func ();
use constant DEBUG => 0; # toggle me

###############################################################################
Expand All @@ -24,6 +24,14 @@ sub writeDebug {
print STDERR '- MediaWikiTablePlugin::Core - '.$_[0]."\n" if DEBUG;
}

###############################################################################
sub init {
Foswiki::Func::addToZone('head', 'MEDIAWIKITABLEPLUGIN:CSS', <<'HERE');
<link rel="stylesheet" href="%PUBURLPATH%/%SYSTEMWEB%/MediaWikiTablePlugin/style.css" type="text/css" media="all" />
HERE
}
}

###############################################################################
sub handleMWTable {
my $web = shift;
Expand Down
2 changes: 2 additions & 0 deletions lib/Foswiki/Plugins/MediaWikiTablePlugin/DEPENDENCIES
@@ -0,0 +1,2 @@
Foswiki::Plugins::ZonePlugin,>=1.0,perl,Required

5 changes: 4 additions & 1 deletion lib/Foswiki/Plugins/MediaWikiTablePlugin/MANIFEST
@@ -1,5 +1,8 @@
data/System/MediaWikiTablePlugin.txt 0644
lib/Foswiki/Plugins/MediaWikiTablePlugin/Core.pm 0644
lib/Foswiki/Plugins/MediaWikiTablePlugin.pm 0644
pub/System/MediaWikiTablePlugin/style.css 0644
pub/System/MediaWikiTablePlugin/Makefile 0644
pub/System/MediaWikiTablePlugin/styles.css 0644
pub/System/MediaWikiTablePlugin/styles.css.gz 0644
pub/System/MediaWikiTablePlugin/styles.uncompressed.css 0644
pub/System/MediaWikiTablePlugin/wikiringlogo40x40.png 0644
4 changes: 4 additions & 0 deletions pub/System/MediaWikiTablePlugin/Makefile
@@ -0,0 +1,4 @@
FOSWIKI_ROOT=~/foswiki/trunk/core
TARGET=styles.css

-include $(FOSWIKI_ROOT)/pub/System/JQueryPlugin/Makefile.include
2 changes: 2 additions & 0 deletions pub/System/MediaWikiTablePlugin/styles.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added pub/System/MediaWikiTablePlugin/styles.css.gz
Binary file not shown.
File renamed without changes.

0 comments on commit 16e3f43

Please sign in to comment.