Skip to content

Commit

Permalink
Item8033: moved BrowserBoosterPlugin into foswiki namespace
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk/BrowserBoosterPlugin@1612 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
OliverKrueger authored and OliverKrueger committed Dec 27, 2008
1 parent 50346de commit b2aae35
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 38 deletions.
Expand Up @@ -13,7 +13,7 @@ After the plugin is enabled in configure, you do not need to do anything further

---++ Why do I want to use this extension?

There are at least to situations where this plugin helps you to boost the speed of your TWiki page loads.
There are at least to situations where this plugin helps you to boost the speed of your Wiki page loads.

1 Your client uses a Firefox2 browser
1 Your network has a high latency
Expand All @@ -25,31 +25,27 @@ On a network with a high latency every additional css or js file costs you an ad

---++ Installation Instructions

__Note:__ You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the TWiki server.
__Note:__ You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the server.

* [[http://twiki.org/p/pub/Plugins/%TOPIC%/%TOPIC%.zip][Download]] the ZIP file
* Unzip it in your twiki installation directory.
* Visit =configure= in your TWiki installation, and enable the plugin in the {Plugins} section.
* %X% This plugin needs at least TWiki 4.2.0 (Freetown) to work.
* [[http://foswiki.org/pub/Extensions/%TOPIC%/%TOPIC%.zip][Download]] the ZIP file
* Unzip it in your installation directory.
* Visit =configure= in your installation, and enable the plugin in the {Plugins} section.

---++ Plugin Info

Many thanks to the following contributors for supporting this work:
* TWiki:Main.AndreUlrich, [[http://www.kontextwork.de/][KontextWork]] for the idea and the collaboration on the first prototype
* TWiki:Main.MichaelDaum for bugfixes
* Foswiki:Main.AndreUlrich, <nop>KontextWork for the idea and the collaboration on the first prototype
* Foswiki:Main.MichaelDaum for bugfixes

| Plugin Author(s): | TWiki:Main.OliverKrueger |
| Copyright: | &copy; 2008, Wiki++, TWiki:Main.OliverKrueger |
| Plugin Author(s): | Foswiki:Main.OliverKrueger |
| Copyright: | &copy; 2008, Foswiki:Main.OliverKrueger |
| License: | [[http://www.gnu.org/licenses/gpl.html][GPL (Gnu General Public License)]] |
| Plugin Version: | %$VERSION% |
| Change History: | <!-- versions below in reverse order -->&nbsp; |
| 05 Jul 2008: | fix Bugs:Item5590, better handling of import urls, patch by [[TWiki:Main.MichaelDaum][MD]] |
| 27 Dec 2008: | moved to foswiki namespace |
| 05 Jul 2008: | fix Bugs:Item5590, better handling of import urls, patch by [[Foswiki:Main.MichaelDaum][MD]] |
| 07 Apr 2008: | initial version |
| Dependencies: | %$DEPENDENCIES% |
| Plugin Home: | http://twiki.org/cgi-bin/view/Plugins/BrowserBoosterPlugin |
| Feedback: | http://twiki.org/cgi-bin/view/Plugins/BrowserBoosterPluginDev |
| Appraisal: | http://twiki.org/cgi-bin/view/Plugins/BrowserBoosterPluginAppraisal |
| Plugin Home: | http://foswiki.org/Extensions/BrowserBoosterPlugin |

__Related Topics:__ [[%SYSTEMWEB%.Plugins][Plugins]], %SYSTEMWEB%.DeveloperDocumentationCategory, %SYSTEMWEB%.AdminDocumentationCategory, %SYSTEMWEB%.DefaultPreferences, %USERSWEB%.SitePreferences

<!-- Do _not_ attempt to edit this topic; it is auto-generated. Please add comments/questions/remarks to the feedback topic on twiki.org instead. -->
<!-- Do _not_ attempt to edit this topic; it is auto-generated. Please add comments/questions/remarks to the feedback topic on foswiki.org instead. -->
@@ -1,6 +1,6 @@
# Plugin for Foswiki - The Free and Open Source Wiki, http://foswiki.org/
#
# Copyright (C) 2008 Oliver Krueger, Wiki++
# Copyright (C) 2008 Oliver Krueger <oliver@wiki-one.net>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
Expand All @@ -12,17 +12,17 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# For licensing info read LICENSE file in the TWiki root.
package TWiki::Plugins::BrowserBoosterPlugin;
package Foswiki::Plugins::BrowserBoosterPlugin;

use strict;

require TWiki::Func; # The plugins API
require TWiki::Plugins; # For the API version
require Foswiki::Func; # The plugins API
require Foswiki::Plugins; # For the API version

use vars qw( $VERSION $RELEASE $SHORTDESCRIPTION $pluginName $NO_PREFS_IN_TOPIC );

$VERSION = '$Rev$';
$RELEASE = '1.01';
$RELEASE = '2008-12-27';
$SHORTDESCRIPTION = 'Embeds js and css files into the page to reduce the number of http objects.';
$NO_PREFS_IN_TOPIC = 1;
$pluginName = 'BrowserBoosterPlugin';
Expand All @@ -33,8 +33,8 @@ sub initPlugin {
my( $topic, $web, $user, $installWeb ) = @_;

# check for Plugins.pm versions
if( $TWiki::Plugins::VERSION < 1.2 ) {
TWiki::Func::writeWarning( "Version mismatch between $pluginName and Plugins.pm" );
if( $Foswiki::Plugins::VERSION < 1.2 ) {
Foswiki::Func::writeWarning( "Version mismatch between $pluginName and Plugins.pm" );
return 0;
}

Expand All @@ -45,7 +45,7 @@ sub initPlugin {
sub completePageHandler {
#my ( $text, $header ) = @_;

TWiki::Func::writeDebug( "- ${pluginName}::completePageHandler()" ) if DEBUG;
Foswiki::Func::writeDebug( "- ${pluginName}::completePageHandler()" ) if DEBUG;

# import javascript
$_[0] =~ s/(<script\s+type=.text\/javascript.\s+src=[^>]+><\/script>)/&importJavascript($1)/gei;
Expand Down Expand Up @@ -78,7 +78,7 @@ sub importJavascript {
$text =~ m/src=["'](.*?)["']/i;
my $file = $1;
my $src = $1;
$file =~ s/.*$TWiki::cfg{PubUrlPath}/$TWiki::cfg{PubDir}/g;
$file =~ s/.*$Foswiki::cfg{PubUrlPath}/$Foswiki::cfg{PubDir}/g;

# read file
my $fileContent = readFile( $file );
Expand All @@ -98,8 +98,8 @@ sub parseStylesheet {

sub rewriteUrls {
my ( $css, $base ) = @_;
my $host = $TWiki::cfg{DefaultUrlHost};
my $pub = $TWiki::cfg{PubUrlPath};
my $host = $Foswiki::cfg{DefaultUrlHost};
my $pub = $Foswiki::cfg{PubUrlPath};

# rewrite /my/path/file.css
$css =~ s/url\(["']?\/([^;]*?)["']?\)/url('$host\/$1')/g;
Expand All @@ -114,7 +114,7 @@ sub importStylesheet {
my ( $url, $prefix, $suffix ) = @_;
my $retval = "";
my $file = $url;
$file =~ s/.*$TWiki::cfg{PubUrlPath}/$TWiki::cfg{PubDir}/g;
$file =~ s/.*$Foswiki::cfg{PubUrlPath}/$Foswiki::cfg{PubDir}/g;

if ( $file ) {
my $fileContent = readFile( $file );
Expand Down
Empty file.
4 changes: 4 additions & 0 deletions lib/Foswiki/Plugins/BrowserBoosterPlugin/MANIFEST
@@ -0,0 +1,4 @@
# Release manifest for BrowserBoosterPlugin
data/System/BrowserBoosterPlugin.txt 0644 Documentation
lib/Foswiki/Plugins/BrowserBoosterPlugin.pm 0644 Perl module

5 changes: 0 additions & 5 deletions lib/TWiki/Plugins/BrowserBoosterPlugin/DEPENDENCIES

This file was deleted.

4 changes: 0 additions & 4 deletions lib/TWiki/Plugins/BrowserBoosterPlugin/MANIFEST

This file was deleted.

0 comments on commit b2aae35

Please sign in to comment.